@imtbl/sdk 0.44.2 → 0.44.3
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 +2 -2
- package/dist/checkout.d.ts +4 -1
- package/dist/checkout.js +68 -51
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +4 -4
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +70 -53
- package/dist/index.d.ts +4 -1
- package/dist/index.js +70 -53
- package/dist/passport.js +2 -2
- package/package.json +1 -1
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.3' };
|
|
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.3',
|
|
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.3',
|
|
11134
11134
|
});
|
|
11135
11135
|
/**
|
|
11136
11136
|
* Sets `sdkVersion` at the time of build
|
|
@@ -36426,6 +36426,7 @@ var BridgeMethodsGasLimit;
|
|
|
36426
36426
|
BridgeMethodsGasLimit[BridgeMethodsGasLimit["MAP_TOKEN_SOURCE"] = 200000] = "MAP_TOKEN_SOURCE";
|
|
36427
36427
|
BridgeMethodsGasLimit[BridgeMethodsGasLimit["MAP_TOKEN_DESTINATION"] = 200000] = "MAP_TOKEN_DESTINATION";
|
|
36428
36428
|
BridgeMethodsGasLimit[BridgeMethodsGasLimit["FINALISE_WITHDRAWAL"] = 200000] = "FINALISE_WITHDRAWAL";
|
|
36429
|
+
BridgeMethodsGasLimit[BridgeMethodsGasLimit["APPROVE_TOKEN"] = 55000] = "APPROVE_TOKEN";
|
|
36429
36430
|
})(BridgeMethodsGasLimit || (BridgeMethodsGasLimit = {}));
|
|
36430
36431
|
var StatusResponse;
|
|
36431
36432
|
(function (StatusResponse) {
|
|
@@ -36613,8 +36614,12 @@ class TokenBridge {
|
|
|
36613
36614
|
throw new BridgeError(`Finalised withdrawals must be on the root chain (${this.config.bridgeInstance.rootChainID})`, BridgeErrorType.UNSUPPORTED_ERROR);
|
|
36614
36615
|
}
|
|
36615
36616
|
let sourceChainGas = BigNumber.from(0);
|
|
36617
|
+
let approvalFee = BigNumber.from(0);
|
|
36616
36618
|
let bridgeFee = BigNumber.from(0);
|
|
36617
36619
|
const imtblFee = BigNumber.from(0);
|
|
36620
|
+
if ('token' in req && req.token !== 'NATIVE') {
|
|
36621
|
+
approvalFee = await this.getGasEstimates(this.config.rootProvider, BridgeMethodsGasLimit.APPROVE_TOKEN);
|
|
36622
|
+
}
|
|
36618
36623
|
if (req.action === BridgeFeeActions.FINALISE_WITHDRAWAL) {
|
|
36619
36624
|
sourceChainGas = await this.getGasEstimates(this.config.rootProvider, BridgeMethodsGasLimit.FINALISE_WITHDRAWAL);
|
|
36620
36625
|
}
|
|
@@ -36625,9 +36630,10 @@ class TokenBridge {
|
|
|
36625
36630
|
const feeResult = await this.calculateBridgeFee(req.sourceChainId, req.destinationChainId, BridgeMethodsGasLimit[`${req.action}_DESTINATION`], req.gasMultiplier);
|
|
36626
36631
|
bridgeFee = feeResult.bridgeFee;
|
|
36627
36632
|
}
|
|
36628
|
-
const totalFees = sourceChainGas.add(bridgeFee).add(imtblFee);
|
|
36633
|
+
const totalFees = sourceChainGas.add(approvalFee).add(bridgeFee).add(imtblFee);
|
|
36629
36634
|
return {
|
|
36630
36635
|
sourceChainGas,
|
|
36636
|
+
approvalFee,
|
|
36631
36637
|
bridgeFee,
|
|
36632
36638
|
imtblFee,
|
|
36633
36639
|
totalFees,
|
|
@@ -36857,6 +36863,8 @@ class TokenBridge {
|
|
|
36857
36863
|
gasMultiplier,
|
|
36858
36864
|
sourceChainId,
|
|
36859
36865
|
destinationChainId,
|
|
36866
|
+
token,
|
|
36867
|
+
amount,
|
|
36860
36868
|
});
|
|
36861
36869
|
const canReceive = await this.checkReceiver(provider, recipient);
|
|
36862
36870
|
if (!canReceive) {
|
|
@@ -41606,7 +41614,7 @@ async function switchWalletNetwork(config, web3Provider, chainId) {
|
|
|
41606
41614
|
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
41607
41615
|
}
|
|
41608
41616
|
catch (err) {
|
|
41609
|
-
throw new CheckoutError('User cancelled add network request', CheckoutErrorType.USER_REJECTED_REQUEST_ERROR);
|
|
41617
|
+
throw new CheckoutError('User cancelled add network request', CheckoutErrorType.USER_REJECTED_REQUEST_ERROR, { error: err });
|
|
41610
41618
|
}
|
|
41611
41619
|
}
|
|
41612
41620
|
else {
|
|
@@ -41970,7 +41978,7 @@ const GAS_OVERRIDES = {
|
|
|
41970
41978
|
maxPriorityFeePerGas: BigNumber$1.from(101e9),
|
|
41971
41979
|
};
|
|
41972
41980
|
|
|
41973
|
-
const SDK_VERSION_MARKER = '0.44.
|
|
41981
|
+
const SDK_VERSION_MARKER = '0.44.3';
|
|
41974
41982
|
// This SDK version is replaced by the `yarn build` command ran on the root level
|
|
41975
41983
|
const globalPackageVersion = () => SDK_VERSION_MARKER;
|
|
41976
41984
|
|
|
@@ -42000,8 +42008,8 @@ class RemoteConfigFetcher {
|
|
|
42000
42008
|
try {
|
|
42001
42009
|
responseData = JSON.parse(response.data);
|
|
42002
42010
|
}
|
|
42003
|
-
catch (
|
|
42004
|
-
throw new CheckoutError('Invalid configuration', CheckoutErrorType.API_ERROR);
|
|
42011
|
+
catch (err) {
|
|
42012
|
+
throw new CheckoutError('Invalid configuration', CheckoutErrorType.API_ERROR, { error: err });
|
|
42005
42013
|
}
|
|
42006
42014
|
}
|
|
42007
42015
|
return responseData;
|
|
@@ -42014,7 +42022,7 @@ class RemoteConfigFetcher {
|
|
|
42014
42022
|
response = await this.httpClient.get(`${this.getEndpoint()}/${this.version}/config`);
|
|
42015
42023
|
}
|
|
42016
42024
|
catch (err) {
|
|
42017
|
-
throw new CheckoutError(`Error: ${err.message}`, CheckoutErrorType.API_ERROR);
|
|
42025
|
+
throw new CheckoutError(`Error: ${err.message}`, CheckoutErrorType.API_ERROR, { error: err });
|
|
42018
42026
|
}
|
|
42019
42027
|
// Ensure that the configuration is valid
|
|
42020
42028
|
this.configCache = this.parseResponse(response);
|
|
@@ -42028,7 +42036,7 @@ class RemoteConfigFetcher {
|
|
|
42028
42036
|
response = await this.httpClient.get(`${this.getEndpoint()}/${this.version}/config/tokens`);
|
|
42029
42037
|
}
|
|
42030
42038
|
catch (err) {
|
|
42031
|
-
throw new CheckoutError(`Error: ${err.message}`, CheckoutErrorType.API_ERROR);
|
|
42039
|
+
throw new CheckoutError(`Error: ${err.message}`, CheckoutErrorType.API_ERROR, { error: err });
|
|
42032
42040
|
}
|
|
42033
42041
|
// Ensure that the configuration is valid
|
|
42034
42042
|
this.tokensCache = this.parseResponse(response);
|
|
@@ -42391,7 +42399,7 @@ const getIndexerBalance = async (config, walletAddress, chainId, filterTokens) =
|
|
|
42391
42399
|
// means we are safe to assume that a 404 is a missing wallet due to inactivity
|
|
42392
42400
|
// or simply an incorrect wallet address was provided.
|
|
42393
42401
|
if (err?.code !== HttpStatusCode$3.NotFound) {
|
|
42394
|
-
throw new CheckoutError(err.message || 'InternalServerError | getTokensByWalletAddress', CheckoutErrorType.GET_INDEXER_BALANCE_ERROR, err);
|
|
42402
|
+
throw new CheckoutError(err.message || 'InternalServerError | getTokensByWalletAddress', CheckoutErrorType.GET_INDEXER_BALANCE_ERROR, { error: err });
|
|
42395
42403
|
}
|
|
42396
42404
|
}
|
|
42397
42405
|
};
|
|
@@ -42410,7 +42418,7 @@ const getIndexerBalance = async (config, walletAddress, chainId, filterTokens) =
|
|
|
42410
42418
|
// means we are safe to assume that a 404 is a missing wallet due to inactivity
|
|
42411
42419
|
// or simply an incorrect wallet address was provided.
|
|
42412
42420
|
if (err?.code !== HttpStatusCode$3.NotFound) {
|
|
42413
|
-
throw new CheckoutError(err.message || 'InternalServerError | getNativeTokenByWalletAddress', CheckoutErrorType.GET_INDEXER_BALANCE_ERROR, err);
|
|
42421
|
+
throw new CheckoutError(err.message || 'InternalServerError | getNativeTokenByWalletAddress', CheckoutErrorType.GET_INDEXER_BALANCE_ERROR, { error: err });
|
|
42414
42422
|
}
|
|
42415
42423
|
}
|
|
42416
42424
|
};
|
|
@@ -42523,6 +42531,7 @@ async function checkIsWalletConnected(web3Provider) {
|
|
|
42523
42531
|
}
|
|
42524
42532
|
catch (err) {
|
|
42525
42533
|
throw new CheckoutError('Check wallet connection request failed', CheckoutErrorType.PROVIDER_REQUEST_FAILED_ERROR, {
|
|
42534
|
+
error: err,
|
|
42526
42535
|
rpcMethod: WalletAction.CHECK_CONNECTION,
|
|
42527
42536
|
});
|
|
42528
42537
|
}
|
|
@@ -42615,7 +42624,7 @@ async function validateProvider(config, web3Provider, validateProviderOptions) {
|
|
|
42615
42624
|
}
|
|
42616
42625
|
}
|
|
42617
42626
|
catch (err) {
|
|
42618
|
-
throw new CheckoutError('Unable to detect the web3Provider network', CheckoutErrorType.WEB3_PROVIDER_ERROR);
|
|
42627
|
+
throw new CheckoutError('Unable to detect the web3Provider network', CheckoutErrorType.WEB3_PROVIDER_ERROR, { error: err });
|
|
42619
42628
|
}
|
|
42620
42629
|
if (web3ChainId !== underlyingChainId && !options.allowMistmatchedChainId) {
|
|
42621
42630
|
throw new CheckoutError('Your wallet has changed network, please switch to a supported network', CheckoutErrorType.WEB3_PROVIDER_ERROR);
|
|
@@ -42667,15 +42676,15 @@ const sendTransaction = async (web3Provider, transaction) => {
|
|
|
42667
42676
|
}
|
|
42668
42677
|
catch (err) {
|
|
42669
42678
|
if (err.code === ethers.errors.INSUFFICIENT_FUNDS) {
|
|
42670
|
-
throw new CheckoutError(err.message, CheckoutErrorType.INSUFFICIENT_FUNDS);
|
|
42679
|
+
throw new CheckoutError(err.message, CheckoutErrorType.INSUFFICIENT_FUNDS, { error: err });
|
|
42671
42680
|
}
|
|
42672
42681
|
if (err.code === ethers.errors.ACTION_REJECTED) {
|
|
42673
|
-
throw new CheckoutError(err.message, CheckoutErrorType.USER_REJECTED_REQUEST_ERROR);
|
|
42682
|
+
throw new CheckoutError(err.message, CheckoutErrorType.USER_REJECTED_REQUEST_ERROR, { error: err });
|
|
42674
42683
|
}
|
|
42675
42684
|
if (err.code === ethers.errors.UNPREDICTABLE_GAS_LIMIT) {
|
|
42676
|
-
throw new CheckoutError(err.message, CheckoutErrorType.UNPREDICTABLE_GAS_LIMIT);
|
|
42685
|
+
throw new CheckoutError(err.message, CheckoutErrorType.UNPREDICTABLE_GAS_LIMIT, { error: err });
|
|
42677
42686
|
}
|
|
42678
|
-
throw new CheckoutError(err.message, CheckoutErrorType.TRANSACTION_FAILED);
|
|
42687
|
+
throw new CheckoutError(err.message, CheckoutErrorType.TRANSACTION_FAILED, { error: err });
|
|
42679
42688
|
}
|
|
42680
42689
|
};
|
|
42681
42690
|
|
|
@@ -42688,6 +42697,8 @@ async function getBridgeFeeEstimate$1(tokenBridge, fromChainId, toChainId, confi
|
|
|
42688
42697
|
gasMultiplier: 1.1,
|
|
42689
42698
|
sourceChainId: fromChainId.toString(),
|
|
42690
42699
|
destinationChainId: toChainId.toString(),
|
|
42700
|
+
token: NATIVE.toUpperCase(),
|
|
42701
|
+
amount: BigNumber$1.from(0),
|
|
42691
42702
|
});
|
|
42692
42703
|
}
|
|
42693
42704
|
|
|
@@ -42767,6 +42778,7 @@ async function bridgeToL2GasEstimator(readOnlyProviders, config) {
|
|
|
42767
42778
|
gasEstimateType: GasEstimateType.BRIDGE_TO_L2,
|
|
42768
42779
|
fees: {
|
|
42769
42780
|
sourceChainGas: BigNumber$1.from(0),
|
|
42781
|
+
approvalFee: BigNumber$1.from(0),
|
|
42770
42782
|
bridgeFee: BigNumber$1.from(0),
|
|
42771
42783
|
imtblFee: BigNumber$1.from(0),
|
|
42772
42784
|
totalFees: BigNumber$1.from(0),
|
|
@@ -42916,7 +42928,7 @@ const getERC20Allowance = async (provider, ownerAddress, contractAddress, spende
|
|
|
42916
42928
|
return await contract.allowance(ownerAddress, spenderAddress);
|
|
42917
42929
|
}
|
|
42918
42930
|
catch (err) {
|
|
42919
|
-
throw new CheckoutError('Failed to get the allowance for ERC20', CheckoutErrorType.GET_ERC20_ALLOWANCE_ERROR, { contractAddress });
|
|
42931
|
+
throw new CheckoutError('Failed to get the allowance for ERC20', CheckoutErrorType.GET_ERC20_ALLOWANCE_ERROR, { contractAddress, error: err });
|
|
42920
42932
|
}
|
|
42921
42933
|
};
|
|
42922
42934
|
// Returns the approval transaction for the ERC20 that the owner can sign
|
|
@@ -42929,8 +42941,8 @@ const getERC20ApprovalTransaction = async (provider, ownerAddress, contractAddre
|
|
|
42929
42941
|
approveTransaction.from = ownerAddress;
|
|
42930
42942
|
return approveTransaction;
|
|
42931
42943
|
}
|
|
42932
|
-
catch {
|
|
42933
|
-
throw new CheckoutError('Failed to get the approval transaction for ERC20', CheckoutErrorType.GET_ERC20_ALLOWANCE_ERROR, { contractAddress });
|
|
42944
|
+
catch (err) {
|
|
42945
|
+
throw new CheckoutError('Failed to get the approval transaction for ERC20', CheckoutErrorType.GET_ERC20_ALLOWANCE_ERROR, { contractAddress, error: err });
|
|
42934
42946
|
}
|
|
42935
42947
|
};
|
|
42936
42948
|
const hasERC20Allowances = async (provider, ownerAddress, itemRequirements) => {
|
|
@@ -43002,7 +43014,12 @@ const getERC721ApprovedForAll = async (provider, ownerAddress, contractAddress,
|
|
|
43002
43014
|
return await contract.isApprovedForAll(ownerAddress, spenderAddress);
|
|
43003
43015
|
}
|
|
43004
43016
|
catch (err) {
|
|
43005
|
-
throw new CheckoutError('Failed to check approval for all ERC721s of collection', CheckoutErrorType.GET_ERC721_ALLOWANCE_ERROR, {
|
|
43017
|
+
throw new CheckoutError('Failed to check approval for all ERC721s of collection', CheckoutErrorType.GET_ERC721_ALLOWANCE_ERROR, {
|
|
43018
|
+
ownerAddress,
|
|
43019
|
+
contractAddress,
|
|
43020
|
+
spenderAddress,
|
|
43021
|
+
error: err,
|
|
43022
|
+
});
|
|
43006
43023
|
}
|
|
43007
43024
|
};
|
|
43008
43025
|
// Returns a populated transaction to approve the ERC721 for the spender.
|
|
@@ -43016,7 +43033,11 @@ const getApproveTransaction = async (provider, ownerAddress, contractAddress, sp
|
|
|
43016
43033
|
}
|
|
43017
43034
|
catch (err) {
|
|
43018
43035
|
throw new CheckoutError('Failed to get the approval transaction for ERC721', CheckoutErrorType.GET_ERC721_ALLOWANCE_ERROR, {
|
|
43019
|
-
id: id.toString(),
|
|
43036
|
+
id: id.toString(),
|
|
43037
|
+
contractAddress,
|
|
43038
|
+
spenderAddress,
|
|
43039
|
+
ownerAddress,
|
|
43040
|
+
error: err,
|
|
43020
43041
|
});
|
|
43021
43042
|
}
|
|
43022
43043
|
};
|
|
@@ -43028,7 +43049,11 @@ const getERC721ApprovedAddress = async (provider, contractAddress, id) => {
|
|
|
43028
43049
|
return await contract.getApproved(id);
|
|
43029
43050
|
}
|
|
43030
43051
|
catch (err) {
|
|
43031
|
-
throw new CheckoutError('Failed to get approved address for ERC721', CheckoutErrorType.GET_ERC721_ALLOWANCE_ERROR, {
|
|
43052
|
+
throw new CheckoutError('Failed to get approved address for ERC721', CheckoutErrorType.GET_ERC721_ALLOWANCE_ERROR, {
|
|
43053
|
+
id: id.toString(),
|
|
43054
|
+
contractAddress,
|
|
43055
|
+
error: err,
|
|
43056
|
+
});
|
|
43032
43057
|
}
|
|
43033
43058
|
};
|
|
43034
43059
|
const convertIdToNumber = (id, contractAddress) => {
|
|
@@ -43356,8 +43381,8 @@ const getTokenBalances = async (config, provider, ownerAddress, itemRequirements
|
|
|
43356
43381
|
const { balances } = await getAllBalances(config, provider, ownerAddress, getL2ChainId(config));
|
|
43357
43382
|
return balances.filter((balance) => tokenMap.get((balance.token.address || NATIVE).toLocaleLowerCase()));
|
|
43358
43383
|
}
|
|
43359
|
-
catch (
|
|
43360
|
-
throw new CheckoutError('Failed to get balances', CheckoutErrorType.GET_BALANCE_ERROR);
|
|
43384
|
+
catch (err) {
|
|
43385
|
+
throw new CheckoutError('Failed to get balances', CheckoutErrorType.GET_BALANCE_ERROR, { error: err });
|
|
43361
43386
|
}
|
|
43362
43387
|
};
|
|
43363
43388
|
/**
|
|
@@ -43395,8 +43420,8 @@ const getERC721Balances = async (provider, ownerAddress, itemRequirements) => {
|
|
|
43395
43420
|
});
|
|
43396
43421
|
});
|
|
43397
43422
|
}
|
|
43398
|
-
catch (
|
|
43399
|
-
throw new CheckoutError('Failed to get ERC721 balances', CheckoutErrorType.GET_ERC721_BALANCE_ERROR);
|
|
43423
|
+
catch (err) {
|
|
43424
|
+
throw new CheckoutError('Failed to get ERC721 balances', CheckoutErrorType.GET_ERC721_BALANCE_ERROR, { error: err });
|
|
43400
43425
|
}
|
|
43401
43426
|
return erc721Balances;
|
|
43402
43427
|
};
|
|
@@ -43466,7 +43491,7 @@ const estimateGas = async (provider, transaction) => {
|
|
|
43466
43491
|
return await provider.estimateGas(transaction);
|
|
43467
43492
|
}
|
|
43468
43493
|
catch (err) {
|
|
43469
|
-
throw new CheckoutError('Failed to estimate gas for transaction', CheckoutErrorType.UNPREDICTABLE_GAS_LIMIT);
|
|
43494
|
+
throw new CheckoutError('Failed to estimate gas for transaction', CheckoutErrorType.UNPREDICTABLE_GAS_LIMIT, { error: err });
|
|
43470
43495
|
}
|
|
43471
43496
|
};
|
|
43472
43497
|
const getGasItemRequirement = (gas, transactionOrGas) => {
|
|
@@ -43530,14 +43555,14 @@ const availabilityService = (isDevelopment, isProduction) => {
|
|
|
43530
43555
|
try {
|
|
43531
43556
|
response = await globalAxios$1.post(`${postEndpoint()}/v1/availability/checkout/swap`);
|
|
43532
43557
|
}
|
|
43533
|
-
catch (
|
|
43558
|
+
catch (err) {
|
|
43534
43559
|
// The request was made and the server responded with a status code
|
|
43535
43560
|
// that falls out of the range of 2xx
|
|
43536
|
-
response =
|
|
43561
|
+
response = err.response;
|
|
43537
43562
|
// If 403 then the service is geo-blocked
|
|
43538
43563
|
if (response.status === 403)
|
|
43539
43564
|
return false;
|
|
43540
|
-
throw new CheckoutError(`Error fetching from api: ${response.status} ${response.statusText}`, CheckoutErrorType.API_ERROR);
|
|
43565
|
+
throw new CheckoutError(`Error fetching from api: ${response.status} ${response.statusText}`, CheckoutErrorType.API_ERROR, { error: err });
|
|
43541
43566
|
}
|
|
43542
43567
|
return true;
|
|
43543
43568
|
};
|
|
@@ -44048,7 +44073,7 @@ const getBridgeFeeEstimate = async (config, readOnlyProviders, fromChainId, toCh
|
|
|
44048
44073
|
};
|
|
44049
44074
|
}
|
|
44050
44075
|
catch (err) {
|
|
44051
|
-
throw new CheckoutError('Error estimating gas for bridge', CheckoutErrorType.BRIDGE_GAS_ESTIMATE_ERROR, {
|
|
44076
|
+
throw new CheckoutError('Error estimating gas for bridge', CheckoutErrorType.BRIDGE_GAS_ESTIMATE_ERROR, { error: err });
|
|
44052
44077
|
}
|
|
44053
44078
|
};
|
|
44054
44079
|
|
|
@@ -44698,7 +44723,7 @@ const routingCalculator = async (config, ownerAddress, balanceRequirements, avai
|
|
|
44698
44723
|
readOnlyProviders = await createReadOnlyProviders(config);
|
|
44699
44724
|
}
|
|
44700
44725
|
catch (err) {
|
|
44701
|
-
throw new CheckoutError('Error occurred while creating read only providers', CheckoutErrorType.PROVIDER_ERROR, {
|
|
44726
|
+
throw new CheckoutError('Error occurred while creating read only providers', CheckoutErrorType.PROVIDER_ERROR, { error: err });
|
|
44702
44727
|
}
|
|
44703
44728
|
const tokenBalances = await measureAsyncExecution(config, 'Time to get token balances inside router', getAllTokenBalances(config, readOnlyProviders, ownerAddress, availableRoutingOptions));
|
|
44704
44729
|
const allowList = await measureAsyncExecution(config, 'Time to get routing allowlist', allowListCheck(config, tokenBalances, availableRoutingOptions));
|
|
@@ -44821,9 +44846,7 @@ const signApprovalTransactions = async (provider, approvalTransactions) => {
|
|
|
44821
44846
|
receipts = await Promise.all(response.map((transaction) => transaction.transactionResponse.wait()));
|
|
44822
44847
|
}
|
|
44823
44848
|
catch (err) {
|
|
44824
|
-
throw new CheckoutError('An error occurred while executing the approval transaction', CheckoutErrorType.EXECUTE_APPROVAL_TRANSACTION_ERROR, {
|
|
44825
|
-
message: err.message,
|
|
44826
|
-
});
|
|
44849
|
+
throw new CheckoutError('An error occurred while executing the approval transaction', CheckoutErrorType.EXECUTE_APPROVAL_TRANSACTION_ERROR, { error: err });
|
|
44827
44850
|
}
|
|
44828
44851
|
for (const receipt of receipts) {
|
|
44829
44852
|
if (receipt.status === 0) {
|
|
@@ -44845,9 +44868,7 @@ const signFulfillmentTransactions = async (provider, fulfillmentTransactions) =>
|
|
|
44845
44868
|
receipts = await Promise.all(response.map((transaction) => transaction.transactionResponse.wait()));
|
|
44846
44869
|
}
|
|
44847
44870
|
catch (err) {
|
|
44848
|
-
throw new CheckoutError('An error occurred while executing the fulfillment transaction', CheckoutErrorType.EXECUTE_FULFILLMENT_TRANSACTION_ERROR, {
|
|
44849
|
-
message: err.message,
|
|
44850
|
-
});
|
|
44871
|
+
throw new CheckoutError('An error occurred while executing the fulfillment transaction', CheckoutErrorType.EXECUTE_FULFILLMENT_TRANSACTION_ERROR, { error: err });
|
|
44851
44872
|
}
|
|
44852
44873
|
for (const receipt of receipts) {
|
|
44853
44874
|
if (receipt.status === 0) {
|
|
@@ -44873,9 +44894,7 @@ const signMessage = async (provider, unsignedMessage) => {
|
|
|
44873
44894
|
};
|
|
44874
44895
|
}
|
|
44875
44896
|
catch (err) {
|
|
44876
|
-
throw new CheckoutError('An error occurred while signing the message', CheckoutErrorType.SIGN_MESSAGE_ERROR, {
|
|
44877
|
-
message: err.message,
|
|
44878
|
-
});
|
|
44897
|
+
throw new CheckoutError('An error occurred while signing the message', CheckoutErrorType.SIGN_MESSAGE_ERROR, { error: err });
|
|
44879
44898
|
}
|
|
44880
44899
|
};
|
|
44881
44900
|
|
|
@@ -45058,8 +45077,8 @@ const buy = async (config, provider, orders, overrides = {
|
|
|
45058
45077
|
}
|
|
45059
45078
|
catch (err) {
|
|
45060
45079
|
throw new CheckoutError('An error occurred while getting the order listing', CheckoutErrorType.GET_ORDER_LISTING_ERROR, {
|
|
45080
|
+
error: err,
|
|
45061
45081
|
orderId: id,
|
|
45062
|
-
message: err.message,
|
|
45063
45082
|
});
|
|
45064
45083
|
}
|
|
45065
45084
|
if (order.result.buy.length === 0) {
|
|
@@ -45098,7 +45117,7 @@ const buy = async (config, provider, orders, overrides = {
|
|
|
45098
45117
|
if (!err.message.includes('The fulfiller does not have the balances needed to fulfill')) {
|
|
45099
45118
|
throw new CheckoutError('Error occurred while trying to fulfill the order', CheckoutErrorType.FULFILL_ORDER_LISTING_ERROR, {
|
|
45100
45119
|
orderId: id,
|
|
45101
|
-
|
|
45120
|
+
error: err,
|
|
45102
45121
|
});
|
|
45103
45122
|
}
|
|
45104
45123
|
}
|
|
@@ -45157,9 +45176,7 @@ const buy = async (config, provider, orders, overrides = {
|
|
|
45157
45176
|
}
|
|
45158
45177
|
}
|
|
45159
45178
|
catch (err) {
|
|
45160
|
-
throw new CheckoutError('Error fetching fulfillment transaction', CheckoutErrorType.FULFILL_ORDER_LISTING_ERROR, {
|
|
45161
|
-
message: err.message,
|
|
45162
|
-
});
|
|
45179
|
+
throw new CheckoutError('Error fetching fulfillment transaction', CheckoutErrorType.FULFILL_ORDER_LISTING_ERROR, { error: err });
|
|
45163
45180
|
}
|
|
45164
45181
|
if (overrides.waitFulfillmentSettlements) {
|
|
45165
45182
|
const fulfillmentResult = await signFulfillmentTransactions(provider, unsignedFulfillmentTransactions);
|
|
@@ -45214,7 +45231,7 @@ const cancel = async (config, provider, orderIds) => {
|
|
|
45214
45231
|
catch (err) {
|
|
45215
45232
|
throw new CheckoutError('An error occurred while cancelling the order listing', CheckoutErrorType.CANCEL_ORDER_LISTING_ERROR, {
|
|
45216
45233
|
orderId,
|
|
45217
|
-
|
|
45234
|
+
error: err,
|
|
45218
45235
|
});
|
|
45219
45236
|
}
|
|
45220
45237
|
const result = await signFulfillmentTransactions(provider, [unsignedCancelOrderTransaction]);
|
|
@@ -45283,7 +45300,7 @@ const sell = async (config, provider, orders) => {
|
|
|
45283
45300
|
}
|
|
45284
45301
|
catch (err) {
|
|
45285
45302
|
throw new CheckoutError('An error occurred while preparing the listing', CheckoutErrorType.PREPARE_ORDER_LISTING_ERROR, {
|
|
45286
|
-
|
|
45303
|
+
error: err,
|
|
45287
45304
|
id: sellToken.id,
|
|
45288
45305
|
collectionAddress: sellToken.collectionAddress,
|
|
45289
45306
|
});
|
|
@@ -45339,7 +45356,7 @@ const sell = async (config, provider, orders) => {
|
|
|
45339
45356
|
}
|
|
45340
45357
|
catch (err) {
|
|
45341
45358
|
throw new CheckoutError('An error occurred while creating the listing', CheckoutErrorType.CREATE_ORDER_LISTING_ERROR, {
|
|
45342
|
-
|
|
45359
|
+
error: err,
|
|
45343
45360
|
collectionId: sellToken.id,
|
|
45344
45361
|
collectionAddress: sellToken.collectionAddress,
|
|
45345
45362
|
});
|
|
@@ -45636,7 +45653,7 @@ class Checkout {
|
|
|
45636
45653
|
}
|
|
45637
45654
|
}
|
|
45638
45655
|
catch (err) {
|
|
45639
|
-
reject(new CheckoutError('Failed to load widgets script', CheckoutErrorType.WIDGETS_SCRIPT_LOAD_ERROR, {
|
|
45656
|
+
reject(new CheckoutError('Failed to load widgets script', CheckoutErrorType.WIDGETS_SCRIPT_LOAD_ERROR, { error: err }));
|
|
45640
45657
|
}
|
|
45641
45658
|
});
|
|
45642
45659
|
return factory;
|
|
@@ -45802,8 +45819,8 @@ class Checkout {
|
|
|
45802
45819
|
try {
|
|
45803
45820
|
itemRequirements = await getItemRequirementsFromRequirements(web3Provider, params.itemRequirements);
|
|
45804
45821
|
}
|
|
45805
|
-
catch (
|
|
45806
|
-
throw new CheckoutError('Failed to map item requirements', CheckoutErrorType.ITEM_REQUIREMENTS_ERROR);
|
|
45822
|
+
catch (err) {
|
|
45823
|
+
throw new CheckoutError('Failed to map item requirements', CheckoutErrorType.ITEM_REQUIREMENTS_ERROR, { error: err });
|
|
45807
45824
|
}
|
|
45808
45825
|
return await smartCheckout(this.config, web3Provider, itemRequirements, params.transactionOrGasAmount);
|
|
45809
45826
|
}
|
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.3' };
|
|
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.3',
|
|
8796
8796
|
});
|
|
8797
8797
|
/**
|
|
8798
8798
|
* Sets `sdkVersion` at the time of build
|
package/package.json
CHANGED