@lifi/types 1.5.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/api.d.ts +1 -0
  3. package/dist/api.js +6 -15
  4. package/dist/apiErrors.js +1 -2
  5. package/dist/base.d.ts +2 -0
  6. package/dist/base.js +8 -9
  7. package/dist/bridges.js +3 -6
  8. package/dist/chains/Chain.js +2 -5
  9. package/dist/chains/EVMChain.js +3 -7
  10. package/dist/chains/SolanaChain.js +1 -2
  11. package/dist/chains/chain.utils.js +10 -20
  12. package/dist/chains/index.js +5 -21
  13. package/dist/chains/supported.chains.js +273 -253
  14. package/dist/cjs/api.d.ts +219 -0
  15. package/dist/cjs/api.js +46 -0
  16. package/dist/cjs/apiErrors.d.ts +9 -0
  17. package/dist/cjs/apiErrors.js +2 -0
  18. package/dist/cjs/base.d.ts +206 -0
  19. package/dist/cjs/base.js +176 -0
  20. package/dist/cjs/bridges.d.ts +34 -0
  21. package/dist/cjs/bridges.js +170 -0
  22. package/dist/cjs/chains/Chain.d.ts +15 -0
  23. package/dist/cjs/chains/Chain.js +8 -0
  24. package/dist/cjs/chains/EVMChain.d.ts +19 -0
  25. package/dist/cjs/chains/EVMChain.js +8 -0
  26. package/dist/cjs/chains/SolanaChain.d.ts +2 -0
  27. package/dist/cjs/chains/SolanaChain.js +2 -0
  28. package/dist/cjs/chains/chain.utils.d.ts +4 -0
  29. package/dist/cjs/chains/chain.utils.js +25 -0
  30. package/dist/cjs/chains/index.d.ts +5 -0
  31. package/dist/cjs/chains/index.js +21 -0
  32. package/dist/cjs/chains/supported.chains.d.ts +5 -0
  33. package/dist/cjs/chains/supported.chains.js +1195 -0
  34. package/dist/cjs/coins.d.ts +9 -0
  35. package/dist/cjs/coins.js +1421 -0
  36. package/dist/cjs/exchanges.d.ts +51 -0
  37. package/dist/cjs/exchanges.js +1067 -0
  38. package/dist/cjs/index.d.ts +8 -0
  39. package/dist/cjs/index.js +24 -0
  40. package/dist/cjs/multicall.d.ts +3 -0
  41. package/dist/cjs/multicall.js +67 -0
  42. package/dist/cjs/step.d.ts +117 -0
  43. package/dist/cjs/step.js +23 -0
  44. package/dist/coins.js +402 -391
  45. package/dist/exchanges.js +230 -214
  46. package/dist/index.js +8 -24
  47. package/dist/multicall.js +44 -41
  48. package/dist/step.d.ts +2 -0
  49. package/dist/step.js +5 -12
  50. package/package.json +26 -3
package/CHANGELOG.md CHANGED
@@ -2,6 +2,24 @@
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
+ ## [1.7.0](https://github.com/lifinance/types/compare/v1.6.0...v1.7.0) (2022-09-13)
6
+
7
+
8
+ ### Features
9
+
10
+ * **api:** add bridgeExplorerLink ([#96](https://github.com/lifinance/types/issues/96)) ([9f37087](https://github.com/lifinance/types/commit/9f37087fe5815512104b3a78d00526188de2c341))
11
+ * **exchanges:** add soulswap on FTM ([#95](https://github.com/lifinance/types/issues/95)) ([3fdf438](https://github.com/lifinance/types/commit/3fdf438066af9f09ff89942613dde0876d638a7f))
12
+
13
+ ## [1.6.0](https://github.com/lifinance/types/compare/v1.5.1...v1.6.0) (2022-09-02)
14
+
15
+
16
+ ### Features
17
+
18
+ * add gasInformation to execution object ([#89](https://github.com/lifinance/types/issues/89)) ([a0e30e9](https://github.com/lifinance/types/commit/a0e30e96497b58d02b980efcff1578e8aeb424c3))
19
+ * add optimism goerli ([#94](https://github.com/lifinance/types/issues/94)) ([899089a](https://github.com/lifinance/types/commit/899089acd3572678614a898f958abcbde00d2bd9))
20
+
21
+ ### [1.5.1](https://github.com/lifinance/types/compare/v1.5.0...v1.5.1) (2022-08-19)
22
+
5
23
  ## [1.5.0](https://github.com/lifinance/types/compare/v1.4.1...v1.5.0) (2022-08-10)
6
24
 
7
25
 
package/dist/api.d.ts CHANGED
@@ -178,6 +178,7 @@ export interface StatusResponse extends StatusInformation {
178
178
  sending: TransactionInfo;
179
179
  receiving?: TransactionInfo;
180
180
  tool?: string;
181
+ bridgeExplorerLink?: string;
181
182
  }
182
183
  export interface ChainsResponse {
183
184
  chains: Chain[];
package/dist/api.js CHANGED
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isSubstatusDone = exports.isSubstatusPending = exports.Orders = void 0;
4
- exports.Orders = ['RECOMMENDED', 'FASTEST', 'CHEAPEST', 'SAFEST'];
5
- var _StatusMessage = [
1
+ export const Orders = ['RECOMMENDED', 'FASTEST', 'CHEAPEST', 'SAFEST'];
2
+ const _StatusMessage = [
6
3
  // The transaction was not found -- likely not mined yet
7
4
  'NOT_FOUND',
8
5
  // A third party service is not available
@@ -14,7 +11,7 @@ var _StatusMessage = [
14
11
  // The transfer failed
15
12
  'FAILED',
16
13
  ];
17
- var _SubstatusPending = [
14
+ const _SubstatusPending = [
18
15
  // The bridge is waiting for additional confirmations
19
16
  'WAIT_SOURCE_CONFIRMATIONS',
20
17
  // The off-chain logic is in progress, waiting for the destination tx to be mined
@@ -30,7 +27,7 @@ var _SubstatusPending = [
30
27
  // We cannot determine the status of the transfer
31
28
  'UNKNOWN_ERROR',
32
29
  ];
33
- var _SubstatusDone = [
30
+ const _SubstatusDone = [
34
31
  // The transfer was successful
35
32
  'COMPLETED',
36
33
  // The transfer was partially successful
@@ -40,11 +37,5 @@ var _SubstatusDone = [
40
37
  // The transfer was not successful but it has been refunded
41
38
  'REFUNDED',
42
39
  ];
43
- var isSubstatusPending = function (substatus) {
44
- return _SubstatusPending.includes(substatus);
45
- };
46
- exports.isSubstatusPending = isSubstatusPending;
47
- var isSubstatusDone = function (substatus) {
48
- return _SubstatusDone.includes(substatus);
49
- };
50
- exports.isSubstatusDone = isSubstatusDone;
40
+ export const isSubstatusPending = (substatus) => _SubstatusPending.includes(substatus);
41
+ export const isSubstatusDone = (substatus) => _SubstatusDone.includes(substatus);
package/dist/apiErrors.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
package/dist/base.d.ts CHANGED
@@ -90,6 +90,7 @@ export declare enum ChainKey {
90
90
  MUM = "mum",
91
91
  ARBT = "arbt",
92
92
  OPTT = "optt",
93
+ OPTG = "optg",
93
94
  BSCT = "bsct",
94
95
  HECT = "hect",
95
96
  ONET = "onet",
@@ -149,6 +150,7 @@ export declare enum ChainId {
149
150
  MUM = 80001,
150
151
  ARBT = 421611,
151
152
  OPTT = 69,
153
+ OPTG = 420,
152
154
  BSCT = 97,
153
155
  HECT = 256,
154
156
  ONET = 1666700000,
package/dist/base.js CHANGED
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ChainId = exports.ChainKey = exports.CoinKey = void 0;
4
- var CoinKey;
1
+ export var CoinKey;
5
2
  (function (CoinKey) {
6
3
  CoinKey["ETH"] = "ETH";
7
4
  CoinKey["MATIC"] = "MATIC";
@@ -49,8 +46,8 @@ var CoinKey;
49
46
  CoinKey["MCB"] = "MCB";
50
47
  CoinKey["CELR"] = "CELR";
51
48
  CoinKey["IF"] = "IF";
52
- })(CoinKey = exports.CoinKey || (exports.CoinKey = {}));
53
- var ChainKey;
49
+ })(CoinKey || (CoinKey = {}));
50
+ export var ChainKey;
54
51
  (function (ChainKey) {
55
52
  ChainKey["ETH"] = "eth";
56
53
  ChainKey["POL"] = "pol";
@@ -97,6 +94,7 @@ var ChainKey;
97
94
  ChainKey["MUM"] = "mum";
98
95
  ChainKey["ARBT"] = "arbt";
99
96
  ChainKey["OPTT"] = "optt";
97
+ ChainKey["OPTG"] = "optg";
100
98
  ChainKey["BSCT"] = "bsct";
101
99
  ChainKey["HECT"] = "hect";
102
100
  ChainKey["ONET"] = "onet";
@@ -110,8 +108,8 @@ var ChainKey;
110
108
  ChainKey["EVMT"] = "evmt";
111
109
  ChainKey["MORT"] = "mort";
112
110
  ChainKey["FTMT"] = "ftmt";
113
- })(ChainKey = exports.ChainKey || (exports.ChainKey = {}));
114
- var ChainId;
111
+ })(ChainKey || (ChainKey = {}));
112
+ export var ChainId;
115
113
  (function (ChainId) {
116
114
  ChainId[ChainId["ETH"] = 1] = "ETH";
117
115
  ChainId[ChainId["POL"] = 137] = "POL";
@@ -158,6 +156,7 @@ var ChainId;
158
156
  ChainId[ChainId["MUM"] = 80001] = "MUM";
159
157
  ChainId[ChainId["ARBT"] = 421611] = "ARBT";
160
158
  ChainId[ChainId["OPTT"] = 69] = "OPTT";
159
+ ChainId[ChainId["OPTG"] = 420] = "OPTG";
161
160
  ChainId[ChainId["BSCT"] = 97] = "BSCT";
162
161
  ChainId[ChainId["HECT"] = 256] = "HECT";
163
162
  ChainId[ChainId["ONET"] = 1666700000] = "ONET";
@@ -171,4 +170,4 @@ var ChainId;
171
170
  ChainId[ChainId["EVMT"] = 9000] = "EVMT";
172
171
  ChainId[ChainId["MORT"] = 1287] = "MORT";
173
172
  ChainId[ChainId["FTMT"] = 4002] = "FTMT";
174
- })(ChainId = exports.ChainId || (exports.ChainId = {}));
173
+ })(ChainId || (ChainId = {}));
package/dist/bridges.js CHANGED
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.supportedBridges = exports.BridgeTool = void 0;
4
1
  /**
5
2
  * @deprecated
6
3
  * These values are now obtainable from the LI.FI API
7
4
  */
8
- var BridgeTool;
5
+ export var BridgeTool;
9
6
  (function (BridgeTool) {
10
7
  BridgeTool["connext"] = "connext";
11
8
  BridgeTool["hop"] = "hop";
@@ -19,12 +16,12 @@ var BridgeTool;
19
16
  BridgeTool["across"] = "across";
20
17
  BridgeTool["portal"] = "portal";
21
18
  BridgeTool["stargate"] = "stargate";
22
- })(BridgeTool = exports.BridgeTool || (exports.BridgeTool = {}));
19
+ })(BridgeTool || (BridgeTool = {}));
23
20
  /**
24
21
  * @deprecated
25
22
  * These values are now obtainable from the LI.FI API
26
23
  */
27
- exports.supportedBridges = [
24
+ export const supportedBridges = [
28
25
  {
29
26
  key: BridgeTool.connext,
30
27
  name: 'Connext',
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ChainType = void 0;
4
- var ChainType;
1
+ export var ChainType;
5
2
  (function (ChainType) {
6
3
  ChainType["EVM"] = "EVM";
7
4
  ChainType["Solana"] = "SOLANA";
8
- })(ChainType = exports.ChainType || (exports.ChainType = {}));
5
+ })(ChainType || (ChainType = {}));
@@ -1,8 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.prefixChainId = void 0;
4
- var ethers_1 = require("ethers");
5
- var prefixChainId = function (chainId) {
6
- return '0x' + ethers_1.BigNumber.from(chainId)._hex.split('0x')[1].replace(/\b0+/g, '');
1
+ import { BigNumber } from 'ethers';
2
+ export const prefixChainId = (chainId) => {
3
+ return '0x' + BigNumber.from(chainId)._hex.split('0x')[1].replace(/\b0+/g, '');
7
4
  };
8
- exports.prefixChainId = prefixChainId;
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,30 +1,20 @@
1
- "use strict";
2
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4
- if (ar || !(i in from)) {
5
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
6
- ar[i] = from[i];
7
- }
8
- }
9
- return to.concat(ar || Array.prototype.slice.call(from));
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getChainById = exports.getChainByKey = void 0;
13
- var supported_chains_1 = require("./supported.chains");
14
- var supportedChains = __spreadArray([], supported_chains_1.supportedEVMChains, true);
15
- var getChainByKey = function (chainKey) {
16
- var chain = supportedChains.find(function (c) { return c.key === chainKey; });
1
+ import { supportedEVMChains } from './supported.chains';
2
+ const supportedChains = [
3
+ // This will be added in the future
4
+ // ...supportedSolanaChains,
5
+ ...supportedEVMChains,
6
+ ];
7
+ export const getChainByKey = (chainKey) => {
8
+ const chain = supportedChains.find((c) => c.key === chainKey);
17
9
  if (!chain) {
18
10
  throw new Error('Invalid chainKey');
19
11
  }
20
12
  return chain;
21
13
  };
22
- exports.getChainByKey = getChainByKey;
23
- var getChainById = function (chainId) {
24
- var chain = supportedChains.find(function (c) { return c.id === chainId; });
14
+ export const getChainById = (chainId) => {
15
+ const chain = supportedChains.find((c) => c.id === chainId);
25
16
  if (!chain) {
26
17
  throw new Error('Invalid chainId');
27
18
  }
28
19
  return chain;
29
20
  };
30
- exports.getChainById = getChainById;
@@ -1,21 +1,5 @@
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("./Chain"), exports);
18
- __exportStar(require("./EVMChain"), exports);
19
- __exportStar(require("./SolanaChain"), exports);
20
- __exportStar(require("./supported.chains"), exports);
21
- __exportStar(require("./chain.utils"), exports);
1
+ export * from './Chain';
2
+ export * from './EVMChain';
3
+ export * from './SolanaChain';
4
+ export * from './supported.chains';
5
+ export * from './chain.utils';