@lifi/types 8.3.0 → 9.0.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.
Files changed (46) hide show
  1. package/CHANGELOG.md +0 -7
  2. package/dist/api.d.ts +25 -4
  3. package/dist/api.js +5 -2
  4. package/dist/base.d.ts +2 -24
  5. package/dist/bridges.d.ts +14 -2
  6. package/dist/bridges.js +0 -148
  7. package/dist/chains/EVMChain.d.ts +0 -1
  8. package/dist/chains/EVMChain.js +1 -4
  9. package/dist/chains/index.d.ts +0 -2
  10. package/dist/chains/index.js +0 -2
  11. package/dist/cjs/api.d.ts +25 -4
  12. package/dist/cjs/api.js +7 -3
  13. package/dist/cjs/base.d.ts +2 -24
  14. package/dist/cjs/bridges.d.ts +14 -2
  15. package/dist/cjs/bridges.js +1 -149
  16. package/dist/cjs/chains/EVMChain.d.ts +0 -1
  17. package/dist/cjs/chains/EVMChain.js +0 -6
  18. package/dist/cjs/chains/index.d.ts +0 -2
  19. package/dist/cjs/chains/index.js +0 -2
  20. package/dist/cjs/exchanges.d.ts +4 -14
  21. package/dist/cjs/exchanges.js +1 -1090
  22. package/dist/cjs/index.d.ts +3 -5
  23. package/dist/cjs/index.js +3 -5
  24. package/dist/cjs/step.d.ts +8 -6
  25. package/dist/exchanges.d.ts +4 -14
  26. package/dist/exchanges.js +0 -1088
  27. package/dist/index.d.ts +3 -5
  28. package/dist/index.js +3 -5
  29. package/dist/step.d.ts +8 -6
  30. package/package.json +12 -15
  31. package/dist/chains/chain.utils.d.ts +0 -4
  32. package/dist/chains/chain.utils.js +0 -21
  33. package/dist/chains/supported.chains.d.ts +0 -5
  34. package/dist/chains/supported.chains.js +0 -1166
  35. package/dist/cjs/chains/chain.utils.d.ts +0 -4
  36. package/dist/cjs/chains/chain.utils.js +0 -26
  37. package/dist/cjs/chains/supported.chains.d.ts +0 -5
  38. package/dist/cjs/chains/supported.chains.js +0 -1169
  39. package/dist/cjs/coins.d.ts +0 -9
  40. package/dist/cjs/coins.js +0 -1841
  41. package/dist/cjs/multicall.d.ts +0 -3
  42. package/dist/cjs/multicall.js +0 -79
  43. package/dist/coins.d.ts +0 -9
  44. package/dist/coins.js +0 -1834
  45. package/dist/multicall.d.ts +0 -3
  46. package/dist/multicall.js +0 -76
package/CHANGELOG.md CHANGED
@@ -2,13 +2,6 @@
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
-
12
5
  ## [8.2.0](https://github.com/lifinance/types/compare/v8.0.4...v8.2.0) (2023-07-26)
13
6
 
14
7
 
package/dist/api.d.ts CHANGED
@@ -1,6 +1,24 @@
1
- import { TransactionRequest } from '@ethersproject/providers';
2
1
  import { BridgeDefinition, Chain, ChainId, ExchangeDefinition, LifiStep, Token } from '.';
3
2
  import { ToolError } from './apiErrors';
3
+ export type TransactionRequest = {
4
+ to?: string;
5
+ from?: string;
6
+ nonce?: number;
7
+ gasLimit?: bigint;
8
+ gasPrice?: bigint;
9
+ data?: `0x${string}`;
10
+ value?: bigint;
11
+ chainId?: number;
12
+ type?: number;
13
+ accessList?: {
14
+ address: `0x${string}`;
15
+ storageKeys: `0x${string}`[];
16
+ }[];
17
+ maxPriorityFeePerGas?: bigint;
18
+ maxFeePerGas?: bigint;
19
+ customData?: Record<string, any>;
20
+ ccipReadEnabled?: boolean;
21
+ };
4
22
  export declare const Orders: readonly ["RECOMMENDED", "FASTEST", "CHEAPEST", "SAFEST"];
