@imtbl/sdk 1.30.0-alpha.1 → 1.30.0-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 +2 -2
- package/dist/browser/checkout/{BridgeWidget-b488c49c.js → BridgeWidget-2a670c8a.js} +1 -1
- package/dist/browser/checkout/{HorizontalMenu-94558d7e.js → HorizontalMenu-b27619a9.js} +1 -1
- package/dist/browser/checkout/{OnRampWidget-cf3dad47.js → OnRampWidget-4a764ba3.js} +1 -1
- package/dist/browser/checkout/{SaleWidget-e68a74b5.js → SaleWidget-bd87c96c.js} +1 -1
- package/dist/browser/checkout/{SpendingCapHero-277a2aed.js → SpendingCapHero-fbde4158.js} +1 -1
- package/dist/browser/checkout/{SwapWidget-f1c4e02c.js → SwapWidget-73986871.js} +1 -1
- package/dist/browser/checkout/{TopUpView-0bcbc762.js → TopUpView-49db4e0c.js} +1 -1
- package/dist/browser/checkout/{WalletWidget-d302dc44.js → WalletWidget-9af01453.js} +1 -1
- package/dist/browser/checkout/{auto-track-f9611a2a.js → auto-track-fe6fb084.js} +1 -1
- package/dist/browser/checkout/{balance-3d411bbd.js → balance-11636d12.js} +1 -1
- package/dist/browser/checkout/{index-adcf7b3e.js → index-376396ce.js} +1 -1
- package/dist/browser/checkout/{index-0662954f.js → index-72581709.js} +1 -1
- package/dist/browser/checkout/{index-4da0c2bb.js → index-9493d2b3.js} +2 -2
- package/dist/browser/checkout/{index-3db0886f.js → index-be1e7f3b.js} +1 -1
- package/dist/browser/checkout/{index-266a0a59.js → index-dc45bf6b.js} +1 -1
- package/dist/browser/checkout/{index-d9350375.js → index-e2a7040c.js} +1 -1
- package/dist/browser/checkout/{index-939bb675.js → index-ea3db59e.js} +1 -1
- package/dist/browser/checkout/index-f4000748.js +1 -0
- package/dist/browser/checkout/{index.umd-4ad5ee36.js → index.umd-44a60fe6.js} +1 -1
- package/dist/browser/checkout/{retry-cd8de993.js → retry-427ffe34.js} +1 -1
- package/dist/browser/checkout/sdk.js +4 -4
- package/dist/browser/checkout/widgets-esm.js +1 -1
- package/dist/browser/checkout/widgets.js +1 -1
- package/dist/checkout.d.ts +4 -2
- package/dist/checkout.js +28 -19
- package/dist/config.js +1 -1
- package/dist/index.browser.js +4 -4
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +31 -22
- package/dist/index.d.ts +4 -2
- package/dist/index.js +31 -22
- package/dist/orderbook.js +1 -1
- package/dist/passport.js +4 -4
- package/dist/x.js +3 -3
- package/package.json +1 -1
- package/dist/browser/checkout/index-57dbdf1d.js +0 -1
package/dist/index.cjs
CHANGED
|
@@ -183,7 +183,7 @@ const flattenProperties$1 = (properties) => {
|
|
|
183
183
|
};
|
|
184
184
|
|
|
185
185
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
186
|
-
const SDK_VERSION$1 = '1.30.0-alpha.
|
|
186
|
+
const SDK_VERSION$1 = '1.30.0-alpha.2';
|
|
187
187
|
const getFrameParentDomain$1 = () => {
|
|
188
188
|
if (isNode$1()) {
|
|
189
189
|
return '';
|
|
@@ -14194,7 +14194,7 @@ class MultiRollupApiClients {
|
|
|
14194
14194
|
}
|
|
14195
14195
|
|
|
14196
14196
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
14197
|
-
const defaultHeaders$2 = { 'x-sdk-version': 'ts-immutable-sdk-1.30.0-alpha.
|
|
14197
|
+
const defaultHeaders$2 = { 'x-sdk-version': 'ts-immutable-sdk-1.30.0-alpha.2' };
|
|
14198
14198
|
const createConfig$1 = ({ basePath, headers, }) => {
|
|
14199
14199
|
if (!basePath.trim()) {
|
|
14200
14200
|
throw Error('basePath can not be empty');
|
|
@@ -14266,7 +14266,7 @@ class APIError extends Error {
|
|
|
14266
14266
|
|
|
14267
14267
|
/* eslint-disable implicit-arrow-linebreak */
|
|
14268
14268
|
const defaultHeaders$1 = {
|
|
14269
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.30.0-alpha.
|
|
14269
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.30.0-alpha.2',
|
|
14270
14270
|
};
|
|
14271
14271
|
/**
|
|
14272
14272
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -14740,7 +14740,7 @@ var blockchain_data = /*#__PURE__*/Object.freeze({
|
|
|
14740
14740
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
14741
14741
|
class ApiConfiguration extends index$2.Configuration {
|
|
14742
14742
|
}
|
|
14743
|
-
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.30.0-alpha.
|
|
14743
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.30.0-alpha.2' };
|
|
14744
14744
|
/**
|
|
14745
14745
|
* @dev use createImmutableXConfiguration instead
|
|
14746
14746
|
*/
|
|
@@ -14779,7 +14779,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
14779
14779
|
chainID,
|
|
14780
14780
|
coreContractAddress,
|
|
14781
14781
|
registrationContractAddress,
|
|
14782
|
-
sdkVersion: 'ts-immutable-sdk-1.30.0-alpha.
|
|
14782
|
+
sdkVersion: 'ts-immutable-sdk-1.30.0-alpha.2',
|
|
14783
14783
|
baseConfig,
|
|
14784
14784
|
});
|
|
14785
14785
|
const production = ({ baseConfig }) => createImmutableXConfiguration({
|
|
@@ -57535,7 +57535,7 @@ const flattenProperties = (properties) => {
|
|
|
57535
57535
|
};
|
|
57536
57536
|
|
|
57537
57537
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
57538
|
-
const SDK_VERSION = '1.30.0-alpha.
|
|
57538
|
+
const SDK_VERSION = '1.30.0-alpha.2';
|
|
57539
57539
|
const getFrameParentDomain = () => {
|
|
57540
57540
|
if (isNode()) {
|
|
57541
57541
|
return '';
|
|
@@ -62756,7 +62756,7 @@ const IMMUTABLE_ZKVEM_GAS_OVERRIDES = {
|
|
|
62756
62756
|
maxPriorityFeePerGas: ethers.BigNumber.from(10e9),
|
|
62757
62757
|
};
|
|
62758
62758
|
|
|
62759
|
-
const SDK_VERSION_MARKER = '1.30.0-alpha.
|
|
62759
|
+
const SDK_VERSION_MARKER = '1.30.0-alpha.2';
|
|
62760
62760
|
// This SDK version is replaced by the `yarn build` command ran on the root level
|
|
62761
62761
|
const globalPackageVersion = () => SDK_VERSION_MARKER;
|
|
62762
62762
|
|
|
@@ -65804,7 +65804,7 @@ const routingCalculator = async (config, ownerAddress, balanceRequirements, avai
|
|
|
65804
65804
|
};
|
|
65805
65805
|
};
|
|
65806
65806
|
|
|
65807
|
-
const
|
|
65807
|
+
const overrideBalanceCheckResult = (balanceCheckResult) => {
|
|
65808
65808
|
const modifiedRequirements = balanceCheckResult.balanceRequirements.map((requirement) => {
|
|
65809
65809
|
if (requirement.type === ItemType.ERC20 && requirement.sufficient) {
|
|
65810
65810
|
return {
|
|
@@ -65823,9 +65823,9 @@ const overrideSufficientBalanceCheckResult = (balanceCheckResult) => {
|
|
|
65823
65823
|
balanceRequirements: modifiedRequirements,
|
|
65824
65824
|
};
|
|
65825
65825
|
};
|
|
65826
|
-
const processRoutes = async (config, ownerAddress, sufficient, availableRoutingOptions, transactionRequirements, balanceCheckResult, onComplete, onFundingRoute) => {
|
|
65827
|
-
const finalBalanceCheckResult = sufficient && onComplete
|
|
65828
|
-
?
|
|
65826
|
+
const processRoutes = async (config, ownerAddress, sufficient, availableRoutingOptions, transactionRequirements, balanceCheckResult, fundingRouteFullAmount, onComplete, onFundingRoute) => {
|
|
65827
|
+
const finalBalanceCheckResult = !fundingRouteFullAmount || (sufficient && onComplete)
|
|
65828
|
+
? overrideBalanceCheckResult(balanceCheckResult)
|
|
65829
65829
|
: balanceCheckResult;
|
|
65830
65830
|
const routingOutcome = await measureAsyncExecution(config, 'Total time to run the routing calculator', routingCalculator(config, ownerAddress, finalBalanceCheckResult, availableRoutingOptions, onFundingRoute));
|
|
65831
65831
|
onComplete?.({
|
|
@@ -65838,7 +65838,7 @@ const processRoutes = async (config, ownerAddress, sufficient, availableRoutingO
|
|
|
65838
65838
|
});
|
|
65839
65839
|
return routingOutcome;
|
|
65840
65840
|
};
|
|
65841
|
-
const smartCheckout = async (config, provider, itemRequirements, transactionOrGasAmount, routingOptions, onComplete, onFundingRoute) => {
|
|
65841
|
+
const smartCheckout = async (config, provider, itemRequirements, transactionOrGasAmount, routingOptions, onComplete, onFundingRoute, fundingRouteFullAmount = false) => {
|
|
65842
65842
|
const ownerAddress = await provider.getSigner().getAddress();
|
|
65843
65843
|
let aggregatedItems = itemAggregator(itemRequirements);
|
|
65844
65844
|
const erc20AllowancePromise = hasERC20Allowances(provider, ownerAddress, aggregatedItems);
|
|
@@ -65865,7 +65865,7 @@ const smartCheckout = async (config, provider, itemRequirements, transactionOrGa
|
|
|
65865
65865
|
if (routingOptions?.bridge === false)
|
|
65866
65866
|
availableRoutingOptions.bridge = false;
|
|
65867
65867
|
if (onComplete) {
|
|
65868
|
-
processRoutes(config, ownerAddress, sufficient, availableRoutingOptions, transactionRequirements, balanceCheckResult, onComplete, onFundingRoute);
|
|
65868
|
+
processRoutes(config, ownerAddress, sufficient, availableRoutingOptions, transactionRequirements, balanceCheckResult, fundingRouteFullAmount, onComplete, onFundingRoute);
|
|
65869
65869
|
return {
|
|
65870
65870
|
sufficient,
|
|
65871
65871
|
transactionRequirements,
|
|
@@ -65877,7 +65877,7 @@ const smartCheckout = async (config, provider, itemRequirements, transactionOrGa
|
|
|
65877
65877
|
transactionRequirements,
|
|
65878
65878
|
};
|
|
65879
65879
|
}
|
|
65880
|
-
const routingOutcome = await processRoutes(config, ownerAddress, sufficient, availableRoutingOptions, transactionRequirements, balanceCheckResult, onComplete, onFundingRoute);
|
|
65880
|
+
const routingOutcome = await processRoutes(config, ownerAddress, sufficient, availableRoutingOptions, transactionRequirements, balanceCheckResult, fundingRouteFullAmount, onComplete, onFundingRoute);
|
|
65881
65881
|
return {
|
|
65882
65882
|
sufficient,
|
|
65883
65883
|
transactionRequirements,
|
|
@@ -66826,7 +66826,8 @@ class Checkout {
|
|
|
66826
66826
|
const cdnUrl = getWidgetsEsmUrl(version);
|
|
66827
66827
|
// WebpackIgnore comment required to prevent webpack modifying the import statement and
|
|
66828
66828
|
// breaking the dynamic import in certain applications integrating checkout
|
|
66829
|
-
const checkoutWidgetsModule = await import(
|
|
66829
|
+
const checkoutWidgetsModule = await import(
|
|
66830
|
+
/* webpackIgnore: true */ cdnUrl);
|
|
66830
66831
|
if (checkoutWidgetsModule && checkoutWidgetsModule.WidgetsFactory) {
|
|
66831
66832
|
return new checkoutWidgetsModule.WidgetsFactory(checkout, config);
|
|
66832
66833
|
}
|
|
@@ -66873,7 +66874,10 @@ class Checkout {
|
|
|
66873
66874
|
* @returns {Promise<CheckConnectionResult>} - A promise that resolves to the result of the check.
|
|
66874
66875
|
*/
|
|
66875
66876
|
async checkIsWalletConnected(params) {
|
|
66876
|
-
const web3Provider = await validateProvider(this.config, params.provider, {
|
|
66877
|
+
const web3Provider = await validateProvider(this.config, params.provider, {
|
|
66878
|
+
allowMistmatchedChainId: true,
|
|
66879
|
+
allowUnsupportedProvider: true,
|
|
66880
|
+
});
|
|
66877
66881
|
return checkIsWalletConnected(web3Provider);
|
|
66878
66882
|
}
|
|
66879
66883
|
/**
|
|
@@ -66887,7 +66891,8 @@ class Checkout {
|
|
|
66887
66891
|
allowUnsupportedProvider: true,
|
|
66888
66892
|
allowMistmatchedChainId: true,
|
|
66889
66893
|
});
|
|
66890
|
-
if (params.requestWalletPermissions
|
|
66894
|
+
if (params.requestWalletPermissions
|
|
66895
|
+
&& !web3Provider.provider?.isPassport) {
|
|
66891
66896
|
await requestPermissions(web3Provider);
|
|
66892
66897
|
}
|
|
66893
66898
|
else {
|
|
@@ -66997,7 +67002,7 @@ class Checkout {
|
|
|
66997
67002
|
/**
|
|
66998
67003
|
* Determines the requirements for performing a buy.
|
|
66999
67004
|
* @param {BuyParams} params - The parameters for the buy.
|
|
67000
|
-
|
|
67005
|
+
*/
|
|
67001
67006
|
async buy(params) {
|
|
67002
67007
|
if (params.orders.length > 1) {
|
|
67003
67008
|
// eslint-disable-next-line no-console
|
|
@@ -67011,7 +67016,7 @@ class Checkout {
|
|
|
67011
67016
|
* @param {SellParams} params - The parameters for the sell.
|
|
67012
67017
|
* Only currently actions the first order in the array until we support batch processing.
|
|
67013
67018
|
* Only currently actions the first fee in the fees array of each order until we support multiple fees.
|
|
67014
|
-
|
|
67019
|
+
*/
|
|
67015
67020
|
async sell(params) {
|
|
67016
67021
|
if (params.orders.length > 1) {
|
|
67017
67022
|
// eslint-disable-next-line no-console
|
|
@@ -67043,7 +67048,7 @@ class Checkout {
|
|
|
67043
67048
|
catch (err) {
|
|
67044
67049
|
throw new CheckoutError('Failed to map item requirements', CheckoutErrorType.ITEM_REQUIREMENTS_ERROR, { error: err });
|
|
67045
67050
|
}
|
|
67046
|
-
return await smartCheckout(this.config, web3Provider, itemRequirements, params.transactionOrGasAmount, params.routingOptions, params.onComplete, params.onFundingRoute);
|
|
67051
|
+
return await smartCheckout(this.config, web3Provider, itemRequirements, params.transactionOrGasAmount, params.routingOptions, params.onComplete, params.onFundingRoute, params.fundingRouteFullAmount);
|
|
67047
67052
|
}
|
|
67048
67053
|
/**
|
|
67049
67054
|
* Checks if the given object is a Web3 provider.
|
|
@@ -67077,13 +67082,17 @@ class Checkout {
|
|
|
67077
67082
|
const userInfo = await params.passport.getUserInfo();
|
|
67078
67083
|
email = userInfo?.email;
|
|
67079
67084
|
}
|
|
67080
|
-
const tokenList = await getTokenAllowList(this.config, {
|
|
67085
|
+
const tokenList = await getTokenAllowList(this.config, {
|
|
67086
|
+
type: TokenFilterTypes.ONRAMP,
|
|
67087
|
+
});
|
|
67081
67088
|
const token = tokenList.tokens?.find((t) => isMatchingAddress(t.address, params.tokenAddress));
|
|
67082
67089
|
if (token) {
|
|
67083
67090
|
tokenAmount = params.tokenAmount;
|
|
67084
67091
|
tokenSymbol = token.symbol;
|
|
67085
67092
|
}
|
|
67086
|
-
const allowedTokens = tokenList?.tokens
|
|
67093
|
+
const allowedTokens = tokenList?.tokens
|
|
67094
|
+
?.filter((t) => t.symbol)
|
|
67095
|
+
.map((t) => t.symbol);
|
|
67087
67096
|
return await this.fiatRampService.createWidgetUrl({
|
|
67088
67097
|
exchangeType: params.exchangeType,
|
|
67089
67098
|
isPassport,
|
package/dist/index.d.ts
CHANGED
|
@@ -26066,6 +26066,8 @@ interface SmartCheckoutParams {
|
|
|
26066
26066
|
onComplete?: (result: SmartCheckoutResult) => void;
|
|
26067
26067
|
/** The callback to be executed on each funding route found */
|
|
26068
26068
|
onFundingRoute?: (fundingRoute: FundingRoute) => void;
|
|
26069
|
+
/** A flag to get funding routes based on full or partial amount */
|
|
26070
|
+
fundingRouteFullAmount?: boolean;
|
|
26069
26071
|
}
|
|
26070
26072
|
/**
|
|
26071
26073
|
* Represents a native item requirement for a transaction.
|
|
@@ -28286,14 +28288,14 @@ declare class Checkout {
|
|
|
28286
28288
|
/**
|
|
28287
28289
|
* Determines the requirements for performing a buy.
|
|
28288
28290
|
* @param {BuyParams} params - The parameters for the buy.
|
|
28289
|
-
|
|
28291
|
+
*/
|
|
28290
28292
|
buy(params: BuyParams): Promise<BuyResult>;
|
|
28291
28293
|
/**
|
|
28292
28294
|
* Determines the requirements for performing a sell.
|
|
28293
28295
|
* @param {SellParams} params - The parameters for the sell.
|
|
28294
28296
|
* Only currently actions the first order in the array until we support batch processing.
|
|
28295
28297
|
* Only currently actions the first fee in the fees array of each order until we support multiple fees.
|
|
28296
|
-
|
|
28298
|
+
*/
|
|
28297
28299
|
sell(params: SellParams): Promise<SellResult>;
|
|
28298
28300
|
/**
|
|
28299
28301
|
* Cancels a sell.
|
package/dist/index.js
CHANGED
|
@@ -160,7 +160,7 @@ const flattenProperties$1 = (properties) => {
|
|
|
160
160
|
};
|
|
161
161
|
|
|
162
162
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
163
|
-
const SDK_VERSION$1 = '1.30.0-alpha.
|
|
163
|
+
const SDK_VERSION$1 = '1.30.0-alpha.2';
|
|
164
164
|
const getFrameParentDomain$1 = () => {
|
|
165
165
|
if (isNode$1()) {
|
|
166
166
|
return '';
|
|
@@ -14171,7 +14171,7 @@ class MultiRollupApiClients {
|
|
|
14171
14171
|
}
|
|
14172
14172
|
|
|
14173
14173
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
14174
|
-
const defaultHeaders$2 = { 'x-sdk-version': 'ts-immutable-sdk-1.30.0-alpha.
|
|
14174
|
+
const defaultHeaders$2 = { 'x-sdk-version': 'ts-immutable-sdk-1.30.0-alpha.2' };
|
|
14175
14175
|
const createConfig$1 = ({ basePath, headers, }) => {
|
|
14176
14176
|
if (!basePath.trim()) {
|
|
14177
14177
|
throw Error('basePath can not be empty');
|
|
@@ -14243,7 +14243,7 @@ class APIError extends Error {
|
|
|
14243
14243
|
|
|
14244
14244
|
/* eslint-disable implicit-arrow-linebreak */
|
|
14245
14245
|
const defaultHeaders$1 = {
|
|
14246
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.30.0-alpha.
|
|
14246
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.30.0-alpha.2',
|
|
14247
14247
|
};
|
|
14248
14248
|
/**
|
|
14249
14249
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -14717,7 +14717,7 @@ var blockchain_data = /*#__PURE__*/Object.freeze({
|
|
|
14717
14717
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
14718
14718
|
class ApiConfiguration extends index$2.Configuration {
|
|
14719
14719
|
}
|
|
14720
|
-
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.30.0-alpha.
|
|
14720
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.30.0-alpha.2' };
|
|
14721
14721
|
/**
|
|
14722
14722
|
* @dev use createImmutableXConfiguration instead
|
|
14723
14723
|
*/
|
|
@@ -14756,7 +14756,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
14756
14756
|
chainID,
|
|
14757
14757
|
coreContractAddress,
|
|
14758
14758
|
registrationContractAddress,
|
|
14759
|
-
sdkVersion: 'ts-immutable-sdk-1.30.0-alpha.
|
|
14759
|
+
sdkVersion: 'ts-immutable-sdk-1.30.0-alpha.2',
|
|
14760
14760
|
baseConfig,
|
|
14761
14761
|
});
|
|
14762
14762
|
const production = ({ baseConfig }) => createImmutableXConfiguration({
|
|
@@ -57512,7 +57512,7 @@ const flattenProperties = (properties) => {
|
|
|
57512
57512
|
};
|
|
57513
57513
|
|
|
57514
57514
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
57515
|
-
const SDK_VERSION = '1.30.0-alpha.
|
|
57515
|
+
const SDK_VERSION = '1.30.0-alpha.2';
|
|
57516
57516
|
const getFrameParentDomain = () => {
|
|
57517
57517
|
if (isNode()) {
|
|
57518
57518
|
return '';
|
|
@@ -62733,7 +62733,7 @@ const IMMUTABLE_ZKVEM_GAS_OVERRIDES = {
|
|
|
62733
62733
|
maxPriorityFeePerGas: BigNumber$1.from(10e9),
|
|
62734
62734
|
};
|
|
62735
62735
|
|
|
62736
|
-
const SDK_VERSION_MARKER = '1.30.0-alpha.
|
|
62736
|
+
const SDK_VERSION_MARKER = '1.30.0-alpha.2';
|
|
62737
62737
|
// This SDK version is replaced by the `yarn build` command ran on the root level
|
|
62738
62738
|
const globalPackageVersion = () => SDK_VERSION_MARKER;
|
|
62739
62739
|
|
|
@@ -65781,7 +65781,7 @@ const routingCalculator = async (config, ownerAddress, balanceRequirements, avai
|
|
|
65781
65781
|
};
|
|
65782
65782
|
};
|
|
65783
65783
|
|
|
65784
|
-
const
|
|
65784
|
+
const overrideBalanceCheckResult = (balanceCheckResult) => {
|
|
65785
65785
|
const modifiedRequirements = balanceCheckResult.balanceRequirements.map((requirement) => {
|
|
65786
65786
|
if (requirement.type === ItemType.ERC20 && requirement.sufficient) {
|
|
65787
65787
|
return {
|
|
@@ -65800,9 +65800,9 @@ const overrideSufficientBalanceCheckResult = (balanceCheckResult) => {
|
|
|
65800
65800
|
balanceRequirements: modifiedRequirements,
|
|
65801
65801
|
};
|
|
65802
65802
|
};
|
|
65803
|
-
const processRoutes = async (config, ownerAddress, sufficient, availableRoutingOptions, transactionRequirements, balanceCheckResult, onComplete, onFundingRoute) => {
|
|
65804
|
-
const finalBalanceCheckResult = sufficient && onComplete
|
|
65805
|
-
?
|
|
65803
|
+
const processRoutes = async (config, ownerAddress, sufficient, availableRoutingOptions, transactionRequirements, balanceCheckResult, fundingRouteFullAmount, onComplete, onFundingRoute) => {
|
|
65804
|
+
const finalBalanceCheckResult = !fundingRouteFullAmount || (sufficient && onComplete)
|
|
65805
|
+
? overrideBalanceCheckResult(balanceCheckResult)
|
|
65806
65806
|
: balanceCheckResult;
|
|
65807
65807
|
const routingOutcome = await measureAsyncExecution(config, 'Total time to run the routing calculator', routingCalculator(config, ownerAddress, finalBalanceCheckResult, availableRoutingOptions, onFundingRoute));
|
|
65808
65808
|
onComplete?.({
|
|
@@ -65815,7 +65815,7 @@ const processRoutes = async (config, ownerAddress, sufficient, availableRoutingO
|
|
|
65815
65815
|
});
|
|
65816
65816
|
return routingOutcome;
|
|
65817
65817
|
};
|
|
65818
|
-
const smartCheckout = async (config, provider, itemRequirements, transactionOrGasAmount, routingOptions, onComplete, onFundingRoute) => {
|
|
65818
|
+
const smartCheckout = async (config, provider, itemRequirements, transactionOrGasAmount, routingOptions, onComplete, onFundingRoute, fundingRouteFullAmount = false) => {
|
|
65819
65819
|
const ownerAddress = await provider.getSigner().getAddress();
|
|
65820
65820
|
let aggregatedItems = itemAggregator(itemRequirements);
|
|
65821
65821
|
const erc20AllowancePromise = hasERC20Allowances(provider, ownerAddress, aggregatedItems);
|
|
@@ -65842,7 +65842,7 @@ const smartCheckout = async (config, provider, itemRequirements, transactionOrGa
|
|
|
65842
65842
|
if (routingOptions?.bridge === false)
|
|
65843
65843
|
availableRoutingOptions.bridge = false;
|
|
65844
65844
|
if (onComplete) {
|
|
65845
|
-
processRoutes(config, ownerAddress, sufficient, availableRoutingOptions, transactionRequirements, balanceCheckResult, onComplete, onFundingRoute);
|
|
65845
|
+
processRoutes(config, ownerAddress, sufficient, availableRoutingOptions, transactionRequirements, balanceCheckResult, fundingRouteFullAmount, onComplete, onFundingRoute);
|
|
65846
65846
|
return {
|
|
65847
65847
|
sufficient,
|
|
65848
65848
|
transactionRequirements,
|
|
@@ -65854,7 +65854,7 @@ const smartCheckout = async (config, provider, itemRequirements, transactionOrGa
|
|
|
65854
65854
|
transactionRequirements,
|
|
65855
65855
|
};
|
|
65856
65856
|
}
|
|
65857
|
-
const routingOutcome = await processRoutes(config, ownerAddress, sufficient, availableRoutingOptions, transactionRequirements, balanceCheckResult, onComplete, onFundingRoute);
|
|
65857
|
+
const routingOutcome = await processRoutes(config, ownerAddress, sufficient, availableRoutingOptions, transactionRequirements, balanceCheckResult, fundingRouteFullAmount, onComplete, onFundingRoute);
|
|
65858
65858
|
return {
|
|
65859
65859
|
sufficient,
|
|
65860
65860
|
transactionRequirements,
|
|
@@ -66803,7 +66803,8 @@ class Checkout {
|
|
|
66803
66803
|
const cdnUrl = getWidgetsEsmUrl(version);
|
|
66804
66804
|
// WebpackIgnore comment required to prevent webpack modifying the import statement and
|
|
66805
66805
|
// breaking the dynamic import in certain applications integrating checkout
|
|
66806
|
-
const checkoutWidgetsModule = await import(
|
|
66806
|
+
const checkoutWidgetsModule = await import(
|
|
66807
|
+
/* webpackIgnore: true */ cdnUrl);
|
|
66807
66808
|
if (checkoutWidgetsModule && checkoutWidgetsModule.WidgetsFactory) {
|
|
66808
66809
|
return new checkoutWidgetsModule.WidgetsFactory(checkout, config);
|
|
66809
66810
|
}
|
|
@@ -66850,7 +66851,10 @@ class Checkout {
|
|
|
66850
66851
|
* @returns {Promise<CheckConnectionResult>} - A promise that resolves to the result of the check.
|
|
66851
66852
|
*/
|
|
66852
66853
|
async checkIsWalletConnected(params) {
|
|
66853
|
-
const web3Provider = await validateProvider(this.config, params.provider, {
|
|
66854
|
+
const web3Provider = await validateProvider(this.config, params.provider, {
|
|
66855
|
+
allowMistmatchedChainId: true,
|
|
66856
|
+
allowUnsupportedProvider: true,
|
|
66857
|
+
});
|
|
66854
66858
|
return checkIsWalletConnected(web3Provider);
|
|
66855
66859
|
}
|
|
66856
66860
|
/**
|
|
@@ -66864,7 +66868,8 @@ class Checkout {
|
|
|
66864
66868
|
allowUnsupportedProvider: true,
|
|
66865
66869
|
allowMistmatchedChainId: true,
|
|
66866
66870
|
});
|
|
66867
|
-
if (params.requestWalletPermissions
|
|
66871
|
+
if (params.requestWalletPermissions
|
|
66872
|
+
&& !web3Provider.provider?.isPassport) {
|
|
66868
66873
|
await requestPermissions(web3Provider);
|
|
66869
66874
|
}
|
|
66870
66875
|
else {
|
|
@@ -66974,7 +66979,7 @@ class Checkout {
|
|
|
66974
66979
|
/**
|
|
66975
66980
|
* Determines the requirements for performing a buy.
|
|
66976
66981
|
* @param {BuyParams} params - The parameters for the buy.
|
|
66977
|
-
|
|
66982
|
+
*/
|
|
66978
66983
|
async buy(params) {
|
|
66979
66984
|
if (params.orders.length > 1) {
|
|
66980
66985
|
// eslint-disable-next-line no-console
|
|
@@ -66988,7 +66993,7 @@ class Checkout {
|
|
|
66988
66993
|
* @param {SellParams} params - The parameters for the sell.
|
|
66989
66994
|
* Only currently actions the first order in the array until we support batch processing.
|
|
66990
66995
|
* Only currently actions the first fee in the fees array of each order until we support multiple fees.
|
|
66991
|
-
|
|
66996
|
+
*/
|
|
66992
66997
|
async sell(params) {
|
|
66993
66998
|
if (params.orders.length > 1) {
|
|
66994
66999
|
// eslint-disable-next-line no-console
|
|
@@ -67020,7 +67025,7 @@ class Checkout {
|
|
|
67020
67025
|
catch (err) {
|
|
67021
67026
|
throw new CheckoutError('Failed to map item requirements', CheckoutErrorType.ITEM_REQUIREMENTS_ERROR, { error: err });
|
|
67022
67027
|
}
|
|
67023
|
-
return await smartCheckout(this.config, web3Provider, itemRequirements, params.transactionOrGasAmount, params.routingOptions, params.onComplete, params.onFundingRoute);
|
|
67028
|
+
return await smartCheckout(this.config, web3Provider, itemRequirements, params.transactionOrGasAmount, params.routingOptions, params.onComplete, params.onFundingRoute, params.fundingRouteFullAmount);
|
|
67024
67029
|
}
|
|
67025
67030
|
/**
|
|
67026
67031
|
* Checks if the given object is a Web3 provider.
|
|
@@ -67054,13 +67059,17 @@ class Checkout {
|
|
|
67054
67059
|
const userInfo = await params.passport.getUserInfo();
|
|
67055
67060
|
email = userInfo?.email;
|
|
67056
67061
|
}
|
|
67057
|
-
const tokenList = await getTokenAllowList(this.config, {
|
|
67062
|
+
const tokenList = await getTokenAllowList(this.config, {
|
|
67063
|
+
type: TokenFilterTypes.ONRAMP,
|
|
67064
|
+
});
|
|
67058
67065
|
const token = tokenList.tokens?.find((t) => isMatchingAddress(t.address, params.tokenAddress));
|
|
67059
67066
|
if (token) {
|
|
67060
67067
|
tokenAmount = params.tokenAmount;
|
|
67061
67068
|
tokenSymbol = token.symbol;
|
|
67062
67069
|
}
|
|
67063
|
-
const allowedTokens = tokenList?.tokens
|
|
67070
|
+
const allowedTokens = tokenList?.tokens
|
|
67071
|
+
?.filter((t) => t.symbol)
|
|
67072
|
+
.map((t) => t.symbol);
|
|
67064
67073
|
return await this.fiatRampService.createWidgetUrl({
|
|
67065
67074
|
exchangeType: params.exchangeType,
|
|
67066
67075
|
isPassport,
|
package/dist/orderbook.js
CHANGED
|
@@ -132,7 +132,7 @@ const flattenProperties = (properties) => {
|
|
|
132
132
|
};
|
|
133
133
|
|
|
134
134
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
135
|
-
const SDK_VERSION = '1.30.0-alpha.
|
|
135
|
+
const SDK_VERSION = '1.30.0-alpha.2';
|
|
136
136
|
const getFrameParentDomain = () => {
|
|
137
137
|
if (isNode()) {
|
|
138
138
|
return '';
|
package/dist/passport.js
CHANGED
|
@@ -11444,7 +11444,7 @@ class MultiRollupApiClients {
|
|
|
11444
11444
|
}
|
|
11445
11445
|
|
|
11446
11446
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
11447
|
-
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-1.30.0-alpha.
|
|
11447
|
+
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-1.30.0-alpha.2' };
|
|
11448
11448
|
const createConfig$1 = ({ basePath, headers, }) => {
|
|
11449
11449
|
if (!basePath.trim()) {
|
|
11450
11450
|
throw Error('basePath can not be empty');
|
|
@@ -11623,7 +11623,7 @@ const flattenProperties = (properties) => {
|
|
|
11623
11623
|
};
|
|
11624
11624
|
|
|
11625
11625
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
11626
|
-
const SDK_VERSION = '1.30.0-alpha.
|
|
11626
|
+
const SDK_VERSION = '1.30.0-alpha.2';
|
|
11627
11627
|
const getFrameParentDomain = () => {
|
|
11628
11628
|
if (isNode()) {
|
|
11629
11629
|
return '';
|
|
@@ -12013,7 +12013,7 @@ const addKeysToHeadersOverride = (baseConfig, overrides) => {
|
|
|
12013
12013
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
12014
12014
|
class ApiConfiguration extends index$2.Configuration {
|
|
12015
12015
|
}
|
|
12016
|
-
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.30.0-alpha.
|
|
12016
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.30.0-alpha.2' };
|
|
12017
12017
|
/**
|
|
12018
12018
|
* @dev use createImmutableXConfiguration instead
|
|
12019
12019
|
*/
|
|
@@ -12052,7 +12052,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
12052
12052
|
chainID,
|
|
12053
12053
|
coreContractAddress,
|
|
12054
12054
|
registrationContractAddress,
|
|
12055
|
-
sdkVersion: 'ts-immutable-sdk-1.30.0-alpha.
|
|
12055
|
+
sdkVersion: 'ts-immutable-sdk-1.30.0-alpha.2',
|
|
12056
12056
|
baseConfig,
|
|
12057
12057
|
});
|
|
12058
12058
|
const production = ({ baseConfig }) => createImmutableXConfiguration({
|
package/dist/x.js
CHANGED
|
@@ -9003,7 +9003,7 @@ const flattenProperties = (properties) => {
|
|
|
9003
9003
|
};
|
|
9004
9004
|
|
|
9005
9005
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
9006
|
-
const SDK_VERSION = '1.30.0-alpha.
|
|
9006
|
+
const SDK_VERSION = '1.30.0-alpha.2';
|
|
9007
9007
|
const getFrameParentDomain = () => {
|
|
9008
9008
|
if (isNode()) {
|
|
9009
9009
|
return '';
|
|
@@ -9269,7 +9269,7 @@ const addKeysToHeadersOverride = (baseConfig, overrides) => {
|
|
|
9269
9269
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
9270
9270
|
class ApiConfiguration extends index$2.Configuration {
|
|
9271
9271
|
}
|
|
9272
|
-
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.30.0-alpha.
|
|
9272
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.30.0-alpha.2' };
|
|
9273
9273
|
/**
|
|
9274
9274
|
* @dev use createImmutableXConfiguration instead
|
|
9275
9275
|
*/
|
|
@@ -9308,7 +9308,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
9308
9308
|
chainID,
|
|
9309
9309
|
coreContractAddress,
|
|
9310
9310
|
registrationContractAddress,
|
|
9311
|
-
sdkVersion: 'ts-immutable-sdk-1.30.0-alpha.
|
|
9311
|
+
sdkVersion: 'ts-immutable-sdk-1.30.0-alpha.2',
|
|
9312
9312
|
baseConfig,
|
|
9313
9313
|
});
|
|
9314
9314
|
const production = ({ baseConfig }) => createImmutableXConfiguration({
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{di as n,dj as t}from"./index-4da0c2bb.js";function i(i){return n(this,void 0,void 0,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return[4,import("./index.umd-4ad5ee36.js").then((function(n){return n.i}))];case 1:return n=t.sent(),i._plugins=n,[2]}}))}))}export{i as loadLegacyVideoPlugins};
|