@lifi/sdk 2.2.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.
@@ -292,7 +292,7 @@ const getGasRecommendation = async ({ chainId, fromChain, fromToken }, options)
292
292
  const getAvailableConnections = async (connectionRequest) => {
293
293
  const config = ConfigService_1.default.getInstance().getConfig();
294
294
  const url = new URL(`${config.apiUrl}/connections`);
295
- const { fromChain, fromToken, toChain, toToken, allowBridges } = connectionRequest;
295
+ const { fromChain, fromToken, toChain, toToken } = connectionRequest;
296
296
  if (fromChain) {
297
297
  url.searchParams.append('fromChain', fromChain);
298
298
  }
@@ -305,11 +305,22 @@ const getAvailableConnections = async (connectionRequest) => {
305
305
  if (toToken) {
306
306
  url.searchParams.append('fromToken', toToken);
307
307
  }
308
- if (allowBridges?.length) {
309
- allowBridges.forEach((bridge) => {
310
- url.searchParams.append('allowBridges', bridge);
311
- });
312
- }
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
+ });
313
324
  try {
314
325
  const response = await (0, request_1.request)(url);
315
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";
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';
5
+ exports.version = '2.2.1';
@@ -287,7 +287,7 @@ const getGasRecommendation = async ({ chainId, fromChain, fromToken }, options)
287
287
  const getAvailableConnections = async (connectionRequest) => {
288
288
  const config = ConfigService.getInstance().getConfig();
289
289
  const url = new URL(`${config.apiUrl}/connections`);
290
- const { fromChain, fromToken, toChain, toToken, allowBridges } = connectionRequest;
290
+ const { fromChain, fromToken, toChain, toToken } = connectionRequest;
291
291
  if (fromChain) {
292
292
  url.searchParams.append('fromChain', fromChain);
293
293
  }
@@ -300,11 +300,22 @@ const getAvailableConnections = async (connectionRequest) => {
300
300
  if (toToken) {
301
301
  url.searchParams.append('fromToken', toToken);
302
302
  }
303
- if (allowBridges?.length) {
304
- allowBridges.forEach((bridge) => {
305
- url.searchParams.append('allowBridges', bridge);
306
- });
307
- }
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
+ });
308
319
  try {
309
320
  const response = await request(url);
310
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";
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';
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",
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,20 +77,20 @@
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": "^6.0.0",
90
- "@typescript-eslint/parser": "^6.0.0",
89
+ "@typescript-eslint/eslint-plugin": "^6.1.0",
90
+ "@typescript-eslint/parser": "^6.1.0",
91
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
95
  "eslint-plugin-prettier": "^5.0.0",
96
96
  "husky": "^8.0.3",