@lifi/sdk 2.0.0-beta.11 → 2.0.0-beta.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/dist/LiFi.d.ts +9 -9
- package/dist/LiFi.js +11 -11
- package/dist/allowance/checkAllowance.js +4 -2
- package/dist/cjs/LiFi.d.ts +9 -9
- package/dist/cjs/LiFi.js +12 -13
- package/dist/cjs/allowance/checkAllowance.js +4 -2
- package/dist/cjs/execution/RouteExecutionManager.d.ts +1 -1
- package/dist/cjs/execution/StatusManager.js +1 -1
- package/dist/cjs/execution/StepExecutionManager.js +2 -2
- package/dist/cjs/services/ConfigService.d.ts +1 -1
- package/dist/cjs/services/ConfigService.js +1 -1
- package/dist/cjs/typeguards.d.ts +2 -2
- package/dist/cjs/types/internal.types.d.ts +6 -9
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/execution/RouteExecutionManager.d.ts +1 -1
- package/dist/execution/StatusManager.js +1 -1
- package/dist/execution/StepExecutionManager.js +2 -2
- package/dist/services/ConfigService.d.ts +1 -1
- package/dist/services/ConfigService.js +1 -1
- package/dist/typeguards.d.ts +2 -2
- package/dist/types/internal.types.d.ts +6 -9
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +11 -11
package/dist/LiFi.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { RouteExecutionManager } from './execution/RouteExecutionManager';
|
|
|
6
6
|
import { Config, ConfigUpdate, RevokeTokenData } from './types';
|
|
7
7
|
export declare class LiFi extends RouteExecutionManager {
|
|
8
8
|
private chainsService;
|
|
9
|
-
constructor(configUpdate
|
|
9
|
+
constructor(configUpdate: ConfigUpdate);
|
|
10
10
|
/**
|
|
11
11
|
* Get the current configuration of the SDK
|
|
12
12
|
* @return {Config} - The config object
|
|
@@ -18,7 +18,7 @@ export declare class LiFi extends RouteExecutionManager {
|
|
|
18
18
|
*/
|
|
19
19
|
getConfigAsync: () => Promise<Config>;
|
|
20
20
|
/**
|
|
21
|
-
* Get an instance of a provider for a specific
|
|
21
|
+
* Get an instance of a provider for a specific chain
|
|
22
22
|
* @param {number} chainId - Id of the chain the provider is for
|
|
23
23
|
* @param {boolean} archive - Whether to use an archive provider that is based on a default rpc or not. defaults to false
|
|
24
24
|
* @return {FallbackProvider} The provider for the given chain
|
|
@@ -29,7 +29,7 @@ export declare class LiFi extends RouteExecutionManager {
|
|
|
29
29
|
* @param {ConfigUpdate} configUpdate - An object containing the configuration fields that should be updated.
|
|
30
30
|
* @return {Config} The renewed config object
|
|
31
31
|
*/
|
|
32
|
-
setConfig: (configUpdate: ConfigUpdate) => Config;
|
|
32
|
+
setConfig: (configUpdate: Partial<ConfigUpdate>) => Config;
|
|
33
33
|
/**
|
|
34
34
|
* Get a set of current possibilities based on a request that specifies which chains, exchanges and bridges are preferred or unwanted.
|
|
35
35
|
* @param {PossibilitiesRequest} request - Object defining preferences regarding chain, exchanges and bridges
|
|
@@ -154,10 +154,10 @@ export declare class LiFi extends RouteExecutionManager {
|
|
|
154
154
|
* @param { RevokeApprovalRequest } request - The revoke request
|
|
155
155
|
*/
|
|
156
156
|
revokeTokenApproval: (request: RevokeApprovalRequest) => Promise<void>;
|
|
157
|
+
/**
|
|
158
|
+
* Get all the available connections for swap/bridging tokens
|
|
159
|
+
* @param connectionRequest ConnectionsRequest
|
|
160
|
+
* @returns ConnectionsResponse
|
|
161
|
+
*/
|
|
162
|
+
getConnections: (connectionRequest: ConnectionsRequest) => Promise<ConnectionsResponse>;
|
|
157
163
|
}
|
|
158
|
-
/**
|
|
159
|
-
* Get all the available connections for swap/bridging tokens
|
|
160
|
-
* @param connectionRequest ConnectionsRequest
|
|
161
|
-
* @returns ConnectionsResponse
|
|
162
|
-
*/
|
|
163
|
-
export declare const getConnections: (connectionRequest: ConnectionsRequest) => Promise<ConnectionsResponse>;
|
package/dist/LiFi.js
CHANGED
|
@@ -26,7 +26,7 @@ export class LiFi extends RouteExecutionManager {
|
|
|
26
26
|
return this.configService.getConfigAsync();
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
|
-
* Get an instance of a provider for a specific
|
|
29
|
+
* Get an instance of a provider for a specific chain
|
|
30
30
|
* @param {number} chainId - Id of the chain the provider is for
|
|
31
31
|
* @param {boolean} archive - Whether to use an archive provider that is based on a default rpc or not. defaults to false
|
|
32
32
|
* @return {FallbackProvider} The provider for the given chain
|
|
@@ -216,19 +216,19 @@ export class LiFi extends RouteExecutionManager {
|
|
|
216
216
|
this.revokeTokenApproval = (request) => {
|
|
217
217
|
return revokeTokenApproval(request);
|
|
218
218
|
};
|
|
219
|
+
/**
|
|
220
|
+
* Get all the available connections for swap/bridging tokens
|
|
221
|
+
* @param connectionRequest ConnectionsRequest
|
|
222
|
+
* @returns ConnectionsResponse
|
|
223
|
+
*/
|
|
224
|
+
this.getConnections = async (connectionRequest) => {
|
|
225
|
+
const connections = await ApiService.getAvailableConnections(connectionRequest);
|
|
226
|
+
return connections;
|
|
227
|
+
};
|
|
219
228
|
this.chainsService = ChainsService.getInstance();
|
|
220
229
|
this.chainsService.getChains().then((chains) => {
|
|
221
230
|
this.configService.updateChains(chains);
|
|
222
231
|
});
|
|
223
|
-
checkPackageUpdates(name, version, configUpdate
|
|
232
|
+
checkPackageUpdates(name, version, configUpdate.disableVersionCheck);
|
|
224
233
|
}
|
|
225
234
|
}
|
|
226
|
-
/**
|
|
227
|
-
* Get all the available connections for swap/bridging tokens
|
|
228
|
-
* @param connectionRequest ConnectionsRequest
|
|
229
|
-
* @returns ConnectionsResponse
|
|
230
|
-
*/
|
|
231
|
-
export const getConnections = async (connectionRequest) => {
|
|
232
|
-
const connections = await ApiService.getAvailableConnections(connectionRequest);
|
|
233
|
-
return connections;
|
|
234
|
-
};
|
|
@@ -20,10 +20,12 @@ export const checkAllowance = async (signer, step, statusManager, settings, chai
|
|
|
20
20
|
from: step.action.fromToken.address,
|
|
21
21
|
to: step.estimate.approvalAddress,
|
|
22
22
|
};
|
|
23
|
-
if (settings.
|
|
24
|
-
const config = await settings.
|
|
23
|
+
if (settings.updateTransactionRequestHook) {
|
|
24
|
+
const config = await settings.updateTransactionRequestHook(approvalRequest);
|
|
25
25
|
approvalRequest.gasLimit = config.gasLimit;
|
|
26
26
|
approvalRequest.gasPrice = config.gasPrice;
|
|
27
|
+
approvalRequest.maxFeePerGas = config.maxFeePerGas;
|
|
28
|
+
approvalRequest.maxPriorityFeePerGas = config.maxPriorityFeePerGas;
|
|
27
29
|
}
|
|
28
30
|
if (!approvalRequest.from) {
|
|
29
31
|
throw new Error('Missing Signer address');
|
package/dist/cjs/LiFi.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { RouteExecutionManager } from './execution/RouteExecutionManager';
|
|
|
6
6
|
import { Config, ConfigUpdate, RevokeTokenData } from './types';
|
|
7
7
|
export declare class LiFi extends RouteExecutionManager {
|
|
8
8
|
private chainsService;
|
|
9
|
-
constructor(configUpdate
|
|
9
|
+
constructor(configUpdate: ConfigUpdate);
|
|
10
10
|
/**
|
|
11
11
|
* Get the current configuration of the SDK
|
|
12
12
|
* @return {Config} - The config object
|
|
@@ -18,7 +18,7 @@ export declare class LiFi extends RouteExecutionManager {
|
|
|
18
18
|
*/
|
|
19
19
|
getConfigAsync: () => Promise<Config>;
|
|
20
20
|
/**
|
|
21
|
-
* Get an instance of a provider for a specific
|
|
21
|
+
* Get an instance of a provider for a specific chain
|
|
22
22
|
* @param {number} chainId - Id of the chain the provider is for
|
|
23
23
|
* @param {boolean} archive - Whether to use an archive provider that is based on a default rpc or not. defaults to false
|
|
24
24
|
* @return {FallbackProvider} The provider for the given chain
|
|
@@ -29,7 +29,7 @@ export declare class LiFi extends RouteExecutionManager {
|
|
|
29
29
|
* @param {ConfigUpdate} configUpdate - An object containing the configuration fields that should be updated.
|
|
30
30
|
* @return {Config} The renewed config object
|
|
31
31
|
*/
|
|
32
|
-
setConfig: (configUpdate: ConfigUpdate) => Config;
|
|
32
|
+
setConfig: (configUpdate: Partial<ConfigUpdate>) => Config;
|
|
33
33
|
/**
|
|
34
34
|
* Get a set of current possibilities based on a request that specifies which chains, exchanges and bridges are preferred or unwanted.
|
|
35
35
|
* @param {PossibilitiesRequest} request - Object defining preferences regarding chain, exchanges and bridges
|
|
@@ -154,10 +154,10 @@ export declare class LiFi extends RouteExecutionManager {
|
|
|
154
154
|
* @param { RevokeApprovalRequest } request - The revoke request
|
|
155
155
|
*/
|
|
156
156
|
revokeTokenApproval: (request: RevokeApprovalRequest) => Promise<void>;
|
|
157
|
+
/**
|
|
158
|
+
* Get all the available connections for swap/bridging tokens
|
|
159
|
+
* @param connectionRequest ConnectionsRequest
|
|
160
|
+
* @returns ConnectionsResponse
|
|
161
|
+
*/
|
|
162
|
+
getConnections: (connectionRequest: ConnectionsRequest) => Promise<ConnectionsResponse>;
|
|
157
163
|
}
|
|
158
|
-
/**
|
|
159
|
-
* Get all the available connections for swap/bridging tokens
|
|
160
|
-
* @param connectionRequest ConnectionsRequest
|
|
161
|
-
* @returns ConnectionsResponse
|
|
162
|
-
*/
|
|
163
|
-
export declare const getConnections: (connectionRequest: ConnectionsRequest) => Promise<ConnectionsResponse>;
|
package/dist/cjs/LiFi.js
CHANGED
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
29
|
+
exports.LiFi = void 0;
|
|
30
30
|
const allowance_1 = require("./allowance");
|
|
31
31
|
const balance = __importStar(require("./balance"));
|
|
32
32
|
const connectors_1 = require("./connectors");
|
|
@@ -55,7 +55,7 @@ class LiFi extends RouteExecutionManager_1.RouteExecutionManager {
|
|
|
55
55
|
return this.configService.getConfigAsync();
|
|
56
56
|
};
|
|
57
57
|
/**
|
|
58
|
-
* Get an instance of a provider for a specific
|
|
58
|
+
* Get an instance of a provider for a specific chain
|
|
59
59
|
* @param {number} chainId - Id of the chain the provider is for
|
|
60
60
|
* @param {boolean} archive - Whether to use an archive provider that is based on a default rpc or not. defaults to false
|
|
61
61
|
* @return {FallbackProvider} The provider for the given chain
|
|
@@ -245,21 +245,20 @@ class LiFi extends RouteExecutionManager_1.RouteExecutionManager {
|
|
|
245
245
|
this.revokeTokenApproval = (request) => {
|
|
246
246
|
return (0, allowance_1.revokeTokenApproval)(request);
|
|
247
247
|
};
|
|
248
|
+
/**
|
|
249
|
+
* Get all the available connections for swap/bridging tokens
|
|
250
|
+
* @param connectionRequest ConnectionsRequest
|
|
251
|
+
* @returns ConnectionsResponse
|
|
252
|
+
*/
|
|
253
|
+
this.getConnections = async (connectionRequest) => {
|
|
254
|
+
const connections = await ApiService_1.default.getAvailableConnections(connectionRequest);
|
|
255
|
+
return connections;
|
|
256
|
+
};
|
|
248
257
|
this.chainsService = ChainsService_1.default.getInstance();
|
|
249
258
|
this.chainsService.getChains().then((chains) => {
|
|
250
259
|
this.configService.updateChains(chains);
|
|
251
260
|
});
|
|
252
|
-
(0, helpers_1.checkPackageUpdates)(version_1.name, version_1.version, configUpdate
|
|
261
|
+
(0, helpers_1.checkPackageUpdates)(version_1.name, version_1.version, configUpdate.disableVersionCheck);
|
|
253
262
|
}
|
|
254
263
|
}
|
|
255
264
|
exports.LiFi = LiFi;
|
|
256
|
-
/**
|
|
257
|
-
* Get all the available connections for swap/bridging tokens
|
|
258
|
-
* @param connectionRequest ConnectionsRequest
|
|
259
|
-
* @returns ConnectionsResponse
|
|
260
|
-
*/
|
|
261
|
-
const getConnections = async (connectionRequest) => {
|
|
262
|
-
const connections = await ApiService_1.default.getAvailableConnections(connectionRequest);
|
|
263
|
-
return connections;
|
|
264
|
-
};
|
|
265
|
-
exports.getConnections = getConnections;
|
|
@@ -26,10 +26,12 @@ const checkAllowance = async (signer, step, statusManager, settings, chain, allo
|
|
|
26
26
|
from: step.action.fromToken.address,
|
|
27
27
|
to: step.estimate.approvalAddress,
|
|
28
28
|
};
|
|
29
|
-
if (settings.
|
|
30
|
-
const config = await settings.
|
|
29
|
+
if (settings.updateTransactionRequestHook) {
|
|
30
|
+
const config = await settings.updateTransactionRequestHook(approvalRequest);
|
|
31
31
|
approvalRequest.gasLimit = config.gasLimit;
|
|
32
32
|
approvalRequest.gasPrice = config.gasPrice;
|
|
33
|
+
approvalRequest.maxFeePerGas = config.maxFeePerGas;
|
|
34
|
+
approvalRequest.maxPriorityFeePerGas = config.maxPriorityFeePerGas;
|
|
33
35
|
}
|
|
34
36
|
if (!approvalRequest.from) {
|
|
35
37
|
throw new Error('Missing Signer address');
|
|
@@ -6,7 +6,7 @@ export declare class RouteExecutionManager {
|
|
|
6
6
|
private executionDictionary;
|
|
7
7
|
private executionPromiseDictionary;
|
|
8
8
|
protected configService: ConfigService;
|
|
9
|
-
constructor(configUpdate
|
|
9
|
+
constructor(configUpdate: ConfigUpdate);
|
|
10
10
|
/**
|
|
11
11
|
* Execute a route.
|
|
12
12
|
* @param {Signer} signer - The signer required to send the transactions.
|
|
@@ -136,7 +136,7 @@ class StatusManager {
|
|
|
136
136
|
throw new Error("Couldn't find a step to update.");
|
|
137
137
|
}
|
|
138
138
|
this.route.steps[stepIndex] = Object.assign(this.route.steps[stepIndex], step);
|
|
139
|
-
this.settings.
|
|
139
|
+
this.settings.updateRouteHook(this.route);
|
|
140
140
|
this.internalUpdateRouteCallback(this.route);
|
|
141
141
|
return this.route.steps[stepIndex];
|
|
142
142
|
};
|
|
@@ -81,8 +81,8 @@ class StepExecutionManager {
|
|
|
81
81
|
if (!this.allowUserInteraction) {
|
|
82
82
|
return step.execution;
|
|
83
83
|
}
|
|
84
|
-
if (settings.
|
|
85
|
-
const customConfig = await settings.
|
|
84
|
+
if (settings.updateTransactionRequestHook) {
|
|
85
|
+
const customConfig = await settings.updateTransactionRequestHook(transactionRequest);
|
|
86
86
|
transactionRequest.gasLimit = customConfig.gasLimit;
|
|
87
87
|
transactionRequest.gasPrice = customConfig.gasPrice;
|
|
88
88
|
transactionRequest.maxPriorityFeePerGas =
|
|
@@ -18,6 +18,6 @@ export default class ConfigService {
|
|
|
18
18
|
* Use this if you need access to chain data (RPCs or multicalls)
|
|
19
19
|
*/
|
|
20
20
|
getConfigAsync: () => Promise<Config>;
|
|
21
|
-
updateConfig: (configUpdate: ConfigUpdate) => Config;
|
|
21
|
+
updateConfig: (configUpdate: Partial<ConfigUpdate>) => Config;
|
|
22
22
|
updateChains: (chains: Chain[]) => Config;
|
|
23
23
|
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const types_1 = require("../types");
|
|
4
4
|
const DefaultExecutionSettings = {
|
|
5
5
|
/* eslint-disable-next-line @typescript-eslint/no-empty-function */
|
|
6
|
-
|
|
6
|
+
updateRouteHook: () => { },
|
|
7
7
|
switchChainHook: () => Promise.resolve(undefined),
|
|
8
8
|
acceptExchangeRateUpdateHook: () => Promise.resolve(undefined),
|
|
9
9
|
infiniteApproval: false,
|
package/dist/cjs/typeguards.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LifiStep, RoutesRequest,
|
|
1
|
+
import { LifiStep, RoutesRequest, StaticToken } from './types';
|
|
2
2
|
export declare const isRoutesRequest: (routesRequest: RoutesRequest) => routesRequest is RoutesRequest;
|
|
3
3
|
export declare const isStep: (step: LifiStep) => step is LifiStep;
|
|
4
|
-
export declare const isToken: (token:
|
|
4
|
+
export declare const isToken: (token: StaticToken) => token is StaticToken;
|
|
@@ -23,8 +23,8 @@ export interface ExecutionParams {
|
|
|
23
23
|
statusManager: StatusManager;
|
|
24
24
|
settings: InternalExecutionSettings;
|
|
25
25
|
}
|
|
26
|
-
export type
|
|
27
|
-
export type
|
|
26
|
+
export type UpdateRouteHook = (updatedRoute: Route) => void;
|
|
27
|
+
export type TransactionRequestUpdateHook = (updatedTxRequest: TransactionRequest) => Promise<TransactionRequest>;
|
|
28
28
|
export type Config = {
|
|
29
29
|
apiUrl: string;
|
|
30
30
|
rpcs: Record<ChainId, string[]>;
|
|
@@ -69,16 +69,13 @@ export interface RouteExecutionData {
|
|
|
69
69
|
}
|
|
70
70
|
export type ExecutionSettings = Partial<InternalExecutionSettings>;
|
|
71
71
|
export interface InternalExecutionSettings {
|
|
72
|
-
updateCallback: CallbackFunction;
|
|
73
|
-
switchChainHook: SwitchChainHook;
|
|
74
72
|
acceptExchangeRateUpdateHook: AcceptExchangeRateUpdateHook;
|
|
75
|
-
|
|
73
|
+
switchChainHook: SwitchChainHook;
|
|
74
|
+
updateRouteHook: UpdateRouteHook;
|
|
75
|
+
updateTransactionRequestHook?: TransactionRequestUpdateHook;
|
|
76
76
|
executeInBackground: boolean;
|
|
77
|
-
|
|
77
|
+
infiniteApproval: boolean;
|
|
78
78
|
}
|
|
79
|
-
export type EnforcedObjectProperties<T> = T & {
|
|
80
|
-
[P in keyof T]-?: T[P];
|
|
81
|
-
};
|
|
82
79
|
export type RouteExecutionDictionary = Partial<Record<string, RouteExecutionData>>;
|
|
83
80
|
export type RouteExecutionPromiseDictionary = Partial<Record<string, Promise<Route>>>;
|
|
84
81
|
export type RevokeTokenData = {
|
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.0.0-beta.
|
|
2
|
+
export declare const version = "2.0.0-beta.12";
|
package/dist/cjs/version.js
CHANGED
|
@@ -6,7 +6,7 @@ export declare class RouteExecutionManager {
|
|
|
6
6
|
private executionDictionary;
|
|
7
7
|
private executionPromiseDictionary;
|
|
8
8
|
protected configService: ConfigService;
|
|
9
|
-
constructor(configUpdate
|
|
9
|
+
constructor(configUpdate: ConfigUpdate);
|
|
10
10
|
/**
|
|
11
11
|
* Execute a route.
|
|
12
12
|
* @param {Signer} signer - The signer required to send the transactions.
|
|
@@ -133,7 +133,7 @@ export class StatusManager {
|
|
|
133
133
|
throw new Error("Couldn't find a step to update.");
|
|
134
134
|
}
|
|
135
135
|
this.route.steps[stepIndex] = Object.assign(this.route.steps[stepIndex], step);
|
|
136
|
-
this.settings.
|
|
136
|
+
this.settings.updateRouteHook(this.route);
|
|
137
137
|
this.internalUpdateRouteCallback(this.route);
|
|
138
138
|
return this.route.steps[stepIndex];
|
|
139
139
|
};
|
|
@@ -75,8 +75,8 @@ export class StepExecutionManager {
|
|
|
75
75
|
if (!this.allowUserInteraction) {
|
|
76
76
|
return step.execution;
|
|
77
77
|
}
|
|
78
|
-
if (settings.
|
|
79
|
-
const customConfig = await settings.
|
|
78
|
+
if (settings.updateTransactionRequestHook) {
|
|
79
|
+
const customConfig = await settings.updateTransactionRequestHook(transactionRequest);
|
|
80
80
|
transactionRequest.gasLimit = customConfig.gasLimit;
|
|
81
81
|
transactionRequest.gasPrice = customConfig.gasPrice;
|
|
82
82
|
transactionRequest.maxPriorityFeePerGas =
|
|
@@ -18,6 +18,6 @@ export default class ConfigService {
|
|
|
18
18
|
* Use this if you need access to chain data (RPCs or multicalls)
|
|
19
19
|
*/
|
|
20
20
|
getConfigAsync: () => Promise<Config>;
|
|
21
|
-
updateConfig: (configUpdate: ConfigUpdate) => Config;
|
|
21
|
+
updateConfig: (configUpdate: Partial<ConfigUpdate>) => Config;
|
|
22
22
|
updateChains: (chains: Chain[]) => Config;
|
|
23
23
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChainId, } from '../types';
|
|
2
2
|
const DefaultExecutionSettings = {
|
|
3
3
|
/* eslint-disable-next-line @typescript-eslint/no-empty-function */
|
|
4
|
-
|
|
4
|
+
updateRouteHook: () => { },
|
|
5
5
|
switchChainHook: () => Promise.resolve(undefined),
|
|
6
6
|
acceptExchangeRateUpdateHook: () => Promise.resolve(undefined),
|
|
7
7
|
infiniteApproval: false,
|
package/dist/typeguards.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LifiStep, RoutesRequest,
|
|
1
|
+
import { LifiStep, RoutesRequest, StaticToken } from './types';
|
|
2
2
|
export declare const isRoutesRequest: (routesRequest: RoutesRequest) => routesRequest is RoutesRequest;
|
|
3
3
|
export declare const isStep: (step: LifiStep) => step is LifiStep;
|
|
4
|
-
export declare const isToken: (token:
|
|
4
|
+
export declare const isToken: (token: StaticToken) => token is StaticToken;
|
|
@@ -23,8 +23,8 @@ export interface ExecutionParams {
|
|
|
23
23
|
statusManager: StatusManager;
|
|
24
24
|
settings: InternalExecutionSettings;
|
|
25
25
|
}
|
|
26
|
-
export type
|
|
27
|
-
export type
|
|
26
|
+
export type UpdateRouteHook = (updatedRoute: Route) => void;
|
|
27
|
+
export type TransactionRequestUpdateHook = (updatedTxRequest: TransactionRequest) => Promise<TransactionRequest>;
|
|
28
28
|
export type Config = {
|
|
29
29
|
apiUrl: string;
|
|
30
30
|
rpcs: Record<ChainId, string[]>;
|
|
@@ -69,16 +69,13 @@ export interface RouteExecutionData {
|
|
|
69
69
|
}
|
|
70
70
|
export type ExecutionSettings = Partial<InternalExecutionSettings>;
|
|
71
71
|
export interface InternalExecutionSettings {
|
|
72
|
-
updateCallback: CallbackFunction;
|
|
73
|
-
switchChainHook: SwitchChainHook;
|
|
74
72
|
acceptExchangeRateUpdateHook: AcceptExchangeRateUpdateHook;
|
|
75
|
-
|
|
73
|
+
switchChainHook: SwitchChainHook;
|
|
74
|
+
updateRouteHook: UpdateRouteHook;
|
|
75
|
+
updateTransactionRequestHook?: TransactionRequestUpdateHook;
|
|
76
76
|
executeInBackground: boolean;
|
|
77
|
-
|
|
77
|
+
infiniteApproval: boolean;
|
|
78
78
|
}
|
|
79
|
-
export type EnforcedObjectProperties<T> = T & {
|
|
80
|
-
[P in keyof T]-?: T[P];
|
|
81
|
-
};
|
|
82
79
|
export type RouteExecutionDictionary = Partial<Record<string, RouteExecutionData>>;
|
|
83
80
|
export type RouteExecutionPromiseDictionary = Partial<Record<string, Promise<Route>>>;
|
|
84
81
|
export type RevokeTokenData = {
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@lifi/sdk";
|
|
2
|
-
export declare const version = "2.0.0-beta.
|
|
2
|
+
export declare const version = "2.0.0-beta.12";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/sdk';
|
|
2
|
-
export const version = '2.0.0-beta.
|
|
2
|
+
export const version = '2.0.0-beta.12';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/sdk",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.12",
|
|
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,20 +76,20 @@
|
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@ethersproject/abi": "^5.7.0",
|
|
78
78
|
"@ethersproject/contracts": "^5.7.0",
|
|
79
|
-
"@lifi/types": "^
|
|
79
|
+
"@lifi/types": "^6.0.0",
|
|
80
80
|
"bignumber.js": "^9.1.1",
|
|
81
81
|
"eth-rpc-errors": "^4.0.3",
|
|
82
82
|
"ethers": "^5.7.2"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@commitlint/cli": "^17.6.
|
|
86
|
-
"@commitlint/config-conventional": "^17.6.
|
|
87
|
-
"@mswjs/interceptors": "^0.22.
|
|
88
|
-
"@typescript-eslint/eslint-plugin": "^5.59.
|
|
89
|
-
"@typescript-eslint/parser": "^5.59.
|
|
90
|
-
"@vitest/coverage-c8": "^0.
|
|
85
|
+
"@commitlint/cli": "^17.6.3",
|
|
86
|
+
"@commitlint/config-conventional": "^17.6.3",
|
|
87
|
+
"@mswjs/interceptors": "^0.22.14",
|
|
88
|
+
"@typescript-eslint/eslint-plugin": "^5.59.5",
|
|
89
|
+
"@typescript-eslint/parser": "^5.59.5",
|
|
90
|
+
"@vitest/coverage-c8": "^0.31.0",
|
|
91
91
|
"cross-fetch": "^3.1.5",
|
|
92
|
-
"eslint": "^8.
|
|
92
|
+
"eslint": "^8.40.0",
|
|
93
93
|
"eslint-config-prettier": "^8.8.0",
|
|
94
94
|
"eslint-plugin-prettier": "^4.2.1",
|
|
95
95
|
"husky": "^8.0.3",
|
|
@@ -100,10 +100,10 @@
|
|
|
100
100
|
"prettier": "^2.8.8",
|
|
101
101
|
"standard-version": "^9.5.0",
|
|
102
102
|
"typescript": "^5.0.4",
|
|
103
|
-
"vitest": "^0.
|
|
103
|
+
"vitest": "^0.31.0"
|
|
104
104
|
},
|
|
105
105
|
"directories": {
|
|
106
106
|
"test": "test"
|
|
107
107
|
},
|
|
108
|
-
"packageManager": "yarn@3.5.
|
|
108
|
+
"packageManager": "yarn@3.5.1"
|
|
109
109
|
}
|