@metamask-previews/core-backend 10.0.1-preview-429f77222 → 10.0.1-preview-95104ffdb
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Add optional `metadata` to `V5BalanceItem` and to the Account Activity `Balance` type ([#10194](https://github.com/MetaMask/core/pull/10194))
|
|
13
|
+
- Add optional `sponsored`, `spendableBalance`, and `minimumReserveBalance` Stellar fields to `V6TokenMetadata` ([#10194](https://github.com/MetaMask/core/pull/10194))
|
|
14
|
+
|
|
10
15
|
### Changed
|
|
11
16
|
|
|
12
17
|
- Bump `@metamask/profile-sync-controller` from `^32.0.0` to `^32.1.0` ([#10184](https://github.com/MetaMask/core/pull/10184))
|
|
@@ -13,6 +13,11 @@ export type V5BalanceItem = {
|
|
|
13
13
|
assetId: string;
|
|
14
14
|
balance: string;
|
|
15
15
|
accountId: string;
|
|
16
|
+
/**
|
|
17
|
+
* Token-level metadata such as Stellar trustline / native reserve fields.
|
|
18
|
+
* Present when the upstream balance row carries it.
|
|
19
|
+
*/
|
|
20
|
+
metadata?: V6TokenMetadata;
|
|
16
21
|
};
|
|
17
22
|
/** V5 Multi-account balances response */
|
|
18
23
|
export type V5BalancesResponse = {
|
|
@@ -77,14 +82,21 @@ export type V6BalanceMetadata = {
|
|
|
77
82
|
groupId: string;
|
|
78
83
|
};
|
|
79
84
|
/**
|
|
80
|
-
* Token-level metadata attached to an `object: token` row in the v6
|
|
81
|
-
*
|
|
85
|
+
* Token-level metadata attached to an `object: token` row in the v5/v6
|
|
86
|
+
* balances responses, e.g. Stellar trustline and native reserve metadata.
|
|
87
|
+
* Additional keys may be present.
|
|
82
88
|
*/
|
|
83
89
|
export type V6TokenMetadata = {
|
|
84
90
|
/** Stellar trustline limit. */
|
|
85
91
|
limit?: string;
|
|
86
92
|
/** Whether the Stellar trustline is authorized. */
|
|
87
93
|
authorized?: boolean;
|
|
94
|
+
/** Whether the Stellar trustline is sponsored. */
|
|
95
|
+
sponsored?: boolean;
|
|
96
|
+
/** Stellar native spendable balance (unscaled stroops). */
|
|
97
|
+
spendableBalance?: string;
|
|
98
|
+
/** Stellar native minimum / reserve balance (unscaled stroops). */
|
|
99
|
+
minimumReserveBalance?: string;
|
|
88
100
|
[key: string]: unknown;
|
|
89
101
|
};
|
|
90
102
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/api/accounts/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAMnD,wCAAwC;AACxC,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/api/accounts/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAMnD,wCAAwC;AACxC,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAA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,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;CACxC,CAAC;AAEF,oBAAoB;AACpB,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAMF,2BAA2B;AAC3B,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,sBAAsB;AACtB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,kBAAkB,EAAE,CAAC;CAC5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/api/accounts/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/api/accounts/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,SAAS;IACT,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,YAAY;CACJ,CAAC","sourcesContent":["/**\n * Accounts API types for the API Platform Client.\n * API: accounts.api.cx.metamask.io\n */\n\nimport type { PageInfo } from '../shared-types.js';\n\n// ============================================================================\n// BALANCE TYPES\n// ============================================================================\n\n/** V5 Balance Item from Accounts API */\nexport type V5BalanceItem = {\n object: 'token';\n symbol: string;\n name: string;\n type: 'native' | 'erc20';\n decimals: number;\n assetId: string;\n balance: string;\n accountId: string;\n /**\n * Token-level metadata such as Stellar trustline / native reserve fields.\n * Present when the upstream balance row carries it.\n */\n metadata?: V6TokenMetadata;\n};\n\n/** V5 Multi-account balances response */\nexport type V5BalancesResponse = {\n count: number;\n unprocessedNetworks: string[];\n balances: V5BalanceItem[];\n};\n\n/** V2 Balance item */\nexport type V2BalanceItem = {\n object: string;\n type?: string;\n timestamp?: string;\n address: string;\n symbol: string;\n name: string;\n decimals: number;\n chainId: number;\n balance: string;\n accountAddress?: string;\n};\n\n/** V2 Balances response */\nexport type V2BalancesResponse = {\n count: number;\n balances: V2BalanceItem[];\n unprocessedNetworks: number[];\n};\n\n/** V4 Multi-account balances response */\nexport type V4BalancesResponse = {\n count: number;\n balances: V2BalanceItem[];\n unprocessedNetworks: number[];\n};\n\n/**\n * Quote currency accepted by the v6 balances endpoint when `includePrices` is\n * true. A superset of {@link SupportedCurrency} (adds e.g. `sol`, `xdr`,\n * `xag`, `xau`, `bits`, `sats`). Defaults to `usd`.\n */\nexport type V6VsCurrency = string;\n\n/**\n * Possible `positionType` values on DeFi rows in the v6 balances response.\n * Categorizes the protocol module where the position is held.\n * Link here: https://developers.zerion.io/api-reference/wallets/get-wallet-fungible-positions#parameter-filter-position-types\n */\nexport const V6_DEFI_POSITION_TYPES = [\n 'deposit',\n 'loan',\n 'locked',\n 'staked',\n 'reward',\n 'wallet',\n 'investment',\n] as const;\n\n/**\n * The specific module or functionality within a DeFi protocol where a position\n * is held.\n */\nexport type V6DeFiPositionType = (typeof V6_DEFI_POSITION_TYPES)[number];\n\n/**\n * DeFi protocol metadata attached to an `object: defi` row in the v6 balances\n * response (`BalanceMetadataV3ResponseDto`).\n */\nexport type V6BalanceMetadata = {\n protocolId: string;\n productName: string;\n description: string;\n protocolUrl: string;\n protocolIconUrl?: string;\n positionType: V6DeFiPositionType;\n poolAddress: string;\n groupId: string;\n};\n\n/**\n * Token-level metadata attached to an `object: token` row in the v5/v6\n * balances responses, e.g. Stellar trustline and native reserve metadata.\n * Additional keys may be present.\n */\nexport type V6TokenMetadata = {\n /** Stellar trustline limit. */\n limit?: string;\n /** Whether the Stellar trustline is authorized. */\n authorized?: boolean;\n /** Whether the Stellar trustline is sponsored. */\n sponsored?: boolean;\n /** Stellar native spendable balance (unscaled stroops). */\n spendableBalance?: string;\n /** Stellar native minimum / reserve balance (unscaled stroops). */\n minimumReserveBalance?: string;\n [key: string]: unknown;\n};\n\n/**\n * A single balance row in the v6 balances response (`BalanceV3ResponseDto`).\n * `object: token` rows are token balances (and may carry\n * {@link V6TokenMetadata}, e.g. Stellar trustline info). `object: defi` rows\n * are flat DeFi positions and include {@link V6BalanceMetadata}.\n */\nexport type V6BalanceItem = {\n accountId: string;\n object: 'token' | 'defi';\n /** Asset standard reported by the network (for example `native` or `erc20`). */\n type: string;\n assetId: string;\n name: string;\n symbol: string;\n decimals: number;\n balance: string;\n /** Spot price in the requested `vsCurrency`. Present when `includePrices` is true. */\n price?: string;\n /** Asset metadata labels. Present when `includeLabels` is true. */\n labels?: string[];\n /** Canonical head asset ID. Present when `includeCanonicalHead` is true. */\n canonicalHead?: string;\n /**\n * DeFi protocol metadata for `object: defi` rows; token-level metadata such\n * as Stellar trustline info (e.g. `limit`, `authorized`) for `object: token`\n * rows.\n */\n metadata?: V6BalanceMetadata | V6TokenMetadata;\n};\n\n/**\n * V6 multi-account balances response (`MultiAccountBalancesV3ResponseDto`).\n */\nexport type V6BalancesResponse = {\n /** CAIP-2 networks that could not be processed for this request. */\n unprocessedNetworks: string[];\n /**\n * ERC-20 IDs from `includeAssetIds` that were not detected on any requested\n * account, plus other IDs that still need a client fallback flow.\n */\n unprocessedIncludeAssetIds: string[];\n /** Flat token and DeFi balance rows. */\n balances: V6BalanceItem[];\n /**\n * CAIP-10 account IDs whose DeFi positions are still being indexed upstream;\n * poll again shortly. DeFi balance rows for these accounts are omitted from\n * `balances` until indexing completes.\n */\n processingDefiPositions?: string[];\n};\n\n// ============================================================================\n// SUPPORTED NETWORKS TYPES\n// ============================================================================\n\n/** V1 Supported networks response */\nexport type V1SupportedNetworksResponse = {\n supportedNetworks: number[];\n};\n\n/** V2 Supported networks response */\nexport type V2SupportedNetworksResponse = {\n fullSupport: number[];\n partialSupport: {\n balances: number[];\n };\n};\n\n/** Active networks response */\nexport type V2ActiveNetworksResponse = {\n activeNetworks: string[];\n};\n\n// ============================================================================\n// TRANSACTION TYPES\n// ============================================================================\n\n/** Transaction by hash response */\nexport type V1TransactionByHashResponse = {\n hash: string;\n timestamp: string;\n chainId: number;\n blockNumber: number;\n blockHash: string;\n gas: number;\n gasUsed: number;\n gasPrice: string;\n effectiveGasPrice: string;\n nonce: number;\n cumulativeGasUsed: number;\n methodId?: string;\n value: string;\n to: string;\n from: string;\n isError?: boolean;\n valueTransfers?: {\n from: string;\n to: string;\n amount: string;\n decimal: number;\n contractAddress: string;\n symbol: string;\n name: string;\n transferType: string;\n }[];\n logs?: {\n data: string;\n topics: string[];\n address: string;\n logIndex: number;\n }[];\n transactionType?: string;\n transactionCategory?: string;\n transactionProtocol?: string;\n};\n\n/** Account transactions response */\nexport type V1AccountTransactionsResponse = {\n data: V1TransactionByHashResponse[];\n pageInfo: PageInfo;\n};\n\n/** V4 Multi-account transactions response */\nexport type V4MultiAccountTransactionsResponse = {\n unprocessedNetworks: string[];\n pageInfo: {\n count: number;\n hasNextPage: boolean;\n endCursor?: string;\n };\n data: V1TransactionByHashResponse[];\n};\n\n// ============================================================================\n// RELATIONSHIP TYPES\n// ============================================================================\n\n/**\n * Value transfer within a transaction\n */\nexport type ValueTransfer = {\n from: string;\n to: string;\n amount: string;\n decimal: number;\n transferType: string;\n};\n\n/**\n * Account address relationship result from v1 endpoint\n */\nexport type V1AccountRelationshipResult = {\n /** Transaction hash of the relationship */\n txHash?: string;\n /** Chain ID */\n chainId?: number;\n /** Number of interactions */\n count?: number;\n /** Transaction data details */\n data?: {\n hash: string;\n timestamp: string;\n chainId: number;\n blockNumber: number;\n blockHash: string;\n gas: number;\n gasUsed: number;\n gasPrice: string;\n effectiveGasPrice: string;\n nonce: number;\n cumulativeGasUsed: number;\n methodId: string;\n value: string;\n to: string;\n from: string;\n isError: boolean;\n valueTransfers: ValueTransfer[];\n logs: unknown[];\n transactionType: string;\n transactionCategory: string;\n readable: string;\n textFunctionSignature: string;\n };\n /** Error information when relationship lookup fails */\n error?: {\n code: string;\n message: string;\n };\n};\n\n// ============================================================================\n// NFT TYPES\n// ============================================================================\n\n/** NFT item */\nexport type NftItem = {\n tokenId: string;\n contractAddress: string;\n chainId: number;\n name?: string;\n description?: string;\n imageUrl?: string;\n attributes?: Record<string, unknown>[];\n};\n\n/** NFTs response */\nexport type V2NftsResponse = {\n data: NftItem[];\n pageInfo: PageInfo;\n};\n\n// ============================================================================\n// TOKEN DISCOVERY TYPES\n// ============================================================================\n\n/** Token discovery item */\nexport type TokenDiscoveryItem = {\n address: string;\n chainId: number;\n symbol: string;\n name: string;\n decimals: number;\n balance?: string;\n};\n\n/** Tokens response */\nexport type V2TokensResponse = {\n data: TokenDiscoveryItem[];\n};\n"]}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Json } from '@metamask/utils';
|
|
1
2
|
/**
|
|
2
3
|
* Basic transaction information
|
|
3
4
|
*/
|
|
@@ -36,6 +37,13 @@ export type Balance = {
|
|
|
36
37
|
amount: string;
|
|
37
38
|
/** Optional error message */
|
|
38
39
|
error?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Network-specific balance properties from Account Activity websocket
|
|
42
|
+
* messages. Stellar trustlines typically include `limit`, `authorized`, and
|
|
43
|
+
* optionally `sponsor` (sponsor address). This is the stream payload, not
|
|
44
|
+
* the Accounts API camelCase fields (`sponsored`, `spendableBalance`, …).
|
|
45
|
+
*/
|
|
46
|
+
metadata?: Json;
|
|
39
47
|
};
|
|
40
48
|
/**
|
|
41
49
|
* Transfer information
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MA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AAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,IAAI,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,wBAAwB;IACxB,KAAK,EAAE,KAAK,CAAC;IACb,+BAA+B;IAC/B,WAAW,EAAE,OAAO,CAAC;IACrB,uCAAuC;IACvC,SAAS,EAAE,QAAQ,EAAE,CAAC;CACvB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,sBAAsB;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,EAAE,EAAE,WAAW,CAAC;IAChB,oDAAoD;IACpD,OAAO,EAAE,aAAa,EAAE,CAAC;CAC1B,CAAC"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Basic transaction information\n */\nexport type Transaction = {\n /** Transaction ID/hash */\n id: string;\n /** Chain identifier in CAIP-2 format (e.g., \"eip155:1\") */\n chain: string;\n /** Transaction status */\n status: string;\n /** Timestamp when the transaction was processed */\n timestamp: number;\n /** Address that initiated the transaction */\n from: string;\n /** Address that received the transaction */\n to: string;\n};\n\n/**\n * Asset information for balance updates\n */\nexport type Asset = {\n /** Whether the asset is fungible */\n fungible: boolean;\n /** Asset type in CAIP format (e.g., \"eip155:1/erc20:0x...\") */\n type: string;\n /** Asset unit/symbol (e.g., \"USDT\", \"ETH\") */\n unit: string;\n /** Number of decimal places for the asset */\n decimals: number;\n};\n\n/**\n * Balance information\n */\nexport type Balance = {\n /** Balance amount as string */\n amount: string;\n /** Optional error message */\n error?: string;\n};\n\n/**\n * Transfer information\n */\nexport type Transfer = {\n /** Address sending the transfer */\n from: string;\n /** Address receiving the transfer */\n to: string;\n /** Transfer amount as string */\n amount: string;\n};\n\n/**\n * Balance update information for a specific asset\n */\nexport type BalanceUpdate = {\n /** Asset information */\n asset: Asset;\n /** Post-transaction balance */\n postBalance: Balance;\n /** List of transfers for this asset */\n transfers: Transfer[];\n};\n\n/**\n * Complete transaction/balance update message\n */\nexport type AccountActivityMessage = {\n /** Account address */\n address: string;\n /** Transaction information */\n tx: Transaction;\n /** Array of balance updates for different assets */\n updates: BalanceUpdate[];\n};\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Json } from '@metamask/utils';\n\n/**\n * Basic transaction information\n */\nexport type Transaction = {\n /** Transaction ID/hash */\n id: string;\n /** Chain identifier in CAIP-2 format (e.g., \"eip155:1\") */\n chain: string;\n /** Transaction status */\n status: string;\n /** Timestamp when the transaction was processed */\n timestamp: number;\n /** Address that initiated the transaction */\n from: string;\n /** Address that received the transaction */\n to: string;\n};\n\n/**\n * Asset information for balance updates\n */\nexport type Asset = {\n /** Whether the asset is fungible */\n fungible: boolean;\n /** Asset type in CAIP format (e.g., \"eip155:1/erc20:0x...\") */\n type: string;\n /** Asset unit/symbol (e.g., \"USDT\", \"ETH\") */\n unit: string;\n /** Number of decimal places for the asset */\n decimals: number;\n};\n\n/**\n * Balance information\n */\nexport type Balance = {\n /** Balance amount as string */\n amount: string;\n /** Optional error message */\n error?: string;\n /**\n * Network-specific balance properties from Account Activity websocket\n * messages. Stellar trustlines typically include `limit`, `authorized`, and\n * optionally `sponsor` (sponsor address). This is the stream payload, not\n * the Accounts API camelCase fields (`sponsored`, `spendableBalance`, …).\n */\n metadata?: Json;\n};\n\n/**\n * Transfer information\n */\nexport type Transfer = {\n /** Address sending the transfer */\n from: string;\n /** Address receiving the transfer */\n to: string;\n /** Transfer amount as string */\n amount: string;\n};\n\n/**\n * Balance update information for a specific asset\n */\nexport type BalanceUpdate = {\n /** Asset information */\n asset: Asset;\n /** Post-transaction balance */\n postBalance: Balance;\n /** List of transfers for this asset */\n transfers: Transfer[];\n};\n\n/**\n * Complete transaction/balance update message\n */\nexport type AccountActivityMessage = {\n /** Account address */\n address: string;\n /** Transaction information */\n tx: Transaction;\n /** Array of balance updates for different assets */\n updates: BalanceUpdate[];\n};\n"]}
|