@imtbl/sdk 0.6.0-alpha → 0.6.1-alpha
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 +18 -3
- package/dist/checkout_sdk.js +2182 -123
- package/dist/checkout_widgets.d.ts +10496 -153
- package/dist/checkout_widgets.js +57 -8
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +8 -8
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +176 -42
- package/dist/index.d.ts +29 -7
- package/dist/index.js +176 -42
- package/dist/orderbook.d.ts +1 -3
- package/dist/orderbook.js +1 -3
- package/dist/passport.js +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2420,7 +2420,7 @@ class MultiRollupApiClients {
|
|
|
2420
2420
|
}
|
|
2421
2421
|
|
|
2422
2422
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2423
|
-
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.6.
|
|
2423
|
+
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.6.1-alpha' };
|
|
2424
2424
|
const createConfig = ({ basePath, headers, }) => {
|
|
2425
2425
|
if (!basePath.trim()) {
|
|
2426
2426
|
throw Error('basePath can not be empty');
|
|
@@ -2480,7 +2480,7 @@ class APIError extends Error {
|
|
|
2480
2480
|
|
|
2481
2481
|
/* eslint-disable implicit-arrow-linebreak */
|
|
2482
2482
|
const defaultHeaders = {
|
|
2483
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.6.
|
|
2483
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.6.1-alpha',
|
|
2484
2484
|
};
|
|
2485
2485
|
/**
|
|
2486
2486
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -2752,7 +2752,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
2752
2752
|
chainID,
|
|
2753
2753
|
coreContractAddress,
|
|
2754
2754
|
registrationContractAddress,
|
|
2755
|
-
sdkVersion: 'ts-immutable-sdk-0.6.
|
|
2755
|
+
sdkVersion: 'ts-immutable-sdk-0.6.1-alpha',
|
|
2756
2756
|
});
|
|
2757
2757
|
/**
|
|
2758
2758
|
* Sets `sdkVersion` at the time of build
|
|
@@ -10941,12 +10941,9 @@ class Orderbook {
|
|
|
10941
10941
|
}
|
|
10942
10942
|
}
|
|
10943
10943
|
|
|
10944
|
-
const module$1 = 'orderbook';
|
|
10945
|
-
|
|
10946
10944
|
var orderbook = /*#__PURE__*/Object.freeze({
|
|
10947
10945
|
__proto__: null,
|
|
10948
|
-
Orderbook: Orderbook
|
|
10949
|
-
module: module$1
|
|
10946
|
+
Orderbook: Orderbook
|
|
10950
10947
|
});
|
|
10951
10948
|
|
|
10952
10949
|
function isChainValid(chainID, config) {
|
|
@@ -27464,6 +27461,19 @@ const $762782b6c862d954$export$db5daa1b5156ccfe = [
|
|
|
27464
27461
|
];
|
|
27465
27462
|
|
|
27466
27463
|
|
|
27464
|
+
var $aa144554f9ef124b$export$1fc8f52ad1810e52;
|
|
27465
|
+
(function(ItemType) {
|
|
27466
|
+
ItemType["NATIVE"] = "NATIVE";
|
|
27467
|
+
ItemType["ERC20"] = "ERC20";
|
|
27468
|
+
ItemType["ERC721"] = "ERC721";
|
|
27469
|
+
})($aa144554f9ef124b$export$1fc8f52ad1810e52 || ($aa144554f9ef124b$export$1fc8f52ad1810e52 = {}));
|
|
27470
|
+
var $aa144554f9ef124b$export$537fa3efd10ed435;
|
|
27471
|
+
(function(GasTokenType) {
|
|
27472
|
+
GasTokenType["NATIVE"] = "NATIVE";
|
|
27473
|
+
GasTokenType["ERC20"] = "ERC20";
|
|
27474
|
+
})($aa144554f9ef124b$export$537fa3efd10ed435 || ($aa144554f9ef124b$export$537fa3efd10ed435 = {}));
|
|
27475
|
+
|
|
27476
|
+
|
|
27467
27477
|
/**
|
|
27468
27478
|
* Enum representing different chain IDs.
|
|
27469
27479
|
* @enum {number}
|
|
@@ -27561,10 +27571,6 @@ const $d85ad1457a3f1a83$export$161d4a74df65fc08 = {
|
|
|
27561
27571
|
[(Environment$1).SANDBOX]: "https://checkout-api.sandbox.immutable.com",
|
|
27562
27572
|
[(Environment$1).PRODUCTION]: "https://checkout-api.immutable.com"
|
|
27563
27573
|
};
|
|
27564
|
-
const $d85ad1457a3f1a83$export$7b057be2a3f512cc = {
|
|
27565
|
-
[(Environment$1).SANDBOX]: "https://zkevm-rpc.sandbox.imtbl.com",
|
|
27566
|
-
[(Environment$1).PRODUCTION]: "https://zkevm-rpc.imtbl.com"
|
|
27567
|
-
};
|
|
27568
27574
|
const $d85ad1457a3f1a83$export$6f24f3cef7d501c4 = new Map([
|
|
27569
27575
|
[
|
|
27570
27576
|
($0472f23319457bfb$export$c06e1e7429de6283).ETHEREUM,
|
|
@@ -27694,6 +27700,8 @@ const $d85ad1457a3f1a83$export$3a9ebede6a150274 = new Map([
|
|
|
27694
27700
|
CheckoutErrorType["INSUFFICIENT_FUNDS"] = "INSUFFICIENT_FUNDS";
|
|
27695
27701
|
CheckoutErrorType["UNPREDICTABLE_GAS_LIMIT"] = "UNPREDICTABLE_GAS_LIMIT";
|
|
27696
27702
|
CheckoutErrorType["INVALID_GAS_ESTIMATE_TYPE"] = "INVALID_GAS_ESTIMATE_TYPE";
|
|
27703
|
+
CheckoutErrorType["UNSUPPORTED_TOKEN_TYPE_ERROR"] = "UNSUPPORTED_TOKEN_TYPE_ERROR";
|
|
27704
|
+
CheckoutErrorType["GET_ORDER_LISTING_ERROR"] = "GET_ORDER_LISTING_ERROR";
|
|
27697
27705
|
})($a8bc256d81a5e2c1$export$e3dc0620abde7f5a || ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a = {}));
|
|
27698
27706
|
class $a8bc256d81a5e2c1$export$b722478a3cbfa3bc extends Error {
|
|
27699
27707
|
message;
|
|
@@ -28140,6 +28148,7 @@ async function $570856c68db0bd36$export$9e73e22953cebcfc(tokenBridge, tokenAddre
|
|
|
28140
28148
|
|
|
28141
28149
|
|
|
28142
28150
|
|
|
28151
|
+
|
|
28143
28152
|
async function $67fc622a2b913d5f$export$989eefe1274a439c(fromChainId, toChainId, readOnlyProviders, config) {
|
|
28144
28153
|
const rootChainProvider = readOnlyProviders.get(fromChainId);
|
|
28145
28154
|
const childChainProvider = readOnlyProviders.get(toChainId);
|
|
@@ -28168,6 +28177,13 @@ async function $67fc622a2b913d5f$export$7cf6178417769841(chainId, config) {
|
|
|
28168
28177
|
overrides: dexConfig?.overrides
|
|
28169
28178
|
});
|
|
28170
28179
|
}
|
|
28180
|
+
async function $67fc622a2b913d5f$export$c60ce6c6a92bc2ff(config) {
|
|
28181
|
+
return new (Orderbook)({
|
|
28182
|
+
baseConfig: {
|
|
28183
|
+
environment: config.environment
|
|
28184
|
+
}
|
|
28185
|
+
});
|
|
28186
|
+
}
|
|
28171
28187
|
|
|
28172
28188
|
|
|
28173
28189
|
|
|
@@ -28234,23 +28250,10 @@ class $4013c5c91bb535f6$export$6ad73ea7e1b6f37f extends Error {
|
|
|
28234
28250
|
this.message = message;
|
|
28235
28251
|
}
|
|
28236
28252
|
}
|
|
28237
|
-
const $4013c5c91bb535f6$var$networkMap = (prod, dev
|
|
28238
|
-
|
|
28239
|
-
if (
|
|
28240
|
-
|
|
28241
|
-
networks = ($d85ad1457a3f1a83$export$6f24f3cef7d501c4);
|
|
28242
|
-
if (local) {
|
|
28243
|
-
const rpcUrls = networks.get(($0472f23319457bfb$export$c06e1e7429de6283).IMTBL_ZKEVM_MAINNET)?.rpcUrls;
|
|
28244
|
-
rpcUrls?.splice(0, 1, ($d85ad1457a3f1a83$export$7b057be2a3f512cc)[(Environment$1).PRODUCTION]);
|
|
28245
|
-
}
|
|
28246
|
-
} else {
|
|
28247
|
-
networks = ($d85ad1457a3f1a83$export$3e81fc0987227f10);
|
|
28248
|
-
if (local) {
|
|
28249
|
-
const rpcUrls = networks.get(($0472f23319457bfb$export$c06e1e7429de6283).IMTBL_ZKEVM_TESTNET)?.rpcUrls;
|
|
28250
|
-
rpcUrls?.splice(0, 1, ($d85ad1457a3f1a83$export$7b057be2a3f512cc)[(Environment$1).SANDBOX]);
|
|
28251
|
-
}
|
|
28252
|
-
}
|
|
28253
|
-
return networks;
|
|
28253
|
+
const $4013c5c91bb535f6$var$networkMap = (prod, dev)=>{
|
|
28254
|
+
if (dev) return $d85ad1457a3f1a83$export$3a9ebede6a150274;
|
|
28255
|
+
if (prod) return $d85ad1457a3f1a83$export$6f24f3cef7d501c4;
|
|
28256
|
+
return $d85ad1457a3f1a83$export$3e81fc0987227f10;
|
|
28254
28257
|
};
|
|
28255
28258
|
const $4013c5c91bb535f6$export$9b794d067cdd1af6 = (config)=>{
|
|
28256
28259
|
// DevMode and Sandbox will both use Sepolia.
|
|
@@ -28268,11 +28271,6 @@ class $4013c5c91bb535f6$export$4823433c4a67bbc6 {
|
|
|
28268
28271
|
// This will be used to get around the lack of
|
|
28269
28272
|
// Environment.DEVELOPMENT
|
|
28270
28273
|
isDevelopment = false;
|
|
28271
|
-
// This is a hidden feature that is only available
|
|
28272
|
-
// when building the project from source code.
|
|
28273
|
-
// This will be used to get around the lack of
|
|
28274
|
-
// Environment.LOCAL_DEVELOPMENT
|
|
28275
|
-
isLocal = false;
|
|
28276
28274
|
isProduction;
|
|
28277
28275
|
remote;
|
|
28278
28276
|
environment;
|
|
@@ -28282,7 +28280,7 @@ class $4013c5c91bb535f6$export$4823433c4a67bbc6 {
|
|
|
28282
28280
|
this.environment = config.baseConfig.environment;
|
|
28283
28281
|
// Developer mode will super set any environment configuration
|
|
28284
28282
|
this.isProduction = !this.isDevelopment && this.environment === (Environment$1).PRODUCTION;
|
|
28285
|
-
this.networkMap = $4013c5c91bb535f6$var$networkMap(this.isProduction, this.isDevelopment
|
|
28283
|
+
this.networkMap = $4013c5c91bb535f6$var$networkMap(this.isProduction, this.isDevelopment);
|
|
28286
28284
|
this.remote = new ($a492ee374ae7b613$export$d902b56530cd5f87)({
|
|
28287
28285
|
isDevelopment: this.isDevelopment,
|
|
28288
28286
|
isProduction: this.isProduction
|
|
@@ -28392,6 +28390,84 @@ async function $2e7bf45a7c9a9570$export$942c8de7174809fc(params, readOnlyProvide
|
|
|
28392
28390
|
|
|
28393
28391
|
|
|
28394
28392
|
|
|
28393
|
+
const $c147333b1f360629$export$92589613aaa38e1f = 300000;
|
|
28394
|
+
const $c147333b1f360629$export$dea9ce0e9bb2441c = "0x474989C4D25DD41B0B9b1ECb4643B9Fe25f83B19";
|
|
28395
|
+
const $c147333b1f360629$export$5baee63457fa7911 = (type, amount, contractAddress)=>{
|
|
28396
|
+
switch(type){
|
|
28397
|
+
case ($aa144554f9ef124b$export$1fc8f52ad1810e52).ERC20:
|
|
28398
|
+
case ($aa144554f9ef124b$export$1fc8f52ad1810e52).ERC721:
|
|
28399
|
+
return {
|
|
28400
|
+
type: type,
|
|
28401
|
+
amount: amount,
|
|
28402
|
+
contractAddress: contractAddress,
|
|
28403
|
+
approvalContractAddress: $c147333b1f360629$export$dea9ce0e9bb2441c
|
|
28404
|
+
};
|
|
28405
|
+
case ($aa144554f9ef124b$export$1fc8f52ad1810e52).NATIVE:
|
|
28406
|
+
default:
|
|
28407
|
+
return {
|
|
28408
|
+
type: ($aa144554f9ef124b$export$1fc8f52ad1810e52).NATIVE,
|
|
28409
|
+
amount: amount
|
|
28410
|
+
};
|
|
28411
|
+
}
|
|
28412
|
+
};
|
|
28413
|
+
const $c147333b1f360629$export$7f8e2b98eca5a7f0 = async (config, provider, orderId)=>{
|
|
28414
|
+
let order;
|
|
28415
|
+
try {
|
|
28416
|
+
const orderbook = await $67fc622a2b913d5f$export$c60ce6c6a92bc2ff(config);
|
|
28417
|
+
order = await orderbook.getListing(orderId);
|
|
28418
|
+
} catch (err) {
|
|
28419
|
+
throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("An error occurred while getting the order listing", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).GET_ORDER_LISTING_ERROR, {
|
|
28420
|
+
orderId: orderId,
|
|
28421
|
+
message: err.message
|
|
28422
|
+
});
|
|
28423
|
+
}
|
|
28424
|
+
let amount = (ethers.BigNumber).from("0");
|
|
28425
|
+
let type = ($aa144554f9ef124b$export$1fc8f52ad1810e52).NATIVE;
|
|
28426
|
+
let contractAddress = "";
|
|
28427
|
+
const buyArray = order.result.buy;
|
|
28428
|
+
if (buyArray.length > 0) switch(buyArray[0].item_type){
|
|
28429
|
+
case "NATIVE":
|
|
28430
|
+
type = ($aa144554f9ef124b$export$1fc8f52ad1810e52).NATIVE;
|
|
28431
|
+
break;
|
|
28432
|
+
case "ERC20":
|
|
28433
|
+
type = ($aa144554f9ef124b$export$1fc8f52ad1810e52).ERC20;
|
|
28434
|
+
contractAddress = buyArray[0].contract_address;
|
|
28435
|
+
break;
|
|
28436
|
+
case "ERC721":
|
|
28437
|
+
type = ($aa144554f9ef124b$export$1fc8f52ad1810e52).ERC721;
|
|
28438
|
+
contractAddress = buyArray[0].contract_address;
|
|
28439
|
+
break;
|
|
28440
|
+
default:
|
|
28441
|
+
throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Purchasing token type is unsupported", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).UNSUPPORTED_TOKEN_TYPE_ERROR, {
|
|
28442
|
+
orderId: orderId
|
|
28443
|
+
});
|
|
28444
|
+
}
|
|
28445
|
+
buyArray.forEach((item)=>{
|
|
28446
|
+
amount = amount.add((ethers.BigNumber).from(item.start_amount));
|
|
28447
|
+
});
|
|
28448
|
+
const feeArray = order.result.fees;
|
|
28449
|
+
feeArray.forEach((item)=>{
|
|
28450
|
+
amount = amount.add((ethers.BigNumber).from(item.amount));
|
|
28451
|
+
});
|
|
28452
|
+
const requirements = [
|
|
28453
|
+
$c147333b1f360629$export$5baee63457fa7911(type, amount, contractAddress)
|
|
28454
|
+
];
|
|
28455
|
+
return {
|
|
28456
|
+
requirements: requirements,
|
|
28457
|
+
gas: {
|
|
28458
|
+
type: ($aa144554f9ef124b$export$537fa3efd10ed435).NATIVE,
|
|
28459
|
+
limit: (ethers.BigNumber).from($c147333b1f360629$export$92589613aaa38e1f)
|
|
28460
|
+
}
|
|
28461
|
+
};
|
|
28462
|
+
};
|
|
28463
|
+
|
|
28464
|
+
|
|
28465
|
+
|
|
28466
|
+
|
|
28467
|
+
|
|
28468
|
+
|
|
28469
|
+
|
|
28470
|
+
|
|
28395
28471
|
async function $0e0060cb42e136d2$export$339cb2be73677b30(config, existingReadOnlyProviders) {
|
|
28396
28472
|
if (config.isProduction && existingReadOnlyProviders?.has(($0472f23319457bfb$export$c06e1e7429de6283).ETHEREUM)) return existingReadOnlyProviders;
|
|
28397
28473
|
if (existingReadOnlyProviders?.has(($0472f23319457bfb$export$c06e1e7429de6283).SEPOLIA)) return existingReadOnlyProviders;
|
|
@@ -28526,6 +28602,15 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
|
|
|
28526
28602
|
return await $de192de6ef100f9f$export$79f13b4cfaaf0d09(this.config, web3Provider);
|
|
28527
28603
|
}
|
|
28528
28604
|
/**
|
|
28605
|
+
* Determines the requirements for performing a buy.
|
|
28606
|
+
* @param {BuyParams} params - The parameters for the buy.
|
|
28607
|
+
*/ async buy(params) {
|
|
28608
|
+
// eslint-disable-next-line no-console
|
|
28609
|
+
console.warn("This endpoint is currently under construction.");
|
|
28610
|
+
const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider);
|
|
28611
|
+
await $c147333b1f360629$export$7f8e2b98eca5a7f0(this.config, web3Provider, params.orderId);
|
|
28612
|
+
}
|
|
28613
|
+
/**
|
|
28529
28614
|
* Checks if the given object is a Web3 provider.
|
|
28530
28615
|
* @param {Web3Provider} web3Provider - The object to check.
|
|
28531
28616
|
* @returns {boolean} - True if the object is a Web3 provider, false otherwise.
|
|
@@ -28559,7 +28644,7 @@ var checkout_sdk = /*#__PURE__*/Object.freeze({
|
|
|
28559
28644
|
function $parcel$export(e, n, v, s) {
|
|
28560
28645
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
28561
28646
|
}
|
|
28562
|
-
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.6.
|
|
28647
|
+
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.6.1-alpha";
|
|
28563
28648
|
const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
|
|
28564
28649
|
const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
|
|
28565
28650
|
|
|
@@ -28752,12 +28837,48 @@ function $77ec335383336bdd$export$931068bc678f0d73(tagName, provider) {
|
|
|
28752
28837
|
|
|
28753
28838
|
|
|
28754
28839
|
|
|
28840
|
+
function $b222a8f062090058$export$fae4199086a966a3(tagName, passport) {
|
|
28841
|
+
if (!passport) {
|
|
28842
|
+
// eslint-disable-next-line no-console
|
|
28843
|
+
console.error("no passport provided");
|
|
28844
|
+
return;
|
|
28845
|
+
}
|
|
28846
|
+
if (window === undefined) {
|
|
28847
|
+
// eslint-disable-next-line no-console
|
|
28848
|
+
console.error("missing window object: please run Checkout client side");
|
|
28849
|
+
return;
|
|
28850
|
+
}
|
|
28851
|
+
let attempts = 0;
|
|
28852
|
+
const maxAttempts = 10;
|
|
28853
|
+
let timer;
|
|
28854
|
+
const attemptToAddPassport = ()=>{
|
|
28855
|
+
try {
|
|
28856
|
+
const elements = document.getElementsByTagName(tagName);
|
|
28857
|
+
const widget = elements[0];
|
|
28858
|
+
widget.addPassportOption(passport);
|
|
28859
|
+
window.clearInterval(timer);
|
|
28860
|
+
} catch (err) {
|
|
28861
|
+
attempts++;
|
|
28862
|
+
if (attempts >= maxAttempts) {
|
|
28863
|
+
window.clearInterval(timer);
|
|
28864
|
+
// eslint-disable-next-line no-console
|
|
28865
|
+
console.error("failed to set the provider");
|
|
28866
|
+
}
|
|
28867
|
+
}
|
|
28868
|
+
};
|
|
28869
|
+
timer = window.setInterval(attemptToAddPassport, 10);
|
|
28870
|
+
attemptToAddPassport();
|
|
28871
|
+
}
|
|
28872
|
+
|
|
28873
|
+
|
|
28755
28874
|
function $1f969328e5988c99$export$30f61ebf204c69f6(props) {
|
|
28756
|
-
const { walletProvider: walletProvider, fromContractAddress: fromContractAddress, amount: amount, provider: provider } = props;
|
|
28875
|
+
const { walletProvider: walletProvider, fromContractAddress: fromContractAddress, amount: amount, provider: provider, passport: passport } = props;
|
|
28757
28876
|
(react.useEffect)(()=>{
|
|
28758
28877
|
if (provider) ($77ec335383336bdd$export$931068bc678f0d73)(($045213b18e9f1f94$export$75be0f6af9650f2c).BRIDGE, provider);
|
|
28878
|
+
if (passport) ($b222a8f062090058$export$fae4199086a966a3)(($045213b18e9f1f94$export$75be0f6af9650f2c).BRIDGE, passport);
|
|
28759
28879
|
}, [
|
|
28760
|
-
provider
|
|
28880
|
+
provider,
|
|
28881
|
+
passport
|
|
28761
28882
|
]);
|
|
28762
28883
|
const config = window.ImtblCheckoutWidgetConfig;
|
|
28763
28884
|
return /*#__PURE__*/ (jsxRuntime.jsx)("imtbl-bridge", {
|
|
@@ -28774,8 +28895,15 @@ var $f2083cd30e2f5c56$exports = {};
|
|
|
28774
28895
|
$parcel$export($f2083cd30e2f5c56$exports, "ConnectReact", () => $f2083cd30e2f5c56$export$49d62957f420a1e2);
|
|
28775
28896
|
|
|
28776
28897
|
|
|
28777
|
-
|
|
28898
|
+
|
|
28899
|
+
|
|
28900
|
+
function $f2083cd30e2f5c56$export$49d62957f420a1e2({ passport: passport }) {
|
|
28778
28901
|
const config = window.ImtblCheckoutWidgetConfig;
|
|
28902
|
+
(react.useEffect)(()=>{
|
|
28903
|
+
if (passport) ($b222a8f062090058$export$fae4199086a966a3)(($045213b18e9f1f94$export$75be0f6af9650f2c).CONNECT, passport);
|
|
28904
|
+
}, [
|
|
28905
|
+
passport
|
|
28906
|
+
]);
|
|
28779
28907
|
return /*#__PURE__*/ (jsxRuntime.jsx)("imtbl-connect", {
|
|
28780
28908
|
widgetConfig: config
|
|
28781
28909
|
});
|
|
@@ -28789,12 +28917,15 @@ $parcel$export($a4fbb8e3a6aeff58$exports, "SwapReact", () => $a4fbb8e3a6aeff58$e
|
|
|
28789
28917
|
|
|
28790
28918
|
|
|
28791
28919
|
|
|
28920
|
+
|
|
28792
28921
|
function $a4fbb8e3a6aeff58$export$971e031379577f4(props) {
|
|
28793
|
-
const { walletProvider: walletProvider, fromContractAddress: fromContractAddress, amount: amount, toContractAddress: toContractAddress, provider: provider } = props;
|
|
28922
|
+
const { walletProvider: walletProvider, fromContractAddress: fromContractAddress, amount: amount, toContractAddress: toContractAddress, provider: provider, passport: passport } = props;
|
|
28794
28923
|
(react.useEffect)(()=>{
|
|
28795
28924
|
if (provider) ($77ec335383336bdd$export$931068bc678f0d73)(($045213b18e9f1f94$export$75be0f6af9650f2c).SWAP, provider);
|
|
28925
|
+
if (passport) ($b222a8f062090058$export$fae4199086a966a3)(($045213b18e9f1f94$export$75be0f6af9650f2c).SWAP, passport);
|
|
28796
28926
|
}, [
|
|
28797
|
-
provider
|
|
28927
|
+
provider,
|
|
28928
|
+
passport
|
|
28798
28929
|
]);
|
|
28799
28930
|
const config = window.ImtblCheckoutWidgetConfig;
|
|
28800
28931
|
return /*#__PURE__*/ (jsxRuntime.jsx)("imtbl-swap", {
|
|
@@ -28814,12 +28945,15 @@ $parcel$export($89d55ace0f8f1c07$exports, "WalletReact", () => $89d55ace0f8f1c07
|
|
|
28814
28945
|
|
|
28815
28946
|
|
|
28816
28947
|
|
|
28948
|
+
|
|
28817
28949
|
function $89d55ace0f8f1c07$export$ceaac94f34dba154(props) {
|
|
28818
|
-
const { walletProvider: walletProvider, provider: provider } = props;
|
|
28950
|
+
const { walletProvider: walletProvider, provider: provider, passport: passport } = props;
|
|
28819
28951
|
(react.useEffect)(()=>{
|
|
28820
28952
|
if (provider) ($77ec335383336bdd$export$931068bc678f0d73)(($045213b18e9f1f94$export$75be0f6af9650f2c).WALLET, provider);
|
|
28953
|
+
if (passport) ($b222a8f062090058$export$fae4199086a966a3)(($045213b18e9f1f94$export$75be0f6af9650f2c).WALLET, passport);
|
|
28821
28954
|
}, [
|
|
28822
|
-
provider
|
|
28955
|
+
provider,
|
|
28956
|
+
passport
|
|
28823
28957
|
]);
|
|
28824
28958
|
const config = window.ImtblCheckoutWidgetConfig;
|
|
28825
28959
|
return /*#__PURE__*/ (jsxRuntime.jsx)("imtbl-wallet", {
|
package/dist/index.d.ts
CHANGED
|
@@ -13193,8 +13193,6 @@ interface CancelOrderResponse {
|
|
|
13193
13193
|
unsignedCancelOrderTransaction: PopulatedTransaction;
|
|
13194
13194
|
}
|
|
13195
13195
|
|
|
13196
|
-
declare const module = "orderbook";
|
|
13197
|
-
|
|
13198
13196
|
type orderbook_d_CancelOrderResponse = CancelOrderResponse;
|
|
13199
13197
|
type orderbook_d_CreateListingParams = CreateListingParams;
|
|
13200
13198
|
type orderbook_d_ERC20Item = ERC20Item;
|
|
@@ -13207,7 +13205,6 @@ declare const orderbook_d_Orderbook: typeof Orderbook;
|
|
|
13207
13205
|
type orderbook_d_PrepareListingParams = PrepareListingParams;
|
|
13208
13206
|
type orderbook_d_PrepareListingResponse = PrepareListingResponse;
|
|
13209
13207
|
type orderbook_d_RoyaltyInfo = RoyaltyInfo;
|
|
13210
|
-
declare const orderbook_d_module: typeof module;
|
|
13211
13208
|
declare namespace orderbook_d {
|
|
13212
13209
|
export {
|
|
13213
13210
|
orderbook_d_CancelOrderResponse as CancelOrderResponse,
|
|
@@ -13221,7 +13218,6 @@ declare namespace orderbook_d {
|
|
|
13221
13218
|
orderbook_d_PrepareListingParams as PrepareListingParams,
|
|
13222
13219
|
orderbook_d_PrepareListingResponse as PrepareListingResponse,
|
|
13223
13220
|
orderbook_d_RoyaltyInfo as RoyaltyInfo,
|
|
13224
|
-
orderbook_d_module as module,
|
|
13225
13221
|
};
|
|
13226
13222
|
}
|
|
13227
13223
|
|
|
@@ -13360,6 +13356,15 @@ interface GetAllBalancesParams {
|
|
|
13360
13356
|
interface GetAllBalancesResult {
|
|
13361
13357
|
balances: GetBalanceResult[];
|
|
13362
13358
|
}
|
|
13359
|
+
/**
|
|
13360
|
+
* Interface representing the parameters for {@link Checkout.buy}
|
|
13361
|
+
* @property {Web3Provider} provider - The provider to use for the buy.
|
|
13362
|
+
* @property {string} orderId - The order ID.
|
|
13363
|
+
*/
|
|
13364
|
+
interface BuyParams {
|
|
13365
|
+
provider: Web3Provider;
|
|
13366
|
+
orderId: string;
|
|
13367
|
+
}
|
|
13363
13368
|
interface CheckoutOverrides {
|
|
13364
13369
|
}
|
|
13365
13370
|
interface CheckoutModuleConfiguration extends ModuleConfiguration<CheckoutOverrides> {
|
|
@@ -13740,7 +13745,9 @@ declare enum CheckoutErrorType {
|
|
|
13740
13745
|
TRANSACTION_FAILED = "TRANSACTION_FAILED",
|
|
13741
13746
|
INSUFFICIENT_FUNDS = "INSUFFICIENT_FUNDS",
|
|
13742
13747
|
UNPREDICTABLE_GAS_LIMIT = "UNPREDICTABLE_GAS_LIMIT",
|
|
13743
|
-
INVALID_GAS_ESTIMATE_TYPE = "INVALID_GAS_ESTIMATE_TYPE"
|
|
13748
|
+
INVALID_GAS_ESTIMATE_TYPE = "INVALID_GAS_ESTIMATE_TYPE",
|
|
13749
|
+
UNSUPPORTED_TOKEN_TYPE_ERROR = "UNSUPPORTED_TOKEN_TYPE_ERROR",
|
|
13750
|
+
GET_ORDER_LISTING_ERROR = "GET_ORDER_LISTING_ERROR"
|
|
13744
13751
|
}
|
|
13745
13752
|
/**
|
|
13746
13753
|
* Represents an error object with a specific type, optional message, and optional data.
|
|
@@ -13766,7 +13773,6 @@ declare class RemoteConfigFetcher {
|
|
|
13766
13773
|
}
|
|
13767
13774
|
declare class CheckoutConfiguration {
|
|
13768
13775
|
readonly isDevelopment: boolean;
|
|
13769
|
-
readonly isLocal: boolean;
|
|
13770
13776
|
readonly isProduction: boolean;
|
|
13771
13777
|
readonly remote: RemoteConfigFetcher;
|
|
13772
13778
|
readonly environment: Environment;
|
|
@@ -13847,6 +13853,11 @@ declare class Checkout {
|
|
|
13847
13853
|
* @returns {Promise<NetworkInfo>} A promise that resolves to the network information.
|
|
13848
13854
|
*/
|
|
13849
13855
|
getNetworkInfo(params: GetNetworkParams): Promise<NetworkInfo>;
|
|
13856
|
+
/**
|
|
13857
|
+
* Determines the requirements for performing a buy.
|
|
13858
|
+
* @param {BuyParams} params - The parameters for the buy.
|
|
13859
|
+
*/
|
|
13860
|
+
buy(params: BuyParams): Promise<void>;
|
|
13850
13861
|
/**
|
|
13851
13862
|
* Checks if the given object is a Web3 provider.
|
|
13852
13863
|
* @param {Web3Provider} web3Provider - The object to check.
|
|
@@ -13862,6 +13873,7 @@ declare class Checkout {
|
|
|
13862
13873
|
}
|
|
13863
13874
|
|
|
13864
13875
|
type checkout_sdk_d_AllowedNetworkConfig = AllowedNetworkConfig;
|
|
13876
|
+
type checkout_sdk_d_BuyParams = BuyParams;
|
|
13865
13877
|
declare const checkout_sdk_d_CHECKOUT_API_BASE_URL: typeof CHECKOUT_API_BASE_URL;
|
|
13866
13878
|
type checkout_sdk_d_ChainId = ChainId;
|
|
13867
13879
|
declare const checkout_sdk_d_ChainId: typeof ChainId;
|
|
@@ -13917,6 +13929,7 @@ declare const checkout_sdk_d_WalletProviderName: typeof WalletProviderName;
|
|
|
13917
13929
|
declare namespace checkout_sdk_d {
|
|
13918
13930
|
export {
|
|
13919
13931
|
checkout_sdk_d_AllowedNetworkConfig as AllowedNetworkConfig,
|
|
13932
|
+
checkout_sdk_d_BuyParams as BuyParams,
|
|
13920
13933
|
checkout_sdk_d_CHECKOUT_API_BASE_URL as CHECKOUT_API_BASE_URL,
|
|
13921
13934
|
checkout_sdk_d_ChainId as ChainId,
|
|
13922
13935
|
checkout_sdk_d_ChainName as ChainName,
|
|
@@ -28660,6 +28673,7 @@ declare global {
|
|
|
28660
28673
|
}
|
|
28661
28674
|
interface ImmutableWebComponent {
|
|
28662
28675
|
setProvider: Function;
|
|
28676
|
+
addPassportOption: Function;
|
|
28663
28677
|
setAttribute: Function;
|
|
28664
28678
|
}
|
|
28665
28679
|
}
|
|
@@ -28730,6 +28744,7 @@ interface ImtblBridgeProps extends React.DetailedHTMLProps<React.HTMLAttributes<
|
|
|
28730
28744
|
interface BridgeReactProps {
|
|
28731
28745
|
walletProvider?: WalletProviderName;
|
|
28732
28746
|
provider?: Web3Provider;
|
|
28747
|
+
passport?: Passport;
|
|
28733
28748
|
fromContractAddress?: string;
|
|
28734
28749
|
amount?: string;
|
|
28735
28750
|
}
|
|
@@ -28743,7 +28758,10 @@ declare function BridgeReact(props: BridgeReactProps): JSX.Element;
|
|
|
28743
28758
|
* A React functional component that renders the Checkout Connect Widget.
|
|
28744
28759
|
* @returns {JSX.Element} - The rendered Connect Widget component.
|
|
28745
28760
|
*/
|
|
28746
|
-
|
|
28761
|
+
interface ConnectReactProps {
|
|
28762
|
+
passport?: Passport;
|
|
28763
|
+
}
|
|
28764
|
+
declare function ConnectReact({ passport }: ConnectReactProps): JSX.Element;
|
|
28747
28765
|
/**
|
|
28748
28766
|
* Interface representing the props for the Swap Widget component.
|
|
28749
28767
|
* @interface SwapReactProps
|
|
@@ -28756,6 +28774,7 @@ declare function ConnectReact(): JSX.Element;
|
|
|
28756
28774
|
interface SwapReactProps {
|
|
28757
28775
|
walletProvider?: WalletProviderName;
|
|
28758
28776
|
provider?: Web3Provider;
|
|
28777
|
+
passport?: Passport;
|
|
28759
28778
|
fromContractAddress?: string;
|
|
28760
28779
|
amount?: string;
|
|
28761
28780
|
toContractAddress?: string;
|
|
@@ -28775,6 +28794,7 @@ declare function SwapReact(props: SwapReactProps): JSX.Element;
|
|
|
28775
28794
|
interface WalletReactProps {
|
|
28776
28795
|
walletProvider?: WalletProviderName;
|
|
28777
28796
|
provider?: Web3Provider;
|
|
28797
|
+
passport?: Passport;
|
|
28778
28798
|
}
|
|
28779
28799
|
/**
|
|
28780
28800
|
* A React functional component that renders the Checkout Wallet Widget.
|
|
@@ -28796,6 +28816,7 @@ type checkout_widgets_d_CheckoutWidgetsConfig = CheckoutWidgetsConfig;
|
|
|
28796
28816
|
type checkout_widgets_d_ConnectEventType = ConnectEventType;
|
|
28797
28817
|
declare const checkout_widgets_d_ConnectEventType: typeof ConnectEventType;
|
|
28798
28818
|
declare const checkout_widgets_d_ConnectReact: typeof ConnectReact;
|
|
28819
|
+
type checkout_widgets_d_ConnectReactProps = ConnectReactProps;
|
|
28799
28820
|
type checkout_widgets_d_ConnectionFailed = ConnectionFailed;
|
|
28800
28821
|
type checkout_widgets_d_ConnectionSuccess = ConnectionSuccess;
|
|
28801
28822
|
type checkout_widgets_d_IMTBLWidgetEvents = IMTBLWidgetEvents;
|
|
@@ -28841,6 +28862,7 @@ declare namespace checkout_widgets_d {
|
|
|
28841
28862
|
checkout_widgets_d_CheckoutWidgetsConfig as CheckoutWidgetsConfig,
|
|
28842
28863
|
checkout_widgets_d_ConnectEventType as ConnectEventType,
|
|
28843
28864
|
checkout_widgets_d_ConnectReact as ConnectReact,
|
|
28865
|
+
checkout_widgets_d_ConnectReactProps as ConnectReactProps,
|
|
28844
28866
|
checkout_widgets_d_ConnectionFailed as ConnectionFailed,
|
|
28845
28867
|
checkout_widgets_d_ConnectionSuccess as ConnectionSuccess,
|
|
28846
28868
|
checkout_widgets_d_IMTBLWidgetEvents as IMTBLWidgetEvents,
|