@imtbl/sdk 0.27.11 → 0.27.13
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.d.ts +1 -1
- package/dist/blockchain_data.js +2 -2
- package/dist/browser/checkout.js +2 -2
- package/dist/checkout_sdk.d.ts +16 -9
- package/dist/checkout_sdk.js +112 -69
- package/dist/checkout_widgets.js +1 -1
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +10 -10
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +122 -79
- package/dist/index.d.ts +68 -41
- package/dist/index.js +122 -79
- package/dist/orderbook.d.ts +45 -25
- package/dist/orderbook.js +14 -2
- package/dist/passport.js +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3632,7 +3632,7 @@ class MultiRollupApiClients {
|
|
|
3632
3632
|
}
|
|
3633
3633
|
|
|
3634
3634
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
3635
|
-
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.27.
|
|
3635
|
+
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.27.13' };
|
|
3636
3636
|
const createConfig = ({ basePath, headers, }) => {
|
|
3637
3637
|
if (!basePath.trim()) {
|
|
3638
3638
|
throw Error('basePath can not be empty');
|
|
@@ -3692,7 +3692,7 @@ class APIError extends Error {
|
|
|
3692
3692
|
|
|
3693
3693
|
/* eslint-disable implicit-arrow-linebreak */
|
|
3694
3694
|
const defaultHeaders = {
|
|
3695
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.27.
|
|
3695
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.27.13',
|
|
3696
3696
|
};
|
|
3697
3697
|
/**
|
|
3698
3698
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -4084,14 +4084,14 @@ class BlockchainData {
|
|
|
4084
4084
|
var blockchain_data = /*#__PURE__*/Object.freeze({
|
|
4085
4085
|
__proto__: null,
|
|
4086
4086
|
APIError: APIError,
|
|
4087
|
-
|
|
4087
|
+
ActivitiesTypes: activitiesApiTypes,
|
|
4088
4088
|
BlockchainData: BlockchainData,
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4089
|
+
ChainsTypes: chainsApiTypes,
|
|
4090
|
+
CollectionsTypes: collectionsApiTypes,
|
|
4091
|
+
MetadataTypes: metadataApiTypes,
|
|
4092
|
+
NFTOwnersTypes: nftOwnersApiTypes,
|
|
4093
|
+
NFTsTypes: nftsApiTypes,
|
|
4094
|
+
TokensTypes: tokensApiTypes
|
|
4095
4095
|
});
|
|
4096
4096
|
|
|
4097
4097
|
/**
|
|
@@ -4103,7 +4103,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
4103
4103
|
chainID,
|
|
4104
4104
|
coreContractAddress,
|
|
4105
4105
|
registrationContractAddress,
|
|
4106
|
-
sdkVersion: 'ts-immutable-sdk-0.27.
|
|
4106
|
+
sdkVersion: 'ts-immutable-sdk-0.27.13',
|
|
4107
4107
|
});
|
|
4108
4108
|
/**
|
|
4109
4109
|
* Sets `sdkVersion` at the time of build
|
|
@@ -11245,7 +11245,7 @@ class OrdersService {
|
|
|
11245
11245
|
* @returns ListListingsResult OK response.
|
|
11246
11246
|
* @throws ApiError
|
|
11247
11247
|
*/
|
|
11248
|
-
listListings({ chainName, status, sellItemContractAddress, buyItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, }) {
|
|
11248
|
+
listListings({ chainName, status, sellItemContractAddress, buyItemContractAddress, sellItemTokenId, fromUpdatedAt, pageSize, sortBy, sortDirection, pageCursor, }) {
|
|
11249
11249
|
return this.httpRequest.request({
|
|
11250
11250
|
method: 'GET',
|
|
11251
11251
|
url: '/v1/chains/{chain_name}/orders/listings',
|
|
@@ -11257,6 +11257,7 @@ class OrdersService {
|
|
|
11257
11257
|
'sell_item_contract_address': sellItemContractAddress,
|
|
11258
11258
|
'buy_item_contract_address': buyItemContractAddress,
|
|
11259
11259
|
'sell_item_token_id': sellItemTokenId,
|
|
11260
|
+
'from_updated_at': fromUpdatedAt,
|
|
11260
11261
|
'page_size': pageSize,
|
|
11261
11262
|
'sort_by': sortBy,
|
|
11262
11263
|
'sort_direction': sortDirection,
|
|
@@ -11340,7 +11341,7 @@ class OrdersService {
|
|
|
11340
11341
|
* @returns ListTradeResult OK response.
|
|
11341
11342
|
* @throws ApiError
|
|
11342
11343
|
*/
|
|
11343
|
-
listTrades({ chainName, accountAddress, pageSize, sortBy, sortDirection, pageCursor, }) {
|
|
11344
|
+
listTrades({ chainName, accountAddress, fromIndexedAt, pageSize, sortBy, sortDirection, pageCursor, }) {
|
|
11344
11345
|
return this.httpRequest.request({
|
|
11345
11346
|
method: 'GET',
|
|
11346
11347
|
url: '/v1/chains/{chain_name}/trades',
|
|
@@ -11349,6 +11350,7 @@ class OrdersService {
|
|
|
11349
11350
|
},
|
|
11350
11351
|
query: {
|
|
11351
11352
|
'account_address': accountAddress,
|
|
11353
|
+
'from_indexed_at': fromIndexedAt,
|
|
11352
11354
|
'page_size': pageSize,
|
|
11353
11355
|
'sort_by': sortBy,
|
|
11354
11356
|
'sort_direction': sortDirection,
|
|
@@ -11414,6 +11416,16 @@ var CancelledOrderStatus;
|
|
|
11414
11416
|
})(CancelledOrderStatus.cancellation_type || (CancelledOrderStatus.cancellation_type = {}));
|
|
11415
11417
|
})(CancelledOrderStatus || (CancelledOrderStatus = {}));
|
|
11416
11418
|
|
|
11419
|
+
/* istanbul ignore file */
|
|
11420
|
+
/* tslint:disable */
|
|
11421
|
+
/* eslint-disable */
|
|
11422
|
+
var FailedOrderCancellation;
|
|
11423
|
+
(function (FailedOrderCancellation) {
|
|
11424
|
+
(function (reason_code) {
|
|
11425
|
+
reason_code["ALREADY_FILLED"] = "ALREADY_FILLED";
|
|
11426
|
+
})(FailedOrderCancellation.reason_code || (FailedOrderCancellation.reason_code = {}));
|
|
11427
|
+
})(FailedOrderCancellation || (FailedOrderCancellation = {}));
|
|
11428
|
+
|
|
11417
11429
|
/* istanbul ignore file */
|
|
11418
11430
|
/* tslint:disable */
|
|
11419
11431
|
/* eslint-disable */
|
|
@@ -29640,6 +29652,7 @@ var $e055e79256bbc1dd$export$80f4da0d409a629d;
|
|
|
29640
29652
|
CheckoutErrorType["ORDER_FEE_ERROR"] = "ORDER_FEE_ERROR";
|
|
29641
29653
|
CheckoutErrorType["ITEM_REQUIREMENTS_ERROR"] = "ITEM_REQUIREMENTS_ERROR";
|
|
29642
29654
|
CheckoutErrorType["API_ERROR"] = "API_ERROR";
|
|
29655
|
+
CheckoutErrorType["ORDER_EXPIRED_ERROR"] = "ORDER_EXPIRED_ERROR";
|
|
29643
29656
|
})($a8bc256d81a5e2c1$export$e3dc0620abde7f5a || ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a = {}));
|
|
29644
29657
|
class $a8bc256d81a5e2c1$export$b722478a3cbfa3bc extends Error {
|
|
29645
29658
|
message;
|
|
@@ -30093,6 +30106,20 @@ class $fd8a8472dcc3ec2b$export$ef140a6b05dfc786 {
|
|
|
30093
30106
|
|
|
30094
30107
|
|
|
30095
30108
|
|
|
30109
|
+
const $458d407830d66110$export$e6a390ea6399b7d8 = (config, debugString, seconds)=>{
|
|
30110
|
+
// eslint-disable-next-line no-console
|
|
30111
|
+
if (!config.isProduction) console.debug(debugString, seconds);
|
|
30112
|
+
};
|
|
30113
|
+
const $458d407830d66110$export$5280dbcb91c8b391 = async (config, debugString, promise)=>{
|
|
30114
|
+
const startTime = performance.now();
|
|
30115
|
+
const result = await promise;
|
|
30116
|
+
const endTime = performance.now();
|
|
30117
|
+
const elapsedTimeInSeconds = (endTime - startTime) / 1000;
|
|
30118
|
+
$458d407830d66110$export$e6a390ea6399b7d8(config, debugString, elapsedTimeInSeconds);
|
|
30119
|
+
return result;
|
|
30120
|
+
};
|
|
30121
|
+
|
|
30122
|
+
|
|
30096
30123
|
const $1564e43dde50bb61$export$df96cd8d56be0ab1 = async (config, web3Provider, walletAddress)=>await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
|
|
30097
30124
|
const networkInfo = await ($de192de6ef100f9f$export$79f13b4cfaaf0d09)(config, web3Provider);
|
|
30098
30125
|
if (!networkInfo.isSupported) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Chain:${networkInfo.chainId} is not a supported chain`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).CHAIN_NOT_SUPPORTED_ERROR, {
|
|
@@ -30247,12 +30274,12 @@ const $1564e43dde50bb61$export$fee49741664a4d7e = async (config, web3Provider, w
|
|
|
30247
30274
|
// Please remove this hack once https://immutable.atlassian.net/browse/WT-1710
|
|
30248
30275
|
// is done.
|
|
30249
30276
|
const isL1Chain = ($4013c5c91bb535f6$export$9b794d067cdd1af6)(config) === chainId;
|
|
30250
|
-
return
|
|
30277
|
+
return ($458d407830d66110$export$5280dbcb91c8b391)(config, `Time to fetch balances using blockscout for ${chainId}`, $1564e43dde50bb61$export$8c978679845804d4(walletAddress, chainId, isL1Chain ? tokens : []));
|
|
30251
30278
|
}
|
|
30252
30279
|
// This fallback to use ERC20s calls which is a best effort solution
|
|
30253
30280
|
// Fails in fetching data from the RCP calls might result in some
|
|
30254
30281
|
// missing data.
|
|
30255
|
-
return await $1564e43dde50bb61$export$a3238cee431627c6(config, web3Provider, walletAddress, tokens);
|
|
30282
|
+
return await ($458d407830d66110$export$5280dbcb91c8b391)(config, `Time to fetch balances using RPC for ${chainId}`, $1564e43dde50bb61$export$a3238cee431627c6(config, web3Provider, walletAddress, tokens));
|
|
30256
30283
|
};
|
|
30257
30284
|
|
|
30258
30285
|
|
|
@@ -30493,7 +30520,7 @@ async function $67fc622a2b913d5f$export$7cf6178417769841(chainId, config) {
|
|
|
30493
30520
|
overrides: dexConfig?.overrides
|
|
30494
30521
|
});
|
|
30495
30522
|
}
|
|
30496
|
-
|
|
30523
|
+
function $67fc622a2b913d5f$export$c60ce6c6a92bc2ff(config) {
|
|
30497
30524
|
return new (Orderbook)({
|
|
30498
30525
|
baseConfig: {
|
|
30499
30526
|
environment: config.environment
|
|
@@ -31294,8 +31321,8 @@ const $5e9bcae98dc8ff19$export$1165ca270f090a66 = (isDevelopment, isProduction)=
|
|
|
31294
31321
|
|
|
31295
31322
|
|
|
31296
31323
|
|
|
31297
|
-
const $1fda5c40669a566d$export$
|
|
31298
|
-
const $1fda5c40669a566d$export$
|
|
31324
|
+
const $1fda5c40669a566d$export$5d79dcabf4595ae0 = async ()=>true;
|
|
31325
|
+
const $1fda5c40669a566d$export$2c2bcd6e0d9a9969 = async (config)=>{
|
|
31299
31326
|
const availability = ($5e9bcae98dc8ff19$export$1165ca270f090a66)(config.isDevelopment, config.isProduction);
|
|
31300
31327
|
try {
|
|
31301
31328
|
return await availability.checkDexAvailability();
|
|
@@ -31316,18 +31343,18 @@ const $7f2e17f026d4fc8d$export$86d9f998ddda013e = async (config, provider)=>{
|
|
|
31316
31343
|
const geoBlockingChecks = [];
|
|
31317
31344
|
if (availableRoutingOptions.onRamp) geoBlockingChecks.push({
|
|
31318
31345
|
id: "onRamp",
|
|
31319
|
-
promise: ($1fda5c40669a566d$export$
|
|
31346
|
+
promise: ($1fda5c40669a566d$export$5d79dcabf4595ae0)()
|
|
31320
31347
|
});
|
|
31321
31348
|
if (availableRoutingOptions.swap) geoBlockingChecks.push({
|
|
31322
31349
|
id: "swap",
|
|
31323
|
-
promise: ($1fda5c40669a566d$export$
|
|
31350
|
+
promise: ($1fda5c40669a566d$export$2c2bcd6e0d9a9969)(config)
|
|
31324
31351
|
});
|
|
31325
31352
|
if (geoBlockingChecks.length > 0) {
|
|
31326
31353
|
const promises = geoBlockingChecks.map((geoBlockingCheck)=>geoBlockingCheck.promise);
|
|
31327
31354
|
const geoBlockingStatus = await Promise.allSettled(promises);
|
|
31328
31355
|
geoBlockingStatus.forEach((result, index)=>{
|
|
31329
31356
|
const statusId = geoBlockingChecks[index].id;
|
|
31330
|
-
availableRoutingOptions[statusId] = availableRoutingOptions[statusId] && result.status === "fulfilled" &&
|
|
31357
|
+
availableRoutingOptions[statusId] = availableRoutingOptions[statusId] && result.status === "fulfilled" && result.value;
|
|
31331
31358
|
});
|
|
31332
31359
|
}
|
|
31333
31360
|
// Bridge not available if passport provider
|
|
@@ -31434,7 +31461,7 @@ const $049bba630af05555$export$6946a1f17c2bbf26 = async (config, chainId, wallet
|
|
|
31434
31461
|
}
|
|
31435
31462
|
// Resolve all the quotes and link them back to the swappable token
|
|
31436
31463
|
// The swappable token array is in the same position in the array as the quote in the promise array
|
|
31437
|
-
const dexTransactionResponse = await Promise.allSettled(dexTransactionResponsePromises);
|
|
31464
|
+
const dexTransactionResponse = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to resolve swap quotes from the dex", Promise.allSettled(dexTransactionResponsePromises));
|
|
31438
31465
|
dexTransactionResponse.forEach((response, index)=>{
|
|
31439
31466
|
if (response.status === "rejected") return; // Ignore any requests to dex that failed to resolve
|
|
31440
31467
|
const swappableToken = fromToken[index];
|
|
@@ -31451,15 +31478,6 @@ const $049bba630af05555$export$6946a1f17c2bbf26 = async (config, chainId, wallet
|
|
|
31451
31478
|
};
|
|
31452
31479
|
|
|
31453
31480
|
|
|
31454
|
-
const $3ee85f12225c19f3$export$fb80fe94a81a3132 = async (config, dexQuoteCache, walletAddress, requiredToken, swappableTokens)=>{
|
|
31455
|
-
const dexQuotes = dexQuoteCache.get(requiredToken.address);
|
|
31456
|
-
if (dexQuotes && dexQuotes.size > 0) return dexQuotes;
|
|
31457
|
-
const quotes = await ($049bba630af05555$export$6946a1f17c2bbf26)(config, ($4013c5c91bb535f6$export$c9af4e4b001c6476)(config), walletAddress, requiredToken, swappableTokens);
|
|
31458
|
-
dexQuoteCache.set(requiredToken.address, quotes);
|
|
31459
|
-
return quotes;
|
|
31460
|
-
};
|
|
31461
|
-
|
|
31462
|
-
|
|
31463
31481
|
const $91807edfd7057288$var$constructFees = (approvalGasFees, swapGasFees, swapFees)=>{
|
|
31464
31482
|
let approvalGasFeeAmount = (ethers.BigNumber).from(0);
|
|
31465
31483
|
let approvalGasFeeFormatted = "0";
|
|
@@ -31587,11 +31605,17 @@ const $91807edfd7057288$export$7b6318fc1a8067b3 = (l2Balances, approval)=>{
|
|
|
31587
31605
|
approvalGasTokenAddress: approvalGasTokenAddress
|
|
31588
31606
|
};
|
|
31589
31607
|
};
|
|
31590
|
-
const $91807edfd7057288$export$38077235fe748d40 = (l2Balances,
|
|
31608
|
+
const $91807edfd7057288$export$38077235fe748d40 = (l2Balances, approvalFees, swapGasFees, swapFees, tokenBeingSwapped)=>{
|
|
31591
31609
|
// Set up a map of token addresses to amounts for each of the swap fees
|
|
31592
31610
|
const feeMap = new Map();
|
|
31593
31611
|
// Add the approval fee to list of fees
|
|
31594
31612
|
if (approvalFees.approvalGasTokenAddress !== "") feeMap.set(approvalFees.approvalGasTokenAddress, approvalFees.approvalGasFee);
|
|
31613
|
+
// Add the swap gas fee to list of fees
|
|
31614
|
+
if (swapGasFees) {
|
|
31615
|
+
const fee = feeMap.get(swapGasFees.token.address);
|
|
31616
|
+
if (fee) feeMap.set(swapGasFees.token.address, fee.add(swapGasFees.value));
|
|
31617
|
+
else feeMap.set(swapGasFees.token.address, swapGasFees.value);
|
|
31618
|
+
}
|
|
31595
31619
|
// Add the token being swapped to list of fees to ensure the user can cover the fee + the token swap
|
|
31596
31620
|
if (tokenBeingSwapped) {
|
|
31597
31621
|
const fee = feeMap.get(tokenBeingSwapped.address);
|
|
@@ -31640,7 +31664,7 @@ const $91807edfd7057288$export$567a0c83c08c514b = (l2balance, balanceRequirement
|
|
|
31640
31664
|
// that is going to be swapped from another item requirement then return true
|
|
31641
31665
|
return remainingBalance.gte(amountBeingSwapped);
|
|
31642
31666
|
};
|
|
31643
|
-
const $91807edfd7057288$export$8e03ea04d59f2402 = async (config, availableRoutingOptions,
|
|
31667
|
+
const $91807edfd7057288$export$8e03ea04d59f2402 = async (config, availableRoutingOptions, walletAddress, balanceRequirement, tokenBalanceResults, swappableTokens, balanceRequirements)=>{
|
|
31644
31668
|
const fundingSteps = [];
|
|
31645
31669
|
if (!availableRoutingOptions.swap) return fundingSteps;
|
|
31646
31670
|
if (swappableTokens.length === 0) return fundingSteps;
|
|
@@ -31651,7 +31675,7 @@ const $91807edfd7057288$export$8e03ea04d59f2402 = async (config, availableRoutin
|
|
|
31651
31675
|
if (!l2TokenBalanceResult) return fundingSteps;
|
|
31652
31676
|
const l2Balances = l2TokenBalanceResult.balances;
|
|
31653
31677
|
if (l2Balances.length === 0) return fundingSteps;
|
|
31654
|
-
const quotes = await ($
|
|
31678
|
+
const quotes = await ($049bba630af05555$export$6946a1f17c2bbf26)(config, ($4013c5c91bb535f6$export$c9af4e4b001c6476)(config), walletAddress, requiredToken, swappableTokens);
|
|
31655
31679
|
const quoteTokenAddresses = Array.from(quotes.keys());
|
|
31656
31680
|
for (const quoteTokenAddress of quoteTokenAddresses){
|
|
31657
31681
|
const quote = quotes.get(quoteTokenAddress);
|
|
@@ -31668,7 +31692,7 @@ const $91807edfd7057288$export$8e03ea04d59f2402 = async (config, availableRoutin
|
|
|
31668
31692
|
// If user does not have enough to cover approval fees then continue
|
|
31669
31693
|
if (!approvalFees.sufficient) continue;
|
|
31670
31694
|
// If user does not have enough to cover swap fees then continue
|
|
31671
|
-
if (!$91807edfd7057288$export$38077235fe748d40(l2Balances, quote.quote.fees,
|
|
31695
|
+
if (!$91807edfd7057288$export$38077235fe748d40(l2Balances, approvalFees, quote.swap, quote.quote.fees, {
|
|
31672
31696
|
amount: amountOfQuoteTokenRequired.value,
|
|
31673
31697
|
address: quoteTokenAddress
|
|
31674
31698
|
})) continue;
|
|
@@ -32073,13 +32097,14 @@ const $7500587317643fc8$export$c3e193fd573f1a94 = async (config, swappableTokens
|
|
|
32073
32097
|
|
|
32074
32098
|
|
|
32075
32099
|
|
|
32076
|
-
|
|
32100
|
+
|
|
32101
|
+
const $d54df4a884f14123$export$d46f2133747ffd93 = async (config, ownerAddress, requiredTokenAddress, insufficientRequirement, filteredSwappableTokens)=>{
|
|
32077
32102
|
const filteredSwappableTokensAddresses = [];
|
|
32078
32103
|
for (const token of filteredSwappableTokens){
|
|
32079
32104
|
if (!token.address) continue;
|
|
32080
32105
|
filteredSwappableTokensAddresses.push(token.address);
|
|
32081
32106
|
}
|
|
32082
|
-
const dexQuotes = await ($
|
|
32107
|
+
const dexQuotes = await ($049bba630af05555$export$6946a1f17c2bbf26)(config, ($4013c5c91bb535f6$export$c9af4e4b001c6476)(config), ownerAddress, {
|
|
32083
32108
|
address: requiredTokenAddress,
|
|
32084
32109
|
amount: insufficientRequirement.delta.balance
|
|
32085
32110
|
}, filteredSwappableTokensAddresses);
|
|
@@ -32189,7 +32214,7 @@ const $afd57acae9471ac5$export$d9b96654eebdaf2a = (bridgeFundingSteps, swapFundi
|
|
|
32189
32214
|
}
|
|
32190
32215
|
return bridgeAndSwapRoutes;
|
|
32191
32216
|
};
|
|
32192
|
-
const $afd57acae9471ac5$export$f95ed27e871fe308 = async (config, readOnlyProviders, availableRoutingOptions, insufficientRequirement,
|
|
32217
|
+
const $afd57acae9471ac5$export$f95ed27e871fe308 = async (config, readOnlyProviders, availableRoutingOptions, insufficientRequirement, ownerAddress, feeEstimates, tokenBalances, bridgeableTokens, swappableTokens, balanceRequirements)=>{
|
|
32193
32218
|
const { l1balances: l1balances, l2balances: l2balances } = ($7bb5af1d8b5d9127$export$8280985cc3da7882)(config, tokenBalances);
|
|
32194
32219
|
const requiredTokenAddress = insufficientRequirement.required.token.address;
|
|
32195
32220
|
if ($afd57acae9471ac5$export$b94e88f4f8805f71(bridgeableTokens, swappableTokens, l1balances, l2balances, availableRoutingOptions, requiredTokenAddress)) return [];
|
|
@@ -32200,7 +32225,7 @@ const $afd57acae9471ac5$export$f95ed27e871fe308 = async (config, readOnlyProvide
|
|
|
32200
32225
|
const filteredSwappableTokens = $afd57acae9471ac5$export$ed7c59bd8d1bb5a7(requiredTokenAddress, bridgeableTokens, swappableTokens, l1tol2Addresses);
|
|
32201
32226
|
if (filteredSwappableTokens.length === 0) return [];
|
|
32202
32227
|
// Fetch all the dex quotes from the list of swappable tokens
|
|
32203
|
-
const dexQuotes = await ($d54df4a884f14123$export$d46f2133747ffd93)(config,
|
|
32228
|
+
const dexQuotes = await ($d54df4a884f14123$export$d46f2133747ffd93)(config, ownerAddress, requiredTokenAddress, insufficientRequirement, filteredSwappableTokens);
|
|
32204
32229
|
// Construct bridge requirements based on L2 balances, slippage and swap fees
|
|
32205
32230
|
const bridgeRequirements = ($62e968a3dd87940e$export$df667c749c93b110)(dexQuotes, l1balances, l2balances, l1tol2Addresses, balanceRequirements);
|
|
32206
32231
|
if (bridgeRequirements.length === 0) return [];
|
|
@@ -32243,7 +32268,7 @@ const $afd57acae9471ac5$export$f95ed27e871fe308 = async (config, readOnlyProvide
|
|
|
32243
32268
|
// Modify the users L2 balance to include the amount as if the user successfully bridged
|
|
32244
32269
|
const modifiedTokenBalances = $afd57acae9471ac5$var$modifyTokenBalancesWithBridgedAmount(config, tokenBalances, l2balances, bridgedTokens, swappableTokens);
|
|
32245
32270
|
// Call the swap route with the faked bridged balances
|
|
32246
|
-
const swapRoutes = await ($91807edfd7057288$export$8e03ea04d59f2402)(config, availableRoutingOptions,
|
|
32271
|
+
const swapRoutes = await ($91807edfd7057288$export$8e03ea04d59f2402)(config, availableRoutingOptions, ownerAddress, insufficientRequirement, modifiedTokenBalances, swappableTokensAfterBridging, balanceRequirements);
|
|
32247
32272
|
if (!swapRoutes) return [];
|
|
32248
32273
|
const originalBalanceSwapRoutes = $afd57acae9471ac5$export$1fc63300bde5e690(tokenBalances, swapRoutes);
|
|
32249
32274
|
return $afd57acae9471ac5$export$d9b96654eebdaf2a(bridgeResults, originalBalanceSwapRoutes, l1tol2Addresses);
|
|
@@ -32285,6 +32310,7 @@ const $5649bc8af91da370$export$1fb2bd867f4a9be3 = async (config, availableRoutin
|
|
|
32285
32310
|
|
|
32286
32311
|
|
|
32287
32312
|
|
|
32313
|
+
|
|
32288
32314
|
const $c16168a9c28ae4fd$var$hasAvailableRoutingOptions = (availableRoutingOptions)=>availableRoutingOptions.bridge || availableRoutingOptions.swap || availableRoutingOptions.onRamp;
|
|
32289
32315
|
const $c16168a9c28ae4fd$export$31ce7ba1a2956195 = (balanceRequirements)=>{
|
|
32290
32316
|
let insufficientBalanceCount = 0;
|
|
@@ -32308,7 +32334,7 @@ const $c16168a9c28ae4fd$export$ab86023c267660 = async (config, readOnlyProviders
|
|
|
32308
32334
|
if (availableRoutingOptions.bridge && insufficientRequirement) bridgeFundingStep = await ($fa9ac5bfdbbf9dfa$export$ddc7ba2b57d7c5fa)(config, readOnlyProviders, ownerAddress, availableRoutingOptions, bridgeRequirement, tokenBalances, feeEstimates);
|
|
32309
32335
|
return bridgeFundingStep;
|
|
32310
32336
|
};
|
|
32311
|
-
const $c16168a9c28ae4fd$export$814624e957fa0f11 = async (config, availableRoutingOptions, insufficientRequirement,
|
|
32337
|
+
const $c16168a9c28ae4fd$export$814624e957fa0f11 = async (config, availableRoutingOptions, insufficientRequirement, ownerAddress, tokenBalances, swapTokenAllowList, balanceRequirements)=>{
|
|
32312
32338
|
const fundingSteps = [];
|
|
32313
32339
|
if (!availableRoutingOptions.swap) return fundingSteps;
|
|
32314
32340
|
if (insufficientRequirement === undefined) return fundingSteps;
|
|
@@ -32319,9 +32345,9 @@ const $c16168a9c28ae4fd$export$814624e957fa0f11 = async (config, availableRoutin
|
|
|
32319
32345
|
if (swapTokenAllowList.length === 0) return fundingSteps;
|
|
32320
32346
|
const swappableTokens = swapTokenAllowList.filter((token)=>token.address).map((token)=>token.address);
|
|
32321
32347
|
if (swappableTokens.length === 0) return fundingSteps;
|
|
32322
|
-
return await ($91807edfd7057288$export$8e03ea04d59f2402)(config, availableRoutingOptions,
|
|
32348
|
+
return await ($91807edfd7057288$export$8e03ea04d59f2402)(config, availableRoutingOptions, ownerAddress, insufficientRequirement, tokenBalances, swappableTokens, balanceRequirements);
|
|
32323
32349
|
};
|
|
32324
|
-
const $c16168a9c28ae4fd$export$2becd43da9d21f73 = async (config, readOnlyProviders, availableRoutingOptions, insufficientRequirement,
|
|
32350
|
+
const $c16168a9c28ae4fd$export$2becd43da9d21f73 = async (config, readOnlyProviders, availableRoutingOptions, insufficientRequirement, ownerAddress, tokenBalances, tokenAllowList, feeEstimates, balanceRequirements)=>{
|
|
32325
32351
|
if (!insufficientRequirement) return [];
|
|
32326
32352
|
const l1balancesResult = tokenBalances.get(($4013c5c91bb535f6$export$9b794d067cdd1af6)(config));
|
|
32327
32353
|
const l2balancesResult = tokenBalances.get(($4013c5c91bb535f6$export$c9af4e4b001c6476)(config));
|
|
@@ -32339,7 +32365,7 @@ const $c16168a9c28ae4fd$export$2becd43da9d21f73 = async (config, readOnlyProvide
|
|
|
32339
32365
|
});
|
|
32340
32366
|
const swapTokenAllowList = tokenAllowList?.swap ?? [];
|
|
32341
32367
|
if (insufficientRequirement.type !== ($4b58188d47aafe8d$export$1fc8f52ad1810e52).NATIVE && insufficientRequirement.type !== ($4b58188d47aafe8d$export$1fc8f52ad1810e52).ERC20) return [];
|
|
32342
|
-
const routes = await ($afd57acae9471ac5$export$f95ed27e871fe308)(config, readOnlyProviders, availableRoutingOptions, insufficientRequirement,
|
|
32368
|
+
const routes = await ($afd57acae9471ac5$export$f95ed27e871fe308)(config, readOnlyProviders, availableRoutingOptions, insufficientRequirement, ownerAddress, feeEstimates, tokenBalances, bridgeableL1Addresses, swapTokenAllowList, balanceRequirements);
|
|
32343
32369
|
return routes;
|
|
32344
32370
|
};
|
|
32345
32371
|
const $c16168a9c28ae4fd$export$e1b6e4d22d0365ee = async (config, availableRoutingOptions, insufficientRequirement)=>{
|
|
@@ -32361,20 +32387,18 @@ const $c16168a9c28ae4fd$export$92606e71d0a264ff = async (config, ownerAddress, b
|
|
|
32361
32387
|
message: err.message
|
|
32362
32388
|
});
|
|
32363
32389
|
}
|
|
32364
|
-
const tokenBalances = await ($33acec7b4a26c053$export$23ddeb2642d2f9d)(config, readOnlyProviders, ownerAddress, availableRoutingOptions);
|
|
32365
|
-
const allowList = await ($5a5ccedc98d53d25$export$1ad29657d49c5440)(config, tokenBalances, availableRoutingOptions);
|
|
32366
|
-
//
|
|
32390
|
+
const tokenBalances = await ($458d407830d66110$export$5280dbcb91c8b391)(config, "Time to get token balances inside router", ($33acec7b4a26c053$export$23ddeb2642d2f9d)(config, readOnlyProviders, ownerAddress, availableRoutingOptions));
|
|
32391
|
+
const allowList = await ($458d407830d66110$export$5280dbcb91c8b391)(config, "Time to get routing allowlist", ($5a5ccedc98d53d25$export$1ad29657d49c5440)(config, tokenBalances, availableRoutingOptions));
|
|
32392
|
+
// Fee estimate cache
|
|
32367
32393
|
const feeEstimates = new Map();
|
|
32368
|
-
// Dex quotes cache
|
|
32369
|
-
const dexQuoteCache = new Map();
|
|
32370
32394
|
// Ensures only 1 balance requirement is insufficient
|
|
32371
32395
|
const insufficientRequirement = $c16168a9c28ae4fd$export$31ce7ba1a2956195(balanceRequirements);
|
|
32372
32396
|
const routePromises = [];
|
|
32373
32397
|
routePromises.push($c16168a9c28ae4fd$export$ab86023c267660(config, readOnlyProviders, availableRoutingOptions, insufficientRequirement, ownerAddress, tokenBalances, feeEstimates));
|
|
32374
|
-
routePromises.push($c16168a9c28ae4fd$export$814624e957fa0f11(config, availableRoutingOptions, insufficientRequirement,
|
|
32398
|
+
routePromises.push($c16168a9c28ae4fd$export$814624e957fa0f11(config, availableRoutingOptions, insufficientRequirement, ownerAddress, tokenBalances, allowList.swap, balanceRequirements));
|
|
32375
32399
|
routePromises.push($c16168a9c28ae4fd$export$e1b6e4d22d0365ee(config, availableRoutingOptions, insufficientRequirement));
|
|
32376
|
-
routePromises.push($c16168a9c28ae4fd$export$2becd43da9d21f73(config, readOnlyProviders, availableRoutingOptions, insufficientRequirement,
|
|
32377
|
-
const resolved = await Promise.all(routePromises);
|
|
32400
|
+
routePromises.push($c16168a9c28ae4fd$export$2becd43da9d21f73(config, readOnlyProviders, availableRoutingOptions, insufficientRequirement, ownerAddress, tokenBalances, allowList, feeEstimates, balanceRequirements));
|
|
32401
|
+
const resolved = await ($458d407830d66110$export$5280dbcb91c8b391)(config, "Time to resolve all routes", Promise.all(routePromises));
|
|
32378
32402
|
let bridgeFundingStep;
|
|
32379
32403
|
let swapFundingSteps = [];
|
|
32380
32404
|
let onRampFundingStep;
|
|
@@ -32441,26 +32465,31 @@ const $c16168a9c28ae4fd$export$92606e71d0a264ff = async (config, ownerAddress, b
|
|
|
32441
32465
|
};
|
|
32442
32466
|
|
|
32443
32467
|
|
|
32468
|
+
|
|
32444
32469
|
const $0e7419077c373b24$export$9e073f9ada8c81e6 = async (config, provider, itemRequirements, transactionOrGasAmount)=>{
|
|
32445
32470
|
const ownerAddress = await provider.getSigner().getAddress();
|
|
32446
32471
|
let aggregatedItems = ($074f75878f618031$export$c804c9ade5c28607)(itemRequirements);
|
|
32447
|
-
const
|
|
32448
|
-
const
|
|
32449
|
-
const
|
|
32450
|
-
|
|
32472
|
+
const erc20AllowancePromise = ($fc8b338399d890f3$export$d93c00812189e36)(provider, ownerAddress, aggregatedItems);
|
|
32473
|
+
const erc721AllowancePromise = ($35c3fc7013888ba5$export$be546c525d418988)(provider, ownerAddress, aggregatedItems);
|
|
32474
|
+
const resolvedAllowances = await ($458d407830d66110$export$5280dbcb91c8b391)(config, "Time to calculate token allowances", Promise.all([
|
|
32475
|
+
erc20AllowancePromise,
|
|
32476
|
+
erc721AllowancePromise
|
|
32477
|
+
]));
|
|
32478
|
+
const aggregatedAllowances = ($ddc6bcd0896481e5$export$2fbfa41a4de56a89)(resolvedAllowances[0], resolvedAllowances[1]);
|
|
32479
|
+
const gasItem = await ($458d407830d66110$export$5280dbcb91c8b391)(config, "Time to run gas calculator", ($7d1bfafb81e64d74$export$3a4140bd9e983e4e)(provider, aggregatedAllowances, transactionOrGasAmount));
|
|
32451
32480
|
if (gasItem !== null) {
|
|
32452
32481
|
aggregatedItems.push(gasItem);
|
|
32453
32482
|
aggregatedItems = ($074f75878f618031$export$c804c9ade5c28607)(aggregatedItems);
|
|
32454
32483
|
}
|
|
32455
|
-
const balanceCheckResult = await ($beb896e098e41faf$export$ddfc885f43c3cb6e)(config, provider, ownerAddress, aggregatedItems);
|
|
32484
|
+
const balanceCheckResult = await ($458d407830d66110$export$5280dbcb91c8b391)(config, "Time to run balance checks", ($beb896e098e41faf$export$ddfc885f43c3cb6e)(config, provider, ownerAddress, aggregatedItems));
|
|
32456
32485
|
const { sufficient: sufficient } = balanceCheckResult;
|
|
32457
32486
|
const transactionRequirements = balanceCheckResult.balanceRequirements;
|
|
32458
32487
|
if (sufficient) return {
|
|
32459
32488
|
sufficient: sufficient,
|
|
32460
32489
|
transactionRequirements: transactionRequirements
|
|
32461
32490
|
};
|
|
32462
|
-
const availableRoutingOptions = await ($7f2e17f026d4fc8d$export$86d9f998ddda013e)(config, provider);
|
|
32463
|
-
const routingOutcome = await ($c16168a9c28ae4fd$export$92606e71d0a264ff)(config, ownerAddress, balanceCheckResult, availableRoutingOptions);
|
|
32491
|
+
const availableRoutingOptions = await ($458d407830d66110$export$5280dbcb91c8b391)(config, "Time to fetch available routing options", ($7f2e17f026d4fc8d$export$86d9f998ddda013e)(config, provider));
|
|
32492
|
+
const routingOutcome = await ($458d407830d66110$export$5280dbcb91c8b391)(config, "Total time to run the routing calculator", ($c16168a9c28ae4fd$export$92606e71d0a264ff)(config, ownerAddress, balanceCheckResult, availableRoutingOptions));
|
|
32464
32493
|
return {
|
|
32465
32494
|
sufficient: sufficient,
|
|
32466
32495
|
transactionRequirements: transactionRequirements,
|
|
@@ -32643,6 +32672,7 @@ const $9051cee080948594$export$1e69c9cfc42e28d8 = (orderFees, weiAmount, decimal
|
|
|
32643
32672
|
};
|
|
32644
32673
|
|
|
32645
32674
|
|
|
32675
|
+
|
|
32646
32676
|
const $64863c39386de592$export$4249179755829904 = (type, contractAddress, amount, spenderAddress)=>{
|
|
32647
32677
|
switch(type){
|
|
32648
32678
|
case ($4b58188d47aafe8d$export$1fc8f52ad1810e52).ERC20:
|
|
@@ -32681,8 +32711,8 @@ const $64863c39386de592$export$7f8e2b98eca5a7f0 = async (config, provider, order
|
|
|
32681
32711
|
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);
|
|
32682
32712
|
const { id: id, takerFees: takerFees } = orders[0];
|
|
32683
32713
|
try {
|
|
32684
|
-
orderbook =
|
|
32685
|
-
order = await orderbook.getListing(id);
|
|
32714
|
+
orderbook = $67fc622a2b913d5f$export$c60ce6c6a92bc2ff(config);
|
|
32715
|
+
order = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to fetch the listing from the orderbook", orderbook.getListing(id));
|
|
32686
32716
|
const { seaportContractAddress: seaportContractAddress } = orderbook.config();
|
|
32687
32717
|
spenderAddress = seaportContractAddress;
|
|
32688
32718
|
} catch (err) {
|
|
@@ -32699,23 +32729,34 @@ const $64863c39386de592$export$7f8e2b98eca5a7f0 = async (config, provider, order
|
|
|
32699
32729
|
let decimals = 18;
|
|
32700
32730
|
if (order.result.buy[0].type === "ERC20") {
|
|
32701
32731
|
const tokenContract = $06a6c5c23f7f2479$export$fbbc17f6e6e58544(order.result.buy[0].contractAddress, ($d85ad1457a3f1a83$export$db5daa1b5156ccfe), provider);
|
|
32702
|
-
decimals = await tokenContract.decimals();
|
|
32732
|
+
decimals = await ($458d407830d66110$export$5280dbcb91c8b391)(config, "Time to get decimals of token contract for the buy token", tokenContract.decimals());
|
|
32703
32733
|
}
|
|
32704
32734
|
let fees = [];
|
|
32705
32735
|
if (takerFees && takerFees.length > 0) fees = ($9051cee080948594$export$1e69c9cfc42e28d8)(takerFees, buyToken.amount, decimals);
|
|
32706
32736
|
let unsignedApprovalTransactions = [];
|
|
32707
32737
|
let unsignedFulfillmentTransactions = [];
|
|
32708
32738
|
let orderActions = [];
|
|
32739
|
+
const fulfillOrderStartTime = performance.now();
|
|
32709
32740
|
try {
|
|
32710
|
-
const fulfillerAddress = await provider.getSigner().getAddress();
|
|
32711
|
-
const { actions: actions } = await orderbook.fulfillOrder(id, fulfillerAddress, fees);
|
|
32741
|
+
const fulfillerAddress = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to get the address from the provider", provider.getSigner().getAddress());
|
|
32742
|
+
const { actions: actions } = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to call fulfillOrder from the orderbook", orderbook.fulfillOrder(id, fulfillerAddress, fees));
|
|
32712
32743
|
orderActions = actions;
|
|
32713
|
-
unsignedApprovalTransactions = await (0, $a7367d01c6e76b1c$export$f64a20a30eb98855)(actions);
|
|
32714
|
-
} catch
|
|
32715
|
-
|
|
32744
|
+
unsignedApprovalTransactions = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to construct the unsigned approval transactions", (0, $a7367d01c6e76b1c$export$f64a20a30eb98855)(actions));
|
|
32745
|
+
} catch (err) {
|
|
32746
|
+
const elapsedTimeInSeconds = (performance.now() - fulfillOrderStartTime) / 1000;
|
|
32747
|
+
($458d407830d66110$export$e6a390ea6399b7d8)(config, "Time to call fulfillOrder from the orderbook", elapsedTimeInSeconds);
|
|
32748
|
+
if (err.message.includes((OrderStatusName).EXPIRED)) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Order is expired", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).ORDER_EXPIRED_ERROR, {
|
|
32749
|
+
orderId: id
|
|
32750
|
+
});
|
|
32751
|
+
// The balances error will be handled by bulk order fulfillment but for now we
|
|
32752
|
+
// need to assert on this string to check that the error is not a balances error
|
|
32753
|
+
if (!err.message.includes("The fulfiller does not have the balances needed to fulfill")) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Error occurred while trying to fulfill the order", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).FULFILL_ORDER_LISTING_ERROR, {
|
|
32754
|
+
orderId: id,
|
|
32755
|
+
message: err.message
|
|
32756
|
+
});
|
|
32716
32757
|
}
|
|
32717
32758
|
try {
|
|
32718
|
-
unsignedFulfillmentTransactions = await (0, $a7367d01c6e76b1c$export$396bd6ce7d3ab533)(orderActions);
|
|
32759
|
+
unsignedFulfillmentTransactions = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to construct the unsigned fulfillment transactions", (0, $a7367d01c6e76b1c$export$396bd6ce7d3ab533)(orderActions));
|
|
32719
32760
|
} catch {
|
|
32720
32761
|
// if cannot estimate gas then silently continue and use gas limit in smartCheckout
|
|
32721
32762
|
// but get the fulfillment transactions after they have approved the spending
|
|
@@ -32747,7 +32788,7 @@ const $64863c39386de592$export$7f8e2b98eca5a7f0 = async (config, provider, order
|
|
|
32747
32788
|
const itemRequirements = [
|
|
32748
32789
|
$64863c39386de592$export$4249179755829904(type, contractAddress, amount, spenderAddress)
|
|
32749
32790
|
];
|
|
32750
|
-
const smartCheckoutResult = await ($0e7419077c373b24$export$9e073f9ada8c81e6)(config, provider, itemRequirements, $64863c39386de592$export$8f2ff92ab8657f0b(gasLimit, unsignedFulfillmentTransactions));
|
|
32791
|
+
const smartCheckoutResult = await ($458d407830d66110$export$5280dbcb91c8b391)(config, "Total time running smart checkout", ($0e7419077c373b24$export$9e073f9ada8c81e6)(config, provider, itemRequirements, $64863c39386de592$export$8f2ff92ab8657f0b(gasLimit, unsignedFulfillmentTransactions)));
|
|
32751
32792
|
if (smartCheckoutResult.sufficient) {
|
|
32752
32793
|
const approvalResult = await ($25ac589234c10b67$export$19693ca396db083e)(provider, unsignedApprovalTransactions);
|
|
32753
32794
|
if (approvalResult.type === ($d855a5ba32004345$export$f51b97f3aaf2d5a8).FAILED) return {
|
|
@@ -32789,15 +32830,16 @@ const $64863c39386de592$export$7f8e2b98eca5a7f0 = async (config, provider, order
|
|
|
32789
32830
|
|
|
32790
32831
|
|
|
32791
32832
|
|
|
32833
|
+
|
|
32792
32834
|
const $9c3db1bb9c8b69d3$export$70b61ad426ddbe54 = async (config, provider, orderIds)=>{
|
|
32793
32835
|
let unsignedCancelOrderTransaction;
|
|
32794
32836
|
if (orderIds.length === 0) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("No orderIds were provided to the orderIds array. Please provide at least one orderId.", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).CANCEL_ORDER_LISTING_ERROR);
|
|
32795
32837
|
// Update this when bulk cancel is supported
|
|
32796
32838
|
const orderId = orderIds[0];
|
|
32797
32839
|
try {
|
|
32798
|
-
const offererAddress = await provider.getSigner().getAddress();
|
|
32799
|
-
const orderbook =
|
|
32800
|
-
const cancelOrderResponse = await orderbook.cancelOrder(orderId, offererAddress);
|
|
32840
|
+
const offererAddress = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to get the address from the provider", provider.getSigner().getAddress());
|
|
32841
|
+
const orderbook = $67fc622a2b913d5f$export$c60ce6c6a92bc2ff(config);
|
|
32842
|
+
const cancelOrderResponse = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to get the cancel order from the orderbook", orderbook.cancelOrder(orderId, offererAddress));
|
|
32801
32843
|
unsignedCancelOrderTransaction = cancelOrderResponse.unsignedCancelOrderTransaction;
|
|
32802
32844
|
} catch (err) {
|
|
32803
32845
|
throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("An error occurred while cancelling the order listing", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).CANCEL_ORDER_LISTING_ERROR, {
|
|
@@ -32830,6 +32872,7 @@ const $9c3db1bb9c8b69d3$export$70b61ad426ddbe54 = async (config, provider, order
|
|
|
32830
32872
|
|
|
32831
32873
|
|
|
32832
32874
|
|
|
32875
|
+
|
|
32833
32876
|
const $9085b221b72ac69e$export$af768ccdf17d5c04 = (id, contractAddress, spenderAddress)=>({
|
|
32834
32877
|
type: ($4b58188d47aafe8d$export$1fc8f52ad1810e52).ERC721,
|
|
32835
32878
|
id: id,
|
|
@@ -32858,15 +32901,15 @@ const $9085b221b72ac69e$export$e761f9e0703de895 = async (config, provider, order
|
|
|
32858
32901
|
if (buyToken.type === ($4b58188d47aafe8d$export$1fc8f52ad1810e52).ERC20) {
|
|
32859
32902
|
// get this from the allowed list
|
|
32860
32903
|
const buyTokenContract = new (ethers.Contract)(buyToken.contractAddress, JSON.stringify(($d85ad1457a3f1a83$export$db5daa1b5156ccfe)), provider);
|
|
32861
|
-
decimals = await buyTokenContract.decimals();
|
|
32904
|
+
decimals = await ($458d407830d66110$export$5280dbcb91c8b391)(config, "Time to get decimals of token contract for the buy token", buyTokenContract.decimals());
|
|
32862
32905
|
}
|
|
32863
32906
|
const buyTokenOrNative = $9085b221b72ac69e$export$586d02673c66d423(buyToken, decimals);
|
|
32864
32907
|
try {
|
|
32865
|
-
const walletAddress = await provider.getSigner().getAddress();
|
|
32866
|
-
orderbook =
|
|
32908
|
+
const walletAddress = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to get the address from the provider", provider.getSigner().getAddress());
|
|
32909
|
+
orderbook = $67fc622a2b913d5f$export$c60ce6c6a92bc2ff(config);
|
|
32867
32910
|
const { seaportContractAddress: seaportContractAddress } = orderbook.config();
|
|
32868
32911
|
spenderAddress = seaportContractAddress;
|
|
32869
|
-
listing = await orderbook.prepareListing({
|
|
32912
|
+
listing = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to prepare the listing from the orderbook", orderbook.prepareListing({
|
|
32870
32913
|
makerAddress: walletAddress,
|
|
32871
32914
|
buy: buyTokenOrNative,
|
|
32872
32915
|
sell: {
|
|
@@ -32874,7 +32917,7 @@ const $9085b221b72ac69e$export$e761f9e0703de895 = async (config, provider, order
|
|
|
32874
32917
|
contractAddress: sellToken.collectionAddress,
|
|
32875
32918
|
tokenId: sellToken.id
|
|
32876
32919
|
}
|
|
32877
|
-
});
|
|
32920
|
+
}));
|
|
32878
32921
|
} catch (err) {
|
|
32879
32922
|
throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("An error occurred while preparing the listing", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PREPARE_ORDER_LISTING_ERROR, {
|
|
32880
32923
|
message: err.message,
|
|
@@ -32885,13 +32928,13 @@ const $9085b221b72ac69e$export$e761f9e0703de895 = async (config, provider, order
|
|
|
32885
32928
|
const itemRequirements = [
|
|
32886
32929
|
$9085b221b72ac69e$export$af768ccdf17d5c04(sellToken.id, sellToken.collectionAddress, spenderAddress)
|
|
32887
32930
|
];
|
|
32888
|
-
const smartCheckoutResult = await ($0e7419077c373b24$export$9e073f9ada8c81e6)(config, provider, itemRequirements, {
|
|
32931
|
+
const smartCheckoutResult = await ($458d407830d66110$export$5280dbcb91c8b391)(config, "Total time running smart checkout", ($0e7419077c373b24$export$9e073f9ada8c81e6)(config, provider, itemRequirements, {
|
|
32889
32932
|
type: ($4b58188d47aafe8d$export$65c64e46348ee3c1).GAS,
|
|
32890
32933
|
gasToken: {
|
|
32891
32934
|
type: ($4b58188d47aafe8d$export$537fa3efd10ed435).NATIVE,
|
|
32892
32935
|
limit: (ethers.BigNumber).from((constants).estimatedFulfillmentGasGwei)
|
|
32893
32936
|
}
|
|
32894
|
-
});
|
|
32937
|
+
}));
|
|
32895
32938
|
if (smartCheckoutResult.sufficient) {
|
|
32896
32939
|
const unsignedTransactions = await ($a7367d01c6e76b1c$export$c5b3365853cb6159)(listing.actions);
|
|
32897
32940
|
const approvalResult = await ($25ac589234c10b67$export$19693ca396db083e)(provider, unsignedTransactions.approvalTransactions);
|
|
@@ -33295,7 +33338,7 @@ var $045213b18e9f1f94$export$75be0f6af9650f2c;
|
|
|
33295
33338
|
})($045213b18e9f1f94$export$75be0f6af9650f2c || ($045213b18e9f1f94$export$75be0f6af9650f2c = {}));
|
|
33296
33339
|
|
|
33297
33340
|
|
|
33298
|
-
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.27.
|
|
33341
|
+
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.27.13";
|
|
33299
33342
|
const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
|
|
33300
33343
|
const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
|
|
33301
33344
|
|