@lifi/sdk 2.1.3-beta.0 → 2.2.0
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/LiFi.d.ts +1 -0
- package/dist/LiFi.js +1 -0
- package/dist/allowance/utils.js +1 -1
- package/dist/cjs/LiFi.d.ts +1 -0
- package/dist/cjs/LiFi.js +1 -0
- package/dist/cjs/allowance/utils.js +1 -1
- package/dist/cjs/execution/multisig.js +4 -1
- package/dist/cjs/services/ApiService.js +3 -0
- package/dist/cjs/types/internal.types.d.ts +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/execution/multisig.js +4 -1
- package/dist/services/ApiService.js +3 -0
- package/dist/types/internal.types.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +10 -9
package/dist/LiFi.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export declare class LiFi extends RouteExecutionManager {
|
|
|
35
35
|
* @param {PossibilitiesRequest} request - Object defining preferences regarding chain, exchanges and bridges
|
|
36
36
|
* @return {Promise<PossibilitiesResponse>} Object listing current possibilities for any-to-any cross-chain-swaps based on the provided preferences.
|
|
37
37
|
* @throws {LifiError} Throws a LifiError if request fails.
|
|
38
|
+
* @deprecated We don't want to support this endpoint anymore in the future. /chains, /tools, /connections, and /tokens should be used instead
|
|
38
39
|
*/
|
|
39
40
|
getPossibilities: (request?: PossibilitiesRequest, options?: RequestOptions) => Promise<PossibilitiesResponse>;
|
|
40
41
|
/**
|
package/dist/LiFi.js
CHANGED
|
@@ -47,6 +47,7 @@ export class LiFi extends RouteExecutionManager {
|
|
|
47
47
|
* @param {PossibilitiesRequest} request - Object defining preferences regarding chain, exchanges and bridges
|
|
48
48
|
* @return {Promise<PossibilitiesResponse>} Object listing current possibilities for any-to-any cross-chain-swaps based on the provided preferences.
|
|
49
49
|
* @throws {LifiError} Throws a LifiError if request fails.
|
|
50
|
+
* @deprecated We don't want to support this endpoint anymore in the future. /chains, /tools, /connections, and /tokens should be used instead
|
|
50
51
|
*/
|
|
51
52
|
this.getPossibilities = async (request, options) => {
|
|
52
53
|
return ApiService.getPossibilities(request, options);
|
package/dist/allowance/utils.js
CHANGED
|
@@ -34,7 +34,7 @@ export const setApproval = async (signer, tokenAddress, contractAddress, amount,
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
catch (error) { }
|
|
37
|
-
return
|
|
37
|
+
return signer.sendTransaction(transactionRequest);
|
|
38
38
|
};
|
|
39
39
|
export const getAllowanceViaMulticall = async (signer, chainId, tokenData) => {
|
|
40
40
|
const chainsService = ChainsService.getInstance();
|
package/dist/cjs/LiFi.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export declare class LiFi extends RouteExecutionManager {
|
|
|
35
35
|
* @param {PossibilitiesRequest} request - Object defining preferences regarding chain, exchanges and bridges
|
|
36
36
|
* @return {Promise<PossibilitiesResponse>} Object listing current possibilities for any-to-any cross-chain-swaps based on the provided preferences.
|
|
37
37
|
* @throws {LifiError} Throws a LifiError if request fails.
|
|
38
|
+
* @deprecated We don't want to support this endpoint anymore in the future. /chains, /tools, /connections, and /tokens should be used instead
|
|
38
39
|
*/
|
|
39
40
|
getPossibilities: (request?: PossibilitiesRequest, options?: RequestOptions) => Promise<PossibilitiesResponse>;
|
|
40
41
|
/**
|
package/dist/cjs/LiFi.js
CHANGED
|
@@ -76,6 +76,7 @@ class LiFi extends RouteExecutionManager_1.RouteExecutionManager {
|
|
|
76
76
|
* @param {PossibilitiesRequest} request - Object defining preferences regarding chain, exchanges and bridges
|
|
77
77
|
* @return {Promise<PossibilitiesResponse>} Object listing current possibilities for any-to-any cross-chain-swaps based on the provided preferences.
|
|
78
78
|
* @throws {LifiError} Throws a LifiError if request fails.
|
|
79
|
+
* @deprecated We don't want to support this endpoint anymore in the future. /chains, /tools, /connections, and /tokens should be used instead
|
|
79
80
|
*/
|
|
80
81
|
this.getPossibilities = async (request, options) => {
|
|
81
82
|
return ApiService_1.default.getPossibilities(request, options);
|
|
@@ -41,7 +41,7 @@ const setApproval = async (signer, tokenAddress, contractAddress, amount, return
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
catch (error) { }
|
|
44
|
-
return
|
|
44
|
+
return signer.sendTransaction(transactionRequest);
|
|
45
45
|
};
|
|
46
46
|
exports.setApproval = setApproval;
|
|
47
47
|
const getAllowanceViaMulticall = async (signer, chainId, tokenData) => {
|
|
@@ -11,7 +11,10 @@ const updateMultisigRouteProcess = async (internalTxHash, step, statusManager, p
|
|
|
11
11
|
if (!config.multisigConfig?.getMultisigTransactionDetails) {
|
|
12
12
|
throw new Error('"getMultisigTransactionDetails()" is missing in Multisig config.');
|
|
13
13
|
}
|
|
14
|
-
const
|
|
14
|
+
const updateIntermediateMultisigStatus = () => {
|
|
15
|
+
process = statusManager.updateProcess(step, process.type, 'PENDING');
|
|
16
|
+
};
|
|
17
|
+
const multisigStatusResponse = await config.multisigConfig?.getMultisigTransactionDetails(internalTxHash, fromChain.id, updateIntermediateMultisigStatus);
|
|
15
18
|
if (multisigStatusResponse.status === 'DONE') {
|
|
16
19
|
process = statusManager.updateProcess(step, process.type, 'PENDING', {
|
|
17
20
|
txHash: multisigStatusResponse.txHash,
|
|
@@ -8,6 +8,9 @@ const typeguards_1 = require("../typeguards");
|
|
|
8
8
|
const errors_1 = require("../utils/errors");
|
|
9
9
|
const parseError_1 = require("../utils/parseError");
|
|
10
10
|
const ConfigService_1 = __importDefault(require("./ConfigService"));
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated We don't want to support this endpoint anymore in the future. /chains, /tools, /connections, and /tokens should be used instead
|
|
13
|
+
*/
|
|
11
14
|
const getPossibilities = async (requestConfig, options) => {
|
|
12
15
|
if (!requestConfig) {
|
|
13
16
|
requestConfig = {};
|
|
@@ -52,7 +52,7 @@ export interface BaseTransaction {
|
|
|
52
52
|
}
|
|
53
53
|
export interface MultisigConfig {
|
|
54
54
|
isMultisigSigner: boolean;
|
|
55
|
-
getMultisigTransactionDetails: (txHash: string, fromChainId: number) => Promise<MultisigTxDetails>;
|
|
55
|
+
getMultisigTransactionDetails: (txHash: string, fromChainId: number, updateIntermediateStatus?: () => void) => Promise<MultisigTxDetails>;
|
|
56
56
|
sendBatchTransaction?: (batchTransactions: BaseTransaction[]) => Promise<MultisigTransactionResponse>;
|
|
57
57
|
shouldBatchTransactions?: boolean;
|
|
58
58
|
}
|
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.
|
|
2
|
+
export declare const version = "2.2.0";
|
package/dist/cjs/version.js
CHANGED
|
@@ -5,7 +5,10 @@ export const updateMultisigRouteProcess = async (internalTxHash, step, statusMan
|
|
|
5
5
|
if (!config.multisigConfig?.getMultisigTransactionDetails) {
|
|
6
6
|
throw new Error('"getMultisigTransactionDetails()" is missing in Multisig config.');
|
|
7
7
|
}
|
|
8
|
-
const
|
|
8
|
+
const updateIntermediateMultisigStatus = () => {
|
|
9
|
+
process = statusManager.updateProcess(step, process.type, 'PENDING');
|
|
10
|
+
};
|
|
11
|
+
const multisigStatusResponse = await config.multisigConfig?.getMultisigTransactionDetails(internalTxHash, fromChain.id, updateIntermediateMultisigStatus);
|
|
9
12
|
if (multisigStatusResponse.status === 'DONE') {
|
|
10
13
|
process = statusManager.updateProcess(step, process.type, 'PENDING', {
|
|
11
14
|
txHash: multisigStatusResponse.txHash,
|
|
@@ -3,6 +3,9 @@ import { isRoutesRequest, isStep } from '../typeguards';
|
|
|
3
3
|
import { ValidationError } from '../utils/errors';
|
|
4
4
|
import { parseBackendError } from '../utils/parseError';
|
|
5
5
|
import ConfigService from './ConfigService';
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated We don't want to support this endpoint anymore in the future. /chains, /tools, /connections, and /tokens should be used instead
|
|
8
|
+
*/
|
|
6
9
|
const getPossibilities = async (requestConfig, options) => {
|
|
7
10
|
if (!requestConfig) {
|
|
8
11
|
requestConfig = {};
|
|
@@ -52,7 +52,7 @@ export interface BaseTransaction {
|
|
|
52
52
|
}
|
|
53
53
|
export interface MultisigConfig {
|
|
54
54
|
isMultisigSigner: boolean;
|
|
55
|
-
getMultisigTransactionDetails: (txHash: string, fromChainId: number) => Promise<MultisigTxDetails>;
|
|
55
|
+
getMultisigTransactionDetails: (txHash: string, fromChainId: number, updateIntermediateStatus?: () => void) => Promise<MultisigTxDetails>;
|
|
56
56
|
sendBatchTransaction?: (batchTransactions: BaseTransaction[]) => Promise<MultisigTransactionResponse>;
|
|
57
57
|
shouldBatchTransactions?: boolean;
|
|
58
58
|
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@lifi/sdk";
|
|
2
|
-
export declare const version = "2.
|
|
2
|
+
export declare const version = "2.2.0";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/sdk';
|
|
2
|
-
export const version = '2.
|
|
2
|
+
export const version = '2.2.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
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",
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"prepublishOnly": "run-s build use:npmReadme && pinst --enable",
|
|
27
27
|
"postpublish": "npm run use:gitReadme && pinst --enable",
|
|
28
28
|
"prepare": "husky install",
|
|
29
|
-
"release": "standard-version -a"
|
|
29
|
+
"release": "standard-version -a",
|
|
30
|
+
"release:beta": "standard-version -a --prerelease beta --skip.changelog"
|
|
30
31
|
},
|
|
31
32
|
"standard-version": {
|
|
32
33
|
"scripts": {
|
|
@@ -85,25 +86,25 @@
|
|
|
85
86
|
"@commitlint/cli": "^17.6.6",
|
|
86
87
|
"@commitlint/config-conventional": "^17.6.6",
|
|
87
88
|
"@mswjs/interceptors": "^0.22.16",
|
|
88
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
89
|
-
"@typescript-eslint/parser": "^
|
|
90
|
-
"@vitest/coverage-c8": "^0.
|
|
89
|
+
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
90
|
+
"@typescript-eslint/parser": "^6.0.0",
|
|
91
|
+
"@vitest/coverage-c8": "^0.33.0",
|
|
91
92
|
"cross-fetch": "^4.0.0",
|
|
92
93
|
"eslint": "^8.44.0",
|
|
93
94
|
"eslint-config-prettier": "^8.8.0",
|
|
94
|
-
"eslint-plugin-prettier": "^
|
|
95
|
+
"eslint-plugin-prettier": "^5.0.0",
|
|
95
96
|
"husky": "^8.0.3",
|
|
96
97
|
"lint-staged": "^13.2.3",
|
|
97
98
|
"msw": "1.0.1",
|
|
98
99
|
"npm-run-all": "^4.1.5",
|
|
99
100
|
"pinst": "^3.0.0",
|
|
100
|
-
"prettier": "^
|
|
101
|
+
"prettier": "^3.0.0",
|
|
101
102
|
"standard-version": "^9.5.0",
|
|
102
103
|
"typescript": "^5.1.6",
|
|
103
|
-
"vitest": "^0.
|
|
104
|
+
"vitest": "^0.33.0"
|
|
104
105
|
},
|
|
105
106
|
"directories": {
|
|
106
107
|
"test": "test"
|
|
107
108
|
},
|
|
108
|
-
"packageManager": "yarn@3.
|
|
109
|
+
"packageManager": "yarn@3.6.1"
|
|
109
110
|
}
|