@lifi/types 6.0.0 → 8.0.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,37 @@
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
+ ## [8.0.0](https://github.com/lifinance/types/compare/v5.3.0...v8.0.0) (2023-06-19)
6
+
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ * new types for status endpoint (#166)
11
+
12
+ ### Features
13
+
14
+ * add vvs finance logo png ([8dd8990](https://github.com/lifinance/types/commit/8dd89901f905768aa12f8bca75ffa4a7e43169c2))
15
+ * error reporting ([#171](https://github.com/lifinance/types/issues/171)) ([97eae77](https://github.com/lifinance/types/commit/97eae7777f0efd0fdbb442f47e0ba6d43d19be4a))
16
+ * new types for status endpoint ([#166](https://github.com/lifinance/types/issues/166)) ([b7262e2](https://github.com/lifinance/types/commit/b7262e2bd531bcfb84fcc756e1cd96ad79a261b9))
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * differentiate between USDC and USDC.e ([#173](https://github.com/lifinance/types/issues/173)) ([ed6572a](https://github.com/lifinance/types/commit/ed6572aff49ea3e58212551ddf8491aa7e97b4f0))
22
+
23
+ ## [7.0.0](https://github.com/lifinance/types/compare/v5.3.0...v7.0.0) (2023-06-06)
24
+
25
+
26
+ ### ⚠ BREAKING CHANGES
27
+
28
+ * new types for status endpoint (#166)
29
+
30
+ ### Features
31
+
32
+ * add vvs finance logo png ([8dd8990](https://github.com/lifinance/types/commit/8dd89901f905768aa12f8bca75ffa4a7e43169c2))
33
+ * error reporting ([#171](https://github.com/lifinance/types/issues/171)) ([97eae77](https://github.com/lifinance/types/commit/97eae7777f0efd0fdbb442f47e0ba6d43d19be4a))
34
+ * new types for status endpoint ([#166](https://github.com/lifinance/types/issues/166)) ([b7262e2](https://github.com/lifinance/types/commit/b7262e2bd531bcfb84fcc756e1cd96ad79a261b9))
35
+
5
36
  ## [6.0.0](https://github.com/lifinance/types/compare/v5.3.0...v6.0.0) (2023-05-09)
6
37
 
7
38
 
package/dist/api.d.ts CHANGED
@@ -206,17 +206,24 @@ export interface GetStatusRequest {
206
206
  fromChain?: number | string;
207
207
  toChain?: number | string;
208
208
  }
209
- export interface TransactionInfo {
209
+ export interface BaseTransactionInfo {
210
210
  txHash: string;
211
- txLink?: string;
211
+ chainId: ChainId;
212
+ txLink: string;
213
+ }
214
+ export interface ExtendedTransactionInfo extends BaseTransactionInfo {
212
215
  amount?: string;
216
+ amountUSD?: string;
213
217
  token?: Token;
214
- chainId?: ChainId;
215
- gasPrice?: string;
216
- gasUsed?: string;
217
- gasToken?: Token;
218
- gasAmount?: string;
219
- gasAmountUSD?: string;
218
+ gasPrice: string;
219
+ gasUsed: string;
220
+ gasToken: Token;
221
+ gasAmount: string;
222
+ gasAmountUSD: string;
223
+ timestamp?: number;
224
+ }
225
+ export interface PendingReceivingInfo {
226
+ chainId: ChainId;
220
227
  }
221
228
  declare const _StatusMessage: readonly ["NOT_FOUND", "INVALID", "PENDING", "DONE", "FAILED"];
222
229
  export type StatusMessage = (typeof _StatusMessage)[number];
@@ -230,15 +237,24 @@ export type Substatus = SubstatusPending | SubstatusDone | SubstatusFailed;
230
237
  export declare const isSubstatusPending: (substatus: Substatus) => substatus is "UNKNOWN_ERROR" | "WAIT_SOURCE_CONFIRMATIONS" | "WAIT_DESTINATION_TRANSACTION" | "BRIDGE_NOT_AVAILABLE" | "CHAIN_NOT_AVAILABLE" | "REFUND_IN_PROGRESS";
231
238
  export declare const isSubstatusDone: (substatus: Substatus) => substatus is "COMPLETED" | "PARTIAL" | "REFUNDED";
232
239
  export declare const isSubstatusFailed: (substatus: Substatus) => substatus is "NOT_PROCESSABLE_REFUND_NEEDED";
233
- export interface StatusInformation {
240
+ export interface BaseStatusData {
234
241
  status: StatusMessage;
235
242
  substatus?: Substatus;
236
243
  substatusMessage?: string;
237
244
  }
238
- export interface StatusResponse extends StatusInformation {
239
- sending: TransactionInfo;
240
- receiving?: TransactionInfo;
241
- tool?: string;
245
+ export interface StatusData extends BaseStatusData {
246
+ tool: string;
247
+ sending: BaseTransactionInfo;
248
+ receiving: PendingReceivingInfo;
249
+ }
250
+ export type StatusResponse = FullStatusData | StatusData;
251
+ export interface FullStatusData extends StatusData {
252
+ transactionId: string;
253
+ sending: ExtendedTransactionInfo;
254
+ receiving: PendingReceivingInfo | ExtendedTransactionInfo;
255
+ lifiExplorerLink: string;
256
+ fromAddress: string;
257
+ toAddress: string;
242
258
  bridgeExplorerLink?: string;
243
259
  }
244
260
  export interface ExtendedChain extends Chain {
@@ -286,8 +302,8 @@ declare const _LIFuelState: readonly ["PENDING", "DONE", "NOT_FOUND"];
286
302
  type LIFuelState = (typeof _LIFuelState)[number];
287
303
  export type LIFuelStatusResponse = {
288
304
  status: LIFuelState;
289
- sending?: TransactionInfo;
290
- receiving?: TransactionInfo;
305
+ sending?: ExtendedTransactionInfo;
306
+ receiving?: PendingReceivingInfo | ExtendedTransactionInfo;
291
307
  };
292
308
  export type GasRecommendationRequest = {
293
309
  chainId: ChainId;
package/dist/base.d.ts CHANGED
@@ -38,6 +38,7 @@ export declare enum CoinKey {
38
38
  cbtWUSDC = "cbtWUSDC",
39
39
  cbtCELR = "cbtCELR",
40
40
  BUSD = "BUSD",
41
+ USDCe = "USDCe",
41
42
  TEST = "TEST",
42
43
  KAL = "KAL",
43
44
  SDIODE = "SDIODE",
package/dist/base.js CHANGED
@@ -38,6 +38,7 @@ export var CoinKey;
38
38
  CoinKey["cbtWUSDC"] = "cbtWUSDC";
39
39
  CoinKey["cbtCELR"] = "cbtCELR";
40
40
  CoinKey["BUSD"] = "BUSD";
41
+ CoinKey["USDCe"] = "USDCe";
41
42
  // Testnet
42
43
  CoinKey["TEST"] = "TEST";
43
44
  CoinKey["KAL"] = "KAL";
package/dist/cjs/api.d.ts CHANGED
@@ -206,17 +206,24 @@ export interface GetStatusRequest {
206
206
  fromChain?: number | string;
207
207
  toChain?: number | string;
208
208
  }
209
- export interface TransactionInfo {
209
+ export interface BaseTransactionInfo {
210
210
  txHash: string;
211
- txLink?: string;
211
+ chainId: ChainId;
212
+ txLink: string;
213
+ }
214
+ export interface ExtendedTransactionInfo extends BaseTransactionInfo {
212
215
  amount?: string;
216
+ amountUSD?: string;
213
217
  token?: Token;
214
- chainId?: ChainId;
215
- gasPrice?: string;
216
- gasUsed?: string;
217
- gasToken?: Token;
218
- gasAmount?: string;
219
- gasAmountUSD?: string;
218
+ gasPrice: string;
219
+ gasUsed: string;
220
+ gasToken: Token;
221
+ gasAmount: string;
222
+ gasAmountUSD: string;
223
+ timestamp?: number;
224
+ }
225
+ export interface PendingReceivingInfo {
226
+ chainId: ChainId;
220
227
  }
221
228
  declare const _StatusMessage: readonly ["NOT_FOUND", "INVALID", "PENDING", "DONE", "FAILED"];
222
229
  export type StatusMessage = (typeof _StatusMessage)[number];
@@ -230,15 +237,24 @@ export type Substatus = SubstatusPending | SubstatusDone | SubstatusFailed;
230
237
  export declare const isSubstatusPending: (substatus: Substatus) => substatus is "UNKNOWN_ERROR" | "WAIT_SOURCE_CONFIRMATIONS" | "WAIT_DESTINATION_TRANSACTION" | "BRIDGE_NOT_AVAILABLE" | "CHAIN_NOT_AVAILABLE" | "REFUND_IN_PROGRESS";
231
238
  export declare const isSubstatusDone: (substatus: Substatus) => substatus is "COMPLETED" | "PARTIAL" | "REFUNDED";
232
239
  export declare const isSubstatusFailed: (substatus: Substatus) => substatus is "NOT_PROCESSABLE_REFUND_NEEDED";
233
- export interface StatusInformation {
240
+ export interface BaseStatusData {
234
241
  status: StatusMessage;
235
242
  substatus?: Substatus;
236
243
  substatusMessage?: string;
237
244
  }
238
- export interface StatusResponse extends StatusInformation {
239
- sending: TransactionInfo;
240
- receiving?: TransactionInfo;
241
- tool?: string;
245
+ export interface StatusData extends BaseStatusData {
246
+ tool: string;
247
+ sending: BaseTransactionInfo;
248
+ receiving: PendingReceivingInfo;
249
+ }
250
+ export type StatusResponse = FullStatusData | StatusData;
251
+ export interface FullStatusData extends StatusData {
252
+ transactionId: string;
253
+ sending: ExtendedTransactionInfo;
254
+ receiving: PendingReceivingInfo | ExtendedTransactionInfo;
255
+ lifiExplorerLink: string;
256
+ fromAddress: string;
257
+ toAddress: string;
242
258
  bridgeExplorerLink?: string;
243
259
  }
244
260
  export interface ExtendedChain extends Chain {
@@ -286,8 +302,8 @@ declare const _LIFuelState: readonly ["PENDING", "DONE", "NOT_FOUND"];
286
302
  type LIFuelState = (typeof _LIFuelState)[number];
287
303
  export type LIFuelStatusResponse = {
288
304
  status: LIFuelState;
289
- sending?: TransactionInfo;
290
- receiving?: TransactionInfo;
305
+ sending?: ExtendedTransactionInfo;
306
+ receiving?: PendingReceivingInfo | ExtendedTransactionInfo;
291
307
  };
292
308
  export type GasRecommendationRequest = {
293
309
  chainId: ChainId;
@@ -38,6 +38,7 @@ export declare enum CoinKey {
38
38
  cbtWUSDC = "cbtWUSDC",
39
39
  cbtCELR = "cbtCELR",
40
40
  BUSD = "BUSD",
41
+ USDCe = "USDCe",
41
42
  TEST = "TEST",
42
43
  KAL = "KAL",
43
44
  SDIODE = "SDIODE",
package/dist/cjs/base.js CHANGED
@@ -41,6 +41,7 @@ var CoinKey;
41
41
  CoinKey["cbtWUSDC"] = "cbtWUSDC";
42
42
  CoinKey["cbtCELR"] = "cbtCELR";
43
43
  CoinKey["BUSD"] = "BUSD";
44
+ CoinKey["USDCe"] = "USDCe";
44
45
  // Testnet
45
46
  CoinKey["TEST"] = "TEST";
46
47
  CoinKey["KAL"] = "KAL";
@@ -62,7 +63,7 @@ var CoinKey;
62
63
  CoinKey["MCB"] = "MCB";
63
64
  CoinKey["CELR"] = "CELR";
64
65
  CoinKey["IF"] = "IF";
65
- })(CoinKey = exports.CoinKey || (exports.CoinKey = {}));
66
+ })(CoinKey || (exports.CoinKey = CoinKey = {}));
66
67
  var ChainKey;
67
68
  (function (ChainKey) {
68
69
  ChainKey["ETH"] = "eth";
@@ -124,7 +125,7 @@ var ChainKey;
124
125
  ChainKey["MORT"] = "mort";
125
126
  ChainKey["FTMT"] = "ftmt";
126
127
  ChainKey["LNAT"] = "lnat";
127
- })(ChainKey = exports.ChainKey || (exports.ChainKey = {}));
128
+ })(ChainKey || (exports.ChainKey = ChainKey = {}));
128
129
  var ChainId;
129
130
  (function (ChainId) {
130
131
  ChainId[ChainId["ETH"] = 1] = "ETH";
@@ -186,4 +187,4 @@ var ChainId;
186
187
  ChainId[ChainId["MORT"] = 1287] = "MORT";
187
188
  ChainId[ChainId["FTMT"] = 4002] = "FTMT";
188
189
  ChainId[ChainId["LNAT"] = 59140] = "LNAT";
189
- })(ChainId = exports.ChainId || (exports.ChainId = {}));
190
+ })(ChainId || (exports.ChainId = ChainId = {}));
@@ -19,7 +19,7 @@ var BridgeTool;
19
19
  BridgeTool["across"] = "across";
20
20
  BridgeTool["portal"] = "portal";
21
21
  BridgeTool["stargate"] = "stargate";
22
- })(BridgeTool = exports.BridgeTool || (exports.BridgeTool = {}));
22
+ })(BridgeTool || (exports.BridgeTool = BridgeTool = {}));
23
23
  /**
24
24
  * @deprecated
25
25
  * These values are now obtainable from the LI.FI API
@@ -5,4 +5,4 @@ var ChainType;
5
5
  (function (ChainType) {
6
6
  ChainType["EVM"] = "EVM";
7
7
  ChainType["Solana"] = "SOLANA";
8
- })(ChainType = exports.ChainType || (exports.ChainType = {}));
8
+ })(ChainType || (exports.ChainType = ChainType = {}));
package/dist/cjs/coins.js CHANGED
@@ -756,7 +756,7 @@ const basicCoins = [
756
756
  // USDC
757
757
  {
758
758
  key: base_1.CoinKey.USDC,
759
- name: base_1.CoinKey.USDC,
759
+ name: 'USD Coin',
760
760
  logoURI: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png',
761
761
  verified: true,
762
762
  chains: {
@@ -798,7 +798,7 @@ const basicCoins = [
798
798
  decimals: 6,
799
799
  },
800
800
  [base_1.ChainId.ARB]: {
801
- address: '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8',
801
+ address: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
802
802
  decimals: 6,
803
803
  },
804
804
  [base_1.ChainId.ONE]: {
@@ -806,10 +806,8 @@ const basicCoins = [
806
806
  decimals: 6,
807
807
  },
808
808
  [base_1.ChainId.AVA]: {
809
- address: '0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664',
809
+ address: '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e',
810
810
  decimals: 6,
811
- symbol: 'USDC.e',
812
- name: 'USD Coin',
813
811
  },
814
812
  [base_1.ChainId.MOR]: {
815
813
  address: '0xe3f5a90f9cb311505cd691a46596599aa1a0ad7d',
@@ -874,6 +872,28 @@ const basicCoins = [
874
872
  // 42, 0xb7a4f3e9097c08da09517b5ab877f7a917224ede, 6
875
873
  },
876
874
  },
875
+ // USDC.e
876
+ // Represents the USD Coin (USDC) bridged from Ethereum (as opposed to the 'native' USDC issued by Circle)
877
+ {
878
+ key: base_1.CoinKey.USDCe,
879
+ name: base_1.CoinKey.USDCe,
880
+ logoURI: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png',
881
+ verified: true,
882
+ chains: {
883
+ [base_1.ChainId.ARB]: {
884
+ address: '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8',
885
+ decimals: 6,
886
+ name: 'Bridged USD Coin',
887
+ symbol: 'USDC.e',
888
+ },
889
+ [base_1.ChainId.AVA]: {
890
+ address: '0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664',
891
+ decimals: 6,
892
+ name: 'Bridged USD Coin',
893
+ symbol: 'USDC.e',
894
+ },
895
+ },
896
+ },
877
897
  // BUSD
878
898
  {
879
899
  key: base_1.CoinKey.BUSD,
@@ -13,7 +13,7 @@ var ExchangeTool;
13
13
  ExchangeTool["openocean"] = "openocean";
14
14
  ExchangeTool["zerox"] = "0x";
15
15
  ExchangeTool["dodo"] = "dodo";
16
- })(ExchangeTool = exports.ExchangeTool || (exports.ExchangeTool = {}));
16
+ })(ExchangeTool || (exports.ExchangeTool = ExchangeTool = {}));
17
17
  /**
18
18
  * @deprecated
19
19
  * These values are now obtainable from the LI.FI API
package/dist/coins.js CHANGED
@@ -753,7 +753,7 @@ const basicCoins = [
753
753
  // USDC
754
754
  {
755
755
  key: CoinKey.USDC,
756
- name: CoinKey.USDC,
756
+ name: 'USD Coin',
757
757
  logoURI: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png',
758
758
  verified: true,
759
759
  chains: {
@@ -795,7 +795,7 @@ const basicCoins = [
795
795
  decimals: 6,
796
796
  },
797
797
  [ChainId.ARB]: {
798
- address: '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8',
798
+ address: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
799
799
  decimals: 6,
800
800
  },
801
801
  [ChainId.ONE]: {
@@ -803,10 +803,8 @@ const basicCoins = [
803
803
  decimals: 6,
804
804
  },
805
805
  [ChainId.AVA]: {
806
- address: '0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664',
806
+ address: '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e',
807
807
  decimals: 6,
808
- symbol: 'USDC.e',
809
- name: 'USD Coin',
810
808
  },
811
809
  [ChainId.MOR]: {
812
810
  address: '0xe3f5a90f9cb311505cd691a46596599aa1a0ad7d',
@@ -871,6 +869,28 @@ const basicCoins = [
871
869
  // 42, 0xb7a4f3e9097c08da09517b5ab877f7a917224ede, 6
872
870
  },
873
871
  },
872
+ // USDC.e
873
+ // Represents the USD Coin (USDC) bridged from Ethereum (as opposed to the 'native' USDC issued by Circle)
874
+ {
875
+ key: CoinKey.USDCe,
876
+ name: CoinKey.USDCe,
877
+ logoURI: 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png',
878
+ verified: true,
879
+ chains: {
880
+ [ChainId.ARB]: {
881
+ address: '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8',
882
+ decimals: 6,
883
+ name: 'Bridged USD Coin',
884
+ symbol: 'USDC.e',
885
+ },
886
+ [ChainId.AVA]: {
887
+ address: '0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664',
888
+ decimals: 6,
889
+ name: 'Bridged USD Coin',
890
+ symbol: 'USDC.e',
891
+ },
892
+ },
893
+ },
874
894
  // BUSD
875
895
  {
876
896
  key: CoinKey.BUSD,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifi/types",
3
- "version": "6.0.0",
3
+ "version": "8.0.0",
4
4
  "description": "Types for the LI.FI stack",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/index.js",