Add address fetch method
Browse files
src/tools/crypto_wallet_toolkit.py
CHANGED
|
@@ -8,6 +8,7 @@ class CryptoWalletTools(Toolkit):
|
|
| 8 |
super().__init__(name="crypto_wallet_tools")
|
| 9 |
|
| 10 |
# Registering methods to make them accessible via the toolkit
|
|
|
|
| 11 |
self.register(self.create_crypto_wallet)
|
| 12 |
|
| 13 |
def create_crypto_wallet(self, user_email: str) -> str:
|
|
@@ -34,9 +35,9 @@ class CryptoWalletTools(Toolkit):
|
|
| 34 |
response = asyncio.run(rpc_call(method_name="createLocalWallet", params=params))
|
| 35 |
return f"{response}"
|
| 36 |
|
| 37 |
-
def
|
| 38 |
"""
|
| 39 |
-
Fetches the crypto wallet account for the given user email.
|
| 40 |
|
| 41 |
Parameters:
|
| 42 |
user_email (str): The email of the user for whom the wallet is being fetched.
|
|
@@ -55,7 +56,7 @@ class CryptoWalletTools(Toolkit):
|
|
| 55 |
params = {
|
| 56 |
'userEmail': user_email,
|
| 57 |
}
|
| 58 |
-
response = asyncio.run(rpc_call(method_name="
|
| 59 |
return f"{response}"
|
| 60 |
|
| 61 |
|
|
|
|
| 8 |
super().__init__(name="crypto_wallet_tools")
|
| 9 |
|
| 10 |
# Registering methods to make them accessible via the toolkit
|
| 11 |
+
self.register(self.get_crypto_wallet_address)
|
| 12 |
self.register(self.create_crypto_wallet)
|
| 13 |
|
| 14 |
def create_crypto_wallet(self, user_email: str) -> str:
|
|
|
|
| 35 |
response = asyncio.run(rpc_call(method_name="createLocalWallet", params=params))
|
| 36 |
return f"{response}"
|
| 37 |
|
| 38 |
+
def get_crypto_wallet_address(self, user_email: str) -> str:
|
| 39 |
"""
|
| 40 |
+
Fetches the crypto wallet account addresse for the given user email.
|
| 41 |
|
| 42 |
Parameters:
|
| 43 |
user_email (str): The email of the user for whom the wallet is being fetched.
|
|
|
|
| 56 |
params = {
|
| 57 |
'userEmail': user_email,
|
| 58 |
}
|
| 59 |
+
response = asyncio.run(rpc_call(method_name="getLocalWalletAddress", params=params))
|
| 60 |
return f"{response}"
|
| 61 |
|
| 62 |
|