@lifi/types 5.3.0 → 7.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,31 @@
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
+ ## [7.0.0](https://github.com/lifinance/types/compare/v5.3.0...v7.0.0) (2023-06-06)
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
+ ## [6.0.0](https://github.com/lifinance/types/compare/v5.3.0...v6.0.0) (2023-05-09)
19
+
20
+
21
+ ### ⚠ BREAKING CHANGES
22
+
23
+ * **explainableFailures:** added supporting types
24
+
25
+ ### Features
26
+
27
+ * error reporting ([8120a4e](https://github.com/lifinance/types/commit/8120a4efe26c19d7fdc95ac9d72b91d1dc988fbc))
28
+ * **explainableFailures:** added supporting types ([50310b9](https://github.com/lifinance/types/commit/50310b93e3f55e3185b7234821fbf19efb5dd8d4))
29
+
5
30
  ## [5.3.0](https://github.com/lifinance/types/compare/v5.2.2...v5.3.0) (2023-05-05)
6
31
 
7
32
 
package/dist/api.d.ts CHANGED
@@ -76,9 +76,24 @@ export interface Route {
76
76
  steps: LifiStep[];
77
77
  tags?: Order[];
78
78
  }
79
+ export type ErroredPaths = {
80
+ [subpath: string]: ToolError[];
81
+ };
82
+ export type ErroredRoute = {
83
+ overallPath: string;
84
+ subpaths: ErroredPaths;
85
+ };
86
+ export type FilteredResult = {
87
+ overallPath: string;
88
+ reason: string;
89
+ };
90
+ export type UnavailableRoutes = {
91
+ filteredOut: FilteredResult[];
92
+ failed: ErroredRoute[];
93
+ };
79
94
  export interface RoutesResponse {
80
95
  routes: Route[];
81
- errors: ToolError[];
96
+ unavailableRoutes: UnavailableRoutes;
82
97
  }
83
98
  export type PossibilityTopic = 'chains' | 'tokens' | 'bridges' | 'exchanges';
84
99
  /**
@@ -191,17 +206,24 @@ export interface GetStatusRequest {
191
206
  fromChain?: number | string;
192
207
  toChain?: number | string;
193
208
  }
194
- export interface TransactionInfo {
209
+ export interface BaseTransactionInfo {
195
210
  txHash: string;
196
- txLink?: string;
211
+ chainId: ChainId;
212
+ txLink: string;
213
+ }
214
+ export interface ExtendedTransactionInfo extends BaseTransactionInfo {
197
215
  amount?: string;
216
+ amountUSD?: string;
198
217
  token?: Token;
199
- chainId?: ChainId;
200
- gasPrice?: string;
201
- gasUsed?: string;
202
- gasToken?: Token;
203
- gasAmount?: string;
204
- 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;
205
227
  }
206
228
  declare const _StatusMessage: readonly ["NOT_FOUND", "INVALID", "PENDING", "DONE", "FAILED"];
207
229
  export type StatusMessage = (typeof _StatusMessage)[number];
@@ -215,15 +237,24 @@ export type Substatus = SubstatusPending | SubstatusDone | SubstatusFailed;
215
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";
216
238
  export declare const isSubstatusDone: (substatus: Substatus) => substatus is "COMPLETED" | "PARTIAL" | "REFUNDED";
217
239
  export declare const isSubstatusFailed: (substatus: Substatus) => substatus is "NOT_PROCESSABLE_REFUND_NEEDED";
218
- export interface StatusInformation {
240
+ export interface BaseStatusData {
219
241
  status: StatusMessage;
220
242
  substatus?: Substatus;
221
243
  substatusMessage?: string;
222
244
  }
223
- export interface StatusResponse extends StatusInformation {
224
- sending: TransactionInfo;
225
- receiving?: TransactionInfo;
226
- 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;
227
258
  bridgeExplorerLink?: string;
228
259
  }
229
260
  export interface ExtendedChain extends Chain {
@@ -271,8 +302,8 @@ declare const _LIFuelState: readonly ["PENDING", "DONE", "NOT_FOUND"];
271
302
  type LIFuelState = (typeof _LIFuelState)[number];
272
303
  export type LIFuelStatusResponse = {
273
304
  status: LIFuelState;
274
- sending?: TransactionInfo;
275
- receiving?: TransactionInfo;
305
+ sending?: ExtendedTransactionInfo;
306
+ receiving?: PendingReceivingInfo | ExtendedTransactionInfo;
276
307
  };
277
308
  export type GasRecommendationRequest = {
278
309
  chainId: ChainId;
package/dist/cjs/api.d.ts CHANGED
@@ -76,9 +76,24 @@ export interface Route {
76
76
  steps: LifiStep[];
77
77
  tags?: Order[];
78
78
  }
79
+ export type ErroredPaths = {
80
+ [subpath: string]: ToolError[];
81
+ };
82
+ export type ErroredRoute = {
83
+ overallPath: string;
84
+ subpaths: ErroredPaths;
85
+ };
86
+ export type FilteredResult = {
87
+ overallPath: string;
88
+ reason: string;
89
+ };
90
+ export type UnavailableRoutes = {
91
+ filteredOut: FilteredResult[];
92
+ failed: ErroredRoute[];
93
+ };
79
94
  export interface RoutesResponse {
80
95
  routes: Route[];
81
- errors: ToolError[];
96
+ unavailableRoutes: UnavailableRoutes;
82
97
  }
83
98
  export type PossibilityTopic = 'chains' | 'tokens' | 'bridges' | 'exchanges';
84
99
  /**
@@ -191,17 +206,24 @@ export interface GetStatusRequest {
191
206
  fromChain?: number | string;
192
207
  toChain?: number | string;
193
208
  }
194
- export interface TransactionInfo {
209
+ export interface BaseTransactionInfo {
195
210
  txHash: string;
196
- txLink?: string;
211
+ chainId: ChainId;
212
+ txLink: string;
213
+ }
214
+ export interface ExtendedTransactionInfo extends BaseTransactionInfo {
197
215
  amount?: string;
216
+ amountUSD?: string;
198
217
  token?: Token;
199
- chainId?: ChainId;
200
- gasPrice?: string;
201
- gasUsed?: string;
202
- gasToken?: Token;
203
- gasAmount?: string;
204
- 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;
205
227
  }
206
228
  declare const _StatusMessage: readonly ["NOT_FOUND", "INVALID", "PENDING", "DONE", "FAILED"];
207
229
  export type StatusMessage = (typeof _StatusMessage)[number];
@@ -215,15 +237,24 @@ export type Substatus = SubstatusPending | SubstatusDone | SubstatusFailed;
215
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";
216
238
  export declare const isSubstatusDone: (substatus: Substatus) => substatus is "COMPLETED" | "PARTIAL" | "REFUNDED";
217
239
  export declare const isSubstatusFailed: (substatus: Substatus) => substatus is "NOT_PROCESSABLE_REFUND_NEEDED";
218
- export interface StatusInformation {
240
+ export interface BaseStatusData {
219
241
  status: StatusMessage;
220
242
  substatus?: Substatus;
221
243
  substatusMessage?: string;
222
244
  }
223
- export interface StatusResponse extends StatusInformation {
224
- sending: TransactionInfo;
225
- receiving?: TransactionInfo;
226
- 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;
227
258
  bridgeExplorerLink?: string;
228
259
  }
229
260
  export interface ExtendedChain extends Chain {
@@ -271,8 +302,8 @@ declare const _LIFuelState: readonly ["PENDING", "DONE", "NOT_FOUND"];
271
302
  type LIFuelState = (typeof _LIFuelState)[number];
272
303
  export type LIFuelStatusResponse = {
273
304
  status: LIFuelState;
274
- sending?: TransactionInfo;
275
- receiving?: TransactionInfo;
305
+ sending?: ExtendedTransactionInfo;
306
+ receiving?: PendingReceivingInfo | ExtendedTransactionInfo;
276
307
  };
277
308
  export type GasRecommendationRequest = {
278
309
  chainId: ChainId;
package/dist/cjs/base.js CHANGED
@@ -62,7 +62,7 @@ var CoinKey;
62
62
  CoinKey["MCB"] = "MCB";
63
63
  CoinKey["CELR"] = "CELR";
64
64
  CoinKey["IF"] = "IF";
65
- })(CoinKey = exports.CoinKey || (exports.CoinKey = {}));
65
+ })(CoinKey || (exports.CoinKey = CoinKey = {}));
66
66
  var ChainKey;
67
67
  (function (ChainKey) {
68
68
  ChainKey["ETH"] = "eth";
@@ -124,7 +124,7 @@ var ChainKey;
124
124
  ChainKey["MORT"] = "mort";
125
125
  ChainKey["FTMT"] = "ftmt";
126
126
  ChainKey["LNAT"] = "lnat";
127
- })(ChainKey = exports.ChainKey || (exports.ChainKey = {}));
127
+ })(ChainKey || (exports.ChainKey = ChainKey = {}));
128
128
  var ChainId;
129
129
  (function (ChainId) {
130
130
  ChainId[ChainId["ETH"] = 1] = "ETH";
@@ -186,4 +186,4 @@ var ChainId;
186
186
  ChainId[ChainId["MORT"] = 1287] = "MORT";
187
187
  ChainId[ChainId["FTMT"] = 4002] = "FTMT";
188
188
  ChainId[ChainId["LNAT"] = 59140] = "LNAT";
189
- })(ChainId = exports.ChainId || (exports.ChainId = {}));
189
+ })(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 = {}));
@@ -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
@@ -5,5 +5,6 @@ export * from './coins';
5
5
  export * from './exchanges';
6
6
  export * from './step';
7
7
  export * from './api';
8
+ export * from './apiErrors';
8
9
  export * from './multicall';
9
10
  export * from './quests';
package/dist/cjs/index.js CHANGED
@@ -21,5 +21,6 @@ __exportStar(require("./coins"), exports);
21
21
  __exportStar(require("./exchanges"), exports);
22
22
  __exportStar(require("./step"), exports);
23
23
  __exportStar(require("./api"), exports);
24
+ __exportStar(require("./apiErrors"), exports);
24
25
  __exportStar(require("./multicall"), exports);
25
26
  __exportStar(require("./quests"), exports);
package/dist/index.d.ts CHANGED
@@ -5,5 +5,6 @@ export * from './coins';
5
5
  export * from './exchanges';
6
6
  export * from './step';
7
7
  export * from './api';
8
+ export * from './apiErrors';
8
9
  export * from './multicall';
9
10
  export * from './quests';
package/dist/index.js CHANGED
@@ -5,5 +5,6 @@ export * from './coins';
5
5
  export * from './exchanges';
6
6
  export * from './step';
7
7
  export * from './api';
8
+ export * from './apiErrors';
8
9
  export * from './multicall';
9
10
  export * from './quests';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifi/types",
3
- "version": "5.3.0",
3
+ "version": "7.0.0",
4
4
  "description": "Types for the LI.FI stack",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/index.js",