@imtbl/sdk 0.27.12 → 0.27.14
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 +16 -9
- package/dist/checkout_sdk.js +87 -61
- package/dist/checkout_widgets.js +1 -1
- package/dist/immutablex_client.js +4 -4
- package/dist/index.browser.js +4 -4
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +93 -67
- package/dist/index.d.ts +16 -9
- package/dist/index.js +93 -67
- package/dist/passport.js +5 -5
- 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.14' };
|
|
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.14',
|
|
3696
3696
|
};
|
|
3697
3697
|
/**
|
|
3698
3698
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -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.14',
|
|
4107
4107
|
});
|
|
4108
4108
|
/**
|
|
4109
4109
|
* Sets `sdkVersion` at the time of build
|
|
@@ -4119,9 +4119,9 @@ const production = () => createImmutableXConfiguration({
|
|
|
4119
4119
|
*/
|
|
4120
4120
|
const sandbox = () => createImmutableXConfiguration({
|
|
4121
4121
|
basePath: 'https://api.sandbox.x.immutable.com',
|
|
4122
|
-
chainID:
|
|
4123
|
-
coreContractAddress: '
|
|
4124
|
-
registrationContractAddress: '
|
|
4122
|
+
chainID: 11155111,
|
|
4123
|
+
coreContractAddress: '0x2d5C349fD8464DA06a3f90b4B0E9195F3d1b7F98',
|
|
4124
|
+
registrationContractAddress: '0xDbA6129C02E69405622fAdc3d5A7f8d23eac3b97',
|
|
4125
4125
|
});
|
|
4126
4126
|
class ImxConfiguration {
|
|
4127
4127
|
immutableXConfig;
|
|
@@ -28458,8 +28458,9 @@ const doesChainSupportEIP1559 = (fee) => {
|
|
|
28458
28458
|
/**
|
|
28459
28459
|
* Fetch the current gas price estimate. Supports both EIP-1559 and non-EIP1559 chains
|
|
28460
28460
|
* @param {JsonRpcProvider} provider - The JSON RPC provider used to fetch fee data
|
|
28461
|
+
* @param {Coin} nativeToken - The native token of the chain. Gas prices will be denominated in this token
|
|
28461
28462
|
* @returns {Amount | null} - The gas price in the smallest denomination of the chain's currency,
|
|
28462
|
-
*
|
|
28463
|
+
* or null if no gas price is available
|
|
28463
28464
|
*/
|
|
28464
28465
|
const fetchGasPrice = async (provider, nativeToken) => {
|
|
28465
28466
|
const feeData = await provider.getFeeData().catch(() => null);
|
|
@@ -28473,8 +28474,8 @@ const fetchGasPrice = async (provider, nativeToken) => {
|
|
|
28473
28474
|
/**
|
|
28474
28475
|
* Calculate the gas fee from the gas price and gas units used for the transaction
|
|
28475
28476
|
*
|
|
28476
|
-
* @param {Amount}
|
|
28477
|
-
* @param {BigNumber}
|
|
28477
|
+
* @param {Amount} gasPrice - The price of gas
|
|
28478
|
+
* @param {BigNumber} gasEstimate - The total gas units that will be used for the transaction
|
|
28478
28479
|
* @returns - The cost of the transaction in the gas token's smallest denomination (e.g. WEI)
|
|
28479
28480
|
*/
|
|
28480
28481
|
const calculateGasFee = (gasPrice, gasEstimate) =>
|
|
@@ -28818,21 +28819,19 @@ function buildSwapParametersForMultiPoolSwap(fromAddress, trade, route, amountIn
|
|
|
28818
28819
|
* @param options additional swap options
|
|
28819
28820
|
* @returns calldata for the swap
|
|
28820
28821
|
*/
|
|
28821
|
-
function buildSwapParameters(fromAddress, trade, options, secondaryFees, secondaryFeeContract) {
|
|
28822
|
+
function buildSwapParameters(fromAddress, trade, options, secondaryFees, secondaryFeeContract, maximumAmountIn, minimumAmountOut) {
|
|
28822
28823
|
// @dev we don't support multiple swaps in a single transaction
|
|
28823
28824
|
// there will always be only one swap in the trade regardless of the trade type
|
|
28824
|
-
const { route
|
|
28825
|
-
const amountIn = v3Sdk.toHex(trade.maximumAmountIn(options.slippageTolerance, inputAmount).quotient);
|
|
28826
|
-
const amountOut = v3Sdk.toHex(trade.minimumAmountOut(options.slippageTolerance, outputAmount).quotient);
|
|
28825
|
+
const { route } = trade.swaps[0];
|
|
28827
28826
|
const isSinglePoolSwap = route.pools.length === 1;
|
|
28828
28827
|
if (isSinglePoolSwap) {
|
|
28829
|
-
return buildSwapParametersForSinglePoolSwap(fromAddress, trade, route,
|
|
28828
|
+
return buildSwapParametersForSinglePoolSwap(fromAddress, trade, route, maximumAmountIn, minimumAmountOut, secondaryFees, secondaryFeeContract);
|
|
28830
28829
|
}
|
|
28831
|
-
return buildSwapParametersForMultiPoolSwap(fromAddress, trade, route,
|
|
28830
|
+
return buildSwapParametersForMultiPoolSwap(fromAddress, trade, route, maximumAmountIn, minimumAmountOut, secondaryFees, secondaryFeeContract);
|
|
28832
28831
|
}
|
|
28833
|
-
function createSwapCallParametersWithFees(trade, fromAddress, swapOptions, secondaryFees) {
|
|
28832
|
+
function createSwapCallParametersWithFees(trade, fromAddress, swapOptions, secondaryFees, maximumAmountIn, minimumAmountOut) {
|
|
28834
28833
|
const secondaryFeeContract = SecondaryFee__factory.createInterface();
|
|
28835
|
-
const swapWithFeesCalldata = buildSwapParameters(fromAddress, trade, swapOptions, secondaryFees, secondaryFeeContract);
|
|
28834
|
+
const swapWithFeesCalldata = buildSwapParameters(fromAddress, trade, swapOptions, secondaryFees, secondaryFeeContract, maximumAmountIn, minimumAmountOut);
|
|
28836
28835
|
return secondaryFeeContract.encodeFunctionData(multicallWithDeadlineFunctionSignature, [
|
|
28837
28836
|
swapOptions.deadlineOrPreviousBlockhash,
|
|
28838
28837
|
[swapWithFeesCalldata],
|
|
@@ -28852,25 +28851,34 @@ function createSwapParameters(adjustedQuote, fromAddress, slippage, deadline, se
|
|
|
28852
28851
|
recipient: fromAddress,
|
|
28853
28852
|
deadlineOrPreviousBlockhash: deadline,
|
|
28854
28853
|
};
|
|
28854
|
+
// If the trade type is EXACT_INPUT, then the maximum amount-in is the user-specified amount (no slippage applied)
|
|
28855
|
+
// https://github.com/Uniswap/v3-sdk/blob/81d66099f07d1ec350767f497ef73222575fe032/src/entities/trade.ts#L456
|
|
28856
|
+
const maximumAmountIn = v3Sdk.toHex(uncheckedTrade.maximumAmountIn(options.slippageTolerance).quotient);
|
|
28857
|
+
const minimumAmountOut = v3Sdk.toHex(uncheckedTrade.minimumAmountOut(options.slippageTolerance).quotient);
|
|
28855
28858
|
if (secondaryFees.length === 0) {
|
|
28856
28859
|
// Generate swap parameters without secondary fee contract details
|
|
28857
|
-
return routerSdk.SwapRouter.swapCallParameters([uncheckedTrade], options).calldata;
|
|
28860
|
+
return { calldata: routerSdk.SwapRouter.swapCallParameters([uncheckedTrade], options).calldata, maximumAmountIn };
|
|
28858
28861
|
}
|
|
28859
|
-
return
|
|
28862
|
+
return {
|
|
28863
|
+
calldata: createSwapCallParametersWithFees(uncheckedTrade, fromAddress, options, secondaryFees, maximumAmountIn, minimumAmountOut),
|
|
28864
|
+
maximumAmountIn,
|
|
28865
|
+
};
|
|
28860
28866
|
}
|
|
28861
|
-
|
|
28862
|
-
|
|
28867
|
+
const getTransactionValue = (tokenIn, maximumAmountIn) => tokenIn.type === 'native' ? maximumAmountIn : zeroNativeCurrencyValue;
|
|
28868
|
+
function getSwap(tokenIn, adjustedQuote, fromAddress, slippage, deadline, peripheryRouterAddress, secondaryFeesAddress, gasPrice, secondaryFees) {
|
|
28869
|
+
// TODO: TP-1651: Include `refundETH` transaction as final step for native Exact Output swaps
|
|
28870
|
+
const { calldata, maximumAmountIn } = createSwapParameters(adjustedQuote, fromAddress, slippage, deadline, secondaryFees);
|
|
28863
28871
|
// TODO: Add additional gas fee estimates for secondary fees
|
|
28864
28872
|
const gasFeeEstimate = gasPrice ? calculateGasFee(gasPrice, adjustedQuote.gasEstimate) : null;
|
|
28873
|
+
const transactionValue = getTransactionValue(tokenIn, maximumAmountIn);
|
|
28865
28874
|
return {
|
|
28866
28875
|
transaction: {
|
|
28867
28876
|
data: calldata,
|
|
28868
28877
|
to: secondaryFees.length > 0 ? secondaryFeesAddress : peripheryRouterAddress,
|
|
28869
|
-
value:
|
|
28878
|
+
value: transactionValue,
|
|
28870
28879
|
from: fromAddress,
|
|
28871
28880
|
},
|
|
28872
|
-
|
|
28873
|
-
gasFeeEstimate: gasFeeEstimate ? nativeTokenService.maybeWrapAmount(gasFeeEstimate) : null,
|
|
28881
|
+
gasFeeEstimate: gasFeeEstimate ? toPublicAmount(gasFeeEstimate) : null,
|
|
28874
28882
|
};
|
|
28875
28883
|
}
|
|
28876
28884
|
const adjustAmountIn = (ourQuote, amountSpecified, fees, nativeTokenService) => {
|
|
@@ -28967,7 +28975,7 @@ class ExchangeConfiguration {
|
|
|
28967
28975
|
baseConfig;
|
|
28968
28976
|
chain;
|
|
28969
28977
|
secondaryFees = [];
|
|
28970
|
-
constructor({ chainId, baseConfig, secondaryFees, overrides
|
|
28978
|
+
constructor({ chainId, baseConfig, secondaryFees, overrides }) {
|
|
28971
28979
|
this.baseConfig = baseConfig;
|
|
28972
28980
|
this.secondaryFees = secondaryFees || [];
|
|
28973
28981
|
validateSecondaryFees(this.secondaryFees);
|
|
@@ -29080,7 +29088,7 @@ class Exchange {
|
|
|
29080
29088
|
fetchGasPrice(this.provider, this.nativeToken),
|
|
29081
29089
|
]);
|
|
29082
29090
|
const adjustedQuote = adjustQuoteWithFees(ourQuote, amountSpecified, fees, this.nativeTokenService);
|
|
29083
|
-
const swap = getSwap(adjustedQuote, fromAddress, slippagePercent, deadline, this.routerContractAddress, this.secondaryFeeContractAddress, gasPrice, secondaryFees
|
|
29091
|
+
const swap = getSwap(tokenIn, adjustedQuote, fromAddress, slippagePercent, deadline, this.routerContractAddress, this.secondaryFeeContractAddress, gasPrice, secondaryFees);
|
|
29084
29092
|
const { quotedAmount, quotedAmountWithMaxSlippage } = prepareUserQuote(this.nativeTokenService, adjustedQuote, slippagePercent, otherToken);
|
|
29085
29093
|
const preparedApproval = prepareApproval(tradeType, amountSpecified, quotedAmountWithMaxSlippage, {
|
|
29086
29094
|
routerAddress: this.routerContractAddress,
|
|
@@ -29652,6 +29660,7 @@ var $e055e79256bbc1dd$export$80f4da0d409a629d;
|
|
|
29652
29660
|
CheckoutErrorType["ORDER_FEE_ERROR"] = "ORDER_FEE_ERROR";
|
|
29653
29661
|
CheckoutErrorType["ITEM_REQUIREMENTS_ERROR"] = "ITEM_REQUIREMENTS_ERROR";
|
|
29654
29662
|
CheckoutErrorType["API_ERROR"] = "API_ERROR";
|
|
29663
|
+
CheckoutErrorType["ORDER_EXPIRED_ERROR"] = "ORDER_EXPIRED_ERROR";
|
|
29655
29664
|
})($a8bc256d81a5e2c1$export$e3dc0620abde7f5a || ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a = {}));
|
|
29656
29665
|
class $a8bc256d81a5e2c1$export$b722478a3cbfa3bc extends Error {
|
|
29657
29666
|
message;
|
|
@@ -30178,44 +30187,53 @@ const $1564e43dde50bb61$export$8c978679845804d4 = async (walletAddress, chainId,
|
|
|
30178
30187
|
// Hold the items in an array for post-fetching processing
|
|
30179
30188
|
const items = [];
|
|
30180
30189
|
const tokenType = ($887a00f8f72d61f0$export$5bd1ea2b3d18210).ERC20;
|
|
30181
|
-
|
|
30182
|
-
|
|
30183
|
-
|
|
30184
|
-
|
|
30185
|
-
|
|
30186
|
-
|
|
30187
|
-
|
|
30188
|
-
|
|
30189
|
-
|
|
30190
|
-
|
|
30190
|
+
const erc20Balances = async (client)=>{
|
|
30191
|
+
// Given that the widgets aren't yet designed to support pagination,
|
|
30192
|
+
// fetch all the possible tokens associated to a given wallet address.
|
|
30193
|
+
let resp;
|
|
30194
|
+
try {
|
|
30195
|
+
do {
|
|
30196
|
+
// eslint-disable-next-line no-await-in-loop
|
|
30197
|
+
resp = await client.getTokensByWalletAddress({
|
|
30198
|
+
walletAddress: walletAddress,
|
|
30199
|
+
tokenType: tokenType,
|
|
30200
|
+
nextPage: resp?.next_page_params
|
|
30201
|
+
});
|
|
30202
|
+
items.push(...resp.items);
|
|
30203
|
+
}while (resp.next_page_params);
|
|
30204
|
+
} catch (err) {
|
|
30205
|
+
// In case of a 404, the wallet is a new wallet that hasn't been indexed by
|
|
30206
|
+
// the Blockscout just yet. This happens when a wallet hasn't had any
|
|
30207
|
+
// activity on the chain. In this case, simply ignore the error and return
|
|
30208
|
+
// no currencies.
|
|
30209
|
+
// In case of a malformed wallet address, Blockscout returns a 422, which
|
|
30210
|
+
// means we are safe to assume that a 404 is a missing wallet due to inactivity
|
|
30211
|
+
// or simply an incorrect wallet address was provided.
|
|
30212
|
+
if (err?.code !== (globalAxios$1.HttpStatusCode).NotFound) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(err.message || "InternalServerError | getTokensByWalletAddress", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).GET_INDEXER_BALANCE_ERROR, err);
|
|
30213
|
+
}
|
|
30214
|
+
};
|
|
30215
|
+
const nativeBalances = async (client)=>{
|
|
30216
|
+
try {
|
|
30217
|
+
const respNative = await client.getNativeTokenByWalletAddress({
|
|
30218
|
+
walletAddress: walletAddress
|
|
30191
30219
|
});
|
|
30192
|
-
items.push(
|
|
30193
|
-
}
|
|
30194
|
-
|
|
30195
|
-
|
|
30196
|
-
|
|
30197
|
-
|
|
30198
|
-
|
|
30199
|
-
|
|
30200
|
-
|
|
30201
|
-
|
|
30202
|
-
|
|
30203
|
-
}
|
|
30204
|
-
|
|
30205
|
-
|
|
30206
|
-
|
|
30207
|
-
|
|
30208
|
-
|
|
30209
|
-
} catch (err) {
|
|
30210
|
-
// In case of a 404, the wallet is a new wallet that hasn't been indexed by
|
|
30211
|
-
// the Blockscout just yet. This happens when a wallet hasn't had any
|
|
30212
|
-
// activity on the chain. In this case, simply ignore the error and return
|
|
30213
|
-
// no currencies.
|
|
30214
|
-
// In case of a malformed wallet address, Blockscout returns a 422, which
|
|
30215
|
-
// means we are safe to assume that a 404 is a missing wallet due to inactivity
|
|
30216
|
-
// or simply an incorrect wallet address was provided.
|
|
30217
|
-
if (err?.code !== (globalAxios$1.HttpStatusCode).NotFound) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(err.message || "InternalServerError | getNativeTokenByWalletAddress", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).GET_INDEXER_BALANCE_ERROR, err);
|
|
30218
|
-
}
|
|
30220
|
+
items.push(respNative);
|
|
30221
|
+
} catch (err) {
|
|
30222
|
+
// In case of a 404, the wallet is a new wallet that hasn't been indexed by
|
|
30223
|
+
// the Blockscout just yet. This happens when a wallet hasn't had any
|
|
30224
|
+
// activity on the chain. In this case, simply ignore the error and return
|
|
30225
|
+
// no currencies.
|
|
30226
|
+
// In case of a malformed wallet address, Blockscout returns a 422, which
|
|
30227
|
+
// means we are safe to assume that a 404 is a missing wallet due to inactivity
|
|
30228
|
+
// or simply an incorrect wallet address was provided.
|
|
30229
|
+
if (err?.code !== (globalAxios$1.HttpStatusCode).NotFound) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(err.message || "InternalServerError | getNativeTokenByWalletAddress", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).GET_INDEXER_BALANCE_ERROR, err);
|
|
30230
|
+
}
|
|
30231
|
+
};
|
|
30232
|
+
// Promise all() rather than allSettled() so that the function can fail fast.
|
|
30233
|
+
await Promise.all([
|
|
30234
|
+
erc20Balances(blockscoutClient),
|
|
30235
|
+
nativeBalances(blockscoutClient)
|
|
30236
|
+
]);
|
|
30219
30237
|
const balances = [];
|
|
30220
30238
|
items.forEach((item)=>{
|
|
30221
30239
|
if (shouldFilter && !mapFilterTokens[item.token.address]) return;
|
|
@@ -32735,16 +32753,24 @@ const $64863c39386de592$export$7f8e2b98eca5a7f0 = async (config, provider, order
|
|
|
32735
32753
|
let unsignedApprovalTransactions = [];
|
|
32736
32754
|
let unsignedFulfillmentTransactions = [];
|
|
32737
32755
|
let orderActions = [];
|
|
32738
|
-
const fulfillOrderStartTime =
|
|
32756
|
+
const fulfillOrderStartTime = performance.now();
|
|
32739
32757
|
try {
|
|
32740
32758
|
const fulfillerAddress = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to get the address from the provider", provider.getSigner().getAddress());
|
|
32741
32759
|
const { actions: actions } = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to call fulfillOrder from the orderbook", orderbook.fulfillOrder(id, fulfillerAddress, fees));
|
|
32742
32760
|
orderActions = actions;
|
|
32743
32761
|
unsignedApprovalTransactions = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to construct the unsigned approval transactions", (0, $a7367d01c6e76b1c$export$f64a20a30eb98855)(actions));
|
|
32744
32762
|
} catch (err) {
|
|
32745
|
-
|
|
32746
|
-
const elapsedTimeInSeconds = (new Date().getTime() - fulfillOrderStartTime) / 1000;
|
|
32763
|
+
const elapsedTimeInSeconds = (performance.now() - fulfillOrderStartTime) / 1000;
|
|
32747
32764
|
($458d407830d66110$export$e6a390ea6399b7d8)(config, "Time to call fulfillOrder from the orderbook", elapsedTimeInSeconds);
|
|
32765
|
+
if (err.message.includes((OrderStatusName).EXPIRED)) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Order is expired", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).ORDER_EXPIRED_ERROR, {
|
|
32766
|
+
orderId: id
|
|
32767
|
+
});
|
|
32768
|
+
// The balances error will be handled by bulk order fulfillment but for now we
|
|
32769
|
+
// need to assert on this string to check that the error is not a balances error
|
|
32770
|
+
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, {
|
|
32771
|
+
orderId: id,
|
|
32772
|
+
message: err.message
|
|
32773
|
+
});
|
|
32748
32774
|
}
|
|
32749
32775
|
try {
|
|
32750
32776
|
unsignedFulfillmentTransactions = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to construct the unsigned fulfillment transactions", (0, $a7367d01c6e76b1c$export$396bd6ce7d3ab533)(orderActions));
|
|
@@ -33329,7 +33355,7 @@ var $045213b18e9f1f94$export$75be0f6af9650f2c;
|
|
|
33329
33355
|
})($045213b18e9f1f94$export$75be0f6af9650f2c || ($045213b18e9f1f94$export$75be0f6af9650f2c = {}));
|
|
33330
33356
|
|
|
33331
33357
|
|
|
33332
|
-
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.27.
|
|
33358
|
+
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.27.14";
|
|
33333
33359
|
const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
|
|
33334
33360
|
const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
|
|
33335
33361
|
|
package/dist/index.d.ts
CHANGED
|
@@ -16406,7 +16406,7 @@ type ERC20BuyToken = {
|
|
|
16406
16406
|
contractAddress: string;
|
|
16407
16407
|
};
|
|
16408
16408
|
/**
|
|
16409
|
-
*
|
|
16409
|
+
* The SellToken type
|
|
16410
16410
|
* @property {string} id - The ERC721 token id
|
|
16411
16411
|
* @property {string} collectionAddress - The ERC721 collection address
|
|
16412
16412
|
*/
|
|
@@ -16737,9 +16737,9 @@ type UserBalance = {
|
|
|
16737
16737
|
* Represents the transaction requirement for a transaction.
|
|
16738
16738
|
* @property {ItemType} type - The type of the transaction requirement.
|
|
16739
16739
|
* @property {boolean} sufficient - If the user address has sufficient funds to cover the transaction.
|
|
16740
|
-
* @property {
|
|
16741
|
-
* @property {
|
|
16742
|
-
* @property {
|
|
16740
|
+
* @property {ItemBalance} required - The required item balance.
|
|
16741
|
+
* @property {ItemBalance} current - The current item balance.
|
|
16742
|
+
* @property {BalanceDelta} delta - The delta between the required and current balances.
|
|
16743
16743
|
*/
|
|
16744
16744
|
type TransactionRequirement = {
|
|
16745
16745
|
type: ItemType;
|
|
@@ -16750,6 +16750,7 @@ type TransactionRequirement = {
|
|
|
16750
16750
|
};
|
|
16751
16751
|
/**
|
|
16752
16752
|
* Represents the balance for either a native or ERC20 token.
|
|
16753
|
+
* @property {ItemType.NATIVE | ItemType.ERC20} type - Type to indicate this is a native or ERC20 token.
|
|
16753
16754
|
* @property {BigNumber} balance - The balance of the item.
|
|
16754
16755
|
* @property {string} formattedBalance - The formatted balance of the item.
|
|
16755
16756
|
* @property {TokenInfo} token - The token info of the item.
|
|
@@ -16761,18 +16762,20 @@ type TokenBalance = {
|
|
|
16761
16762
|
token: TokenInfo;
|
|
16762
16763
|
};
|
|
16763
16764
|
/**
|
|
16764
|
-
* Represents the balance for an
|
|
16765
|
+
* Represents the balance for an ERC721.
|
|
16766
|
+
* @property {ItemType.ERC721} type - Type to indicate this is an ERC721 token.
|
|
16765
16767
|
* @property {BigNumber} balance - The balance of the item.
|
|
16766
16768
|
* @property {string} formattedBalance - The formatted balance of the item.
|
|
16767
|
-
* @property {
|
|
16769
|
+
* @property {string} contractAddress - The contract address of the ERC721 collection.
|
|
16770
|
+
* @property {string} id - The ID of the ERC721 in the collection.
|
|
16768
16771
|
*/
|
|
16769
|
-
|
|
16772
|
+
type ERC721Balance = {
|
|
16770
16773
|
type: ItemType.ERC721;
|
|
16771
16774
|
balance: BigNumber;
|
|
16772
16775
|
formattedBalance: string;
|
|
16773
16776
|
contractAddress: string;
|
|
16774
16777
|
id: string;
|
|
16775
|
-
}
|
|
16778
|
+
};
|
|
16776
16779
|
/**
|
|
16777
16780
|
* Type representing the balance of an item.
|
|
16778
16781
|
*/
|
|
@@ -16789,6 +16792,9 @@ type BalanceDelta = {
|
|
|
16789
16792
|
/**
|
|
16790
16793
|
* A type representing the Smart Checkout routing options available for a user
|
|
16791
16794
|
* if they are configured and enabled (not geo-blocked etc.)
|
|
16795
|
+
* @property {boolean | undefined} onRamp - If the user can use onramp
|
|
16796
|
+
* @property {boolean | undefined} swap - If the user can use swap
|
|
16797
|
+
* @property {boolean | undefined} bridge - If the user can use bridge
|
|
16792
16798
|
*/
|
|
16793
16799
|
type AvailableRoutingOptions = {
|
|
16794
16800
|
onRamp?: boolean;
|
|
@@ -17311,7 +17317,8 @@ declare enum CheckoutErrorType {
|
|
|
17311
17317
|
BRIDGE_GAS_ESTIMATE_ERROR = "BRIDGE_GAS_ESTIMATE_ERROR",
|
|
17312
17318
|
ORDER_FEE_ERROR = "ORDER_FEE_ERROR",
|
|
17313
17319
|
ITEM_REQUIREMENTS_ERROR = "ITEM_REQUIREMENTS_ERROR",
|
|
17314
|
-
API_ERROR = "API_ERROR"
|
|
17320
|
+
API_ERROR = "API_ERROR",
|
|
17321
|
+
ORDER_EXPIRED_ERROR = "ORDER_EXPIRED_ERROR"
|
|
17315
17322
|
}
|
|
17316
17323
|
/**
|
|
17317
17324
|
* Represents an error object with a specific type, optional message, and optional data.
|