@imtbl/sdk 0.27.5 → 0.27.6
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 +3 -3
- package/dist/checkout_sdk.js +41 -31
- package/dist/checkout_widgets.d.ts +5 -1
- 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 +44 -34
- package/dist/index.d.ts +8 -4
- package/dist/index.js +44 -34
- package/dist/passport.js +2 -2
- package/package.json +1 -1
package/dist/checkout_sdk.d.ts
CHANGED
|
@@ -12108,6 +12108,9 @@ declare class CheckoutConfiguration {
|
|
|
12108
12108
|
readonly networkMap: NetworkMap;
|
|
12109
12109
|
constructor(config: CheckoutModuleConfiguration);
|
|
12110
12110
|
}
|
|
12111
|
+
type AvailabilityService = {
|
|
12112
|
+
checkDexAvailability: () => Promise<boolean>;
|
|
12113
|
+
};
|
|
12111
12114
|
interface FiatRampWidgetParams {
|
|
12112
12115
|
exchangeType: ExchangeType;
|
|
12113
12116
|
isPassport: boolean;
|
|
@@ -12126,9 +12129,6 @@ declare class FiatRampService {
|
|
|
12126
12129
|
feeEstimate(): Promise<OnRampProviderFees>;
|
|
12127
12130
|
createWidgetUrl(params: FiatRampWidgetParams): Promise<string>;
|
|
12128
12131
|
}
|
|
12129
|
-
type AvailabilityService = {
|
|
12130
|
-
checkDexAvailability: () => Promise<boolean>;
|
|
12131
|
-
};
|
|
12132
12132
|
declare class Checkout {
|
|
12133
12133
|
readonly config: CheckoutConfiguration;
|
|
12134
12134
|
readonly fiatRampService: FiatRampService;
|
package/dist/checkout_sdk.js
CHANGED
|
@@ -20409,7 +20409,7 @@ class APIError extends Error {
|
|
|
20409
20409
|
|
|
20410
20410
|
/* eslint-disable implicit-arrow-linebreak */
|
|
20411
20411
|
const defaultHeaders = {
|
|
20412
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.27.
|
|
20412
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.27.6',
|
|
20413
20413
|
};
|
|
20414
20414
|
/**
|
|
20415
20415
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -22924,8 +22924,46 @@ const $7d1bfafb81e64d74$export$3a4140bd9e983e4e = async (provider, insufficientI
|
|
|
22924
22924
|
|
|
22925
22925
|
|
|
22926
22926
|
|
|
22927
|
+
|
|
22928
|
+
|
|
22929
|
+
|
|
22930
|
+
|
|
22931
|
+
const $5e9bcae98dc8ff19$export$1165ca270f090a66 = (isDevelopment, isProduction)=>{
|
|
22932
|
+
const postEndpoint = ()=>{
|
|
22933
|
+
if (isDevelopment) return ($d85ad1457a3f1a83$export$89133ca13c5ee30)[$d85ad1457a3f1a83$export$7d3a9eeba384fa59];
|
|
22934
|
+
if (isProduction) return ($d85ad1457a3f1a83$export$89133ca13c5ee30)[(Environment$1).PRODUCTION];
|
|
22935
|
+
return ($d85ad1457a3f1a83$export$89133ca13c5ee30)[(Environment$1).SANDBOX];
|
|
22936
|
+
};
|
|
22937
|
+
const checkDexAvailability = async ()=>{
|
|
22938
|
+
// TEMP FIX: Returns true for sandbox environment
|
|
22939
|
+
if (!isDevelopment && !isProduction) return true;
|
|
22940
|
+
let response;
|
|
22941
|
+
try {
|
|
22942
|
+
response = await (0, globalAxios).post(`${postEndpoint()}/v1/availability/checkout/swap`);
|
|
22943
|
+
} catch (error) {
|
|
22944
|
+
response = error.response;
|
|
22945
|
+
}
|
|
22946
|
+
if (response.status === 403) return false;
|
|
22947
|
+
if (response.status === 204) return true;
|
|
22948
|
+
throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Error fetching from api: ${response.status} ${response.statusText}`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).API_ERROR);
|
|
22949
|
+
};
|
|
22950
|
+
return {
|
|
22951
|
+
checkDexAvailability: checkDexAvailability
|
|
22952
|
+
};
|
|
22953
|
+
};
|
|
22954
|
+
|
|
22955
|
+
|
|
22956
|
+
|
|
22957
|
+
|
|
22927
22958
|
const $1fda5c40669a566d$export$1fac8e857d728583 = async ()=>false;
|
|
22928
|
-
const $1fda5c40669a566d$export$2e83e9eeaf217e20 = async ()=>
|
|
22959
|
+
const $1fda5c40669a566d$export$2e83e9eeaf217e20 = async (config)=>{
|
|
22960
|
+
const availability = ($5e9bcae98dc8ff19$export$1165ca270f090a66)(config.isDevelopment, config.isProduction);
|
|
22961
|
+
try {
|
|
22962
|
+
return await availability.checkDexAvailability();
|
|
22963
|
+
} catch {
|
|
22964
|
+
return false;
|
|
22965
|
+
}
|
|
22966
|
+
};
|
|
22929
22967
|
|
|
22930
22968
|
|
|
22931
22969
|
const $7f2e17f026d4fc8d$var$isPassportProvider = (provider)=>(provider.provider?.isPassport === true) ?? false;
|
|
@@ -22943,7 +22981,7 @@ const $7f2e17f026d4fc8d$export$86d9f998ddda013e = async (config, provider)=>{
|
|
|
22943
22981
|
});
|
|
22944
22982
|
if (availableRoutingOptions.swap) geoBlockingChecks.push({
|
|
22945
22983
|
id: "swap",
|
|
22946
|
-
promise: ($1fda5c40669a566d$export$2e83e9eeaf217e20)()
|
|
22984
|
+
promise: ($1fda5c40669a566d$export$2e83e9eeaf217e20)(config)
|
|
22947
22985
|
});
|
|
22948
22986
|
if (geoBlockingChecks.length > 0) {
|
|
22949
22987
|
const promises = geoBlockingChecks.map((geoBlockingCheck)=>geoBlockingCheck.promise);
|
|
@@ -24650,34 +24688,6 @@ async function $d35036efee31c5d1$export$dc8635800ef20f4b(provider, requirements)
|
|
|
24650
24688
|
|
|
24651
24689
|
|
|
24652
24690
|
|
|
24653
|
-
|
|
24654
|
-
|
|
24655
|
-
|
|
24656
|
-
const $5e9bcae98dc8ff19$export$1165ca270f090a66 = (isDevelopment, isProduction)=>{
|
|
24657
|
-
const postEndpoint = ()=>{
|
|
24658
|
-
if (isDevelopment) return ($d85ad1457a3f1a83$export$89133ca13c5ee30)[$d85ad1457a3f1a83$export$7d3a9eeba384fa59];
|
|
24659
|
-
if (isProduction) return ($d85ad1457a3f1a83$export$89133ca13c5ee30)[(Environment$1).PRODUCTION];
|
|
24660
|
-
return ($d85ad1457a3f1a83$export$89133ca13c5ee30)[(Environment$1).SANDBOX];
|
|
24661
|
-
};
|
|
24662
|
-
const checkDexAvailability = async ()=>{
|
|
24663
|
-
let response;
|
|
24664
|
-
try {
|
|
24665
|
-
response = await (0, globalAxios).post(`${postEndpoint()}/v1/availability/checkout/swap`);
|
|
24666
|
-
} catch (error) {
|
|
24667
|
-
response = error.response;
|
|
24668
|
-
}
|
|
24669
|
-
if (response.status === 403) return false;
|
|
24670
|
-
if (response.status === 204) return true;
|
|
24671
|
-
throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Error fetching from api: ${response.status} ${response.statusText}`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).API_ERROR);
|
|
24672
|
-
};
|
|
24673
|
-
return {
|
|
24674
|
-
checkDexAvailability: checkDexAvailability
|
|
24675
|
-
};
|
|
24676
|
-
};
|
|
24677
|
-
|
|
24678
|
-
|
|
24679
|
-
|
|
24680
|
-
|
|
24681
24691
|
const $a8cb37a3fc8eb863$var$SANDBOX_CONFIGURATION = {
|
|
24682
24692
|
baseConfig: {
|
|
24683
24693
|
environment: (Environment$1).SANDBOX
|
|
@@ -25594,7 +25594,11 @@ declare enum SaleEventType {
|
|
|
25594
25594
|
* @property {string} transactionHash - The hash of the successful transaction.
|
|
25595
25595
|
*/
|
|
25596
25596
|
type SaleSuccess = {
|
|
25597
|
-
|
|
25597
|
+
transactions: {
|
|
25598
|
+
method: string;
|
|
25599
|
+
hash: string | undefined;
|
|
25600
|
+
}[];
|
|
25601
|
+
[key: string]: unknown;
|
|
25598
25602
|
};
|
|
25599
25603
|
/**
|
|
25600
25604
|
* Type representing a Sale Widget with type FAILURE.
|
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.6";
|
|
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.6',
|
|
20
20
|
});
|
|
21
21
|
/**
|
|
22
22
|
* Sets `sdkVersion` at the time of build
|