@lifi/types 5.0.0 → 5.2.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 CHANGED
@@ -2,6 +2,25 @@
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.2.0](https://github.com/lifinance/types/compare/v5.1.0...v5.2.0) (2023-04-28)
6
+
7
+
8
+ ### Features
9
+
10
+ * add Polygon zkEVM and zkSync Era ([#167](https://github.com/lifinance/types/issues/167)) ([922dc70](https://github.com/lifinance/types/commit/922dc70c92a085391a2fc5e5c8b4407d487a4a2f))
11
+
12
+ ## [5.1.0](https://github.com/lifinance/types/compare/v5.0.0...v5.1.0) (2023-04-28)
13
+
14
+
15
+ ### Features
16
+
17
+ * add circle logo ([7f68249](https://github.com/lifinance/types/commit/7f68249aa10f301d6ad1805c49690f1628b5ed7e))
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * more explicit type for GasRecommendationResponse ([#165](https://github.com/lifinance/types/issues/165)) ([9fc5756](https://github.com/lifinance/types/commit/9fc57560356ecc977785b6dccce3b060523c32e3))
23
+
5
24
  ## [5.0.0](https://github.com/lifinance/types/compare/v4.0.0...v5.0.0) (2023-04-25)
6
25
 
7
26
 
package/dist/api.d.ts CHANGED
@@ -149,7 +149,6 @@ export interface ContractCallQuoteRequest extends ToolConfiguration {
149
149
  referrer?: string;
150
150
  fee?: number | string;
151
151
  allowDestinationCall?: boolean;
152
- maxPriceImpact?: number;
153
152
  }
154
153
  export interface ContractCallQuotesRequest extends ToolConfiguration {
155
154
  fromChain: number | string;
@@ -292,12 +291,14 @@ export type RefetchLIFuelRequest = {
292
291
  chainId: ChainId;
293
292
  };
294
293
  export type GasRecommendationResponse = {
295
- available: boolean;
296
- recommended?: TokenBalance;
297
- limit?: TokenBalance;
298
- serviceFee?: TokenBalance;
294
+ available: false;
295
+ message: string;
296
+ } | {
297
+ available: true;
298
+ recommended: TokenBalance;
299
+ limit: TokenBalance;
300
+ serviceFee: TokenBalance;
299
301
  fromToken?: Token;
300
302
  fromAmount?: string;
301
- message?: string;
302
303
  };
303
304
  export {};
package/dist/base.d.ts CHANGED
@@ -85,6 +85,8 @@ export declare enum ChainKey {
85
85
  SOL = "sol",
86
86
  EVM = "evm",
87
87
  ARN = "arn",
88
+ ERA = "era",
89
+ PZE = "pze",
88
90
  GOR = "gor",
89
91
  METT = "mett",
90
92
  DIOT = "diot",
@@ -143,6 +145,8 @@ export declare enum ChainId {
143
145
  OAS = 111971151099710,
144
146
  EVM = 9001,
145
147
  ARN = 42170,
148
+ ERA = 324,
149
+ PZE = 1101,
146
150
  GOR = 5,
147
151
  METT = 12,
148
152
  DIOT = 13,
package/dist/base.js CHANGED
@@ -88,6 +88,8 @@ export var ChainKey;
88
88
  ChainKey["SOL"] = "sol";
89
89
  ChainKey["EVM"] = "evm";
90
90
  ChainKey["ARN"] = "arn";
91
+ ChainKey["ERA"] = "era";
92
+ ChainKey["PZE"] = "pze";
91
93
  // Testnets
92
94
  ChainKey["GOR"] = "gor";
93
95
  ChainKey["METT"] = "mett";
@@ -148,6 +150,8 @@ export var ChainId;
148
150
  ChainId[ChainId["OAS"] = 111971151099710] = "OAS";
149
151
  ChainId[ChainId["EVM"] = 9001] = "EVM";
150
152
  ChainId[ChainId["ARN"] = 42170] = "ARN";
153
+ ChainId[ChainId["ERA"] = 324] = "ERA";
154
+ ChainId[ChainId["PZE"] = 1101] = "PZE";
151
155
  // Testnets
152
156
  ChainId[ChainId["GOR"] = 5] = "GOR";
153
157
  ChainId[ChainId["METT"] = 12] = "METT";
@@ -764,6 +764,49 @@ export const supportedEVMChains = [
764
764
  rpcUrls: ['https://eth.bd.evmos.org:8545'],
765
765
  },
766
766
  },
767
+ // 324 - zksync ERA
768
+ {
769
+ key: ChainKey.ERA,
770
+ chainType: ChainType.EVM,
771
+ name: 'zkSync Era',
772
+ coin: CoinKey.ETH,
773
+ id: 324,
774
+ mainnet: true,
775
+ logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/zksync.png',
776
+ metamask: {
777
+ chainId: prefixChainId(324),
778
+ blockExplorerUrls: ['https://zkscan.io/'],
779
+ chainName: 'zkSync Era Mainnet',
780
+ nativeCurrency: {
781
+ name: 'ETH',
782
+ symbol: 'ETH',
783
+ decimals: 18,
784
+ },
785
+ rpcUrls: ['https://mainnet.era.zksync.io'],
786
+ },
787
+ },
788
+ // 1101 - Polygon zkEVM
789
+ {
790
+ key: ChainKey.PZE,
791
+ chainType: ChainType.EVM,
792
+ name: 'Polygon zkEVM',
793
+ coin: CoinKey.ETH,
794
+ id: 1101,
795
+ mainnet: true,
796
+ logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/zkevm.png',
797
+ multicallAddress: multicallAddresses[ChainId.PZE],
798
+ metamask: {
799
+ chainId: prefixChainId(1101),
800
+ blockExplorerUrls: ['https://zkevm.polygonscan.com'],
801
+ chainName: 'Polygon zkEVM',
802
+ nativeCurrency: {
803
+ name: 'ETH',
804
+ symbol: 'ETH',
805
+ decimals: 18,
806
+ },
807
+ rpcUrls: ['https://polygon-rpc.com/zkevm'],
808
+ },
809
+ },
767
810
  // TESTNETS
768
811
  // 5 - Goerli
769
812
  {
package/dist/cjs/api.d.ts CHANGED
@@ -149,7 +149,6 @@ export interface ContractCallQuoteRequest extends ToolConfiguration {
149
149
  referrer?: string;
150
150
  fee?: number | string;
151
151
  allowDestinationCall?: boolean;
152
- maxPriceImpact?: number;
153
152
  }
154
153
  export interface ContractCallQuotesRequest extends ToolConfiguration {
155
154
  fromChain: number | string;
@@ -292,12 +291,14 @@ export type RefetchLIFuelRequest = {
292
291
  chainId: ChainId;
293
292
  };
294
293
  export type GasRecommendationResponse = {
295
- available: boolean;
296
- recommended?: TokenBalance;
297
- limit?: TokenBalance;
298
- serviceFee?: TokenBalance;
294
+ available: false;
295
+ message: string;
296
+ } | {
297
+ available: true;
298
+ recommended: TokenBalance;
299
+ limit: TokenBalance;
300
+ serviceFee: TokenBalance;
299
301
  fromToken?: Token;
300
302
  fromAmount?: string;
301
- message?: string;
302
303
  };
303
304
  export {};
@@ -85,6 +85,8 @@ export declare enum ChainKey {
85
85
  SOL = "sol",
86
86
  EVM = "evm",
87
87
  ARN = "arn",
88
+ ERA = "era",
89
+ PZE = "pze",
88
90
  GOR = "gor",
89
91
  METT = "mett",
90
92
  DIOT = "diot",
@@ -143,6 +145,8 @@ export declare enum ChainId {
143
145
  OAS = 111971151099710,
144
146
  EVM = 9001,
145
147
  ARN = 42170,
148
+ ERA = 324,
149
+ PZE = 1101,
146
150
  GOR = 5,
147
151
  METT = 12,
148
152
  DIOT = 13,
package/dist/cjs/base.js CHANGED
@@ -91,6 +91,8 @@ var ChainKey;
91
91
  ChainKey["SOL"] = "sol";
92
92
  ChainKey["EVM"] = "evm";
93
93
  ChainKey["ARN"] = "arn";
94
+ ChainKey["ERA"] = "era";
95
+ ChainKey["PZE"] = "pze";
94
96
  // Testnets
95
97
  ChainKey["GOR"] = "gor";
96
98
  ChainKey["METT"] = "mett";
@@ -151,6 +153,8 @@ var ChainId;
151
153
  ChainId[ChainId["OAS"] = 111971151099710] = "OAS";
152
154
  ChainId[ChainId["EVM"] = 9001] = "EVM";
153
155
  ChainId[ChainId["ARN"] = 42170] = "ARN";
156
+ ChainId[ChainId["ERA"] = 324] = "ERA";
157
+ ChainId[ChainId["PZE"] = 1101] = "PZE";
154
158
  // Testnets
155
159
  ChainId[ChainId["GOR"] = 5] = "GOR";
156
160
  ChainId[ChainId["METT"] = 12] = "METT";
@@ -767,6 +767,49 @@ exports.supportedEVMChains = [
767
767
  rpcUrls: ['https://eth.bd.evmos.org:8545'],
768
768
  },
769
769
  },
770
+ // 324 - zksync ERA
771
+ {
772
+ key: base_1.ChainKey.ERA,
773
+ chainType: Chain_1.ChainType.EVM,
774
+ name: 'zkSync Era',
775
+ coin: base_1.CoinKey.ETH,
776
+ id: 324,
777
+ mainnet: true,
778
+ logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/zksync.png',
779
+ metamask: {
780
+ chainId: (0, EVMChain_1.prefixChainId)(324),
781
+ blockExplorerUrls: ['https://zkscan.io/'],
782
+ chainName: 'zkSync Era Mainnet',
783
+ nativeCurrency: {
784
+ name: 'ETH',
785
+ symbol: 'ETH',
786
+ decimals: 18,
787
+ },
788
+ rpcUrls: ['https://mainnet.era.zksync.io'],
789
+ },
790
+ },
791
+ // 1101 - Polygon zkEVM
792
+ {
793
+ key: base_1.ChainKey.PZE,
794
+ chainType: Chain_1.ChainType.EVM,
795
+ name: 'Polygon zkEVM',
796
+ coin: base_1.CoinKey.ETH,
797
+ id: 1101,
798
+ mainnet: true,
799
+ logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/zkevm.png',
800
+ multicallAddress: multicall_1.multicallAddresses[base_1.ChainId.PZE],
801
+ metamask: {
802
+ chainId: (0, EVMChain_1.prefixChainId)(1101),
803
+ blockExplorerUrls: ['https://zkevm.polygonscan.com'],
804
+ chainName: 'Polygon zkEVM',
805
+ nativeCurrency: {
806
+ name: 'ETH',
807
+ symbol: 'ETH',
808
+ decimals: 18,
809
+ },
810
+ rpcUrls: ['https://polygon-rpc.com/zkevm'],
811
+ },
812
+ },
770
813
  // TESTNETS
771
814
  // 5 - Goerli
772
815
  {
package/dist/cjs/coins.js CHANGED
@@ -42,6 +42,14 @@ const basicCoins = [
42
42
  address: '0x0000000000000000000000000000000000000000',
43
43
  decimals: 18,
44
44
  },
45
+ [base_1.ChainId.ERA]: {
46
+ address: '0x0000000000000000000000000000000000000000',
47
+ decimals: 18,
48
+ },
49
+ [base_1.ChainId.PZE]: {
50
+ address: '0x0000000000000000000000000000000000000000',
51
+ decimals: 18,
52
+ },
45
53
  [base_1.ChainId.FTM]: {
46
54
  address: '0x74b23882a30290451a17c44f4f05243b6b58c76d',
47
55
  decimals: 18,
@@ -257,6 +265,10 @@ const basicCoins = [
257
265
  address: '0xda10009cbd5d07dd0cecc66161fc93d7c9000da1',
258
266
  decimals: 18,
259
267
  },
268
+ [base_1.ChainId.ERA]: {
269
+ address: '0x4bef76b6b7f2823c6c1f4fcfeacd85c24548ad7e',
270
+ decimals: 18,
271
+ },
260
272
  [base_1.ChainId.FTM]: {
261
273
  address: '0x8d11ec38a3eb5e956b052f67da8bdc9bef8abf3e',
262
274
  decimals: 18,
@@ -603,6 +615,14 @@ const basicCoins = [
603
615
  address: '0x7f5c764cbc14f9669b88837ca1490cca17c31607',
604
616
  decimals: 6,
605
617
  },
618
+ [base_1.ChainId.ERA]: {
619
+ address: '0x3355df6d4c9c3035724fd0e3914de96a5a83aaf4',
620
+ decimals: 6,
621
+ },
622
+ [base_1.ChainId.PZE]: {
623
+ address: '0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035',
624
+ decimals: 6,
625
+ },
606
626
  [base_1.ChainId.FTM]: {
607
627
  address: '0x04068da6c83afcfa0e13ba15a6696662335d5b75',
608
628
  decimals: 6,
@@ -1349,6 +1369,26 @@ exports.wrappedTokens = {
1349
1369
  name: 'Wrapped ETH',
1350
1370
  logoURI: 'https://zapper.fi/images/networks/ethereum/0x0000000000000000000000000000000000000000.png',
1351
1371
  },
1372
+ [base_1.ChainId.ERA]: {
1373
+ // https://explorer.zksync.io/address/0x5aea5775959fbc2557cc8789bc1bf90a239d9a91
1374
+ address: '0x5aea5775959fbc2557cc8789bc1bf90a239d9a91',
1375
+ symbol: 'WETH',
1376
+ decimals: 18,
1377
+ chainId: base_1.ChainId.ERA,
1378
+ coinKey: base_1.CoinKey.WETH,
1379
+ name: 'Wrapped Ether',
1380
+ logoURI: 'https://static.debank.com/image/era_token/logo_url/0x5aea5775959fbc2557cc8789bc1bf90a239d9a91/61844453e63cf81301f845d7864236f6.png',
1381
+ },
1382
+ [base_1.ChainId.PZE]: {
1383
+ // https://zkevm.polygonscan.com/token/0x4f9a0e7fd2bf6067db6994cf12e4495df938e6e9
1384
+ address: '0x5aea5775959fbc2557cc8789bc1bf90a239d9a91',
1385
+ symbol: 'WETH',
1386
+ decimals: 18,
1387
+ chainId: base_1.ChainId.PZE,
1388
+ coinKey: base_1.CoinKey.WETH,
1389
+ name: 'Wrapped Ether',
1390
+ logoURI: 'https://static.debank.com/image/pze_token/logo_url/0x4f9a0e7fd2bf6067db6994cf12e4495df938e6e9/61844453e63cf81301f845d7864236f6.png',
1391
+ },
1352
1392
  [base_1.ChainId.FTM]: {
1353
1393
  //
1354
1394
  address: '0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83',
@@ -34,6 +34,8 @@ exports.multicallAddresses = {
34
34
  [_1.ChainId.MET]: '0xcA11bde05977b3631167028862bE2a173976CA11',
35
35
  [_1.ChainId.RSK]: '0xcA11bde05977b3631167028862bE2a173976CA11',
36
36
  [_1.ChainId.VEL]: '0x6ede559F2Bd951777470595761672091CCD21Ac6',
37
+ [_1.ChainId.PZE]: '0xcA11bde05977b3631167028862bE2a173976CA11',
38
+ // [ChainId.ERA]: '', // not available
37
39
  // TODO
38
40
  // [ChainId.ARN]: '', // TODO
39
41
  // [ChainId.EXP]: '', // TODO
package/dist/coins.js CHANGED
@@ -39,6 +39,14 @@ const basicCoins = [
39
39
  address: '0x0000000000000000000000000000000000000000',
40
40
  decimals: 18,
41
41
  },
42
+ [ChainId.ERA]: {
43
+ address: '0x0000000000000000000000000000000000000000',
44
+ decimals: 18,
45
+ },
46
+ [ChainId.PZE]: {
47
+ address: '0x0000000000000000000000000000000000000000',
48
+ decimals: 18,
49
+ },
42
50
  [ChainId.FTM]: {
43
51
  address: '0x74b23882a30290451a17c44f4f05243b6b58c76d',
44
52
  decimals: 18,
@@ -254,6 +262,10 @@ const basicCoins = [
254
262
  address: '0xda10009cbd5d07dd0cecc66161fc93d7c9000da1',
255
263
  decimals: 18,
256
264
  },
265
+ [ChainId.ERA]: {
266
+ address: '0x4bef76b6b7f2823c6c1f4fcfeacd85c24548ad7e',
267
+ decimals: 18,
268
+ },
257
269
  [ChainId.FTM]: {
258
270
  address: '0x8d11ec38a3eb5e956b052f67da8bdc9bef8abf3e',
259
271
  decimals: 18,
@@ -600,6 +612,14 @@ const basicCoins = [
600
612
  address: '0x7f5c764cbc14f9669b88837ca1490cca17c31607',
601
613
  decimals: 6,
602
614
  },
615
+ [ChainId.ERA]: {
616
+ address: '0x3355df6d4c9c3035724fd0e3914de96a5a83aaf4',
617
+ decimals: 6,
618
+ },
619
+ [ChainId.PZE]: {
620
+ address: '0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035',
621
+ decimals: 6,
622
+ },
603
623
  [ChainId.FTM]: {
604
624
  address: '0x04068da6c83afcfa0e13ba15a6696662335d5b75',
605
625
  decimals: 6,
@@ -1346,6 +1366,26 @@ export const wrappedTokens = {
1346
1366
  name: 'Wrapped ETH',
1347
1367
  logoURI: 'https://zapper.fi/images/networks/ethereum/0x0000000000000000000000000000000000000000.png',
1348
1368
  },
1369
+ [ChainId.ERA]: {
1370
+ // https://explorer.zksync.io/address/0x5aea5775959fbc2557cc8789bc1bf90a239d9a91
1371
+ address: '0x5aea5775959fbc2557cc8789bc1bf90a239d9a91',
1372
+ symbol: 'WETH',
1373
+ decimals: 18,
1374
+ chainId: ChainId.ERA,
1375
+ coinKey: CoinKey.WETH,
1376
+ name: 'Wrapped Ether',
1377
+ logoURI: 'https://static.debank.com/image/era_token/logo_url/0x5aea5775959fbc2557cc8789bc1bf90a239d9a91/61844453e63cf81301f845d7864236f6.png',
1378
+ },
1379
+ [ChainId.PZE]: {
1380
+ // https://zkevm.polygonscan.com/token/0x4f9a0e7fd2bf6067db6994cf12e4495df938e6e9
1381
+ address: '0x5aea5775959fbc2557cc8789bc1bf90a239d9a91',
1382
+ symbol: 'WETH',
1383
+ decimals: 18,
1384
+ chainId: ChainId.PZE,
1385
+ coinKey: CoinKey.WETH,
1386
+ name: 'Wrapped Ether',
1387
+ logoURI: 'https://static.debank.com/image/pze_token/logo_url/0x4f9a0e7fd2bf6067db6994cf12e4495df938e6e9/61844453e63cf81301f845d7864236f6.png',
1388
+ },
1349
1389
  [ChainId.FTM]: {
1350
1390
  //
1351
1391
  address: '0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83',
package/dist/multicall.js CHANGED
@@ -31,6 +31,8 @@ export const multicallAddresses = {
31
31
  [ChainId.MET]: '0xcA11bde05977b3631167028862bE2a173976CA11',
32
32
  [ChainId.RSK]: '0xcA11bde05977b3631167028862bE2a173976CA11',
33
33
  [ChainId.VEL]: '0x6ede559F2Bd951777470595761672091CCD21Ac6',
34
+ [ChainId.PZE]: '0xcA11bde05977b3631167028862bE2a173976CA11',
35
+ // [ChainId.ERA]: '', // not available
34
36
  // TODO
35
37
  // [ChainId.ARN]: '', // TODO
36
38
  // [ChainId.EXP]: '', // TODO
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifi/types",
3
- "version": "5.0.0",
3
+ "version": "5.2.0",
4
4
  "description": "Types for the LI.FI stack",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/index.js",