@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/index.cjs
CHANGED
|
@@ -3631,7 +3631,7 @@ class MultiRollupApiClients {
|
|
|
3631
3631
|
}
|
|
3632
3632
|
|
|
3633
3633
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
3634
|
-
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.27.
|
|
3634
|
+
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.27.6' };
|
|
3635
3635
|
const createConfig = ({ basePath, headers, }) => {
|
|
3636
3636
|
if (!basePath.trim()) {
|
|
3637
3637
|
throw Error('basePath can not be empty');
|
|
@@ -3691,7 +3691,7 @@ class APIError extends Error {
|
|
|
3691
3691
|
|
|
3692
3692
|
/* eslint-disable implicit-arrow-linebreak */
|
|
3693
3693
|
const defaultHeaders = {
|
|
3694
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.27.
|
|
3694
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.27.6',
|
|
3695
3695
|
};
|
|
3696
3696
|
/**
|
|
3697
3697
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -4102,7 +4102,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
4102
4102
|
chainID,
|
|
4103
4103
|
coreContractAddress,
|
|
4104
4104
|
registrationContractAddress,
|
|
4105
|
-
sdkVersion: 'ts-immutable-sdk-0.27.
|
|
4105
|
+
sdkVersion: 'ts-immutable-sdk-0.27.6',
|
|
4106
4106
|
});
|
|
4107
4107
|
/**
|
|
4108
4108
|
* Sets `sdkVersion` at the time of build
|
|
@@ -31034,8 +31034,46 @@ const $7d1bfafb81e64d74$export$3a4140bd9e983e4e = async (provider, insufficientI
|
|
|
31034
31034
|
|
|
31035
31035
|
|
|
31036
31036
|
|
|
31037
|
+
|
|
31038
|
+
|
|
31039
|
+
|
|
31040
|
+
|
|
31041
|
+
const $5e9bcae98dc8ff19$export$1165ca270f090a66 = (isDevelopment, isProduction)=>{
|
|
31042
|
+
const postEndpoint = ()=>{
|
|
31043
|
+
if (isDevelopment) return ($d85ad1457a3f1a83$export$89133ca13c5ee30)[$d85ad1457a3f1a83$export$7d3a9eeba384fa59];
|
|
31044
|
+
if (isProduction) return ($d85ad1457a3f1a83$export$89133ca13c5ee30)[(Environment$1).PRODUCTION];
|
|
31045
|
+
return ($d85ad1457a3f1a83$export$89133ca13c5ee30)[(Environment$1).SANDBOX];
|
|
31046
|
+
};
|
|
31047
|
+
const checkDexAvailability = async ()=>{
|
|
31048
|
+
// TEMP FIX: Returns true for sandbox environment
|
|
31049
|
+
if (!isDevelopment && !isProduction) return true;
|
|
31050
|
+
let response;
|
|
31051
|
+
try {
|
|
31052
|
+
response = await (0, globalAxios$1).post(`${postEndpoint()}/v1/availability/checkout/swap`);
|
|
31053
|
+
} catch (error) {
|
|
31054
|
+
response = error.response;
|
|
31055
|
+
}
|
|
31056
|
+
if (response.status === 403) return false;
|
|
31057
|
+
if (response.status === 204) return true;
|
|
31058
|
+
throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Error fetching from api: ${response.status} ${response.statusText}`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).API_ERROR);
|
|
31059
|
+
};
|
|
31060
|
+
return {
|
|
31061
|
+
checkDexAvailability: checkDexAvailability
|
|
31062
|
+
};
|
|
31063
|
+
};
|
|
31064
|
+
|
|
31065
|
+
|
|
31066
|
+
|
|
31067
|
+
|
|
31037
31068
|
const $1fda5c40669a566d$export$1fac8e857d728583 = async ()=>false;
|
|
31038
|
-
const $1fda5c40669a566d$export$2e83e9eeaf217e20 = async ()=>
|
|
31069
|
+
const $1fda5c40669a566d$export$2e83e9eeaf217e20 = async (config)=>{
|
|
31070
|
+
const availability = ($5e9bcae98dc8ff19$export$1165ca270f090a66)(config.isDevelopment, config.isProduction);
|
|
31071
|
+
try {
|
|
31072
|
+
return await availability.checkDexAvailability();
|
|
31073
|
+
} catch {
|
|
31074
|
+
return false;
|
|
31075
|
+
}
|
|
31076
|
+
};
|
|
31039
31077
|
|
|
31040
31078
|
|
|
31041
31079
|
const $7f2e17f026d4fc8d$var$isPassportProvider = (provider)=>(provider.provider?.isPassport === true) ?? false;
|
|
@@ -31053,7 +31091,7 @@ const $7f2e17f026d4fc8d$export$86d9f998ddda013e = async (config, provider)=>{
|
|
|
31053
31091
|
});
|
|
31054
31092
|
if (availableRoutingOptions.swap) geoBlockingChecks.push({
|
|
31055
31093
|
id: "swap",
|
|
31056
|
-
promise: ($1fda5c40669a566d$export$2e83e9eeaf217e20)()
|
|
31094
|
+
promise: ($1fda5c40669a566d$export$2e83e9eeaf217e20)(config)
|
|
31057
31095
|
});
|
|
31058
31096
|
if (geoBlockingChecks.length > 0) {
|
|
31059
31097
|
const promises = geoBlockingChecks.map((geoBlockingCheck)=>geoBlockingCheck.promise);
|
|
@@ -32760,34 +32798,6 @@ async function $d35036efee31c5d1$export$dc8635800ef20f4b(provider, requirements)
|
|
|
32760
32798
|
|
|
32761
32799
|
|
|
32762
32800
|
|
|
32763
|
-
|
|
32764
|
-
|
|
32765
|
-
|
|
32766
|
-
const $5e9bcae98dc8ff19$export$1165ca270f090a66 = (isDevelopment, isProduction)=>{
|
|
32767
|
-
const postEndpoint = ()=>{
|
|
32768
|
-
if (isDevelopment) return ($d85ad1457a3f1a83$export$89133ca13c5ee30)[$d85ad1457a3f1a83$export$7d3a9eeba384fa59];
|
|
32769
|
-
if (isProduction) return ($d85ad1457a3f1a83$export$89133ca13c5ee30)[(Environment$1).PRODUCTION];
|
|
32770
|
-
return ($d85ad1457a3f1a83$export$89133ca13c5ee30)[(Environment$1).SANDBOX];
|
|
32771
|
-
};
|
|
32772
|
-
const checkDexAvailability = async ()=>{
|
|
32773
|
-
let response;
|
|
32774
|
-
try {
|
|
32775
|
-
response = await (0, globalAxios$1).post(`${postEndpoint()}/v1/availability/checkout/swap`);
|
|
32776
|
-
} catch (error) {
|
|
32777
|
-
response = error.response;
|
|
32778
|
-
}
|
|
32779
|
-
if (response.status === 403) return false;
|
|
32780
|
-
if (response.status === 204) return true;
|
|
32781
|
-
throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Error fetching from api: ${response.status} ${response.statusText}`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).API_ERROR);
|
|
32782
|
-
};
|
|
32783
|
-
return {
|
|
32784
|
-
checkDexAvailability: checkDexAvailability
|
|
32785
|
-
};
|
|
32786
|
-
};
|
|
32787
|
-
|
|
32788
|
-
|
|
32789
|
-
|
|
32790
|
-
|
|
32791
32801
|
const $a8cb37a3fc8eb863$var$SANDBOX_CONFIGURATION = {
|
|
32792
32802
|
baseConfig: {
|
|
32793
32803
|
environment: (Environment$1).SANDBOX
|
|
@@ -33068,7 +33078,7 @@ var $045213b18e9f1f94$export$75be0f6af9650f2c;
|
|
|
33068
33078
|
})($045213b18e9f1f94$export$75be0f6af9650f2c || ($045213b18e9f1f94$export$75be0f6af9650f2c = {}));
|
|
33069
33079
|
|
|
33070
33080
|
|
|
33071
|
-
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.27.
|
|
33081
|
+
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.27.6";
|
|
33072
33082
|
const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
|
|
33073
33083
|
const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
|
|
33074
33084
|
|
package/dist/index.d.ts
CHANGED
|
@@ -17284,6 +17284,9 @@ declare class CheckoutConfiguration {
|
|
|
17284
17284
|
readonly networkMap: NetworkMap;
|
|
17285
17285
|
constructor(config: CheckoutModuleConfiguration);
|
|
17286
17286
|
}
|
|
17287
|
+
type AvailabilityService = {
|
|
17288
|
+
checkDexAvailability: () => Promise<boolean>;
|
|
17289
|
+
};
|
|
17287
17290
|
interface FiatRampWidgetParams {
|
|
17288
17291
|
exchangeType: ExchangeType;
|
|
17289
17292
|
isPassport: boolean;
|
|
@@ -17302,9 +17305,6 @@ declare class FiatRampService {
|
|
|
17302
17305
|
feeEstimate(): Promise<OnRampProviderFees>;
|
|
17303
17306
|
createWidgetUrl(params: FiatRampWidgetParams): Promise<string>;
|
|
17304
17307
|
}
|
|
17305
|
-
type AvailabilityService = {
|
|
17306
|
-
checkDexAvailability: () => Promise<boolean>;
|
|
17307
|
-
};
|
|
17308
17308
|
declare class Checkout {
|
|
17309
17309
|
readonly config: CheckoutConfiguration;
|
|
17310
17310
|
readonly fiatRampService: FiatRampService;
|
|
@@ -32344,7 +32344,11 @@ declare enum SaleEventType {
|
|
|
32344
32344
|
* @property {string} transactionHash - The hash of the successful transaction.
|
|
32345
32345
|
*/
|
|
32346
32346
|
type SaleSuccess = {
|
|
32347
|
-
|
|
32347
|
+
transactions: {
|
|
32348
|
+
method: string;
|
|
32349
|
+
hash: string | undefined;
|
|
32350
|
+
}[];
|
|
32351
|
+
[key: string]: unknown;
|
|
32348
32352
|
};
|
|
32349
32353
|
/**
|
|
32350
32354
|
* Type representing a Sale Widget with type FAILURE.
|
package/dist/index.js
CHANGED
|
@@ -3609,7 +3609,7 @@ class MultiRollupApiClients {
|
|
|
3609
3609
|
}
|
|
3610
3610
|
|
|
3611
3611
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
3612
|
-
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.27.
|
|
3612
|
+
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.27.6' };
|
|
3613
3613
|
const createConfig = ({ basePath, headers, }) => {
|
|
3614
3614
|
if (!basePath.trim()) {
|
|
3615
3615
|
throw Error('basePath can not be empty');
|
|
@@ -3669,7 +3669,7 @@ class APIError extends Error {
|
|
|
3669
3669
|
|
|
3670
3670
|
/* eslint-disable implicit-arrow-linebreak */
|
|
3671
3671
|
const defaultHeaders = {
|
|
3672
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.27.
|
|
3672
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.27.6',
|
|
3673
3673
|
};
|
|
3674
3674
|
/**
|
|
3675
3675
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -4080,7 +4080,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
4080
4080
|
chainID,
|
|
4081
4081
|
coreContractAddress,
|
|
4082
4082
|
registrationContractAddress,
|
|
4083
|
-
sdkVersion: 'ts-immutable-sdk-0.27.
|
|
4083
|
+
sdkVersion: 'ts-immutable-sdk-0.27.6',
|
|
4084
4084
|
});
|
|
4085
4085
|
/**
|
|
4086
4086
|
* Sets `sdkVersion` at the time of build
|
|
@@ -31012,8 +31012,46 @@ const $7d1bfafb81e64d74$export$3a4140bd9e983e4e = async (provider, insufficientI
|
|
|
31012
31012
|
|
|
31013
31013
|
|
|
31014
31014
|
|
|
31015
|
+
|
|
31016
|
+
|
|
31017
|
+
|
|
31018
|
+
|
|
31019
|
+
const $5e9bcae98dc8ff19$export$1165ca270f090a66 = (isDevelopment, isProduction)=>{
|
|
31020
|
+
const postEndpoint = ()=>{
|
|
31021
|
+
if (isDevelopment) return ($d85ad1457a3f1a83$export$89133ca13c5ee30)[$d85ad1457a3f1a83$export$7d3a9eeba384fa59];
|
|
31022
|
+
if (isProduction) return ($d85ad1457a3f1a83$export$89133ca13c5ee30)[(Environment$1).PRODUCTION];
|
|
31023
|
+
return ($d85ad1457a3f1a83$export$89133ca13c5ee30)[(Environment$1).SANDBOX];
|
|
31024
|
+
};
|
|
31025
|
+
const checkDexAvailability = async ()=>{
|
|
31026
|
+
// TEMP FIX: Returns true for sandbox environment
|
|
31027
|
+
if (!isDevelopment && !isProduction) return true;
|
|
31028
|
+
let response;
|
|
31029
|
+
try {
|
|
31030
|
+
response = await (0, globalAxios$1).post(`${postEndpoint()}/v1/availability/checkout/swap`);
|
|
31031
|
+
} catch (error) {
|
|
31032
|
+
response = error.response;
|
|
31033
|
+
}
|
|
31034
|
+
if (response.status === 403) return false;
|
|
31035
|
+
if (response.status === 204) return true;
|
|
31036
|
+
throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Error fetching from api: ${response.status} ${response.statusText}`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).API_ERROR);
|
|
31037
|
+
};
|
|
31038
|
+
return {
|
|
31039
|
+
checkDexAvailability: checkDexAvailability
|
|
31040
|
+
};
|
|
31041
|
+
};
|
|
31042
|
+
|
|
31043
|
+
|
|
31044
|
+
|
|
31045
|
+
|
|
31015
31046
|
const $1fda5c40669a566d$export$1fac8e857d728583 = async ()=>false;
|
|
31016
|
-
const $1fda5c40669a566d$export$2e83e9eeaf217e20 = async ()=>
|
|
31047
|
+
const $1fda5c40669a566d$export$2e83e9eeaf217e20 = async (config)=>{
|
|
31048
|
+
const availability = ($5e9bcae98dc8ff19$export$1165ca270f090a66)(config.isDevelopment, config.isProduction);
|
|
31049
|
+
try {
|
|
31050
|
+
return await availability.checkDexAvailability();
|
|
31051
|
+
} catch {
|
|
31052
|
+
return false;
|
|
31053
|
+
}
|
|
31054
|
+
};
|
|
31017
31055
|
|
|
31018
31056
|
|
|
31019
31057
|
const $7f2e17f026d4fc8d$var$isPassportProvider = (provider)=>(provider.provider?.isPassport === true) ?? false;
|
|
@@ -31031,7 +31069,7 @@ const $7f2e17f026d4fc8d$export$86d9f998ddda013e = async (config, provider)=>{
|
|
|
31031
31069
|
});
|
|
31032
31070
|
if (availableRoutingOptions.swap) geoBlockingChecks.push({
|
|
31033
31071
|
id: "swap",
|
|
31034
|
-
promise: ($1fda5c40669a566d$export$2e83e9eeaf217e20)()
|
|
31072
|
+
promise: ($1fda5c40669a566d$export$2e83e9eeaf217e20)(config)
|
|
31035
31073
|
});
|
|
31036
31074
|
if (geoBlockingChecks.length > 0) {
|
|
31037
31075
|
const promises = geoBlockingChecks.map((geoBlockingCheck)=>geoBlockingCheck.promise);
|
|
@@ -32738,34 +32776,6 @@ async function $d35036efee31c5d1$export$dc8635800ef20f4b(provider, requirements)
|
|
|
32738
32776
|
|
|
32739
32777
|
|
|
32740
32778
|
|
|
32741
|
-
|
|
32742
|
-
|
|
32743
|
-
|
|
32744
|
-
const $5e9bcae98dc8ff19$export$1165ca270f090a66 = (isDevelopment, isProduction)=>{
|
|
32745
|
-
const postEndpoint = ()=>{
|
|
32746
|
-
if (isDevelopment) return ($d85ad1457a3f1a83$export$89133ca13c5ee30)[$d85ad1457a3f1a83$export$7d3a9eeba384fa59];
|
|
32747
|
-
if (isProduction) return ($d85ad1457a3f1a83$export$89133ca13c5ee30)[(Environment$1).PRODUCTION];
|
|
32748
|
-
return ($d85ad1457a3f1a83$export$89133ca13c5ee30)[(Environment$1).SANDBOX];
|
|
32749
|
-
};
|
|
32750
|
-
const checkDexAvailability = async ()=>{
|
|
32751
|
-
let response;
|
|
32752
|
-
try {
|
|
32753
|
-
response = await (0, globalAxios$1).post(`${postEndpoint()}/v1/availability/checkout/swap`);
|
|
32754
|
-
} catch (error) {
|
|
32755
|
-
response = error.response;
|
|
32756
|
-
}
|
|
32757
|
-
if (response.status === 403) return false;
|
|
32758
|
-
if (response.status === 204) return true;
|
|
32759
|
-
throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Error fetching from api: ${response.status} ${response.statusText}`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).API_ERROR);
|
|
32760
|
-
};
|
|
32761
|
-
return {
|
|
32762
|
-
checkDexAvailability: checkDexAvailability
|
|
32763
|
-
};
|
|
32764
|
-
};
|
|
32765
|
-
|
|
32766
|
-
|
|
32767
|
-
|
|
32768
|
-
|
|
32769
32779
|
const $a8cb37a3fc8eb863$var$SANDBOX_CONFIGURATION = {
|
|
32770
32780
|
baseConfig: {
|
|
32771
32781
|
environment: (Environment$1).SANDBOX
|
|
@@ -33046,7 +33056,7 @@ var $045213b18e9f1f94$export$75be0f6af9650f2c;
|
|
|
33046
33056
|
})($045213b18e9f1f94$export$75be0f6af9650f2c || ($045213b18e9f1f94$export$75be0f6af9650f2c = {}));
|
|
33047
33057
|
|
|
33048
33058
|
|
|
33049
|
-
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.27.
|
|
33059
|
+
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.27.6";
|
|
33050
33060
|
const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
|
|
33051
33061
|
const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
|
|
33052
33062
|
|
package/dist/passport.js
CHANGED
|
@@ -2072,7 +2072,7 @@ class MultiRollupApiClients {
|
|
|
2072
2072
|
}
|
|
2073
2073
|
|
|
2074
2074
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2075
|
-
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.27.
|
|
2075
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-0.27.6' };
|
|
2076
2076
|
const createConfig = ({ basePath, headers, }) => {
|
|
2077
2077
|
if (!basePath.trim()) {
|
|
2078
2078
|
throw Error('basePath can not be empty');
|
|
@@ -2128,7 +2128,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
2128
2128
|
chainID,
|
|
2129
2129
|
coreContractAddress,
|
|
2130
2130
|
registrationContractAddress,
|
|
2131
|
-
sdkVersion: 'ts-immutable-sdk-0.27.
|
|
2131
|
+
sdkVersion: 'ts-immutable-sdk-0.27.6',
|
|
2132
2132
|
});
|
|
2133
2133
|
/**
|
|
2134
2134
|
* Sets `sdkVersion` at the time of build
|
package/package.json
CHANGED