5
23
  export type Order = (typeof Orders)[number];
6
24
  export interface RoutesRequest {
@@ -227,13 +245,16 @@ export interface PendingReceivingInfo {
227
245
  }
228
246
  declare const _StatusMessage: readonly ["NOT_FOUND", "INVALID", "PENDING", "DONE", "FAILED"];
229
247
  export type StatusMessage = (typeof _StatusMessage)[number];
230
- 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"];
248
+ declare const _SubstatusPending: readonly ["WAIT_SOURCE_CONFIRMATIONS", "WAIT_DESTINATION_TRANSACTION", "BRIDGE_NOT_AVAILABLE", "CHAIN_NOT_AVAILABLE", "REFUND_IN_PROGRESS", "UNKNOWN_ERROR"];
231
249
  export type SubstatusPending = (typeof _SubstatusPending)[number];
232
250
  declare const _SubstatusDone: readonly ["COMPLETED", "PARTIAL", "REFUNDED"];
233
251
  export type SubstatusDone = (typeof _SubstatusDone)[number];
234
- export type Substatus = SubstatusPending | SubstatusDone;
235
- export declare const isSubstatusPending: (substatus: Substatus) => substatus is "UNKNOWN_ERROR" | "WAIT_SOURCE_CONFIRMATIONS" | "WAIT_DESTINATION_TRANSACTION" | "BRIDGE_NOT_AVAILABLE" | "CHAIN_NOT_AVAILABLE" | "NOT_PROCESSABLE_REFUND_NEEDED" | "REFUND_IN_PROGRESS";
252
+ declare const _SubstatusFailed: readonly ["NOT_PROCESSABLE_REFUND_NEEDED"];
253
+ export type SubstatusFailed = (typeof _SubstatusFailed)[number];
254
+ export type Substatus = SubstatusPending | SubstatusDone | SubstatusFailed;
255
+ 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";
236
256
  export declare const isSubstatusDone: (substatus: Substatus) => substatus is "COMPLETED" | "PARTIAL" | "REFUNDED";
257
+ export declare const isSubstatusFailed: (substatus: Substatus) => substatus is "NOT_PROCESSABLE_REFUND_NEEDED";
237
258
  export interface BaseStatusData {
238
259
  status: StatusMessage;
239
260
  substatus?: Substatus;
package/dist/api.js CHANGED
@@ -25,8 +25,6 @@ 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',
30
28
  // A refund has been requested and is in progress
31
29
  'REFUND_IN_PROGRESS',
32
30
  // We cannot determine the status of the transfer
@@ -42,6 +40,11 @@ const _SubstatusDone = [
42
40
  // The transfer was not successful but it has been refunded
43
41
  'REFUNDED',
44
42
  ];
43
+ const _SubstatusFailed = [
44
+ // The transfer cannot be completed, a refund is required
45
+ 'NOT_PROCESSABLE_REFUND_NEEDED',
46
+ ];
45
47
  export const isSubstatusPending = (substatus) => _SubstatusPending.includes(substatus);
46
48
  export const isSubstatusDone = (substatus) => _SubstatusDone.includes(substatus);
49
+ export const isSubstatusFailed = (substatus) => _SubstatusFailed.includes(substatus);
47
50
  const _LIFuelState = ['PENDING', 'DONE', 'NOT_FOUND'];
package/dist/base.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- import { BridgeTool } from './bridges';
2
- import { ExchangeTools } from './exchanges';
3
1
  export declare enum CoinKey {
4
2
  ETH = "ETH",
5
3
  MATIC = "MATIC",
@@ -195,8 +193,8 @@ export interface Token extends StaticToken {
195
193
  priceUSD: string;
196
194
  }
197
195
  export interface TokenAmount extends Token {
198
- amount: string;
199
- blockNumber?: number;
196
+ amount?: bigint;
197
+ blockNumber?: bigint;
200
198
  }
201
199
  export interface Coin {
202
200
  key: CoinKey;
@@ -207,23 +205,3 @@ export interface Coin {
207
205
  [ChainId: string]: StaticToken;
208
206
  };
209
207
  }
210
- export interface ExchangeDefinition {
211
- tool: ExchangeTools;
212
- chains: number[];
213
- }
214
- /**
215
- * Should not be accessed via the types package anymore
216
- * @deprecated
217
- */
218
- export interface BridgeDefinition {
219
- tool: BridgeTool;
220
- fromChainId: number;
221
- fromToken: BaseToken;
222
- toChainId: number;
223
- toToken: BaseToken;
224
- maximumTransfer: string;
225
- minimumTransfer: string;
226
- swapFeeRate: string;
227
- swapFeeMinimum: string;
228
- swapFeeMaximum: string;
229
- }
package/dist/bridges.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { BaseToken } from './base';
1
2
  /**
2
3
  * @deprecated
3
4
  * These values are now obtainable from the LI.FI API
@@ -28,7 +29,18 @@ export interface Bridge {
28
29
  analyticsUrl?: string;
29
30
  }
30
31
  /**
32
+ * Should not be accessed via the types package anymore
31
33
  * @deprecated
32
- * These values are now obtainable from the LI.FI API
33
34
  */
34
- export declare const supportedBridges: Array<Bridge>;
35
+ export interface BridgeDefinition {
36
+ tool: BridgeTool;
37
+ fromChainId: number;
38
+ fromToken: BaseToken;
39
+ toChainId: number;
40
+ toToken: BaseToken;
41
+ maximumTransfer: string;
42
+ minimumTransfer: string;
43
+ swapFeeRate: string;
44
+ swapFeeMinimum: string;
45
+ swapFeeMaximum: string;
46
+ }
package/dist/bridges.js CHANGED
@@ -17,151 +17,3 @@ export var BridgeTool;
17
17
  BridgeTool["portal"] = "portal";
18
18
  BridgeTool["stargate"] = "stargate";
19
19
  })(BridgeTool || (BridgeTool = {}));
20
- /**
21
- * @deprecated
22
- * These values are now obtainable from the LI.FI API
23
- */
24
- export const supportedBridges = [
25
- {
26
- key: BridgeTool.connext,
27
- name: 'Connext',
28
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/connext.png',
29
- bridgeUrl: 'https://xpollinate.io/',
30
- discordUrl: 'https://chat.connext.network/',
31
- supportUrl: 'https://www.notion.so/connext/Connext-NXTP-Support-19a357ebabdd4e888cfcd138fe3e4644',
32
- docsUrl: 'https://docs.connext.network/',
33
- explorerUrl: 'https://connextscan.io/',
34
- analyticsUrl: 'https://connextscan.io/',
35
- },
36
- {
37
- key: BridgeTool.hop,
38
- name: 'Hop',
39
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/hop.png',
40
- bridgeUrl: 'https://app.hop.exchange/',
41
- discordUrl: 'https://discord.gg/PwCF88emV4',
42
- supportUrl: 'https://help.hop.exchange/hc/en-us',
43
- docsUrl: 'https://docs.hop.exchange/',
44
- explorerUrl: 'https://explorer.hop.exchange/mainnet/',
45
- analyticsUrl: 'https://explorer.hop.exchange/mainnet/',
46
- },
47
- {
48
- key: BridgeTool.multichain,
49
- name: 'Multichain',
50
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/anyswap.png',
51
- bridgeUrl: 'https://app.multichain.org/',
52
- // discordUrl: '',
53
- supportUrl: 'https://multichain.zendesk.com/hc/en-us',
54
- docsUrl: 'https://docs.multichain.org/',
55
- explorerUrl: 'https://anyswap.net/',
56
- },
57
- {
58
- key: BridgeTool.cbridge,
59
- name: 'cBridge',
60
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/cbridge.png',
61
- bridgeUrl: 'https://cbridge.celer.network/',
62
- discordUrl: 'https://discord.com/invite/uGx4fjQ',
63
- supportUrl: 'https://form.typeform.com/to/Q4LMjUaK',
64
- docsUrl: 'https://cbridge-docs.celer.network/',
65
- // explorerUrl: '',
66
- analyticsUrl: 'https://cbridge-analytics.celer.network/',
67
- },
68
- {
69
- key: BridgeTool.hyphen,
70
- name: 'Hyphen',
71
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/hyphen.png',
72
- bridgeUrl: 'https://hyphen.biconomy.io/',
73
- discordUrl: 'https://discord.com/invite/HKHxgyEExQ',
74
- supportUrl: 'https://discord.com/invite/HKHxgyEExQ',
75
- docsUrl: 'https://docs.biconomy.io/products/hyphen-instant-cross-chain-transfers',
76
- // explorerUrl: '',
77
- analyticsUrl: 'https://hyphen-info.biconomy.io/',
78
- },
79
- {
80
- key: BridgeTool.polygon,
81
- name: 'Polygon Bridge (PoS)',
82
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/polygon.png',
83
- bridgeUrl: 'https://wallet.polygon.technology/bridge',
84
- // discordUrl: '',
85
- supportUrl: 'https://forum.matic.network/',
86
- docsUrl: 'https://docs.polygon.technology/docs/develop/ethereum-polygon/pos/getting-started',
87
- // explorerUrl: '',
88
- // analyticsUrl: '',
89
- },
90
- {
91
- key: BridgeTool.arbitrum,
92
- name: 'Arbitrum Bridge',
93
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/arbitrum.png',
94
- bridgeUrl: 'https://bridge.arbitrum.io/',
95
- discordUrl: 'https://discord.gg/ZpZuw7p',
96
- supportUrl: 'https://discord.gg/ZpZuw7p',
97
- docsUrl: 'https://developer.offchainlabs.com/docs/bridging_assets',
98
- // explorerUrl: '',
99
- },
100
- {
101
- key: BridgeTool.avalanche,
102
- name: 'AVAX Bridge',
103
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/avalanche.png',
104
- bridgeUrl: 'https://bridge.avax.network/',
105
- discordUrl: 'https://chat.avalabs.org/',
106
- supportUrl: 'https://docs.avax.network/learn/avalanche-bridge-faq/',
107
- docsUrl: 'https://docs.avax.network/learn/avalanche-bridge-faq/',
108
- // explorerUrl: '',
109
- // analyticsUrl: '',
110
- },
111
- {
112
- key: BridgeTool.optimism,
113
- name: 'Optimism Gateway',
114
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/optimism.png',
115
- bridgeUrl: 'https://gateway.optimism.io/',
116
- discordUrl: 'https://discord.com/invite/jrnFEvq',
117
- supportUrl: 'https://discord.com/invite/jrnFEvq',
118
- docsUrl: 'https://community.optimism.io/docs/developers/bridge/basics/',
119
- // explorerUrl: '',
120
- // analyticsUrl: '',
121
- },
122
- {
123
- key: BridgeTool.across,
124
- name: 'Across',
125
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/acrossv2.png',
126
- bridgeUrl: 'https://across.to/',
127
- discordUrl: 'https://discord.gg/t4SZySkn',
128
- supportUrl: 'https://discord.gg/t4SZySkn',
129
- docsUrl: 'https://docs.across.to/',
130
- },
131
- {
132
- key: BridgeTool.portal,
133
- name: 'Wormhole Portal',
134
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/wormhole_portal.png',
135
- bridgeUrl: 'https://portalbridge.com/',
136
- discordUrl: 'https://discord.com/invite/wormholecrypto',
137
- supportUrl: 'https://discord.com/invite/wormholecrypto',
138
- docsUrl: 'https://docs.wormholenetwork.com/wormhole/',
139
- },
140
- {
141
- key: BridgeTool.stargate,
142
- name: 'Stargate',
143
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/5685c638772f533edad80fcb210b4bb89e30a50f/src/assets/icons/bridges/stargate.png',
144
- bridgeUrl: 'https://stargate.finance/',
145
- discordUrl: 'https://discord.com/invite/TyjeQ45',
146
- supportUrl: 'https://discord.com/invite/TyjeQ45',
147
- docsUrl: 'https://stargateprotocol.gitbook.io/stargate/',
148
- },
149
- // {
150
- // key: BridgeTool.,
151
- // name: '',
152
- // logoURI:
153
- // 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/.png',
154
- // bridgeUrl: '',
155
- // discordUrl: '',
156
- // supportUrl: '',
157
- // docsUrl: '',
158
- // explorerUrl: '',
159
- // analyticsUrl: '',
160
- // },
161
- // for cronos chain, we should confirm if these bridges are available to integrate
162
- // https://bridge.evodefi.com/
163
- // https://app.relaychain.com/#/
164
- // for metis network, we should confirm these bridges as well
165
- // https://bridge.metis.io/home
166
- // https://apps.standard.tech/bridge
167
- ];
@@ -15,5 +15,4 @@ export interface AddEthereumChainParameter {
15
15
  };
16
16
  rpcUrls: string[];
17
17
  }
