@imtbl/sdk 0.27.2-alpha → 0.27.3
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.d.ts +79 -990
- package/dist/blockchain_data.js +304 -261
- package/dist/browser/checkout.js +2 -2
- package/dist/checkout_sdk.d.ts +9 -0
- package/dist/checkout_sdk.js +342 -134
- 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 +350 -278
- package/dist/index.d.ts +245 -1154
- package/dist/index.js +350 -278
- package/dist/passport.js +14 -14
- package/dist/provider.js +4 -5
- package/package.json +1 -1
package/dist/passport.js
CHANGED
|
@@ -114,6 +114,8 @@ let Configuration$1 = class Configuration {
|
|
|
114
114
|
* https://openapi-generator.tech
|
|
115
115
|
* Do not edit the class manually.
|
|
116
116
|
*/
|
|
117
|
+
// Some imports not used depending on template conditions
|
|
118
|
+
// @ts-ignore
|
|
117
119
|
const BASE_PATH$1 = "https://api.sandbox.immutable.com".replace(/\/+$/, "");
|
|
118
120
|
/**
|
|
119
121
|
*
|
|
@@ -141,10 +143,10 @@ let BaseAPI$1 = class BaseAPI {
|
|
|
141
143
|
*/
|
|
142
144
|
let RequiredError$1 = class RequiredError extends Error {
|
|
143
145
|
field;
|
|
146
|
+
name = "RequiredError";
|
|
144
147
|
constructor(field, msg) {
|
|
145
148
|
super(msg);
|
|
146
149
|
this.field = field;
|
|
147
|
-
this.name = "RequiredError";
|
|
148
150
|
}
|
|
149
151
|
};
|
|
150
152
|
|
|
@@ -201,8 +203,6 @@ const setBearerAuthToObject$1 = async function (object, configuration) {
|
|
|
201
203
|
}
|
|
202
204
|
};
|
|
203
205
|
function setFlattenedQueryParams$1(urlSearchParams, parameter, key = "") {
|
|
204
|
-
if (parameter == null)
|
|
205
|
-
return;
|
|
206
206
|
if (typeof parameter === "object") {
|
|
207
207
|
if (Array.isArray(parameter)) {
|
|
208
208
|
parameter.forEach(item => setFlattenedQueryParams$1(urlSearchParams, item, key));
|
|
@@ -255,7 +255,7 @@ const toPathString$1 = function (url) {
|
|
|
255
255
|
*/
|
|
256
256
|
const createRequestFunction$1 = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
|
|
257
257
|
return (axios = globalAxios, basePath = BASE_PATH) => {
|
|
258
|
-
const axiosRequestArgs = { ...axiosArgs.options, url: (configuration?.basePath ||
|
|
258
|
+
const axiosRequestArgs = { ...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url };
|
|
259
259
|
return axios.request(axiosRequestArgs);
|
|
260
260
|
};
|
|
261
261
|
};
|
|
@@ -1609,8 +1609,8 @@ const OrdersApiAxiosParamCreator = function (configuration) {
|
|
|
1609
1609
|
* @param {string} [buyItemContractAddress] Buy item contract address to filter by
|
|
1610
1610
|
* @param {string} [sellItemTokenId] Sell item token identifier to filter by
|
|
1611
1611
|
* @param {number} [pageSize] Maximum number of orders to return per page
|
|
1612
|
-
* @param {
|
|
1613
|
-
* @param {
|
|
1612
|
+
* @param {'created_at' | 'updated_at' | 'buy_item_amount'} [sortBy] Order field to sort by
|
|
1613
|
+
* @param {'asc' | 'desc'} [sortDirection] Ascending or descending direction for sort
|
|
1614
1614
|
* @param {string} [pageCursor] Page cursor to retrieve previous or next page. Use the value returned in the response.
|
|
1615
1615
|
* @param {*} [options] Override http request option.
|
|
1616
1616
|
* @throws {RequiredError}
|
|
@@ -1667,8 +1667,8 @@ const OrdersApiAxiosParamCreator = function (configuration) {
|
|
|
1667
1667
|
* @param {string} chainName
|
|
1668
1668
|
* @param {string} [accountAddress]
|
|
1669
1669
|
* @param {number} [pageSize] Maximum number of trades to return per page
|
|
1670
|
-
* @param {
|
|
1671
|
-
* @param {
|
|
1670
|
+
* @param {'indexed_at'} [sortBy] Trade field to sort by
|
|
1671
|
+
* @param {'asc' | 'desc'} [sortDirection] Ascending or descending direction for sort
|
|
1672
1672
|
* @param {string} [pageCursor] Page cursor to retrieve previous or next page. Use the value returned in the response.
|
|
1673
1673
|
* @param {*} [options] Override http request option.
|
|
1674
1674
|
* @throws {RequiredError}
|
|
@@ -1788,8 +1788,8 @@ const OrdersApiFp = function (configuration) {
|
|
|
1788
1788
|
* @param {string} [buyItemContractAddress] Buy item contract address to filter by
|
|
1789
1789
|
* @param {string} [sellItemTokenId] Sell item token identifier to filter by
|
|
1790
1790
|
* @param {number} [pageSize] Maximum number of orders to return per page
|
|
1791
|
-
* @param {
|
|
1792
|
-
* @param {
|
|
1791
|
+
* @param {'created_at' | 'updated_at' | 'buy_item_amount'} [sortBy] Order field to sort by
|
|
1792
|
+
* @param {'asc' | 'desc'} [sortDirection] Ascending or descending direction for sort
|
|
1793
1793
|
* @param {string} [pageCursor] Page cursor to retrieve previous or next page. Use the value returned in the response.
|
|
1794
1794
|
* @param {*} [options] Override http request option.
|
|
1795
1795
|
* @throws {RequiredError}
|
|
@@ -1804,8 +1804,8 @@ const OrdersApiFp = function (configuration) {
|
|
|
1804
1804
|
* @param {string} chainName
|
|
1805
1805
|
* @param {string} [accountAddress]
|
|
1806
1806
|
* @param {number} [pageSize] Maximum number of trades to return per page
|
|
1807
|
-
* @param {
|
|
1808
|
-
* @param {
|
|
1807
|
+
* @param {'indexed_at'} [sortBy] Trade field to sort by
|
|
1808
|
+
* @param {'asc' | 'desc'} [sortDirection] Ascending or descending direction for sort
|
|
1809
1809
|
* @param {string} [pageCursor] Page cursor to retrieve previous or next page. Use the value returned in the response.
|
|
1810
1810
|
* @param {*} [options] Override http request option.
|
|
1811
1811
|
* @throws {RequiredError}
|
|
@@ -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.3' };
|
|
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.3',
|
|
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