@lifi/types 1.24.0 → 2.0.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,33 @@
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.1](https://github.com/lifinance/types/compare/v2.0.0...v2.0.1) (2023-02-15)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * rename flag for max price impact ([#131](https://github.com/lifinance/types/issues/131)) ([f633d3a](https://github.com/lifinance/types/commit/f633d3a44ca30b631bca076715022df4ee59bedd))
11
+
12
+ ## [2.0.0](https://github.com/lifinance/types/compare/v1.19.0...v2.0.0) (2023-02-13)
13
+
14
+
15
+ ### Features
16
+
17
+ * add lif3swap dex on POL and BSC ([#120](https://github.com/lifinance/types/issues/120)) ([b213e28](https://github.com/lifinance/types/commit/b213e281ce777465180b11a0585ad71f98404df7))
18
+ * add opt allowDestCall flag to /routes,/quote ([#122](https://github.com/lifinance/types/issues/122)) ([a899bf2](https://github.com/lifinance/types/commit/a899bf2fee112de6fff002ee0c737f3325f71efa))
19
+ * add types for quests ([#116](https://github.com/lifinance/types/issues/116)) ([ce923d3](https://github.com/lifinance/types/commit/ce923d311ce3921c736ae75e3316fb66415b98b4))
20
+ * add wantInsurance flag to RoutesContext ([#126](https://github.com/lifinance/types/issues/126)) ([cfa6f76](https://github.com/lifinance/types/commit/cfa6f769756be18a821af1e4577c6f28c83db2d3))
21
+ * added flag for variable price impact ([#127](https://github.com/lifinance/types/issues/127)) ([7adf21b](https://github.com/lifinance/types/commit/7adf21baa809c388421b10dad51d18731829372e))
22
+ * 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))
23
+ * insurance option in quoteRequest ([#128](https://github.com/lifinance/types/issues/128)) ([4a9a064](https://github.com/lifinance/types/commit/4a9a064c2c3d92f55d97b700669e2be491e7ab41))
24
+ * make properties of Interface GetStatusRequest optional ([f2be836](https://github.com/lifinance/types/commit/f2be8362c4cad7227dba9ff4d4d9d885b9de4bc5))
25
+ * trusted gas parameter for routes and quote request ([#129](https://github.com/lifinance/types/issues/129)) ([927adaa](https://github.com/lifinance/types/commit/927adaa83129a6422718d65a26f39ae0d4d90dfc))
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * rename XDAI token to DAI on most chains ([#125](https://github.com/lifinance/types/issues/125)) ([32a17b9](https://github.com/lifinance/types/commit/32a17b93cc9abd2b764bb03e9c7c1a06522bbf36))
31
+
5
32
  ## [1.24.0](https://github.com/lifinance/types/compare/v1.23.0...v1.24.0) (2023-02-09)
6
33
 
7
34
 
package/dist/api.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { TransactionRequest } from '@ethersproject/providers';
2
- import { BridgeDefinition, Chain, ChainId, ExchangeDefinition, Step, Token } from '.';
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
+ maxPriceImpact?: 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: Step[];
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
+ maxPriceImpact?: 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
+ maxPriceImpact?: 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, Step, Token } from '.';
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
+ maxPriceImpact?: 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: Step[];
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
+ maxPriceImpact?: 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
+ maxPriceImpact?: number;
133
138
  }
134
139
  export interface ContractCallQuotesRequest extends ToolConfiguration {
135
140
  fromChain: number | string;
@@ -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 type Step = SwapStep | CrossStep | LifiStep | CustomStep;
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 type Step = SwapStep | CrossStep | LifiStep | CustomStep;
127
+ export declare function isProtocolStep(step: Step): step is ProtocolStep;
128
+ export type Step = SwapStep | CrossStep | LifiStep | CustomStep | ProtocolStep;
package/dist/step.js CHANGED
@@ -14,3 +14,6 @@ export function isLifiStep(step) {
14
14
  export function isCustomStep(step) {
15
15
  return step.type === 'custom';
16
16
  }
17
+ export function isProtocolStep(step) {
18
+ return step.type === 'protocol';
19
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifi/types",
3
- "version": "1.24.0",
3
+ "version": "2.0.1",
4
4
  "description": "Types for the LI.FI stack",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/index.js",