@lifi/types 1.4.0 → 1.5.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 (47) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/api.js +6 -15
  3. package/dist/apiErrors.js +1 -2
  4. package/dist/base.js +6 -9
  5. package/dist/bridges.js +4 -7
  6. package/dist/chains/Chain.js +2 -5
  7. package/dist/chains/EVMChain.js +3 -7
  8. package/dist/chains/SolanaChain.js +1 -2
  9. package/dist/chains/chain.utils.js +10 -20
  10. package/dist/chains/index.js +5 -21
  11. package/dist/chains/supported.chains.js +251 -254
  12. package/dist/cjs/api.d.ts +218 -0
  13. package/dist/cjs/api.js +46 -0
  14. package/dist/cjs/apiErrors.d.ts +9 -0
  15. package/dist/cjs/apiErrors.js +2 -0
  16. package/dist/cjs/base.d.ts +204 -0
  17. package/dist/cjs/base.js +174 -0
  18. package/dist/cjs/bridges.d.ts +34 -0
  19. package/dist/cjs/bridges.js +170 -0
  20. package/dist/cjs/chains/Chain.d.ts +15 -0
  21. package/dist/cjs/chains/Chain.js +8 -0
  22. package/dist/cjs/chains/EVMChain.d.ts +19 -0
  23. package/dist/cjs/chains/EVMChain.js +8 -0
  24. package/dist/cjs/chains/SolanaChain.d.ts +2 -0
  25. package/dist/cjs/chains/SolanaChain.js +2 -0
  26. package/dist/cjs/chains/chain.utils.d.ts +4 -0
  27. package/dist/cjs/chains/chain.utils.js +25 -0
  28. package/dist/cjs/chains/index.d.ts +5 -0
  29. package/dist/cjs/chains/index.js +21 -0
  30. package/dist/cjs/chains/supported.chains.d.ts +5 -0
  31. package/dist/cjs/chains/supported.chains.js +1172 -0
  32. package/dist/cjs/coins.d.ts +9 -0
  33. package/dist/cjs/coins.js +1403 -0
  34. package/dist/cjs/exchanges.d.ts +51 -0
  35. package/dist/cjs/exchanges.js +1047 -0
  36. package/dist/cjs/index.d.ts +8 -0
  37. package/dist/cjs/index.js +24 -0
  38. package/dist/cjs/multicall.d.ts +3 -0
  39. package/dist/cjs/multicall.js +66 -0
  40. package/dist/cjs/step.d.ts +115 -0
  41. package/dist/cjs/step.js +23 -0
  42. package/dist/coins.js +384 -391
  43. package/dist/exchanges.js +210 -214
  44. package/dist/index.js +8 -24
  45. package/dist/multicall.js +43 -41
  46. package/dist/step.js +5 -12
  47. package/package.json +26 -3
package/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
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.5.1](https://github.com/lifinance/types/compare/v1.5.0...v1.5.1) (2022-08-19)
6
+
7
+ ## [1.5.0](https://github.com/lifinance/types/compare/v1.4.1...v1.5.0) (2022-08-10)
8
+
9
+
10
+ ### Features
11
+
12
+ * **bridges:** rename AcrossV2 in Across ([#92](https://github.com/lifinance/types/issues/92)) ([5bd7e7a](https://github.com/lifinance/types/commit/5bd7e7ac045b2a93b0e6e7803c2ddfa087385a27))
13
+
14
+ ### [1.4.1](https://github.com/lifinance/types/compare/v1.4.0...v1.4.1) (2022-08-09)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * okx icon ([#91](https://github.com/lifinance/types/issues/91)) ([d356e19](https://github.com/lifinance/types/commit/d356e1983fb4fef604fd92e3bb87cf908d24fa8a))
20
+
5
21
  ## [1.4.0](https://github.com/lifinance/types/compare/v1.3.0...v1.4.0) (2022-08-08)
6
22
 
7
23
 
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.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";
@@ -110,8 +107,8 @@ var ChainKey;
110
107
  ChainKey["EVMT"] = "evmt";
111
108
  ChainKey["MORT"] = "mort";
112
109
  ChainKey["FTMT"] = "ftmt";
113
- })(ChainKey = exports.ChainKey || (exports.ChainKey = {}));
114
- var ChainId;
110
+ })(ChainKey || (ChainKey = {}));
111
+ export var ChainId;
115
112
  (function (ChainId) {
116
113
  ChainId[ChainId["ETH"] = 1] = "ETH";
117
114
  ChainId[ChainId["POL"] = 137] = "POL";
@@ -171,4 +168,4 @@ var ChainId;
171
168
  ChainId[ChainId["EVMT"] = 9000] = "EVMT";
172
169
  ChainId[ChainId["MORT"] = 1287] = "MORT";
173
170
  ChainId[ChainId["FTMT"] = 4002] = "FTMT";
174
- })(ChainId = exports.ChainId || (exports.ChainId = {}));
171
+ })(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',
@@ -124,7 +121,7 @@ exports.supportedBridges = [
124
121
  },
125
122
  {
126
123
  key: BridgeTool.across,
127
- name: 'AcrossV2',
124
+ name: 'Across',
128
125
  logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/acrossv2.png',
129
126
  bridgeUrl: 'https://across.to/',
130
127
  discordUrl: 'https://discord.gg/t4SZySkn',
@@ -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';