Skip to content

feat: Add accounts/{}/foreign-asset-balances#1834

Merged
andrew-ifrita merged 6 commits into
masterfrom
feat/foreign-asset-balances
Nov 25, 2025
Merged

feat: Add accounts/{}/foreign-asset-balances#1834
andrew-ifrita merged 6 commits into
masterfrom
feat/foreign-asset-balances

Conversation

@andrew-ifrita

Copy link
Copy Markdown
Contributor

Sidecar currently lacks a means to query the foreign asset balances for an account

Discussion

Should this be a separate endpoint?

Should this be seamlessly integrated with the asset-balances call instead?

Comment thread src/services/accounts/AccountsForeignAssetsService.ts Outdated
@andrew-ifrita andrew-ifrita force-pushed the feat/foreign-asset-balances branch from c851e0d to aa307b2 Compare November 24, 2025 12:21
Comment thread src/services/accounts/AccountsForeignAssetsService.ts Outdated
Comment thread src/services/accounts/AccountsForeignAssetsService.ts Outdated
@andrew-ifrita andrew-ifrita marked this pull request as ready for review November 24, 2025 13:01
@andrew-ifrita andrew-ifrita requested a review from a team as a code owner November 24, 2025 13:01

@filvecchiato filvecchiato left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looking nice! one minor nit about isFrozen

Comment thread src/services/accounts/AccountsForeignAssetsService.ts Outdated
*
* @param entries Foreign asset storage entries
*/
extractMultiLocationsFromAssetEntries(entries: [StorageKey<AnyTuple>, unknown][]): AnyJson[] {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
extractMultiLocationsFromAssetEntries(entries: [StorageKey<AnyTuple>, unknown][]): AnyJson[] {
extractMultiLocationsFromAssetEntries(entries: [[StorageKey<AnyTuple>, unknown][]](entries: [StorageKey<[StagingXcmV5Location]>, Option<PalletAssetsAssetDetails>][])): StagingXcmV5Location[] {

Then you can access the storageKey via: storageKey.args[0], and you can return the actual type here as StagingXcmV5Location[]

Comment thread src/services/accounts/AccountsForeignAssetsService.ts Outdated
Comment thread src/services/accounts/AccountsForeignAssetsService.ts Outdated

@TarikGul TarikGul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall, great PR. Just some typings need to be changed in order to clear up all the type castings and eslint ignores.

@TarikGul

Copy link
Copy Markdown
Member

Also docsv2/ needs to be updated with the new endpoint.

@andrew-ifrita

Copy link
Copy Markdown
Contributor Author

Also docsv2/ needs to be updated with the new endpoint.

Yeah good call. Added in 6833fe2

Using XcmVersionedLocation now.
@andrew-ifrita andrew-ifrita force-pushed the feat/foreign-asset-balances branch from 6bc9fb6 to 4b2f027 Compare November 25, 2025 13:22

@TarikGul TarikGul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Changes going in look good so far! 🚀 Going to give this a check as to not block.

@andrew-ifrita andrew-ifrita merged commit 1772e85 into master Nov 25, 2025
14 checks passed
@andrew-ifrita andrew-ifrita deleted the feat/foreign-asset-balances branch November 25, 2025 13:35
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.

3 participants