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

Implement addressIndexes parameter in the getBalances RPC #6

Open
5 tasks
andreabadesso opened this issue Aug 2, 2024 · 0 comments
Open
5 tasks

Implement addressIndexes parameter in the getBalances RPC #6

andreabadesso opened this issue Aug 2, 2024 · 0 comments

Comments

@andreabadesso
Copy link
Collaborator

andreabadesso commented Aug 2, 2024

We didn't implement this in the part 2 of the RPC implementation because we don't have a single method that returns a GetBalanceObject for a token in a given address

We could do multiple calls on existing methods, but I think the ideal would be to have this method in the lib.

This is the GetBalanceObject type:

export interface GetBalanceObject {
    token: TokenInfo;
    balance: Balance;
    tokenAuthorities: AuthoritiesBalance;
    transactions: number;
    lockExpires: number | null;
}
  • token(TokenInfo): We can get it using wallet.getTokenDetails(token);
  • balance(Balance): We can get it using await wallet.getAddressInfo(address, { token })
  • tokenAuthorities(AuthoritiesBalance): This is a hard one, we do have a method to get the authority utxos for a given token (getAuthorityUtxos), but we don't have a mechanism for filtering authorities for a given address. My suggestion would be to refactor getMintAuthority and getMeltAuthority to accept an option filter_method which would be passed down to this.store.selectUtxos as a UtxoFilterOptions option. We would have to implement it in the new facade differently, probably using the same method in the wallet-service lambda.
  • transactions: this comes from the getTokenDetails method.
  • lockExpires: I'm not sure, would require a deeper investigation, I couldn't find a method that returns lockExpires for a given address and token
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant