@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.
- package/CHANGELOG.md +18 -0
- package/dist/api.d.ts +1 -0
- package/dist/api.js +6 -15
- package/dist/apiErrors.js +1 -2
- package/dist/base.d.ts +2 -0
- package/dist/base.js +8 -9
- package/dist/bridges.js +3 -6
- package/dist/chains/Chain.js +2 -5
- package/dist/chains/EVMChain.js +3 -7
- package/dist/chains/SolanaChain.js +1 -2
- package/dist/chains/chain.utils.js +10 -20
- package/dist/chains/index.js +5 -21
- package/dist/chains/supported.chains.js +273 -253
- package/dist/cjs/api.d.ts +219 -0
- package/dist/cjs/api.js +46 -0
- package/dist/cjs/apiErrors.d.ts +9 -0
- package/dist/cjs/apiErrors.js +2 -0
- package/dist/cjs/base.d.ts +206 -0
- package/dist/cjs/base.js +176 -0
- package/dist/cjs/bridges.d.ts +34 -0
- package/dist/cjs/bridges.js +170 -0
- package/dist/cjs/chains/Chain.d.ts +15 -0
- package/dist/cjs/chains/Chain.js +8 -0
- package/dist/cjs/chains/EVMChain.d.ts +19 -0
- package/dist/cjs/chains/EVMChain.js +8 -0
- package/dist/cjs/chains/SolanaChain.d.ts +2 -0
- package/dist/cjs/chains/SolanaChain.js +2 -0
- package/dist/cjs/chains/chain.utils.d.ts +4 -0
- package/dist/cjs/chains/chain.utils.js +25 -0
- package/dist/cjs/chains/index.d.ts +5 -0
- package/dist/cjs/chains/index.js +21 -0
- package/dist/cjs/chains/supported.chains.d.ts +5 -0
- package/dist/cjs/chains/supported.chains.js +1195 -0
- package/dist/cjs/coins.d.ts +9 -0
- package/dist/cjs/coins.js +1421 -0
- package/dist/cjs/exchanges.d.ts +51 -0
- package/dist/cjs/exchanges.js +1067 -0
- package/dist/cjs/index.d.ts +8 -0
- package/dist/cjs/index.js +24 -0
- package/dist/cjs/multicall.d.ts +3 -0
- package/dist/cjs/multicall.js +67 -0
- package/dist/cjs/step.d.ts +117 -0
- package/dist/cjs/step.js +23 -0
- package/dist/coins.js +402 -391
- package/dist/exchanges.js +230 -214
- package/dist/index.js +8 -24
- package/dist/multicall.js +44 -41
- package/dist/step.d.ts +2 -0
- package/dist/step.js +5 -12
- 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
package/dist/api.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
44
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
19
|
+
})(BridgeTool || (BridgeTool = {}));
|
|
23
20
|
/**
|
|
24
21
|
* @deprecated
|
|
25
22
|
* These values are now obtainable from the LI.FI API
|
|
26
23
|
*/
|
|
27
|
-
|
|
24
|
+
export const supportedBridges = [
|
|
28
25
|
{
|
|
29
26
|
key: BridgeTool.connext,
|
|
30
27
|
name: 'Connext',
|
package/dist/chains/Chain.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
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
|
|
5
|
+
})(ChainType || (ChainType = {}));
|
package/dist/chains/EVMChain.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,30 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
23
|
-
|
|
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;
|
package/dist/chains/index.js
CHANGED
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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';
|