@imtbl/sdk 1.76.0 → 1.76.1
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-BBXNY5bu.js → blockchain_data-Cbpk_9xM.js} +2 -2
- package/dist/blockchain_data.js +3 -3
- package/dist/browser/checkout/{AddTokensWidget-Ov8QlKCk.js → AddTokensWidget-B0aMPpaf.js} +352 -351
- package/dist/browser/checkout/{BridgeWidget-FBnDhhqK.js → BridgeWidget-B2xMuXIe.js} +9 -9
- package/dist/browser/checkout/{CommerceWidget-BWSOXt1Z.js → CommerceWidget-mvSR60zJ.js} +17 -17
- package/dist/browser/checkout/{CryptoFiatProvider-CI8GAJs8.js → CryptoFiatProvider-DuUL-g05.js} +1 -1
- package/dist/browser/checkout/{FeesBreakdown-CYOq1UYb.js → FeesBreakdown-ux_kv2hV.js} +1 -1
- package/dist/browser/checkout/{HandoverContent-BGe-FSBI.js → HandoverContent-CjAdkJyP.js} +1 -1
- package/dist/browser/checkout/{OnRampWidget-yWeBoNXM.js → OnRampWidget-CPBxu5mW.js} +3 -3
- package/dist/browser/checkout/{SaleWidget-u7Vt_hEK.js → SaleWidget-C_z2mvby.js} +14 -14
- package/dist/browser/checkout/{SpendingCapHero-BKUOW3vH.js → SpendingCapHero-DZ2h3c0I.js} +1 -1
- package/dist/browser/checkout/{SwapWidget-B7y0JomC.js → SwapWidget-C46tSXSg.js} +9 -9
- package/dist/browser/checkout/{TokenImage-1PBGOvLH.js → TokenImage-DVwKafFC.js} +1 -1
- package/dist/browser/checkout/{TopUpView-DHdxY5JT.js → TopUpView-Domn-Qcd.js} +3 -3
- package/dist/browser/checkout/{WalletApproveHero-35dcfo4w.js → WalletApproveHero-BuDyraLc.js} +3 -3
- package/dist/browser/checkout/{WalletWidget-Y9iR990Q.js → WalletWidget-CBUNHu8H.js} +4 -4
- package/dist/browser/checkout/{auto-track-Cg6kkwOx.js → auto-track-B4CZrwEV.js} +1 -1
- package/dist/browser/checkout/{index-Cga-0Avd.js → index-7xV-Pj_F.js} +1 -1
- package/dist/browser/checkout/{index-DpyMYzyv.js → index-Bphp6vfp.js} +2 -2
- package/dist/browser/checkout/{index-CNE2GoPm.js → index-C4rT0Sv6.js} +19 -19
- package/dist/browser/checkout/{index-DBGBKN_L.js → index-C9QxRl74.js} +1 -1
- package/dist/browser/checkout/{index-Czt3GvNk.js → index-CN_1RCxb.js} +1 -1
- package/dist/browser/checkout/{index-BT973-4Q.js → index-CRlimiZc.js} +1 -1
- package/dist/browser/checkout/{index-jI6ZFdoK.js → index-D_SSOEje.js} +1 -1
- package/dist/browser/checkout/{index-D7I7TIGd.js → index-Jl4iGdbj.js} +1 -1
- package/dist/browser/checkout/{index-C-kBUpgB.js → index-W518Tkp4.js} +1 -1
- package/dist/browser/checkout/{index-Cy_x51ga.js → index-u3PvSxx0.js} +1 -1
- package/dist/browser/checkout/{index.umd-DFEUUd9m.js → index.umd-C3XaSuZ6.js} +1 -1
- package/dist/browser/checkout/sdk.js +4 -4
- package/dist/browser/checkout/{useInterval-C_sHli0I.js → useInterval-Daykm58W.js} +1 -1
- package/dist/browser/checkout/widgets-esm.js +1 -1
- package/dist/browser/checkout/widgets.js +346 -345
- package/dist/{checkout-BVe_DYsB.js → checkout-BBw3jFMf.js} +34 -32
- package/dist/checkout.js +5 -5
- package/dist/{config-Bw1VvH0V.js → config-Cmi9x3Q6.js} +1 -1
- package/dist/config.js +1 -1
- package/dist/{index-CXburu7G.js → index-Bw2yzYg3.js} +1 -1
- package/dist/{index-CwlDox7X.js → index-C85kemJl.js} +1 -1
- package/dist/{index-Cd5Vu7wl.js → index-DFL3nZz6.js} +1 -1
- package/dist/{index-CALqWbUf.js → index-DGxS9oho.js} +4 -4
- package/dist/{index-B2vxU1RS.js → index-DZGolhBr.js} +1 -1
- package/dist/{index-Djlp0kzp.js → index-u5tNvD21.js} +3 -3
- package/dist/index.browser.js +4 -4
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +36 -34
- package/dist/index.js +14 -14
- package/dist/last_updated.json +1 -0
- package/dist/{minting_backend-DkDu72pB.js → minting_backend-B3sWDYVL.js} +3 -3
- package/dist/minting_backend.js +5 -5
- package/dist/{orderbook-BrLZ1jCD.js → orderbook-B0GH6rPV.js} +1 -1
- package/dist/orderbook.js +2 -2
- package/dist/{passport-B3y6qXgF.js → passport-Sc9Ko92d.js} +3 -3
- package/dist/passport.js +4 -4
- package/dist/{webhook-BhYpOSI6.js → webhook-CZoH-2Ow.js} +1 -1
- package/dist/webhook.js +2 -2
- package/dist/{x-CF0pLl5u.js → x-CBHSFDCr.js} +3 -3
- package/dist/x.js +4 -4
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as Environment$1, t as track, I as ImmutableConfiguration } from './index-
|
|
1
|
+
import { E as Environment$1, t as track, I as ImmutableConfiguration } from './index-DZGolhBr.js';
|
|
2
2
|
import globalAxios, { HttpStatusCode as HttpStatusCode$1 } from 'axios';
|
|
3
3
|
import { ethers, BigNumber as BigNumber$1, ContractFactory, utils as utils$2, Contract as Contract$1 } from 'ethers';
|
|
4
4
|
import { Web3Provider, JsonRpcProvider } from '@ethersproject/providers';
|
|
@@ -8,8 +8,8 @@ import assert from 'assert';
|
|
|
8
8
|
import { FeeAmount, Route, SwapQuoter, Pool, Trade, toHex as toHex$1, encodeRouteToPath } from '@uniswap/v3-sdk';
|
|
9
9
|
import { keccak256 as keccak256$1 } from '@ethersproject/solidity';
|
|
10
10
|
import { SwapRouter, PaymentsExtended } from '@uniswap/router-sdk';
|
|
11
|
-
import { c as constants, O as OrderStatusName, a as Orderbook, A as ActionType, T as TransactionPurpose, S as SignablePurpose } from './index-
|
|
12
|
-
import { B as BlockchainData } from './index-
|
|
11
|
+
import { c as constants, O as OrderStatusName, a as Orderbook, A as ActionType, T as TransactionPurpose, S as SignablePurpose } from './index-DFL3nZz6.js';
|
|
12
|
+
import { B as BlockchainData } from './index-u5tNvD21.js';
|
|
13
13
|
import detectEthereumProvider from '@metamask/detect-provider';
|
|
14
14
|
import semver from 'semver';
|
|
15
15
|
|
|
@@ -19207,7 +19207,7 @@ const flattenProperties = (properties) => {
|
|
|
19207
19207
|
};
|
|
19208
19208
|
|
|
19209
19209
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
19210
|
-
const SDK_VERSION = '1.76.
|
|
19210
|
+
const SDK_VERSION = '1.76.1';
|
|
19211
19211
|
const getFrameParentDomain = () => {
|
|
19212
19212
|
if (isNode()) {
|
|
19213
19213
|
return '';
|
|
@@ -24327,7 +24327,7 @@ const IMMUTABLE_ZKVEM_GAS_OVERRIDES = {
|
|
|
24327
24327
|
maxPriorityFeePerGas: BigNumber$1.from(10e9),
|
|
24328
24328
|
};
|
|
24329
24329
|
|
|
24330
|
-
const SDK_VERSION_MARKER = '1.76.
|
|
24330
|
+
const SDK_VERSION_MARKER = '1.76.1';
|
|
24331
24331
|
// This SDK version is replaced by the `yarn build` command ran on the root level
|
|
24332
24332
|
const globalPackageVersion = () => SDK_VERSION_MARKER;
|
|
24333
24333
|
|
|
@@ -28961,30 +28961,6 @@ async function getLatestVersionFromNpm() {
|
|
|
28961
28961
|
return fallbackVersion;
|
|
28962
28962
|
}
|
|
28963
28963
|
}
|
|
28964
|
-
/**
|
|
28965
|
-
* Checks if the provided version is available on the CDN.
|
|
28966
|
-
* @param {string} version - The version to check.
|
|
28967
|
-
* @returns {Promise<boolean>} A promise resolving to a boolean indicating if the version is available on the CDN.
|
|
28968
|
-
*/
|
|
28969
|
-
async function isVersionAvailableOnCDN(version) {
|
|
28970
|
-
const files = ['widgets-esm.js', 'widgets.js'];
|
|
28971
|
-
const baseUrl = `https://cdn.jsdelivr.net/npm/@imtbl/sdk@${version}/dist/browser/checkout/`;
|
|
28972
|
-
try {
|
|
28973
|
-
const checks = files.map(async (file) => {
|
|
28974
|
-
const response = await fetch(`${baseUrl}${file}`, { method: 'HEAD' });
|
|
28975
|
-
if (!response.ok) {
|
|
28976
|
-
return false;
|
|
28977
|
-
}
|
|
28978
|
-
return true;
|
|
28979
|
-
});
|
|
28980
|
-
const results = await Promise.all(checks);
|
|
28981
|
-
const allFilesAvailable = results.every((isAvailable) => isAvailable);
|
|
28982
|
-
return allFilesAvailable;
|
|
28983
|
-
}
|
|
28984
|
-
catch {
|
|
28985
|
-
return false;
|
|
28986
|
-
}
|
|
28987
|
-
}
|
|
28988
28964
|
/**
|
|
28989
28965
|
* Returns the latest compatible version based on the provided checkout version config.
|
|
28990
28966
|
* If no compatible version markers are provided, it returns 'latest'.
|
|
@@ -28997,6 +28973,33 @@ function latestCompatibleVersion(validVersion, compatibleVersionMarkers) {
|
|
|
28997
28973
|
}
|
|
28998
28974
|
return 'latest';
|
|
28999
28975
|
}
|
|
28976
|
+
/**
|
|
28977
|
+
* Checks if the last_updated.json file exists on the CDN and validates its timestamp.
|
|
28978
|
+
* @param {string} version - The version to check.
|
|
28979
|
+
* @returns {Promise<boolean>} A promise resolving to `true` if last_updated.json exists and is older than 15 minutes, `false` otherwise.
|
|
28980
|
+
*/
|
|
28981
|
+
async function checkLastUpdatedTimestamp(version) {
|
|
28982
|
+
const WAIT_TIME_IN_MINUTES = 20;
|
|
28983
|
+
const lastUpdatedJsonUrl = `https://cdn.jsdelivr.net/npm/@imtbl/sdk@${version}/dist/last_updated.json`;
|
|
28984
|
+
try {
|
|
28985
|
+
const response = await fetch(lastUpdatedJsonUrl);
|
|
28986
|
+
if (!response.ok) {
|
|
28987
|
+
return false;
|
|
28988
|
+
}
|
|
28989
|
+
const lastUpdatedData = await response.json();
|
|
28990
|
+
if (lastUpdatedData.timestamp) {
|
|
28991
|
+
const timestamp = new Date(lastUpdatedData.timestamp);
|
|
28992
|
+
const now = new Date();
|
|
28993
|
+
const diffInMs = now.getTime() - timestamp.getTime();
|
|
28994
|
+
const diffInMinutes = diffInMs / (1000 * 60);
|
|
28995
|
+
return diffInMinutes > WAIT_TIME_IN_MINUTES;
|
|
28996
|
+
}
|
|
28997
|
+
}
|
|
28998
|
+
catch (error) {
|
|
28999
|
+
return false;
|
|
29000
|
+
}
|
|
29001
|
+
return false;
|
|
29002
|
+
}
|
|
29000
29003
|
/**
|
|
29001
29004
|
* Determines the version of the widgets to use based on the provided validated build version and checkout version config.
|
|
29002
29005
|
* If a version is provided in the widget init parameters, it uses that version.
|
|
@@ -29017,11 +29020,10 @@ async function determineWidgetsVersion(validatedBuildVersion, initVersionProvide
|
|
|
29017
29020
|
return validatedBuildVersion;
|
|
29018
29021
|
}
|
|
29019
29022
|
const compatibleVersion = latestCompatibleVersion(validatedBuildVersion, versionConfig.compatibleVersionMarkers);
|
|
29020
|
-
// If `latest` is returned, query NPM registry for the actual latest version and check
|
|
29023
|
+
// If `latest` is returned, query NPM registry for the actual latest version and check timestamp
|
|
29021
29024
|
if (compatibleVersion === 'latest') {
|
|
29022
29025
|
const latestVersion = await getLatestVersionFromNpm();
|
|
29023
|
-
|
|
29024
|
-
if (isAvailable) {
|
|
29026
|
+
if (await checkLastUpdatedTimestamp(latestVersion)) {
|
|
29025
29027
|
return latestVersion;
|
|
29026
29028
|
}
|
|
29027
29029
|
return 'latest';
|
package/dist/checkout.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A as AddTokensEventType, B as BlockExplorerService, a as BridgeEventType, C as ChainId, b as ChainName, d as ChainSlug, e as Checkout, f as CheckoutConfiguration, g as CheckoutError, h as CheckoutErrorType, i as CheckoutStatus, j as CommerceEventType, k as CommerceFailureEventType, l as CommerceFlowType, m as CommerceSuccessEventType, n as CommerceUserActionEventType, o as ConnectEventType, p as ConnectTargetLayer, E as ExchangeType, F as FeeType, q as FundingStepType, G as GasEstimateType, r as GasTokenType, I as IMMUTABLE_API_BASE_URL, s as IMTBLWidgetEvents, t as ItemType, N as NetworkFilterTypes, O as OnRampEventType, u as OrchestrationEventType, P as ProviderEventType, v as PurchaseEventType, R as RoutingOutcomeType, S as SaleEventType, w as SalePaymentTypes, x as SwapDirection, y as SwapEventType, T as TokenFilterTypes, z as TransactionOrGasType, W as WalletEventType, D as WalletFilterTypes, H as WalletProviderName, J as WalletProviderRdns, K as WidgetTheme, L as WidgetType, M as fetchRiskAssessment, Q as getMetaMaskProviderDetail, U as getPassportProviderDetail, V as isAddressSanctioned, X as validateProvider } from './checkout-
|
|
2
|
-
import './index-
|
|
1
|
+
export { A as AddTokensEventType, B as BlockExplorerService, a as BridgeEventType, C as ChainId, b as ChainName, d as ChainSlug, e as Checkout, f as CheckoutConfiguration, g as CheckoutError, h as CheckoutErrorType, i as CheckoutStatus, j as CommerceEventType, k as CommerceFailureEventType, l as CommerceFlowType, m as CommerceSuccessEventType, n as CommerceUserActionEventType, o as ConnectEventType, p as ConnectTargetLayer, E as ExchangeType, F as FeeType, q as FundingStepType, G as GasEstimateType, r as GasTokenType, I as IMMUTABLE_API_BASE_URL, s as IMTBLWidgetEvents, t as ItemType, N as NetworkFilterTypes, O as OnRampEventType, u as OrchestrationEventType, P as ProviderEventType, v as PurchaseEventType, R as RoutingOutcomeType, S as SaleEventType, w as SalePaymentTypes, x as SwapDirection, y as SwapEventType, T as TokenFilterTypes, z as TransactionOrGasType, W as WalletEventType, D as WalletFilterTypes, H as WalletProviderName, J as WalletProviderRdns, K as WidgetTheme, L as WidgetType, M as fetchRiskAssessment, Q as getMetaMaskProviderDetail, U as getPassportProviderDetail, V as isAddressSanctioned, X as validateProvider } from './checkout-BBw3jFMf.js';
|
|
2
|
+
import './index-DZGolhBr.js';
|
|
3
3
|
import 'axios';
|
|
4
4
|
import 'lru-memorise';
|
|
5
5
|
import 'global-const';
|
|
@@ -10,13 +10,13 @@ import 'assert';
|
|
|
10
10
|
import '@uniswap/v3-sdk';
|
|
11
11
|
import '@ethersproject/solidity';
|
|
12
12
|
import '@uniswap/router-sdk';
|
|
13
|
-
import './index-
|
|
13
|
+
import './index-DFL3nZz6.js';
|
|
14
14
|
import 'form-data';
|
|
15
15
|
import '@opensea/seaport-js/lib/constants';
|
|
16
16
|
import 'ethers-v6';
|
|
17
17
|
import 'merkletreejs';
|
|
18
18
|
import '@opensea/seaport-js';
|
|
19
|
-
import './index-
|
|
20
|
-
import './index-
|
|
19
|
+
import './index-u5tNvD21.js';
|
|
20
|
+
import './index-Bw2yzYg3.js';
|
|
21
21
|
import '@metamask/detect-provider';
|
|
22
22
|
import 'semver';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as Environment, I as ImmutableConfiguration, K as KeyHeaders, a as addKeysToHeadersOverride } from './index-
|
|
1
|
+
import { E as Environment, I as ImmutableConfiguration, K as KeyHeaders, a as addKeysToHeadersOverride } from './index-DZGolhBr.js';
|
|
2
2
|
|
|
3
3
|
var config = /*#__PURE__*/Object.freeze({
|
|
4
4
|
__proto__: null,
|
package/dist/config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { E as Environment, I as ImmutableConfiguration, K as KeyHeaders, a as addKeysToHeadersOverride } from './index-
|
|
1
|
+
export { E as Environment, I as ImmutableConfiguration, K as KeyHeaders, a as addKeysToHeadersOverride } from './index-DZGolhBr.js';
|
|
2
2
|
import 'axios';
|
|
3
3
|
import 'lru-memorise';
|
|
4
4
|
import 'global-const';
|
|
@@ -14336,7 +14336,7 @@ class MultiRollupApiClients {
|
|
|
14336
14336
|
}
|
|
14337
14337
|
|
|
14338
14338
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
14339
|
-
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.76.
|
|
14339
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.76.1' };
|
|
14340
14340
|
const createConfig = ({ basePath, headers, }) => {
|
|
14341
14341
|
if (!basePath.trim()) {
|
|
14342
14342
|
throw Error('basePath can not be empty');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as track, E as Environment } from './index-
|
|
1
|
+
import { t as track, E as Environment } from './index-DZGolhBr.js';
|
|
2
2
|
import globalAxios from 'axios';
|
|
3
3
|
import FormData from 'form-data';
|
|
4
4
|
import { OrderType as OrderType$1, ItemType as ItemType$1 } from '@opensea/seaport-js/lib/constants';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as index$2, I as ImxApiClients } from './index-
|
|
2
|
-
import { a as addKeysToHeadersOverride, E as Environment, I as ImmutableConfiguration } from './index-
|
|
1
|
+
import { d as index$2, I as ImxApiClients } from './index-Bw2yzYg3.js';
|
|
2
|
+
import { a as addKeysToHeadersOverride, E as Environment, I as ImmutableConfiguration } from './index-DZGolhBr.js';
|
|
3
3
|
import globalAxios from 'axios';
|
|
4
4
|
import { keccak256 } from '@ethersproject/keccak256';
|
|
5
5
|
import { toUtf8Bytes } from '@ethersproject/strings';
|
|
@@ -16,7 +16,7 @@ import '@ethersproject/abstract-signer';
|
|
|
16
16
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
17
17
|
class ApiConfiguration extends index$2.Configuration {
|
|
18
18
|
}
|
|
19
|
-
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.76.
|
|
19
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.76.1' };
|
|
20
20
|
/**
|
|
21
21
|
* @dev use createImmutableXConfiguration instead
|
|
22
22
|
*/
|
|
@@ -57,7 +57,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
57
57
|
coreContractAddress,
|
|
58
58
|
registrationContractAddress,
|
|
59
59
|
registrationV4ContractAddress,
|
|
60
|
-
sdkVersion: 'ts-immutable-sdk-1.76.
|
|
60
|
+
sdkVersion: 'ts-immutable-sdk-1.76.1',
|
|
61
61
|
baseConfig,
|
|
62
62
|
});
|
|
63
63
|
const production = ({ baseConfig }) => createImmutableXConfiguration({
|
|
@@ -158,7 +158,7 @@ const flattenProperties = (properties) => {
|
|
|
158
158
|
};
|
|
159
159
|
|
|
160
160
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
161
|
-
const SDK_VERSION = '1.76.
|
|
161
|
+
const SDK_VERSION = '1.76.1';
|
|
162
162
|
const getFrameParentDomain = () => {
|
|
163
163
|
if (isNode()) {
|
|
164
164
|
return '';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as index$1 } from './index-
|
|
2
|
-
import { E as Environment, a as addKeysToHeadersOverride } from './index-
|
|
1
|
+
import { a as index$1 } from './index-Bw2yzYg3.js';
|
|
2
|
+
import { E as Environment, a as addKeysToHeadersOverride } from './index-DZGolhBr.js';
|
|
3
3
|
import globalAxios from 'axios';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -21,7 +21,7 @@ class APIError extends Error {
|
|
|
21
21
|
|
|
22
22
|
/* eslint-disable implicit-arrow-linebreak */
|
|
23
23
|
const defaultHeaders = {
|
|
24
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.76.
|
|
24
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.76.1',
|
|
25
25
|
};
|
|
26
26
|
/**
|
|
27
27
|
* createAPIConfiguration to create a custom Configuration
|