@lifi/types 17.28.0 → 17.29.0-alpha.1

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/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "dependencies": {
5
5
  "viem": "^2.33.2"
6
6
  },
7
- "version": "17.28.0",
7
+ "version": "17.29.0-alpha.1",
8
8
  "files": [
9
9
  "src",
10
10
  "!src/assets",
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./wallet.js"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../balance/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=wallet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wallet.js","sourceRoot":"","sources":["../../balance/wallet.ts"],"names":[],"mappings":""}
package/src/_cjs/index.js CHANGED
@@ -21,4 +21,5 @@ __exportStar(require("./errors.js"), exports);
21
21
  __exportStar(require("./exchanges.js"), exports);
22
22
  __exportStar(require("./step.js"), exports);
23
23
  __exportStar(require("./tokens/index.js"), exports);
24
+ __exportStar(require("./balance/index.js"), exports);
24
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,+CAA4B;AAC5B,oDAAiC;AACjC,8CAA2B;AAC3B,iDAA8B;AAC9B,4CAAyB;AACzB,oDAAiC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,+CAA4B;AAC5B,oDAAiC;AACjC,8CAA2B;AAC3B,iDAA8B;AAC9B,4CAAyB;AACzB,oDAAiC;AACjC,qDAAkC"}
@@ -0,0 +1,2 @@
1
+ export * from './wallet.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../balance/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=wallet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wallet.js","sourceRoot":"","sources":["../../balance/wallet.ts"],"names":[],"mappings":""}
package/src/_esm/index.js CHANGED
@@ -5,4 +5,5 @@ export * from './errors.js';
5
5
  export * from './exchanges.js';
6
6
  export * from './step.js';
7
7
  export * from './tokens/index.js';
8
+ export * from './balance/index.js';
8
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './wallet.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../balance/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
@@ -0,0 +1,100 @@
1
+ import type { StaticToken, TokenExtended } from '../tokens/token.js';
2
+ /**
3
+ * Parameters for getting wallet balance
4
+ */
5
+ export interface GetWalletBalanceParams {
6
+ walletAddress: string;
7
+ }
8
+ /**
9
+ * Filter options for wallet balance requests
10
+ */
11
+ export interface GetWalletBalanceFilter {
12
+ chainIds?: (string | number)[];
13
+ offset?: string;
14
+ limit?: number;
15
+ extended?: boolean;
16
+ }
17
+ /**
18
+ * Basic wallet token following EIP structure
19
+ */
20
+ export interface WalletToken extends Omit<StaticToken, 'chainId'> {
21
+ amount: number;
22
+ }
23
+ /**
24
+ * Extended wallet token with pricing and metadata information
25
+ * Reuses TokenExtended but adapts for wallet context
26
+ */
27
+ export interface WalletTokenExtended extends Omit<TokenExtended, 'chainId'> {
28
+ amount: number;
29
+ }
30
+ /**
31
+ * Wallet balance response following EIP structure
32
+ * Balances are grouped by chainId as numeric keys
33
+ *
34
+ * @example Basic response
35
+ * ```json
36
+ * {
37
+ * "walletAddress": "0x742d35Cc6466C7b9d5b52b8e5d8bD9D9F4B12345",
38
+ * "balances": {
39
+ * "1": [
40
+ * {
41
+ * "address": "0x4200000000000000000000000000000000000006",
42
+ * "symbol": "WETH",
43
+ * "decimals": 18,
44
+ * "amount": 100000000000000
45
+ * },
46
+ * {
47
+ * "address": "0x0000000000000000000000000000000000000000",
48
+ * "symbol": "ETH",
49
+ * "decimals": 18,
50
+ * "amount": 15965635006674968
51
+ * }
52
+ * ]
53
+ * }
54
+ * }
55
+ * ```
56
+ *
57
+ * @example Extended response (with pricing data)
58
+ * ```json
59
+ * {
60
+ * "walletAddress": "0x742d35Cc6466C7b9d5b52b8e5d8bD9D9F4B12345",
61
+ * "balances": {
62
+ * "1": [
63
+ * {
64
+ * "address": "0x0000000000000000000000000000000000000000",
65
+ * "symbol": "ETH",
66
+ * "decimals": 18,
67
+ * "amount": 15965635006674968,
68
+ * "name": "ETH",
69
+ * "priceUSD": "3647.66",
70
+ * "marketCapUSD": 22112274762505,
71
+ * "volumeUSD24H": 67057337.09,
72
+ * "fdvUSD": null,
73
+ * "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
74
+ * }
75
+ * ]
76
+ * }
77
+ * }
78
+ * ```
79
+ */
80
+ export interface GetWalletBalanceResponse {
81
+ walletAddress: string;
82
+ balances: {
83
+ [chainId: number]: WalletToken[];
84
+ };
85
+ offset?: string;
86
+ limit?: number;
87
+ }
88
+ /**
89
+ * Extended wallet balance response with enhanced token information
90
+ * Includes pricing data, market cap, volume, and other metadata
91
+ */
92
+ export interface GetWalletBalanceExtendedResponse {
93
+ walletAddress: string;
94
+ balances: {
95
+ [chainId: number]: WalletTokenExtended[];
96
+ };
97
+ offset?: string;
98
+ limit?: number;
99
+ }
100
+ //# sourceMappingURL=wallet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../balance/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEpE;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,MAAM,CAAA;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC;IAC/D,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC;IACzE,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,MAAM,WAAW,wBAAwB;IACvC,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE;QACR,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,EAAE,CAAA;KACjC,CAAA;IACD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,gCAAgC;IAC/C,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE;QACR,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB,EAAE,CAAA;KACzC,CAAA;IACD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;CACf"}
@@ -5,4 +5,5 @@ export * from './errors.js';
5
5
  export * from './exchanges.js';
6
6
  export * from './step.js';
7
7
  export * from './tokens/index.js';
8
+ export * from './balance/index.js';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA"}
@@ -0,0 +1 @@
1
+ export * from './wallet.js'
@@ -0,0 +1,105 @@
1
+ import type { StaticToken, TokenExtended } from '../tokens/token.js'
2
+
3
+ /**
4
+ * Parameters for getting wallet balance
5
+ */
6
+ export interface GetWalletBalanceParams {
7
+ walletAddress: string
8
+ }
9
+
10
+ /**
11
+ * Filter options for wallet balance requests
12
+ */
13
+ export interface GetWalletBalanceFilter {
14
+ chainIds?: (string | number)[]
15
+ offset?: string
16
+ limit?: number
17
+ extended?: boolean
18
+ }
19
+
20
+ /**
21
+ * Basic wallet token following EIP structure
22
+ */
23
+ export interface WalletToken extends Omit<StaticToken, 'chainId'> {
24
+ amount: number
25
+ }
26
+
27
+ /**
28
+ * Extended wallet token with pricing and metadata information
29
+ * Reuses TokenExtended but adapts for wallet context
30
+ */
31
+ export interface WalletTokenExtended extends Omit<TokenExtended, 'chainId'> {
32
+ amount: number
33
+ }
34
+
35
+ /**
36
+ * Wallet balance response following EIP structure
37
+ * Balances are grouped by chainId as numeric keys
38
+ *
39
+ * @example Basic response
40
+ * ```json
41
+ * {
42
+ * "walletAddress": "0x742d35Cc6466C7b9d5b52b8e5d8bD9D9F4B12345",
43
+ * "balances": {
44
+ * "1": [
45
+ * {
46
+ * "address": "0x4200000000000000000000000000000000000006",
47
+ * "symbol": "WETH",
48
+ * "decimals": 18,
49
+ * "amount": 100000000000000
50
+ * },
51
+ * {
52
+ * "address": "0x0000000000000000000000000000000000000000",
53
+ * "symbol": "ETH",
54
+ * "decimals": 18,
55
+ * "amount": 15965635006674968
56
+ * }
57
+ * ]
58
+ * }
59
+ * }
60
+ * ```
61
+ *
62
+ * @example Extended response (with pricing data)
63
+ * ```json
64
+ * {
65
+ * "walletAddress": "0x742d35Cc6466C7b9d5b52b8e5d8bD9D9F4B12345",
66
+ * "balances": {
67
+ * "1": [
68
+ * {
69
+ * "address": "0x0000000000000000000000000000000000000000",
70
+ * "symbol": "ETH",
71
+ * "decimals": 18,
72
+ * "amount": 15965635006674968,
73
+ * "name": "ETH",
74
+ * "priceUSD": "3647.66",
75
+ * "marketCapUSD": 22112274762505,
76
+ * "volumeUSD24H": 67057337.09,
77
+ * "fdvUSD": null,
78
+ * "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
79
+ * }
80
+ * ]
81
+ * }
82
+ * }
83
+ * ```
84
+ */
85
+ export interface GetWalletBalanceResponse {
86
+ walletAddress: string
87
+ balances: {
88
+ [chainId: number]: WalletToken[]
89
+ }
90
+ offset?: string
91
+ limit?: number
92
+ }
93
+
94
+ /**
95
+ * Extended wallet balance response with enhanced token information
96
+ * Includes pricing data, market cap, volume, and other metadata
97
+ */
98
+ export interface GetWalletBalanceExtendedResponse {
99
+ walletAddress: string
100
+ balances: {
101
+ [chainId: number]: WalletTokenExtended[]
102
+ }
103
+ offset?: string
104
+ limit?: number
105
+ }
package/src/index.ts CHANGED
@@ -5,3 +5,4 @@ export * from './errors.js'
5
5
  export * from './exchanges.js'
6
6
  export * from './step.js'
7
7
  export * from './tokens/index.js'
8
+ export * from './balance/index.js'