@lifi/types 2.5.6 → 2.6.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 +9 -0
- package/dist/cjs/coins.js +4 -0
- package/dist/cjs/step.d.ts +16 -16
- package/dist/cjs/step.js +1 -5
- package/dist/coins.js +4 -0
- package/dist/step.d.ts +16 -16
- package/dist/step.js +0 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
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.6.0](https://github.com/lifinance/types/compare/v2.5.7...v2.6.0) (2023-03-22)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* supporting types ([#124](https://github.com/lifinance/types/issues/124)) ([9fc1fa7](https://github.com/lifinance/types/commit/9fc1fa718ff7dc8fa1c33990bb136357179131cf))
|
|
11
|
+
|
|
12
|
+
### [2.5.7](https://github.com/lifinance/types/compare/v2.5.6...v2.5.7) (2023-03-20)
|
|
13
|
+
|
|
5
14
|
### [2.5.6](https://github.com/lifinance/types/compare/v2.5.5...v2.5.6) (2023-03-17)
|
|
6
15
|
|
|
7
16
|
### [2.5.5](https://github.com/lifinance/types/compare/v2.5.4...v2.5.5) (2023-03-17)
|
package/dist/cjs/coins.js
CHANGED
package/dist/cjs/step.d.ts
CHANGED
|
@@ -10,10 +10,11 @@ export interface FeeCost {
|
|
|
10
10
|
token: Token;
|
|
11
11
|
amount: string;
|
|
12
12
|
amountUSD?: string;
|
|
13
|
+
included: boolean;
|
|
13
14
|
}
|
|
14
15
|
export interface GasCost {
|
|
15
16
|
type: 'SUM' | 'APPROVE' | 'SEND' | 'FEE';
|
|
16
|
-
price
|
|
17
|
+
price: string;
|
|
17
18
|
estimate?: string;
|
|
18
19
|
limit?: string;
|
|
19
20
|
amount: string;
|
|
@@ -31,6 +32,7 @@ export interface Action {
|
|
|
31
32
|
slippage: number;
|
|
32
33
|
}
|
|
33
34
|
export interface Estimate {
|
|
35
|
+
tool: string;
|
|
34
36
|
fromAmount: string;
|
|
35
37
|
fromAmountUSD?: string;
|
|
36
38
|
toAmount: string;
|
|
@@ -40,7 +42,6 @@ export interface Estimate {
|
|
|
40
42
|
feeCosts?: FeeCost[];
|
|
41
43
|
gasCosts?: GasCost[];
|
|
42
44
|
executionDuration: number;
|
|
43
|
-
data?: any;
|
|
44
45
|
}
|
|
45
46
|
export type Status = 'NOT_STARTED' | 'STARTED' | 'ACTION_REQUIRED' | 'CHAIN_SWITCH_REQUIRED' | 'PENDING' | 'FAILED' | 'DONE' | 'RESUME' | 'CANCELLED';
|
|
46
47
|
export type ProcessType = 'TOKEN_ALLOWANCE' | 'SWITCH_CHAIN' | 'SWAP' | 'CROSS_CHAIN' | 'RECEIVING_CHAIN' | 'TRANSACTION';
|
|
@@ -105,24 +106,23 @@ export interface ProtocolStep extends StepBase {
|
|
|
105
106
|
estimate: Estimate;
|
|
106
107
|
}
|
|
107
108
|
export declare function isCrossStep(step: Step): step is CrossStep;
|
|
108
|
-
export interface
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
export interface DestinationCallInfo {
|
|
110
|
+
toContractAddress: string;
|
|
111
|
+
toContractCallData: string;
|
|
112
|
+
toFallbackAddress: string;
|
|
113
|
+
callDataGasLimit: string;
|
|
113
114
|
}
|
|
114
|
-
export
|
|
115
|
+
export type CallAction = Action & DestinationCallInfo;
|
|
115
116
|
export interface CustomStep extends StepBase {
|
|
116
117
|
type: 'custom';
|
|
117
|
-
action:
|
|
118
|
+
action: CallAction;
|
|
118
119
|
estimate: Estimate;
|
|
119
|
-
destinationCallInfo: {
|
|
120
|
-
toContractAddress: string;
|
|
121
|
-
toContractCallData: string;
|
|
122
|
-
toFallbackAddress: string;
|
|
123
|
-
callDataGasLimit: string;
|
|
124
|
-
};
|
|
125
120
|
}
|
|
126
121
|
export declare function isCustomStep(step: Step): step is CustomStep;
|
|
127
122
|
export declare function isProtocolStep(step: Step): step is ProtocolStep;
|
|
128
|
-
export type Step = SwapStep | CrossStep |
|
|
123
|
+
export type Step = SwapStep | CrossStep | CustomStep | ProtocolStep;
|
|
124
|
+
export type LifiStep = Omit<Step, 'type'> & {
|
|
125
|
+
includedSteps: Step[];
|
|
126
|
+
} & {
|
|
127
|
+
type: 'lifi';
|
|
128
|
+
};
|
package/dist/cjs/step.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isProtocolStep = exports.isCustomStep = exports.
|
|
3
|
+
exports.isProtocolStep = exports.isCustomStep = exports.isCrossStep = exports.isSwapStep = exports.emptyExecution = void 0;
|
|
4
4
|
exports.emptyExecution = {
|
|
5
5
|
status: 'NOT_STARTED',
|
|
6
6
|
process: [],
|
|
@@ -13,10 +13,6 @@ function isCrossStep(step) {
|
|
|
13
13
|
return step.type === 'cross';
|
|
14
14
|
}
|
|
15
15
|
exports.isCrossStep = isCrossStep;
|
|
16
|
-
function isLifiStep(step) {
|
|
17
|
-
return (step.type === 'lifi' && step.includedSteps && step.includedSteps.length > 0);
|
|
18
|
-
}
|
|
19
|
-
exports.isLifiStep = isLifiStep;
|
|
20
16
|
function isCustomStep(step) {
|
|
21
17
|
return step.type === 'custom';
|
|
22
18
|
}
|
package/dist/coins.js
CHANGED
package/dist/step.d.ts
CHANGED
|
@@ -10,10 +10,11 @@ export interface FeeCost {
|
|
|
10
10
|
token: Token;
|
|
11
11
|
amount: string;
|
|
12
12
|
amountUSD?: string;
|
|
13
|
+
included: boolean;
|
|
13
14
|
}
|
|
14
15
|
export interface GasCost {
|
|
15
16
|
type: 'SUM' | 'APPROVE' | 'SEND' | 'FEE';
|
|
16
|
-
price
|
|
17
|
+
price: string;
|
|
17
18
|
estimate?: string;
|
|
18
19
|
limit?: string;
|
|
19
20
|
amount: string;
|
|
@@ -31,6 +32,7 @@ export interface Action {
|
|
|
31
32
|
slippage: number;
|
|
32
33
|
}
|
|
33
34
|
export interface Estimate {
|
|
35
|
+
tool: string;
|
|
34
36
|
fromAmount: string;
|
|
35
37
|
fromAmountUSD?: string;
|
|
36
38
|
toAmount: string;
|
|
@@ -40,7 +42,6 @@ export interface Estimate {
|
|
|
40
42
|
feeCosts?: FeeCost[];
|
|
41
43
|
gasCosts?: GasCost[];
|
|
42
44
|
executionDuration: number;
|
|
43
|
-
data?: any;
|
|
44
45
|
}
|
|
45
46
|
export type Status = 'NOT_STARTED' | 'STARTED' | 'ACTION_REQUIRED' | 'CHAIN_SWITCH_REQUIRED' | 'PENDING' | 'FAILED' | 'DONE' | 'RESUME' | 'CANCELLED';
|
|
46
47
|
export type ProcessType = 'TOKEN_ALLOWANCE' | 'SWITCH_CHAIN' | 'SWAP' | 'CROSS_CHAIN' | 'RECEIVING_CHAIN' | 'TRANSACTION';
|
|
@@ -105,24 +106,23 @@ export interface ProtocolStep extends StepBase {
|
|
|
105
106
|
estimate: Estimate;
|
|
106
107
|
}
|
|
107
108
|
export declare function isCrossStep(step: Step): step is CrossStep;
|
|
108
|
-
export interface
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
export interface DestinationCallInfo {
|
|
110
|
+
toContractAddress: string;
|
|
111
|
+
toContractCallData: string;
|
|
112
|
+
toFallbackAddress: string;
|
|
113
|
+
callDataGasLimit: string;
|
|
113
114
|
}
|
|
114
|
-
export
|
|
115
|
+
export type CallAction = Action & DestinationCallInfo;
|
|
115
116
|
export interface CustomStep extends StepBase {
|
|
116
117
|
type: 'custom';
|
|
117
|
-
action:
|
|
118
|
+
action: CallAction;
|
|
118
119
|
estimate: Estimate;
|
|
119
|
-
destinationCallInfo: {
|
|
120
|
-
toContractAddress: string;
|
|
121
|
-
toContractCallData: string;
|
|
122
|
-
toFallbackAddress: string;
|
|
123
|
-
callDataGasLimit: string;
|
|
124
|
-
};
|
|
125
120
|
}
|
|
126
121
|
export declare function isCustomStep(step: Step): step is CustomStep;
|
|
127
122
|
export declare function isProtocolStep(step: Step): step is ProtocolStep;
|
|
128
|
-
export type Step = SwapStep | CrossStep |
|
|
123
|
+
export type Step = SwapStep | CrossStep | CustomStep | ProtocolStep;
|
|
124
|
+
export type LifiStep = Omit<Step, 'type'> & {
|
|
125
|
+
includedSteps: Step[];
|
|
126
|
+
} & {
|
|
127
|
+
type: 'lifi';
|
|
128
|
+
};
|
package/dist/step.js
CHANGED
|
@@ -8,9 +8,6 @@ export function isSwapStep(step) {
|
|
|
8
8
|
export function isCrossStep(step) {
|
|
9
9
|
return step.type === 'cross';
|
|
10
10
|
}
|
|
11
|
-
export function isLifiStep(step) {
|
|
12
|
-
return (step.type === 'lifi' && step.includedSteps && step.includedSteps.length > 0);
|
|
13
|
-
}
|
|
14
11
|
export function isCustomStep(step) {
|
|
15
12
|
return step.type === 'custom';
|
|
16
13
|
}
|