Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Balance for Other Wallets Fixes #291 #293

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

arnavmehta7
Copy link

@arnavmehta7 arnavmehta7 commented Feb 7, 2025

Fixes #291
Added ability to fetch other wallet's balances if some specific address is supplied in prompt

Pros:

  • Supports Previous Implementation
  • Allows checking info for more wallets/external wallets

Example SS:
image

@cb-heimdall
Copy link

cb-heimdall commented Feb 7, 2025

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 1
Sum 2

@arnavmehta7 arnavmehta7 changed the title changed logic to support both current wallet + other wallets which us… Get Balance for Other Wallets Fixes #291 Feb 7, 2025
@0xRAG 0xRAG added enhancement New feature or request needs review PR / issue needs review banana labels Feb 10, 2025
Copy link
Contributor

@0xRAG 0xRAG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @arnavmehta7! Please see my comments

from pydantic import BaseModel, Field

from cdp_agentkit_core.actions import CdpAction

GET_BALANCE_PROMPT = """
This tool will get the balance of all the addresses in the wallet for a given asset.
This tool will get the balance of address.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see suggestion

Suggested change
This tool will get the balance of address.
This tool will get the balance of all the addresses in the wallet for a given asset, or for a user-specified address if provided.

@@ -18,10 +19,14 @@ class GetBalanceInput(BaseModel):
...,
description="The asset ID to get the balance for, e.g. `eth`, `0x036CbD53842c5426634e7929541eC2318f3dCF7e`",
)
address_to_fund: Optional[str] = Field(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: rename to just address

@@ -18,10 +19,14 @@ class GetBalanceInput(BaseModel):
...,
description="The asset ID to get the balance for, e.g. `eth`, `0x036CbD53842c5426634e7929541eC2318f3dCF7e`",
)
address_to_fund: Optional[str] = Field(
None,
description="The address to fund. If not provided, the default address of the wallet will be used.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see suggestion

Suggested change
description="The address to fund. If not provided, the default address of the wallet will be used.",
description="The address to get the balance for. If not provided, addresses of the wallet will be used.",



def get_balance(wallet: Wallet, asset_id: str) -> str:
"""Get balance for all addresses in the wallet for a given asset.
def get_balance(wallet: Wallet, asset_id: str, address_to_fund: Optional[str]) -> str:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: rename to just address

@0xRAG 0xRAG added changes requested PR / Issue has changes requested and removed needs review PR / issue needs review labels Feb 11, 2025
@cb-heimdall
Copy link

Review Error for 0xRAG @ 2025-02-11 15:41:15 UTC
User failed mfa authentication, public email is not set on your github profile. see go/mfa-help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
banana changes requested PR / Issue has changes requested enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

Get Balances for addresses over network other than system's wallet
3 participants