@lifi/types 1.24.0 → 2.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 +20 -0
- package/dist/api.d.ts +7 -2
- package/dist/cjs/api.d.ts +7 -2
- package/dist/cjs/step.d.ts +8 -2
- package/dist/cjs/step.js +5 -1
- package/dist/step.d.ts +8 -2
- package/dist/step.js +3 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
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.0.0](https://github.com/lifinance/types/compare/v1.19.0...v2.0.0) (2023-02-13)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* add lif3swap dex on POL and BSC ([#120](https://github.com/lifinance/types/issues/120)) ([b213e28](https://github.com/lifinance/types/commit/b213e281ce777465180b11a0585ad71f98404df7))
|
|
11
|
+
* add opt allowDestCall flag to /routes,/quote ([#122](https://github.com/lifinance/types/issues/122)) ([a899bf2](https://github.com/lifinance/types/commit/a899bf2fee112de6fff002ee0c737f3325f71efa))
|
|
12
|
+
* add types for quests ([#116](https://github.com/lifinance/types/issues/116)) ([ce923d3](https://github.com/lifinance/types/commit/ce923d311ce3921c736ae75e3316fb66415b98b4))
|
|
13
|
+
* add wantInsurance flag to RoutesContext ([#126](https://github.com/lifinance/types/issues/126)) ([cfa6f76](https://github.com/lifinance/types/commit/cfa6f769756be18a821af1e4577c6f28c83db2d3))
|
|
14
|
+
* added flag for variable price impact ([#127](https://github.com/lifinance/types/issues/127)) ([7adf21b](https://github.com/lifinance/types/commit/7adf21baa809c388421b10dad51d18731829372e))
|
|
15
|
+
* added protocol step type + routes can only contain lifi steps ([#130](https://github.com/lifinance/types/issues/130)) ([cedfeec](https://github.com/lifinance/types/commit/cedfeec618b243700bc44e305e29057dceaefc38))
|
|
16
|
+
* insurance option in quoteRequest ([#128](https://github.com/lifinance/types/issues/128)) ([4a9a064](https://github.com/lifinance/types/commit/4a9a064c2c3d92f55d97b700669e2be491e7ab41))
|
|
17
|
+
* make properties of Interface GetStatusRequest optional ([f2be836](https://github.com/lifinance/types/commit/f2be8362c4cad7227dba9ff4d4d9d885b9de4bc5))
|
|
18
|
+
* trusted gas parameter for routes and quote request ([#129](https://github.com/lifinance/types/issues/129)) ([927adaa](https://github.com/lifinance/types/commit/927adaa83129a6422718d65a26f39ae0d4d90dfc))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* rename XDAI token to DAI on most chains ([#125](https://github.com/lifinance/types/issues/125)) ([32a17b9](https://github.com/lifinance/types/commit/32a17b93cc9abd2b764bb03e9c7c1a06522bbf36))
|
|
24
|
+
|
|
5
25
|
## [1.24.0](https://github.com/lifinance/types/compare/v1.23.0...v1.24.0) (2023-02-09)
|
|
6
26
|
|
|
7
27
|
|
package/dist/api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TransactionRequest } from '@ethersproject/providers';
|
|
2
|
-
import { BridgeDefinition, Chain, ChainId, ExchangeDefinition,
|
|
2
|
+
import { BridgeDefinition, Chain, ChainId, ExchangeDefinition, LifiStep, Token } from '.';
|
|
3
3
|
import { ToolError } from './apiErrors';
|
|
4
4
|
export declare const Orders: readonly ["RECOMMENDED", "FASTEST", "CHEAPEST", "SAFEST"];
|
|
5
5
|
export type Order = typeof Orders[number];
|
|
@@ -12,6 +12,7 @@ export interface RoutesRequest {
|
|
|
12
12
|
toTokenAddress: string;
|
|
13
13
|
toAddress?: string;
|
|
14
14
|
options?: RouteOptions;
|
|
15
|
+
convertAmountToGas?: string;
|
|
15
16
|
}
|
|
16
17
|
export interface RouteOptions {
|
|
17
18
|
order?: Order;
|
|
@@ -25,6 +26,7 @@ export interface RouteOptions {
|
|
|
25
26
|
exchanges?: AllowDenyPrefer;
|
|
26
27
|
fee?: number;
|
|
27
28
|
insurance?: boolean;
|
|
29
|
+
hideRoutesWithGTEPriceImpact?: number;
|
|
28
30
|
}
|
|
29
31
|
export type ToolsResponse = {
|
|
30
32
|
exchanges: {
|
|
@@ -64,7 +66,7 @@ export interface Route {
|
|
|
64
66
|
gasCostUSD?: string;
|
|
65
67
|
containsSwitchChain?: boolean;
|
|
66
68
|
infiniteApproval?: boolean;
|
|
67
|
-
steps:
|
|
69
|
+
steps: LifiStep[];
|
|
68
70
|
tags?: Order[];
|
|
69
71
|
}
|
|
70
72
|
export interface RoutesResponse {
|
|
@@ -111,6 +113,8 @@ export interface QuoteRequest extends ToolConfiguration {
|
|
|
111
113
|
fee?: number | string;
|
|
112
114
|
insurance?: boolean;
|
|
113
115
|
allowDestinationCall?: boolean;
|
|
116
|
+
convertAmountToGas?: string;
|
|
117
|
+
hideRoutesWithGTEPriceImpact?: number;
|
|
114
118
|
}
|
|
115
119
|
export interface ContractCallQuoteRequest extends ToolConfiguration {
|
|
116
120
|
fromChain: number | string;
|
|
@@ -130,6 +134,7 @@ export interface ContractCallQuoteRequest extends ToolConfiguration {
|
|
|
130
134
|
referrer?: string;
|
|
131
135
|
fee?: number | string;
|
|
132
136
|
allowDestinationCall?: boolean;
|
|
137
|
+
hideRoutesWithGTEPriceImpact?: number;
|
|
133
138
|
}
|
|
134
139
|
export interface ContractCallQuotesRequest extends ToolConfiguration {
|
|
135
140
|
fromChain: number | string;
|
package/dist/cjs/api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TransactionRequest } from '@ethersproject/providers';
|
|
2
|
-
import { BridgeDefinition, Chain, ChainId, ExchangeDefinition,
|
|
2
|
+
import { BridgeDefinition, Chain, ChainId, ExchangeDefinition, LifiStep, Token } from '.';
|
|
3
3
|
import { ToolError } from './apiErrors';
|
|
4
4
|
export declare const Orders: readonly ["RECOMMENDED", "FASTEST", "CHEAPEST", "SAFEST"];
|
|
5
5
|
export type Order = typeof Orders[number];
|
|
@@ -12,6 +12,7 @@ export interface RoutesRequest {
|
|
|
12
12
|
toTokenAddress: string;
|
|
13
13
|
toAddress?: string;
|
|
14
14
|
options?: RouteOptions;
|
|
15
|
+
convertAmountToGas?: string;
|
|
15
16
|
}
|
|
16
17
|
export interface RouteOptions {
|
|
17
18
|
order?: Order;
|
|
@@ -25,6 +26,7 @@ export interface RouteOptions {
|
|
|
25
26
|
exchanges?: AllowDenyPrefer;
|
|
26
27
|
fee?: number;
|
|
27
28
|
insurance?: boolean;
|
|
29
|
+
hideRoutesWithGTEPriceImpact?: number;
|
|
28
30
|
}
|
|
29
31
|
export type ToolsResponse = {
|
|
30
32
|
exchanges: {
|
|
@@ -64,7 +66,7 @@ export interface Route {
|
|
|
64
66
|
gasCostUSD?: string;
|
|
65
67
|
containsSwitchChain?: boolean;
|
|
66
68
|
infiniteApproval?: boolean;
|
|
67
|
-
steps:
|
|
69
|
+
steps: LifiStep[];
|
|
68
70
|
tags?: Order[];
|
|
69
71
|
}
|
|
70
72
|
export interface RoutesResponse {
|
|
@@ -111,6 +113,8 @@ export interface QuoteRequest extends ToolConfiguration {
|
|
|
111
113
|
fee?: number | string;
|
|
112
114
|
insurance?: boolean;
|
|
113
115
|
allowDestinationCall?: boolean;
|
|
116
|
+
convertAmountToGas?: string;
|
|
117
|
+
hideRoutesWithGTEPriceImpact?: number;
|
|
114
118
|
}
|
|
115
119
|
export interface ContractCallQuoteRequest extends ToolConfiguration {
|
|
116
120
|
fromChain: number | string;
|
|
@@ -130,6 +134,7 @@ export interface ContractCallQuoteRequest extends ToolConfiguration {
|
|
|
130
134
|
referrer?: string;
|
|
131
135
|
fee?: number | string;
|
|
132
136
|
allowDestinationCall?: boolean;
|
|
137
|
+
hideRoutesWithGTEPriceImpact?: number;
|
|
133
138
|
}
|
|
134
139
|
export interface ContractCallQuotesRequest extends ToolConfiguration {
|
|
135
140
|
fromChain: number | string;
|
package/dist/cjs/step.d.ts
CHANGED
|
@@ -74,7 +74,7 @@ export interface Execution {
|
|
|
74
74
|
gasAmountUSD?: string;
|
|
75
75
|
}
|
|
76
76
|
export declare const emptyExecution: Execution;
|
|
77
|
-
export type StepType = 'swap' | 'cross' | 'lifi' | 'custom';
|
|
77
|
+
export type StepType = 'swap' | 'cross' | 'lifi' | 'custom' | 'protocol';
|
|
78
78
|
export type StepTool = string;
|
|
79
79
|
export interface StepBase {
|
|
80
80
|
id: string;
|
|
@@ -99,6 +99,11 @@ export interface CrossStep extends StepBase {
|
|
|
99
99
|
action: Action;
|
|
100
100
|
estimate: Estimate;
|
|
101
101
|
}
|
|
102
|
+
export interface ProtocolStep extends StepBase {
|
|
103
|
+
type: 'protocol';
|
|
104
|
+
action: Action;
|
|
105
|
+
estimate: Estimate;
|
|
106
|
+
}
|
|
102
107
|
export declare function isCrossStep(step: Step): step is CrossStep;
|
|
103
108
|
export interface LifiStep extends StepBase {
|
|
104
109
|
type: 'lifi';
|
|
@@ -119,4 +124,5 @@ export interface CustomStep extends StepBase {
|
|
|
119
124
|
};
|
|
120
125
|
}
|
|
121
126
|
export declare function isCustomStep(step: Step): step is CustomStep;
|
|
122
|
-
export
|
|
127
|
+
export declare function isProtocolStep(step: Step): step is ProtocolStep;
|
|
128
|
+
export type Step = SwapStep | CrossStep | LifiStep | CustomStep | ProtocolStep;
|
package/dist/cjs/step.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isCustomStep = exports.isLifiStep = exports.isCrossStep = exports.isSwapStep = exports.emptyExecution = void 0;
|
|
3
|
+
exports.isProtocolStep = exports.isCustomStep = exports.isLifiStep = exports.isCrossStep = exports.isSwapStep = exports.emptyExecution = void 0;
|
|
4
4
|
exports.emptyExecution = {
|
|
5
5
|
status: 'NOT_STARTED',
|
|
6
6
|
process: [],
|
|
@@ -21,3 +21,7 @@ function isCustomStep(step) {
|
|
|
21
21
|
return step.type === 'custom';
|
|
22
22
|
}
|
|
23
23
|
exports.isCustomStep = isCustomStep;
|
|
24
|
+
function isProtocolStep(step) {
|
|
25
|
+
return step.type === 'protocol';
|
|
26
|
+
}
|
|
27
|
+
exports.isProtocolStep = isProtocolStep;
|
package/dist/step.d.ts
CHANGED
|
@@ -74,7 +74,7 @@ export interface Execution {
|
|
|
74
74
|
gasAmountUSD?: string;
|
|
75
75
|
}
|
|
76
76
|
export declare const emptyExecution: Execution;
|
|
77
|
-
export type StepType = 'swap' | 'cross' | 'lifi' | 'custom';
|
|
77
|
+
export type StepType = 'swap' | 'cross' | 'lifi' | 'custom' | 'protocol';
|
|
78
78
|
export type StepTool = string;
|
|
79
79
|
export interface StepBase {
|
|
80
80
|
id: string;
|
|
@@ -99,6 +99,11 @@ export interface CrossStep extends StepBase {
|
|
|
99
99
|
action: Action;
|
|
100
100
|
estimate: Estimate;
|
|
101
101
|
}
|
|
102
|
+
export interface ProtocolStep extends StepBase {
|
|
103
|
+
type: 'protocol';
|
|
104
|
+
action: Action;
|
|
105
|
+
estimate: Estimate;
|
|
106
|
+
}
|
|
102
107
|
export declare function isCrossStep(step: Step): step is CrossStep;
|
|
103
108
|
export interface LifiStep extends StepBase {
|
|
104
109
|
type: 'lifi';
|
|
@@ -119,4 +124,5 @@ export interface CustomStep extends StepBase {
|
|
|
119
124
|
};
|
|
120
125
|
}
|
|
121
126
|
export declare function isCustomStep(step: Step): step is CustomStep;
|
|
122
|
-
export
|
|
127
|
+
export declare function isProtocolStep(step: Step): step is ProtocolStep;
|
|
128
|
+
export type Step = SwapStep | CrossStep | LifiStep | CustomStep | ProtocolStep;
|
package/dist/step.js
CHANGED