18
- export declare const prefixChainId: (chainId: number) => string;
19
18
  export type Chain = EVMChain;
@@ -1,4 +1 @@
1
- import { BigNumber } from 'ethers';
2
- export const prefixChainId = (chainId) => {
3
- return '0x' + BigNumber.from(chainId)._hex.split('0x')[1].replace(/\b0+/g, '');
4
- };
1
+ export {};
@@ -1,5 +1,3 @@
1
1
  export * from './Chain';
2
- export * from './chain.utils';
3
2
  export * from './EVMChain';
4
3
  export * from './SolanaChain';
5
- export * from './supported.chains';
@@ -1,5 +1,3 @@
1
1
  export * from './Chain';
2
- export * from './chain.utils';
3
2
  export * from './EVMChain';
4
3
  export * from './SolanaChain';
5
- export * from './supported.chains';
package/dist/cjs/api.d.ts CHANGED
@@ -1,6 +1,24 @@
1
- import { TransactionRequest } from '@ethersproject/providers';
2
1
  import { BridgeDefinition, Chain, ChainId, ExchangeDefinition, LifiStep, Token } from '.';
3
2
  import { ToolError } from './apiErrors';
3
+ export type TransactionRequest = {
4
+ to?: string;
5
+ from?: string;
6
+ nonce?: number;
7
+ gasLimit?: bigint;
8
+ gasPrice?: bigint;
9
+ data?: `0x${string}`;
10
+ value?: bigint;
11
+ chainId?: number;
12
+ type?: number;
13
+ accessList?: {
14
+ address: `0x${string}`;
15
+ storageKeys: `0x${string}`[];
16
+ }[];
17
+ maxPriorityFeePerGas?: bigint;
18
+ maxFeePerGas?: bigint;
19
+ customData?: Record<string, any>;
20
+ ccipReadEnabled?: boolean;
21
+ };
4
22
  export declare const Orders: readonly ["RECOMMENDED", "FASTEST", "CHEAPEST", "SAFEST"];
