@imtbl/sdk 0.1.10-alpha.2 → 0.1.10-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blockchain-data.js +1 -1
- package/dist/browser/checkout.js +2 -2
- package/dist/checkout_sdk.d.ts +5 -7
- package/dist/checkout_sdk.js +11 -24
- package/dist/checkout_widgets.d.ts +14109 -14120
- package/dist/checkout_widgets.js +21 -1
- package/dist/immutablex_client.js +1 -1
- package/dist/index.cjs +46 -36
- package/dist/index.d.ts +6 -19
- package/dist/index.js +46 -36
- package/dist/orderbook.js +12 -9
- package/dist/passport.js +1 -1
- package/package.json +1 -1
package/dist/checkout_widgets.js
CHANGED
|
@@ -4,7 +4,7 @@ import { useEffect } from 'react';
|
|
|
4
4
|
function $parcel$export(e, n, v, s) {
|
|
5
5
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
6
6
|
}
|
|
7
|
-
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.1.10-alpha.
|
|
7
|
+
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.1.10-alpha.3";
|
|
8
8
|
const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
|
|
9
9
|
const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
|
|
10
10
|
|
|
@@ -32,6 +32,16 @@ function $430e3eda76fa4d5f$export$46b1ae20f762ad4c(version) {
|
|
|
32
32
|
return validatedVersion;
|
|
33
33
|
}
|
|
34
34
|
function $430e3eda76fa4d5f$export$af210a0808087845(config) {
|
|
35
|
+
if (window === undefined) {
|
|
36
|
+
// eslint-disable-next-line no-console
|
|
37
|
+
console.error("missing window object: please run Checkout client side");
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (document === undefined) {
|
|
41
|
+
// eslint-disable-next-line no-console
|
|
42
|
+
console.error("missing document object: please run Checkout client side");
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
35
45
|
const checkoutWidgetJS = document.createElement("script");
|
|
36
46
|
const validVersion = $430e3eda76fa4d5f$export$46b1ae20f762ad4c(config?.version);
|
|
37
47
|
let cdnUrl = `https://cdn.jsdelivr.net/npm/@imtbl/sdk@${validVersion}/dist/browser/checkout.js`;
|
|
@@ -41,6 +51,11 @@ function $430e3eda76fa4d5f$export$af210a0808087845(config) {
|
|
|
41
51
|
window.ImtblCheckoutWidgetConfig = JSON.stringify(config);
|
|
42
52
|
}
|
|
43
53
|
function $430e3eda76fa4d5f$export$bf1548ba7e61c17f(config) {
|
|
54
|
+
if (window === undefined) {
|
|
55
|
+
// eslint-disable-next-line no-console
|
|
56
|
+
console.error("missing document object: please run Checkout client side");
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
44
59
|
window.ImtblCheckoutWidgetConfig = JSON.stringify(config);
|
|
45
60
|
}
|
|
46
61
|
|
|
@@ -153,6 +168,11 @@ function $77ec335383336bdd$export$931068bc678f0d73(tagName, provider) {
|
|
|
153
168
|
console.error("no provider parsed");
|
|
154
169
|
return;
|
|
155
170
|
}
|
|
171
|
+
if (window === undefined) {
|
|
172
|
+
// eslint-disable-next-line no-console
|
|
173
|
+
console.error("missing window object: please run Checkout client side");
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
156
176
|
let attempts = 0;
|
|
157
177
|
const maxAttempts = 10;
|
|
158
178
|
let timer;
|
|
@@ -16,7 +16,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
16
16
|
chainID,
|
|
17
17
|
coreContractAddress,
|
|
18
18
|
registrationContractAddress,
|
|
19
|
-
sdkVersion: 'ts-immutable-sdk-0.1.10-alpha.
|
|
19
|
+
sdkVersion: 'ts-immutable-sdk-0.1.10-alpha.3',
|
|
20
20
|
});
|
|
21
21
|
/**
|
|
22
22
|
* Sets `sdkVersion` at the time of build
|
package/dist/index.cjs
CHANGED
|
@@ -16,7 +16,6 @@ var seaportJs = require('@opensea/seaport-js');
|
|
|
16
16
|
var units = require('@ethersproject/units');
|
|
17
17
|
var bignumber = require('@ethersproject/bignumber');
|
|
18
18
|
var detectEthereumProvider = require('@metamask/detect-provider');
|
|
19
|
-
var ethers$1 = require('ethers/lib/ethers');
|
|
20
19
|
var sdkCore = require('@uniswap/sdk-core');
|
|
21
20
|
var assert = require('assert');
|
|
22
21
|
var v3Sdk = require('@uniswap/v3-sdk');
|
|
@@ -5459,7 +5458,7 @@ class APIError extends Error {
|
|
|
5459
5458
|
|
|
5460
5459
|
/* eslint-disable implicit-arrow-linebreak */
|
|
5461
5460
|
const defaultHeaders = {
|
|
5462
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.1.10-alpha.
|
|
5461
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.1.10-alpha.3',
|
|
5463
5462
|
};
|
|
5464
5463
|
/**
|
|
5465
5464
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -5725,7 +5724,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
5725
5724
|
chainID,
|
|
5726
5725
|
coreContractAddress,
|
|
5727
5726
|
registrationContractAddress,
|
|
5728
|
-
sdkVersion: 'ts-immutable-sdk-0.1.10-alpha.
|
|
5727
|
+
sdkVersion: 'ts-immutable-sdk-0.1.10-alpha.3',
|
|
5729
5728
|
});
|
|
5730
5729
|
/**
|
|
5731
5730
|
* Sets `sdkVersion` at the time of build
|
|
@@ -11849,7 +11848,7 @@ class ImmutableApiClientFactory {
|
|
|
11849
11848
|
|
|
11850
11849
|
// eslint-disable-next-line
|
|
11851
11850
|
dotenv.config();
|
|
11852
|
-
function
|
|
11851
|
+
function getConfigFromEnv() {
|
|
11853
11852
|
if (!process.env.ORDERBOOK_MR_API_URL
|
|
11854
11853
|
|| !process.env.SEAPORT_CONTRACT_ADDRESS
|
|
11855
11854
|
|| !process.env.ZONE_CONTRACT_ADDRESS) {
|
|
@@ -11877,16 +11876,19 @@ const LOCAL_CHAIN_NAME = 'imtbl-zkevm-local';
|
|
|
11877
11876
|
const DEVNET_CHAIN_NAME = 'imtbl-zkevm-devnet';
|
|
11878
11877
|
const TESTNET_CHAIN_NAME = 'imtbl-zkevm-testnet';
|
|
11879
11878
|
const MAINNET_CHAIN_NAME = 'imtbl-zkevm-mainnet';
|
|
11879
|
+
function localChainConfig() {
|
|
11880
|
+
const localConfig = getConfigFromEnv();
|
|
11881
|
+
return {
|
|
11882
|
+
seaportContractAddress: localConfig.seaportContractAddress,
|
|
11883
|
+
zoneContractAddress: localConfig.zoneContractAddress,
|
|
11884
|
+
apiEndpoint: localConfig.apiUrl,
|
|
11885
|
+
provider: getLocalhostProvider(),
|
|
11886
|
+
};
|
|
11887
|
+
}
|
|
11880
11888
|
function getOrderbookConfig(chainName) {
|
|
11881
|
-
const localConfig = getConfig();
|
|
11882
11889
|
switch (chainName) {
|
|
11883
11890
|
case LOCAL_CHAIN_NAME:
|
|
11884
|
-
return
|
|
11885
|
-
seaportContractAddress: localConfig.seaportContractAddress,
|
|
11886
|
-
zoneContractAddress: localConfig.zoneContractAddress,
|
|
11887
|
-
apiEndpoint: localConfig.apiUrl,
|
|
11888
|
-
provider: getLocalhostProvider(),
|
|
11889
|
-
};
|
|
11891
|
+
return localChainConfig();
|
|
11890
11892
|
case DEVNET_CHAIN_NAME:
|
|
11891
11893
|
return {
|
|
11892
11894
|
seaportContractAddress: '0x41388404Efb7a68Fd31d75CEf71dF91e2BDBa2fb',
|
|
@@ -12844,7 +12846,7 @@ class SeaportLibFactory {
|
|
|
12844
12846
|
this.provider = provider;
|
|
12845
12847
|
}
|
|
12846
12848
|
create(orderSeaportVersion, orderSeaportAddress) {
|
|
12847
|
-
const seaportVersion = orderSeaportVersion ??
|
|
12849
|
+
const seaportVersion = orderSeaportVersion ?? SEAPORT_CONTRACT_VERSION_V1_4;
|
|
12848
12850
|
const seaportContractAddress = orderSeaportAddress ?? this.defaultSeaportContractAddress;
|
|
12849
12851
|
return new seaportJs.Seaport(this.provider, {
|
|
12850
12852
|
seaportVersion,
|
|
@@ -26639,9 +26641,6 @@ class ExchangeConfiguration {
|
|
|
26639
26641
|
}
|
|
26640
26642
|
}
|
|
26641
26643
|
|
|
26642
|
-
function $parcel$interopDefault(a) {
|
|
26643
|
-
return a && a.__esModule ? a.default : a;
|
|
26644
|
-
}
|
|
26645
26644
|
/* eslint-disable class-methods-use-this */
|
|
26646
26645
|
|
|
26647
26646
|
const $762782b6c862d954$export$db5daa1b5156ccfe = [
|
|
@@ -26781,8 +26780,6 @@ var $4f91c5f280efe242$export$35b06f0d33f57e26;
|
|
|
26781
26780
|
exports.WalletFilterTypes = void 0;
|
|
26782
26781
|
(function(WalletFilterTypes) {
|
|
26783
26782
|
WalletFilterTypes["ALL"] = "all";
|
|
26784
|
-
WalletFilterTypes["DESKTOP"] = "desktop";
|
|
26785
|
-
WalletFilterTypes["MOBILE"] = "mobile";
|
|
26786
26783
|
})(exports.WalletFilterTypes || (exports.WalletFilterTypes = {}));
|
|
26787
26784
|
|
|
26788
26785
|
|
|
@@ -27295,23 +27292,17 @@ async function $bb88265fe45a0393$export$9e1fd9cc88c637a0(config, web3Provider, v
|
|
|
27295
27292
|
|
|
27296
27293
|
|
|
27297
27294
|
|
|
27298
|
-
|
|
27299
|
-
|
|
27300
|
-
|
|
27301
|
-
|
|
27302
|
-
|
|
27303
|
-
|
|
27304
|
-
|
|
27305
|
-
|
|
27306
|
-
const allowAllWallets = type === (exports.WalletFilterTypes).ALL;
|
|
27307
|
-
const walletsAllowedForType = wallet.platform.includes(type);
|
|
27308
|
-
return walletNotExcluded && (allowAllWallets || walletsAllowedForType);
|
|
27309
|
-
}).map((wallet)=>{
|
|
27310
|
-
const { platform: platform, ...walletInfo } = wallet;
|
|
27311
|
-
return walletInfo;
|
|
27295
|
+
async function $5cdde2ffe6360fec$export$a822caa90d7eef09(params) {
|
|
27296
|
+
const walletList = [];
|
|
27297
|
+
const excludedWalletProvider = params.exclude?.map((wp)=>wp.walletProvider) ?? [];
|
|
27298
|
+
let walletProviderNames = Object.values((exports.WalletProviderName));
|
|
27299
|
+
if (excludedWalletProvider.length !== 0) walletProviderNames = walletProviderNames.filter((wp)=>!excludedWalletProvider.includes(wp));
|
|
27300
|
+
for (const value of walletProviderNames)walletList.push({
|
|
27301
|
+
walletProvider: value,
|
|
27302
|
+
name: value
|
|
27312
27303
|
});
|
|
27313
27304
|
return {
|
|
27314
|
-
wallets:
|
|
27305
|
+
wallets: walletList
|
|
27315
27306
|
};
|
|
27316
27307
|
}
|
|
27317
27308
|
|
|
@@ -27342,7 +27333,6 @@ const $dbe95599a4661140$export$8e0e7ffc78696d30 = async (web3Provider, transacti
|
|
|
27342
27333
|
|
|
27343
27334
|
|
|
27344
27335
|
|
|
27345
|
-
|
|
27346
27336
|
const $570856c68db0bd36$var$GAS_LIMIT = 140000;
|
|
27347
27337
|
const $570856c68db0bd36$var$doesChainSupportEIP1559 = (feeData)=>!!feeData.maxFeePerGas && !!feeData.maxPriorityFeePerGas;
|
|
27348
27338
|
const $570856c68db0bd36$var$getGasPriceInWei = (feeData)=>$570856c68db0bd36$var$doesChainSupportEIP1559(feeData) ? (ethers.BigNumber).from(feeData.maxFeePerGas).add((ethers.BigNumber).from(feeData.maxPriorityFeePerGas)) : feeData.gasPrice && (ethers.BigNumber).from(feeData.gasPrice);
|
|
@@ -27571,13 +27561,13 @@ async function $2e7bf45a7c9a9570$var$swapGasEstimator(config) {
|
|
|
27571
27561
|
try {
|
|
27572
27562
|
const exchange = await $67fc622a2b913d5f$export$7cf6178417769841(chainId, config);
|
|
27573
27563
|
// Create a fake transaction to get the gas from the quote
|
|
27574
|
-
const { swap: swap } = await exchange.getUnsignedSwapTxFromAmountIn($2e7bf45a7c9a9570$var$DUMMY_WALLET_ADDRESS, inAddress, outAddress, (0, ethers
|
|
27564
|
+
const { swap: swap } = await exchange.getUnsignedSwapTxFromAmountIn($2e7bf45a7c9a9570$var$DUMMY_WALLET_ADDRESS, inAddress, outAddress, (0, ethers.BigNumber).from((0, ethers.utils).parseUnits("1", $2e7bf45a7c9a9570$var$DEFAULT_TOKEN_DECIMALS)));
|
|
27575
27565
|
if (swap.gasFeeEstimate === null) return {
|
|
27576
27566
|
gasEstimateType: (0, exports.GasEstimateType).SWAP,
|
|
27577
27567
|
gasFee: {}
|
|
27578
27568
|
};
|
|
27579
27569
|
let estimatedAmount;
|
|
27580
|
-
if (swap.gasFeeEstimate.value) estimatedAmount = (0, ethers
|
|
27570
|
+
if (swap.gasFeeEstimate.value) estimatedAmount = (0, ethers.BigNumber).from(swap.gasFeeEstimate.value);
|
|
27581
27571
|
return {
|
|
27582
27572
|
gasEstimateType: (0, exports.GasEstimateType).SWAP,
|
|
27583
27573
|
gasFee: {
|
|
@@ -27773,7 +27763,7 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
|
|
|
27773
27763
|
function $parcel$export(e, n, v, s) {
|
|
27774
27764
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
27775
27765
|
}
|
|
27776
|
-
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.1.10-alpha.
|
|
27766
|
+
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.1.10-alpha.3";
|
|
27777
27767
|
const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
|
|
27778
27768
|
const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
|
|
27779
27769
|
|
|
@@ -27801,6 +27791,16 @@ function $430e3eda76fa4d5f$export$46b1ae20f762ad4c(version) {
|
|
|
27801
27791
|
return validatedVersion;
|
|
27802
27792
|
}
|
|
27803
27793
|
function $430e3eda76fa4d5f$export$af210a0808087845(config) {
|
|
27794
|
+
if (window === undefined) {
|
|
27795
|
+
// eslint-disable-next-line no-console
|
|
27796
|
+
console.error("missing window object: please run Checkout client side");
|
|
27797
|
+
return;
|
|
27798
|
+
}
|
|
27799
|
+
if (document === undefined) {
|
|
27800
|
+
// eslint-disable-next-line no-console
|
|
27801
|
+
console.error("missing document object: please run Checkout client side");
|
|
27802
|
+
return;
|
|
27803
|
+
}
|
|
27804
27804
|
const checkoutWidgetJS = document.createElement("script");
|
|
27805
27805
|
const validVersion = $430e3eda76fa4d5f$export$46b1ae20f762ad4c(config?.version);
|
|
27806
27806
|
let cdnUrl = `https://cdn.jsdelivr.net/npm/@imtbl/sdk@${validVersion}/dist/browser/checkout.js`;
|
|
@@ -27810,6 +27810,11 @@ function $430e3eda76fa4d5f$export$af210a0808087845(config) {
|
|
|
27810
27810
|
window.ImtblCheckoutWidgetConfig = JSON.stringify(config);
|
|
27811
27811
|
}
|
|
27812
27812
|
function $430e3eda76fa4d5f$export$bf1548ba7e61c17f(config) {
|
|
27813
|
+
if (window === undefined) {
|
|
27814
|
+
// eslint-disable-next-line no-console
|
|
27815
|
+
console.error("missing document object: please run Checkout client side");
|
|
27816
|
+
return;
|
|
27817
|
+
}
|
|
27813
27818
|
window.ImtblCheckoutWidgetConfig = JSON.stringify(config);
|
|
27814
27819
|
}
|
|
27815
27820
|
|
|
@@ -27922,6 +27927,11 @@ function $77ec335383336bdd$export$931068bc678f0d73(tagName, provider) {
|
|
|
27922
27927
|
console.error("no provider parsed");
|
|
27923
27928
|
return;
|
|
27924
27929
|
}
|
|
27930
|
+
if (window === undefined) {
|
|
27931
|
+
// eslint-disable-next-line no-console
|
|
27932
|
+
console.error("missing window object: please run Checkout client side");
|
|
27933
|
+
return;
|
|
27934
|
+
}
|
|
27925
27935
|
let attempts = 0;
|
|
27926
27936
|
const maxAttempts = 10;
|
|
27927
27937
|
let timer;
|
package/dist/index.d.ts
CHANGED
|
@@ -13272,14 +13272,14 @@ interface GetWalletAllowListParams {
|
|
|
13272
13272
|
* Interface representing information about a wallet used in {@link GetWalletAllowListResult}.
|
|
13273
13273
|
* @property {WalletProviderName} walletProvider - The connection provider for the wallet.
|
|
13274
13274
|
* @property {string} name - The name of the wallet.
|
|
13275
|
-
* @property {string} description - A description of the wallet.
|
|
13276
|
-
* @property {string} icon - The URL/data:image of an icon for the wallet.
|
|
13275
|
+
* @property {string | undefined} description - A description of the wallet.
|
|
13276
|
+
* @property {string | undefined} icon - The URL/data:image of an icon for the wallet.
|
|
13277
13277
|
*/
|
|
13278
13278
|
interface WalletInfo {
|
|
13279
13279
|
walletProvider: WalletProviderName;
|
|
13280
13280
|
name: string;
|
|
13281
|
-
description
|
|
13282
|
-
icon
|
|
13281
|
+
description?: string;
|
|
13282
|
+
icon?: string;
|
|
13283
13283
|
}
|
|
13284
13284
|
/**
|
|
13285
13285
|
* Interface representing the result of {@link Checkout.getWalletAllowList}.
|
|
@@ -13292,9 +13292,7 @@ interface GetWalletAllowListResult {
|
|
|
13292
13292
|
* Enum representing the platform filters used in {@link GetWalletAllowListParams}.
|
|
13293
13293
|
*/
|
|
13294
13294
|
declare enum WalletFilterTypes {
|
|
13295
|
-
ALL = "all"
|
|
13296
|
-
DESKTOP = "desktop",
|
|
13297
|
-
MOBILE = "mobile"
|
|
13295
|
+
ALL = "all"
|
|
13298
13296
|
}
|
|
13299
13297
|
/**
|
|
13300
13298
|
* Base URL for the checkout API based on the environment.
|
|
@@ -27876,17 +27874,6 @@ interface GlobalJSXIntrinsicClassAttributes<T> extends JSX.IntrinsicClassAttribu
|
|
|
27876
27874
|
|
|
27877
27875
|
interface GlobalJSXIntrinsicElements extends JSX.IntrinsicElements {}
|
|
27878
27876
|
|
|
27879
|
-
declare namespace JSX$1 {
|
|
27880
|
-
interface Element extends undefined.Element {}
|
|
27881
|
-
interface ElementClass extends undefined.ElementClass {}
|
|
27882
|
-
interface ElementAttributesProperty extends undefined.ElementAttributesProperty {}
|
|
27883
|
-
interface ElementChildrenAttribute extends undefined.ElementChildrenAttribute {}
|
|
27884
|
-
type LibraryManagedAttributes<C, P> = undefined.LibraryManagedAttributes<C, P>;
|
|
27885
|
-
interface IntrinsicAttributes extends undefined.IntrinsicAttributes {}
|
|
27886
|
-
interface IntrinsicClassAttributes<T> extends undefined.IntrinsicClassAttributes<T> {}
|
|
27887
|
-
interface IntrinsicElements extends undefined.IntrinsicElements {}
|
|
27888
|
-
}
|
|
27889
|
-
|
|
27890
27877
|
/**
|
|
27891
27878
|
* Enum representing the themes for the Checkout widgets.
|
|
27892
27879
|
*/
|
|
@@ -28282,7 +28269,7 @@ interface WalletReactProps {
|
|
|
28282
28269
|
* @param {WalletReactProps} props - The props for the Wallet Widget component.
|
|
28283
28270
|
* @returns {JSX.Element} - The rendered Wallet Widget component.
|
|
28284
28271
|
*/
|
|
28285
|
-
declare function WalletReact(props: WalletReactProps): JSX
|
|
28272
|
+
declare function WalletReact(props: WalletReactProps): JSX.Element;
|
|
28286
28273
|
|
|
28287
28274
|
/* Autogenerated file. Do not edit manually. */
|
|
28288
28275
|
/* tslint:disable */
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,6 @@ import { Seaport as Seaport$1 } from '@opensea/seaport-js';
|
|
|
15
15
|
import { parseUnits } from '@ethersproject/units';
|
|
16
16
|
import { BigNumber as BigNumber$2 } from '@ethersproject/bignumber';
|
|
17
17
|
import detectEthereumProvider from '@metamask/detect-provider';
|
|
18
|
-
import { BigNumber as BigNumber$3, utils as utils$3 } from 'ethers/lib/ethers';
|
|
19
18
|
import { Token, TradeType, CurrencyAmount, Percent } from '@uniswap/sdk-core';
|
|
20
19
|
import assert from 'assert';
|
|
21
20
|
import { FeeAmount, Route, SwapQuoter, Pool, Trade } from '@uniswap/v3-sdk';
|
|
@@ -5439,7 +5438,7 @@ class APIError extends Error {
|
|
|
5439
5438
|
|
|
5440
5439
|
/* eslint-disable implicit-arrow-linebreak */
|
|
5441
5440
|
const defaultHeaders = {
|
|
5442
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.1.10-alpha.
|
|
5441
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.1.10-alpha.3',
|
|
5443
5442
|
};
|
|
5444
5443
|
/**
|
|
5445
5444
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -5705,7 +5704,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
5705
5704
|
chainID,
|
|
5706
5705
|
coreContractAddress,
|
|
5707
5706
|
registrationContractAddress,
|
|
5708
|
-
sdkVersion: 'ts-immutable-sdk-0.1.10-alpha.
|
|
5707
|
+
sdkVersion: 'ts-immutable-sdk-0.1.10-alpha.3',
|
|
5709
5708
|
});
|
|
5710
5709
|
/**
|
|
5711
5710
|
* Sets `sdkVersion` at the time of build
|
|
@@ -11829,7 +11828,7 @@ class ImmutableApiClientFactory {
|
|
|
11829
11828
|
|
|
11830
11829
|
// eslint-disable-next-line
|
|
11831
11830
|
dotenv.config();
|
|
11832
|
-
function
|
|
11831
|
+
function getConfigFromEnv() {
|
|
11833
11832
|
if (!process.env.ORDERBOOK_MR_API_URL
|
|
11834
11833
|
|| !process.env.SEAPORT_CONTRACT_ADDRESS
|
|
11835
11834
|
|| !process.env.ZONE_CONTRACT_ADDRESS) {
|
|
@@ -11857,16 +11856,19 @@ const LOCAL_CHAIN_NAME = 'imtbl-zkevm-local';
|
|
|
11857
11856
|
const DEVNET_CHAIN_NAME = 'imtbl-zkevm-devnet';
|
|
11858
11857
|
const TESTNET_CHAIN_NAME = 'imtbl-zkevm-testnet';
|
|
11859
11858
|
const MAINNET_CHAIN_NAME = 'imtbl-zkevm-mainnet';
|
|
11859
|
+
function localChainConfig() {
|
|
11860
|
+
const localConfig = getConfigFromEnv();
|
|
11861
|
+
return {
|
|
11862
|
+
seaportContractAddress: localConfig.seaportContractAddress,
|
|
11863
|
+
zoneContractAddress: localConfig.zoneContractAddress,
|
|
11864
|
+
apiEndpoint: localConfig.apiUrl,
|
|
11865
|
+
provider: getLocalhostProvider(),
|
|
11866
|
+
};
|
|
11867
|
+
}
|
|
11860
11868
|
function getOrderbookConfig(chainName) {
|
|
11861
|
-
const localConfig = getConfig();
|
|
11862
11869
|
switch (chainName) {
|
|
11863
11870
|
case LOCAL_CHAIN_NAME:
|
|
11864
|
-
return
|
|
11865
|
-
seaportContractAddress: localConfig.seaportContractAddress,
|
|
11866
|
-
zoneContractAddress: localConfig.zoneContractAddress,
|
|
11867
|
-
apiEndpoint: localConfig.apiUrl,
|
|
11868
|
-
provider: getLocalhostProvider(),
|
|
11869
|
-
};
|
|
11871
|
+
return localChainConfig();
|
|
11870
11872
|
case DEVNET_CHAIN_NAME:
|
|
11871
11873
|
return {
|
|
11872
11874
|
seaportContractAddress: '0x41388404Efb7a68Fd31d75CEf71dF91e2BDBa2fb',
|
|
@@ -12824,7 +12826,7 @@ class SeaportLibFactory {
|
|
|
12824
12826
|
this.provider = provider;
|
|
12825
12827
|
}
|
|
12826
12828
|
create(orderSeaportVersion, orderSeaportAddress) {
|
|
12827
|
-
const seaportVersion = orderSeaportVersion ?? SEAPORT_CONTRACT_VERSION_V1_4
|
|
12829
|
+
const seaportVersion = orderSeaportVersion ?? SEAPORT_CONTRACT_VERSION_V1_4;
|
|
12828
12830
|
const seaportContractAddress = orderSeaportAddress ?? this.defaultSeaportContractAddress;
|
|
12829
12831
|
return new Seaport$1(this.provider, {
|
|
12830
12832
|
seaportVersion,
|
|
@@ -26619,9 +26621,6 @@ class ExchangeConfiguration {
|
|
|
26619
26621
|
}
|
|
26620
26622
|
}
|
|
26621
26623
|
|
|
26622
|
-
function $parcel$interopDefault(a) {
|
|
26623
|
-
return a && a.__esModule ? a.default : a;
|
|
26624
|
-
}
|
|
26625
26624
|
/* eslint-disable class-methods-use-this */
|
|
26626
26625
|
|
|
26627
26626
|
const $762782b6c862d954$export$db5daa1b5156ccfe = [
|
|
@@ -26761,8 +26760,6 @@ var $4f91c5f280efe242$export$35b06f0d33f57e26;
|
|
|
26761
26760
|
var $4f91c5f280efe242$export$a75605c67ea83a5a;
|
|
26762
26761
|
(function(WalletFilterTypes) {
|
|
26763
26762
|
WalletFilterTypes["ALL"] = "all";
|
|
26764
|
-
WalletFilterTypes["DESKTOP"] = "desktop";
|
|
26765
|
-
WalletFilterTypes["MOBILE"] = "mobile";
|
|
26766
26763
|
})($4f91c5f280efe242$export$a75605c67ea83a5a || ($4f91c5f280efe242$export$a75605c67ea83a5a = {}));
|
|
26767
26764
|
|
|
26768
26765
|
|
|
@@ -27275,23 +27272,17 @@ async function $bb88265fe45a0393$export$9e1fd9cc88c637a0(config, web3Provider, v
|
|
|
27275
27272
|
|
|
27276
27273
|
|
|
27277
27274
|
|
|
27278
|
-
|
|
27279
|
-
|
|
27280
|
-
|
|
27281
|
-
|
|
27282
|
-
|
|
27283
|
-
|
|
27284
|
-
|
|
27285
|
-
|
|
27286
|
-
const allowAllWallets = type === ($4f91c5f280efe242$export$a75605c67ea83a5a).ALL;
|
|
27287
|
-
const walletsAllowedForType = wallet.platform.includes(type);
|
|
27288
|
-
return walletNotExcluded && (allowAllWallets || walletsAllowedForType);
|
|
27289
|
-
}).map((wallet)=>{
|
|
27290
|
-
const { platform: platform, ...walletInfo } = wallet;
|
|
27291
|
-
return walletInfo;
|
|
27275
|
+
async function $5cdde2ffe6360fec$export$a822caa90d7eef09(params) {
|
|
27276
|
+
const walletList = [];
|
|
27277
|
+
const excludedWalletProvider = params.exclude?.map((wp)=>wp.walletProvider) ?? [];
|
|
27278
|
+
let walletProviderNames = Object.values(($e768639828688ca3$export$2d7a51a18d87e21d));
|
|
27279
|
+
if (excludedWalletProvider.length !== 0) walletProviderNames = walletProviderNames.filter((wp)=>!excludedWalletProvider.includes(wp));
|
|
27280
|
+
for (const value of walletProviderNames)walletList.push({
|
|
27281
|
+
walletProvider: value,
|
|
27282
|
+
name: value
|
|
27292
27283
|
});
|
|
27293
27284
|
return {
|
|
27294
|
-
wallets:
|
|
27285
|
+
wallets: walletList
|
|
27295
27286
|
};
|
|
27296
27287
|
}
|
|
27297
27288
|
|
|
@@ -27322,7 +27313,6 @@ const $dbe95599a4661140$export$8e0e7ffc78696d30 = async (web3Provider, transacti
|
|
|
27322
27313
|
|
|
27323
27314
|
|
|
27324
27315
|
|
|
27325
|
-
|
|
27326
27316
|
const $570856c68db0bd36$var$GAS_LIMIT = 140000;
|
|
27327
27317
|
const $570856c68db0bd36$var$doesChainSupportEIP1559 = (feeData)=>!!feeData.maxFeePerGas && !!feeData.maxPriorityFeePerGas;
|
|
27328
27318
|
const $570856c68db0bd36$var$getGasPriceInWei = (feeData)=>$570856c68db0bd36$var$doesChainSupportEIP1559(feeData) ? (BigNumber$1).from(feeData.maxFeePerGas).add((BigNumber$1).from(feeData.maxPriorityFeePerGas)) : feeData.gasPrice && (BigNumber$1).from(feeData.gasPrice);
|
|
@@ -27551,13 +27541,13 @@ async function $2e7bf45a7c9a9570$var$swapGasEstimator(config) {
|
|
|
27551
27541
|
try {
|
|
27552
27542
|
const exchange = await $67fc622a2b913d5f$export$7cf6178417769841(chainId, config);
|
|
27553
27543
|
// Create a fake transaction to get the gas from the quote
|
|
27554
|
-
const { swap: swap } = await exchange.getUnsignedSwapTxFromAmountIn($2e7bf45a7c9a9570$var$DUMMY_WALLET_ADDRESS, inAddress, outAddress, (0, BigNumber$
|
|
27544
|
+
const { swap: swap } = await exchange.getUnsignedSwapTxFromAmountIn($2e7bf45a7c9a9570$var$DUMMY_WALLET_ADDRESS, inAddress, outAddress, (0, BigNumber$1).from((0, utils$2).parseUnits("1", $2e7bf45a7c9a9570$var$DEFAULT_TOKEN_DECIMALS)));
|
|
27555
27545
|
if (swap.gasFeeEstimate === null) return {
|
|
27556
27546
|
gasEstimateType: (0, $de275b98d2b651c3$export$788b1fd17f3dad84).SWAP,
|
|
27557
27547
|
gasFee: {}
|
|
27558
27548
|
};
|
|
27559
27549
|
let estimatedAmount;
|
|
27560
|
-
if (swap.gasFeeEstimate.value) estimatedAmount = (0, BigNumber$
|
|
27550
|
+
if (swap.gasFeeEstimate.value) estimatedAmount = (0, BigNumber$1).from(swap.gasFeeEstimate.value);
|
|
27561
27551
|
return {
|
|
27562
27552
|
gasEstimateType: (0, $de275b98d2b651c3$export$788b1fd17f3dad84).SWAP,
|
|
27563
27553
|
gasFee: {
|
|
@@ -27753,7 +27743,7 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
|
|
|
27753
27743
|
function $parcel$export(e, n, v, s) {
|
|
27754
27744
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
27755
27745
|
}
|
|
27756
|
-
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.1.10-alpha.
|
|
27746
|
+
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.1.10-alpha.3";
|
|
27757
27747
|
const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
|
|
27758
27748
|
const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
|
|
27759
27749
|
|
|
@@ -27781,6 +27771,16 @@ function $430e3eda76fa4d5f$export$46b1ae20f762ad4c(version) {
|
|
|
27781
27771
|
return validatedVersion;
|
|
27782
27772
|
}
|
|
27783
27773
|
function $430e3eda76fa4d5f$export$af210a0808087845(config) {
|
|
27774
|
+
if (window === undefined) {
|
|
27775
|
+
// eslint-disable-next-line no-console
|
|
27776
|
+
console.error("missing window object: please run Checkout client side");
|
|
27777
|
+
return;
|
|
27778
|
+
}
|
|
27779
|
+
if (document === undefined) {
|
|
27780
|
+
// eslint-disable-next-line no-console
|
|
27781
|
+
console.error("missing document object: please run Checkout client side");
|
|
27782
|
+
return;
|
|
27783
|
+
}
|
|
27784
27784
|
const checkoutWidgetJS = document.createElement("script");
|
|
27785
27785
|
const validVersion = $430e3eda76fa4d5f$export$46b1ae20f762ad4c(config?.version);
|
|
27786
27786
|
let cdnUrl = `https://cdn.jsdelivr.net/npm/@imtbl/sdk@${validVersion}/dist/browser/checkout.js`;
|
|
@@ -27790,6 +27790,11 @@ function $430e3eda76fa4d5f$export$af210a0808087845(config) {
|
|
|
27790
27790
|
window.ImtblCheckoutWidgetConfig = JSON.stringify(config);
|
|
27791
27791
|
}
|
|
27792
27792
|
function $430e3eda76fa4d5f$export$bf1548ba7e61c17f(config) {
|
|
27793
|
+
if (window === undefined) {
|
|
27794
|
+
// eslint-disable-next-line no-console
|
|
27795
|
+
console.error("missing document object: please run Checkout client side");
|
|
27796
|
+
return;
|
|
27797
|
+
}
|
|
27793
27798
|
window.ImtblCheckoutWidgetConfig = JSON.stringify(config);
|
|
27794
27799
|
}
|
|
27795
27800
|
|
|
@@ -27902,6 +27907,11 @@ function $77ec335383336bdd$export$931068bc678f0d73(tagName, provider) {
|
|
|
27902
27907
|
console.error("no provider parsed");
|
|
27903
27908
|
return;
|
|
27904
27909
|
}
|
|
27910
|
+
if (window === undefined) {
|
|
27911
|
+
// eslint-disable-next-line no-console
|
|
27912
|
+
console.error("missing window object: please run Checkout client side");
|
|
27913
|
+
return;
|
|
27914
|
+
}
|
|
27905
27915
|
let attempts = 0;
|
|
27906
27916
|
const maxAttempts = 10;
|
|
27907
27917
|
let timer;
|
package/dist/orderbook.js
CHANGED
|
@@ -901,7 +901,7 @@ class ImmutableApiClientFactory {
|
|
|
901
901
|
|
|
902
902
|
// eslint-disable-next-line
|
|
903
903
|
dotenv.config();
|
|
904
|
-
function
|
|
904
|
+
function getConfigFromEnv() {
|
|
905
905
|
if (!process.env.ORDERBOOK_MR_API_URL
|
|
906
906
|
|| !process.env.SEAPORT_CONTRACT_ADDRESS
|
|
907
907
|
|| !process.env.ZONE_CONTRACT_ADDRESS) {
|
|
@@ -929,16 +929,19 @@ const LOCAL_CHAIN_NAME = 'imtbl-zkevm-local';
|
|
|
929
929
|
const DEVNET_CHAIN_NAME = 'imtbl-zkevm-devnet';
|
|
930
930
|
const TESTNET_CHAIN_NAME = 'imtbl-zkevm-testnet';
|
|
931
931
|
const MAINNET_CHAIN_NAME = 'imtbl-zkevm-mainnet';
|
|
932
|
+
function localChainConfig() {
|
|
933
|
+
const localConfig = getConfigFromEnv();
|
|
934
|
+
return {
|
|
935
|
+
seaportContractAddress: localConfig.seaportContractAddress,
|
|
936
|
+
zoneContractAddress: localConfig.zoneContractAddress,
|
|
937
|
+
apiEndpoint: localConfig.apiUrl,
|
|
938
|
+
provider: getLocalhostProvider(),
|
|
939
|
+
};
|
|
940
|
+
}
|
|
932
941
|
function getOrderbookConfig(chainName) {
|
|
933
|
-
const localConfig = getConfig();
|
|
934
942
|
switch (chainName) {
|
|
935
943
|
case LOCAL_CHAIN_NAME:
|
|
936
|
-
return
|
|
937
|
-
seaportContractAddress: localConfig.seaportContractAddress,
|
|
938
|
-
zoneContractAddress: localConfig.zoneContractAddress,
|
|
939
|
-
apiEndpoint: localConfig.apiUrl,
|
|
940
|
-
provider: getLocalhostProvider(),
|
|
941
|
-
};
|
|
944
|
+
return localChainConfig();
|
|
942
945
|
case DEVNET_CHAIN_NAME:
|
|
943
946
|
return {
|
|
944
947
|
seaportContractAddress: '0x41388404Efb7a68Fd31d75CEf71dF91e2BDBa2fb',
|
|
@@ -1896,7 +1899,7 @@ class SeaportLibFactory {
|
|
|
1896
1899
|
this.provider = provider;
|
|
1897
1900
|
}
|
|
1898
1901
|
create(orderSeaportVersion, orderSeaportAddress) {
|
|
1899
|
-
const seaportVersion = orderSeaportVersion ?? SEAPORT_CONTRACT_VERSION_V1_4
|
|
1902
|
+
const seaportVersion = orderSeaportVersion ?? SEAPORT_CONTRACT_VERSION_V1_4;
|
|
1900
1903
|
const seaportContractAddress = orderSeaportAddress ?? this.defaultSeaportContractAddress;
|
|
1901
1904
|
return new Seaport$1(this.provider, {
|
|
1902
1905
|
seaportVersion,
|
package/dist/passport.js
CHANGED
|
@@ -21,7 +21,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
21
21
|
chainID,
|
|
22
22
|
coreContractAddress,
|
|
23
23
|
registrationContractAddress,
|
|
24
|
-
sdkVersion: 'ts-immutable-sdk-0.1.10-alpha.
|
|
24
|
+
sdkVersion: 'ts-immutable-sdk-0.1.10-alpha.3',
|
|
25
25
|
});
|
|
26
26
|
/**
|
|
27
27
|
* Sets `sdkVersion` at the time of build
|
package/package.json
CHANGED