@lifi/types 9.0.0-alpha.4 → 9.0.0-alpha.6

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.
Files changed (40) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/api.d.ts +22 -13
  3. package/dist/api.js +2 -5
  4. package/dist/bridges.d.ts +3 -21
  5. package/dist/bridges.js +1 -19
  6. package/dist/chains/Chain.d.ts +2 -1
  7. package/dist/{cjs → chains}/base.d.ts +0 -85
  8. package/dist/{base.js → chains/base.js} +0 -63
  9. package/dist/cjs/api.d.ts +22 -13
  10. package/dist/cjs/api.js +3 -7
  11. package/dist/cjs/bridges.d.ts +3 -21
  12. package/dist/cjs/bridges.js +0 -20
  13. package/dist/cjs/chains/Chain.d.ts +2 -1
  14. package/dist/{base.d.ts → cjs/chains/base.d.ts} +0 -85
  15. package/dist/cjs/{base.js → chains/base.js} +1 -64
  16. package/dist/cjs/exchanges.d.ts +3 -19
  17. package/dist/cjs/exchanges.js +0 -13
  18. package/dist/cjs/index.d.ts +1 -2
  19. package/dist/cjs/index.js +1 -2
  20. package/dist/cjs/step.d.ts +1 -1
  21. package/dist/cjs/tokens/base.d.ts +58 -0
  22. package/dist/cjs/tokens/base.js +66 -0
  23. package/dist/cjs/tokens/index.d.ts +2 -0
  24. package/dist/cjs/tokens/index.js +18 -0
  25. package/dist/cjs/tokens/token.d.ts +29 -0
  26. package/dist/exchanges.d.ts +3 -19
  27. package/dist/exchanges.js +1 -12
  28. package/dist/index.d.ts +1 -2
  29. package/dist/index.js +1 -2
  30. package/dist/step.d.ts +1 -1
  31. package/dist/tokens/base.d.ts +58 -0
  32. package/dist/tokens/base.js +63 -0
  33. package/dist/tokens/index.d.ts +2 -0
  34. package/dist/tokens/index.js +2 -0
  35. package/dist/tokens/token.d.ts +29 -0
  36. package/package.json +1 -1
  37. package/dist/apiErrors.d.ts +0 -9
  38. package/dist/cjs/apiErrors.d.ts +0 -9
  39. /package/dist/cjs/{apiErrors.js → tokens/token.js} +0 -0
  40. /package/dist/{apiErrors.js → tokens/token.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [8.3.0](https://github.com/lifinance/types/compare/v8.2.0...v8.3.0) (2023-08-04)
6
+
7
+
8
+ ### Features
9
+
10
+ * move NOT_PROCESSABLE_REFUND_NEEDED to PENDING ([#185](https://github.com/lifinance/types/issues/185)) ([14ceea0](https://github.com/lifinance/types/commit/14ceea03f7e95466061c46b70998738114812f80))
11
+
5
12
  ## [8.2.0](https://github.com/lifinance/types/compare/v8.0.4...v8.2.0) (2023-07-26)
6
13
 
7
14
 
package/dist/api.d.ts CHANGED
@@ -1,5 +1,9 @@
1
- import { BridgeDefinition, Chain, ChainId, ExchangeDefinition, LifiStep, Token } from '.';
2
- import { ToolError } from './apiErrors';
1
+ import { BridgeDefinition } from './bridges';
2
+ import { Chain } from './chains';
3
+ import { ChainId } from './chains/base';
4
+ import { ExchangeDefinition } from './exchanges';
5
+ import { Action, LifiStep } from './step';
6
+ import { Token } from './tokens';
3
7
  /**
4
8
  * Used as a bigint replacement for TransactionRequest because bigint is not serializable
5
9
  */
@@ -37,18 +41,18 @@ export interface RoutesRequest {
37
41
  fromAmountForGas?: string;
38
42
  }
39
43
  export interface RouteOptions {
44
+ integrator?: string;
45
+ fee?: number;
46
+ insurance?: boolean;
47
+ maxPriceImpact?: number;
40
48
  order?: Order;
41
49
  slippage?: number;
50
+ referrer?: string;
42
51
  infiniteApproval?: boolean;
43
52
  allowSwitchChain?: boolean;
44
- integrator?: string;
45
53
  allowDestinationCall?: boolean;
46
- referrer?: string;
47
54
  bridges?: AllowDenyPrefer;
48
55
  exchanges?: AllowDenyPrefer;
49
- fee?: number;
50
- insurance?: boolean;
51
- maxPriceImpact?: number;
52
56
  }
53
57
  export type ToolsResponse = {
54
58
  exchanges: {
@@ -98,6 +102,14 @@ export interface Route {
98
102
  steps: LifiStep[];
99
103
  tags?: Order[];
100
104
  }
105
+ export type ToolErrorType = 'NO_QUOTE';
106
+ export interface ToolError {
107
+ errorType: ToolErrorType;
108
+ code: string;
109
+ action: Action;
110
+ tool: string;
111
+ message: string;
112
+ }
101
113
  export type ErroredPaths = {
102
114
  [subpath: string]: ToolError[];
103
115
  };
@@ -249,16 +261,13 @@ export interface PendingReceivingInfo {
249
261
  }
250
262
  declare const _StatusMessage: readonly ["NOT_FOUND", "INVALID", "PENDING", "DONE", "FAILED"];
251
263
  export type StatusMessage = (typeof _StatusMessage)[number];
252
- declare const _SubstatusPending: readonly ["WAIT_SOURCE_CONFIRMATIONS", "WAIT_DESTINATION_TRANSACTION", "BRIDGE_NOT_AVAILABLE", "CHAIN_NOT_AVAILABLE", "REFUND_IN_PROGRESS", "UNKNOWN_ERROR"];
264
+ declare const _SubstatusPending: readonly ["WAIT_SOURCE_CONFIRMATIONS", "WAIT_DESTINATION_TRANSACTION", "BRIDGE_NOT_AVAILABLE", "CHAIN_NOT_AVAILABLE", "NOT_PROCESSABLE_REFUND_NEEDED", "REFUND_IN_PROGRESS", "UNKNOWN_ERROR"];
253
265
  export type SubstatusPending = (typeof _SubstatusPending)[number];
254
266
  declare const _SubstatusDone: readonly ["COMPLETED", "PARTIAL", "REFUNDED"];
255
267
  export type SubstatusDone = (typeof _SubstatusDone)[number];
256
- declare const _SubstatusFailed: readonly ["NOT_PROCESSABLE_REFUND_NEEDED"];
257
- export type SubstatusFailed = (typeof _SubstatusFailed)[number];
258
- export type Substatus = SubstatusPending | SubstatusDone | SubstatusFailed;
259
- export declare const isSubstatusPending: (substatus: Substatus) => substatus is "WAIT_SOURCE_CONFIRMATIONS" | "WAIT_DESTINATION_TRANSACTION" | "BRIDGE_NOT_AVAILABLE" | "CHAIN_NOT_AVAILABLE" | "REFUND_IN_PROGRESS" | "UNKNOWN_ERROR";
268
+ export type Substatus = SubstatusPending | SubstatusDone;
269
+ export declare const isSubstatusPending: (substatus: Substatus) => substatus is "WAIT_SOURCE_CONFIRMATIONS" | "WAIT_DESTINATION_TRANSACTION" | "BRIDGE_NOT_AVAILABLE" | "CHAIN_NOT_AVAILABLE" | "NOT_PROCESSABLE_REFUND_NEEDED" | "REFUND_IN_PROGRESS" | "UNKNOWN_ERROR";
260
270
  export declare const isSubstatusDone: (substatus: Substatus) => substatus is "COMPLETED" | "PARTIAL" | "REFUNDED";
261
- export declare const isSubstatusFailed: (substatus: Substatus) => substatus is "NOT_PROCESSABLE_REFUND_NEEDED";
262
271
  export interface BaseStatusData {
263
272
  status: StatusMessage;
264
273
  substatus?: Substatus;
package/dist/api.js CHANGED
@@ -25,6 +25,8 @@ const _SubstatusPending = [
25
25
  'BRIDGE_NOT_AVAILABLE',
26
26
  // The RPC for source/destination chain is temporarily unavailable
27
27
  'CHAIN_NOT_AVAILABLE',
28
+ // The transfer cannot be completed, a refund is required
29
+ 'NOT_PROCESSABLE_REFUND_NEEDED',
28
30
  // A refund has been requested and is in progress
29
31
  'REFUND_IN_PROGRESS',
30
32
  // We cannot determine the status of the transfer
@@ -40,11 +42,6 @@ const _SubstatusDone = [
40
42
  // The transfer was not successful but it has been refunded
41
43
  'REFUNDED',
42
44
  ];
43
- const _SubstatusFailed = [
44
- // The transfer cannot be completed, a refund is required
45
- 'NOT_PROCESSABLE_REFUND_NEEDED',
46
- ];
47
45
  export const isSubstatusPending = (substatus) => _SubstatusPending.includes(substatus);
48
46
  export const isSubstatusDone = (substatus) => _SubstatusDone.includes(substatus);
49
- export const isSubstatusFailed = (substatus) => _SubstatusFailed.includes(substatus);
50
47
  const _LIFuelState = ['PENDING', 'DONE', 'NOT_FOUND'];
package/dist/bridges.d.ts CHANGED
@@ -1,24 +1,6 @@
1
- import { BaseToken } from './base';
2
- /**
3
- * @deprecated
4
- * These values are now obtainable from the LI.FI API
5
- */
6
- export declare enum BridgeTool {
7
- connext = "connext",
8
- hop = "hop",
9
- multichain = "multichain",
10
- cbridge = "cbridge",
11
- hyphen = "hyphen",
12
- polygon = "polygon",
13
- arbitrum = "arbitrum",
14
- avalanche = "avalanche",
15
- optimism = "optimism",
16
- across = "across",
17
- portal = "portal",
18
- stargate = "stargate"
19
- }
1
+ import { BaseToken } from './tokens/token';
20
2
  export interface Bridge {
21
- key: BridgeTool;
3
+ key: string;
22
4
  name: string;
23
5
  logoURI: string;
24
6
  bridgeUrl?: string;
@@ -33,7 +15,7 @@ export interface Bridge {
33
15
  * @deprecated
34
16
  */
35
17
  export interface BridgeDefinition {
36
- tool: BridgeTool;
18
+ tool: string;
37
19
  fromChainId: number;
38
20
  fromToken: BaseToken;
39
21
  toChainId: number;
package/dist/bridges.js CHANGED
@@ -1,19 +1 @@
1
- /**
2
- * @deprecated
3
- * These values are now obtainable from the LI.FI API
4
- */
5
- export var BridgeTool;
6
- (function (BridgeTool) {
7
- BridgeTool["connext"] = "connext";
8
- BridgeTool["hop"] = "hop";
9
- BridgeTool["multichain"] = "multichain";
10
- BridgeTool["cbridge"] = "cbridge";
11
- BridgeTool["hyphen"] = "hyphen";
12
- BridgeTool["polygon"] = "polygon";
13
- BridgeTool["arbitrum"] = "arbitrum";
14
- BridgeTool["avalanche"] = "avalanche";
15
- BridgeTool["optimism"] = "optimism";
16
- BridgeTool["across"] = "across";
17
- BridgeTool["portal"] = "portal";
18
- BridgeTool["stargate"] = "stargate";
19
- })(BridgeTool || (BridgeTool = {}));
1
+ export {};
@@ -1,4 +1,5 @@
1
- import { ChainKey, CoinKey } from '../base';
1
+ import { CoinKey } from '../tokens/base';
2
+ import { ChainKey } from './base';
2
3
  export declare enum ChainType {
3
4
  EVM = "EVM",
4
5
  Solana = "SOLANA"
@@ -1,61 +1,3 @@
1
- export declare enum CoinKey {
2
- ETH = "ETH",
3
- MATIC = "MATIC",
4
- BNB = "BNB",
5
- DAI = "DAI",
6
- FTM = "FTM",
7
- OKT = "OKT",
8
- AVAX = "AVAX",
9
- HT = "HT",
10
- ONE = "ONE",
11
- FSN = "FSN",
12
- MOVR = "MOVR",
13
- EXP = "EXP",
14
- TCH = "TCH",
15
- UBQ = "UBQ",
16
- META = "META",
17
- DIODE = "DIODE",
18
- CELO = "CELO",
19
- FUSE = "FUSE",
20
- TLOS = "TLOS",
21
- CRO = "CRO",
22
- SHIB = "SHIB",
23
- L1 = "L1",
24
- RBTC = "RBTC",
25
- TBG = "TBG",
26
- VLX = "VLX",
27
- GLMR = "GLMR",
28
- METIS = "METIS",
29
- SOL = "SOL",
30
- EVM = "EVM",
31
- USDT = "USDT",
32
- USDC = "USDC",
33
- cbtUSDC = "cbtUSDC",
34
- cbtUSDT = "cbtUSDT",
35
- cbtWUSDT = "cbtWUSDT",
36
- cbtWUSDC = "cbtWUSDC",
37
- cbtCELR = "cbtCELR",
38
- BUSD = "BUSD",
39
- USDCe = "USDCe",
40
- TEST = "TEST",
41
- KAL = "KAL",
42
- SDIODE = "SDIODE",
43
- SPARK = "SPARK",
44
- TRBTC = "TRBTC",
45
- CXTT = "CXTT",
46
- sgMETIS = "sgMETIS",
47
- sgWOO = "sgWOO",
48
- sgUSDT = "sgUSDT",
49
- sgBUSD = "sgBUSD",
50
- sgUSDC = "sgUSDC",
51
- WBTC = "WBTC",
52
- WETH = "WETH",
53
- SUSHI = "SUSHI",
54
- DODO = "DODO",
55
- MCB = "MCB",
56
- CELR = "CELR",
57
- IF = "IF"
58
- }
59
1
  export declare enum ChainKey {
60
2
  ETH = "eth",
61
3
  POL = "pol",
@@ -178,30 +120,3 @@ export declare enum ChainId {
178
120
  FTMT = 4002,
179
121
  LNAT = 59140
180
122
  }
181
- export interface BaseToken {
182
- chainId: ChainId;
183
- address: string;
184
- }
185
- export interface StaticToken extends BaseToken {
186
- symbol: string;
187
- decimals: number;
188
- name: string;
189
- coinKey?: CoinKey;
190
- logoURI?: string;
191
- }
192
- export interface Token extends StaticToken {
193
- priceUSD: string;
194
- }
195
- export interface TokenAmount extends Token {
196
- amount?: bigint;
197
- blockNumber?: bigint;
198
- }
199
- export interface Coin {
200
- key: CoinKey;
201
- name: string;
202
- logoURI: string;
203
- verified: boolean;
204
- chains: {
205
- [ChainId: string]: StaticToken;
206
- };
207
- }
@@ -1,66 +1,3 @@
1
- export var CoinKey;
2
- (function (CoinKey) {
3
- CoinKey["ETH"] = "ETH";
4
- CoinKey["MATIC"] = "MATIC";
5
- CoinKey["BNB"] = "BNB";
6
- CoinKey["DAI"] = "DAI";
7
- CoinKey["FTM"] = "FTM";
8
- CoinKey["OKT"] = "OKT";
9
- CoinKey["AVAX"] = "AVAX";
10
- CoinKey["HT"] = "HT";
11
- CoinKey["ONE"] = "ONE";
12
- CoinKey["FSN"] = "FSN";
13
- CoinKey["MOVR"] = "MOVR";
14
- CoinKey["EXP"] = "EXP";
15
- CoinKey["TCH"] = "TCH";
16
- CoinKey["UBQ"] = "UBQ";
17
- CoinKey["META"] = "META";
18
- CoinKey["DIODE"] = "DIODE";
19
- CoinKey["CELO"] = "CELO";
20
- CoinKey["FUSE"] = "FUSE";
21
- CoinKey["TLOS"] = "TLOS";
22
- CoinKey["CRO"] = "CRO";
23
- CoinKey["SHIB"] = "SHIB";
24
- CoinKey["L1"] = "L1";
25
- CoinKey["RBTC"] = "RBTC";
26
- CoinKey["TBG"] = "TBG";
27
- CoinKey["VLX"] = "VLX";
28
- CoinKey["GLMR"] = "GLMR";
29
- CoinKey["METIS"] = "METIS";
30
- CoinKey["SOL"] = "SOL";
31
- CoinKey["EVM"] = "EVM";
32
- // Stable coins
33
- CoinKey["USDT"] = "USDT";
34
- CoinKey["USDC"] = "USDC";
35
- CoinKey["cbtUSDC"] = "cbtUSDC";
36
- CoinKey["cbtUSDT"] = "cbtUSDT";
37
- CoinKey["cbtWUSDT"] = "cbtWUSDT";
38
- CoinKey["cbtWUSDC"] = "cbtWUSDC";
39
- CoinKey["cbtCELR"] = "cbtCELR";
40
- CoinKey["BUSD"] = "BUSD";
41
- CoinKey["USDCe"] = "USDCe";
42
- // Testnet
43
- CoinKey["TEST"] = "TEST";
44
- CoinKey["KAL"] = "KAL";
45
- CoinKey["SDIODE"] = "SDIODE";
46
- CoinKey["SPARK"] = "SPARK";
47
- CoinKey["TRBTC"] = "TRBTC";
48
- CoinKey["CXTT"] = "CXTT";
49
- // stargate testnet tokens
50
- CoinKey["sgMETIS"] = "sgMETIS";
51
- CoinKey["sgWOO"] = "sgWOO";
52
- CoinKey["sgUSDT"] = "sgUSDT";
53
- CoinKey["sgBUSD"] = "sgBUSD";
54
- CoinKey["sgUSDC"] = "sgUSDC";
55
- // Other tokens
56
- CoinKey["WBTC"] = "WBTC";
57
- CoinKey["WETH"] = "WETH";
58
- CoinKey["SUSHI"] = "SUSHI";
59
- CoinKey["DODO"] = "DODO";
60
- CoinKey["MCB"] = "MCB";
61
- CoinKey["CELR"] = "CELR";
62
- CoinKey["IF"] = "IF";
63
- })(CoinKey || (CoinKey = {}));
64
1
  export var ChainKey;
65
2
  (function (ChainKey) {
66
3
  ChainKey["ETH"] = "eth";
package/dist/cjs/api.d.ts CHANGED
@@ -1,5 +1,9 @@
1
- import { BridgeDefinition, Chain, ChainId, ExchangeDefinition, LifiStep, Token } from '.';
2
- import { ToolError } from './apiErrors';
1
+ import { BridgeDefinition } from './bridges';
2
+ import { Chain } from './chains';
3
+ import { ChainId } from './chains/base';
4
+ import { ExchangeDefinition } from './exchanges';
5
+ import { Action, LifiStep } from './step';
6
+ import { Token } from './tokens';
3
7
  /**
4
8
  * Used as a bigint replacement for TransactionRequest because bigint is not serializable
5
9
  */
@@ -37,18 +41,18 @@ export interface RoutesRequest {
37
41
  fromAmountForGas?: string;
38
42
  }
39
43
  export interface RouteOptions {
44
+ integrator?: string;
45
+ fee?: number;
46
+ insurance?: boolean;
47
+ maxPriceImpact?: number;
40
48
  order?: Order;
41
49
  slippage?: number;
50
+ referrer?: string;
42
51
  infiniteApproval?: boolean;
43
52
  allowSwitchChain?: boolean;
44
- integrator?: string;
45
53
  allowDestinationCall?: boolean;
46
- referrer?: string;
47
54
  bridges?: AllowDenyPrefer;
48
55
  exchanges?: AllowDenyPrefer;
49
- fee?: number;
50
- insurance?: boolean;
51
- maxPriceImpact?: number;
52
56
  }
53
57
  export type ToolsResponse = {
54
58
  exchanges: {
@@ -98,6 +102,14 @@ export interface Route {
98
102
  steps: LifiStep[];
99
103
  tags?: Order[];
100
104
  }
105
+ export type ToolErrorType = 'NO_QUOTE';
106
+ export interface ToolError {
107
+ errorType: ToolErrorType;
108
+ code: string;
109
+ action: Action;
110
+ tool: string;
111
+ message: string;
112
+ }
101
113
  export type ErroredPaths = {
102
114
  [subpath: string]: ToolError[];
103
115
  };
@@ -249,16 +261,13 @@ export interface PendingReceivingInfo {
249
261
  }
250
262
  declare const _StatusMessage: readonly ["NOT_FOUND", "INVALID", "PENDING", "DONE", "FAILED"];
251
263
  export type StatusMessage = (typeof _StatusMessage)[number];
252
- declare const _SubstatusPending: readonly ["WAIT_SOURCE_CONFIRMATIONS", "WAIT_DESTINATION_TRANSACTION", "BRIDGE_NOT_AVAILABLE", "CHAIN_NOT_AVAILABLE", "REFUND_IN_PROGRESS", "UNKNOWN_ERROR"];
264
+ declare const _SubstatusPending: readonly ["WAIT_SOURCE_CONFIRMATIONS", "WAIT_DESTINATION_TRANSACTION", "BRIDGE_NOT_AVAILABLE", "CHAIN_NOT_AVAILABLE", "NOT_PROCESSABLE_REFUND_NEEDED", "REFUND_IN_PROGRESS", "UNKNOWN_ERROR"];
253
265
  export type SubstatusPending = (typeof _SubstatusPending)[number];
254
266
  declare const _SubstatusDone: readonly ["COMPLETED", "PARTIAL", "REFUNDED"];
255
267
  export type SubstatusDone = (typeof _SubstatusDone)[number];
256
- declare const _SubstatusFailed: readonly ["NOT_PROCESSABLE_REFUND_NEEDED"];
257
- export type SubstatusFailed = (typeof _SubstatusFailed)[number];
258
- export type Substatus = SubstatusPending | SubstatusDone | SubstatusFailed;
259
- export declare const isSubstatusPending: (substatus: Substatus) => substatus is "WAIT_SOURCE_CONFIRMATIONS" | "WAIT_DESTINATION_TRANSACTION" | "BRIDGE_NOT_AVAILABLE" | "CHAIN_NOT_AVAILABLE" | "REFUND_IN_PROGRESS" | "UNKNOWN_ERROR";
268
+ export type Substatus = SubstatusPending | SubstatusDone;
269
+ export declare const isSubstatusPending: (substatus: Substatus) => substatus is "WAIT_SOURCE_CONFIRMATIONS" | "WAIT_DESTINATION_TRANSACTION" | "BRIDGE_NOT_AVAILABLE" | "CHAIN_NOT_AVAILABLE" | "NOT_PROCESSABLE_REFUND_NEEDED" | "REFUND_IN_PROGRESS" | "UNKNOWN_ERROR";
260
270
  export declare const isSubstatusDone: (substatus: Substatus) => substatus is "COMPLETED" | "PARTIAL" | "REFUNDED";
261
- export declare const isSubstatusFailed: (substatus: Substatus) => substatus is "NOT_PROCESSABLE_REFUND_NEEDED";
262
271
  export interface BaseStatusData {
263
272
  status: StatusMessage;
264
273
  substatus?: Substatus;
package/dist/cjs/api.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isSubstatusFailed = exports.isSubstatusDone = exports.isSubstatusPending = exports._InsuranceState = exports.Orders = void 0;
3
+ exports.isSubstatusDone = exports.isSubstatusPending = exports._InsuranceState = exports.Orders = void 0;
4
4
  exports.Orders = ['RECOMMENDED', 'FASTEST', 'CHEAPEST', 'SAFEST'];
5
5
  exports._InsuranceState = [
6
6
  'INSURED',
@@ -28,6 +28,8 @@ const _SubstatusPending = [
28
28
  'BRIDGE_NOT_AVAILABLE',
29
29
  // The RPC for source/destination chain is temporarily unavailable
30
30
  'CHAIN_NOT_AVAILABLE',
31
+ // The transfer cannot be completed, a refund is required
32
+ 'NOT_PROCESSABLE_REFUND_NEEDED',
31
33
  // A refund has been requested and is in progress
32
34
  'REFUND_IN_PROGRESS',
33
35
  // We cannot determine the status of the transfer
@@ -43,14 +45,8 @@ const _SubstatusDone = [
43
45
  // The transfer was not successful but it has been refunded
44
46
  'REFUNDED',
45
47
  ];
46
- const _SubstatusFailed = [
47
- // The transfer cannot be completed, a refund is required
48
- 'NOT_PROCESSABLE_REFUND_NEEDED',
49
- ];
50
48
  const isSubstatusPending = (substatus) => _SubstatusPending.includes(substatus);
51
49
  exports.isSubstatusPending = isSubstatusPending;
52
50
  const isSubstatusDone = (substatus) => _SubstatusDone.includes(substatus);
53
51
  exports.isSubstatusDone = isSubstatusDone;
54
- const isSubstatusFailed = (substatus) => _SubstatusFailed.includes(substatus);
55
- exports.isSubstatusFailed = isSubstatusFailed;
56
52
  const _LIFuelState = ['PENDING', 'DONE', 'NOT_FOUND'];
@@ -1,24 +1,6 @@
1
- import { BaseToken } from './base';
2
- /**
3
- * @deprecated
4
- * These values are now obtainable from the LI.FI API
5
- */
6
- export declare enum BridgeTool {
7
- connext = "connext",
8
- hop = "hop",
9
- multichain = "multichain",
10
- cbridge = "cbridge",
11
- hyphen = "hyphen",
12
- polygon = "polygon",
13
- arbitrum = "arbitrum",
14
- avalanche = "avalanche",
15
- optimism = "optimism",
16
- across = "across",
17
- portal = "portal",
18
- stargate = "stargate"
19
- }
1
+ import { BaseToken } from './tokens/token';
20
2
  export interface Bridge {
21
- key: BridgeTool;
3
+ key: string;
22
4
  name: string;
23
5
  logoURI: string;
24
6
  bridgeUrl?: string;
@@ -33,7 +15,7 @@ export interface Bridge {
33
15
  * @deprecated
34
16
  */
35
17
  export interface BridgeDefinition {
36
- tool: BridgeTool;
18
+ tool: string;
37
19
  fromChainId: number;
38
20
  fromToken: BaseToken;
39
21
  toChainId: number;
@@ -1,22 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BridgeTool = void 0;
4
- /**
5
- * @deprecated
6
- * These values are now obtainable from the LI.FI API
7
- */
8
- var BridgeTool;
9
- (function (BridgeTool) {
10
- BridgeTool["connext"] = "connext";
11
- BridgeTool["hop"] = "hop";
12
- BridgeTool["multichain"] = "multichain";
13
- BridgeTool["cbridge"] = "cbridge";
14
- BridgeTool["hyphen"] = "hyphen";
15
- BridgeTool["polygon"] = "polygon";
16
- BridgeTool["arbitrum"] = "arbitrum";
17
- BridgeTool["avalanche"] = "avalanche";
18
- BridgeTool["optimism"] = "optimism";
19
- BridgeTool["across"] = "across";
20
- BridgeTool["portal"] = "portal";
21
- BridgeTool["stargate"] = "stargate";
22
- })(BridgeTool || (exports.BridgeTool = BridgeTool = {}));
@@ -1,4 +1,5 @@
1
- import { ChainKey, CoinKey } from '../base';
1
+ import { CoinKey } from '../tokens/base';
2
+ import { ChainKey } from './base';
2
3
  export declare enum ChainType {
3
4
  EVM = "EVM",
4
5
  Solana = "SOLANA"
@@ -1,61 +1,3 @@
1
- export declare enum CoinKey {
2
- ETH = "ETH",
3
- MATIC = "MATIC",
4
- BNB = "BNB",
5
- DAI = "DAI",
6
- FTM = "FTM",
7
- OKT = "OKT",
8
- AVAX = "AVAX",
9
- HT = "HT",
10
- ONE = "ONE",
11
- FSN = "FSN",
12
- MOVR = "MOVR",
13
- EXP = "EXP",
14
- TCH = "TCH",
15
- UBQ = "UBQ",
16
- META = "META",
17
- DIODE = "DIODE",
18
- CELO = "CELO",
19
- FUSE = "FUSE",
20
- TLOS = "TLOS",
21
- CRO = "CRO",
22
- SHIB = "SHIB",
23
- L1 = "L1",
24
- RBTC = "RBTC",
25
- TBG = "TBG",
26
- VLX = "VLX",
27
- GLMR = "GLMR",
28
- METIS = "METIS",
29
- SOL = "SOL",
30
- EVM = "EVM",
31
- USDT = "USDT",
32
- USDC = "USDC",
33
- cbtUSDC = "cbtUSDC",
34
- cbtUSDT = "cbtUSDT",
35
- cbtWUSDT = "cbtWUSDT",
36
- cbtWUSDC = "cbtWUSDC",
37
- cbtCELR = "cbtCELR",
38
- BUSD = "BUSD",
39
- USDCe = "USDCe",
40
- TEST = "TEST",
41
- KAL = "KAL",
42
- SDIODE = "SDIODE",
43
- SPARK = "SPARK",
44
- TRBTC = "TRBTC",
45
- CXTT = "CXTT",
46
- sgMETIS = "sgMETIS",
47
- sgWOO = "sgWOO",
48
- sgUSDT = "sgUSDT",
49
- sgBUSD = "sgBUSD",
50
- sgUSDC = "sgUSDC",
51
- WBTC = "WBTC",
52
- WETH = "WETH",
53
- SUSHI = "SUSHI",
54
- DODO = "DODO",
55
- MCB = "MCB",
56
- CELR = "CELR",
57
- IF = "IF"
58
- }
59
1
  export declare enum ChainKey {
60
2
  ETH = "eth",
61
3
  POL = "pol",
@@ -178,30 +120,3 @@ export declare enum ChainId {
178
120
  FTMT = 4002,
179
121
  LNAT = 59140
180
122
  }
181
- export interface BaseToken {
182
- chainId: ChainId;
183
- address: string;
184
- }
185
- export interface StaticToken extends BaseToken {
186
- symbol: string;
187
- decimals: number;
188
- name: string;
189
- coinKey?: CoinKey;
190
- logoURI?: string;
191
- }
192
- export interface Token extends StaticToken {
193
- priceUSD: string;
194
- }
195
- export interface TokenAmount extends Token {
196
- amount?: bigint;
197
- blockNumber?: bigint;
198
- }
199
- export interface Coin {
200
- key: CoinKey;
201
- name: string;
202
- logoURI: string;
203
- verified: boolean;
204
- chains: {
205
- [ChainId: string]: StaticToken;
206
- };
207
- }
@@ -1,69 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ChainId = exports.ChainKey = exports.CoinKey = void 0;
4
- var CoinKey;
5
- (function (CoinKey) {
6
- CoinKey["ETH"] = "ETH";
7
- CoinKey["MATIC"] = "MATIC";
8
- CoinKey["BNB"] = "BNB";
9
- CoinKey["DAI"] = "DAI";
10
- CoinKey["FTM"] = "FTM";
11
- CoinKey["OKT"] = "OKT";
12
- CoinKey["AVAX"] = "AVAX";
13
- CoinKey["HT"] = "HT";
14
- CoinKey["ONE"] = "ONE";
15
- CoinKey["FSN"] = "FSN";
16
- CoinKey["MOVR"] = "MOVR";
17
- CoinKey["EXP"] = "EXP";
18
- CoinKey["TCH"] = "TCH";
19
- CoinKey["UBQ"] = "UBQ";
20
- CoinKey["META"] = "META";
21
- CoinKey["DIODE"] = "DIODE";
22
- CoinKey["CELO"] = "CELO";
23
- CoinKey["FUSE"] = "FUSE";
24
- CoinKey["TLOS"] = "TLOS";
25
- CoinKey["CRO"] = "CRO";
26
- CoinKey["SHIB"] = "SHIB";
27
- CoinKey["L1"] = "L1";
28
- CoinKey["RBTC"] = "RBTC";
29
- CoinKey["TBG"] = "TBG";
30
- CoinKey["VLX"] = "VLX";
31
- CoinKey["GLMR"] = "GLMR";
32
- CoinKey["METIS"] = "METIS";
33
- CoinKey["SOL"] = "SOL";
34
- CoinKey["EVM"] = "EVM";
35
- // Stable coins
36
- CoinKey["USDT"] = "USDT";
37
- CoinKey["USDC"] = "USDC";
38
- CoinKey["cbtUSDC"] = "cbtUSDC";
39
- CoinKey["cbtUSDT"] = "cbtUSDT";
40
- CoinKey["cbtWUSDT"] = "cbtWUSDT";
41
- CoinKey["cbtWUSDC"] = "cbtWUSDC";
42
- CoinKey["cbtCELR"] = "cbtCELR";
43
- CoinKey["BUSD"] = "BUSD";
44
- CoinKey["USDCe"] = "USDCe";
45
- // Testnet
46
- CoinKey["TEST"] = "TEST";
47
- CoinKey["KAL"] = "KAL";
48
- CoinKey["SDIODE"] = "SDIODE";
49
- CoinKey["SPARK"] = "SPARK";
50
- CoinKey["TRBTC"] = "TRBTC";
51
- CoinKey["CXTT"] = "CXTT";
52
- // stargate testnet tokens
53
- CoinKey["sgMETIS"] = "sgMETIS";
54
- CoinKey["sgWOO"] = "sgWOO";
55
- CoinKey["sgUSDT"] = "sgUSDT";
56
- CoinKey["sgBUSD"] = "sgBUSD";
57
- CoinKey["sgUSDC"] = "sgUSDC";
58
- // Other tokens
59
- CoinKey["WBTC"] = "WBTC";
60
- CoinKey["WETH"] = "WETH";
61
- CoinKey["SUSHI"] = "SUSHI";
62
- CoinKey["DODO"] = "DODO";
63
- CoinKey["MCB"] = "MCB";
64
- CoinKey["CELR"] = "CELR";
65
- CoinKey["IF"] = "IF";
66
- })(CoinKey || (exports.CoinKey = CoinKey = {}));
3
+ exports.ChainId = exports.ChainKey = void 0;
67
4
  var ChainKey;
68
5
  (function (ChainKey) {
69
6
  ChainKey["ETH"] = "eth";
@@ -1,28 +1,12 @@
1
1
  import { StaticToken } from '.';
2
- /**
3
- * @deprecated
4
- * These values are now obtainable from the LI.FI API
5
- */
6
- export declare enum ExchangeTool {
7
- oneinch = "1inch",
8
- paraswap = "paraswap",
9
- openocean = "openocean",
10
- zerox = "0x",
11
- dodo = "dodo"
12
- }
13
- /**
14
- * @deprecated
15
- * These values are now obtainable from the LI.FI API
16
- */
17
- export type ExchangeTools = ExchangeTool | string;
18
2
  export interface ExchangeAggregator {
19
- key: ExchangeTool;
3
+ key: string;
20
4
  name: string;
21
5
  logoURI: string;
22
6
  webUrl: string;
23
7
  }
24
8
  export interface Exchange {
25
- key: ExchangeTools;
9
+ key: string;
26
10
  name: string;
27
11
  chainId: number;
28
12
  logoURI: string;
@@ -35,6 +19,6 @@ export interface Exchange {
35
19
  baseTokens: readonly StaticToken[];
36
20
  }
37
21
  export interface ExchangeDefinition {
38
- tool: ExchangeTools;
22
+ tool: string;
39
23
  chains: number[];
40
24
  }
@@ -1,15 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ExchangeTool = void 0;
4
- /**
5
- * @deprecated
6
- * These values are now obtainable from the LI.FI API
7
- */
8
- var ExchangeTool;
9
- (function (ExchangeTool) {
10
- ExchangeTool["oneinch"] = "1inch";
11
- ExchangeTool["paraswap"] = "paraswap";
12
- ExchangeTool["openocean"] = "openocean";
13
- ExchangeTool["zerox"] = "0x";
14
- ExchangeTool["dodo"] = "dodo";
15
- })(ExchangeTool || (exports.ExchangeTool = ExchangeTool = {}));
@@ -1,8 +1,7 @@
1
1
  export * from './api';
2
- export * from './apiErrors';
3
- export * from './base';
4
2
  export * from './bridges';
5
3
  export * from './chains';
6
4
  export * from './exchanges';
7
5
  export * from './quests';
8
6
  export * from './step';
7
+ export * from './tokens/token';
package/dist/cjs/index.js CHANGED
@@ -15,10 +15,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./api"), exports);
18
- __exportStar(require("./apiErrors"), exports);
19
- __exportStar(require("./base"), exports);
20
18
  __exportStar(require("./bridges"), exports);
21
19
  __exportStar(require("./chains"), exports);
22
20
  __exportStar(require("./exchanges"), exports);
23
21
  __exportStar(require("./quests"), exports);
24
22
  __exportStar(require("./step"), exports);
23
+ __exportStar(require("./tokens/token"), exports);
@@ -1,5 +1,5 @@
1
1
  import { Substatus, TransactionRequest } from '.';
2
- import { Token } from './base';
2
+ import { Token } from './tokens/token';
3
3
  export interface FeeCost {
4
4
  name: string;
5
5
  description: string;
@@ -0,0 +1,58 @@
1
+ export declare enum CoinKey {
2
+ ETH = "ETH",
3
+ MATIC = "MATIC",
4
+ BNB = "BNB",
5
+ DAI = "DAI",
6
+ FTM = "FTM",
7
+ OKT = "OKT",
8
+ AVAX = "AVAX",
9
+ HT = "HT",
10
+ ONE = "ONE",
11
+ FSN = "FSN",
12
+ MOVR = "MOVR",
13
+ EXP = "EXP",
14
+ TCH = "TCH",
15
+ UBQ = "UBQ",
16
+ META = "META",
17
+ DIODE = "DIODE",
18
+ CELO = "CELO",
19
+ FUSE = "FUSE",
20
+ TLOS = "TLOS",
21
+ CRO = "CRO",
22
+ SHIB = "SHIB",
23
+ L1 = "L1",
24
+ RBTC = "RBTC",
25
+ TBG = "TBG",
26
+ VLX = "VLX",
27
+ GLMR = "GLMR",
28
+ METIS = "METIS",
29
+ SOL = "SOL",
30
+ EVM = "EVM",
31
+ USDT = "USDT",
32
+ USDC = "USDC",
33
+ cbtUSDC = "cbtUSDC",
34
+ cbtUSDT = "cbtUSDT",
35
+ cbtWUSDT = "cbtWUSDT",
36
+ cbtWUSDC = "cbtWUSDC",
37
+ cbtCELR = "cbtCELR",
38
+ BUSD = "BUSD",
39
+ USDCe = "USDCe",
40
+ TEST = "TEST",
41
+ KAL = "KAL",
42
+ SDIODE = "SDIODE",
43
+ SPARK = "SPARK",
44
+ TRBTC = "TRBTC",
45
+ CXTT = "CXTT",
46
+ sgMETIS = "sgMETIS",
47
+ sgWOO = "sgWOO",
48
+ sgUSDT = "sgUSDT",
49
+ sgBUSD = "sgBUSD",
50
+ sgUSDC = "sgUSDC",
51
+ WBTC = "WBTC",
52
+ WETH = "WETH",
53
+ SUSHI = "SUSHI",
54
+ DODO = "DODO",
55
+ MCB = "MCB",
56
+ CELR = "CELR",
57
+ IF = "IF"
58
+ }
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CoinKey = void 0;
4
+ var CoinKey;
5
+ (function (CoinKey) {
6
+ CoinKey["ETH"] = "ETH";
7
+ CoinKey["MATIC"] = "MATIC";
8
+ CoinKey["BNB"] = "BNB";
9
+ CoinKey["DAI"] = "DAI";
10
+ CoinKey["FTM"] = "FTM";
11
+ CoinKey["OKT"] = "OKT";
12
+ CoinKey["AVAX"] = "AVAX";
13
+ CoinKey["HT"] = "HT";
14
+ CoinKey["ONE"] = "ONE";
15
+ CoinKey["FSN"] = "FSN";
16
+ CoinKey["MOVR"] = "MOVR";
17
+ CoinKey["EXP"] = "EXP";
18
+ CoinKey["TCH"] = "TCH";
19
+ CoinKey["UBQ"] = "UBQ";
20
+ CoinKey["META"] = "META";
21
+ CoinKey["DIODE"] = "DIODE";
22
+ CoinKey["CELO"] = "CELO";
23
+ CoinKey["FUSE"] = "FUSE";
24
+ CoinKey["TLOS"] = "TLOS";
25
+ CoinKey["CRO"] = "CRO";
26
+ CoinKey["SHIB"] = "SHIB";
27
+ CoinKey["L1"] = "L1";
28
+ CoinKey["RBTC"] = "RBTC";
29
+ CoinKey["TBG"] = "TBG";
30
+ CoinKey["VLX"] = "VLX";
31
+ CoinKey["GLMR"] = "GLMR";
32
+ CoinKey["METIS"] = "METIS";
33
+ CoinKey["SOL"] = "SOL";
34
+ CoinKey["EVM"] = "EVM";
35
+ // Stable coins
36
+ CoinKey["USDT"] = "USDT";
37
+ CoinKey["USDC"] = "USDC";
38
+ CoinKey["cbtUSDC"] = "cbtUSDC";
39
+ CoinKey["cbtUSDT"] = "cbtUSDT";
40
+ CoinKey["cbtWUSDT"] = "cbtWUSDT";
41
+ CoinKey["cbtWUSDC"] = "cbtWUSDC";
42
+ CoinKey["cbtCELR"] = "cbtCELR";
43
+ CoinKey["BUSD"] = "BUSD";
44
+ CoinKey["USDCe"] = "USDCe";
45
+ // Testnet
46
+ CoinKey["TEST"] = "TEST";
47
+ CoinKey["KAL"] = "KAL";
48
+ CoinKey["SDIODE"] = "SDIODE";
49
+ CoinKey["SPARK"] = "SPARK";
50
+ CoinKey["TRBTC"] = "TRBTC";
51
+ CoinKey["CXTT"] = "CXTT";
52
+ // stargate testnet tokens
53
+ CoinKey["sgMETIS"] = "sgMETIS";
54
+ CoinKey["sgWOO"] = "sgWOO";
55
+ CoinKey["sgUSDT"] = "sgUSDT";
56
+ CoinKey["sgBUSD"] = "sgBUSD";
57
+ CoinKey["sgUSDC"] = "sgUSDC";
58
+ // Other tokens
59
+ CoinKey["WBTC"] = "WBTC";
60
+ CoinKey["WETH"] = "WETH";
61
+ CoinKey["SUSHI"] = "SUSHI";
62
+ CoinKey["DODO"] = "DODO";
63
+ CoinKey["MCB"] = "MCB";
64
+ CoinKey["CELR"] = "CELR";
65
+ CoinKey["IF"] = "IF";
66
+ })(CoinKey || (exports.CoinKey = CoinKey = {}));
@@ -0,0 +1,2 @@
1
+ export * from './base';
2
+ export * from './token';
@@ -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("./base"), exports);
18
+ __exportStar(require("./token"), exports);
@@ -0,0 +1,29 @@
1
+ import { ChainId } from '../chains/base';
2
+ import { CoinKey } from './base';
3
+ export interface BaseToken {
4
+ chainId: ChainId;
5
+ address: string;
6
+ }
7
+ export interface StaticToken extends BaseToken {
8
+ symbol: string;
9
+ decimals: number;
10
+ name: string;
11
+ coinKey?: CoinKey;
12
+ logoURI?: string;
13
+ }
14
+ export interface Token extends StaticToken {
15
+ priceUSD: string;
16
+ }
17
+ export interface TokenAmount extends Token {
18
+ amount?: bigint;
19
+ blockNumber?: bigint;
20
+ }
21
+ export interface Coin {
22
+ key: CoinKey;
23
+ name: string;
24
+ logoURI: string;
25
+ verified: boolean;
26
+ chains: {
27
+ [ChainId: string]: StaticToken;
28
+ };
29
+ }
@@ -1,28 +1,12 @@
1
1
  import { StaticToken } from '.';
2
- /**
3
- * @deprecated
4
- * These values are now obtainable from the LI.FI API
5
- */
6
- export declare enum ExchangeTool {
7
- oneinch = "1inch",
8
- paraswap = "paraswap",
9
- openocean = "openocean",
10
- zerox = "0x",
11
- dodo = "dodo"
12
- }
13
- /**
14
- * @deprecated
15
- * These values are now obtainable from the LI.FI API
16
- */
17
- export type ExchangeTools = ExchangeTool | string;
18
2
  export interface ExchangeAggregator {
19
- key: ExchangeTool;
3
+ key: string;
20
4
  name: string;
21
5
  logoURI: string;
22
6
  webUrl: string;
23
7
  }
24
8
  export interface Exchange {
25
- key: ExchangeTools;
9
+ key: string;
26
10
  name: string;
27
11
  chainId: number;
28
12
  logoURI: string;
@@ -35,6 +19,6 @@ export interface Exchange {
35
19
  baseTokens: readonly StaticToken[];
36
20
  }
37
21
  export interface ExchangeDefinition {
38
- tool: ExchangeTools;
22
+ tool: string;
39
23
  chains: number[];
40
24
  }
package/dist/exchanges.js CHANGED
@@ -1,12 +1 @@
1
- /**
2
- * @deprecated
3
- * These values are now obtainable from the LI.FI API
4
- */
5
- export var ExchangeTool;
6
- (function (ExchangeTool) {
7
- ExchangeTool["oneinch"] = "1inch";
8
- ExchangeTool["paraswap"] = "paraswap";
9
- ExchangeTool["openocean"] = "openocean";
10
- ExchangeTool["zerox"] = "0x";
11
- ExchangeTool["dodo"] = "dodo";
12
- })(ExchangeTool || (ExchangeTool = {}));
1
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  export * from './api';
2
- export * from './apiErrors';
3
- export * from './base';
4
2
  export * from './bridges';
5
3
  export * from './chains';
6
4
  export * from './exchanges';
7
5
  export * from './quests';
8
6
  export * from './step';
7
+ export * from './tokens/token';
package/dist/index.js CHANGED
@@ -1,8 +1,7 @@
1
1
  export * from './api';
2
- export * from './apiErrors';
3
- export * from './base';
4
2
  export * from './bridges';
5
3
  export * from './chains';
6
4
  export * from './exchanges';
7
5
  export * from './quests';
8
6
  export * from './step';
7
+ export * from './tokens/token';
package/dist/step.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Substatus, TransactionRequest } from '.';
2
- import { Token } from './base';
2
+ import { Token } from './tokens/token';
3
3
  export interface FeeCost {
4
4
  name: string;
5
5
  description: string;
@@ -0,0 +1,58 @@
1
+ export declare enum CoinKey {
2
+ ETH = "ETH",
3
+ MATIC = "MATIC",
4
+ BNB = "BNB",
5
+ DAI = "DAI",
6
+ FTM = "FTM",
7
+ OKT = "OKT",
8
+ AVAX = "AVAX",
9
+ HT = "HT",
10
+ ONE = "ONE",
11
+ FSN = "FSN",
12
+ MOVR = "MOVR",
13
+ EXP = "EXP",
14
+ TCH = "TCH",
15
+ UBQ = "UBQ",
16
+ META = "META",
17
+ DIODE = "DIODE",
18
+ CELO = "CELO",
19
+ FUSE = "FUSE",
20
+ TLOS = "TLOS",
21
+ CRO = "CRO",
22
+ SHIB = "SHIB",
23
+ L1 = "L1",
24
+ RBTC = "RBTC",
25
+ TBG = "TBG",
26
+ VLX = "VLX",
27
+ GLMR = "GLMR",
28
+ METIS = "METIS",
29
+ SOL = "SOL",
30
+ EVM = "EVM",
31
+ USDT = "USDT",
32
+ USDC = "USDC",
33
+ cbtUSDC = "cbtUSDC",
34
+ cbtUSDT = "cbtUSDT",
35
+ cbtWUSDT = "cbtWUSDT",
36
+ cbtWUSDC = "cbtWUSDC",
37
+ cbtCELR = "cbtCELR",
38
+ BUSD = "BUSD",
39
+ USDCe = "USDCe",
40
+ TEST = "TEST",
41
+ KAL = "KAL",
42
+ SDIODE = "SDIODE",
43
+ SPARK = "SPARK",
44
+ TRBTC = "TRBTC",
45
+ CXTT = "CXTT",
46
+ sgMETIS = "sgMETIS",
47
+ sgWOO = "sgWOO",
48
+ sgUSDT = "sgUSDT",
49
+ sgBUSD = "sgBUSD",
50
+ sgUSDC = "sgUSDC",
51
+ WBTC = "WBTC",
52
+ WETH = "WETH",
53
+ SUSHI = "SUSHI",
54
+ DODO = "DODO",
55
+ MCB = "MCB",
56
+ CELR = "CELR",
57
+ IF = "IF"
58
+ }
@@ -0,0 +1,63 @@
1
+ export var CoinKey;
2
+ (function (CoinKey) {
3
+ CoinKey["ETH"] = "ETH";
4
+ CoinKey["MATIC"] = "MATIC";
5
+ CoinKey["BNB"] = "BNB";
6
+ CoinKey["DAI"] = "DAI";
7
+ CoinKey["FTM"] = "FTM";
8
+ CoinKey["OKT"] = "OKT";
9
+ CoinKey["AVAX"] = "AVAX";
10
+ CoinKey["HT"] = "HT";
11
+ CoinKey["ONE"] = "ONE";
12
+ CoinKey["FSN"] = "FSN";
13
+ CoinKey["MOVR"] = "MOVR";
14
+ CoinKey["EXP"] = "EXP";
15
+ CoinKey["TCH"] = "TCH";
16
+ CoinKey["UBQ"] = "UBQ";
17
+ CoinKey["META"] = "META";
18
+ CoinKey["DIODE"] = "DIODE";
19
+ CoinKey["CELO"] = "CELO";
20
+ CoinKey["FUSE"] = "FUSE";
21
+ CoinKey["TLOS"] = "TLOS";
22
+ CoinKey["CRO"] = "CRO";
23
+ CoinKey["SHIB"] = "SHIB";
24
+ CoinKey["L1"] = "L1";
25
+ CoinKey["RBTC"] = "RBTC";
26
+ CoinKey["TBG"] = "TBG";
27
+ CoinKey["VLX"] = "VLX";
28
+ CoinKey["GLMR"] = "GLMR";
29
+ CoinKey["METIS"] = "METIS";
30
+ CoinKey["SOL"] = "SOL";
31
+ CoinKey["EVM"] = "EVM";
32
+ // Stable coins
33
+ CoinKey["USDT"] = "USDT";
34
+ CoinKey["USDC"] = "USDC";
35
+ CoinKey["cbtUSDC"] = "cbtUSDC";
36
+ CoinKey["cbtUSDT"] = "cbtUSDT";
37
+ CoinKey["cbtWUSDT"] = "cbtWUSDT";
38
+ CoinKey["cbtWUSDC"] = "cbtWUSDC";
39
+ CoinKey["cbtCELR"] = "cbtCELR";
40
+ CoinKey["BUSD"] = "BUSD";
41
+ CoinKey["USDCe"] = "USDCe";
42
+ // Testnet
43
+ CoinKey["TEST"] = "TEST";
44
+ CoinKey["KAL"] = "KAL";
45
+ CoinKey["SDIODE"] = "SDIODE";
46
+ CoinKey["SPARK"] = "SPARK";
47
+ CoinKey["TRBTC"] = "TRBTC";
48
+ CoinKey["CXTT"] = "CXTT";
49
+ // stargate testnet tokens
50
+ CoinKey["sgMETIS"] = "sgMETIS";
51
+ CoinKey["sgWOO"] = "sgWOO";
52
+ CoinKey["sgUSDT"] = "sgUSDT";
53
+ CoinKey["sgBUSD"] = "sgBUSD";
54
+ CoinKey["sgUSDC"] = "sgUSDC";
55
+ // Other tokens
56
+ CoinKey["WBTC"] = "WBTC";
57
+ CoinKey["WETH"] = "WETH";
58
+ CoinKey["SUSHI"] = "SUSHI";
59
+ CoinKey["DODO"] = "DODO";
60
+ CoinKey["MCB"] = "MCB";
61
+ CoinKey["CELR"] = "CELR";
62
+ CoinKey["IF"] = "IF";
63
+ })(CoinKey || (CoinKey = {}));
@@ -0,0 +1,2 @@
1
+ export * from './base';
2
+ export * from './token';
@@ -0,0 +1,2 @@
1
+ export * from './base';
2
+ export * from './token';
@@ -0,0 +1,29 @@
1
+ import { ChainId } from '../chains/base';
2
+ import { CoinKey } from './base';
3
+ export interface BaseToken {
4
+ chainId: ChainId;
5
+ address: string;
6
+ }
7
+ export interface StaticToken extends BaseToken {
8
+ symbol: string;
9
+ decimals: number;
10
+ name: string;
11
+ coinKey?: CoinKey;
12
+ logoURI?: string;
13
+ }
14
+ export interface Token extends StaticToken {
15
+ priceUSD: string;
16
+ }
17
+ export interface TokenAmount extends Token {
18
+ amount?: bigint;
19
+ blockNumber?: bigint;
20
+ }
21
+ export interface Coin {
22
+ key: CoinKey;
23
+ name: string;
24
+ logoURI: string;
25
+ verified: boolean;
26
+ chains: {
27
+ [ChainId: string]: StaticToken;
28
+ };
29
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifi/types",
3
- "version": "9.0.0-alpha.4",
3
+ "version": "9.0.0-alpha.6",
4
4
  "description": "Types for the LI.FI stack",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/index.js",
@@ -1,9 +0,0 @@
1
- import { Action } from './step';
2
- export type ToolErrorType = 'NO_QUOTE';
3
- export interface ToolError {
4
- errorType: ToolErrorType;
5
- code: string;
6
- action: Action;
7
- tool: string;
8
- message: string;
9
- }
@@ -1,9 +0,0 @@
1
- import { Action } from './step';
2
- export type ToolErrorType = 'NO_QUOTE';
3
- export interface ToolError {
4
- errorType: ToolErrorType;
5
- code: string;
6
- action: Action;
7
- tool: string;
8
- message: string;
9
- }
File without changes
File without changes