@lifi/types 9.0.0-alpha.10 → 9.0.0-alpha.12
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/README.md +0 -6
- package/dist/api.d.ts +23 -18
- package/dist/chains/base.d.ts +2 -0
- package/dist/chains/base.js +2 -0
- package/dist/cjs/api.d.ts +23 -18
- package/dist/cjs/chains/base.d.ts +2 -0
- package/dist/cjs/chains/base.js +2 -0
- package/dist/cjs/step.d.ts +2 -2
- package/dist/step.d.ts +2 -2
- package/package.json +39 -39
package/README.md
CHANGED
|
@@ -20,8 +20,6 @@ Check out the [Changelog](./CHANGELOG.md) to see what changed in the last releas
|
|
|
20
20
|
|
|
21
21
|
## Installation
|
|
22
22
|
|
|
23
|
-
Install dependencies with yarn:
|
|
24
|
-
|
|
25
23
|
```bash
|
|
26
24
|
yarn add @lifi/types
|
|
27
25
|
```
|
|
@@ -31,7 +29,3 @@ or
|
|
|
31
29
|
```bash
|
|
32
30
|
npm install --save @lifi/types
|
|
33
31
|
```
|
|
34
|
-
|
|
35
|
-
## Summary
|
|
36
|
-
|
|
37
|
-
This package contains type definitions for LI.FI projects (https://github.com/lifinance).
|
package/dist/api.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { BridgeDefinition } from './bridges';
|
|
|
2
2
|
import { Chain } from './chains';
|
|
3
3
|
import { ChainId } from './chains/base';
|
|
4
4
|
import { ExchangeDefinition } from './exchanges';
|
|
5
|
-
import { Action,
|
|
5
|
+
import { Action, LiFiStep } from './step';
|
|
6
6
|
import { Token } from './tokens';
|
|
7
7
|
/**
|
|
8
8
|
* Used as a bigint replacement for TransactionRequest because bigint is not serializable
|
|
@@ -99,7 +99,7 @@ export interface Route {
|
|
|
99
99
|
gasCostUSD?: string;
|
|
100
100
|
containsSwitchChain?: boolean;
|
|
101
101
|
infiniteApproval?: boolean;
|
|
102
|
-
steps:
|
|
102
|
+
steps: LiFiStep[];
|
|
103
103
|
tags?: Order[];
|
|
104
104
|
}
|
|
105
105
|
export type ToolErrorType = 'NO_QUOTE';
|
|
@@ -180,44 +180,49 @@ export interface QuoteRequest extends ToolConfiguration {
|
|
|
180
180
|
fromAmountForGas?: string;
|
|
181
181
|
maxPriceImpact?: number;
|
|
182
182
|
}
|
|
183
|
-
export interface
|
|
183
|
+
export interface ContractCall {
|
|
184
|
+
fromAmount: string;
|
|
185
|
+
fromTokenAddress: string;
|
|
186
|
+
toContractAddress: string;
|
|
187
|
+
toContractCallData: string;
|
|
188
|
+
toContractGasLimit: string;
|
|
189
|
+
toApprovalAddress?: string;
|
|
190
|
+
toTokenAddress?: string;
|
|
191
|
+
}
|
|
192
|
+
export interface ContractCallsQuoteRequest extends ToolConfiguration {
|
|
184
193
|
fromChain: number | string;
|
|
185
194
|
fromToken: string;
|
|
186
195
|
fromAddress: string;
|
|
187
196
|
toChain: number | string;
|
|
188
197
|
toToken: string;
|
|
189
198
|
toAmount: string;
|
|
190
|
-
toContractAddress: string;
|
|
191
|
-
toContractCallData: string;
|
|
192
|
-
toContractGasLimit: string;
|
|
193
|
-
toApprovalAddress?: string;
|
|
194
199
|
toFallbackAddress?: string;
|
|
195
200
|
contractOutputsToken?: string;
|
|
201
|
+
contractCalls: ContractCall[];
|
|
196
202
|
slippage?: number | string;
|
|
197
203
|
integrator?: string;
|
|
198
204
|
referrer?: string;
|
|
199
205
|
fee?: number | string;
|
|
200
206
|
allowDestinationCall?: boolean;
|
|
201
207
|
}
|
|
202
|
-
export interface
|
|
208
|
+
export interface ContractCallQuoteRequest extends ToolConfiguration {
|
|
203
209
|
fromChain: number | string;
|
|
204
210
|
fromToken: string;
|
|
205
211
|
fromAddress: string;
|
|
206
212
|
toChain: number | string;
|
|
213
|
+
toToken: string;
|
|
214
|
+
toAmount: string;
|
|
215
|
+
toContractAddress: string;
|
|
216
|
+
toContractCallData: string;
|
|
217
|
+
toContractGasLimit: string;
|
|
218
|
+
toApprovalAddress?: string;
|
|
207
219
|
toFallbackAddress?: string;
|
|
208
|
-
|
|
209
|
-
sendingAmount: string;
|
|
210
|
-
sendingToken: string;
|
|
211
|
-
receivingToken: string;
|
|
212
|
-
contractAddress: string;
|
|
213
|
-
approvalAddress?: string;
|
|
214
|
-
callData: string;
|
|
215
|
-
gasLimit: string;
|
|
216
|
-
}[];
|
|
217
|
-
order?: Order;
|
|
220
|
+
contractOutputsToken?: string;
|
|
218
221
|
slippage?: number | string;
|
|
219
222
|
integrator?: string;
|
|
220
223
|
referrer?: string;
|
|
224
|
+
fee?: number | string;
|
|
225
|
+
allowDestinationCall?: boolean;
|
|
221
226
|
}
|
|
222
227
|
export interface ConnectionsRequest extends ToolConfiguration {
|
|
223
228
|
fromChain?: number | string;
|
package/dist/chains/base.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export declare enum ChainKey {
|
|
|
38
38
|
ERA = "era",
|
|
39
39
|
PZE = "pze",
|
|
40
40
|
LNA = "lna",
|
|
41
|
+
BAS = "bas",
|
|
41
42
|
GOR = "gor",
|
|
42
43
|
METT = "mett",
|
|
43
44
|
DIOT = "diot",
|
|
@@ -99,6 +100,7 @@ export declare enum ChainId {
|
|
|
99
100
|
ERA = 324,
|
|
100
101
|
PZE = 1101,
|
|
101
102
|
LNA = 59144,
|
|
103
|
+
BAS = 8453,
|
|
102
104
|
GOR = 5,
|
|
103
105
|
METT = 12,
|
|
104
106
|
DIOT = 13,
|
package/dist/chains/base.js
CHANGED
|
@@ -39,6 +39,7 @@ export var ChainKey;
|
|
|
39
39
|
ChainKey["ERA"] = "era";
|
|
40
40
|
ChainKey["PZE"] = "pze";
|
|
41
41
|
ChainKey["LNA"] = "lna";
|
|
42
|
+
ChainKey["BAS"] = "bas";
|
|
42
43
|
// Testnets
|
|
43
44
|
ChainKey["GOR"] = "gor";
|
|
44
45
|
ChainKey["METT"] = "mett";
|
|
@@ -102,6 +103,7 @@ export var ChainId;
|
|
|
102
103
|
ChainId[ChainId["ERA"] = 324] = "ERA";
|
|
103
104
|
ChainId[ChainId["PZE"] = 1101] = "PZE";
|
|
104
105
|
ChainId[ChainId["LNA"] = 59144] = "LNA";
|
|
106
|
+
ChainId[ChainId["BAS"] = 8453] = "BAS";
|
|
105
107
|
// Testnets
|
|
106
108
|
ChainId[ChainId["GOR"] = 5] = "GOR";
|
|
107
109
|
ChainId[ChainId["METT"] = 12] = "METT";
|
package/dist/cjs/api.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { BridgeDefinition } from './bridges';
|
|
|
2
2
|
import { Chain } from './chains';
|
|
3
3
|
import { ChainId } from './chains/base';
|
|
4
4
|
import { ExchangeDefinition } from './exchanges';
|
|
5
|
-
import { Action,
|
|
5
|
+
import { Action, LiFiStep } from './step';
|
|
6
6
|
import { Token } from './tokens';
|
|
7
7
|
/**
|
|
8
8
|
* Used as a bigint replacement for TransactionRequest because bigint is not serializable
|
|
@@ -99,7 +99,7 @@ export interface Route {
|
|
|
99
99
|
gasCostUSD?: string;
|
|
100
100
|
containsSwitchChain?: boolean;
|
|
101
101
|
infiniteApproval?: boolean;
|
|
102
|
-
steps:
|
|
102
|
+
steps: LiFiStep[];
|
|
103
103
|
tags?: Order[];
|
|
104
104
|
}
|
|
105
105
|
export type ToolErrorType = 'NO_QUOTE';
|
|
@@ -180,44 +180,49 @@ export interface QuoteRequest extends ToolConfiguration {
|
|
|
180
180
|
fromAmountForGas?: string;
|
|
181
181
|
maxPriceImpact?: number;
|
|
182
182
|
}
|
|
183
|
-
export interface
|
|
183
|
+
export interface ContractCall {
|
|
184
|
+
fromAmount: string;
|
|
185
|
+
fromTokenAddress: string;
|
|
186
|
+
toContractAddress: string;
|
|
187
|
+
toContractCallData: string;
|
|
188
|
+
toContractGasLimit: string;
|
|
189
|
+
toApprovalAddress?: string;
|
|
190
|
+
toTokenAddress?: string;
|
|
191
|
+
}
|
|
192
|
+
export interface ContractCallsQuoteRequest extends ToolConfiguration {
|
|
184
193
|
fromChain: number | string;
|
|
185
194
|
fromToken: string;
|
|
186
195
|
fromAddress: string;
|
|
187
196
|
toChain: number | string;
|
|
188
197
|
toToken: string;
|
|
189
198
|
toAmount: string;
|
|
190
|
-
toContractAddress: string;
|
|
191
|
-
toContractCallData: string;
|
|
192
|
-
toContractGasLimit: string;
|
|
193
|
-
toApprovalAddress?: string;
|
|
194
199
|
toFallbackAddress?: string;
|
|
195
200
|
contractOutputsToken?: string;
|
|
201
|
+
contractCalls: ContractCall[];
|
|
196
202
|
slippage?: number | string;
|
|
197
203
|
integrator?: string;
|
|
198
204
|
referrer?: string;
|
|
199
205
|
fee?: number | string;
|
|
200
206
|
allowDestinationCall?: boolean;
|
|
201
207
|
}
|
|
202
|
-
export interface
|
|
208
|
+
export interface ContractCallQuoteRequest extends ToolConfiguration {
|
|
203
209
|
fromChain: number | string;
|
|
204
210
|
fromToken: string;
|
|
205
211
|
fromAddress: string;
|
|
206
212
|
toChain: number | string;
|
|
213
|
+
toToken: string;
|
|
214
|
+
toAmount: string;
|
|
215
|
+
toContractAddress: string;
|
|
216
|
+
toContractCallData: string;
|
|
217
|
+
toContractGasLimit: string;
|
|
218
|
+
toApprovalAddress?: string;
|
|
207
219
|
toFallbackAddress?: string;
|
|
208
|
-
|
|
209
|
-
sendingAmount: string;
|
|
210
|
-
sendingToken: string;
|
|
211
|
-
receivingToken: string;
|
|
212
|
-
contractAddress: string;
|
|
213
|
-
approvalAddress?: string;
|
|
214
|
-
callData: string;
|
|
215
|
-
gasLimit: string;
|
|
216
|
-
}[];
|
|
217
|
-
order?: Order;
|
|
220
|
+
contractOutputsToken?: string;
|
|
218
221
|
slippage?: number | string;
|
|
219
222
|
integrator?: string;
|
|
220
223
|
referrer?: string;
|
|
224
|
+
fee?: number | string;
|
|
225
|
+
allowDestinationCall?: boolean;
|
|
221
226
|
}
|
|
222
227
|
export interface ConnectionsRequest extends ToolConfiguration {
|
|
223
228
|
fromChain?: number | string;
|
|
@@ -38,6 +38,7 @@ export declare enum ChainKey {
|
|
|
38
38
|
ERA = "era",
|
|
39
39
|
PZE = "pze",
|
|
40
40
|
LNA = "lna",
|
|
41
|
+
BAS = "bas",
|
|
41
42
|
GOR = "gor",
|
|
42
43
|
METT = "mett",
|
|
43
44
|
DIOT = "diot",
|
|
@@ -99,6 +100,7 @@ export declare enum ChainId {
|
|
|
99
100
|
ERA = 324,
|
|
100
101
|
PZE = 1101,
|
|
101
102
|
LNA = 59144,
|
|
103
|
+
BAS = 8453,
|
|
102
104
|
GOR = 5,
|
|
103
105
|
METT = 12,
|
|
104
106
|
DIOT = 13,
|
package/dist/cjs/chains/base.js
CHANGED
|
@@ -42,6 +42,7 @@ var ChainKey;
|
|
|
42
42
|
ChainKey["ERA"] = "era";
|
|
43
43
|
ChainKey["PZE"] = "pze";
|
|
44
44
|
ChainKey["LNA"] = "lna";
|
|
45
|
+
ChainKey["BAS"] = "bas";
|
|
45
46
|
// Testnets
|
|
46
47
|
ChainKey["GOR"] = "gor";
|
|
47
48
|
ChainKey["METT"] = "mett";
|
|
@@ -105,6 +106,7 @@ var ChainId;
|
|
|
105
106
|
ChainId[ChainId["ERA"] = 324] = "ERA";
|
|
106
107
|
ChainId[ChainId["PZE"] = 1101] = "PZE";
|
|
107
108
|
ChainId[ChainId["LNA"] = 59144] = "LNA";
|
|
109
|
+
ChainId[ChainId["BAS"] = 8453] = "BAS";
|
|
108
110
|
// Testnets
|
|
109
111
|
ChainId[ChainId["GOR"] = 5] = "GOR";
|
|
110
112
|
ChainId[ChainId["METT"] = 12] = "METT";
|
package/dist/cjs/step.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export interface FeeCost {
|
|
|
6
6
|
percentage: string;
|
|
7
7
|
token: Token;
|
|
8
8
|
amount: string;
|
|
9
|
-
amountUSD
|
|
9
|
+
amountUSD: string;
|
|
10
10
|
included: boolean;
|
|
11
11
|
}
|
|
12
12
|
export interface GasCost {
|
|
@@ -121,7 +121,7 @@ export interface CustomStep extends StepBase {
|
|
|
121
121
|
estimate: Estimate;
|
|
122
122
|
}
|
|
123
123
|
export type Step = SwapStep | CrossStep | CustomStep | ProtocolStep;
|
|
124
|
-
export interface
|
|
124
|
+
export interface LiFiStep extends Omit<Step, 'type'> {
|
|
125
125
|
type: 'lifi';
|
|
126
126
|
includedSteps: Step[];
|
|
127
127
|
}
|
package/dist/step.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export interface FeeCost {
|
|
|
6
6
|
percentage: string;
|
|
7
7
|
token: Token;
|
|
8
8
|
amount: string;
|
|
9
|
-
amountUSD
|
|
9
|
+
amountUSD: string;
|
|
10
10
|
included: boolean;
|
|
11
11
|
}
|
|
12
12
|
export interface GasCost {
|
|
@@ -121,7 +121,7 @@ export interface CustomStep extends StepBase {
|
|
|
121
121
|
estimate: Estimate;
|
|
122
122
|
}
|
|
123
123
|
export type Step = SwapStep | CrossStep | CustomStep | ProtocolStep;
|
|
124
|
-
export interface
|
|
124
|
+
export interface LiFiStep extends Omit<Step, 'type'> {
|
|
125
125
|
type: 'lifi';
|
|
126
126
|
includedSteps: Step[];
|
|
127
127
|
}
|
package/package.json
CHANGED
|
@@ -1,42 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/types",
|
|
3
|
-
"version": "9.0.0-alpha.
|
|
3
|
+
"version": "9.0.0-alpha.12",
|
|
4
4
|
"description": "Types for the LI.FI stack",
|
|
5
|
-
"main": "./dist/cjs/index.js",
|
|
6
|
-
"module": "./dist/index.js",
|
|
7
|
-
"types": "./dist/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
"require": "./dist/cjs/index.js",
|
|
10
|
-
"import": "./dist/index.js"
|
|
11
|
-
},
|
|
12
|
-
"scripts": {
|
|
13
|
-
"build": "tsc -p ./tsconfig.json && tsc -p ./tsconfig.cjs.json",
|
|
14
|
-
"lint:fix": "eslint --ext .tsx --ext .ts ./src --fix",
|
|
15
|
-
"package": "npm run build && npm pack",
|
|
16
|
-
"prettier:fix": "prettier --write ./src/.",
|
|
17
|
-
"release": "standard-version -a",
|
|
18
|
-
"release:alpha": "standard-version -a --prerelease alpha --skip.changelog",
|
|
19
|
-
"release:beta": "standard-version -a --prerelease beta --skip.changelog",
|
|
20
|
-
"_postinstall": "husky install",
|
|
21
|
-
"pre-commit": "lint-staged",
|
|
22
|
-
"pre-push": "yarn build",
|
|
23
|
-
"prepack": "pinst --disable",
|
|
24
|
-
"postpack": "pinst --enable"
|
|
25
|
-
},
|
|
26
|
-
"lint-staged": {
|
|
27
|
-
"src/**/*.{ts,tsx}": [
|
|
28
|
-
"yarn run lint:fix",
|
|
29
|
-
"yarn run prettier:fix"
|
|
30
|
-
]
|
|
31
|
-
},
|
|
32
|
-
"files": [
|
|
33
|
-
"dist"
|
|
34
|
-
],
|
|
35
|
-
"publishConfig": {
|
|
36
|
-
"access": "public"
|
|
37
|
-
},
|
|
38
|
-
"author": "LI.FI <github@li.finance>",
|
|
39
|
-
"license": "Apache-2.0",
|
|
40
5
|
"keywords": [
|
|
41
6
|
"sdk",
|
|
42
7
|
"ethereum",
|
|
@@ -56,12 +21,44 @@
|
|
|
56
21
|
"metamask"
|
|
57
22
|
],
|
|
58
23
|
"homepage": "https://github.com/lifinance/types",
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/lifinance/types"
|
|
26
|
+
},
|
|
59
27
|
"repository": {
|
|
60
28
|
"type": "git",
|
|
61
29
|
"url": "git+ssh://git@github.com/lifinance/types.git"
|
|
62
30
|
},
|
|
63
|
-
"
|
|
64
|
-
|
|
31
|
+
"license": "Apache-2.0",
|
|
32
|
+
"author": "LI.FI <github@li.finance>",
|
|
33
|
+
"exports": {
|
|
34
|
+
"require": "./dist/cjs/index.js",
|
|
35
|
+
"import": "./dist/index.js"
|
|
36
|
+
},
|
|
37
|
+
"main": "./dist/cjs/index.js",
|
|
38
|
+
"module": "./dist/index.js",
|
|
39
|
+
"types": "./dist/index.d.ts",
|
|
40
|
+
"files": [
|
|
41
|
+
"dist"
|
|
42
|
+
],
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsc -p ./tsconfig.json && tsc -p ./tsconfig.cjs.json",
|
|
45
|
+
"_postinstall": "husky install",
|
|
46
|
+
"lint:fix": "eslint --ext .tsx --ext .ts ./src --fix",
|
|
47
|
+
"prepack": "pinst --disable",
|
|
48
|
+
"postpack": "pinst --enable",
|
|
49
|
+
"package": "npm run build && npm pack",
|
|
50
|
+
"pre-commit": "lint-staged",
|
|
51
|
+
"pre-push": "yarn build",
|
|
52
|
+
"prettier:fix": "prettier --write ./src/.",
|
|
53
|
+
"release": "standard-version -a",
|
|
54
|
+
"release:alpha": "standard-version -a --prerelease alpha --skip.changelog",
|
|
55
|
+
"release:beta": "standard-version -a --prerelease beta --skip.changelog"
|
|
56
|
+
},
|
|
57
|
+
"lint-staged": {
|
|
58
|
+
"src/**/*.{ts,tsx}": [
|
|
59
|
+
"yarn run lint:fix",
|
|
60
|
+
"yarn run prettier:fix"
|
|
61
|
+
]
|
|
65
62
|
},
|
|
66
63
|
"devDependencies": {
|
|
67
64
|
"@commitlint/cli": "^17.7.1",
|
|
@@ -78,5 +75,8 @@
|
|
|
78
75
|
"standard-version": "^9.5.0",
|
|
79
76
|
"typescript": "^5.2.2"
|
|
80
77
|
},
|
|
81
|
-
"packageManager": "yarn@3.6.3"
|
|
78
|
+
"packageManager": "yarn@3.6.3",
|
|
79
|
+
"publishConfig": {
|
|
80
|
+
"access": "public"
|
|
81
|
+
}
|
|
82
82
|
}
|