Skip to content

feat: add Stellar account asset info RPC#81

Merged
khanti42 merged 13 commits into
mainfrom
feat/stellar-account-asset-info
Jun 3, 2026
Merged

feat: add Stellar account asset info RPC#81
khanti42 merged 13 commits into
mainfrom
feat/stellar-account-asset-info

Conversation

@khanti42
Copy link
Copy Markdown
Contributor

Explanation

Explanation

Adds support for the custom keyring_getAccountAssetInfo RPC to expose fungible asset metadata together with Stellar classic trustline-specific fields (limit, authorized, sponsored) when available.

This PR also improves change-trust transaction tracking by passing trustline verification metadata into the background tracking flow and delaying transaction confirmation until Horizon reflects the expected trustline state. This avoids race conditions where Soroban confirms the transaction before Horizon indexing is updated.

To support this, retry and delay logic was added around Horizon trustline verification after transaction confirmation.

Additional tests were added covering:

  • keyring_getAccountAssetInfo RPC behavior
  • trustline extra field serialization
  • request routing
  • error handling
  • Horizon trustline synchronization and verification flow

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

@khanti42 khanti42 requested a review from a team as a code owner May 27, 2026 13:25
@khanti42
Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Copy Markdown

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/stellar-wallet-snap@0.0.1-preview-e169e16

@khanti42
Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@khanti42
Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Copy Markdown

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/stellar-wallet-snap@0.0.1-preview-56dc705

Comment thread packages/snap/src/handlers/clientRequest/getAccountAssetInfo.ts Outdated
Comment thread packages/snap/src/services/account-asset-info/AccountAssetInfoService.ts Outdated
Comment thread packages/snap/src/handlers/cronjob/trackTransaction.ts Outdated
Comment thread packages/snap/src/handlers/clientRequest/getAccountAssetInfo.ts Outdated
Comment thread packages/snap/src/services/account-asset-info/api.ts Outdated
Comment thread packages/snap/src/handlers/clientRequest/getAccountAssetInfo.ts Outdated
Comment thread packages/snap/src/handlers/clientRequest/getAccountAssetInfo.ts Outdated
Comment thread packages/snap/src/services/account-asset-info/api.ts Outdated
const assetData =
onChainAccount === null
? undefined
: onChainAccount.getRawAsset(assetId);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

plz put why we use getRawAsset rather than getAsset

Comment thread packages/snap/src/handlers/clientRequest/getAccountAssetInfo.ts Outdated
Comment thread packages/snap/src/handlers/clientRequest/getAccountAssetInfo.ts Outdated
Comment thread packages/snap/src/handlers/clientRequest/getAccountAssetInfo.ts
Comment thread packages/snap/src/handlers/clientRequest/getAccountAssetInfo.ts Outdated
@khanti42 khanti42 merged commit fa96e01 into main Jun 3, 2026
10 checks passed
@khanti42 khanti42 deleted the feat/stellar-account-asset-info branch June 3, 2026 10:50
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

Successfully merging this pull request may close these issues.

2 participants