@imtbl/sdk 0.18.2 → 0.18.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.js +2 -2
- package/dist/checkout_sdk.js +46 -3
- package/dist/checkout_widgets.js +1 -1
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +6 -6
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +49 -6
- package/dist/index.js +49 -6
- package/dist/passport.js +2 -2
- package/package.json +2 -1
package/dist/checkout_sdk.js
CHANGED
|
@@ -19537,7 +19537,7 @@ class APIError extends Error {
|
|
|
19537
19537
|
|
|
19538
19538
|
/* eslint-disable implicit-arrow-linebreak */
|
|
19539
19539
|
const defaultHeaders = {
|
|
19540
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.18.
|
|
19540
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.18.3',
|
|
19541
19541
|
};
|
|
19542
19542
|
/**
|
|
19543
19543
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -22421,6 +22421,34 @@ const $91807edfd7057288$export$8e03ea04d59f2402 = async (config, availableRoutin
|
|
|
22421
22421
|
|
|
22422
22422
|
|
|
22423
22423
|
|
|
22424
|
+
|
|
22425
|
+
|
|
22426
|
+
|
|
22427
|
+
const $5649bc8af91da370$export$1fb2bd867f4a9be3 = async (config, availableRoutingOptions, balanceRequirement)=>{
|
|
22428
|
+
if (balanceRequirement.type !== ($4b58188d47aafe8d$export$1fc8f52ad1810e52).ERC20 && balanceRequirement.type !== ($4b58188d47aafe8d$export$1fc8f52ad1810e52).NATIVE) return undefined;
|
|
22429
|
+
const requiredBalance = balanceRequirement.required;
|
|
22430
|
+
let hasAllowList = false;
|
|
22431
|
+
const onRampProvidersAllowList = await ($5a5ccedc98d53d25$export$9ec9fc71f3ce62c4)(config, availableRoutingOptions);
|
|
22432
|
+
Object.values(onRampProvidersAllowList).forEach((onRampAllowList)=>{
|
|
22433
|
+
if (onRampAllowList.length > 0 && !hasAllowList) hasAllowList = !!onRampAllowList.find((token)=>token.address === requiredBalance.token?.address);
|
|
22434
|
+
});
|
|
22435
|
+
if (!hasAllowList) return undefined;
|
|
22436
|
+
return {
|
|
22437
|
+
type: ($4b58188d47aafe8d$export$3af78bb3e8650ee6).ONRAMP,
|
|
22438
|
+
chainId: ($4013c5c91bb535f6$export$c9af4e4b001c6476)(config),
|
|
22439
|
+
asset: {
|
|
22440
|
+
balance: requiredBalance.balance,
|
|
22441
|
+
formattedBalance: requiredBalance.formattedBalance,
|
|
22442
|
+
token: {
|
|
22443
|
+
...requiredBalance.token
|
|
22444
|
+
}
|
|
22445
|
+
}
|
|
22446
|
+
};
|
|
22447
|
+
};
|
|
22448
|
+
|
|
22449
|
+
|
|
22450
|
+
|
|
22451
|
+
|
|
22424
22452
|
const $c16168a9c28ae4fd$export$31ce7ba1a2956195 = (balanceRequirements)=>{
|
|
22425
22453
|
let insufficientBalanceCount = 0;
|
|
22426
22454
|
let insufficientRequirement;
|
|
@@ -22444,6 +22472,12 @@ const $c16168a9c28ae4fd$export$c39a7b7dc167cdb4 = async (config, availableRoutin
|
|
|
22444
22472
|
const swapFundingStep = await ($91807edfd7057288$export$8e03ea04d59f2402)(config, availableRoutingOptions, dexQuoteCache, ownerAddress, insufficientRequirement, tokenBalances, swappableTokens);
|
|
22445
22473
|
return swapFundingStep;
|
|
22446
22474
|
};
|
|
22475
|
+
const $c16168a9c28ae4fd$export$e1b6e4d22d0365ee = async (config, availableRoutingOptions, insufficientRequirement)=>{
|
|
22476
|
+
if (!availableRoutingOptions.onRamp) return undefined;
|
|
22477
|
+
if (insufficientRequirement === undefined) return undefined;
|
|
22478
|
+
const onRampFundingStep = await ($5649bc8af91da370$export$1fb2bd867f4a9be3)(config, availableRoutingOptions, insufficientRequirement);
|
|
22479
|
+
return onRampFundingStep;
|
|
22480
|
+
};
|
|
22447
22481
|
const $c16168a9c28ae4fd$export$92606e71d0a264ff = async (config, ownerAddress, balanceRequirements, availableRoutingOptions)=>{
|
|
22448
22482
|
let readOnlyProviders;
|
|
22449
22483
|
try {
|
|
@@ -22464,7 +22498,7 @@ const $c16168a9c28ae4fd$export$92606e71d0a264ff = async (config, ownerAddress, b
|
|
|
22464
22498
|
let bridgeFundingStep;
|
|
22465
22499
|
if (availableRoutingOptions.bridge && insufficientRequirement) bridgeFundingStep = await ($fa9ac5bfdbbf9dfa$export$ddc7ba2b57d7c5fa)(config, readOnlyProviders, ownerAddress, availableRoutingOptions, insufficientRequirement, tokenBalances, feeEstimates);
|
|
22466
22500
|
const swapFundingStep = await $c16168a9c28ae4fd$export$c39a7b7dc167cdb4(config, availableRoutingOptions, insufficientRequirement, dexQuoteCache, ownerAddress, tokenBalances, allowList.swap);
|
|
22467
|
-
|
|
22501
|
+
const onRampFundingStep = await $c16168a9c28ae4fd$export$e1b6e4d22d0365ee(config, availableRoutingOptions, insufficientRequirement);
|
|
22468
22502
|
// Check swap routes
|
|
22469
22503
|
// > Could bridge first
|
|
22470
22504
|
// > Could on-ramp first
|
|
@@ -22477,7 +22511,7 @@ const $c16168a9c28ae4fd$export$92606e71d0a264ff = async (config, ownerAddress, b
|
|
|
22477
22511
|
fundingRoutes: []
|
|
22478
22512
|
};
|
|
22479
22513
|
let priority = 0;
|
|
22480
|
-
if (bridgeFundingStep || swapFundingStep) {
|
|
22514
|
+
if (bridgeFundingStep || swapFundingStep || onRampFundingStep) {
|
|
22481
22515
|
response.response.type = ($b23305044c0e096a$export$3057de18ac0c076).ROUTES_FOUND;
|
|
22482
22516
|
response.response.message = "Routes found";
|
|
22483
22517
|
}
|
|
@@ -22499,6 +22533,15 @@ const $c16168a9c28ae4fd$export$92606e71d0a264ff = async (config, ownerAddress, b
|
|
|
22499
22533
|
]
|
|
22500
22534
|
});
|
|
22501
22535
|
}
|
|
22536
|
+
if (onRampFundingStep) {
|
|
22537
|
+
priority++;
|
|
22538
|
+
response.fundingRoutes.push({
|
|
22539
|
+
priority: priority,
|
|
22540
|
+
steps: [
|
|
22541
|
+
onRampFundingStep
|
|
22542
|
+
]
|
|
22543
|
+
});
|
|
22544
|
+
}
|
|
22502
22545
|
return response;
|
|
22503
22546
|
};
|
|
22504
22547
|
|
package/dist/checkout_widgets.js
CHANGED
|
@@ -4,7 +4,7 @@ import { useEffect } from 'react';
|
|
|
4
4
|
function $parcel$export(e, n, v, s) {
|
|
5
5
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
6
6
|
}
|
|
7
|
-
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.18.
|
|
7
|
+
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.18.3";
|
|
8
8
|
const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
|
|
9
9
|
const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
|
|
10
10
|
|
|
@@ -16,7 +16,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
16
16
|
chainID,
|
|
17
17
|
coreContractAddress,
|
|
18
18
|
registrationContractAddress,
|
|
19
|
-
sdkVersion: 'ts-immutable-sdk-0.18.
|
|
19
|
+
sdkVersion: 'ts-immutable-sdk-0.18.3',
|
|
20
20
|
});
|
|
21
21
|
/**
|
|
22
22
|
* Sets `sdkVersion` at the time of build
|