@metamask/assets-controllers 38.3.0 → 40.0.0
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 +25 -1
- package/dist/AccountTrackerController.cjs +4 -3
- package/dist/AccountTrackerController.cjs.map +1 -1
- package/dist/AccountTrackerController.d.cts +26 -4
- package/dist/AccountTrackerController.d.cts.map +1 -1
- package/dist/AccountTrackerController.d.mts +26 -4
- package/dist/AccountTrackerController.d.mts.map +1 -1
- package/dist/AccountTrackerController.mjs +4 -3
- package/dist/AccountTrackerController.mjs.map +1 -1
- package/dist/CurrencyRateController.cjs +5 -6
- package/dist/CurrencyRateController.cjs.map +1 -1
- package/dist/CurrencyRateController.d.cts +24 -6
- package/dist/CurrencyRateController.d.cts.map +1 -1
- package/dist/CurrencyRateController.d.mts +24 -6
- package/dist/CurrencyRateController.d.mts.map +1 -1
- package/dist/CurrencyRateController.mjs +5 -6
- package/dist/CurrencyRateController.mjs.map +1 -1
- package/dist/TokenDetectionController.cjs +126 -29
- package/dist/TokenDetectionController.cjs.map +1 -1
- package/dist/TokenDetectionController.d.cts +25 -17
- package/dist/TokenDetectionController.d.cts.map +1 -1
- package/dist/TokenDetectionController.d.mts +25 -17
- package/dist/TokenDetectionController.d.mts.map +1 -1
- package/dist/TokenDetectionController.mjs +125 -27
- package/dist/TokenDetectionController.mjs.map +1 -1
- package/dist/TokenListController.cjs +18 -17
- package/dist/TokenListController.cjs.map +1 -1
- package/dist/TokenListController.d.cts +23 -8
- package/dist/TokenListController.d.cts.map +1 -1
- package/dist/TokenListController.d.mts +23 -8
- package/dist/TokenListController.d.mts.map +1 -1
- package/dist/TokenListController.mjs +18 -17
- package/dist/TokenListController.mjs.map +1 -1
- package/dist/TokenRatesController.cjs +8 -8
- package/dist/TokenRatesController.cjs.map +1 -1
- package/dist/TokenRatesController.d.cts +23 -5
- package/dist/TokenRatesController.d.cts.map +1 -1
- package/dist/TokenRatesController.d.mts +23 -5
- package/dist/TokenRatesController.d.mts.map +1 -1
- package/dist/TokenRatesController.mjs +8 -8
- package/dist/TokenRatesController.mjs.map +1 -1
- package/dist/multi-chain-accounts-service/index.cjs +7 -0
- package/dist/multi-chain-accounts-service/index.cjs.map +1 -0
- package/dist/multi-chain-accounts-service/index.d.cts +3 -0
- package/dist/multi-chain-accounts-service/index.d.cts.map +1 -0
- package/dist/multi-chain-accounts-service/index.d.mts +3 -0
- package/dist/multi-chain-accounts-service/index.d.mts.map +1 -0
- package/dist/multi-chain-accounts-service/index.mjs +2 -0
- package/dist/multi-chain-accounts-service/index.mjs.map +1 -0
- package/dist/multi-chain-accounts-service/mocks/mock-get-balances.cjs +82 -0
- package/dist/multi-chain-accounts-service/mocks/mock-get-balances.cjs.map +1 -0
- package/dist/multi-chain-accounts-service/mocks/mock-get-balances.d.cts +4 -0
- package/dist/multi-chain-accounts-service/mocks/mock-get-balances.d.cts.map +1 -0
- package/dist/multi-chain-accounts-service/mocks/mock-get-balances.d.mts +4 -0
- package/dist/multi-chain-accounts-service/mocks/mock-get-balances.d.mts.map +1 -0
- package/dist/multi-chain-accounts-service/mocks/mock-get-balances.mjs +78 -0
- package/dist/multi-chain-accounts-service/mocks/mock-get-balances.mjs.map +1 -0
- package/dist/multi-chain-accounts-service/mocks/mock-get-supported-networks.cjs +10 -0
- package/dist/multi-chain-accounts-service/mocks/mock-get-supported-networks.cjs.map +1 -0
- package/dist/multi-chain-accounts-service/mocks/mock-get-supported-networks.d.cts +3 -0
- package/dist/multi-chain-accounts-service/mocks/mock-get-supported-networks.d.cts.map +1 -0
- package/dist/multi-chain-accounts-service/mocks/mock-get-supported-networks.d.mts +3 -0
- package/dist/multi-chain-accounts-service/mocks/mock-get-supported-networks.d.mts.map +1 -0
- package/dist/multi-chain-accounts-service/mocks/mock-get-supported-networks.mjs +7 -0
- package/dist/multi-chain-accounts-service/mocks/mock-get-supported-networks.mjs.map +1 -0
- package/dist/multi-chain-accounts-service/multi-chain-accounts.cjs +38 -0
- package/dist/multi-chain-accounts-service/multi-chain-accounts.cjs.map +1 -0
- package/dist/multi-chain-accounts-service/multi-chain-accounts.d.cts +18 -0
- package/dist/multi-chain-accounts-service/multi-chain-accounts.d.cts.map +1 -0
- package/dist/multi-chain-accounts-service/multi-chain-accounts.d.mts +18 -0
- package/dist/multi-chain-accounts-service/multi-chain-accounts.d.mts.map +1 -0
- package/dist/multi-chain-accounts-service/multi-chain-accounts.mjs +33 -0
- package/dist/multi-chain-accounts-service/multi-chain-accounts.mjs.map +1 -0
- package/dist/multi-chain-accounts-service/types.cjs +3 -0
- package/dist/multi-chain-accounts-service/types.cjs.map +1 -0
- package/dist/multi-chain-accounts-service/types.d.cts +37 -0
- package/dist/multi-chain-accounts-service/types.d.cts.map +1 -0
- package/dist/multi-chain-accounts-service/types.d.mts +37 -0
- package/dist/multi-chain-accounts-service/types.d.mts.map +1 -0
- package/dist/multi-chain-accounts-service/types.mjs +2 -0
- package/dist/multi-chain-accounts-service/types.mjs.map +1 -0
- package/package.json +9 -9
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createMockGetBalancesResponse = exports.MOCK_GET_BALANCES_RESPONSE = void 0;
|
|
4
|
+
exports.MOCK_GET_BALANCES_RESPONSE = {
|
|
5
|
+
count: 6,
|
|
6
|
+
balances: [
|
|
7
|
+
{
|
|
8
|
+
object: 'token',
|
|
9
|
+
address: '0x0000000000000000000000000000000000000000',
|
|
10
|
+
symbol: 'ETH',
|
|
11
|
+
name: 'Ether',
|
|
12
|
+
type: 'native',
|
|
13
|
+
timestamp: '2015-07-30T03:26:13.000Z',
|
|
14
|
+
decimals: 18,
|
|
15
|
+
chainId: 1,
|
|
16
|
+
balance: '0.026380882267770930',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
object: 'token',
|
|
20
|
+
address: '0x4200000000000000000000000000000000000042',
|
|
21
|
+
name: 'Optimism',
|
|
22
|
+
symbol: 'OP',
|
|
23
|
+
decimals: 18,
|
|
24
|
+
balance: '5.250000000000000000',
|
|
25
|
+
chainId: 10,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
object: 'token',
|
|
29
|
+
address: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174',
|
|
30
|
+
name: 'USD Coin (PoS)',
|
|
31
|
+
symbol: 'USDC',
|
|
32
|
+
decimals: 6,
|
|
33
|
+
balance: '22.484688',
|
|
34
|
+
chainId: 137,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
object: 'token',
|
|
38
|
+
address: '0x0000000000000000000000000000000000000000',
|
|
39
|
+
symbol: 'MATIC',
|
|
40
|
+
name: 'MATIC',
|
|
41
|
+
type: 'native',
|
|
42
|
+
timestamp: '2020-05-30T07:47:16.000Z',
|
|
43
|
+
decimals: 18,
|
|
44
|
+
chainId: 137,
|
|
45
|
+
balance: '2.873547261071381088',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
object: 'token',
|
|
49
|
+
address: '0x912ce59144191c1204e64559fe8253a0e49e6548',
|
|
50
|
+
name: 'Arbitrum',
|
|
51
|
+
symbol: 'ARB',
|
|
52
|
+
decimals: 18,
|
|
53
|
+
balance: '14.640000000000000000',
|
|
54
|
+
chainId: 42161,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
object: 'token',
|
|
58
|
+
address: '0xd83af4fbd77f3ab65c3b1dc4b38d7e67aecf599a',
|
|
59
|
+
name: 'Linea Voyage XP',
|
|
60
|
+
symbol: 'LXP',
|
|
61
|
+
decimals: 18,
|
|
62
|
+
balance: '100.000000000000000000',
|
|
63
|
+
chainId: 59144,
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
unprocessedNetworks: [],
|
|
67
|
+
};
|
|
68
|
+
const createMockGetBalancesResponse = (tokenAddrs, chainId) => ({
|
|
69
|
+
count: tokenAddrs.length,
|
|
70
|
+
balances: tokenAddrs.map((a) => ({
|
|
71
|
+
object: 'token',
|
|
72
|
+
address: a,
|
|
73
|
+
name: 'Mock Token',
|
|
74
|
+
symbol: 'MOCK',
|
|
75
|
+
decimals: 18,
|
|
76
|
+
balance: '10.18',
|
|
77
|
+
chainId,
|
|
78
|
+
})),
|
|
79
|
+
unprocessedNetworks: [],
|
|
80
|
+
});
|
|
81
|
+
exports.createMockGetBalancesResponse = createMockGetBalancesResponse;
|
|
82
|
+
//# sourceMappingURL=mock-get-balances.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-get-balances.cjs","sourceRoot":"","sources":["../../../src/multi-chain-accounts-service/mocks/mock-get-balances.ts"],"names":[],"mappings":";;;AAEa,QAAA,0BAA0B,GAAwB;IAC7D,KAAK,EAAE,CAAC;IACR,QAAQ,EAAE;QACR;YACE,MAAM,EAAE,OAAO;YACf,OAAO,EAAE,4CAA4C;YACrD,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,0BAA0B;YACrC,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,sBAAsB;SAChC;QACD;YACE,MAAM,EAAE,OAAO;YACf,OAAO,EAAE,4CAA4C;YACrD,IAAI,EAAE,UAAU;YAChB,MAAM,EAAE,IAAI;YACZ,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,sBAAsB;YAC/B,OAAO,EAAE,EAAE;SACZ;QACD;YACE,MAAM,EAAE,OAAO;YACf,OAAO,EAAE,4CAA4C;YACrD,IAAI,EAAE,gBAAgB;YACtB,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,CAAC;YACX,OAAO,EAAE,WAAW;YACpB,OAAO,EAAE,GAAG;SACb;QACD;YACE,MAAM,EAAE,OAAO;YACf,OAAO,EAAE,4CAA4C;YACrD,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,0BAA0B;YACrC,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,GAAG;YACZ,OAAO,EAAE,sBAAsB;SAChC;QACD;YACE,MAAM,EAAE,OAAO;YACf,OAAO,EAAE,4CAA4C;YACrD,IAAI,EAAE,UAAU;YAChB,MAAM,EAAE,KAAK;YACb,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,uBAAuB;YAChC,OAAO,EAAE,KAAK;SACf;QACD;YACE,MAAM,EAAE,OAAO;YACf,OAAO,EAAE,4CAA4C;YACrD,IAAI,EAAE,iBAAiB;YACvB,MAAM,EAAE,KAAK;YACb,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,wBAAwB;YACjC,OAAO,EAAE,KAAK;SACf;KACF;IACD,mBAAmB,EAAE,EAAE;CACxB,CAAC;AAEK,MAAM,6BAA6B,GAAG,CAC3C,UAAoB,EACpB,OAAe,EACM,EAAE,CAAC,CAAC;IACzB,KAAK,EAAE,UAAU,CAAC,MAAM;IACxB,QAAQ,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC/B,MAAM,EAAE,OAAO;QACf,OAAO,EAAE,CAAC;QACV,IAAI,EAAE,YAAY;QAClB,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,EAAE;QACZ,OAAO,EAAE,OAAO;QAChB,OAAO;KACR,CAAC,CAAC;IACH,mBAAmB,EAAE,EAAE;CACxB,CAAC,CAAC;AAfU,QAAA,6BAA6B,iCAevC","sourcesContent":["import type { GetBalancesResponse } from '../types';\n\nexport const MOCK_GET_BALANCES_RESPONSE: GetBalancesResponse = {\n count: 6,\n balances: [\n {\n object: 'token',\n address: '0x0000000000000000000000000000000000000000',\n symbol: 'ETH',\n name: 'Ether',\n type: 'native',\n timestamp: '2015-07-30T03:26:13.000Z',\n decimals: 18,\n chainId: 1,\n balance: '0.026380882267770930',\n },\n {\n object: 'token',\n address: '0x4200000000000000000000000000000000000042',\n name: 'Optimism',\n symbol: 'OP',\n decimals: 18,\n balance: '5.250000000000000000',\n chainId: 10,\n },\n {\n object: 'token',\n address: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174',\n name: 'USD Coin (PoS)',\n symbol: 'USDC',\n decimals: 6,\n balance: '22.484688',\n chainId: 137,\n },\n {\n object: 'token',\n address: '0x0000000000000000000000000000000000000000',\n symbol: 'MATIC',\n name: 'MATIC',\n type: 'native',\n timestamp: '2020-05-30T07:47:16.000Z',\n decimals: 18,\n chainId: 137,\n balance: '2.873547261071381088',\n },\n {\n object: 'token',\n address: '0x912ce59144191c1204e64559fe8253a0e49e6548',\n name: 'Arbitrum',\n symbol: 'ARB',\n decimals: 18,\n balance: '14.640000000000000000',\n chainId: 42161,\n },\n {\n object: 'token',\n address: '0xd83af4fbd77f3ab65c3b1dc4b38d7e67aecf599a',\n name: 'Linea Voyage XP',\n symbol: 'LXP',\n decimals: 18,\n balance: '100.000000000000000000',\n chainId: 59144,\n },\n ],\n unprocessedNetworks: [],\n};\n\nexport const createMockGetBalancesResponse = (\n tokenAddrs: string[],\n chainId: number,\n): GetBalancesResponse => ({\n count: tokenAddrs.length,\n balances: tokenAddrs.map((a) => ({\n object: 'token',\n address: a,\n name: 'Mock Token',\n symbol: 'MOCK',\n decimals: 18,\n balance: '10.18',\n chainId,\n })),\n unprocessedNetworks: [],\n});\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { GetBalancesResponse } from "../types.cjs";
|
|
2
|
+
export declare const MOCK_GET_BALANCES_RESPONSE: GetBalancesResponse;
|
|
3
|
+
export declare const createMockGetBalancesResponse: (tokenAddrs: string[], chainId: number) => GetBalancesResponse;
|
|
4
|
+
//# sourceMappingURL=mock-get-balances.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-get-balances.d.cts","sourceRoot":"","sources":["../../../src/multi-chain-accounts-service/mocks/mock-get-balances.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAiB;AAEpD,eAAO,MAAM,0BAA0B,EAAE,mBA+DxC,CAAC;AAEF,eAAO,MAAM,6BAA6B,eAC5B,MAAM,EAAE,WACX,MAAM,KACd,mBAYD,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { GetBalancesResponse } from "../types.mjs";
|
|
2
|
+
export declare const MOCK_GET_BALANCES_RESPONSE: GetBalancesResponse;
|
|
3
|
+
export declare const createMockGetBalancesResponse: (tokenAddrs: string[], chainId: number) => GetBalancesResponse;
|
|
4
|
+
//# sourceMappingURL=mock-get-balances.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-get-balances.d.mts","sourceRoot":"","sources":["../../../src/multi-chain-accounts-service/mocks/mock-get-balances.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAiB;AAEpD,eAAO,MAAM,0BAA0B,EAAE,mBA+DxC,CAAC;AAEF,eAAO,MAAM,6BAA6B,eAC5B,MAAM,EAAE,WACX,MAAM,KACd,mBAYD,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export const MOCK_GET_BALANCES_RESPONSE = {
|
|
2
|
+
count: 6,
|
|
3
|
+
balances: [
|
|
4
|
+
{
|
|
5
|
+
object: 'token',
|
|
6
|
+
address: '0x0000000000000000000000000000000000000000',
|
|
7
|
+
symbol: 'ETH',
|
|
8
|
+
name: 'Ether',
|
|
9
|
+
type: 'native',
|
|
10
|
+
timestamp: '2015-07-30T03:26:13.000Z',
|
|
11
|
+
decimals: 18,
|
|
12
|
+
chainId: 1,
|
|
13
|
+
balance: '0.026380882267770930',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
object: 'token',
|
|
17
|
+
address: '0x4200000000000000000000000000000000000042',
|
|
18
|
+
name: 'Optimism',
|
|
19
|
+
symbol: 'OP',
|
|
20
|
+
decimals: 18,
|
|
21
|
+
balance: '5.250000000000000000',
|
|
22
|
+
chainId: 10,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
object: 'token',
|
|
26
|
+
address: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174',
|
|
27
|
+
name: 'USD Coin (PoS)',
|
|
28
|
+
symbol: 'USDC',
|
|
29
|
+
decimals: 6,
|
|
30
|
+
balance: '22.484688',
|
|
31
|
+
chainId: 137,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
object: 'token',
|
|
35
|
+
address: '0x0000000000000000000000000000000000000000',
|
|
36
|
+
symbol: 'MATIC',
|
|
37
|
+
name: 'MATIC',
|
|
38
|
+
type: 'native',
|
|
39
|
+
timestamp: '2020-05-30T07:47:16.000Z',
|
|
40
|
+
decimals: 18,
|
|
41
|
+
chainId: 137,
|
|
42
|
+
balance: '2.873547261071381088',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
object: 'token',
|
|
46
|
+
address: '0x912ce59144191c1204e64559fe8253a0e49e6548',
|
|
47
|
+
name: 'Arbitrum',
|
|
48
|
+
symbol: 'ARB',
|
|
49
|
+
decimals: 18,
|
|
50
|
+
balance: '14.640000000000000000',
|
|
51
|
+
chainId: 42161,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
object: 'token',
|
|
55
|
+
address: '0xd83af4fbd77f3ab65c3b1dc4b38d7e67aecf599a',
|
|
56
|
+
name: 'Linea Voyage XP',
|
|
57
|
+
symbol: 'LXP',
|
|
58
|
+
decimals: 18,
|
|
59
|
+
balance: '100.000000000000000000',
|
|
60
|
+
chainId: 59144,
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
unprocessedNetworks: [],
|
|
64
|
+
};
|
|
65
|
+
export const createMockGetBalancesResponse = (tokenAddrs, chainId) => ({
|
|
66
|
+
count: tokenAddrs.length,
|
|
67
|
+
balances: tokenAddrs.map((a) => ({
|
|
68
|
+
object: 'token',
|
|
69
|
+
address: a,
|
|
70
|
+
name: 'Mock Token',
|
|
71
|
+
symbol: 'MOCK',
|
|
72
|
+
decimals: 18,
|
|
73
|
+
balance: '10.18',
|
|
74
|
+
chainId,
|
|
75
|
+
})),
|
|
76
|
+
unprocessedNetworks: [],
|
|
77
|
+
});
|
|
78
|
+
//# sourceMappingURL=mock-get-balances.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-get-balances.mjs","sourceRoot":"","sources":["../../../src/multi-chain-accounts-service/mocks/mock-get-balances.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,0BAA0B,GAAwB;IAC7D,KAAK,EAAE,CAAC;IACR,QAAQ,EAAE;QACR;YACE,MAAM,EAAE,OAAO;YACf,OAAO,EAAE,4CAA4C;YACrD,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,0BAA0B;YACrC,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,sBAAsB;SAChC;QACD;YACE,MAAM,EAAE,OAAO;YACf,OAAO,EAAE,4CAA4C;YACrD,IAAI,EAAE,UAAU;YAChB,MAAM,EAAE,IAAI;YACZ,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,sBAAsB;YAC/B,OAAO,EAAE,EAAE;SACZ;QACD;YACE,MAAM,EAAE,OAAO;YACf,OAAO,EAAE,4CAA4C;YACrD,IAAI,EAAE,gBAAgB;YACtB,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,CAAC;YACX,OAAO,EAAE,WAAW;YACpB,OAAO,EAAE,GAAG;SACb;QACD;YACE,MAAM,EAAE,OAAO;YACf,OAAO,EAAE,4CAA4C;YACrD,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,0BAA0B;YACrC,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,GAAG;YACZ,OAAO,EAAE,sBAAsB;SAChC;QACD;YACE,MAAM,EAAE,OAAO;YACf,OAAO,EAAE,4CAA4C;YACrD,IAAI,EAAE,UAAU;YAChB,MAAM,EAAE,KAAK;YACb,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,uBAAuB;YAChC,OAAO,EAAE,KAAK;SACf;QACD;YACE,MAAM,EAAE,OAAO;YACf,OAAO,EAAE,4CAA4C;YACrD,IAAI,EAAE,iBAAiB;YACvB,MAAM,EAAE,KAAK;YACb,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,wBAAwB;YACjC,OAAO,EAAE,KAAK;SACf;KACF;IACD,mBAAmB,EAAE,EAAE;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAC3C,UAAoB,EACpB,OAAe,EACM,EAAE,CAAC,CAAC;IACzB,KAAK,EAAE,UAAU,CAAC,MAAM;IACxB,QAAQ,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC/B,MAAM,EAAE,OAAO;QACf,OAAO,EAAE,CAAC;QACV,IAAI,EAAE,YAAY;QAClB,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,EAAE;QACZ,OAAO,EAAE,OAAO;QAChB,OAAO;KACR,CAAC,CAAC;IACH,mBAAmB,EAAE,EAAE;CACxB,CAAC,CAAC","sourcesContent":["import type { GetBalancesResponse } from '../types';\n\nexport const MOCK_GET_BALANCES_RESPONSE: GetBalancesResponse = {\n count: 6,\n balances: [\n {\n object: 'token',\n address: '0x0000000000000000000000000000000000000000',\n symbol: 'ETH',\n name: 'Ether',\n type: 'native',\n timestamp: '2015-07-30T03:26:13.000Z',\n decimals: 18,\n chainId: 1,\n balance: '0.026380882267770930',\n },\n {\n object: 'token',\n address: '0x4200000000000000000000000000000000000042',\n name: 'Optimism',\n symbol: 'OP',\n decimals: 18,\n balance: '5.250000000000000000',\n chainId: 10,\n },\n {\n object: 'token',\n address: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174',\n name: 'USD Coin (PoS)',\n symbol: 'USDC',\n decimals: 6,\n balance: '22.484688',\n chainId: 137,\n },\n {\n object: 'token',\n address: '0x0000000000000000000000000000000000000000',\n symbol: 'MATIC',\n name: 'MATIC',\n type: 'native',\n timestamp: '2020-05-30T07:47:16.000Z',\n decimals: 18,\n chainId: 137,\n balance: '2.873547261071381088',\n },\n {\n object: 'token',\n address: '0x912ce59144191c1204e64559fe8253a0e49e6548',\n name: 'Arbitrum',\n symbol: 'ARB',\n decimals: 18,\n balance: '14.640000000000000000',\n chainId: 42161,\n },\n {\n object: 'token',\n address: '0xd83af4fbd77f3ab65c3b1dc4b38d7e67aecf599a',\n name: 'Linea Voyage XP',\n symbol: 'LXP',\n decimals: 18,\n balance: '100.000000000000000000',\n chainId: 59144,\n },\n ],\n unprocessedNetworks: [],\n};\n\nexport const createMockGetBalancesResponse = (\n tokenAddrs: string[],\n chainId: number,\n): GetBalancesResponse => ({\n count: tokenAddrs.length,\n balances: tokenAddrs.map((a) => ({\n object: 'token',\n address: a,\n name: 'Mock Token',\n symbol: 'MOCK',\n decimals: 18,\n balance: '10.18',\n chainId,\n })),\n unprocessedNetworks: [],\n});\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MOCK_GET_SUPPORTED_NETWORKS_RESPONSE = void 0;
|
|
4
|
+
exports.MOCK_GET_SUPPORTED_NETWORKS_RESPONSE = {
|
|
5
|
+
fullSupport: [1, 137, 56, 59144, 8453, 10, 42161, 534352],
|
|
6
|
+
partialSupport: {
|
|
7
|
+
balances: [59141, 42220, 43114],
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=mock-get-supported-networks.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-get-supported-networks.cjs","sourceRoot":"","sources":["../../../src/multi-chain-accounts-service/mocks/mock-get-supported-networks.ts"],"names":[],"mappings":";;;AAEa,QAAA,oCAAoC,GAC/C;IACE,WAAW,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC;IACzD,cAAc,EAAE;QACd,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;KAChC;CACF,CAAC","sourcesContent":["import type { GetSupportedNetworksResponse } from '../types';\n\nexport const MOCK_GET_SUPPORTED_NETWORKS_RESPONSE: GetSupportedNetworksResponse =\n {\n fullSupport: [1, 137, 56, 59144, 8453, 10, 42161, 534352],\n partialSupport: {\n balances: [59141, 42220, 43114],\n },\n };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-get-supported-networks.d.cts","sourceRoot":"","sources":["../../../src/multi-chain-accounts-service/mocks/mock-get-supported-networks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,qBAAiB;AAE7D,eAAO,MAAM,oCAAoC,EAAE,4BAMhD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-get-supported-networks.d.mts","sourceRoot":"","sources":["../../../src/multi-chain-accounts-service/mocks/mock-get-supported-networks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,qBAAiB;AAE7D,eAAO,MAAM,oCAAoC,EAAE,4BAMhD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-get-supported-networks.mjs","sourceRoot":"","sources":["../../../src/multi-chain-accounts-service/mocks/mock-get-supported-networks.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,oCAAoC,GAC/C;IACE,WAAW,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC;IACzD,cAAc,EAAE;QACd,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;KAChC;CACF,CAAC","sourcesContent":["import type { GetSupportedNetworksResponse } from '../types';\n\nexport const MOCK_GET_SUPPORTED_NETWORKS_RESPONSE: GetSupportedNetworksResponse =\n {\n fullSupport: [1, 137, 56, 59144, 8453, 10, 42161, 534352],\n partialSupport: {\n balances: [59141, 42220, 43114],\n },\n };\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchMultiChainBalances = exports.fetchSupportedNetworks = exports.MULTICHAIN_ACCOUNTS_DOMAIN = void 0;
|
|
4
|
+
const controller_utils_1 = require("@metamask/controller-utils");
|
|
5
|
+
exports.MULTICHAIN_ACCOUNTS_DOMAIN = 'https://accounts.api.cx.metamask.io';
|
|
6
|
+
const getBalancesUrl = (address, queryParams) => {
|
|
7
|
+
const url = new URL(`${exports.MULTICHAIN_ACCOUNTS_DOMAIN}/v2/accounts/${address}/balances`);
|
|
8
|
+
if (queryParams?.networks !== undefined) {
|
|
9
|
+
url.searchParams.append('networks', queryParams.networks);
|
|
10
|
+
}
|
|
11
|
+
return url;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Fetches Supported Networks.
|
|
15
|
+
* @returns supported networks (decimal)
|
|
16
|
+
*/
|
|
17
|
+
async function fetchSupportedNetworks() {
|
|
18
|
+
const url = new URL(`${exports.MULTICHAIN_ACCOUNTS_DOMAIN}/v1/supportedNetworks`);
|
|
19
|
+
const response = await (0, controller_utils_1.handleFetch)(url);
|
|
20
|
+
return response.fullSupport;
|
|
21
|
+
}
|
|
22
|
+
exports.fetchSupportedNetworks = fetchSupportedNetworks;
|
|
23
|
+
/**
|
|
24
|
+
* Fetches Balances for multiple networks.
|
|
25
|
+
* @param address - address to fetch balances from
|
|
26
|
+
* @param options - params to pass down for a more refined search
|
|
27
|
+
* @param options.networks - the networks (in decimal) that you want to filter by
|
|
28
|
+
* @returns a Balances Response
|
|
29
|
+
*/
|
|
30
|
+
async function fetchMultiChainBalances(address, options) {
|
|
31
|
+
const url = getBalancesUrl(address, {
|
|
32
|
+
networks: options?.networks?.join(),
|
|
33
|
+
});
|
|
34
|
+
const response = await (0, controller_utils_1.handleFetch)(url);
|
|
35
|
+
return response;
|
|
36
|
+
}
|
|
37
|
+
exports.fetchMultiChainBalances = fetchMultiChainBalances;
|
|
38
|
+
//# sourceMappingURL=multi-chain-accounts.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multi-chain-accounts.cjs","sourceRoot":"","sources":["../../src/multi-chain-accounts-service/multi-chain-accounts.ts"],"names":[],"mappings":";;;AAAA,iEAAyD;AAQ5C,QAAA,0BAA0B,GAAG,qCAAqC,CAAC;AAEhF,MAAM,cAAc,GAAG,CACrB,OAAe,EACf,WAAoC,EACpC,EAAE;IACF,MAAM,GAAG,GAAG,IAAI,GAAG,CACjB,GAAG,kCAA0B,gBAAgB,OAAO,WAAW,CAChE,CAAC;IAEF,IAAI,WAAW,EAAE,QAAQ,KAAK,SAAS,EAAE;QACvC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;KAC3D;IAED,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAEF;;;GAGG;AACI,KAAK,UAAU,sBAAsB;IAC1C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,kCAA0B,uBAAuB,CAAC,CAAC;IAC1E,MAAM,QAAQ,GAAiC,MAAM,IAAA,8BAAW,EAAC,GAAG,CAAC,CAAC;IACtE,OAAO,QAAQ,CAAC,WAAW,CAAC;AAC9B,CAAC;AAJD,wDAIC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,uBAAuB,CAC3C,OAAe,EACf,OAAiC;IAEjC,MAAM,GAAG,GAAG,cAAc,CAAC,OAAO,EAAE;QAClC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE;KACpC,CAAC,CAAC;IACH,MAAM,QAAQ,GAAwB,MAAM,IAAA,8BAAW,EAAC,GAAG,CAAC,CAAC;IAC7D,OAAO,QAAQ,CAAC;AAClB,CAAC;AATD,0DASC","sourcesContent":["import { handleFetch } from '@metamask/controller-utils';\n\nimport type {\n GetBalancesQueryParams,\n GetBalancesResponse,\n GetSupportedNetworksResponse,\n} from './types';\n\nexport const MULTICHAIN_ACCOUNTS_DOMAIN = 'https://accounts.api.cx.metamask.io';\n\nconst getBalancesUrl = (\n address: string,\n queryParams?: GetBalancesQueryParams,\n) => {\n const url = new URL(\n `${MULTICHAIN_ACCOUNTS_DOMAIN}/v2/accounts/${address}/balances`,\n );\n\n if (queryParams?.networks !== undefined) {\n url.searchParams.append('networks', queryParams.networks);\n }\n\n return url;\n};\n\n/**\n * Fetches Supported Networks.\n * @returns supported networks (decimal)\n */\nexport async function fetchSupportedNetworks(): Promise<number[]> {\n const url = new URL(`${MULTICHAIN_ACCOUNTS_DOMAIN}/v1/supportedNetworks`);\n const response: GetSupportedNetworksResponse = await handleFetch(url);\n return response.fullSupport;\n}\n\n/**\n * Fetches Balances for multiple networks.\n * @param address - address to fetch balances from\n * @param options - params to pass down for a more refined search\n * @param options.networks - the networks (in decimal) that you want to filter by\n * @returns a Balances Response\n */\nexport async function fetchMultiChainBalances(\n address: string,\n options?: { networks?: number[] },\n) {\n const url = getBalancesUrl(address, {\n networks: options?.networks?.join(),\n });\n const response: GetBalancesResponse = await handleFetch(url);\n return response;\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { GetBalancesResponse } from "./types.cjs";
|
|
2
|
+
export declare const MULTICHAIN_ACCOUNTS_DOMAIN = "https://accounts.api.cx.metamask.io";
|
|
3
|
+
/**
|
|
4
|
+
* Fetches Supported Networks.
|
|
5
|
+
* @returns supported networks (decimal)
|
|
6
|
+
*/
|
|
7
|
+
export declare function fetchSupportedNetworks(): Promise<number[]>;
|
|
8
|
+
/**
|
|
9
|
+
* Fetches Balances for multiple networks.
|
|
10
|
+
* @param address - address to fetch balances from
|
|
11
|
+
* @param options - params to pass down for a more refined search
|
|
12
|
+
* @param options.networks - the networks (in decimal) that you want to filter by
|
|
13
|
+
* @returns a Balances Response
|
|
14
|
+
*/
|
|
15
|
+
export declare function fetchMultiChainBalances(address: string, options?: {
|
|
16
|
+
networks?: number[];
|
|
17
|
+
}): Promise<GetBalancesResponse>;
|
|
18
|
+
//# sourceMappingURL=multi-chain-accounts.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multi-chain-accounts.d.cts","sourceRoot":"","sources":["../../src/multi-chain-accounts-service/multi-chain-accounts.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,mBAAmB,EAEpB,oBAAgB;AAEjB,eAAO,MAAM,0BAA0B,wCAAwC,CAAC;AAiBhF;;;GAGG;AACH,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAIhE;AAED;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,gCAOlC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { GetBalancesResponse } from "./types.mjs";
|
|
2
|
+
export declare const MULTICHAIN_ACCOUNTS_DOMAIN = "https://accounts.api.cx.metamask.io";
|
|
3
|
+
/**
|
|
4
|
+
* Fetches Supported Networks.
|
|
5
|
+
* @returns supported networks (decimal)
|
|
6
|
+
*/
|
|
7
|
+
export declare function fetchSupportedNetworks(): Promise<number[]>;
|
|
8
|
+
/**
|
|
9
|
+
* Fetches Balances for multiple networks.
|
|
10
|
+
* @param address - address to fetch balances from
|
|
11
|
+
* @param options - params to pass down for a more refined search
|
|
12
|
+
* @param options.networks - the networks (in decimal) that you want to filter by
|
|
13
|
+
* @returns a Balances Response
|
|
14
|
+
*/
|
|
15
|
+
export declare function fetchMultiChainBalances(address: string, options?: {
|
|
16
|
+
networks?: number[];
|
|
17
|
+
}): Promise<GetBalancesResponse>;
|
|
18
|
+
//# sourceMappingURL=multi-chain-accounts.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multi-chain-accounts.d.mts","sourceRoot":"","sources":["../../src/multi-chain-accounts-service/multi-chain-accounts.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,mBAAmB,EAEpB,oBAAgB;AAEjB,eAAO,MAAM,0BAA0B,wCAAwC,CAAC;AAiBhF;;;GAGG;AACH,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAIhE;AAED;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,gCAOlC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { handleFetch } from "@metamask/controller-utils";
|
|
2
|
+
export const MULTICHAIN_ACCOUNTS_DOMAIN = 'https://accounts.api.cx.metamask.io';
|
|
3
|
+
const getBalancesUrl = (address, queryParams) => {
|
|
4
|
+
const url = new URL(`${MULTICHAIN_ACCOUNTS_DOMAIN}/v2/accounts/${address}/balances`);
|
|
5
|
+
if (queryParams?.networks !== undefined) {
|
|
6
|
+
url.searchParams.append('networks', queryParams.networks);
|
|
7
|
+
}
|
|
8
|
+
return url;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Fetches Supported Networks.
|
|
12
|
+
* @returns supported networks (decimal)
|
|
13
|
+
*/
|
|
14
|
+
export async function fetchSupportedNetworks() {
|
|
15
|
+
const url = new URL(`${MULTICHAIN_ACCOUNTS_DOMAIN}/v1/supportedNetworks`);
|
|
16
|
+
const response = await handleFetch(url);
|
|
17
|
+
return response.fullSupport;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Fetches Balances for multiple networks.
|
|
21
|
+
* @param address - address to fetch balances from
|
|
22
|
+
* @param options - params to pass down for a more refined search
|
|
23
|
+
* @param options.networks - the networks (in decimal) that you want to filter by
|
|
24
|
+
* @returns a Balances Response
|
|
25
|
+
*/
|
|
26
|
+
export async function fetchMultiChainBalances(address, options) {
|
|
27
|
+
const url = getBalancesUrl(address, {
|
|
28
|
+
networks: options?.networks?.join(),
|
|
29
|
+
});
|
|
30
|
+
const response = await handleFetch(url);
|
|
31
|
+
return response;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=multi-chain-accounts.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multi-chain-accounts.mjs","sourceRoot":"","sources":["../../src/multi-chain-accounts-service/multi-chain-accounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,mCAAmC;AAQzD,MAAM,CAAC,MAAM,0BAA0B,GAAG,qCAAqC,CAAC;AAEhF,MAAM,cAAc,GAAG,CACrB,OAAe,EACf,WAAoC,EACpC,EAAE;IACF,MAAM,GAAG,GAAG,IAAI,GAAG,CACjB,GAAG,0BAA0B,gBAAgB,OAAO,WAAW,CAChE,CAAC;IAEF,IAAI,WAAW,EAAE,QAAQ,KAAK,SAAS,EAAE;QACvC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;KAC3D;IAED,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB;IAC1C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,0BAA0B,uBAAuB,CAAC,CAAC;IAC1E,MAAM,QAAQ,GAAiC,MAAM,WAAW,CAAC,GAAG,CAAC,CAAC;IACtE,OAAO,QAAQ,CAAC,WAAW,CAAC;AAC9B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,OAAe,EACf,OAAiC;IAEjC,MAAM,GAAG,GAAG,cAAc,CAAC,OAAO,EAAE;QAClC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE;KACpC,CAAC,CAAC;IACH,MAAM,QAAQ,GAAwB,MAAM,WAAW,CAAC,GAAG,CAAC,CAAC;IAC7D,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import { handleFetch } from '@metamask/controller-utils';\n\nimport type {\n GetBalancesQueryParams,\n GetBalancesResponse,\n GetSupportedNetworksResponse,\n} from './types';\n\nexport const MULTICHAIN_ACCOUNTS_DOMAIN = 'https://accounts.api.cx.metamask.io';\n\nconst getBalancesUrl = (\n address: string,\n queryParams?: GetBalancesQueryParams,\n) => {\n const url = new URL(\n `${MULTICHAIN_ACCOUNTS_DOMAIN}/v2/accounts/${address}/balances`,\n );\n\n if (queryParams?.networks !== undefined) {\n url.searchParams.append('networks', queryParams.networks);\n }\n\n return url;\n};\n\n/**\n * Fetches Supported Networks.\n * @returns supported networks (decimal)\n */\nexport async function fetchSupportedNetworks(): Promise<number[]> {\n const url = new URL(`${MULTICHAIN_ACCOUNTS_DOMAIN}/v1/supportedNetworks`);\n const response: GetSupportedNetworksResponse = await handleFetch(url);\n return response.fullSupport;\n}\n\n/**\n * Fetches Balances for multiple networks.\n * @param address - address to fetch balances from\n * @param options - params to pass down for a more refined search\n * @param options.networks - the networks (in decimal) that you want to filter by\n * @returns a Balances Response\n */\nexport async function fetchMultiChainBalances(\n address: string,\n options?: { networks?: number[] },\n) {\n const url = getBalancesUrl(address, {\n networks: options?.networks?.join(),\n });\n const response: GetBalancesResponse = await handleFetch(url);\n return response;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../src/multi-chain-accounts-service/types.ts"],"names":[],"mappings":"","sourcesContent":["export type GetSupportedNetworksResponse = {\n fullSupport: number[];\n partialSupport: {\n balances: number[];\n };\n};\n\nexport type GetBalancesQueryParams = {\n /** Comma-separated network/chain IDs */\n networks?: string;\n /** Whether or not to filter the assets to contain only the tokens existing in the Token API */\n filterSupportedTokens?: boolean;\n /** Specific token addresses to fetch balances for across specified network(s) */\n includeTokenAddresses?: string;\n /** Whether to include balances of the account's staked asset balances */\n includeStakedAssets?: boolean;\n};\n\nexport type GetBalancesResponse = {\n count: number;\n balances: {\n /** Underlying object type. Seems to be always `token` */\n object: string;\n /** Token Type: This is only supplied as `native` to native chain tokens (e.g. - ETH, POL) */\n type?: string;\n /** Timestamp is only provided for `native` chain tokens */\n timestamp?: string;\n address: string;\n symbol: string;\n name: string;\n decimals: number;\n chainId: number;\n /** string representation of the balance in decimal format (decimals adjusted). e.g. - 123.456789 */\n balance: string;\n }[];\n /** networks that failed to process, if no network is processed, returns HTTP 422 */\n unprocessedNetworks: number[];\n};\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export type GetSupportedNetworksResponse = {
|
|
2
|
+
fullSupport: number[];
|
|
3
|
+
partialSupport: {
|
|
4
|
+
balances: number[];
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
export type GetBalancesQueryParams = {
|
|
8
|
+
/** Comma-separated network/chain IDs */
|
|
9
|
+
networks?: string;
|
|
10
|
+
/** Whether or not to filter the assets to contain only the tokens existing in the Token API */
|
|
11
|
+
filterSupportedTokens?: boolean;
|
|
12
|
+
/** Specific token addresses to fetch balances for across specified network(s) */
|
|
13
|
+
includeTokenAddresses?: string;
|
|
14
|
+
/** Whether to include balances of the account's staked asset balances */
|
|
15
|
+
includeStakedAssets?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export type GetBalancesResponse = {
|
|
18
|
+
count: number;
|
|
19
|
+
balances: {
|
|
20
|
+
/** Underlying object type. Seems to be always `token` */
|
|
21
|
+
object: string;
|
|
22
|
+
/** Token Type: This is only supplied as `native` to native chain tokens (e.g. - ETH, POL) */
|
|
23
|
+
type?: string;
|
|
24
|
+
/** Timestamp is only provided for `native` chain tokens */
|
|
25
|
+
timestamp?: string;
|
|
26
|
+
address: string;
|
|
27
|
+
symbol: string;
|
|
28
|
+
name: string;
|
|
29
|
+
decimals: number;
|
|
30
|
+
chainId: number;
|
|
31
|
+
/** string representation of the balance in decimal format (decimals adjusted). e.g. - 123.456789 */
|
|
32
|
+
balance: string;
|
|
33
|
+
}[];
|
|
34
|
+
/** networks that failed to process, if no network is processed, returns HTTP 422 */
|
|
35
|
+
unprocessedNetworks: number[];
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../src/multi-chain-accounts-service/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,4BAA4B,GAAG;IACzC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,cAAc,EAAE;QACd,QAAQ,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+FAA+F;IAC/F,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,iFAAiF;IACjF,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,yEAAyE;IACzE,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE;QACR,yDAAyD;QACzD,MAAM,EAAE,MAAM,CAAC;QACf,6FAA6F;QAC7F,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,2DAA2D;QAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,oGAAoG;QACpG,OAAO,EAAE,MAAM,CAAC;KACjB,EAAE,CAAC;IACJ,qFAAqF;IACrF,mBAAmB,EAAE,MAAM,EAAE,CAAC;CAC/B,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export type GetSupportedNetworksResponse = {
|
|
2
|
+
fullSupport: number[];
|
|
3
|
+
partialSupport: {
|
|
4
|
+
balances: number[];
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
export type GetBalancesQueryParams = {
|
|
8
|
+
/** Comma-separated network/chain IDs */
|
|
9
|
+
networks?: string;
|
|
10
|
+
/** Whether or not to filter the assets to contain only the tokens existing in the Token API */
|
|
11
|
+
filterSupportedTokens?: boolean;
|
|
12
|
+
/** Specific token addresses to fetch balances for across specified network(s) */
|
|
13
|
+
includeTokenAddresses?: string;
|
|
14
|
+
/** Whether to include balances of the account's staked asset balances */
|
|
15
|
+
includeStakedAssets?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export type GetBalancesResponse = {
|
|
18
|
+
count: number;
|
|
19
|
+
balances: {
|
|
20
|
+
/** Underlying object type. Seems to be always `token` */
|
|
21
|
+
object: string;
|
|
22
|
+
/** Token Type: This is only supplied as `native` to native chain tokens (e.g. - ETH, POL) */
|
|
23
|
+
type?: string;
|
|
24
|
+
/** Timestamp is only provided for `native` chain tokens */
|
|
25
|
+
timestamp?: string;
|
|
26
|
+
address: string;
|
|
27
|
+
symbol: string;
|
|
28
|
+
name: string;
|
|
29
|
+
decimals: number;
|
|
30
|
+
chainId: number;
|
|
31
|
+
/** string representation of the balance in decimal format (decimals adjusted). e.g. - 123.456789 */
|
|
32
|
+
balance: string;
|
|
33
|
+
}[];
|
|
34
|
+
/** networks that failed to process, if no network is processed, returns HTTP 422 */
|
|
35
|
+
unprocessedNetworks: number[];
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/multi-chain-accounts-service/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,4BAA4B,GAAG;IACzC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,cAAc,EAAE;QACd,QAAQ,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+FAA+F;IAC/F,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,iFAAiF;IACjF,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,yEAAyE;IACzE,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE;QACR,yDAAyD;QACzD,MAAM,EAAE,MAAM,CAAC;QACf,6FAA6F;QAC7F,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,2DAA2D;QAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,oGAAoG;QACpG,OAAO,EAAE,MAAM,CAAC;KACjB,EAAE,CAAC;IACJ,qFAAqF;IACrF,mBAAmB,EAAE,MAAM,EAAE,CAAC;CAC/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../src/multi-chain-accounts-service/types.ts"],"names":[],"mappings":"","sourcesContent":["export type GetSupportedNetworksResponse = {\n fullSupport: number[];\n partialSupport: {\n balances: number[];\n };\n};\n\nexport type GetBalancesQueryParams = {\n /** Comma-separated network/chain IDs */\n networks?: string;\n /** Whether or not to filter the assets to contain only the tokens existing in the Token API */\n filterSupportedTokens?: boolean;\n /** Specific token addresses to fetch balances for across specified network(s) */\n includeTokenAddresses?: string;\n /** Whether to include balances of the account's staked asset balances */\n includeStakedAssets?: boolean;\n};\n\nexport type GetBalancesResponse = {\n count: number;\n balances: {\n /** Underlying object type. Seems to be always `token` */\n object: string;\n /** Token Type: This is only supplied as `native` to native chain tokens (e.g. - ETH, POL) */\n type?: string;\n /** Timestamp is only provided for `native` chain tokens */\n timestamp?: string;\n address: string;\n symbol: string;\n name: string;\n decimals: number;\n chainId: number;\n /** string representation of the balance in decimal format (decimals adjusted). e.g. - 123.456789 */\n balance: string;\n }[];\n /** networks that failed to process, if no network is processed, returns HTTP 422 */\n unprocessedNetworks: number[];\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask/assets-controllers",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "40.0.0",
|
|
4
4
|
"description": "Controllers which manage interactions involving ERC-20, ERC-721, and ERC-1155 tokens (including NFTs)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"MetaMask",
|
|
@@ -55,12 +55,12 @@
|
|
|
55
55
|
"@metamask/abi-utils": "^2.0.3",
|
|
56
56
|
"@metamask/base-controller": "^7.0.1",
|
|
57
57
|
"@metamask/contract-metadata": "^2.4.0",
|
|
58
|
-
"@metamask/controller-utils": "^11.
|
|
58
|
+
"@metamask/controller-utils": "^11.4.0",
|
|
59
59
|
"@metamask/eth-query": "^4.0.0",
|
|
60
60
|
"@metamask/metamask-eth-abis": "^3.1.1",
|
|
61
|
-
"@metamask/polling-controller": "^
|
|
62
|
-
"@metamask/rpc-errors": "^
|
|
63
|
-
"@metamask/utils": "^
|
|
61
|
+
"@metamask/polling-controller": "^12.0.0",
|
|
62
|
+
"@metamask/rpc-errors": "^7.0.1",
|
|
63
|
+
"@metamask/utils": "^10.0.0",
|
|
64
64
|
"@types/bn.js": "^5.1.5",
|
|
65
65
|
"@types/uuid": "^8.3.0",
|
|
66
66
|
"async-mutex": "^0.5.0",
|
|
@@ -78,9 +78,9 @@
|
|
|
78
78
|
"@metamask/auto-changelog": "^3.4.4",
|
|
79
79
|
"@metamask/ethjs-provider-http": "^0.3.0",
|
|
80
80
|
"@metamask/keyring-api": "^8.1.3",
|
|
81
|
-
"@metamask/keyring-controller": "^17.
|
|
82
|
-
"@metamask/network-controller": "^
|
|
83
|
-
"@metamask/preferences-controller": "^13.0
|
|
81
|
+
"@metamask/keyring-controller": "^17.3.0",
|
|
82
|
+
"@metamask/network-controller": "^22.0.0",
|
|
83
|
+
"@metamask/preferences-controller": "^13.1.0",
|
|
84
84
|
"@types/jest": "^27.4.1",
|
|
85
85
|
"@types/lodash": "^4.14.191",
|
|
86
86
|
"@types/node": "^16.18.54",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"@metamask/accounts-controller": "^18.0.0",
|
|
99
99
|
"@metamask/approval-controller": "^7.0.0",
|
|
100
100
|
"@metamask/keyring-controller": "^17.0.0",
|
|
101
|
-
"@metamask/network-controller": "^
|
|
101
|
+
"@metamask/network-controller": "^22.0.0",
|
|
102
102
|
"@metamask/preferences-controller": "^13.0.0"
|
|
103
103
|
},
|
|
104
104
|
"engines": {
|