@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 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
@@ -575,6 +575,10 @@ const basicCoins = [
575
575
  address: '0x07de306ff27a2b630b1141956844eb1552b956b5',
576
576
  decimals: 6,
577
577
  },
578
+ [base_1.ChainId.GOR]: {
579
+ address: '0x509ee0d083ddf8ac028f2a56731412edd63223b9',
580
+ decimals: 6,
581
+ },
578
582
  },
579
583
  },
580
584
  // USDC
@@ -14,11 +14,11 @@ export interface FeeCost {
14
14
  }
15
15
  export interface GasCost {
16
16
  type: 'SUM' | 'APPROVE' | 'SEND' | 'FEE';
17
- price?: string;
18
- estimate?: string;
19
- limit?: string;
17
+ price: string;
18
+ estimate: string;
19
+ limit: string;
20
20
  amount: string;
21
- amountUSD?: string;
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 LifiStep extends StepBase {
110
- type: 'lifi';
111
- action: Action;
112
- estimate: Estimate;
113
- includedSteps: Step[];
109
+ export interface DestinationCallInfo {
110
+ toContractAddress: string;
111
+ toContractCallData: string;
112
+ toFallbackAddress: string;
113
+ callDataGasLimit: string;
114
114
  }
115
- export declare function isLifiStep(step: Step): step is LifiStep;
115
+ export type CallAction = Action & DestinationCallInfo;
116
116
  export interface CustomStep extends StepBase {
117
117
  type: 'custom';
118
- action: 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 | LifiStep | CustomStep | ProtocolStep;
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.isLifiStep = exports.isCrossStep = exports.isSwapStep = exports.emptyExecution = void 0;
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
@@ -572,6 +572,10 @@ const basicCoins = [
572
572
  address: '0x07de306ff27a2b630b1141956844eb1552b956b5',
573
573
  decimals: 6,
574
574
  },
575
+ [ChainId.GOR]: {
576
+ address: '0x509ee0d083ddf8ac028f2a56731412edd63223b9',
577
+ decimals: 6,
578
+ },
575
579
  },
576
580
  },
577
581
  // USDC
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?: string;
18
- estimate?: string;
19
- limit?: string;
17
+ price: string;
18
+ estimate: string;
19
+ limit: string;
20
20
  amount: string;
21
- amountUSD?: string;
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 LifiStep extends StepBase {
110
- type: 'lifi';
111
- action: Action;
112
- estimate: Estimate;
113
- includedSteps: Step[];
109
+ export interface DestinationCallInfo {
110
+ toContractAddress: string;
111
+ toContractCallData: string;
112
+ toFallbackAddress: string;
113
+ callDataGasLimit: string;
114
114
  }
115
- export declare function isLifiStep(step: Step): step is LifiStep;
115
+ export type CallAction = Action & DestinationCallInfo;
116
116
  export interface CustomStep extends StepBase {
117
117
  type: 'custom';
118
- action: 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 | LifiStep | CustomStep | ProtocolStep;
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifi/types",
3
- "version": "2.5.7",
3
+ "version": "2.6.1",
4
4
  "description": "Types for the LI.FI stack",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/index.js",