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