Skip to content

Commit ea4fde3

Browse files
authored
Merge pull request #77 from pattern-tech/refactor/ai-v2
Fix cursor handling and rename wallet history function
2 parents 6b61a34 + 4cd9ae7 commit ea4fde3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/agentflow/providers/moralis_tools.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def get_wallet_token_balances(wallet_address: str, chain: str, output_include: l
7373
final_results.append({item: result[item]
7474
for item in result.keys() if item in output_include})
7575

76-
return {"cursor": api_result["cursor"],
76+
return {"cursor": api_result.get(["cursor"], None),
7777
"results": final_results}
7878

7979

@@ -114,7 +114,7 @@ def get_wallet_stats(wallet_address: str, chain: str, output_include: list[str])
114114

115115
@tool
116116
@handle_exceptions
117-
def get_wallet_history(wallet_address: str, chain: str, output_include: list[str], cursor: str = "") -> dict:
117+
def get_wallet_transactions(wallet_address: str, chain: str, output_include: list[str], cursor: str = "") -> dict:
118118
"""
119119
Retrieve the full transaction history of a specified wallet address, including sends, receives, token and NFT transfers
120120
and contract interactions in a specific chain. (paginated & in descending order)
@@ -157,7 +157,7 @@ def get_wallet_history(wallet_address: str, chain: str, output_include: list[str
157157
final_results.append({item: result[item]
158158
for item in result.keys() if item in output_include})
159159

160-
return {"cursor": api_result["cursor"],
160+
return {"cursor": api_result.get(["cursor"], None),
161161
"results": final_results}
162162

163163

@@ -250,5 +250,5 @@ def get_token_approvals(wallet_address: str, chain: str, output_include: list[st
250250
final_results.append({item: result[item]
251251
for item in result.keys() if item in output_include})
252252

253-
return {"cursor": api_result["cursor"],
253+
return {"cursor": api_result.get(["cursor"], None),
254254
"results": final_results}

0 commit comments

Comments
 (0)