@lifi/types 4.0.1 → 5.1.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 -2
- package/dist/base.d.ts +10 -6
- package/dist/cjs/base.d.ts +10 -6
- package/dist/cjs/coins.d.ts +5 -5
- package/dist/cjs/exchanges.d.ts +3 -4
- package/dist/cjs/exchanges.js +5 -6
- package/dist/coins.d.ts +5 -5
- package/dist/exchanges.d.ts +3 -4
- package/dist/exchanges.js +5 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,12 +2,28 @@
|
|
|
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
|
-
|
|
5
|
+
## [5.1.0](https://github.com/lifinance/types/compare/v5.0.0...v5.1.0) (2023-04-28)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* add circle logo ([7f68249](https://github.com/lifinance/types/commit/7f68249aa10f301d6ad1805c49690f1628b5ed7e))
|
|
6
11
|
|
|
7
12
|
|
|
8
13
|
### Bug Fixes
|
|
9
14
|
|
|
10
|
-
* more explicit type for GasRecommendationResponse ([#165](https://github.com/lifinance/types/issues/165)) ([
|
|
15
|
+
* more explicit type for GasRecommendationResponse ([#165](https://github.com/lifinance/types/issues/165)) ([9fc5756](https://github.com/lifinance/types/commit/9fc57560356ecc977785b6dccce3b060523c32e3))
|
|
16
|
+
|
|
17
|
+
## [5.0.0](https://github.com/lifinance/types/compare/v4.0.0...v5.0.0) (2023-04-25)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### ⚠ BREAKING CHANGES
|
|
21
|
+
|
|
22
|
+
* introduce Base and StaticToken and make priceUSD in Token required (#153)
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
* introduce Base and StaticToken and make priceUSD in Token required ([#153](https://github.com/lifinance/types/issues/153)) ([85b9ab1](https://github.com/lifinance/types/commit/85b9ab10570c9a3cce8ab076fa7b77fb339fc492))
|
|
11
27
|
|
|
12
28
|
## [4.0.0](https://github.com/lifinance/types/compare/v3.2.8...v4.0.0) (2023-04-24)
|
|
13
29
|
|
package/dist/base.d.ts
CHANGED
|
@@ -164,16 +164,20 @@ export declare enum ChainId {
|
|
|
164
164
|
FTMT = 4002,
|
|
165
165
|
LNAT = 59140
|
|
166
166
|
}
|
|
167
|
-
export interface
|
|
167
|
+
export interface BaseToken {
|
|
168
|
+
chainId: ChainId;
|
|
168
169
|
address: string;
|
|
170
|
+
}
|
|
171
|
+
export interface StaticToken extends BaseToken {
|
|
169
172
|
symbol: string;
|
|
170
173
|
decimals: number;
|
|
171
|
-
chainId: number;
|
|
172
174
|
name: string;
|
|
173
175
|
coinKey?: CoinKey;
|
|
174
|
-
priceUSD?: string;
|
|
175
176
|
logoURI?: string;
|
|
176
177
|
}
|
|
178
|
+
export interface Token extends StaticToken {
|
|
179
|
+
priceUSD: string;
|
|
180
|
+
}
|
|
177
181
|
export interface TokenAmount extends Token {
|
|
178
182
|
amount: string;
|
|
179
183
|
blockNumber?: number;
|
|
@@ -184,7 +188,7 @@ export interface Coin {
|
|
|
184
188
|
logoURI: string;
|
|
185
189
|
verified: boolean;
|
|
186
190
|
chains: {
|
|
187
|
-
[ChainId: string]:
|
|
191
|
+
[ChainId: string]: StaticToken;
|
|
188
192
|
};
|
|
189
193
|
}
|
|
190
194
|
export interface ExchangeDefinition {
|
|
@@ -198,9 +202,9 @@ export interface ExchangeDefinition {
|
|
|
198
202
|
export interface BridgeDefinition {
|
|
199
203
|
tool: BridgeTool;
|
|
200
204
|
fromChainId: number;
|
|
201
|
-
fromToken:
|
|
205
|
+
fromToken: BaseToken;
|
|
202
206
|
toChainId: number;
|
|
203
|
-
toToken:
|
|
207
|
+
toToken: BaseToken;
|
|
204
208
|
maximumTransfer: string;
|
|
205
209
|
minimumTransfer: string;
|
|
206
210
|
swapFeeRate: string;
|
package/dist/cjs/base.d.ts
CHANGED
|
@@ -164,16 +164,20 @@ export declare enum ChainId {
|
|
|
164
164
|
FTMT = 4002,
|
|
165
165
|
LNAT = 59140
|
|
166
166
|
}
|
|
167
|
-
export interface
|
|
167
|
+
export interface BaseToken {
|
|
168
|
+
chainId: ChainId;
|
|
168
169
|
address: string;
|
|
170
|
+
}
|
|
171
|
+
export interface StaticToken extends BaseToken {
|
|
169
172
|
symbol: string;
|
|
170
173
|
decimals: number;
|
|
171
|
-
chainId: number;
|
|
172
174
|
name: string;
|
|
173
175
|
coinKey?: CoinKey;
|
|
174
|
-
priceUSD?: string;
|
|
175
176
|
logoURI?: string;
|
|
176
177
|
}
|
|
178
|
+
export interface Token extends StaticToken {
|
|
179
|
+
priceUSD: string;
|
|
180
|
+
}
|
|
177
181
|
export interface TokenAmount extends Token {
|
|
178
182
|
amount: string;
|
|
179
183
|
blockNumber?: number;
|
|
@@ -184,7 +188,7 @@ export interface Coin {
|
|
|
184
188
|
logoURI: string;
|
|
185
189
|
verified: boolean;
|
|
186
190
|
chains: {
|
|
187
|
-
[ChainId: string]:
|
|
191
|
+
[ChainId: string]: StaticToken;
|
|
188
192
|
};
|
|
189
193
|
}
|
|
190
194
|
export interface ExchangeDefinition {
|
|
@@ -198,9 +202,9 @@ export interface ExchangeDefinition {
|
|
|
198
202
|
export interface BridgeDefinition {
|
|
199
203
|
tool: BridgeTool;
|
|
200
204
|
fromChainId: number;
|
|
201
|
-
fromToken:
|
|
205
|
+
fromToken: BaseToken;
|
|
202
206
|
toChainId: number;
|
|
203
|
-
toToken:
|
|
207
|
+
toToken: BaseToken;
|
|
204
208
|
maximumTransfer: string;
|
|
205
209
|
minimumTransfer: string;
|
|
206
210
|
swapFeeRate: string;
|
package/dist/cjs/coins.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ChainId, Coin, CoinKey
|
|
1
|
+
import { StaticToken, ChainId, Coin, CoinKey } from './base';
|
|
2
2
|
export declare const defaultCoins: Array<Coin>;
|
|
3
3
|
export declare const wrappedTokens: {
|
|
4
|
-
[ChainId: string]:
|
|
4
|
+
[ChainId: string]: StaticToken;
|
|
5
5
|
};
|
|
6
6
|
export declare const findDefaultCoin: (coinKey: CoinKey) => Coin;
|
|
7
|
-
export declare const findDefaultToken: (coinKey: CoinKey, chainId: ChainId) =>
|
|
8
|
-
export declare const findWrappedGasOnChain: (chainId: ChainId) =>
|
|
9
|
-
export declare const findTokenByChainIdAndAddress: (chainId: number, tokenAddress: string) =>
|
|
7
|
+
export declare const findDefaultToken: (coinKey: CoinKey, chainId: ChainId) => StaticToken;
|
|
8
|
+
export declare const findWrappedGasOnChain: (chainId: ChainId) => StaticToken;
|
|
9
|
+
export declare const findTokenByChainIdAndAddress: (chainId: number, tokenAddress: string) => StaticToken | null;
|
package/dist/cjs/exchanges.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StaticToken } from '.';
|
|
2
2
|
/**
|
|
3
3
|
* @deprecated
|
|
4
4
|
* These values are now obtainable from the LI.FI API
|
|
@@ -37,13 +37,12 @@ export interface Exchange {
|
|
|
37
37
|
routerAddress: string;
|
|
38
38
|
factoryAddress: string;
|
|
39
39
|
initCodeHash: string;
|
|
40
|
-
baseTokens: readonly
|
|
40
|
+
baseTokens: readonly StaticToken[];
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* @deprecated
|
|
44
44
|
* These values are now obtainable from the LI.FI API
|
|
45
|
-
*/
|
|
46
|
-
export declare const supportedExchanges: Array<Exchange>;
|
|
45
|
+
*/ export declare const supportedExchanges: Array<Exchange>;
|
|
47
46
|
/**
|
|
48
47
|
* @deprecated
|
|
49
48
|
* Available exchanges should be queried from the API
|
package/dist/cjs/exchanges.js
CHANGED
|
@@ -53,8 +53,7 @@ exports.supportedExchangeAggregators = [
|
|
|
53
53
|
/**
|
|
54
54
|
* @deprecated
|
|
55
55
|
* These values are now obtainable from the LI.FI API
|
|
56
|
-
*/
|
|
57
|
-
exports.supportedExchanges = [
|
|
56
|
+
*/ exports.supportedExchanges = [
|
|
58
57
|
// 1 - Ethereum
|
|
59
58
|
{
|
|
60
59
|
key: 'uniswap-eth',
|
|
@@ -851,7 +850,7 @@ exports.supportedExchanges = [
|
|
|
851
850
|
// symbol: 'fUSD',
|
|
852
851
|
// decimals: 18,
|
|
853
852
|
// chainId: ChainId.FUS,
|
|
854
|
-
// } as
|
|
853
|
+
// } as StaticToken,
|
|
855
854
|
// ],
|
|
856
855
|
// },
|
|
857
856
|
{
|
|
@@ -953,19 +952,19 @@ exports.supportedExchanges = [
|
|
|
953
952
|
// symbol: 'STND',
|
|
954
953
|
// decimals: 18,
|
|
955
954
|
// chainId: ChainId.MAM,
|
|
956
|
-
// } as
|
|
955
|
+
// } as StaticToken,
|
|
957
956
|
// {
|
|
958
957
|
// address: '0xea32a96608495e54156ae48931a7c20f0dcc1a21',
|
|
959
958
|
// symbol: 'm.USDC',
|
|
960
959
|
// decimals: 6,
|
|
961
960
|
// chainId: ChainId.MAM,
|
|
962
|
-
// } as
|
|
961
|
+
// } as StaticToken,
|
|
963
962
|
// {
|
|
964
963
|
// address: '0xbb06dca3ae6887fabf931640f67cab3e3a16f4dc',
|
|
965
964
|
// symbol: 'm.USDT',
|
|
966
965
|
// decimals: 6,
|
|
967
966
|
// chainId: ChainId.MAM,
|
|
968
|
-
// } as
|
|
967
|
+
// } as StaticToken,
|
|
969
968
|
// ],
|
|
970
969
|
// },
|
|
971
970
|
// 288 Boba Network
|
package/dist/coins.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ChainId, Coin, CoinKey
|
|
1
|
+
import { StaticToken, ChainId, Coin, CoinKey } from './base';
|
|
2
2
|
export declare const defaultCoins: Array<Coin>;
|
|
3
3
|
export declare const wrappedTokens: {
|
|
4
|
-
[ChainId: string]:
|
|
4
|
+
[ChainId: string]: StaticToken;
|
|
5
5
|
};
|
|
6
6
|
export declare const findDefaultCoin: (coinKey: CoinKey) => Coin;
|
|
7
|
-
export declare const findDefaultToken: (coinKey: CoinKey, chainId: ChainId) =>
|
|
8
|
-
export declare const findWrappedGasOnChain: (chainId: ChainId) =>
|
|
9
|
-
export declare const findTokenByChainIdAndAddress: (chainId: number, tokenAddress: string) =>
|
|
7
|
+
export declare const findDefaultToken: (coinKey: CoinKey, chainId: ChainId) => StaticToken;
|
|
8
|
+
export declare const findWrappedGasOnChain: (chainId: ChainId) => StaticToken;
|
|
9
|
+
export declare const findTokenByChainIdAndAddress: (chainId: number, tokenAddress: string) => StaticToken | null;
|
package/dist/exchanges.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StaticToken } from '.';
|
|
2
2
|
/**
|
|
3
3
|
* @deprecated
|
|
4
4
|
* These values are now obtainable from the LI.FI API
|
|
@@ -37,13 +37,12 @@ export interface Exchange {
|
|
|
37
37
|
routerAddress: string;
|
|
38
38
|
factoryAddress: string;
|
|
39
39
|
initCodeHash: string;
|
|
40
|
-
baseTokens: readonly
|
|
40
|
+
baseTokens: readonly StaticToken[];
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* @deprecated
|
|
44
44
|
* These values are now obtainable from the LI.FI API
|
|
45
|
-
*/
|
|
46
|
-
export declare const supportedExchanges: Array<Exchange>;
|
|
45
|
+
*/ export declare const supportedExchanges: Array<Exchange>;
|
|
47
46
|
/**
|
|
48
47
|
* @deprecated
|
|
49
48
|
* Available exchanges should be queried from the API
|
package/dist/exchanges.js
CHANGED
|
@@ -50,8 +50,7 @@ export const supportedExchangeAggregators = [
|
|
|
50
50
|
/**
|
|
51
51
|
* @deprecated
|
|
52
52
|
* These values are now obtainable from the LI.FI API
|
|
53
|
-
*/
|
|
54
|
-
export const supportedExchanges = [
|
|
53
|
+
*/ export const supportedExchanges = [
|
|
55
54
|
// 1 - Ethereum
|
|
56
55
|
{
|
|
57
56
|
key: 'uniswap-eth',
|
|
@@ -848,7 +847,7 @@ export const supportedExchanges = [
|
|
|
848
847
|
// symbol: 'fUSD',
|
|
849
848
|
// decimals: 18,
|
|
850
849
|
// chainId: ChainId.FUS,
|
|
851
|
-
// } as
|
|
850
|
+
// } as StaticToken,
|
|
852
851
|
// ],
|
|
853
852
|
// },
|
|
854
853
|
{
|
|
@@ -950,19 +949,19 @@ export const supportedExchanges = [
|
|
|
950
949
|
// symbol: 'STND',
|
|
951
950
|
// decimals: 18,
|
|
952
951
|
// chainId: ChainId.MAM,
|
|
953
|
-
// } as
|
|
952
|
+
// } as StaticToken,
|
|
954
953
|
// {
|
|
955
954
|
// address: '0xea32a96608495e54156ae48931a7c20f0dcc1a21',
|
|
956
955
|
// symbol: 'm.USDC',
|
|
957
956
|
// decimals: 6,
|
|
958
957
|
// chainId: ChainId.MAM,
|
|
959
|
-
// } as
|
|
958
|
+
// } as StaticToken,
|
|
960
959
|
// {
|
|
961
960
|
// address: '0xbb06dca3ae6887fabf931640f67cab3e3a16f4dc',
|
|
962
961
|
// symbol: 'm.USDT',
|
|
963
962
|
// decimals: 6,
|
|
964
963
|
// chainId: ChainId.MAM,
|
|
965
|
-
// } as
|
|
964
|
+
// } as StaticToken,
|
|
966
965
|
// ],
|
|
967
966
|
// },
|
|
968
967
|
// 288 Boba Network
|