@lifi/sdk 2.1.0 → 2.1.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/dist/allowance/utils.js +1 -1
- package/dist/cjs/allowance/utils.js +1 -1
- package/dist/cjs/execution/StepExecutionManager.js +2 -1
- package/dist/cjs/utils/preRestart.js +4 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/execution/StepExecutionManager.js +2 -1
- package/dist/utils/preRestart.js +4 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +8 -8
package/dist/allowance/utils.js
CHANGED
|
@@ -26,7 +26,7 @@ export const setApproval = async (signer, tokenAddress, contractAddress, amount)
|
|
|
26
26
|
try {
|
|
27
27
|
const estimatedGasLimit = await signer.estimateGas(transactionRequest);
|
|
28
28
|
if (estimatedGasLimit) {
|
|
29
|
-
const formattedGasLimit = ethers.
|
|
29
|
+
const formattedGasLimit = ethers.BigNumber.from(`${(BigInt(estimatedGasLimit.toString()) * 125n) / 100n}`);
|
|
30
30
|
transactionRequest.gasLimit = formattedGasLimit;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -33,7 +33,7 @@ const setApproval = async (signer, tokenAddress, contractAddress, amount) => {
|
|
|
33
33
|
try {
|
|
34
34
|
const estimatedGasLimit = await signer.estimateGas(transactionRequest);
|
|
35
35
|
if (estimatedGasLimit) {
|
|
36
|
-
const formattedGasLimit = ethers_1.ethers.
|
|
36
|
+
const formattedGasLimit = ethers_1.ethers.BigNumber.from(`${(BigInt(estimatedGasLimit.toString()) * 125n) / 100n}`);
|
|
37
37
|
transactionRequest.gasLimit = formattedGasLimit;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.StepExecutionManager = void 0;
|
|
7
|
+
const ethers_1 = require("ethers");
|
|
7
8
|
const allowance_1 = require("../allowance");
|
|
8
9
|
const balance_1 = require("../balance");
|
|
9
10
|
const ApiService_1 = __importDefault(require("../services/ApiService"));
|
|
@@ -93,7 +94,7 @@ class StepExecutionManager {
|
|
|
93
94
|
try {
|
|
94
95
|
const estimatedGasLimit = await signer.estimateGas(transactionRequest);
|
|
95
96
|
if (estimatedGasLimit) {
|
|
96
|
-
transactionRequest.gasLimit = `${(BigInt(estimatedGasLimit.toString()) * 125n) / 100n}
|
|
97
|
+
transactionRequest.gasLimit = ethers_1.BigNumber.from(`${(BigInt(estimatedGasLimit.toString()) * 125n) / 100n}`);
|
|
97
98
|
}
|
|
98
99
|
// Fetch latest gasPrice from provider and use it
|
|
99
100
|
const gasPrice = await signer.getGasPrice();
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.handlePreRestart = void 0;
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
5
|
+
const ethers_1 = require("ethers");
|
|
4
6
|
const errors_1 = require("./errors");
|
|
5
7
|
const handlePreRestart = async (route, signer) => {
|
|
6
8
|
for (let index = 0; index < route.steps.length; index++) {
|
|
@@ -25,7 +27,7 @@ const handleErrorType = async (route, index, signer) => {
|
|
|
25
27
|
}
|
|
26
28
|
catch (error) { }
|
|
27
29
|
if (gasLimit) {
|
|
28
|
-
transactionRequest.gasLimit = `${(BigInt(gasLimit.toString()) * 125n) / 100n}
|
|
30
|
+
transactionRequest.gasLimit = ethers_1.BigNumber.from(`${(BigInt(gasLimit.toString()) * 125n) / 100n}`);
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
33
|
route.steps[index].estimate.gasCosts?.forEach((gasCost) => (gasCost.limit = `${Math.round(Number(gasCost.limit) * 1.25)}`));
|
|
@@ -38,7 +40,7 @@ const handleErrorType = async (route, index, signer) => {
|
|
|
38
40
|
}
|
|
39
41
|
catch (error) { }
|
|
40
42
|
if (gasPrice) {
|
|
41
|
-
transactionRequest.gasPrice = `${(BigInt(gasPrice.toString()) * 125n) / 100n}
|
|
43
|
+
transactionRequest.gasPrice = ethers_1.BigNumber.from(`${(BigInt(gasPrice.toString()) * 125n) / 100n}`);
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
46
|
route.steps[index].estimate.gasCosts?.forEach((gasCost) => (gasCost.price = `${Math.round(Number(gasCost.price) * 1.25)}`));
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@lifi/sdk";
|
|
2
|
-
export declare const version = "2.1.
|
|
2
|
+
export declare const version = "2.1.1";
|
package/dist/cjs/version.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BigNumber } from 'ethers';
|
|
1
2
|
import { checkAllowance } from '../allowance';
|
|
2
3
|
import { checkBalance } from '../balance';
|
|
3
4
|
import ApiService from '../services/ApiService';
|
|
@@ -87,7 +88,7 @@ export class StepExecutionManager {
|
|
|
87
88
|
try {
|
|
88
89
|
const estimatedGasLimit = await signer.estimateGas(transactionRequest);
|
|
89
90
|
if (estimatedGasLimit) {
|
|
90
|
-
transactionRequest.gasLimit = `${(BigInt(estimatedGasLimit.toString()) * 125n) / 100n}
|
|
91
|
+
transactionRequest.gasLimit = BigNumber.from(`${(BigInt(estimatedGasLimit.toString()) * 125n) / 100n}`);
|
|
91
92
|
}
|
|
92
93
|
// Fetch latest gasPrice from provider and use it
|
|
93
94
|
const gasPrice = await signer.getGasPrice();
|
package/dist/utils/preRestart.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
2
|
+
import { BigNumber } from 'ethers';
|
|
1
3
|
import { LifiErrorCode } from './errors';
|
|
2
4
|
export const handlePreRestart = async (route, signer) => {
|
|
3
5
|
for (let index = 0; index < route.steps.length; index++) {
|
|
@@ -21,7 +23,7 @@ const handleErrorType = async (route, index, signer) => {
|
|
|
21
23
|
}
|
|
22
24
|
catch (error) { }
|
|
23
25
|
if (gasLimit) {
|
|
24
|
-
transactionRequest.gasLimit = `${(BigInt(gasLimit.toString()) * 125n) / 100n}
|
|
26
|
+
transactionRequest.gasLimit = BigNumber.from(`${(BigInt(gasLimit.toString()) * 125n) / 100n}`);
|
|
25
27
|
}
|
|
26
28
|
}
|
|
27
29
|
route.steps[index].estimate.gasCosts?.forEach((gasCost) => (gasCost.limit = `${Math.round(Number(gasCost.limit) * 1.25)}`));
|
|
@@ -34,7 +36,7 @@ const handleErrorType = async (route, index, signer) => {
|
|
|
34
36
|
}
|
|
35
37
|
catch (error) { }
|
|
36
38
|
if (gasPrice) {
|
|
37
|
-
transactionRequest.gasPrice = `${(BigInt(gasPrice.toString()) * 125n) / 100n}
|
|
39
|
+
transactionRequest.gasPrice = BigNumber.from(`${(BigInt(gasPrice.toString()) * 125n) / 100n}`);
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
42
|
route.steps[index].estimate.gasCosts?.forEach((gasCost) => (gasCost.price = `${Math.round(Number(gasCost.price) * 1.25)}`));
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@lifi/sdk";
|
|
2
|
-
export declare const version = "2.1.
|
|
2
|
+
export declare const version = "2.1.1";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/sdk';
|
|
2
|
-
export const version = '2.1.
|
|
2
|
+
export const version = '2.1.1';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/sdk",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "LI.FI Any-to-Any Cross-Chain-Swap SDK",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@ethersproject/abi": "^5.7.0",
|
|
78
78
|
"@ethersproject/contracts": "^5.7.0",
|
|
79
|
-
"@lifi/types": "^8.0.
|
|
79
|
+
"@lifi/types": "^8.0.2",
|
|
80
80
|
"bignumber.js": "^9.1.1",
|
|
81
81
|
"eth-rpc-errors": "^4.0.3",
|
|
82
82
|
"ethers": "^5.7.2"
|
|
@@ -87,20 +87,20 @@
|
|
|
87
87
|
"@mswjs/interceptors": "^0.22.15",
|
|
88
88
|
"@typescript-eslint/eslint-plugin": "^5.60.1",
|
|
89
89
|
"@typescript-eslint/parser": "^5.60.1",
|
|
90
|
-
"@vitest/coverage-c8": "^0.32.
|
|
91
|
-
"cross-fetch": "^3.1.
|
|
92
|
-
"eslint": "^8.
|
|
90
|
+
"@vitest/coverage-c8": "^0.32.3",
|
|
91
|
+
"cross-fetch": "^3.1.8",
|
|
92
|
+
"eslint": "^8.44.0",
|
|
93
93
|
"eslint-config-prettier": "^8.8.0",
|
|
94
94
|
"eslint-plugin-prettier": "^4.2.1",
|
|
95
95
|
"husky": "^8.0.3",
|
|
96
|
-
"lint-staged": "^13.2.
|
|
96
|
+
"lint-staged": "^13.2.3",
|
|
97
97
|
"msw": "1.0.1",
|
|
98
98
|
"npm-run-all": "^4.1.5",
|
|
99
99
|
"pinst": "^3.0.0",
|
|
100
100
|
"prettier": "^2.8.8",
|
|
101
101
|
"standard-version": "^9.5.0",
|
|
102
|
-
"typescript": "^5.1.
|
|
103
|
-
"vitest": "^0.32.
|
|
102
|
+
"typescript": "^5.1.6",
|
|
103
|
+
"vitest": "^0.32.3"
|
|
104
104
|
},
|
|
105
105
|
"directories": {
|
|
106
106
|
"test": "test"
|