@imtbl/sdk 0.44.1 → 0.44.2
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/blockchain_data.js +1 -1
- package/dist/browser/checkout/sdk.js +3 -3
- package/dist/browser/checkout/widgets.js +60 -60
- package/dist/checkout.d.ts +29 -3
- package/dist/checkout.js +147 -94
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +11 -11
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +149 -96
- package/dist/index.d.ts +34 -2
- package/dist/index.js +149 -96
- package/dist/orderbook.d.ts +1 -1
- package/dist/passport.js +2 -2
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -10619,7 +10619,7 @@ class MultiRollupApiClients {
|
|
|
10619
10619
|
}
|
|
10620
10620
|
|
|
10621
10621
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
10622
|
-
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.44.
|
|
10622
|
+
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.44.2' };
|
|
10623
10623
|
const createConfig = ({ basePath, headers, }) => {
|
|
10624
10624
|
if (!basePath.trim()) {
|
|
10625
10625
|
throw Error('basePath can not be empty');
|
|
@@ -10691,7 +10691,7 @@ class APIError extends Error {
|
|
|
10691
10691
|
|
|
10692
10692
|
/* eslint-disable implicit-arrow-linebreak */
|
|
10693
10693
|
const defaultHeaders = {
|
|
10694
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.44.
|
|
10694
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.44.2',
|
|
10695
10695
|
};
|
|
10696
10696
|
/**
|
|
10697
10697
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -11130,7 +11130,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
11130
11130
|
chainID,
|
|
11131
11131
|
coreContractAddress,
|
|
11132
11132
|
registrationContractAddress,
|
|
11133
|
-
sdkVersion: 'ts-immutable-sdk-0.44.
|
|
11133
|
+
sdkVersion: 'ts-immutable-sdk-0.44.2',
|
|
11134
11134
|
});
|
|
11135
11135
|
/**
|
|
11136
11136
|
* Sets `sdkVersion` at the time of build
|
|
@@ -37016,38 +37016,84 @@ class TokenBridge {
|
|
|
37016
37016
|
* @throws {BridgeError} - If an error occurs during the query, a BridgeError will be thrown with a specific error type.
|
|
37017
37017
|
*/
|
|
37018
37018
|
async getTransactionStatus(req) {
|
|
37019
|
-
const axelarAPIEndpoint = this.getAxelarEndpoint(req.sourceChainId);
|
|
37020
37019
|
const txStatusResponse = {
|
|
37021
37020
|
transactions: [],
|
|
37022
37021
|
};
|
|
37023
|
-
const
|
|
37024
|
-
const
|
|
37025
|
-
|
|
37026
|
-
|
|
37022
|
+
const txStatusItems = await this.getAxelarStatus(req.transactions, req.sourceChainId);
|
|
37023
|
+
const uniqueReceivers = await this.getUniqueReceivers(txStatusItems, req.sourceChainId);
|
|
37024
|
+
const pendingWithdrawalPromises = [];
|
|
37025
|
+
for (const address of uniqueReceivers) {
|
|
37026
|
+
pendingWithdrawalPromises.push(this.getPendingWithdrawals({ recipient: address }));
|
|
37027
37027
|
}
|
|
37028
|
-
let
|
|
37028
|
+
let pendingWithdrawalResponses = [];
|
|
37029
37029
|
try {
|
|
37030
|
-
|
|
37030
|
+
pendingWithdrawalResponses = await Promise.all(pendingWithdrawalPromises);
|
|
37031
37031
|
}
|
|
37032
37032
|
catch (err) {
|
|
37033
|
-
|
|
37033
|
+
console.log('err', err);
|
|
37034
|
+
throw new BridgeError(`Failed to fetch the pending withdrawals with: ${err}`, BridgeErrorType.FLOW_RATE_ERROR);
|
|
37034
37035
|
}
|
|
37035
|
-
|
|
37036
|
+
txStatusResponse.transactions = txStatusItems;
|
|
37037
|
+
// try match a completed transaction to a pending flowRate transaction
|
|
37038
|
+
for (const txStatusRes of txStatusResponse.transactions) {
|
|
37039
|
+
if (txStatusRes.status === StatusResponse.COMPLETE) {
|
|
37040
|
+
(() => {
|
|
37041
|
+
for (const pendingWithdrawals of pendingWithdrawalResponses) {
|
|
37042
|
+
const flowRatedTxIndex = pendingWithdrawals.pending.findIndex((el) => (el.amount.toString() === txStatusRes.amount.toString()
|
|
37043
|
+
&& el.token === txStatusRes.token
|
|
37044
|
+
&& el.withdrawer === txStatusRes.sender
|
|
37045
|
+
&& el.recipient === txStatusRes.recipient));
|
|
37046
|
+
if (flowRatedTxIndex !== -1) {
|
|
37047
|
+
txStatusRes.status = StatusResponse.FLOW_RATE_CONTROLLED;
|
|
37048
|
+
txStatusRes.data = {
|
|
37049
|
+
canWithdraw: pendingWithdrawals.pending[flowRatedTxIndex].canWithdraw,
|
|
37050
|
+
timeoutStart: pendingWithdrawals.pending[flowRatedTxIndex].timeoutStart,
|
|
37051
|
+
timeoutEnd: pendingWithdrawals.pending[flowRatedTxIndex].timeoutEnd,
|
|
37052
|
+
};
|
|
37053
|
+
pendingWithdrawals.pending.splice(flowRatedTxIndex, 1);
|
|
37054
|
+
return;
|
|
37055
|
+
}
|
|
37056
|
+
}
|
|
37057
|
+
})();
|
|
37058
|
+
}
|
|
37059
|
+
}
|
|
37060
|
+
// Return the tx status response
|
|
37061
|
+
return txStatusResponse;
|
|
37062
|
+
}
|
|
37063
|
+
async getUniqueReceivers(txStatusItems, sourceChainId) {
|
|
37064
|
+
const uniqueReceivers = [];
|
|
37036
37065
|
const isWithdraw = [
|
|
37037
37066
|
ZKEVM_DEVNET_CHAIN_ID,
|
|
37038
37067
|
ZKEVM_TESTNET_CHAIN_ID,
|
|
37039
37068
|
ZKEVM_MAINNET_CHAIN_ID
|
|
37040
|
-
].includes(
|
|
37041
|
-
let
|
|
37042
|
-
|
|
37043
|
-
|
|
37044
|
-
const
|
|
37045
|
-
|
|
37046
|
-
|
|
37069
|
+
].includes(sourceChainId);
|
|
37070
|
+
for (let i = 0, l = txStatusItems.length; i < l; i++) {
|
|
37071
|
+
if (txStatusItems[i].status === StatusResponse.COMPLETE
|
|
37072
|
+
&& isWithdraw && txStatusItems[i].recipient) {
|
|
37073
|
+
const receiverIndex = uniqueReceivers.findIndex((el) => el === txStatusItems[i].recipient);
|
|
37074
|
+
if (receiverIndex === -1) {
|
|
37075
|
+
uniqueReceivers.push(txStatusItems[i].recipient);
|
|
37076
|
+
}
|
|
37077
|
+
}
|
|
37078
|
+
} // for
|
|
37079
|
+
return uniqueReceivers;
|
|
37080
|
+
}
|
|
37081
|
+
async getAxelarStatus(transactions, sourceChainId) {
|
|
37082
|
+
const txStatusItems = [];
|
|
37083
|
+
const statusPromises = [];
|
|
37084
|
+
const axelarAPIEndpoint = this.getAxelarEndpoint(sourceChainId);
|
|
37085
|
+
const unpaidGasStatus = [GasPaidStatus.GAS_UNPAID, GasPaidStatus.GAS_PAID_NOT_ENOUGH_GAS];
|
|
37086
|
+
const abiCoder = new AbiCoder();
|
|
37087
|
+
for (const transaction of transactions) {
|
|
37088
|
+
statusPromises.push(queryTransactionStatus(axelarAPIEndpoint, transaction.txHash));
|
|
37089
|
+
}
|
|
37090
|
+
let statusResponses;
|
|
37091
|
+
try {
|
|
37092
|
+
statusResponses = await Promise.all(statusPromises);
|
|
37093
|
+
}
|
|
37094
|
+
catch (err) {
|
|
37095
|
+
throw new BridgeError(`Failed to fetch the Axelar Status with the reason: ${err}`, BridgeErrorType.AXELAR_GAS_ESTIMATE_FAILED);
|
|
37047
37096
|
}
|
|
37048
|
-
const flowRatePromises = [];
|
|
37049
|
-
const flowRateLengthPromises = [];
|
|
37050
|
-
const flowRatePromisesReceivers = [];
|
|
37051
37097
|
for (let i = 0, l = statusResponses.length; i < l; i++) {
|
|
37052
37098
|
let metaStatus;
|
|
37053
37099
|
// consolidate axelar statuses to our own simplified metaStatus
|
|
@@ -37081,7 +37127,7 @@ class TokenBridge {
|
|
|
37081
37127
|
}
|
|
37082
37128
|
}
|
|
37083
37129
|
let txItem = {
|
|
37084
|
-
txHash:
|
|
37130
|
+
txHash: transactions[i].txHash,
|
|
37085
37131
|
status: metaStatus,
|
|
37086
37132
|
data: {
|
|
37087
37133
|
gmpResponse: statusResponses[i].status,
|
|
@@ -37098,61 +37144,9 @@ class TokenBridge {
|
|
|
37098
37144
|
amount: decodedData[4],
|
|
37099
37145
|
};
|
|
37100
37146
|
}
|
|
37101
|
-
|
|
37102
|
-
if (metaStatus === StatusResponse.COMPLETE
|
|
37103
|
-
&& isWithdraw && txItem.recipient) {
|
|
37104
|
-
// consolidate the calls we have to make to the flow rate by receiver
|
|
37105
|
-
if (flowRatePromiseIndex === -1) {
|
|
37106
|
-
flowRatePromisesReceivers.push(txItem.recipient);
|
|
37107
|
-
flowRatePromiseIndex = flowRatePromisesReceivers.length - 1;
|
|
37108
|
-
}
|
|
37109
|
-
txItem.data.flowRatePromiseIndex = flowRatePromiseIndex;
|
|
37110
|
-
}
|
|
37111
|
-
txStatusResponse.transactions.push(txItem);
|
|
37147
|
+
txStatusItems.push(txItem);
|
|
37112
37148
|
} // for
|
|
37113
|
-
|
|
37114
|
-
flowRateLengthPromises.push(rootBridge.getPendingWithdrawalsLength(flowRateReceiver));
|
|
37115
|
-
}
|
|
37116
|
-
let flowRateLengthResponses = [];
|
|
37117
|
-
try {
|
|
37118
|
-
flowRateLengthResponses = await Promise.all(flowRateLengthPromises);
|
|
37119
|
-
}
|
|
37120
|
-
catch (err) {
|
|
37121
|
-
throw new BridgeError(`Failed to fetch the Flow Rate pending lengths with the reason: ${err}`, BridgeErrorType.FLOW_RATE_ERROR);
|
|
37122
|
-
}
|
|
37123
|
-
for (let i = 0, l = flowRatePromisesReceivers.length; i < l; i++) {
|
|
37124
|
-
const indices = [];
|
|
37125
|
-
const indicesLength = flowRateLengthResponses[i].toNumber();
|
|
37126
|
-
for (let j = 0; j < indicesLength; j++) {
|
|
37127
|
-
indices.push(j);
|
|
37128
|
-
}
|
|
37129
|
-
flowRatePromises.push(rootBridge.getPendingWithdrawals(flowRatePromisesReceivers[i], indices));
|
|
37130
|
-
}
|
|
37131
|
-
let flowRateResponses = [];
|
|
37132
|
-
if (flowRatePromises.length > 0) {
|
|
37133
|
-
try {
|
|
37134
|
-
flowRateResponses = await Promise.all(flowRatePromises);
|
|
37135
|
-
}
|
|
37136
|
-
catch (err) {
|
|
37137
|
-
throw new BridgeError(`Failed to fetch the Flow Rate statuses with the reason: ${err}`, BridgeErrorType.FLOW_RATE_ERROR);
|
|
37138
|
-
}
|
|
37139
|
-
}
|
|
37140
|
-
for (const txStatusRes of txStatusResponse.transactions) {
|
|
37141
|
-
if (txStatusRes.data.flowRatePromiseIndex !== -1 && flowRateResponses[txStatusRes.data.flowRatePromiseIndex]) {
|
|
37142
|
-
const flowRatedTx = flowRateResponses[txStatusRes.data.flowRatePromiseIndex].find((el) => (el.amount.toString() === txStatusRes.amount.toString()
|
|
37143
|
-
&& el.token === txStatusRes.token
|
|
37144
|
-
&& el.withdrawer === txStatusRes.sender));
|
|
37145
|
-
if (flowRatedTx) {
|
|
37146
|
-
txStatusRes.status = StatusResponse.FLOW_RATE_CONTROLLED;
|
|
37147
|
-
txStatusRes.data = {
|
|
37148
|
-
timestamp: flowRatedTx.timestamp.toString(),
|
|
37149
|
-
};
|
|
37150
|
-
}
|
|
37151
|
-
}
|
|
37152
|
-
delete txStatusRes.data.flowRatePromiseIndex;
|
|
37153
|
-
}
|
|
37154
|
-
// Return the tx status response
|
|
37155
|
-
return txStatusResponse;
|
|
37149
|
+
return txStatusItems;
|
|
37156
37150
|
}
|
|
37157
37151
|
/**
|
|
37158
37152
|
* Queries for the information about which tokens are flowrated and how long the delay is.
|
|
@@ -37178,6 +37172,7 @@ class TokenBridge {
|
|
|
37178
37172
|
token = ETHEREUM_NATIVE_TOKEN_ADDRESS;
|
|
37179
37173
|
}
|
|
37180
37174
|
contractPromises.push(rootBridge.flowRateBuckets(token));
|
|
37175
|
+
contractPromises.push(rootBridge.largeTransferThresholds(token));
|
|
37181
37176
|
}
|
|
37182
37177
|
let contractPromisesRes;
|
|
37183
37178
|
try {
|
|
@@ -37187,19 +37182,25 @@ class TokenBridge {
|
|
|
37187
37182
|
throw new BridgeError('unable to query contract for flowrate info', BridgeErrorType.INTERNAL_ERROR);
|
|
37188
37183
|
}
|
|
37189
37184
|
const tokensRes = {};
|
|
37190
|
-
|
|
37185
|
+
const withdrawalQueueActivated = contractPromisesRes[0];
|
|
37186
|
+
const withdrawalDelay = contractPromisesRes[1].toNumber();
|
|
37187
|
+
// remove first 2 items from promise all response
|
|
37188
|
+
contractPromisesRes.splice(0, 2);
|
|
37189
|
+
// the remaining items should be sets of 2 per token
|
|
37191
37190
|
for (let i = 0, l = req.tokens.length; i < l; i++) {
|
|
37191
|
+
const shifter = i * 2;
|
|
37192
37192
|
tokensRes[req.tokens[i]] = {
|
|
37193
|
-
capacity: contractPromisesRes[
|
|
37194
|
-
depth: contractPromisesRes[
|
|
37195
|
-
refillTime: contractPromisesRes[
|
|
37196
|
-
refillRate: contractPromisesRes[
|
|
37193
|
+
capacity: contractPromisesRes[shifter].capacity,
|
|
37194
|
+
depth: contractPromisesRes[shifter].depth,
|
|
37195
|
+
refillTime: contractPromisesRes[shifter].refillTime.toNumber(),
|
|
37196
|
+
refillRate: contractPromisesRes[shifter].refillRate,
|
|
37197
|
+
largeTransferThreshold: contractPromisesRes[shifter + 1],
|
|
37197
37198
|
};
|
|
37198
37199
|
}
|
|
37199
37200
|
// Return the token mappings
|
|
37200
37201
|
return {
|
|
37201
|
-
withdrawalQueueActivated
|
|
37202
|
-
withdrawalDelay
|
|
37202
|
+
withdrawalQueueActivated,
|
|
37203
|
+
withdrawalDelay,
|
|
37203
37204
|
tokens: tokensRes,
|
|
37204
37205
|
};
|
|
37205
37206
|
}
|
|
@@ -37246,6 +37247,7 @@ class TokenBridge {
|
|
|
37246
37247
|
canWithdraw: true,
|
|
37247
37248
|
};
|
|
37248
37249
|
}
|
|
37250
|
+
pendingWithdrawals.pending[i].recipient = req.recipient;
|
|
37249
37251
|
pendingWithdrawals.pending[i].withdrawer = pending[i].withdrawer;
|
|
37250
37252
|
pendingWithdrawals.pending[i].token = pending[i].token;
|
|
37251
37253
|
pendingWithdrawals.pending[i].amount = pending[i].amount;
|
|
@@ -37289,6 +37291,7 @@ class TokenBridge {
|
|
|
37289
37291
|
pendingWithdrawal: {
|
|
37290
37292
|
canWithdraw: false,
|
|
37291
37293
|
withdrawer: pending[0].withdrawer,
|
|
37294
|
+
recipient: req.recipient,
|
|
37292
37295
|
token: pending[0].token,
|
|
37293
37296
|
amount: pending[0].amount,
|
|
37294
37297
|
timeoutStart: pending[0].timestamp.toNumber(),
|
|
@@ -37302,6 +37305,7 @@ class TokenBridge {
|
|
|
37302
37305
|
pendingWithdrawal: {
|
|
37303
37306
|
canWithdraw: true,
|
|
37304
37307
|
withdrawer: pending[0].withdrawer,
|
|
37308
|
+
recipient: req.recipient,
|
|
37305
37309
|
token: pending[0].token,
|
|
37306
37310
|
amount: pending[0].amount,
|
|
37307
37311
|
timeoutStart: pending[0].timestamp.toNumber(),
|
|
@@ -37327,10 +37331,38 @@ class TokenBridge {
|
|
|
37327
37331
|
*/
|
|
37328
37332
|
async getTokenMapping(req) {
|
|
37329
37333
|
// eslint-disable-next-line no-console
|
|
37330
|
-
|
|
37334
|
+
if (req.rootToken.toUpperCase() === 'NATIVE'
|
|
37335
|
+
|| req.rootToken === this.config.bridgeContracts.rootChainWrappedETH) {
|
|
37336
|
+
const childBridge = await withBridgeError(async () => {
|
|
37337
|
+
const contract = new Contract(this.config.bridgeContracts.childERC20Bridge, CHILD_ERC20_BRIDGE, this.config.childProvider);
|
|
37338
|
+
return contract;
|
|
37339
|
+
}, BridgeErrorType.INTERNAL_ERROR);
|
|
37340
|
+
const childETHToken = await childBridge.childETHToken();
|
|
37341
|
+
return {
|
|
37342
|
+
rootToken: req.rootToken,
|
|
37343
|
+
childToken: childETHToken,
|
|
37344
|
+
};
|
|
37345
|
+
}
|
|
37346
|
+
const rootBridge = await withBridgeError(async () => {
|
|
37347
|
+
const contract = new Contract(this.config.bridgeContracts.rootERC20BridgeFlowRate, ROOT_ERC20_BRIDGE_FLOW_RATE, this.config.rootProvider);
|
|
37348
|
+
return contract;
|
|
37349
|
+
}, BridgeErrorType.INTERNAL_ERROR);
|
|
37350
|
+
const rootTokenChildAddress = await rootBridge.rootTokenToChildToken(req.rootToken);
|
|
37351
|
+
if (rootTokenChildAddress === AddressZero) {
|
|
37352
|
+
return {
|
|
37353
|
+
rootToken: req.rootToken,
|
|
37354
|
+
childToken: null,
|
|
37355
|
+
};
|
|
37356
|
+
}
|
|
37357
|
+
if (rootTokenChildAddress === req.rootToken) {
|
|
37358
|
+
return {
|
|
37359
|
+
rootToken: req.rootToken,
|
|
37360
|
+
childToken: 'NATIVE',
|
|
37361
|
+
};
|
|
37362
|
+
}
|
|
37331
37363
|
return {
|
|
37332
|
-
rootToken:
|
|
37333
|
-
childToken:
|
|
37364
|
+
rootToken: req.rootToken,
|
|
37365
|
+
childToken: rootTokenChildAddress,
|
|
37334
37366
|
};
|
|
37335
37367
|
}
|
|
37336
37368
|
}
|
|
@@ -41256,12 +41288,14 @@ const validateProviderDefaults = {
|
|
|
41256
41288
|
* @property {string} SUCCESS - If checkout succeeded as the transactions were able to be processed
|
|
41257
41289
|
* @property {string} FAILED - If checkout failed due to transactions not settling on chain
|
|
41258
41290
|
* @property {string} INSUFFICIENT_FUNDS - If checkout failed due to insufficient funds
|
|
41291
|
+
* @property {string} FULFILLMENTS_UNSETTLED - If checkout succeeded but the fulfillment transactions are not yet settled
|
|
41259
41292
|
*/
|
|
41260
41293
|
var CheckoutStatus;
|
|
41261
41294
|
(function (CheckoutStatus) {
|
|
41262
41295
|
CheckoutStatus["SUCCESS"] = "SUCCESS";
|
|
41263
41296
|
CheckoutStatus["FAILED"] = "FAILED";
|
|
41264
41297
|
CheckoutStatus["INSUFFICIENT_FUNDS"] = "INSUFFICIENT_FUNDS";
|
|
41298
|
+
CheckoutStatus["FULFILLMENTS_UNSETTLED"] = "FULFILLMENTS_UNSETTLED";
|
|
41265
41299
|
})(CheckoutStatus || (CheckoutStatus = {}));
|
|
41266
41300
|
/**
|
|
41267
41301
|
* An enum representing the item types
|
|
@@ -41936,7 +41970,7 @@ const GAS_OVERRIDES = {
|
|
|
41936
41970
|
maxPriorityFeePerGas: BigNumber$1.from(101e9),
|
|
41937
41971
|
};
|
|
41938
41972
|
|
|
41939
|
-
const SDK_VERSION_MARKER = '0.44.
|
|
41973
|
+
const SDK_VERSION_MARKER = '0.44.2';
|
|
41940
41974
|
// This SDK version is replaced by the `yarn build` command ran on the root level
|
|
41941
41975
|
const globalPackageVersion = () => SDK_VERSION_MARKER;
|
|
41942
41976
|
|
|
@@ -44997,7 +45031,9 @@ const getTransactionOrGas = (gasLimit, fulfillmentTransactions) => {
|
|
|
44997
45031
|
},
|
|
44998
45032
|
};
|
|
44999
45033
|
};
|
|
45000
|
-
const buy = async (config, provider, orders
|
|
45034
|
+
const buy = async (config, provider, orders, overrides = {
|
|
45035
|
+
waitFulfillmentSettlements: true,
|
|
45036
|
+
}) => {
|
|
45001
45037
|
if (orders.length === 0) {
|
|
45002
45038
|
throw new CheckoutError('No orders were provided to the orders array. Please provide at least one order.', CheckoutErrorType.FULFILL_ORDER_LISTING_ERROR);
|
|
45003
45039
|
}
|
|
@@ -45125,18 +45161,35 @@ const buy = async (config, provider, orders) => {
|
|
|
45125
45161
|
message: err.message,
|
|
45126
45162
|
});
|
|
45127
45163
|
}
|
|
45128
|
-
|
|
45129
|
-
|
|
45164
|
+
if (overrides.waitFulfillmentSettlements) {
|
|
45165
|
+
const fulfillmentResult = await signFulfillmentTransactions(provider, unsignedFulfillmentTransactions);
|
|
45166
|
+
if (fulfillmentResult.type === SignTransactionStatusType.FAILED) {
|
|
45167
|
+
return {
|
|
45168
|
+
status: CheckoutStatus.FAILED,
|
|
45169
|
+
transactionHash: fulfillmentResult.transactionHash,
|
|
45170
|
+
reason: fulfillmentResult.reason,
|
|
45171
|
+
smartCheckoutResult,
|
|
45172
|
+
};
|
|
45173
|
+
}
|
|
45130
45174
|
return {
|
|
45131
|
-
status: CheckoutStatus.
|
|
45132
|
-
transactionHash: fulfillmentResult.transactionHash,
|
|
45133
|
-
reason: fulfillmentResult.reason,
|
|
45175
|
+
status: CheckoutStatus.SUCCESS,
|
|
45134
45176
|
smartCheckoutResult,
|
|
45135
45177
|
};
|
|
45136
45178
|
}
|
|
45179
|
+
let transactions;
|
|
45180
|
+
try {
|
|
45181
|
+
const response = await Promise.all(unsignedFulfillmentTransactions.map((transaction) => sendTransaction(provider, transaction)));
|
|
45182
|
+
transactions = response.map((result) => result.transactionResponse);
|
|
45183
|
+
}
|
|
45184
|
+
catch (err) {
|
|
45185
|
+
throw new CheckoutError('An error occurred while executing the fulfillment transaction', CheckoutErrorType.EXECUTE_FULFILLMENT_TRANSACTION_ERROR, {
|
|
45186
|
+
message: err.message,
|
|
45187
|
+
});
|
|
45188
|
+
}
|
|
45137
45189
|
return {
|
|
45138
|
-
status: CheckoutStatus.
|
|
45190
|
+
status: CheckoutStatus.FULFILLMENTS_UNSETTLED,
|
|
45139
45191
|
smartCheckoutResult,
|
|
45192
|
+
transactions,
|
|
45140
45193
|
};
|
|
45141
45194
|
}
|
|
45142
45195
|
return {
|
|
@@ -45713,7 +45766,7 @@ class Checkout {
|
|
|
45713
45766
|
console.warn('This endpoint currently only processes the first order in the array.');
|
|
45714
45767
|
}
|
|
45715
45768
|
const web3Provider = await validateProvider(this.config, params.provider);
|
|
45716
|
-
return await buy(this.config, web3Provider, params.orders);
|
|
45769
|
+
return await buy(this.config, web3Provider, params.orders, params.overrides);
|
|
45717
45770
|
}
|
|
45718
45771
|
/**
|
|
45719
45772
|
* Determines the requirements for performing a sell.
|
package/dist/orderbook.d.ts
CHANGED
|
@@ -1653,4 +1653,4 @@ declare const constants: {
|
|
|
1653
1653
|
estimatedFulfillmentGasGwei: number;
|
|
1654
1654
|
};
|
|
1655
1655
|
|
|
1656
|
-
export { Action, ActionType, CancelOrdersOnChainResponse, CreateListingParams, ERC20Item, ERC721Item, Fee, FeeType, FeeValue, FulfillBulkOrdersInsufficientBalanceResponse, FulfillBulkOrdersResponse, FulfillBulkOrdersSufficientBalanceResponse, FulfillOrderResponse, FulfillmentListing, ListListingsParams, ListListingsResult, ListTradesParams, ListTradesResult, ListingResult, NativeItem, Order, OrderStatusName, Orderbook, Page, PrepareCancelOrdersResponse, PrepareListingParams, PrepareListingResponse, RoyaltyInfo, SignableAction, SignablePurpose, Trade, TradeResult, TransactionAction, TransactionBuilder, TransactionPurpose, UnfulfillableOrder, constants };
|
|
1656
|
+
export { Action, ActionType, CancelOrdersOnChainResponse, CreateListingParams, ERC20Item, ERC721Item, Fee, FeeType, FeeValue, FulfillBulkOrdersInsufficientBalanceResponse, FulfillBulkOrdersResponse, FulfillBulkOrdersSufficientBalanceResponse, FulfillOrderResponse, FulfillmentListing, ListListingsParams, ListListingsResult, ListTradesParams, ListTradesResult, ListingResult, NativeItem, Order, OrderStatusName, Orderbook, OrderbookModuleConfiguration, OrderbookOverrides, Page, PrepareCancelOrdersResponse, PrepareListingParams, PrepareListingResponse, RoyaltyInfo, SignableAction, SignablePurpose, Trade, TradeResult, TransactionAction, TransactionBuilder, TransactionPurpose, UnfulfillableOrder, constants };
|
package/dist/passport.js
CHANGED
|
@@ -8724,7 +8724,7 @@ class MultiRollupApiClients {
|
|
|
8724
8724
|
}
|
|
8725
8725
|
|
|
8726
8726
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
8727
|
-
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.44.
|
|
8727
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.44.2' };
|
|
8728
8728
|
const createConfig = ({ basePath, headers, }) => {
|
|
8729
8729
|
if (!basePath.trim()) {
|
|
8730
8730
|
throw Error('basePath can not be empty');
|
|
@@ -8792,7 +8792,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
8792
8792
|
chainID,
|
|
8793
8793
|
coreContractAddress,
|
|
8794
8794
|
registrationContractAddress,
|
|
8795
|
-
sdkVersion: 'ts-immutable-sdk-0.44.
|
|
8795
|
+
sdkVersion: 'ts-immutable-sdk-0.44.2',
|
|
8796
8796
|
});
|
|
8797
8797
|
/**
|
|
8798
8798
|
* Sets `sdkVersion` at the time of build
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imtbl/sdk",
|
|
3
3
|
"description": "Immutable Unified SDK",
|
|
4
|
-
"version": "0.44.
|
|
4
|
+
"version": "0.44.2",
|
|
5
5
|
"author": "Immutable",
|
|
6
6
|
"browser": "./dist/index.browser.js",
|
|
7
7
|
"bugs": "https://github.com/immutable/ts-immutable-sdk/issues",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@0xsequence/abi": "^1.4.3",
|
|
10
10
|
"@0xsequence/core": "^1.4.3",
|
|
11
|
-
"@biom3/design-tokens": "0.2.
|
|
12
|
-
"@biom3/react": "^0.19.
|
|
11
|
+
"@biom3/design-tokens": "^0.2.10",
|
|
12
|
+
"@biom3/react": "^0.19.40",
|
|
13
13
|
"@ethersproject/abi": "^5.7.0",
|
|
14
14
|
"@ethersproject/abstract-signer": "^5.7.0",
|
|
15
15
|
"@ethersproject/providers": "^5.7.2",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"@imtbl/core-sdk": "^2.4.0",
|
|
18
18
|
"@imtbl/react-analytics": "0.2.1-alpha",
|
|
19
19
|
"@jest/globals": "^29.5.0",
|
|
20
|
-
"@magic-ext/oidc": "
|
|
20
|
+
"@magic-ext/oidc": "4.2.0",
|
|
21
21
|
"@metamask/detect-provider": "^2.0.0",
|
|
22
22
|
"@opensea/seaport-js": "2.0.7",
|
|
23
23
|
"@uniswap/router-sdk": "^1.4.0",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"i18next-browser-languagedetector": "^7.2.0",
|
|
36
36
|
"jwt-decode": "^3.1.2",
|
|
37
37
|
"magic-sdk": "^21.2.0",
|
|
38
|
-
"oidc-client-ts": "
|
|
38
|
+
"oidc-client-ts": "2.2.1",
|
|
39
39
|
"os-browserify": "^0.3.0",
|
|
40
40
|
"pako": "^2.1.0",
|
|
41
41
|
"react-i18next": "^13.5.0",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
},
|
|
128
128
|
"repository": "immutable/ts-immutable-sdk.git",
|
|
129
129
|
"resolutions": {
|
|
130
|
-
"@biom3/design-tokens": "0.2.
|
|
130
|
+
"@biom3/design-tokens": "^0.2.10",
|
|
131
131
|
"@openzeppelin/contracts": "3.4.2-solc-0.7"
|
|
132
132
|
},
|
|
133
133
|
"scripts": {
|