@imtbl/sdk 0.27.5 → 0.27.7
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 +42 -44
- 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 +45 -47
- package/dist/index.d.ts +8 -4
- package/dist/index.js +45 -47
- 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
|
@@ -15410,7 +15410,7 @@ const CONTRACTS_FOR_CHAIN_ID = {
|
|
|
15410
15410
|
multicall: '0xD17c98b38bA28c7eA1080317EB9AB2b9663BEd92',
|
|
15411
15411
|
coreFactory: '0x8AC26EfCbf5D700b37A27aA00E6934e6904e7B8e',
|
|
15412
15412
|
quoterV2: '0x0Afe6F5f4DC34461A801420634239FFaD50A2e44',
|
|
15413
|
-
peripheryRouter: '
|
|
15413
|
+
peripheryRouter: '0x57c73281f2697a632AEF1A48CD6ff600f49ee344',
|
|
15414
15414
|
secondaryFee: '0x5893A5c7bc615Dfd36D7383366d00FFFca5f7178',
|
|
15415
15415
|
},
|
|
15416
15416
|
};
|
|
@@ -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.7',
|
|
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
|
|
@@ -24803,9 +24813,6 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
|
|
|
24803
24813
|
* Determines the requirements for performing a buy.
|
|
24804
24814
|
* @param {BuyParams} params - The parameters for the buy.
|
|
24805
24815
|
*/ async buy(params) {
|
|
24806
|
-
if (this.config.isProduction) throw new Error("This endpoint is not currently available.");
|
|
24807
|
-
// eslint-disable-next-line no-console
|
|
24808
|
-
console.warn("This endpoint is currently under construction.");
|
|
24809
24816
|
if (params.orders.length > 1) // eslint-disable-next-line no-console
|
|
24810
24817
|
console.warn("This endpoint currently only processes the first order in the array.");
|
|
24811
24818
|
const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider);
|
|
@@ -24817,9 +24824,6 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
|
|
|
24817
24824
|
* Only currently actions the first order in the array until we support batch processing.
|
|
24818
24825
|
* Only currently actions the first fee in the fees array of each order until we support multiple fees.
|
|
24819
24826
|
*/ async sell(params) {
|
|
24820
|
-
if (this.config.isProduction) throw new Error("This endpoint is not currently available.");
|
|
24821
|
-
// eslint-disable-next-line no-console
|
|
24822
|
-
console.warn("This endpoint is currently under construction.");
|
|
24823
24827
|
if (params.orders.length > 1) // eslint-disable-next-line no-console
|
|
24824
24828
|
console.warn("This endpoint currently only processes the first order in the array.");
|
|
24825
24829
|
const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider);
|
|
@@ -24829,9 +24833,6 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
|
|
|
24829
24833
|
* Cancels a sell.
|
|
24830
24834
|
* @param {CancelParams} params - The parameters for the cancel.
|
|
24831
24835
|
*/ async cancel(params) {
|
|
24832
|
-
if (this.config.isProduction) throw new Error("This endpoint is not currently available.");
|
|
24833
|
-
// eslint-disable-next-line no-console
|
|
24834
|
-
console.warn("This endpoint is currently under construction.");
|
|
24835
24836
|
// eslint-disable-next-line no-console
|
|
24836
24837
|
console.warn("This endpoint currently only processes the first order in the array.");
|
|
24837
24838
|
const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider);
|
|
@@ -24841,9 +24842,6 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
|
|
|
24841
24842
|
* Determines the transaction requirements to complete a purchase.
|
|
24842
24843
|
* @params {SmartCheckoutParams} params - The parameters for smart checkout.
|
|
24843
24844
|
*/ async smartCheckout(params) {
|
|
24844
|
-
if (this.config.isProduction) throw new Error("This endpoint is not currently available.");
|
|
24845
|
-
// eslint-disable-next-line no-console
|
|
24846
|
-
console.warn("This endpoint is currently under construction.");
|
|
24847
24845
|
const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider);
|
|
24848
24846
|
let itemRequirements = [];
|
|
24849
24847
|
try {
|
|
@@ -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.7";
|
|
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.7',
|
|
20
20
|
});
|
|
21
21
|
/**
|
|
22
22
|
* Sets `sdkVersion` at the time of build
|