@imtbl/sdk 1.14.0-alpha → 1.14.1-alpha
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 +2 -2
- package/dist/browser/checkout/sdk.js +4 -4
- package/dist/checkout.d.ts +3 -1
- package/dist/checkout.js +4 -4
- package/dist/config.js +1 -1
- package/dist/index.browser.js +11 -11
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +15 -43
- package/dist/index.d.ts +237 -69
- package/dist/index.js +19 -47
- package/dist/orderbook.js +1 -1
- package/dist/passport.d.ts +3 -1
- package/dist/passport.js +8 -9
- package/dist/x.d.ts +165 -49
- package/dist/x.js +14 -37
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import globalAxios$1, { isAxiosError as isAxiosError$2, HttpStatusCode as HttpStatusCode$3
|
|
1
|
+
import globalAxios$1, { isAxiosError as isAxiosError$2, HttpStatusCode as HttpStatusCode$3 } from 'axios';
|
|
2
2
|
import { memorise as memorise$1 } from 'lru-memorise';
|
|
3
3
|
import { getGlobalisedValue as getGlobalisedValue$3 } from 'global-const';
|
|
4
4
|
import { keccak256 as keccak256$1 } from '@ethersproject/keccak256';
|
|
@@ -17,7 +17,7 @@ import jwt_decode from 'jwt-decode';
|
|
|
17
17
|
import * as crypto from 'crypto';
|
|
18
18
|
import { Magic } from 'magic-sdk';
|
|
19
19
|
import { OpenIdExtension } from '@magic-ext/oidc';
|
|
20
|
-
import { generateLegacyStarkPrivateKey as generateLegacyStarkPrivateKey$1, createStarkSigner as createStarkSigner$1, Config
|
|
20
|
+
import { generateLegacyStarkPrivateKey as generateLegacyStarkPrivateKey$1, createStarkSigner as createStarkSigner$1, Config, TransfersApi as TransfersApi$2, OrdersApi as OrdersApi$3, UsersApi as UsersApi$2, Contracts, TradesApi as TradesApi$2, ExchangesApi as ExchangesApi$2, WithdrawalsApi as WithdrawalsApi$2, MintsApi as MintsApi$2, DepositsApi as DepositsApi$2, EncodingApi as EncodingApi$2, TokensApi as TokensApi$3 } from '@imtbl/core-sdk';
|
|
21
21
|
import { JsonRpcProvider, Web3Provider } from '@ethersproject/providers';
|
|
22
22
|
import { EventEmitter } from 'events';
|
|
23
23
|
import { walletContracts } from '@0xsequence/abi';
|
|
@@ -159,7 +159,7 @@ const flattenProperties$1 = (properties) => {
|
|
|
159
159
|
};
|
|
160
160
|
|
|
161
161
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
162
|
-
const SDK_VERSION$1 = '1.14.
|
|
162
|
+
const SDK_VERSION$1 = '1.14.1-alpha';
|
|
163
163
|
const getReferrer$1 = () => {
|
|
164
164
|
if (isNode$1()) {
|
|
165
165
|
return '';
|
|
@@ -13535,7 +13535,7 @@ class MultiRollupApiClients {
|
|
|
13535
13535
|
}
|
|
13536
13536
|
|
|
13537
13537
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
13538
|
-
const defaultHeaders$2 = { 'x-sdk-version': 'ts-immutable-sdk-1.14.
|
|
13538
|
+
const defaultHeaders$2 = { 'x-sdk-version': 'ts-immutable-sdk-1.14.1-alpha' };
|
|
13539
13539
|
const createConfig$1 = ({ basePath, headers, }) => {
|
|
13540
13540
|
if (!basePath.trim()) {
|
|
13541
13541
|
throw Error('basePath can not be empty');
|
|
@@ -13607,7 +13607,7 @@ class APIError extends Error {
|
|
|
13607
13607
|
|
|
13608
13608
|
/* eslint-disable implicit-arrow-linebreak */
|
|
13609
13609
|
const defaultHeaders$1 = {
|
|
13610
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.14.
|
|
13610
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.14.1-alpha',
|
|
13611
13611
|
};
|
|
13612
13612
|
/**
|
|
13613
13613
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -14082,10 +14082,11 @@ var blockchain_data = /*#__PURE__*/Object.freeze({
|
|
|
14082
14082
|
});
|
|
14083
14083
|
|
|
14084
14084
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
14085
|
-
|
|
14086
|
-
|
|
14085
|
+
class ApiConfiguration extends index$2.Configuration {
|
|
14086
|
+
}
|
|
14087
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.14.1-alpha' };
|
|
14087
14088
|
/**
|
|
14088
|
-
* @dev
|
|
14089
|
+
* @dev use createImmutableXConfiguration instead
|
|
14089
14090
|
*/
|
|
14090
14091
|
const createConfig = ({ coreContractAddress, registrationContractAddress, chainID, basePath, headers, sdkVersion, }) => {
|
|
14091
14092
|
if (!basePath.trim()) {
|
|
@@ -14109,30 +14110,6 @@ const createConfig = ({ coreContractAddress, registrationContractAddress, chainI
|
|
|
14109
14110
|
},
|
|
14110
14111
|
};
|
|
14111
14112
|
};
|
|
14112
|
-
/**
|
|
14113
|
-
* Creates a Configuration for the specified environment
|
|
14114
|
-
* @dev Copied from Core SDK as a convenience for migrating away from Core SDK
|
|
14115
|
-
* @returns an ImmutableXConfiguration
|
|
14116
|
-
*/
|
|
14117
|
-
const Config = {
|
|
14118
|
-
get PRODUCTION() {
|
|
14119
|
-
return createConfig({
|
|
14120
|
-
basePath: 'https://api.x.immutable.com',
|
|
14121
|
-
chainID: 1,
|
|
14122
|
-
coreContractAddress: '0x5FDCCA53617f4d2b9134B29090C87D01058e27e9',
|
|
14123
|
-
registrationContractAddress: '0x72a06bf2a1CE5e39cBA06c0CAb824960B587d64c',
|
|
14124
|
-
});
|
|
14125
|
-
},
|
|
14126
|
-
get SANDBOX() {
|
|
14127
|
-
return createConfig({
|
|
14128
|
-
basePath: 'https://api.sandbox.x.immutable.com',
|
|
14129
|
-
chainID: 11155111,
|
|
14130
|
-
coreContractAddress: '0x2d5C349fD8464DA06a3f90b4B0E9195F3d1b7F98',
|
|
14131
|
-
registrationContractAddress: '0xDbA6129C02E69405622fAdc3d5A7f8d23eac3b97',
|
|
14132
|
-
});
|
|
14133
|
-
},
|
|
14134
|
-
createConfig,
|
|
14135
|
-
};
|
|
14136
14113
|
/**
|
|
14137
14114
|
* createImmutableXConfiguration to create a custom ImmutableXConfiguration
|
|
14138
14115
|
* other than the production and sandbox defined below.
|
|
@@ -14142,7 +14119,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
14142
14119
|
chainID,
|
|
14143
14120
|
coreContractAddress,
|
|
14144
14121
|
registrationContractAddress,
|
|
14145
|
-
sdkVersion: 'ts-immutable-sdk-1.14.
|
|
14122
|
+
sdkVersion: 'ts-immutable-sdk-1.14.1-alpha',
|
|
14146
14123
|
});
|
|
14147
14124
|
/**
|
|
14148
14125
|
* Sets `sdkVersion` at the time of build
|
|
@@ -17718,8 +17695,8 @@ class IMXClient {
|
|
|
17718
17695
|
});
|
|
17719
17696
|
}
|
|
17720
17697
|
}
|
|
17721
|
-
|
|
17722
|
-
|
|
17698
|
+
class ImmutableX extends IMXClient {
|
|
17699
|
+
}
|
|
17723
17700
|
|
|
17724
17701
|
/* Autogenerated file. Do not edit manually. */
|
|
17725
17702
|
/* tslint:disable */
|
|
@@ -25010,9 +24987,7 @@ async function batchNftTransfer({ user, starkSigner, request, transfersApi, guar
|
|
|
25010
24987
|
await guardianClient.evaluateImxTransaction({
|
|
25011
24988
|
payloadHash: signableResult.data.signable_responses[0]?.payload_hash,
|
|
25012
24989
|
});
|
|
25013
|
-
const requests = await Promise.all(
|
|
25014
|
-
// @ts-ignore - TS is not able to infer the type of the response
|
|
25015
|
-
signableResult.data.signable_responses.map(async (resp) => {
|
|
24990
|
+
const requests = await Promise.all(signableResult.data.signable_responses.map(async (resp) => {
|
|
25016
24991
|
const starkSignature = await starkSigner.signMessage(resp.payload_hash);
|
|
25017
24992
|
return {
|
|
25018
24993
|
sender_vault_id: resp.sender_vault_id,
|
|
@@ -45446,7 +45421,7 @@ const flattenProperties = (properties) => {
|
|
|
45446
45421
|
};
|
|
45447
45422
|
|
|
45448
45423
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
45449
|
-
const SDK_VERSION = '1.14.
|
|
45424
|
+
const SDK_VERSION = '1.14.1-alpha';
|
|
45450
45425
|
const getReferrer = () => {
|
|
45451
45426
|
if (isNode()) {
|
|
45452
45427
|
return '';
|
|
@@ -50626,7 +50601,7 @@ const IMMUTABLE_ZKVEM_GAS_OVERRIDES = {
|
|
|
50626
50601
|
maxPriorityFeePerGas: BigNumber$1.from(10e9),
|
|
50627
50602
|
};
|
|
50628
50603
|
|
|
50629
|
-
const SDK_VERSION_MARKER = '1.14.
|
|
50604
|
+
const SDK_VERSION_MARKER = '1.14.1-alpha';
|
|
50630
50605
|
// This SDK version is replaced by the `yarn build` command ran on the root level
|
|
50631
50606
|
const globalPackageVersion = () => SDK_VERSION_MARKER;
|
|
50632
50607
|
|
|
@@ -54941,7 +54916,7 @@ async function isRegisteredOffchain(ethAddress, config) {
|
|
|
54941
54916
|
return accounts?.length > 0;
|
|
54942
54917
|
}
|
|
54943
54918
|
catch (ex) {
|
|
54944
|
-
if (
|
|
54919
|
+
if (isAxiosError$2(ex) && ex.response?.status === 404) {
|
|
54945
54920
|
return false;
|
|
54946
54921
|
}
|
|
54947
54922
|
throw ex;
|
|
@@ -55796,11 +55771,11 @@ class ProviderConfiguration {
|
|
|
55796
55771
|
// eslint-disable-next-line default-case
|
|
55797
55772
|
switch (baseConfig.environment) {
|
|
55798
55773
|
case Environment$1.SANDBOX: {
|
|
55799
|
-
this.immutableXConfig = Config
|
|
55774
|
+
this.immutableXConfig = Config.SANDBOX;
|
|
55800
55775
|
break;
|
|
55801
55776
|
}
|
|
55802
55777
|
case Environment$1.PRODUCTION: {
|
|
55803
|
-
this.immutableXConfig = Config
|
|
55778
|
+
this.immutableXConfig = Config.PRODUCTION;
|
|
55804
55779
|
break;
|
|
55805
55780
|
}
|
|
55806
55781
|
}
|
|
@@ -55814,7 +55789,6 @@ var x = /*#__PURE__*/Object.freeze({
|
|
|
55814
55789
|
AssetsApi: AssetsApi,
|
|
55815
55790
|
BalancesApi: BalancesApi,
|
|
55816
55791
|
CollectionsApi: CollectionsApi,
|
|
55817
|
-
Config: Config,
|
|
55818
55792
|
Contracts: exportContracts,
|
|
55819
55793
|
DepositsApi: DepositsApi,
|
|
55820
55794
|
EncodingApi: EncodingApi,
|
|
@@ -55842,9 +55816,7 @@ var x = /*#__PURE__*/Object.freeze({
|
|
|
55842
55816
|
createStarkSigner: createStarkSigner,
|
|
55843
55817
|
generateLegacyStarkPrivateKey: generateLegacyStarkPrivateKey,
|
|
55844
55818
|
generateStarkPrivateKey: generateStarkPrivateKey,
|
|
55845
|
-
imxClientConfig: imxClientConfig
|
|
55846
|
-
imxClientCreateStarkSigner: createStarkSigner,
|
|
55847
|
-
imxClientGenerateLegacyStarkPrivateKey: generateLegacyStarkPrivateKey
|
|
55819
|
+
imxClientConfig: imxClientConfig
|
|
55848
55820
|
});
|
|
55849
55821
|
|
|
55850
55822
|
export { blockchain_data as blockchainData, checkout, config, orderbook, passport, x };
|
package/dist/orderbook.js
CHANGED
|
@@ -131,7 +131,7 @@ const flattenProperties = (properties) => {
|
|
|
131
131
|
};
|
|
132
132
|
|
|
133
133
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
134
|
-
const SDK_VERSION = '1.14.
|
|
134
|
+
const SDK_VERSION = '1.14.1-alpha';
|
|
135
135
|
const getReferrer = () => {
|
|
136
136
|
if (isNode()) {
|
|
137
137
|
return '';
|
package/dist/passport.d.ts
CHANGED
|
@@ -13201,6 +13201,8 @@ declare class ImxApiClients {
|
|
|
13201
13201
|
constructor(config: ImmutableAPIConfiguration);
|
|
13202
13202
|
}
|
|
13203
13203
|
|
|
13204
|
+
declare class ApiConfiguration extends Configuration {
|
|
13205
|
+
}
|
|
13204
13206
|
interface EthConfiguration {
|
|
13205
13207
|
coreContractAddress: string;
|
|
13206
13208
|
registrationContractAddress: string;
|
|
@@ -13210,7 +13212,7 @@ interface ImmutableXConfiguration {
|
|
|
13210
13212
|
/**
|
|
13211
13213
|
* The configuration for the API client
|
|
13212
13214
|
*/
|
|
13213
|
-
apiConfiguration:
|
|
13215
|
+
apiConfiguration: ApiConfiguration;
|
|
13214
13216
|
/**
|
|
13215
13217
|
* The configuration for the Ethereum network
|
|
13216
13218
|
*/
|
package/dist/passport.js
CHANGED
|
@@ -11350,7 +11350,7 @@ class MultiRollupApiClients {
|
|
|
11350
11350
|
}
|
|
11351
11351
|
|
|
11352
11352
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
11353
|
-
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-1.14.
|
|
11353
|
+
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-1.14.1-alpha' };
|
|
11354
11354
|
const createConfig$1 = ({ basePath, headers, }) => {
|
|
11355
11355
|
if (!basePath.trim()) {
|
|
11356
11356
|
throw Error('basePath can not be empty');
|
|
@@ -11529,7 +11529,7 @@ const flattenProperties = (properties) => {
|
|
|
11529
11529
|
};
|
|
11530
11530
|
|
|
11531
11531
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
11532
|
-
const SDK_VERSION = '1.14.
|
|
11532
|
+
const SDK_VERSION = '1.14.1-alpha';
|
|
11533
11533
|
const getReferrer = () => {
|
|
11534
11534
|
if (isNode()) {
|
|
11535
11535
|
return '';
|
|
@@ -11744,10 +11744,11 @@ var KeyHeaders;
|
|
|
11744
11744
|
})(KeyHeaders || (KeyHeaders = {}));
|
|
11745
11745
|
|
|
11746
11746
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
11747
|
-
|
|
11748
|
-
|
|
11747
|
+
class ApiConfiguration extends index$2.Configuration {
|
|
11748
|
+
}
|
|
11749
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.14.1-alpha' };
|
|
11749
11750
|
/**
|
|
11750
|
-
* @dev
|
|
11751
|
+
* @dev use createImmutableXConfiguration instead
|
|
11751
11752
|
*/
|
|
11752
11753
|
const createConfig = ({ coreContractAddress, registrationContractAddress, chainID, basePath, headers, sdkVersion, }) => {
|
|
11753
11754
|
if (!basePath.trim()) {
|
|
@@ -11780,7 +11781,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
11780
11781
|
chainID,
|
|
11781
11782
|
coreContractAddress,
|
|
11782
11783
|
registrationContractAddress,
|
|
11783
|
-
sdkVersion: 'ts-immutable-sdk-1.14.
|
|
11784
|
+
sdkVersion: 'ts-immutable-sdk-1.14.1-alpha',
|
|
11784
11785
|
});
|
|
11785
11786
|
/**
|
|
11786
11787
|
* Sets `sdkVersion` at the time of build
|
|
@@ -19929,9 +19930,7 @@ async function batchNftTransfer({ user, starkSigner, request, transfersApi, guar
|
|
|
19929
19930
|
await guardianClient.evaluateImxTransaction({
|
|
19930
19931
|
payloadHash: signableResult.data.signable_responses[0]?.payload_hash,
|
|
19931
19932
|
});
|
|
19932
|
-
const requests = await Promise.all(
|
|
19933
|
-
// @ts-ignore - TS is not able to infer the type of the response
|
|
19934
|
-
signableResult.data.signable_responses.map(async (resp) => {
|
|
19933
|
+
const requests = await Promise.all(signableResult.data.signable_responses.map(async (resp) => {
|
|
19935
19934
|
const starkSignature = await starkSigner.signMessage(resp.payload_hash);
|
|
19936
19935
|
return {
|
|
19937
19936
|
sender_vault_id: resp.sender_vault_id,
|