-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More interesting prompts for NFT agents
- Loading branch information
Showing
4 changed files
with
115 additions
and
82 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
prediction_market_agent/agents/microchain_agent/balance_functions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from microchain import Function | ||
from prediction_market_agent_tooling.gtypes import ChecksumAddress | ||
from prediction_market_agent_tooling.tools.balances import get_balances | ||
|
||
from prediction_market_agent.utils import APIKeys | ||
|
||
|
||
class GetOtherWalletXDAIBalance(Function): | ||
@property | ||
def description(self) -> str: | ||
return f"Use this function to fetch xDai and wxDai balance of someone else given his wallet address." | ||
|
||
@property | ||
def example_args(self) -> list[str]: | ||
return ["0xSomeAddress"] | ||
|
||
def __call__(self, wallet_address: ChecksumAddress) -> str: | ||
balances = get_balances(wallet_address) | ||
return f"Balance of {wallet_address} is {balances.xdai} xDai and {balances.wxdai} wxDai." | ||
|
||
|
||
class GetMyXDAIBalance(Function): | ||
@property | ||
def description(self) -> str: | ||
return f"Use this function to fetch your xDai and wxDai balance." | ||
|
||
@property | ||
def example_args(self) -> list[str]: | ||
return [] | ||
|
||
def __call__(self) -> str: | ||
balances = get_balances(APIKeys().bet_from_address) | ||
return f"You have {balances.xdai} xDai and {balances.wxdai} wxDai." | ||
|
||
|
||
BALANCE_FUNCTIONS: list[type[Function]] = [GetOtherWalletXDAIBalance, GetMyXDAIBalance] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters