@lifi/types 17.26.0 → 17.27.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.31.7"
6
6
  },
7
- "version": "17.26.0",
7
+ "version": "17.27.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,80 @@
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
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": 1
51
+ * }
52
+ * ],
53
+ * "137": [
54
+ * // Polygon tokens...
55
+ * ]
56
+ * }
57
+ * }
58
+ * ```
59
+ */
60
+ export interface GetWalletBalanceResponse {
61
+ walletAddress: string;
62
+ balances: {
63
+ [chainId: number]: WalletToken[];
64
+ };
65
+ offset?: string;
66
+ limit?: number;
67
+ }
68
+ /**
69
+ * Extended wallet balance response with enhanced token information
70
+ * Includes pricing data, market cap, volume, and other metadata
71
+ */
72
+ export interface GetWalletBalanceExtendedResponse {
73
+ walletAddress: string;
74
+ balances: {
75
+ [chainId: number]: WalletTokenExtended[];
76
+ };
77
+ offset?: string;
78
+ limit?: number;
79
+ }
80
+ //# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;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,85 @@
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
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": 1
56
+ * }
57
+ * ],
58
+ * "137": [
59
+ * // Polygon tokens...
60
+ * ]
61
+ * }
62
+ * }
63
+ * ```
64
+ */
65
+ export interface GetWalletBalanceResponse {
66
+ walletAddress: string
67
+ balances: {
68
+ [chainId: number]: WalletToken[]
69
+ }
70
+ offset?: string
71
+ limit?: number
72
+ }
73
+
74
+ /**
75
+ * Extended wallet balance response with enhanced token information
76
+ * Includes pricing data, market cap, volume, and other metadata
77
+ */
78
+ export interface GetWalletBalanceExtendedResponse {
79
+ walletAddress: string
80
+ balances: {
81
+ [chainId: number]: WalletTokenExtended[]
82
+ }
83
+ offset?: string
84
+ limit?: number
85
+ }
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'