@imtbl/sdk 0.28.3 → 0.28.4-alpha.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.js +2 -2
- package/dist/checkout_sdk.d.ts +14 -27
- package/dist/checkout_sdk.js +94 -80
- package/dist/checkout_widgets.d.ts +19 -3
- package/dist/checkout_widgets.js +3 -2
- 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 +99 -84
- package/dist/index.d.ts +34 -29
- package/dist/index.js +99 -84
- package/dist/passport.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3629,7 +3629,7 @@ class MultiRollupApiClients {
|
|
|
3629
3629
|
}
|
|
3630
3630
|
|
|
3631
3631
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
3632
|
-
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.28.
|
|
3632
|
+
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.28.4-alpha.2' };
|
|
3633
3633
|
const createConfig = ({ basePath, headers, }) => {
|
|
3634
3634
|
if (!basePath.trim()) {
|
|
3635
3635
|
throw Error('basePath can not be empty');
|
|
@@ -3689,7 +3689,7 @@ class APIError extends Error {
|
|
|
3689
3689
|
|
|
3690
3690
|
/* eslint-disable implicit-arrow-linebreak */
|
|
3691
3691
|
const defaultHeaders = {
|
|
3692
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.28.
|
|
3692
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.28.4-alpha.2',
|
|
3693
3693
|
};
|
|
3694
3694
|
/**
|
|
3695
3695
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -4100,7 +4100,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
4100
4100
|
chainID,
|
|
4101
4101
|
coreContractAddress,
|
|
4102
4102
|
registrationContractAddress,
|
|
4103
|
-
sdkVersion: 'ts-immutable-sdk-0.28.
|
|
4103
|
+
sdkVersion: 'ts-immutable-sdk-0.28.4-alpha.2',
|
|
4104
4104
|
});
|
|
4105
4105
|
/**
|
|
4106
4106
|
* Sets `sdkVersion` at the time of build
|
|
@@ -30377,6 +30377,7 @@ async function $1564e43dde50bb61$export$60e0fe116a0e6ed0(web3Provider, walletAdd
|
|
|
30377
30377
|
}
|
|
30378
30378
|
// Blockscout client singleton per chain id
|
|
30379
30379
|
const $1564e43dde50bb61$var$blockscoutClientMap = new Map();
|
|
30380
|
+
const $1564e43dde50bb61$export$be5483d07cfa803d = ()=>$1564e43dde50bb61$var$blockscoutClientMap.clear();
|
|
30380
30381
|
const $1564e43dde50bb61$export$8c978679845804d4 = async (walletAddress, chainId, filterTokens)=>{
|
|
30381
30382
|
// Shuffle the mapping of the tokens configuration so it is a hashmap
|
|
30382
30383
|
// for faster access to tokens config objects.
|
|
@@ -30478,6 +30479,8 @@ const $1564e43dde50bb61$export$a3238cee431627c6 = async (config, web3Provider, w
|
|
|
30478
30479
|
};
|
|
30479
30480
|
};
|
|
30480
30481
|
const $1564e43dde50bb61$export$fee49741664a4d7e = async (config, web3Provider, walletAddress, chainId)=>{
|
|
30482
|
+
// eslint-disable-next-line no-param-reassign
|
|
30483
|
+
chainId ||= await web3Provider.getSigner().getChainId();
|
|
30481
30484
|
const { tokens: tokens } = await ($efe60cea83bfc4e8$export$473cec51305fdae8)(config, {
|
|
30482
30485
|
type: ($08d5ddc39acd6833$export$fd9b17d87f4121d2).ALL,
|
|
30483
30486
|
chainId: chainId
|
|
@@ -30499,7 +30502,7 @@ const $1564e43dde50bb61$export$fee49741664a4d7e = async (config, web3Provider, w
|
|
|
30499
30502
|
// Please remove this hack once https://immutable.atlassian.net/browse/WT-1710
|
|
30500
30503
|
// is done.
|
|
30501
30504
|
const isL1Chain = ($4013c5c91bb535f6$export$9b794d067cdd1af6)(config) === chainId;
|
|
30502
|
-
return ($458d407830d66110$export$5280dbcb91c8b391)(config, `Time to fetch balances using blockscout for ${chainId}`, $1564e43dde50bb61$export$8c978679845804d4(walletAddress, chainId, isL1Chain ? tokens : []));
|
|
30505
|
+
return await ($458d407830d66110$export$5280dbcb91c8b391)(config, `Time to fetch balances using blockscout for ${chainId}`, $1564e43dde50bb61$export$8c978679845804d4(walletAddress, chainId, isL1Chain ? tokens : []));
|
|
30503
30506
|
}
|
|
30504
30507
|
// This fallback to use ERC20s calls which is a best effort solution
|
|
30505
30508
|
// Fails in fetching data from the RCP calls might result in some
|
|
@@ -30772,39 +30775,39 @@ function $06a6c5c23f7f2479$export$fbbc17f6e6e58544(address, contractInterface, s
|
|
|
30772
30775
|
|
|
30773
30776
|
const $2e7bf45a7c9a9570$var$DUMMY_WALLET_ADDRESS = "0x0000000000000000000000000000000000000001";
|
|
30774
30777
|
const $2e7bf45a7c9a9570$var$DEFAULT_TOKEN_DECIMALS = 18;
|
|
30775
|
-
async function $2e7bf45a7c9a9570$var$
|
|
30776
|
-
if (tokenAddress === "NATIVE") return config.networkMap.get(chainId)?.nativeCurrency;
|
|
30777
|
-
const contract = new (Contract$1)(tokenAddress, JSON.stringify(($d85ad1457a3f1a83$export$db5daa1b5156ccfe)), provider);
|
|
30778
|
-
const name = await contract.name();
|
|
30779
|
-
const symbol = await contract.symbol();
|
|
30780
|
-
const decimals = await contract.decimals();
|
|
30781
|
-
return {
|
|
30782
|
-
name: name,
|
|
30783
|
-
symbol: symbol,
|
|
30784
|
-
decimals: decimals,
|
|
30785
|
-
address: tokenAddress
|
|
30786
|
-
};
|
|
30787
|
-
}
|
|
30788
|
-
async function $2e7bf45a7c9a9570$var$bridgeToL2GasEstimator(readOnlyProviders, config, isSpendingCapApprovalRequired, tokenAddress) {
|
|
30778
|
+
async function $2e7bf45a7c9a9570$var$bridgeToL2GasEstimator(readOnlyProviders, config, isSpendingCapApprovalRequired) {
|
|
30789
30779
|
const fromChainId = ($4013c5c91bb535f6$export$9b794d067cdd1af6)(config);
|
|
30790
30780
|
const toChainId = ($4013c5c91bb535f6$export$c9af4e4b001c6476)(config);
|
|
30791
30781
|
const gasEstimateTokensConfig = await config.remote.getConfig("gasEstimateTokens");
|
|
30792
|
-
const {
|
|
30782
|
+
const { fromAddress: fromAddress } = gasEstimateTokensConfig[fromChainId].bridgeToL2Addresses;
|
|
30793
30783
|
const provider = readOnlyProviders.get(fromChainId);
|
|
30794
30784
|
if (!provider) throw new Error(`Missing JsonRpcProvider for chain id: ${fromChainId}`);
|
|
30795
30785
|
try {
|
|
30796
|
-
|
|
30797
|
-
|
|
30798
|
-
|
|
30799
|
-
|
|
30786
|
+
let gasFees = {};
|
|
30787
|
+
const getGasFees = async ()=>{
|
|
30788
|
+
gasFees = await (0, $570856c68db0bd36$export$51010590edbe56a6)(provider, isSpendingCapApprovalRequired);
|
|
30789
|
+
gasFees.token = config.networkMap.get(fromChainId)?.nativeCurrency;
|
|
30790
|
+
};
|
|
30791
|
+
let bridgeFees = {
|
|
30792
|
+
bridgeFee: {},
|
|
30793
|
+
bridgeable: false
|
|
30794
|
+
};
|
|
30795
|
+
const getBridgeFees = async ()=>{
|
|
30796
|
+
const tokenBridge = await $67fc622a2b913d5f$export$989eefe1274a439c(fromChainId, toChainId, readOnlyProviders, config);
|
|
30797
|
+
bridgeFees = await (0, $570856c68db0bd36$export$9e73e22953cebcfc)(tokenBridge, fromAddress);
|
|
30798
|
+
};
|
|
30799
|
+
await Promise.all([
|
|
30800
|
+
getGasFees(),
|
|
30801
|
+
getBridgeFees()
|
|
30802
|
+
]);
|
|
30800
30803
|
return {
|
|
30801
30804
|
gasEstimateType: (0, $de275b98d2b651c3$export$788b1fd17f3dad84).BRIDGE_TO_L2,
|
|
30802
|
-
gasFee:
|
|
30805
|
+
gasFee: gasFees,
|
|
30803
30806
|
bridgeFee: {
|
|
30804
|
-
estimatedAmount: bridgeFee?.estimatedAmount,
|
|
30805
|
-
token: bridgeFee?.token
|
|
30807
|
+
estimatedAmount: bridgeFees.bridgeFee?.estimatedAmount,
|
|
30808
|
+
token: bridgeFees.bridgeFee?.token
|
|
30806
30809
|
},
|
|
30807
|
-
bridgeable: bridgeable
|
|
30810
|
+
bridgeable: bridgeFees.bridgeable
|
|
30808
30811
|
};
|
|
30809
30812
|
} catch {
|
|
30810
30813
|
// In the case of an error, just return an empty gas & bridge fee estimate
|
|
@@ -30853,7 +30856,7 @@ async function $2e7bf45a7c9a9570$var$swapGasEstimator(config) {
|
|
|
30853
30856
|
async function $2e7bf45a7c9a9570$export$942c8de7174809fc(params, readOnlyProviders, config) {
|
|
30854
30857
|
switch(params.gasEstimateType){
|
|
30855
30858
|
case ($de275b98d2b651c3$export$788b1fd17f3dad84).BRIDGE_TO_L2:
|
|
30856
|
-
return await $2e7bf45a7c9a9570$var$bridgeToL2GasEstimator(readOnlyProviders, config, params.isSpendingCapApprovalRequired
|
|
30859
|
+
return await $2e7bf45a7c9a9570$var$bridgeToL2GasEstimator(readOnlyProviders, config, params.isSpendingCapApprovalRequired);
|
|
30857
30860
|
case ($de275b98d2b651c3$export$788b1fd17f3dad84).SWAP:
|
|
30858
30861
|
return await $2e7bf45a7c9a9570$var$swapGasEstimator(config);
|
|
30859
30862
|
default:
|
|
@@ -30870,6 +30873,7 @@ async function $2e7bf45a7c9a9570$export$942c8de7174809fc(params, readOnlyProvide
|
|
|
30870
30873
|
|
|
30871
30874
|
|
|
30872
30875
|
|
|
30876
|
+
|
|
30873
30877
|
const $ddc6bcd0896481e5$export$2fbfa41a4de56a89 = (erc20allowances, erc721allowances)=>{
|
|
30874
30878
|
const aggregatedAllowances = [];
|
|
30875
30879
|
if (!erc20allowances.sufficient) {
|
|
@@ -31176,7 +31180,7 @@ const $35c3fc7013888ba5$export$be546c525d418988 = async (provider, ownerAddress,
|
|
|
31176
31180
|
|
|
31177
31181
|
|
|
31178
31182
|
|
|
31179
|
-
|
|
31183
|
+
|
|
31180
31184
|
|
|
31181
31185
|
|
|
31182
31186
|
|
|
@@ -31369,17 +31373,14 @@ const $73d2282a108cc7e2$export$6ab9757fda54db7e = (itemRequirement, balances)=>{
|
|
|
31369
31373
|
/**
|
|
31370
31374
|
* Gets the balances for all NATIVE and ERC20 balance requirements.
|
|
31371
31375
|
*/ const $beb896e098e41faf$var$getTokenBalances = async (config, provider, ownerAddress, itemRequirements)=>{
|
|
31372
|
-
let tokenBalances = [];
|
|
31373
31376
|
try {
|
|
31374
|
-
const
|
|
31375
|
-
|
|
31376
|
-
|
|
31377
|
-
|
|
31378
|
-
];
|
|
31377
|
+
const tokenMap = new Map();
|
|
31378
|
+
(0, $73d2282a108cc7e2$export$ed7929b58bab85da)(itemRequirements).forEach((item)=>tokenMap.set((item.address || "").toLocaleLowerCase(), item));
|
|
31379
|
+
const { balances: balances } = await (0, $1564e43dde50bb61$export$fee49741664a4d7e)(config, provider, ownerAddress);
|
|
31380
|
+
return balances.filter((balance)=>tokenMap.get((balance.token.address || "").toLocaleLowerCase()));
|
|
31379
31381
|
} catch (error) {
|
|
31380
31382
|
throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Failed to get balances", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).GET_BALANCE_ERROR);
|
|
31381
31383
|
}
|
|
31382
|
-
return tokenBalances;
|
|
31383
31384
|
};
|
|
31384
31385
|
/**
|
|
31385
31386
|
* Gets the balances for all ERC721 balance requirements.
|
|
@@ -31417,42 +31418,46 @@ const $73d2282a108cc7e2$export$6ab9757fda54db7e = (itemRequirement, balances)=>{
|
|
|
31417
31418
|
};
|
|
31418
31419
|
const $beb896e098e41faf$export$ddfc885f43c3cb6e = async (config, provider, ownerAddress, itemRequirements)=>{
|
|
31419
31420
|
const aggregatedItems = ($aa6caea9a60d18c7$export$f96d1c819a615a64)(itemRequirements);
|
|
31420
|
-
|
|
31421
|
-
|
|
31422
|
-
|
|
31421
|
+
const requiredToken = [];
|
|
31422
|
+
const requiredERC721 = [];
|
|
31423
|
+
aggregatedItems.forEach((item)=>{
|
|
31424
|
+
switch(item.type){
|
|
31425
|
+
case ($4b58188d47aafe8d$export$1fc8f52ad1810e52).ERC20:
|
|
31426
|
+
case ($4b58188d47aafe8d$export$1fc8f52ad1810e52).NATIVE:
|
|
31427
|
+
requiredToken.push(item);
|
|
31428
|
+
break;
|
|
31429
|
+
case ($4b58188d47aafe8d$export$1fc8f52ad1810e52).ERC721:
|
|
31430
|
+
requiredERC721.push(item);
|
|
31431
|
+
break;
|
|
31432
|
+
}
|
|
31433
|
+
});
|
|
31434
|
+
if (requiredERC721.length === 0 && requiredToken.length === 0) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Unsupported item requirement balance check", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).UNSUPPORTED_BALANCE_REQUIREMENT_ERROR);
|
|
31423
31435
|
// Get all ERC20 and NATIVE balances
|
|
31424
|
-
const
|
|
31425
|
-
|
|
31426
|
-
if (tokenItemRequirements.length > 0) currentBalances.push($beb896e098e41faf$var$getTokenBalances(config, provider, ownerAddress, aggregatedItems));
|
|
31436
|
+
const balancePromises = [];
|
|
31437
|
+
if (requiredToken.length > 0) balancePromises.push($beb896e098e41faf$var$getTokenBalances(config, provider, ownerAddress, aggregatedItems));
|
|
31427
31438
|
// Get all ERC721 balances
|
|
31428
|
-
|
|
31429
|
-
if (erc721ItemRequirements.length > 0) currentBalances.push($beb896e098e41faf$var$getERC721Balances(provider, ownerAddress, aggregatedItems));
|
|
31439
|
+
if (requiredERC721.length > 0) balancePromises.push($beb896e098e41faf$var$getERC721Balances(provider, ownerAddress, aggregatedItems));
|
|
31430
31440
|
// Wait for all balances and calculate the requirements
|
|
31431
|
-
const
|
|
31432
|
-
|
|
31433
|
-
|
|
31434
|
-
|
|
31435
|
-
|
|
31436
|
-
|
|
31437
|
-
|
|
31438
|
-
|
|
31439
|
-
|
|
31440
|
-
|
|
31441
|
-
|
|
31442
|
-
|
|
31443
|
-
|
|
31444
|
-
|
|
31445
|
-
|
|
31446
|
-
|
|
31447
|
-
|
|
31448
|
-
|
|
31449
|
-
|
|
31450
|
-
|
|
31451
|
-
return requirements;
|
|
31452
|
-
});
|
|
31453
|
-
const sufficient = balanceRequirements.reduce((acc, balanceRequirement)=>{
|
|
31454
|
-
return acc && balanceRequirement.sufficient;
|
|
31455
|
-
}, true);
|
|
31441
|
+
const promisesResponses = await Promise.all(balancePromises);
|
|
31442
|
+
const balanceRequirements = [];
|
|
31443
|
+
// Get all ERC20 and NATIVE balances
|
|
31444
|
+
if (requiredToken.length > 0 && promisesResponses.length > 0) {
|
|
31445
|
+
const result = promisesResponses.shift();
|
|
31446
|
+
if (result) requiredToken.forEach((item)=>{
|
|
31447
|
+
balanceRequirements.push(($73d2282a108cc7e2$export$6ab9757fda54db7e)(item, result));
|
|
31448
|
+
});
|
|
31449
|
+
}
|
|
31450
|
+
// Get all ERC721 balances
|
|
31451
|
+
if (requiredERC721.length > 0 && promisesResponses.length > 0) {
|
|
31452
|
+
const result = promisesResponses.shift();
|
|
31453
|
+
if (result) requiredERC721.forEach((item)=>{
|
|
31454
|
+
balanceRequirements.push(($73d2282a108cc7e2$export$9b757e40b19984c3)(item, result));
|
|
31455
|
+
});
|
|
31456
|
+
}
|
|
31457
|
+
// Find if there are any requirements that aren't sufficient.
|
|
31458
|
+
// If there is not item with sufficient === false then the requirements
|
|
31459
|
+
// are satisfied.
|
|
31460
|
+
const sufficient = balanceRequirements.find((req)=>req.sufficient === false) === undefined;
|
|
31456
31461
|
return {
|
|
31457
31462
|
sufficient: sufficient,
|
|
31458
31463
|
balanceRequirements: balanceRequirements
|
|
@@ -32036,7 +32041,9 @@ const $15fe1c77041bd4f4$export$9e73e22953cebcfc = async (config, readOnlyProvide
|
|
|
32036
32041
|
|
|
32037
32042
|
const $887d24b47765b1c0$export$c37d8687c27b9660 = "0x0000000000000000000000000000000000000001";
|
|
32038
32043
|
const $887d24b47765b1c0$export$1430626eec86fce9 = (chainId)=>{
|
|
32044
|
+
if (chainId === ($0472f23319457bfb$export$c06e1e7429de6283).IMTBL_ZKEVM_MAINNET) return "imtbl-zkevm-mainnet";
|
|
32039
32045
|
if (chainId === ($0472f23319457bfb$export$c06e1e7429de6283).IMTBL_ZKEVM_TESTNET) return "imtbl-zkevm-testnet";
|
|
32046
|
+
if (chainId === ($0472f23319457bfb$export$c06e1e7429de6283).IMTBL_ZKEVM_DEVNET) return "imtbl-zkevm-devent";
|
|
32040
32047
|
return "";
|
|
32041
32048
|
};
|
|
32042
32049
|
const $887d24b47765b1c0$export$53e663abd9b77fc1 = async (chainId, config)=>{
|
|
@@ -32857,7 +32864,6 @@ const $a7367d01c6e76b1c$export$d62081fac18000c2 = (orderHash, orderComponents, a
|
|
|
32857
32864
|
|
|
32858
32865
|
|
|
32859
32866
|
|
|
32860
|
-
|
|
32861
32867
|
const $9051cee080948594$export$9ac1563efd38130 = 1; // 100%
|
|
32862
32868
|
const $9051cee080948594$export$768e717351d4b176 = 6; // will allow 0.000001 (0.0001%) as the minimum value
|
|
32863
32869
|
const $9051cee080948594$var$calculateFeesPercent = (orderFee, amountBn)=>{
|
|
@@ -32898,6 +32904,7 @@ const $9051cee080948594$export$1e69c9cfc42e28d8 = (orderFees, weiAmount, decimal
|
|
|
32898
32904
|
|
|
32899
32905
|
|
|
32900
32906
|
|
|
32907
|
+
|
|
32901
32908
|
const $64863c39386de592$export$4249179755829904 = (type, contractAddress, amount, spenderAddress)=>{
|
|
32902
32909
|
switch(type){
|
|
32903
32910
|
case ($4b58188d47aafe8d$export$1fc8f52ad1810e52).ERC20:
|
|
@@ -32929,16 +32936,24 @@ const $64863c39386de592$export$8f2ff92ab8657f0b = (gasLimit, fulfillmentTransact
|
|
|
32929
32936
|
};
|
|
32930
32937
|
};
|
|
32931
32938
|
const $64863c39386de592$export$7f8e2b98eca5a7f0 = async (config, provider, orders)=>{
|
|
32932
|
-
|
|
32939
|
+
if (orders.length === 0) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("No orders were provided to the orders array. Please provide at least one order.", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).FULFILL_ORDER_LISTING_ERROR);
|
|
32933
32940
|
let order;
|
|
32934
32941
|
let spenderAddress = "";
|
|
32942
|
+
let decimals = 18;
|
|
32935
32943
|
const gasLimit = (constants).estimatedFulfillmentGasGwei;
|
|
32936
|
-
|
|
32944
|
+
const orderbook = $67fc622a2b913d5f$export$c60ce6c6a92bc2ff(config);
|
|
32945
|
+
const blockchainClient = $67fc622a2b913d5f$export$436dd76f23f463ff(config);
|
|
32946
|
+
const fulfillerAddress = await ($458d407830d66110$export$5280dbcb91c8b391)(config, "Time to get the address from the provider", provider.getSigner().getAddress());
|
|
32947
|
+
// Prefetch balances and store them in memory
|
|
32948
|
+
($1564e43dde50bb61$export$be5483d07cfa803d)();
|
|
32949
|
+
($1564e43dde50bb61$export$fee49741664a4d7e)(config, provider, fulfillerAddress, ($4013c5c91bb535f6$export$9b794d067cdd1af6)(config));
|
|
32950
|
+
($1564e43dde50bb61$export$fee49741664a4d7e)(config, provider, fulfillerAddress, ($4013c5c91bb535f6$export$c9af4e4b001c6476)(config));
|
|
32937
32951
|
const { id: id, takerFees: takerFees } = orders[0];
|
|
32952
|
+
let orderChainName;
|
|
32938
32953
|
try {
|
|
32939
|
-
orderbook = $67fc622a2b913d5f$export$c60ce6c6a92bc2ff(config);
|
|
32940
32954
|
order = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to fetch the listing from the orderbook", orderbook.getListing(id));
|
|
32941
|
-
const { seaportContractAddress: seaportContractAddress } = orderbook.config();
|
|
32955
|
+
const { seaportContractAddress: seaportContractAddress, chainName: chainName } = orderbook.config();
|
|
32956
|
+
orderChainName = chainName;
|
|
32942
32957
|
spenderAddress = seaportContractAddress;
|
|
32943
32958
|
} catch (err) {
|
|
32944
32959
|
throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("An error occurred while getting the order listing", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).GET_ORDER_LISTING_ERROR, {
|
|
@@ -32951,10 +32966,12 @@ const $64863c39386de592$export$7f8e2b98eca5a7f0 = async (config, provider, order
|
|
|
32951
32966
|
message: "No buy side tokens found on order"
|
|
32952
32967
|
});
|
|
32953
32968
|
const buyToken = order.result.buy[0];
|
|
32954
|
-
|
|
32955
|
-
|
|
32956
|
-
|
|
32957
|
-
|
|
32969
|
+
if (buyToken.type === "ERC20") {
|
|
32970
|
+
const token = await ($458d407830d66110$export$5280dbcb91c8b391)(config, "Time to get decimals of token contract for the buy token", blockchainClient.getToken({
|
|
32971
|
+
contractAddress: buyToken.contractAddress,
|
|
32972
|
+
chainName: orderChainName
|
|
32973
|
+
}));
|
|
32974
|
+
if (token.result.decimals) decimals = token.result.decimals;
|
|
32958
32975
|
}
|
|
32959
32976
|
let fees = [];
|
|
32960
32977
|
if (takerFees && takerFees.length > 0) fees = ($9051cee080948594$export$1e69c9cfc42e28d8)(takerFees, buyToken.amount, decimals);
|
|
@@ -32963,7 +32980,6 @@ const $64863c39386de592$export$7f8e2b98eca5a7f0 = async (config, provider, order
|
|
|
32963
32980
|
let orderActions = [];
|
|
32964
32981
|
const fulfillOrderStartTime = performance.now();
|
|
32965
32982
|
try {
|
|
32966
|
-
const fulfillerAddress = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to get the address from the provider", provider.getSigner().getAddress());
|
|
32967
32983
|
const { actions: actions } = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to call fulfillOrder from the orderbook", orderbook.fulfillOrder(id, fulfillerAddress, fees));
|
|
32968
32984
|
orderActions = actions;
|
|
32969
32985
|
unsignedApprovalTransactions = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to construct the unsigned approval transactions", (0, $a7367d01c6e76b1c$export$f64a20a30eb98855)(actions));
|
|
@@ -33343,10 +33359,8 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
|
|
|
33343
33359
|
allowUnsupportedProvider: true
|
|
33344
33360
|
});
|
|
33345
33361
|
await $c99672cf2294e839$export$43f7168eb392a88c(web3Provider);
|
|
33346
|
-
const networkInfo = await $de192de6ef100f9f$export$79f13b4cfaaf0d09(this.config, web3Provider);
|
|
33347
33362
|
return {
|
|
33348
|
-
provider: web3Provider
|
|
33349
|
-
network: networkInfo
|
|
33363
|
+
provider: web3Provider
|
|
33350
33364
|
};
|
|
33351
33365
|
}
|
|
33352
33366
|
/**
|
|
@@ -33565,7 +33579,7 @@ var $045213b18e9f1f94$export$75be0f6af9650f2c;
|
|
|
33565
33579
|
})($045213b18e9f1f94$export$75be0f6af9650f2c || ($045213b18e9f1f94$export$75be0f6af9650f2c = {}));
|
|
33566
33580
|
|
|
33567
33581
|
|
|
33568
|
-
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.28.
|
|
33582
|
+
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.28.4-alpha.2";
|
|
33569
33583
|
const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
|
|
33570
33584
|
const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
|
|
33571
33585
|
|
|
@@ -33750,6 +33764,7 @@ $parcel$export($9b3189b6b155842e$exports, "SaleEventType", () => $9b3189b6b15584
|
|
|
33750
33764
|
SaleEventType["SUCCESS"] = "success";
|
|
33751
33765
|
SaleEventType["FAILURE"] = "failure";
|
|
33752
33766
|
SaleEventType["REJECTED"] = "rejected";
|
|
33767
|
+
SaleEventType["TRANSACTION_SUCCESS"] = "transaction-success";
|
|
33753
33768
|
})($9b3189b6b155842e$export$881881ffb3bd733e || ($9b3189b6b155842e$export$881881ffb3bd733e = {}));
|
|
33754
33769
|
|
|
33755
33770
|
|
|
@@ -33859,7 +33874,7 @@ function $b222a8f062090058$export$fae4199086a966a3(tagName, passport) {
|
|
|
33859
33874
|
if (attempts >= maxAttempts) {
|
|
33860
33875
|
window.clearInterval(timer);
|
|
33861
33876
|
// eslint-disable-next-line no-console
|
|
33862
|
-
console.error("failed to set the provider");
|
|
33877
|
+
console.error("failed to set the provider", err);
|
|
33863
33878
|
}
|
|
33864
33879
|
}
|
|
33865
33880
|
};
|
package/dist/passport.js
CHANGED
|
@@ -2072,7 +2072,7 @@ class MultiRollupApiClients {
|
|
|
2072
2072
|
}
|
|
2073
2073
|
|
|
2074
2074
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2075
|
-
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.28.
|
|
2075
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.28.4-alpha.2' };
|
|
2076
2076
|
const createConfig = ({ basePath, headers, }) => {
|
|
2077
2077
|
if (!basePath.trim()) {
|
|
2078
2078
|
throw Error('basePath can not be empty');
|
|
@@ -2128,7 +2128,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
2128
2128
|
chainID,
|
|
2129
2129
|
coreContractAddress,
|
|
2130
2130
|
registrationContractAddress,
|
|
2131
|
-
sdkVersion: 'ts-immutable-sdk-0.28.
|
|
2131
|
+
sdkVersion: 'ts-immutable-sdk-0.28.4-alpha.2',
|
|
2132
2132
|
});
|
|
2133
2133
|
/**
|
|
2134
2134
|
* Sets `sdkVersion` at the time of build
|
package/package.json
CHANGED