Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions packages/assets-controller/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@ destroy()
// Per-account balances
assetsBalance: {
"account-uuid-1": {
"eip155:1/slip44:60": { amount: "1000000000000000000" },
"eip155:1/erc20:0xA0b8...": { amount: "1000000" },
"eip155:1/slip44:60": { amount: "1" },
"eip155:1/erc20:0xA0b8...": { amount: "1" },
},
"account-uuid-2": { ... },
},
Expand Down Expand Up @@ -411,7 +411,7 @@ const balances = await messenger.call(
Record<AccountId, Record<Caip19AssetId, AssetBalance>>;

interface AssetBalance {
amount: string; // Raw amount as string (e.g., "1000000000000000000" for 1 ETH)
amount: string; // Converted amount (e.g., "1" for 1 ETH)
}
```

Expand All @@ -427,7 +427,7 @@ const balances = await messenger.call(
},
);

// Get raw ETH balance
// Get ETH balance
const ethBalance = balances[accountId]['eip155:1/slip44:60'].amount;
```

Expand Down Expand Up @@ -536,7 +536,7 @@ await messenger.call(
{
assetsBalance: {
'account-uuid-1': {
'eip155:1/slip44:60': { amount: '1000000000000000000' },
'eip155:1/slip44:60': { amount: '1' },
},
},
},
Expand Down Expand Up @@ -589,8 +589,8 @@ messenger.subscribe('AssetsController:balanceChanged', (event) => {
{
accountId: AccountId; // Account UUID
assetId: Caip19AssetId; // "eip155:1/slip44:60"
previousAmount: string; // "1000000000000000000"
newAmount: string; // "2000000000000000000"
previousAmount: string; // "1"
newAmount: string; // "2"
}
```

Expand Down
2 changes: 1 addition & 1 deletion packages/assets-controller/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export type AssetPrice = FungibleAssetPrice | NFTAssetPrice;
* Balance data for fungible tokens (native, ERC20, SPL).
*/
export type FungibleAssetBalance = {
/** Raw balance amount as string (e.g., "1000000000" for 1000 USDC) */
/** Converted balance amount (e.g., "1000" for 1000 USDC) */
amount: string;
/**
* Network-specific balance fields, when the source provides them. Stellar
Expand Down
Loading