@lifi/types 2.1.0 → 2.2.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,30 @@
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
+ ### [2.2.1](https://github.com/lifinance/types/compare/v2.2.0...v2.2.1) (2023-03-02)
6
+
7
+ ## [2.2.0](https://github.com/lifinance/types/compare/v2.1.1...v2.2.0) (2023-03-02)
8
+
9
+
10
+ ### Features
11
+
12
+ * add gas suggestion and status types, lifuel icon ([#137](https://github.com/lifinance/types/issues/137)) ([94ae5f2](https://github.com/lifinance/types/commit/94ae5f2a5358e08e2096dddfe79cbad23c94eaff))
13
+ * add protocol icons ([97cf747](https://github.com/lifinance/types/commit/97cf747d3cf8c4704e15dc23ecfd019cd0ed7bd2))
14
+ * deprecate the possibilities endpoint ([#136](https://github.com/lifinance/types/issues/136)) ([53fa193](https://github.com/lifinance/types/commit/53fa193334fc0f929325c3e8f9b3f2c07a52edb7))
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * rename gasUp to getGas ([b2dfda9](https://github.com/lifinance/types/commit/b2dfda984e923c74275c99498e6d5818b7447a91))
20
+ * typo ([62981c6](https://github.com/lifinance/types/commit/62981c60254cbe4342129fad88029e5870d30321))
21
+
22
+ ### [2.1.1](https://github.com/lifinance/types/compare/v2.1.0...v2.1.1) (2023-02-17)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * add CZKT default tokens ([df967ac](https://github.com/lifinance/types/commit/df967ac4fb3ee89a701d89950f50b438cc67b656))
28
+
5
29
  ## [2.1.0](https://github.com/lifinance/types/compare/v2.0.4...v2.1.0) (2023-02-17)
6
30
 
7
31
 
package/dist/api.d.ts CHANGED
@@ -74,12 +74,20 @@ export interface RoutesResponse {
74
74
  errors: ToolError[];
75
75
  }
76
76
  export type PossibilityTopic = 'chains' | 'tokens' | 'bridges' | 'exchanges';
77
+ /**
78
+ * We don't want to support this endpoint anymore in the future. /chains, /tools, /connections, and /tokens should be used instead
79
+ * @deprecated
80
+ */
77
81
  export interface PossibilitiesRequest {
78
82
  chains?: number[];
79
83
  bridges?: AllowDenyPrefer;
80
84
  exchanges?: AllowDenyPrefer;
81
85
  include?: PossibilityTopic[];
82
86
  }
87
+ /**
88
+ * Should not be accessed via the types package anymore
89
+ * @deprecated
90
+ */
83
91
  export interface PossibilitiesResponse {
84
92
  chains?: Chain[];
85
93
  tokens?: Token[];
@@ -250,4 +258,36 @@ export interface IntegratorWithdrawalRequest {
250
258
  export interface IntegratorWithdrawalTransactionResponse {
251
259
  transactionRequest: TransactionRequest;
252
260
  }
261
+ declare const _LIFuelState: readonly ["PENDING", "DONE", "NOT_FOUND"];
262
+ type LIFuelState = (typeof _LIFuelState)[number];
263
+ export type LIFuelStatusResponse = {
264
+ status: LIFuelState;
265
+ sending?: TransactionInfo;
266
+ receiving?: TransactionInfo;
267
+ };
268
+ export type GasRecommendationRequest = {
269
+ chainId: ChainId;
270
+ fromChain?: ChainId;
271
+ fromToken?: string;
272
+ };
273
+ export type RefetchSourceLIFuelRequest = {
274
+ txHash: string;
275
+ chainId: ChainId;
276
+ };
277
+ export type LIFuelStatusRequest = {
278
+ txHash: string;
279
+ };
280
+ export type RefetchLIFuelRequest = {
281
+ txHash: string;
282
+ chainId: ChainId;
283
+ };
284
+ export type GasRecommendationResponse = {
285
+ available: boolean;
286
+ recommended?: TokenBalance;
287
+ limit?: TokenBalance;
288
+ serviceFee?: TokenBalance;
289
+ fromToken?: Token;
290
+ fromAmount?: string;
291
+ message?: string;
292
+ };
253
293
  export {};
package/dist/api.js CHANGED
@@ -39,3 +39,4 @@ const _SubstatusDone = [
39
39
  ];
40
40
  export const isSubstatusPending = (substatus) => _SubstatusPending.includes(substatus);
41
41
  export const isSubstatusDone = (substatus) => _SubstatusDone.includes(substatus);
42
+ const _LIFuelState = ['PENDING', 'DONE', 'NOT_FOUND'];
package/dist/base.d.ts CHANGED
@@ -198,6 +198,10 @@ export interface ExchangeDefinition {
198
198
  tool: ExchangeTools;
199
199
  chains: number[];
200
200
  }
201
+ /**
202
+ * Should not be accessed via the types package anymore
203
+ * @deprecated
204
+ */
201
205
  export interface BridgeDefinition {
202
206
  tool: BridgeTool;
203
207
  fromChainId: number;
@@ -1,5 +1,5 @@
1
1
  export * from './Chain';
2
+ export * from './chain.utils';
2
3
  export * from './EVMChain';
3
4
  export * from './SolanaChain';
4
5
  export * from './supported.chains';
5
- export * from './chain.utils';
@@ -1,5 +1,5 @@
1
1
  export * from './Chain';
2
+ export * from './chain.utils';
2
3
  export * from './EVMChain';
3
4
  export * from './SolanaChain';
4
5
  export * from './supported.chains';
5
- export * from './chain.utils';
@@ -1198,7 +1198,7 @@ export const supportedEVMChains = [
1198
1198
  coin: CoinKey.ETH,
1199
1199
  id: 59140,
1200
1200
  mainnet: false,
1201
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/consensys_skevm_test.png',
1201
+ logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/consensys_zkevm_test.png',
1202
1202
  // multicallAddress: multicallAddresses[ChainId.CZKT], // Not deployed yet
1203
1203
  faucetUrls: ['https://goerli.zkevm.consensys.net/'],
1204
1204
  metamask: {
package/dist/cjs/api.d.ts CHANGED
@@ -74,12 +74,20 @@ export interface RoutesResponse {
74
74
  errors: ToolError[];
75
75
  }
76
76
  export type PossibilityTopic = 'chains' | 'tokens' | 'bridges' | 'exchanges';
77
+ /**
78
+ * We don't want to support this endpoint anymore in the future. /chains, /tools, /connections, and /tokens should be used instead
79
+ * @deprecated
80
+ */
77
81
  export interface PossibilitiesRequest {
78
82
  chains?: number[];
79
83
  bridges?: AllowDenyPrefer;
80
84
  exchanges?: AllowDenyPrefer;
81
85
  include?: PossibilityTopic[];
82
86
  }
87
+ /**
88
+ * Should not be accessed via the types package anymore
89
+ * @deprecated
90
+ */
83
91
  export interface PossibilitiesResponse {
84
92
  chains?: Chain[];
85
93
  tokens?: Token[];
@@ -250,4 +258,36 @@ export interface IntegratorWithdrawalRequest {
250
258
  export interface IntegratorWithdrawalTransactionResponse {
251
259
  transactionRequest: TransactionRequest;
252
260
  }
261
+ declare const _LIFuelState: readonly ["PENDING", "DONE", "NOT_FOUND"];
262
+ type LIFuelState = (typeof _LIFuelState)[number];
263
+ export type LIFuelStatusResponse = {
264
+ status: LIFuelState;
265
+ sending?: TransactionInfo;
266
+ receiving?: TransactionInfo;
267
+ };
268
+ export type GasRecommendationRequest = {
269
+ chainId: ChainId;
270
+ fromChain?: ChainId;
271
+ fromToken?: string;
272
+ };
273
+ export type RefetchSourceLIFuelRequest = {
274
+ txHash: string;
275
+ chainId: ChainId;
276
+ };
277
+ export type LIFuelStatusRequest = {
278
+ txHash: string;
279
+ };
280
+ export type RefetchLIFuelRequest = {
281
+ txHash: string;
282
+ chainId: ChainId;
283
+ };
284
+ export type GasRecommendationResponse = {
285
+ available: boolean;
286
+ recommended?: TokenBalance;
287
+ limit?: TokenBalance;
288
+ serviceFee?: TokenBalance;
289
+ fromToken?: Token;
290
+ fromAmount?: string;
291
+ message?: string;
292
+ };
253
293
  export {};
package/dist/cjs/api.js CHANGED
@@ -44,3 +44,4 @@ const isSubstatusPending = (substatus) => _SubstatusPending.includes(substatus);
44
44
  exports.isSubstatusPending = isSubstatusPending;
45
45
  const isSubstatusDone = (substatus) => _SubstatusDone.includes(substatus);
46
46
  exports.isSubstatusDone = isSubstatusDone;
47
+ const _LIFuelState = ['PENDING', 'DONE', 'NOT_FOUND'];
@@ -198,6 +198,10 @@ export interface ExchangeDefinition {
198
198
  tool: ExchangeTools;
199
199
  chains: number[];
200
200
  }
201
+ /**
202
+ * Should not be accessed via the types package anymore
203
+ * @deprecated
204
+ */
201
205
  export interface BridgeDefinition {
202
206
  tool: BridgeTool;
203
207
  fromChainId: number;
@@ -1,5 +1,5 @@
1
1
  export * from './Chain';
2
+ export * from './chain.utils';
2
3
  export * from './EVMChain';
3
4
  export * from './SolanaChain';
4
5
  export * from './supported.chains';
5
- export * from './chain.utils';
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./Chain"), exports);
18
+ __exportStar(require("./chain.utils"), exports);
18
19
  __exportStar(require("./EVMChain"), exports);
19
20
  __exportStar(require("./SolanaChain"), exports);
20
21
  __exportStar(require("./supported.chains"), exports);
21
- __exportStar(require("./chain.utils"), exports);
@@ -1201,7 +1201,7 @@ exports.supportedEVMChains = [
1201
1201
  coin: base_1.CoinKey.ETH,
1202
1202
  id: 59140,
1203
1203
  mainnet: false,
1204
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/consensys_skevm_test.png',
1204
+ logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/consensys_zkevm_test.png',
1205
1205
  // multicallAddress: multicallAddresses[ChainId.CZKT], // Not deployed yet
1206
1206
  faucetUrls: ['https://goerli.zkevm.consensys.net/'],
1207
1207
  metamask: {
package/dist/cjs/coins.js CHANGED
@@ -126,6 +126,14 @@ const basicCoins = [
126
126
  address: '0x0000000000000000000000000000000000000000',
127
127
  decimals: 18,
128
128
  },
129
+ [base_1.ChainId.ARBG]: {
130
+ address: '0x0000000000000000000000000000000000000000',
131
+ decimals: 18,
132
+ },
133
+ [base_1.ChainId.CZKT]: {
134
+ address: '0x0000000000000000000000000000000000000000',
135
+ decimals: 18,
136
+ },
129
137
  },
130
138
  },
131
139
  // > MATIC
@@ -386,6 +394,10 @@ const basicCoins = [
386
394
  decimals: 8,
387
395
  name: 'Avalanche (Wormhole)',
388
396
  },
397
+ [base_1.ChainId.AVAT]: {
398
+ address: '0x0000000000000000000000000000000000000000',
399
+ decimals: 18,
400
+ },
389
401
  },
390
402
  },
391
403
  // > HT
@@ -679,6 +691,11 @@ const basicCoins = [
679
691
  address: '0x6d4dd09982853f08d9966ac3ca4eb5885f16f2b2',
680
692
  decimals: 6,
681
693
  },
694
+ [base_1.ChainId.CZKT]: {
695
+ address: '0x964FF70695da981027c81020B1c58d833D49A640',
696
+ decimals: 6,
697
+ name: 'ConsenSys USD Coin',
698
+ },
682
699
  // 42, 0xb7a4f3e9097c08da09517b5ab877f7a917224ede, 6
683
700
  },
684
701
  },
@@ -916,6 +933,10 @@ const basicCoins = [
916
933
  address: '0x4200000000000000000000000000000000000006',
917
934
  decimals: 18,
918
935
  },
936
+ [base_1.ChainId.CZKT]: {
937
+ address: '0x2C1b868d6596a18e32E61B901E4060C872647b6C',
938
+ decimals: 18,
939
+ },
919
940
  },
920
941
  },
921
942
  // > SUSHI
@@ -1512,6 +1533,16 @@ exports.wrappedTokens = {
1512
1533
  name: 'WETH',
1513
1534
  logoURI: 'https://zapper.fi/images/networks/ethereum/0x0000000000000000000000000000000000000000.png',
1514
1535
  },
1536
+ [base_1.ChainId.ARBG]: {
1537
+ // https://goerli.arbiscan.io/token/0x42da9eE191833756c618778145A86E6709f70C9b
1538
+ address: '0x42da9eE191833756c618778145A86E6709f70C9b',
1539
+ symbol: 'WETH',
1540
+ decimals: 18,
1541
+ chainId: base_1.ChainId.ARBG,
1542
+ coinKey: base_1.CoinKey.WETH,
1543
+ name: 'WETH',
1544
+ logoURI: 'https://zapper.fi/images/networks/ethereum/0x0000000000000000000000000000000000000000.png',
1545
+ },
1515
1546
  [base_1.ChainId.OPTT]: {
1516
1547
  // https://kovan-optimistic.etherscan.io/token/0x4200000000000000000000000000000000000006
1517
1548
  address: '0x4200000000000000000000000000000000000006',
@@ -1542,6 +1573,26 @@ exports.wrappedTokens = {
1542
1573
  name: 'WBNB',
1543
1574
  logoURI: 'https://zapper.fi/images/networks/binance-smart-chain/0x0000000000000000000000000000000000000000.png',
1544
1575
  },
1576
+ [base_1.ChainId.CZKT]: {
1577
+ // https://explorer.prealpha.zkevm.consensys.net/address/0x2C1b868d6596a18e32E61B901E4060C872647b6C
1578
+ address: '0x2C1b868d6596a18e32E61B901E4060C872647b6C',
1579
+ symbol: 'WETH',
1580
+ decimals: 18,
1581
+ chainId: base_1.ChainId.CZKT,
1582
+ coinKey: base_1.CoinKey.WETH,
1583
+ name: 'WETH',
1584
+ logoURI: 'https://zapper.fi/images/networks/ethereum/0x0000000000000000000000000000000000000000.png',
1585
+ },
1586
+ [base_1.ChainId.AVAT]: {
1587
+ // https://testnet.snowtrace.io/token/0xd00ae08403B9bbb9124bB305C09058E32C39A48c
1588
+ address: '0xd00ae08403B9bbb9124bB305C09058E32C39A48c',
1589
+ symbol: 'WAVAX',
1590
+ decimals: 18,
1591
+ chainId: base_1.ChainId.AVA,
1592
+ coinKey: 'WAVAX',
1593
+ name: 'Wrapped AVAX',
1594
+ logoURI: '',
1595
+ },
1545
1596
  };
1546
1597
  const findDefaultCoin = (coinKey) => {
1547
1598
  const coin = exports.defaultCoins.find((coin) => coin.key === coinKey);
package/dist/coins.js CHANGED
@@ -123,6 +123,14 @@ const basicCoins = [
123
123
  address: '0x0000000000000000000000000000000000000000',
124
124
  decimals: 18,
125
125
  },
126
+ [ChainId.ARBG]: {
127
+ address: '0x0000000000000000000000000000000000000000',
128
+ decimals: 18,
129
+ },
130
+ [ChainId.CZKT]: {
131
+ address: '0x0000000000000000000000000000000000000000',
132
+ decimals: 18,
133
+ },
126
134
  },
127
135
  },
128
136
  // > MATIC
@@ -383,6 +391,10 @@ const basicCoins = [
383
391
  decimals: 8,
384
392
  name: 'Avalanche (Wormhole)',
385
393
  },
394
+ [ChainId.AVAT]: {
395
+ address: '0x0000000000000000000000000000000000000000',
396
+ decimals: 18,
397
+ },
386
398
  },
387
399
  },
388
400
  // > HT
@@ -676,6 +688,11 @@ const basicCoins = [
676
688
  address: '0x6d4dd09982853f08d9966ac3ca4eb5885f16f2b2',
677
689
  decimals: 6,
678
690
  },
691
+ [ChainId.CZKT]: {
692
+ address: '0x964FF70695da981027c81020B1c58d833D49A640',
693
+ decimals: 6,
694
+ name: 'ConsenSys USD Coin',
695
+ },
679
696
  // 42, 0xb7a4f3e9097c08da09517b5ab877f7a917224ede, 6
680
697
  },
681
698
  },
@@ -913,6 +930,10 @@ const basicCoins = [
913
930
  address: '0x4200000000000000000000000000000000000006',
914
931
  decimals: 18,
915
932
  },
933
+ [ChainId.CZKT]: {
934
+ address: '0x2C1b868d6596a18e32E61B901E4060C872647b6C',
935
+ decimals: 18,
936
+ },
916
937
  },
917
938
  },
918
939
  // > SUSHI
@@ -1509,6 +1530,16 @@ export const wrappedTokens = {
1509
1530
  name: 'WETH',
1510
1531
  logoURI: 'https://zapper.fi/images/networks/ethereum/0x0000000000000000000000000000000000000000.png',
1511
1532
  },
1533
+ [ChainId.ARBG]: {
1534
+ // https://goerli.arbiscan.io/token/0x42da9eE191833756c618778145A86E6709f70C9b
1535
+ address: '0x42da9eE191833756c618778145A86E6709f70C9b',
1536
+ symbol: 'WETH',
1537
+ decimals: 18,
1538
+ chainId: ChainId.ARBG,
1539
+ coinKey: CoinKey.WETH,
1540
+ name: 'WETH',
1541
+ logoURI: 'https://zapper.fi/images/networks/ethereum/0x0000000000000000000000000000000000000000.png',
1542
+ },
1512
1543
  [ChainId.OPTT]: {
1513
1544
  // https://kovan-optimistic.etherscan.io/token/0x4200000000000000000000000000000000000006
1514
1545
  address: '0x4200000000000000000000000000000000000006',
@@ -1539,6 +1570,26 @@ export const wrappedTokens = {
1539
1570
  name: 'WBNB',
1540
1571
  logoURI: 'https://zapper.fi/images/networks/binance-smart-chain/0x0000000000000000000000000000000000000000.png',
1541
1572
  },
1573
+ [ChainId.CZKT]: {
1574
+ // https://explorer.prealpha.zkevm.consensys.net/address/0x2C1b868d6596a18e32E61B901E4060C872647b6C
1575
+ address: '0x2C1b868d6596a18e32E61B901E4060C872647b6C',
1576
+ symbol: 'WETH',
1577
+ decimals: 18,
1578
+ chainId: ChainId.CZKT,
1579
+ coinKey: CoinKey.WETH,
1580
+ name: 'WETH',
1581
+ logoURI: 'https://zapper.fi/images/networks/ethereum/0x0000000000000000000000000000000000000000.png',
1582
+ },
1583
+ [ChainId.AVAT]: {
1584
+ // https://testnet.snowtrace.io/token/0xd00ae08403B9bbb9124bB305C09058E32C39A48c
1585
+ address: '0xd00ae08403B9bbb9124bB305C09058E32C39A48c',
1586
+ symbol: 'WAVAX',
1587
+ decimals: 18,
1588
+ chainId: ChainId.AVA,
1589
+ coinKey: 'WAVAX',
1590
+ name: 'Wrapped AVAX',
1591
+ logoURI: '',
1592
+ },
1542
1593
  };
1543
1594
  export const findDefaultCoin = (coinKey) => {
1544
1595
  const coin = defaultCoins.find((coin) => coin.key === coinKey);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifi/types",
3
- "version": "2.1.0",
3
+ "version": "2.2.1",
4
4
  "description": "Types for the LI.FI stack",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/index.js",
@@ -73,26 +73,23 @@
73
73
  "ethers": "^5.7.2"
74
74
  },
75
75
  "devDependencies": {
76
- "@commitlint/cli": "^17.2.0",
77
- "@commitlint/config-conventional": "^17.2.0",
78
- "@types/jest": "^29.2.2",
79
- "@typescript-eslint/eslint-plugin": "^5.42.1",
80
- "@typescript-eslint/parser": "^5.42.1",
81
- "eslint": "^8.27.0",
82
- "eslint-config-prettier": "^8.5.0",
76
+ "@commitlint/cli": "^17.4.4",
77
+ "@commitlint/config-conventional": "^17.4.4",
78
+ "@types/jest": "^29.4.0",
79
+ "@typescript-eslint/eslint-plugin": "^5.54.0",
80
+ "@typescript-eslint/parser": "^5.54.0",
81
+ "eslint": "^8.35.0",
82
+ "eslint-config-prettier": "^8.6.0",
83
83
  "eslint-plugin-prettier": "^4.2.1",
84
- "husky": "^8.0.2",
85
- "jest": "^29.3.1",
86
- "lint-staged": ">=13.0.3",
84
+ "husky": "^8.0.3",
85
+ "jest": "^29.4.3",
86
+ "lint-staged": "^13.1.2",
87
87
  "npm-run-all": "^4.1.5",
88
88
  "pinst": "^3.0.0",
89
- "prettier": "^2.7.1",
89
+ "prettier": "^2.8.4",
90
90
  "standard-version": "^9.5.0",
91
- "ts-jest": "^29.0.3",
92
- "ts-loader": "^9.4.1",
93
- "typescript": "^4.8.4",
94
- "webpack": "^5.75.0",
95
- "webpack-cli": "^4.10.0"
91
+ "ts-jest": "^29.0.5",
92
+ "typescript": "^4.9.5"
96
93
  },
97
94
  "directories": {
98
95
  "test": "test"