@imtbl/sdk 0.27.2-alpha → 0.27.4
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 +9 -0
- package/dist/checkout_sdk.js +40 -3
- package/dist/checkout_widgets.js +1 -1
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +13 -13
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +47 -11
- package/dist/index.d.ts +9 -0
- package/dist/index.js +47 -11
- package/dist/passport.js +2 -2
- package/dist/provider.js +4 -5
- 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.4' };
|
|
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.4',
|
|
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.4',
|
|
4106
4106
|
});
|
|
4107
4107
|
/**
|
|
4108
4108
|
* Sets `sdkVersion` at the time of build
|
|
@@ -12394,7 +12394,6 @@ async function createOrder({ signers, request, config, }) {
|
|
|
12394
12394
|
asset_id_buy: resp.asset_id_buy,
|
|
12395
12395
|
asset_id_sell: resp.asset_id_sell,
|
|
12396
12396
|
expiration_timestamp: resp.expiration_timestamp,
|
|
12397
|
-
include_fees: true,
|
|
12398
12397
|
fees: request.fees,
|
|
12399
12398
|
nonce: resp.nonce,
|
|
12400
12399
|
stark_key: resp.stark_key,
|
|
@@ -12405,14 +12404,14 @@ async function createOrder({ signers, request, config, }) {
|
|
|
12405
12404
|
xImxEthAddress: ethAddress,
|
|
12406
12405
|
xImxEthSignature: ethSignature,
|
|
12407
12406
|
};
|
|
12408
|
-
const createOrderResponse = await ordersApi.
|
|
12407
|
+
const createOrderResponse = await ordersApi.createOrderV3(orderParams);
|
|
12409
12408
|
return {
|
|
12410
12409
|
...createOrderResponse.data,
|
|
12411
12410
|
};
|
|
12412
12411
|
}
|
|
12413
12412
|
async function cancelOrder({ signers, request, config, }) {
|
|
12414
12413
|
const ordersApi = new coreSdk.OrdersApi(config.immutableXConfig.apiConfiguration);
|
|
12415
|
-
const getSignableCancelOrderResponse = await ordersApi.
|
|
12414
|
+
const getSignableCancelOrderResponse = await ordersApi.getSignableCancelOrderV3({
|
|
12416
12415
|
getSignableCancelOrderRequest: {
|
|
12417
12416
|
order_id: request.order_id,
|
|
12418
12417
|
},
|
|
@@ -12421,7 +12420,7 @@ async function cancelOrder({ signers, request, config, }) {
|
|
|
12421
12420
|
const ethSignature = await signRaw(signableMessage, signers.ethSigner);
|
|
12422
12421
|
const starkSignature = await signers.starkSigner.signMessage(payloadHash);
|
|
12423
12422
|
const ethAddress = await signers.ethSigner.getAddress();
|
|
12424
|
-
const cancelOrderResponse = await ordersApi.
|
|
12423
|
+
const cancelOrderResponse = await ordersApi.cancelOrderV3({
|
|
12425
12424
|
id: request.order_id.toString(),
|
|
12426
12425
|
cancelOrderRequest: {
|
|
12427
12426
|
order_id: request.order_id,
|
|
@@ -12722,7 +12721,7 @@ async function createTrade({ signers: { ethSigner, starkSigner }, request, confi
|
|
|
12722
12721
|
const { signable_message: signableMessage, payload_hash: payloadHash } = signableResult.data;
|
|
12723
12722
|
const ethSignature = await signRaw(signableMessage, ethSigner);
|
|
12724
12723
|
const starkSignature = await starkSigner.signMessage(payloadHash);
|
|
12725
|
-
const createTradeResponse = await tradesApi.
|
|
12724
|
+
const createTradeResponse = await tradesApi.createTradeV3({
|
|
12726
12725
|
createTradeRequest: {
|
|
12727
12726
|
amount_buy: signableResult.data.amount_buy,
|
|
12728
12727
|
amount_sell: signableResult.data.amount_sell,
|
|
@@ -29023,11 +29022,11 @@ const $d85ad1457a3f1a83$var$ZKEVM_NATIVE_TOKEN = {
|
|
|
29023
29022
|
decimals: $d85ad1457a3f1a83$export$903389470ba9433c,
|
|
29024
29023
|
address: $d85ad1457a3f1a83$export$b80040cb173ba6e9
|
|
29025
29024
|
};
|
|
29026
|
-
|
|
29025
|
+
const $d85ad1457a3f1a83$export$89133ca13c5ee30 = {
|
|
29027
29026
|
[$d85ad1457a3f1a83$export$7d3a9eeba384fa59]: "https://api.dev.immutable.com",
|
|
29028
29027
|
[(Environment$1).SANDBOX]: "https://api.sandbox.immutable.com",
|
|
29029
29028
|
[(Environment$1).PRODUCTION]: "https://api.immutable.com"
|
|
29030
|
-
}
|
|
29029
|
+
};
|
|
29031
29030
|
const $d85ad1457a3f1a83$export$161d4a74df65fc08 = {
|
|
29032
29031
|
[$d85ad1457a3f1a83$export$7d3a9eeba384fa59]: "https://checkout-api.dev.immutable.com",
|
|
29033
29032
|
[(Environment$1).SANDBOX]: "https://checkout-api.sandbox.immutable.com",
|
|
@@ -32755,6 +32754,35 @@ async function $d35036efee31c5d1$export$dc8635800ef20f4b(provider, requirements)
|
|
|
32755
32754
|
|
|
32756
32755
|
|
|
32757
32756
|
|
|
32757
|
+
|
|
32758
|
+
|
|
32759
|
+
|
|
32760
|
+
|
|
32761
|
+
const $5e9bcae98dc8ff19$export$1165ca270f090a66 = (isDevelopment, isProduction)=>{
|
|
32762
|
+
const postEndpoint = ()=>{
|
|
32763
|
+
if (isDevelopment) return ($d85ad1457a3f1a83$export$89133ca13c5ee30)[$d85ad1457a3f1a83$export$7d3a9eeba384fa59];
|
|
32764
|
+
if (isProduction) return ($d85ad1457a3f1a83$export$89133ca13c5ee30)[(Environment$1).PRODUCTION];
|
|
32765
|
+
return ($d85ad1457a3f1a83$export$89133ca13c5ee30)[(Environment$1).SANDBOX];
|
|
32766
|
+
};
|
|
32767
|
+
const checkDexAvailability = async ()=>{
|
|
32768
|
+
let response;
|
|
32769
|
+
try {
|
|
32770
|
+
response = await (0, globalAxios$1).post(`${postEndpoint()}/v1/availability/checkout/swap`);
|
|
32771
|
+
} catch (error) {
|
|
32772
|
+
response = error.response;
|
|
32773
|
+
}
|
|
32774
|
+
if (response.status === 403) return false;
|
|
32775
|
+
if (response.status === 204) return true;
|
|
32776
|
+
throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Error fetching from api: ${response.status} ${response.statusText}`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).API_ERROR);
|
|
32777
|
+
};
|
|
32778
|
+
return {
|
|
32779
|
+
checkDexAvailability: checkDexAvailability
|
|
32780
|
+
};
|
|
32781
|
+
};
|
|
32782
|
+
|
|
32783
|
+
|
|
32784
|
+
|
|
32785
|
+
|
|
32758
32786
|
const $a8cb37a3fc8eb863$var$SANDBOX_CONFIGURATION = {
|
|
32759
32787
|
baseConfig: {
|
|
32760
32788
|
environment: (Environment$1).SANDBOX
|
|
@@ -32764,6 +32792,7 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
|
|
|
32764
32792
|
config;
|
|
32765
32793
|
fiatRampService;
|
|
32766
32794
|
readOnlyProviders;
|
|
32795
|
+
availability;
|
|
32767
32796
|
/**
|
|
32768
32797
|
* Constructs a new instance of the CheckoutModule class.
|
|
32769
32798
|
* @param {CheckoutModuleConfiguration} [config=SANDBOX_CONFIGURATION] - The configuration object for the CheckoutModule.
|
|
@@ -32771,6 +32800,7 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
|
|
|
32771
32800
|
this.config = new ($4013c5c91bb535f6$export$4823433c4a67bbc6)(config);
|
|
32772
32801
|
this.fiatRampService = new ($a77d203f701a3b72$export$1453e9b801542ef4)(this.config);
|
|
32773
32802
|
this.readOnlyProviders = new Map();
|
|
32803
|
+
this.availability = ($5e9bcae98dc8ff19$export$1165ca270f090a66)(this.config.isDevelopment, this.config.isProduction);
|
|
32774
32804
|
}
|
|
32775
32805
|
/**
|
|
32776
32806
|
* Creates a provider using the given parameters.
|
|
@@ -32980,6 +33010,12 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
|
|
|
32980
33010
|
*/ async getExchangeFeeEstimate() {
|
|
32981
33011
|
return await this.fiatRampService.feeEstimate();
|
|
32982
33012
|
}
|
|
33013
|
+
/**
|
|
33014
|
+
* Fetches Swap widget availability.
|
|
33015
|
+
* @returns {Promise<boolean>} - A promise that resolves to a boolean.
|
|
33016
|
+
*/ async isSwapAvailable() {
|
|
33017
|
+
return this.availability.checkDexAvailability();
|
|
33018
|
+
}
|
|
32983
33019
|
}
|
|
32984
33020
|
|
|
32985
33021
|
var checkout_sdk = /*#__PURE__*/Object.freeze({
|
|
@@ -33027,7 +33063,7 @@ var $045213b18e9f1f94$export$75be0f6af9650f2c;
|
|
|
33027
33063
|
})($045213b18e9f1f94$export$75be0f6af9650f2c || ($045213b18e9f1f94$export$75be0f6af9650f2c = {}));
|
|
33028
33064
|
|
|
33029
33065
|
|
|
33030
|
-
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.27.
|
|
33066
|
+
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.27.4";
|
|
33031
33067
|
const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
|
|
33032
33068
|
const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
|
|
33033
33069
|
|
package/dist/index.d.ts
CHANGED
|
@@ -17302,9 +17302,13 @@ declare class FiatRampService {
|
|
|
17302
17302
|
feeEstimate(): Promise<OnRampProviderFees>;
|
|
17303
17303
|
createWidgetUrl(params: FiatRampWidgetParams): Promise<string>;
|
|
17304
17304
|
}
|
|
17305
|
+
type AvailabilityService = {
|
|
17306
|
+
checkDexAvailability: () => Promise<boolean>;
|
|
17307
|
+
};
|
|
17305
17308
|
declare class Checkout {
|
|
17306
17309
|
readonly config: CheckoutConfiguration;
|
|
17307
17310
|
readonly fiatRampService: FiatRampService;
|
|
17311
|
+
readonly availability: AvailabilityService;
|
|
17308
17312
|
/**
|
|
17309
17313
|
* Constructs a new instance of the CheckoutModule class.
|
|
17310
17314
|
* @param {CheckoutModuleConfiguration} [config=SANDBOX_CONFIGURATION] - The configuration object for the CheckoutModule.
|
|
@@ -17422,6 +17426,11 @@ declare class Checkout {
|
|
|
17422
17426
|
* @returns {Promise<OnRampProviderFees>} - A promise that resolves to OnRampProviderFees.
|
|
17423
17427
|
*/
|
|
17424
17428
|
getExchangeFeeEstimate(): Promise<OnRampProviderFees>;
|
|
17429
|
+
/**
|
|
17430
|
+
* Fetches Swap widget availability.
|
|
17431
|
+
* @returns {Promise<boolean>} - A promise that resolves to a boolean.
|
|
17432
|
+
*/
|
|
17433
|
+
isSwapAvailable(): Promise<boolean>;
|
|
17425
17434
|
}
|
|
17426
17435
|
|
|
17427
17436
|
type checkout_sdk_d_AllowedNetworkConfig = AllowedNetworkConfig;
|
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.4' };
|
|
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.4',
|
|
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.4',
|
|
4084
4084
|
});
|
|
4085
4085
|
/**
|
|
4086
4086
|
* Sets `sdkVersion` at the time of build
|
|
@@ -12372,7 +12372,6 @@ async function createOrder({ signers, request, config, }) {
|
|
|
12372
12372
|
asset_id_buy: resp.asset_id_buy,
|
|
12373
12373
|
asset_id_sell: resp.asset_id_sell,
|
|
12374
12374
|
expiration_timestamp: resp.expiration_timestamp,
|
|
12375
|
-
include_fees: true,
|
|
12376
12375
|
fees: request.fees,
|
|
12377
12376
|
nonce: resp.nonce,
|
|
12378
12377
|
stark_key: resp.stark_key,
|
|
@@ -12383,14 +12382,14 @@ async function createOrder({ signers, request, config, }) {
|
|
|
12383
12382
|
xImxEthAddress: ethAddress,
|
|
12384
12383
|
xImxEthSignature: ethSignature,
|
|
12385
12384
|
};
|
|
12386
|
-
const createOrderResponse = await ordersApi.
|
|
12385
|
+
const createOrderResponse = await ordersApi.createOrderV3(orderParams);
|
|
12387
12386
|
return {
|
|
12388
12387
|
...createOrderResponse.data,
|
|
12389
12388
|
};
|
|
12390
12389
|
}
|
|
12391
12390
|
async function cancelOrder({ signers, request, config, }) {
|
|
12392
12391
|
const ordersApi = new OrdersApi$1(config.immutableXConfig.apiConfiguration);
|
|
12393
|
-
const getSignableCancelOrderResponse = await ordersApi.
|
|
12392
|
+
const getSignableCancelOrderResponse = await ordersApi.getSignableCancelOrderV3({
|
|
12394
12393
|
getSignableCancelOrderRequest: {
|
|
12395
12394
|
order_id: request.order_id,
|
|
12396
12395
|
},
|
|
@@ -12399,7 +12398,7 @@ async function cancelOrder({ signers, request, config, }) {
|
|
|
12399
12398
|
const ethSignature = await signRaw(signableMessage, signers.ethSigner);
|
|
12400
12399
|
const starkSignature = await signers.starkSigner.signMessage(payloadHash);
|
|
12401
12400
|
const ethAddress = await signers.ethSigner.getAddress();
|
|
12402
|
-
const cancelOrderResponse = await ordersApi.
|
|
12401
|
+
const cancelOrderResponse = await ordersApi.cancelOrderV3({
|
|
12403
12402
|
id: request.order_id.toString(),
|
|
12404
12403
|
cancelOrderRequest: {
|
|
12405
12404
|
order_id: request.order_id,
|
|
@@ -12700,7 +12699,7 @@ async function createTrade({ signers: { ethSigner, starkSigner }, request, confi
|
|
|
12700
12699
|
const { signable_message: signableMessage, payload_hash: payloadHash } = signableResult.data;
|
|
12701
12700
|
const ethSignature = await signRaw(signableMessage, ethSigner);
|
|
12702
12701
|
const starkSignature = await starkSigner.signMessage(payloadHash);
|
|
12703
|
-
const createTradeResponse = await tradesApi.
|
|
12702
|
+
const createTradeResponse = await tradesApi.createTradeV3({
|
|
12704
12703
|
createTradeRequest: {
|
|
12705
12704
|
amount_buy: signableResult.data.amount_buy,
|
|
12706
12705
|
amount_sell: signableResult.data.amount_sell,
|
|
@@ -29001,11 +29000,11 @@ const $d85ad1457a3f1a83$var$ZKEVM_NATIVE_TOKEN = {
|
|
|
29001
29000
|
decimals: $d85ad1457a3f1a83$export$903389470ba9433c,
|
|
29002
29001
|
address: $d85ad1457a3f1a83$export$b80040cb173ba6e9
|
|
29003
29002
|
};
|
|
29004
|
-
|
|
29003
|
+
const $d85ad1457a3f1a83$export$89133ca13c5ee30 = {
|
|
29005
29004
|
[$d85ad1457a3f1a83$export$7d3a9eeba384fa59]: "https://api.dev.immutable.com",
|
|
29006
29005
|
[(Environment$1).SANDBOX]: "https://api.sandbox.immutable.com",
|
|
29007
29006
|
[(Environment$1).PRODUCTION]: "https://api.immutable.com"
|
|
29008
|
-
}
|
|
29007
|
+
};
|
|
29009
29008
|
const $d85ad1457a3f1a83$export$161d4a74df65fc08 = {
|
|
29010
29009
|
[$d85ad1457a3f1a83$export$7d3a9eeba384fa59]: "https://checkout-api.dev.immutable.com",
|
|
29011
29010
|
[(Environment$1).SANDBOX]: "https://checkout-api.sandbox.immutable.com",
|
|
@@ -32733,6 +32732,35 @@ async function $d35036efee31c5d1$export$dc8635800ef20f4b(provider, requirements)
|
|
|
32733
32732
|
|
|
32734
32733
|
|
|
32735
32734
|
|
|
32735
|
+
|
|
32736
|
+
|
|
32737
|
+
|
|
32738
|
+
|
|
32739
|
+
const $5e9bcae98dc8ff19$export$1165ca270f090a66 = (isDevelopment, isProduction)=>{
|
|
32740
|
+
const postEndpoint = ()=>{
|
|
32741
|
+
if (isDevelopment) return ($d85ad1457a3f1a83$export$89133ca13c5ee30)[$d85ad1457a3f1a83$export$7d3a9eeba384fa59];
|
|
32742
|
+
if (isProduction) return ($d85ad1457a3f1a83$export$89133ca13c5ee30)[(Environment$1).PRODUCTION];
|
|
32743
|
+
return ($d85ad1457a3f1a83$export$89133ca13c5ee30)[(Environment$1).SANDBOX];
|
|
32744
|
+
};
|
|
32745
|
+
const checkDexAvailability = async ()=>{
|
|
32746
|
+
let response;
|
|
32747
|
+
try {
|
|
32748
|
+
response = await (0, globalAxios$1).post(`${postEndpoint()}/v1/availability/checkout/swap`);
|
|
32749
|
+
} catch (error) {
|
|
32750
|
+
response = error.response;
|
|
32751
|
+
}
|
|
32752
|
+
if (response.status === 403) return false;
|
|
32753
|
+
if (response.status === 204) return true;
|
|
32754
|
+
throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Error fetching from api: ${response.status} ${response.statusText}`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).API_ERROR);
|
|
32755
|
+
};
|
|
32756
|
+
return {
|
|
32757
|
+
checkDexAvailability: checkDexAvailability
|
|
32758
|
+
};
|
|
32759
|
+
};
|
|
32760
|
+
|
|
32761
|
+
|
|
32762
|
+
|
|
32763
|
+
|
|
32736
32764
|
const $a8cb37a3fc8eb863$var$SANDBOX_CONFIGURATION = {
|
|
32737
32765
|
baseConfig: {
|
|
32738
32766
|
environment: (Environment$1).SANDBOX
|
|
@@ -32742,6 +32770,7 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
|
|
|
32742
32770
|
config;
|
|
32743
32771
|
fiatRampService;
|
|
32744
32772
|
readOnlyProviders;
|
|
32773
|
+
availability;
|
|
32745
32774
|
/**
|
|
32746
32775
|
* Constructs a new instance of the CheckoutModule class.
|
|
32747
32776
|
* @param {CheckoutModuleConfiguration} [config=SANDBOX_CONFIGURATION] - The configuration object for the CheckoutModule.
|
|
@@ -32749,6 +32778,7 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
|
|
|
32749
32778
|
this.config = new ($4013c5c91bb535f6$export$4823433c4a67bbc6)(config);
|
|
32750
32779
|
this.fiatRampService = new ($a77d203f701a3b72$export$1453e9b801542ef4)(this.config);
|
|
32751
32780
|
this.readOnlyProviders = new Map();
|
|
32781
|
+
this.availability = ($5e9bcae98dc8ff19$export$1165ca270f090a66)(this.config.isDevelopment, this.config.isProduction);
|
|
32752
32782
|
}
|
|
32753
32783
|
/**
|
|
32754
32784
|
* Creates a provider using the given parameters.
|
|
@@ -32958,6 +32988,12 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
|
|
|
32958
32988
|
*/ async getExchangeFeeEstimate() {
|
|
32959
32989
|
return await this.fiatRampService.feeEstimate();
|
|
32960
32990
|
}
|
|
32991
|
+
/**
|
|
32992
|
+
* Fetches Swap widget availability.
|
|
32993
|
+
* @returns {Promise<boolean>} - A promise that resolves to a boolean.
|
|
32994
|
+
*/ async isSwapAvailable() {
|
|
32995
|
+
return this.availability.checkDexAvailability();
|
|
32996
|
+
}
|
|
32961
32997
|
}
|
|
32962
32998
|
|
|
32963
32999
|
var checkout_sdk = /*#__PURE__*/Object.freeze({
|
|
@@ -33005,7 +33041,7 @@ var $045213b18e9f1f94$export$75be0f6af9650f2c;
|
|
|
33005
33041
|
})($045213b18e9f1f94$export$75be0f6af9650f2c || ($045213b18e9f1f94$export$75be0f6af9650f2c = {}));
|
|
33006
33042
|
|
|
33007
33043
|
|
|
33008
|
-
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.27.
|
|
33044
|
+
const $d663162fd5a0853f$export$38a083d9fb5551ca = "0.27.4";
|
|
33009
33045
|
const $d663162fd5a0853f$export$83bf90b30cdfd29f = ()=>false;
|
|
33010
33046
|
const $d663162fd5a0853f$export$1169f5475725171b = ()=>$d663162fd5a0853f$export$38a083d9fb5551ca;
|
|
33011
33047
|
|
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.4' };
|
|
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.4',
|
|
2132
2132
|
});
|
|
2133
2133
|
/**
|
|
2134
2134
|
* Sets `sdkVersion` at the time of build
|
package/dist/provider.js
CHANGED
|
@@ -219,7 +219,6 @@ async function createOrder({ signers, request, config, }) {
|
|
|
219
219
|
asset_id_buy: resp.asset_id_buy,
|
|
220
220
|
asset_id_sell: resp.asset_id_sell,
|
|
221
221
|
expiration_timestamp: resp.expiration_timestamp,
|
|
222
|
-
include_fees: true,
|
|
223
222
|
fees: request.fees,
|
|
224
223
|
nonce: resp.nonce,
|
|
225
224
|
stark_key: resp.stark_key,
|
|
@@ -230,14 +229,14 @@ async function createOrder({ signers, request, config, }) {
|
|
|
230
229
|
xImxEthAddress: ethAddress,
|
|
231
230
|
xImxEthSignature: ethSignature,
|
|
232
231
|
};
|
|
233
|
-
const createOrderResponse = await ordersApi.
|
|
232
|
+
const createOrderResponse = await ordersApi.createOrderV3(orderParams);
|
|
234
233
|
return {
|
|
235
234
|
...createOrderResponse.data,
|
|
236
235
|
};
|
|
237
236
|
}
|
|
238
237
|
async function cancelOrder({ signers, request, config, }) {
|
|
239
238
|
const ordersApi = new OrdersApi(config.immutableXConfig.apiConfiguration);
|
|
240
|
-
const getSignableCancelOrderResponse = await ordersApi.
|
|
239
|
+
const getSignableCancelOrderResponse = await ordersApi.getSignableCancelOrderV3({
|
|
241
240
|
getSignableCancelOrderRequest: {
|
|
242
241
|
order_id: request.order_id,
|
|
243
242
|
},
|
|
@@ -246,7 +245,7 @@ async function cancelOrder({ signers, request, config, }) {
|
|
|
246
245
|
const ethSignature = await signRaw(signableMessage, signers.ethSigner);
|
|
247
246
|
const starkSignature = await signers.starkSigner.signMessage(payloadHash);
|
|
248
247
|
const ethAddress = await signers.ethSigner.getAddress();
|
|
249
|
-
const cancelOrderResponse = await ordersApi.
|
|
248
|
+
const cancelOrderResponse = await ordersApi.cancelOrderV3({
|
|
250
249
|
id: request.order_id.toString(),
|
|
251
250
|
cancelOrderRequest: {
|
|
252
251
|
order_id: request.order_id,
|
|
@@ -547,7 +546,7 @@ async function createTrade({ signers: { ethSigner, starkSigner }, request, confi
|
|
|
547
546
|
const { signable_message: signableMessage, payload_hash: payloadHash } = signableResult.data;
|
|
548
547
|
const ethSignature = await signRaw(signableMessage, ethSigner);
|
|
549
548
|
const starkSignature = await starkSigner.signMessage(payloadHash);
|
|
550
|
-
const createTradeResponse = await tradesApi.
|
|
549
|
+
const createTradeResponse = await tradesApi.createTradeV3({
|
|
551
550
|
createTradeRequest: {
|
|
552
551
|
amount_buy: signableResult.data.amount_buy,
|
|
553
552
|
amount_sell: signableResult.data.amount_sell,
|
package/package.json
CHANGED