5
23
  export type Order = (typeof Orders)[number];
6
24
  export interface RoutesRequest {
@@ -227,13 +245,16 @@ export interface PendingReceivingInfo {
227
245
  }
228
246
  declare const _StatusMessage: readonly ["NOT_FOUND", "INVALID", "PENDING", "DONE", "FAILED"];
229
247
  export type StatusMessage = (typeof _StatusMessage)[number];
230
- 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"];
248
+ declare const _SubstatusPending: readonly ["WAIT_SOURCE_CONFIRMATIONS", "WAIT_DESTINATION_TRANSACTION", "BRIDGE_NOT_AVAILABLE", "CHAIN_NOT_AVAILABLE", "REFUND_IN_PROGRESS", "UNKNOWN_ERROR"];
231
249
  export type SubstatusPending = (typeof _SubstatusPending)[number];
232
250
  declare const _SubstatusDone: readonly ["COMPLETED", "PARTIAL", "REFUNDED"];
233
251
  export type SubstatusDone = (typeof _SubstatusDone)[number];
234
- export type Substatus = SubstatusPending | SubstatusDone;
235
- export declare const isSubstatusPending: (substatus: Substatus) => substatus is "UNKNOWN_ERROR" | "WAIT_SOURCE_CONFIRMATIONS" | "WAIT_DESTINATION_TRANSACTION" | "BRIDGE_NOT_AVAILABLE" | "CHAIN_NOT_AVAILABLE" | "NOT_PROCESSABLE_REFUND_NEEDED" | "REFUND_IN_PROGRESS";
252
+ declare const _SubstatusFailed: readonly ["NOT_PROCESSABLE_REFUND_NEEDED"];
253
+ export type SubstatusFailed = (typeof _SubstatusFailed)[number];
254
+ export type Substatus = SubstatusPending | SubstatusDone | SubstatusFailed;
255
+ 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";
236
256
  export declare const isSubstatusDone: (substatus: Substatus) => substatus is "COMPLETED" | "PARTIAL" | "REFUNDED";
257
+ export declare const isSubstatusFailed: (substatus: Substatus) => substatus is "NOT_PROCESSABLE_REFUND_NEEDED";
237
258
  export interface BaseStatusData {
238
259
  status: StatusMessage;
239
260
  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.isSubstatusDone = exports.isSubstatusPending = exports._InsuranceState = exports.Orders = void 0;
3
+ exports.isSubstatusFailed = 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,8 +28,6 @@ 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',
33
31
  // A refund has been requested and is in progress
34
32
  'REFUND_IN_PROGRESS',
35
33
  // We cannot determine the status of the transfer
@@ -45,8 +43,14 @@ const _SubstatusDone = [
45
43
  // The transfer was not successful but it has been refunded
46
44
  'REFUNDED',
47
45
  ];
46
+ const _SubstatusFailed = [
47
+ // The transfer cannot be completed, a refund is required
48
+ 'NOT_PROCESSABLE_REFUND_NEEDED',
49
+ ];
48
50
  const isSubstatusPending = (substatus) => _SubstatusPending.includes(substatus);
49
51
  exports.isSubstatusPending = isSubstatusPending;
50
52
  const isSubstatusDone = (substatus) => _SubstatusDone.includes(substatus);
51
53
  exports.isSubstatusDone = isSubstatusDone;
54
+ const isSubstatusFailed = (substatus) => _SubstatusFailed.includes(substatus);
55
+ exports.isSubstatusFailed = isSubstatusFailed;
52
56
  const _LIFuelState = ['PENDING', 'DONE', 'NOT_FOUND'];
@@ -1,5 +1,3 @@
1
- import { BridgeTool } from './bridges';
2
- import { ExchangeTools } from './exchanges';
3
1
  export declare enum CoinKey {
4
2
  ETH = "ETH",
5
3
  MATIC = "MATIC",
@@ -195,8 +193,8 @@ export interface Token extends StaticToken {
195
193
  priceUSD: string;
196
194
  }
197
195
  export interface TokenAmount extends Token {
198
- amount: string;
199
- blockNumber?: number;
196
+ amount?: bigint;
197
+ blockNumber?: bigint;
200
198
  }
201
199
  export interface Coin {
202
200
  key: CoinKey;
@@ -207,23 +205,3 @@ export interface Coin {
207
205
  [ChainId: string]: StaticToken;
208
206
  };
209
207
  }
210
- export interface ExchangeDefinition {
211
- tool: ExchangeTools;
212
- chains: number[];
213
- }
214
- /**
215
- * Should not be accessed via the types package anymore
216
- * @deprecated
217
- */
218
- export interface BridgeDefinition {
219
- tool: BridgeTool;
220
- fromChainId: number;
221
- fromToken: BaseToken;
222
- toChainId: number;
223
- toToken: BaseToken;
224
- maximumTransfer: string;
225
- minimumTransfer: string;
226
- swapFeeRate: string;
227
- swapFeeMinimum: string;
228
- swapFeeMaximum: string;
229
- }
@@ -1,3 +1,4 @@
1
+ import { BaseToken } from './base';
1
2
  /**
2
3
  * @deprecated
3
4
  * These values are now obtainable from the LI.FI API
@@ -28,7 +29,18 @@ export interface Bridge {
28
29
  analyticsUrl?: string;
29
30
  }
30
31
  /**
32
+ * Should not be accessed via the types package anymore
31
33
  * @deprecated
32
- * These values are now obtainable from the LI.FI API
33
34
  */
34
- export declare const supportedBridges: Array<Bridge>;
35
+ export interface BridgeDefinition {
36
+ tool: BridgeTool;
37
+ fromChainId: number;
38
+ fromToken: BaseToken;
39
+ toChainId: number;
40
+ toToken: BaseToken;
41
+ maximumTransfer: string;
42
+ minimumTransfer: string;
43
+ swapFeeRate: string;
44
+ swapFeeMinimum: string;
45
+ swapFeeMaximum: string;
46
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.supportedBridges = exports.BridgeTool = void 0;
3
+ exports.BridgeTool = void 0;
4
4
  /**
5
5
  * @deprecated
6
6
  * These values are now obtainable from the LI.FI API
@@ -20,151 +20,3 @@ var BridgeTool;
20
20
  BridgeTool["portal"] = "portal";
21
21
  BridgeTool["stargate"] = "stargate";
22
22
  })(BridgeTool = exports.BridgeTool || (exports.BridgeTool = {}));
23
- /**
24
- * @deprecated
25
- * These values are now obtainable from the LI.FI API
26
- */
27
- exports.supportedBridges = [
28
- {
29
- key: BridgeTool.connext,
30
- name: 'Connext',
31
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/connext.png',
32
- bridgeUrl: 'https://xpollinate.io/',
33
- discordUrl: 'https://chat.connext.network/',
34
- supportUrl: 'https://www.notion.so/connext/Connext-NXTP-Support-19a357ebabdd4e888cfcd138fe3e4644',
35
- docsUrl: 'https://docs.connext.network/',
36
- explorerUrl: 'https://connextscan.io/',
37
- analyticsUrl: 'https://connextscan.io/',
38
- },
39
- {
40
- key: BridgeTool.hop,
41
- name: 'Hop',
42
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/hop.png',
43
- bridgeUrl: 'https://app.hop.exchange/',
44
- discordUrl: 'https://discord.gg/PwCF88emV4',
45
- supportUrl: 'https://help.hop.exchange/hc/en-us',
46
- docsUrl: 'https://docs.hop.exchange/',
47
- explorerUrl: 'https://explorer.hop.exchange/mainnet/',
48
- analyticsUrl: 'https://explorer.hop.exchange/mainnet/',
49
- },
50
- {
51
- key: BridgeTool.multichain,
52
- name: 'Multichain',
53
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/anyswap.png',
54
- bridgeUrl: 'https://app.multichain.org/',
55
- // discordUrl: '',
56
- supportUrl: 'https://multichain.zendesk.com/hc/en-us',
57
- docsUrl: 'https://docs.multichain.org/',
58
- explorerUrl: 'https://anyswap.net/',
59
- },
60
- {
61
- key: BridgeTool.cbridge,
62
- name: 'cBridge',
63
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/cbridge.png',
64
- bridgeUrl: 'https://cbridge.celer.network/',
65
- discordUrl: 'https://discord.com/invite/uGx4fjQ',
66
- supportUrl: 'https://form.typeform.com/to/Q4LMjUaK',
67
- docsUrl: 'https://cbridge-docs.celer.network/',
68
- // explorerUrl: '',
69
- analyticsUrl: 'https://cbridge-analytics.celer.network/',
70
- },
71
- {
72
- key: BridgeTool.hyphen,
73
- name: 'Hyphen',
74
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/hyphen.png',
75
- bridgeUrl: 'https://hyphen.biconomy.io/',
76
- discordUrl: 'https://discord.com/invite/HKHxgyEExQ',
77
- supportUrl: 'https://discord.com/invite/HKHxgyEExQ',
78
- docsUrl: 'https://docs.biconomy.io/products/hyphen-instant-cross-chain-transfers',
79
- // explorerUrl: '',
80
- analyticsUrl: 'https://hyphen-info.biconomy.io/',
81
- },
82
- {
83
- key: BridgeTool.polygon,
84
- name: 'Polygon Bridge (PoS)',
85
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/polygon.png',
86
- bridgeUrl: 'https://wallet.polygon.technology/bridge',
87
- // discordUrl: '',
88
- supportUrl: 'https://forum.matic.network/',
89
- docsUrl: 'https://docs.polygon.technology/docs/develop/ethereum-polygon/pos/getting-started',
90
- // explorerUrl: '',
91
- // analyticsUrl: '',
92
- },
93
- {
94
- key: BridgeTool.arbitrum,
95
- name: 'Arbitrum Bridge',
96
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/arbitrum.png',
97
- bridgeUrl: 'https://bridge.arbitrum.io/',
98
- discordUrl: 'https://discord.gg/ZpZuw7p',
99
- supportUrl: 'https://discord.gg/ZpZuw7p',
100
- docsUrl: 'https://developer.offchainlabs.com/docs/bridging_assets',
101
- // explorerUrl: '',
102
- },
103
- {
104
- key: BridgeTool.avalanche,
105
- name: 'AVAX Bridge',
106
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/avalanche.png',
107
- bridgeUrl: 'https://bridge.avax.network/',
108
- discordUrl: 'https://chat.avalabs.org/',
109
- supportUrl: 'https://docs.avax.network/learn/avalanche-bridge-faq/',
110
- docsUrl: 'https://docs.avax.network/learn/avalanche-bridge-faq/',
111
- // explorerUrl: '',
112
- // analyticsUrl: '',
113
- },
114
- {
115
- key: BridgeTool.optimism,
116
- name: 'Optimism Gateway',
117
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/optimism.png',
118
- bridgeUrl: 'https://gateway.optimism.io/',
119
- discordUrl: 'https://discord.com/invite/jrnFEvq',
120
- supportUrl: 'https://discord.com/invite/jrnFEvq',
121
- docsUrl: 'https://community.optimism.io/docs/developers/bridge/basics/',
122
- // explorerUrl: '',
123
- // analyticsUrl: '',
124
- },
125
- {
126
- key: BridgeTool.across,
127
- name: 'Across',
128
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/acrossv2.png',
129
- bridgeUrl: 'https://across.to/',
130
- discordUrl: 'https://discord.gg/t4SZySkn',
131
- supportUrl: 'https://discord.gg/t4SZySkn',
132
- docsUrl: 'https://docs.across.to/',
133
- },
134
- {
135
- key: BridgeTool.portal,
136
- name: 'Wormhole Portal',
137
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/wormhole_portal.png',
138
- bridgeUrl: 'https://portalbridge.com/',
139
- discordUrl: 'https://discord.com/invite/wormholecrypto',
140
- supportUrl: 'https://discord.com/invite/wormholecrypto',
141
- docsUrl: 'https://docs.wormholenetwork.com/wormhole/',
142
- },
143
- {
144
- key: BridgeTool.stargate,
145
- name: 'Stargate',
146
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/5685c638772f533edad80fcb210b4bb89e30a50f/src/assets/icons/bridges/stargate.png',
147
- bridgeUrl: 'https://stargate.finance/',
148
- discordUrl: 'https://discord.com/invite/TyjeQ45',
149
- supportUrl: 'https://discord.com/invite/TyjeQ45',
150
- docsUrl: 'https://stargateprotocol.gitbook.io/stargate/',
151
- },
152
- // {
153
- // key: BridgeTool.,
154
- // name: '',
155
- // logoURI:
156
- // 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/.png',
157
- // bridgeUrl: '',
158
- // discordUrl: '',
159
- // supportUrl: '',
160
- // docsUrl: '',
161
- // explorerUrl: '',
162
- // analyticsUrl: '',
163
- // },
164
- // for cronos chain, we should confirm if these bridges are available to integrate
165
- // https://bridge.evodefi.com/
166
- // https://app.relaychain.com/#/
167
- // for metis network, we should confirm these bridges as well
168
- // https://bridge.metis.io/home
169
- // https://apps.standard.tech/bridge
170
- ];
@@ -15,5 +15,4 @@ export interface AddEthereumChainParameter {
15
15
  };
16
16
  rpcUrls: string[];
17
17
  }
18
- export declare const prefixChainId: (chainId: number) => string;
19
18
  export type Chain = EVMChain;
@@ -1,8 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.prefixChainId = void 0;
4
- const ethers_1 = require("ethers");
5
- const prefixChainId = (chainId) => {
6
- return '0x' + ethers_1.BigNumber.from(chainId)._hex.split('0x')[1].replace(/\b0+/g, '');
7
- };
8
- exports.prefixChainId = prefixChainId;
@@ -1,5 +1,3 @@
1
1
  export * from './Chain';
2
- export * from './chain.utils';
3
2
  export * from './EVMChain';
4
3
  export * from './SolanaChain';
5
- export * from './supported.chains';