@imtbl/sdk 0.27.12 → 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.js +1 -1
- package/dist/browser/checkout.js +2 -2
- package/dist/checkout_sdk.d.ts +16 -9
- package/dist/checkout_sdk.js +13 -4
- package/dist/checkout_widgets.js +1 -1
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +4 -4
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +16 -7
- package/dist/index.d.ts +16 -9
- package/dist/index.js +16 -7
- package/dist/passport.js +2 -2
- package/package.json +1 -1
package/dist/checkout_sdk.d.ts
CHANGED
|
@@ -11198,7 +11198,7 @@ type ERC20BuyToken = {
|
|
|
11198
11198
|
contractAddress: string;
|
|
11199
11199
|
};
|
|
11200
11200
|
/**
|
|
11201
|
-
*
|
|
11201
|
+
* The SellToken type
|
|
11202
11202
|
* @property {string} id - The ERC721 token id
|
|
11203
11203
|
* @property {string} collectionAddress - The ERC721 collection address
|
|
11204
11204
|
*/
|
|
@@ -11529,9 +11529,9 @@ type UserBalance = {
|
|
|
11529
11529
|
* Represents the transaction requirement for a transaction.
|
|
11530
11530
|
* @property {ItemType} type - The type of the transaction requirement.
|
|
11531
11531
|
* @property {boolean} sufficient - If the user address has sufficient funds to cover the transaction.
|
|
11532
|
-
* @property {
|
|
11533
|
-
* @property {
|
|
11534
|
-
* @property {
|
|
11532
|
+
* @property {ItemBalance} required - The required item balance.
|
|
11533
|
+
* @property {ItemBalance} current - The current item balance.
|
|
11534
|
+
* @property {BalanceDelta} delta - The delta between the required and current balances.
|
|
11535
11535
|
*/
|
|
11536
11536
|
type TransactionRequirement = {
|
|
11537
11537
|
type: ItemType;
|
|
@@ -11542,6 +11542,7 @@ type TransactionRequirement = {
|
|
|
11542
11542
|
};
|
|
11543
11543
|
/**
|
|
11544
11544
|
* Represents the balance for either a native or ERC20 token.
|
|
11545
|
+
* @property {ItemType.NATIVE | ItemType.ERC20} type - Type to indicate this is a native or ERC20 token.
|
|
11545
11546
|
* @property {BigNumber} balance - The balance of the item.
|
|
11546
11547
|
* @property {string} formattedBalance - The formatted balance of the item.
|
|
11547
11548
|
* @property {TokenInfo} token - The token info of the item.
|
|
@@ -11553,18 +11554,20 @@ type TokenBalance = {
|
|
|
11553
11554
|
token: TokenInfo;
|
|
11554
11555
|
};
|
|
11555
11556
|
/**
|
|
11556
|
-
* Represents the balance for an
|
|
11557
|
+
* Represents the balance for an ERC721.
|
|
11558
|
+
* @property {ItemType.ERC721} type - Type to indicate this is an ERC721 token.
|
|
11557
11559
|
* @property {BigNumber} balance - The balance of the item.
|
|
11558
11560
|
* @property {string} formattedBalance - The formatted balance of the item.
|
|
11559
|
-
* @property {
|
|
11561
|
+
* @property {string} contractAddress - The contract address of the ERC721 collection.
|
|
11562
|
+
* @property {string} id - The ID of the ERC721 in the collection.
|
|
11560
11563
|
*/
|
|
11561
|
-
|
|
11564
|
+
type ERC721Balance = {
|
|
11562
11565
|
type: ItemType.ERC721;
|
|
11563
11566
|
balance: BigNumber;
|
|
11564
11567
|
formattedBalance: string;
|
|
11565
11568
|
contractAddress: string;
|
|
11566
11569
|
id: string;
|
|
11567
|
-
}
|
|
11570
|
+
};
|
|
11568
11571
|
/**
|
|
11569
11572
|
* Type representing the balance of an item.
|
|
11570
11573
|
*/
|
|
@@ -11581,6 +11584,9 @@ type BalanceDelta = {
|
|
|
11581
11584
|
/**
|
|
11582
11585
|
* A type representing the Smart Checkout routing options available for a user
|
|
11583
11586
|
* if they are configured and enabled (not geo-blocked etc.)
|
|
11587
|
+
* @property {boolean | undefined} onRamp - If the user can use onramp
|
|
11588
|
+
* @property {boolean | undefined} swap - If the user can use swap
|
|
11589
|
+
* @property {boolean | undefined} bridge - If the user can use bridge
|
|
11584
11590
|
*/
|
|
11585
11591
|
type AvailableRoutingOptions = {
|
|
11586
11592
|
onRamp?: boolean;
|
|
@@ -12103,7 +12109,8 @@ declare enum CheckoutErrorType {
|
|
|
12103
12109
|
BRIDGE_GAS_ESTIMATE_ERROR = "BRIDGE_GAS_ESTIMATE_ERROR",
|
|
12104
12110
|
ORDER_FEE_ERROR = "ORDER_FEE_ERROR",
|
|
12105
12111
|
ITEM_REQUIREMENTS_ERROR = "ITEM_REQUIREMENTS_ERROR",
|
|
12106
|
-
API_ERROR = "API_ERROR"
|
|
12112
|
+
API_ERROR = "API_ERROR",
|
|
12113
|
+
ORDER_EXPIRED_ERROR = "ORDER_EXPIRED_ERROR"
|
|
12107
12114
|
}
|
|
12108
12115
|
/**
|
|
12109
12116
|
* Represents an error object with a specific type, optional message, and optional data.
|
package/dist/checkout_sdk.js
CHANGED
|
@@ -20599,7 +20599,7 @@ class APIError extends Error {
|
|
|
20599
20599
|
|
|
20600
20600
|
/* eslint-disable implicit-arrow-linebreak */
|
|
20601
20601
|
const defaultHeaders = {
|
|
20602
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.27.
|
|
20602
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.27.13',
|
|
20603
20603
|
};
|
|
20604
20604
|
/**
|
|
20605
20605
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -21513,6 +21513,7 @@ var $e055e79256bbc1dd$export$80f4da0d409a629d;
|
|
|
21513
21513
|
CheckoutErrorType["ORDER_FEE_ERROR"] = "ORDER_FEE_ERROR";
|
|
21514
21514
|
CheckoutErrorType["ITEM_REQUIREMENTS_ERROR"] = "ITEM_REQUIREMENTS_ERROR";
|
|
21515
21515
|
CheckoutErrorType["API_ERROR"] = "API_ERROR";
|
|
21516
|
+
CheckoutErrorType["ORDER_EXPIRED_ERROR"] = "ORDER_EXPIRED_ERROR";
|
|
21516
21517
|
})($a8bc256d81a5e2c1$export$e3dc0620abde7f5a || ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a = {}));
|
|
21517
21518
|
class $a8bc256d81a5e2c1$export$b722478a3cbfa3bc extends Error {
|
|
21518
21519
|
message;
|
|
@@ -24596,16 +24597,24 @@ const $64863c39386de592$export$7f8e2b98eca5a7f0 = async (config, provider, order
|
|
|
24596
24597
|
let unsignedApprovalTransactions = [];
|
|
24597
24598
|
let unsignedFulfillmentTransactions = [];
|
|
24598
24599
|
let orderActions = [];
|
|
24599
|
-
const fulfillOrderStartTime =
|
|
24600
|
+
const fulfillOrderStartTime = performance.now();
|
|
24600
24601
|
try {
|
|
24601
24602
|
const fulfillerAddress = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to get the address from the provider", provider.getSigner().getAddress());
|
|
24602
24603
|
const { actions: actions } = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to call fulfillOrder from the orderbook", orderbook.fulfillOrder(id, fulfillerAddress, fees));
|
|
24603
24604
|
orderActions = actions;
|
|
24604
24605
|
unsignedApprovalTransactions = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to construct the unsigned approval transactions", (0, $a7367d01c6e76b1c$export$f64a20a30eb98855)(actions));
|
|
24605
24606
|
} catch (err) {
|
|
24606
|
-
|
|
24607
|
-
const elapsedTimeInSeconds = (new Date().getTime() - fulfillOrderStartTime) / 1000;
|
|
24607
|
+
const elapsedTimeInSeconds = (performance.now() - fulfillOrderStartTime) / 1000;
|
|
24608
24608
|
($458d407830d66110$export$e6a390ea6399b7d8)(config, "Time to call fulfillOrder from the orderbook", elapsedTimeInSeconds);
|
|
24609
|
+
if (err.message.includes((OrderStatusName$1).EXPIRED)) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Order is expired", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).ORDER_EXPIRED_ERROR, {
|
|
24610
|
+
orderId: id
|
|
24611
|
+
});
|
|
24612
|
+
// The balances error will be handled by bulk order fulfillment but for now we
|
|
24613
|
+
// need to assert on this string to check that the error is not a balances error
|
|
24614
|
+
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, {
|
|
24615
|
+
orderId: id,
|
|
24616
|
+
message: err.message
|
|
24617
|
+
});
|
|
24609
24618
|
}
|
|
24610
24619
|
try {
|
|
24611
24620
|
unsignedFulfillmentTransactions = await (0, $458d407830d66110$export$5280dbcb91c8b391)(config, "Time to construct the unsigned fulfillment transactions", (0, $a7367d01c6e76b1c$export$396bd6ce7d3ab533)(orderActions));
|
package/dist/checkout_widgets.js
CHANGED
|
@@ -25,7 +25,7 @@ var $045213b18e9f1f94$export$75be0f6af9650f2c;
|
|
|
25
25
|
})($045213b18e9f1f94$export$75be0f6af9650f2c || ($045213b18e9f1f94$export$75be0f6af9650f2c = {}));
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.27.
|
|
28
|
+
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.27.13";
|
|
29
29
|
const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
|
|
30
30
|
const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
|
|
31
31
|
|
|
@@ -16,7 +16,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
16
16
|
chainID,
|
|
17
17
|
coreContractAddress,
|
|
18
18
|
registrationContractAddress,
|
|
19
|
-
sdkVersion: 'ts-immutable-sdk-0.27.
|
|
19
|
+
sdkVersion: 'ts-immutable-sdk-0.27.13',
|
|
20
20
|
});
|
|
21
21
|
/**
|
|
22
22
|
* Sets `sdkVersion` at the time of build
|