@lifi/sdk 2.2.0-beta.0 → 2.2.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/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);
@@ -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);
@@ -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 = {};
@@ -289,7 +292,7 @@ const getGasRecommendation = async ({ chainId, fromChain, fromToken }, options)
289
292
  const getAvailableConnections = async (connectionRequest) => {
290
293
  const config = ConfigService_1.default.getInstance().getConfig();
291
294
  const url = new URL(`${config.apiUrl}/connections`);
292
- const { fromChain, fromToken, toChain, toToken, allowBridges } = connectionRequest;
295
+ const { fromChain, fromToken, toChain, toToken } = connectionRequest;
293
296
  if (fromChain) {
294
297
  url.searchParams.append('fromChain', fromChain);
295
298
  }
@@ -302,11 +305,22 @@ const getAvailableConnections = async (connectionRequest) => {
302
305
  if (toToken) {
303
306
  url.searchParams.append('fromToken', toToken);
304
307
  }
305
- if (allowBridges?.length) {
306
- allowBridges.forEach((bridge) => {
307
- url.searchParams.append('allowBridges', bridge);
308
- });
309
- }
308
+ const connectionRequestArrayParams = [
309
+ 'allowBridges',
310
+ 'denyBridges',
311
+ 'preferBridges',
312
+ 'allowExchanges',
313
+ 'denyExchanges',
314
+ 'preferExchanges',
315
+ ];
316
+ connectionRequestArrayParams.forEach((parameter) => {
317
+ const connectionRequestArrayParam = connectionRequest[parameter];
318
+ if (connectionRequestArrayParam?.length) {
319
+ connectionRequestArrayParam?.forEach((value) => {
320
+ url.searchParams.append(parameter, value);
321
+ });
322
+ }
323
+ });
310
324
  try {
311
325
  const response = await (0, request_1.request)(url);
312
326
  return response;
@@ -39,7 +39,6 @@ export type Config = {
39
39
  };
40
40
  export interface MultisigTxDetails {
41
41
  status: 'DONE' | 'FAILED' | 'PENDING' | 'CANCELLED';
42
- message: string;
43
42
  txHash?: string;
44
43
  }
45
44
  export interface MultisigTransactionResponse {
@@ -51,8 +50,8 @@ export interface BaseTransaction {
51
50
  data: string;
52
51
  }
53
52
  export interface MultisigConfig {
54
- isMultisigSigner: boolean;
55
- getMultisigTransactionDetails: (txHash: string, fromChainId: number, updateIntermediateStatus?: () => void) => Promise<MultisigTxDetails>;
53
+ isMultisigSigner?: boolean;
54
+ getMultisigTransactionDetails?: (txHash: string, fromChainId: number, updateIntermediateStatus?: () => void) => Promise<MultisigTxDetails>;
56
55
  sendBatchTransaction?: (batchTransactions: BaseTransaction[]) => Promise<MultisigTransactionResponse>;
57
56
  shouldBatchTransactions?: boolean;
58
57
  }
@@ -1,2 +1,2 @@
1
1
  export declare const name = "@lifi/sdk";
2
- export declare const version = "2.2.0-beta.0";
2
+ export declare const version = "2.2.1";
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = exports.name = void 0;
4
4
  exports.name = '@lifi/sdk';
5
- exports.version = '2.2.0-beta.0';
5
+ exports.version = '2.2.1';
@@ -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 = {};
@@ -284,7 +287,7 @@ const getGasRecommendation = async ({ chainId, fromChain, fromToken }, options)
284
287
  const getAvailableConnections = async (connectionRequest) => {
285
288
  const config = ConfigService.getInstance().getConfig();
286
289
  const url = new URL(`${config.apiUrl}/connections`);
287
- const { fromChain, fromToken, toChain, toToken, allowBridges } = connectionRequest;
290
+ const { fromChain, fromToken, toChain, toToken } = connectionRequest;
288
291
  if (fromChain) {
289
292
  url.searchParams.append('fromChain', fromChain);
290
293
  }
@@ -297,11 +300,22 @@ const getAvailableConnections = async (connectionRequest) => {
297
300
  if (toToken) {
298
301
  url.searchParams.append('fromToken', toToken);
299
302
  }
300
- if (allowBridges?.length) {
301
- allowBridges.forEach((bridge) => {
302
- url.searchParams.append('allowBridges', bridge);
303
- });
304
- }
303
+ const connectionRequestArrayParams = [
304
+ 'allowBridges',
305
+ 'denyBridges',
306
+ 'preferBridges',
307
+ 'allowExchanges',
308
+ 'denyExchanges',
309
+ 'preferExchanges',
310
+ ];
311
+ connectionRequestArrayParams.forEach((parameter) => {
312
+ const connectionRequestArrayParam = connectionRequest[parameter];
313
+ if (connectionRequestArrayParam?.length) {
314
+ connectionRequestArrayParam?.forEach((value) => {
315
+ url.searchParams.append(parameter, value);
316
+ });
317
+ }
318
+ });
305
319
  try {
306
320
  const response = await request(url);
307
321
  return response;
@@ -39,7 +39,6 @@ export type Config = {
39
39
  };
40
40
  export interface MultisigTxDetails {
41
41
  status: 'DONE' | 'FAILED' | 'PENDING' | 'CANCELLED';
42
- message: string;
43
42
  txHash?: string;
44
43
  }
45
44
  export interface MultisigTransactionResponse {
@@ -51,8 +50,8 @@ export interface BaseTransaction {
51
50
  data: string;
52
51
  }
53
52
  export interface MultisigConfig {
54
- isMultisigSigner: boolean;
55
- getMultisigTransactionDetails: (txHash: string, fromChainId: number, updateIntermediateStatus?: () => void) => Promise<MultisigTxDetails>;
53
+ isMultisigSigner?: boolean;
54
+ getMultisigTransactionDetails?: (txHash: string, fromChainId: number, updateIntermediateStatus?: () => void) => Promise<MultisigTxDetails>;
56
55
  sendBatchTransaction?: (batchTransactions: BaseTransaction[]) => Promise<MultisigTransactionResponse>;
57
56
  shouldBatchTransactions?: boolean;
58
57
  }
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.0-beta.0";
2
+ export declare const version = "2.2.1";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export const name = '@lifi/sdk';
2
- export const version = '2.2.0-beta.0';
2
+ export const version = '2.2.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifi/sdk",
3
- "version": "2.2.0-beta.0",
3
+ "version": "2.2.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",
@@ -77,34 +77,34 @@
77
77
  "dependencies": {
78
78
  "@ethersproject/abi": "^5.7.0",
79
79
  "@ethersproject/contracts": "^5.7.0",
80
- "@lifi/types": "^8.0.3",
80
+ "@lifi/types": "^8.0.4",
81
81
  "bignumber.js": "^9.1.1",
82
82
  "eth-rpc-errors": "^4.0.3",
83
83
  "ethers": "^5.7.2"
84
84
  },
85
85
  "devDependencies": {
86
- "@commitlint/cli": "^17.6.6",
87
- "@commitlint/config-conventional": "^17.6.6",
86
+ "@commitlint/cli": "^17.6.7",
87
+ "@commitlint/config-conventional": "^17.6.7",
88
88
  "@mswjs/interceptors": "^0.22.16",
89
- "@typescript-eslint/eslint-plugin": "^5.61.0",
90
- "@typescript-eslint/parser": "^5.61.0",
91
- "@vitest/coverage-c8": "^0.32.4",
89
+ "@typescript-eslint/eslint-plugin": "^6.1.0",
90
+ "@typescript-eslint/parser": "^6.1.0",
91
+ "@vitest/coverage-c8": "^0.33.0",
92
92
  "cross-fetch": "^4.0.0",
93
- "eslint": "^8.44.0",
93
+ "eslint": "^8.45.0",
94
94
  "eslint-config-prettier": "^8.8.0",
95
- "eslint-plugin-prettier": "^4.2.1",
95
+ "eslint-plugin-prettier": "^5.0.0",
96
96
  "husky": "^8.0.3",
97
97
  "lint-staged": "^13.2.3",
98
98
  "msw": "1.0.1",
99
99
  "npm-run-all": "^4.1.5",
100
100
  "pinst": "^3.0.0",
101
- "prettier": "^2.8.8",
101
+ "prettier": "^3.0.0",
102
102
  "standard-version": "^9.5.0",
103
103
  "typescript": "^5.1.6",
104
- "vitest": "^0.32.4"
104
+ "vitest": "^0.33.0"
105
105
  },
106
106
  "directories": {
107
107
  "test": "test"
108
108
  },
109
- "packageManager": "yarn@3.5.1"
109
+ "packageManager": "yarn@3.6.1"
110
110
  }