@imtbl/sdk 1.15.4-alpha → 1.15.5-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 +6 -0
- package/dist/checkout.js +4 -4
- package/dist/config.js +1 -1
- package/dist/index.browser.js +14 -14
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +33 -33
- package/dist/index.d.ts +9 -2
- package/dist/index.js +35 -35
- package/dist/orderbook.js +1 -1
- package/dist/passport.d.ts +6 -0
- package/dist/passport.js +59 -26
- package/dist/x.d.ts +6 -3
- package/dist/x.js +63 -32
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -52,8 +52,6 @@ function _interopNamespaceDefault(e) {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
var encUtils__namespace = /*#__PURE__*/_interopNamespaceDefault(encUtils);
|
|
55
|
-
var elliptic__namespace = /*#__PURE__*/_interopNamespaceDefault(elliptic);
|
|
56
|
-
var ethereumjsWallet__namespace = /*#__PURE__*/_interopNamespaceDefault(ethereumjsWallet);
|
|
57
55
|
var crypto__namespace = /*#__PURE__*/_interopNamespaceDefault(crypto);
|
|
58
56
|
var Uniswap__namespace = /*#__PURE__*/_interopNamespaceDefault(Uniswap);
|
|
59
57
|
|
|
@@ -183,7 +181,7 @@ const flattenProperties$1 = (properties) => {
|
|
|
183
181
|
};
|
|
184
182
|
|
|
185
183
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
186
|
-
const SDK_VERSION$1 = '1.15.
|
|
184
|
+
const SDK_VERSION$1 = '1.15.5-alpha';
|
|
187
185
|
const getReferrer$1 = () => {
|
|
188
186
|
if (isNode$1()) {
|
|
189
187
|
return '';
|
|
@@ -13559,7 +13557,7 @@ class MultiRollupApiClients {
|
|
|
13559
13557
|
}
|
|
13560
13558
|
|
|
13561
13559
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
13562
|
-
const defaultHeaders$2 = { 'x-sdk-version': 'ts-immutable-sdk-1.15.
|
|
13560
|
+
const defaultHeaders$2 = { 'x-sdk-version': 'ts-immutable-sdk-1.15.5-alpha' };
|
|
13563
13561
|
const createConfig$1 = ({ basePath, headers, }) => {
|
|
13564
13562
|
if (!basePath.trim()) {
|
|
13565
13563
|
throw Error('basePath can not be empty');
|
|
@@ -13631,7 +13629,7 @@ class APIError extends Error {
|
|
|
13631
13629
|
|
|
13632
13630
|
/* eslint-disable implicit-arrow-linebreak */
|
|
13633
13631
|
const defaultHeaders$1 = {
|
|
13634
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.15.
|
|
13632
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.15.5-alpha',
|
|
13635
13633
|
};
|
|
13636
13634
|
/**
|
|
13637
13635
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -14108,11 +14106,11 @@ var blockchain_data = /*#__PURE__*/Object.freeze({
|
|
|
14108
14106
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
14109
14107
|
class ApiConfiguration extends index$2.Configuration {
|
|
14110
14108
|
}
|
|
14111
|
-
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.15.
|
|
14109
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.15.5-alpha' };
|
|
14112
14110
|
/**
|
|
14113
14111
|
* @dev use createImmutableXConfiguration instead
|
|
14114
14112
|
*/
|
|
14115
|
-
const createConfig = ({ coreContractAddress, registrationContractAddress, chainID, basePath, headers, sdkVersion, }) => {
|
|
14113
|
+
const createConfig = ({ coreContractAddress, registrationContractAddress, chainID, basePath, headers, sdkVersion, baseConfig, }) => {
|
|
14116
14114
|
if (!basePath.trim()) {
|
|
14117
14115
|
throw Error('basePath can not be empty');
|
|
14118
14116
|
}
|
|
@@ -14120,7 +14118,11 @@ const createConfig = ({ coreContractAddress, registrationContractAddress, chainI
|
|
|
14120
14118
|
defaultHeaders['x-sdk-version'] = sdkVersion;
|
|
14121
14119
|
}
|
|
14122
14120
|
// eslint-disable-next-line no-param-reassign
|
|
14123
|
-
headers = {
|
|
14121
|
+
headers = {
|
|
14122
|
+
...(headers || {}),
|
|
14123
|
+
...(addKeysToHeadersOverride(baseConfig, { headers })?.headers || {}),
|
|
14124
|
+
...defaultHeaders,
|
|
14125
|
+
};
|
|
14124
14126
|
const apiConfigOptions = {
|
|
14125
14127
|
basePath,
|
|
14126
14128
|
baseOptions: { headers },
|
|
@@ -14138,30 +14140,27 @@ const createConfig = ({ coreContractAddress, registrationContractAddress, chainI
|
|
|
14138
14140
|
* createImmutableXConfiguration to create a custom ImmutableXConfiguration
|
|
14139
14141
|
* other than the production and sandbox defined below.
|
|
14140
14142
|
*/
|
|
14141
|
-
const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress, registrationContractAddress, }) => createConfig({
|
|
14143
|
+
const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress, registrationContractAddress, baseConfig, }) => createConfig({
|
|
14142
14144
|
basePath,
|
|
14143
14145
|
chainID,
|
|
14144
14146
|
coreContractAddress,
|
|
14145
14147
|
registrationContractAddress,
|
|
14146
|
-
sdkVersion: 'ts-immutable-sdk-1.15.
|
|
14148
|
+
sdkVersion: 'ts-immutable-sdk-1.15.5-alpha',
|
|
14149
|
+
baseConfig,
|
|
14147
14150
|
});
|
|
14148
|
-
|
|
14149
|
-
* Sets `sdkVersion` at the time of build
|
|
14150
|
-
*/
|
|
14151
|
-
const production = () => createImmutableXConfiguration({
|
|
14151
|
+
const production = ({ baseConfig }) => createImmutableXConfiguration({
|
|
14152
14152
|
basePath: 'https://api.x.immutable.com',
|
|
14153
14153
|
chainID: 1,
|
|
14154
14154
|
coreContractAddress: '0x5FDCCA53617f4d2b9134B29090C87D01058e27e9',
|
|
14155
14155
|
registrationContractAddress: '0x72a06bf2a1CE5e39cBA06c0CAb824960B587d64c',
|
|
14156
|
+
baseConfig,
|
|
14156
14157
|
});
|
|
14157
|
-
|
|
14158
|
-
* Sets `sdkVersion` at the time of build
|
|
14159
|
-
*/
|
|
14160
|
-
const sandbox = () => createImmutableXConfiguration({
|
|
14158
|
+
const sandbox = ({ baseConfig }) => createImmutableXConfiguration({
|
|
14161
14159
|
basePath: 'https://api.sandbox.x.immutable.com',
|
|
14162
14160
|
chainID: 11155111,
|
|
14163
14161
|
coreContractAddress: '0x2d5C349fD8464DA06a3f90b4B0E9195F3d1b7F98',
|
|
14164
14162
|
registrationContractAddress: '0xDbA6129C02E69405622fAdc3d5A7f8d23eac3b97',
|
|
14163
|
+
baseConfig,
|
|
14165
14164
|
});
|
|
14166
14165
|
class ImxConfiguration {
|
|
14167
14166
|
immutableXConfig;
|
|
@@ -14174,15 +14173,15 @@ class ImxConfiguration {
|
|
|
14174
14173
|
else {
|
|
14175
14174
|
switch (baseConfig.environment) {
|
|
14176
14175
|
case Environment$1.SANDBOX: {
|
|
14177
|
-
this.immutableXConfig = sandbox();
|
|
14176
|
+
this.immutableXConfig = sandbox({ baseConfig });
|
|
14178
14177
|
break;
|
|
14179
14178
|
}
|
|
14180
14179
|
case Environment$1.PRODUCTION: {
|
|
14181
|
-
this.immutableXConfig = production();
|
|
14180
|
+
this.immutableXConfig = production({ baseConfig });
|
|
14182
14181
|
break;
|
|
14183
14182
|
}
|
|
14184
14183
|
default: {
|
|
14185
|
-
this.immutableXConfig = sandbox();
|
|
14184
|
+
this.immutableXConfig = sandbox({ baseConfig });
|
|
14186
14185
|
}
|
|
14187
14186
|
}
|
|
14188
14187
|
}
|
|
@@ -14206,9 +14205,9 @@ const imxClientConfig = (configOptions) => {
|
|
|
14206
14205
|
if (Object.values(Environment$1).indexOf(configOptions.environment) === -1) {
|
|
14207
14206
|
throw new Error(`Invalid environment: ${configOptions.environment}`);
|
|
14208
14207
|
}
|
|
14209
|
-
const clientConfig =
|
|
14208
|
+
const clientConfig = {
|
|
14210
14209
|
baseConfig: new ImmutableConfiguration(configOptions),
|
|
14211
|
-
}
|
|
14210
|
+
};
|
|
14212
14211
|
return clientConfig;
|
|
14213
14212
|
};
|
|
14214
14213
|
|
|
@@ -16522,8 +16521,6 @@ async function getStarkPublicKeyFromImx(ethAddress) {
|
|
|
16522
16521
|
return undefined;
|
|
16523
16522
|
}
|
|
16524
16523
|
|
|
16525
|
-
const { ec, curves } = elliptic__namespace;
|
|
16526
|
-
const { hdkey } = ethereumjsWallet__namespace;
|
|
16527
16524
|
/*
|
|
16528
16525
|
Stark-friendly elliptic curve
|
|
16529
16526
|
|
|
@@ -16549,7 +16546,7 @@ https://docs.starkware.co/starkex-v4/crypto/stark-curve
|
|
|
16549
16546
|
*/
|
|
16550
16547
|
const starkEcOrder = new BN$2('08000000 00000010 ffffffff ffffffff b781126d cae7b232 1e66a241 adc64d2f', 16);
|
|
16551
16548
|
// eslint-disable-next-line new-cap
|
|
16552
|
-
new ec(new curves.PresetCurve({
|
|
16549
|
+
new elliptic.ec(new elliptic.curves.PresetCurve({
|
|
16553
16550
|
type: 'short',
|
|
16554
16551
|
prime: null,
|
|
16555
16552
|
p: '08000000 00000011 00000000 00000000 00000000 00000000 00000000 00000001',
|
|
@@ -16641,7 +16638,7 @@ function checkIfHashedKeyIsAboveLimit(keySeed) {
|
|
|
16641
16638
|
return key.gte(maxAllowedVal);
|
|
16642
16639
|
}
|
|
16643
16640
|
function getPrivateKeyFromPath(seed, path) {
|
|
16644
|
-
const privateKey = hdkey
|
|
16641
|
+
const privateKey = ethereumjsWallet.hdkey
|
|
16645
16642
|
.fromMasterSeed(Buffer.from(seed.slice(2), 'hex')) // assuming seed is '0x...'
|
|
16646
16643
|
.derivePath(path)
|
|
16647
16644
|
.getWallet()
|
|
@@ -17050,6 +17047,7 @@ class Workflows {
|
|
|
17050
17047
|
|
|
17051
17048
|
class IMXClient {
|
|
17052
17049
|
immutableX;
|
|
17050
|
+
imxConfig;
|
|
17053
17051
|
assetApi;
|
|
17054
17052
|
balanceApi;
|
|
17055
17053
|
collectionApi;
|
|
@@ -17070,8 +17068,8 @@ class IMXClient {
|
|
|
17070
17068
|
withdrawalsApi;
|
|
17071
17069
|
workflows;
|
|
17072
17070
|
constructor(config) {
|
|
17073
|
-
|
|
17074
|
-
this.immutableX = new ImxApiClients(imxConfig.immutableXConfig.apiConfiguration);
|
|
17071
|
+
this.imxConfig = new ImxConfiguration(config);
|
|
17072
|
+
this.immutableX = new ImxApiClients(this.imxConfig.immutableXConfig.apiConfiguration);
|
|
17075
17073
|
this.assetApi = this.immutableX.assetApi;
|
|
17076
17074
|
this.balanceApi = this.immutableX.balanceApi;
|
|
17077
17075
|
this.collectionApi = this.immutableX.collectionApi;
|
|
@@ -17090,7 +17088,7 @@ class IMXClient {
|
|
|
17090
17088
|
this.transfersApi = this.immutableX.transfersApi;
|
|
17091
17089
|
this.usersApi = this.immutableX.usersApi;
|
|
17092
17090
|
this.withdrawalsApi = this.immutableX.withdrawalsApi;
|
|
17093
|
-
this.workflows = new Workflows(imxConfig.immutableXConfig, this.immutableX.collectionApi, this.immutableX.exchangeApi, this.immutableX.metadataApi, this.immutableX.metadataRefreshesApi, this.immutableX.mintsApi, this.immutableX.primarySalesApi, this.immutableX.projectsApi);
|
|
17091
|
+
this.workflows = new Workflows(this.imxConfig.immutableXConfig, this.immutableX.collectionApi, this.immutableX.exchangeApi, this.immutableX.metadataApi, this.immutableX.metadataRefreshesApi, this.immutableX.mintsApi, this.immutableX.primarySalesApi, this.immutableX.projectsApi);
|
|
17094
17092
|
}
|
|
17095
17093
|
/**
|
|
17096
17094
|
* Get details of a Deposit with the given ID
|
|
@@ -45441,7 +45439,7 @@ const flattenProperties = (properties) => {
|
|
|
45441
45439
|
};
|
|
45442
45440
|
|
|
45443
45441
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
45444
|
-
const SDK_VERSION = '1.15.
|
|
45442
|
+
const SDK_VERSION = '1.15.5-alpha';
|
|
45445
45443
|
const getReferrer = () => {
|
|
45446
45444
|
if (isNode()) {
|
|
45447
45445
|
return '';
|
|
@@ -50621,7 +50619,7 @@ const IMMUTABLE_ZKVEM_GAS_OVERRIDES = {
|
|
|
50621
50619
|
maxPriorityFeePerGas: ethers.BigNumber.from(10e9),
|
|
50622
50620
|
};
|
|
50623
50621
|
|
|
50624
|
-
const SDK_VERSION_MARKER = '1.15.
|
|
50622
|
+
const SDK_VERSION_MARKER = '1.15.5-alpha';
|
|
50625
50623
|
// This SDK version is replaced by the `yarn build` command ran on the root level
|
|
50626
50624
|
const globalPackageVersion = () => SDK_VERSION_MARKER;
|
|
50627
50625
|
|
|
@@ -55850,7 +55848,9 @@ var x = /*#__PURE__*/Object.freeze({
|
|
|
55850
55848
|
createStarkSigner: createStarkSigner,
|
|
55851
55849
|
generateLegacyStarkPrivateKey: generateLegacyStarkPrivateKey,
|
|
55852
55850
|
generateStarkPrivateKey: generateStarkPrivateKey,
|
|
55853
|
-
imxClientConfig: imxClientConfig
|
|
55851
|
+
imxClientConfig: imxClientConfig,
|
|
55852
|
+
imxClientCreateStarkSigner: createStarkSigner,
|
|
55853
|
+
imxClientGenerateLegacyStarkPrivateKey: generateLegacyStarkPrivateKey
|
|
55854
55854
|
});
|
|
55855
55855
|
|
|
55856
55856
|
exports.blockchainData = blockchain_data;
|
package/dist/index.d.ts
CHANGED
|
@@ -21890,6 +21890,7 @@ interface ImmutableXConfigurationParams {
|
|
|
21890
21890
|
chainID: number;
|
|
21891
21891
|
coreContractAddress: string;
|
|
21892
21892
|
registrationContractAddress: string;
|
|
21893
|
+
baseConfig?: ImmutableConfiguration;
|
|
21893
21894
|
}
|
|
21894
21895
|
interface EthConfiguration {
|
|
21895
21896
|
coreContractAddress: string;
|
|
@@ -21900,6 +21901,7 @@ interface ImxEnvironment extends EthConfiguration {
|
|
|
21900
21901
|
basePath: string;
|
|
21901
21902
|
headers?: Record<string, string>;
|
|
21902
21903
|
sdkVersion?: string;
|
|
21904
|
+
baseConfig?: ImmutableConfiguration;
|
|
21903
21905
|
}
|
|
21904
21906
|
interface ImmutableXConfiguration {
|
|
21905
21907
|
/**
|
|
@@ -21914,12 +21916,12 @@ interface ImmutableXConfiguration {
|
|
|
21914
21916
|
/**
|
|
21915
21917
|
* @dev use createImmutableXConfiguration instead
|
|
21916
21918
|
*/
|
|
21917
|
-
declare const createConfig: ({ coreContractAddress, registrationContractAddress, chainID, basePath, headers, sdkVersion, }: ImxEnvironment) => ImmutableXConfiguration;
|
|
21919
|
+
declare const createConfig: ({ coreContractAddress, registrationContractAddress, chainID, basePath, headers, sdkVersion, baseConfig, }: ImxEnvironment) => ImmutableXConfiguration;
|
|
21918
21920
|
/**
|
|
21919
21921
|
* createImmutableXConfiguration to create a custom ImmutableXConfiguration
|
|
21920
21922
|
* other than the production and sandbox defined below.
|
|
21921
21923
|
*/
|
|
21922
|
-
declare const createImmutableXConfiguration: ({ basePath, chainID, coreContractAddress, registrationContractAddress, }: ImmutableXConfigurationParams) => ImmutableXConfiguration;
|
|
21924
|
+
declare const createImmutableXConfiguration: ({ basePath, chainID, coreContractAddress, registrationContractAddress, baseConfig, }: ImmutableXConfigurationParams) => ImmutableXConfiguration;
|
|
21923
21925
|
interface ImxOverrides {
|
|
21924
21926
|
immutableXConfig: ImmutableXConfiguration;
|
|
21925
21927
|
}
|
|
@@ -22324,6 +22326,7 @@ declare class Workflows {
|
|
|
22324
22326
|
|
|
22325
22327
|
declare class IMXClient {
|
|
22326
22328
|
private immutableX;
|
|
22329
|
+
imxConfig: ImxConfiguration;
|
|
22327
22330
|
assetApi: AssetsApi;
|
|
22328
22331
|
balanceApi: BalancesApi;
|
|
22329
22332
|
collectionApi: CollectionsApi;
|
|
@@ -29256,6 +29259,8 @@ declare namespace x_d {
|
|
|
29256
29259
|
x_d_ImmutableConfiguration as ImmutableConfiguration,
|
|
29257
29260
|
x_d_ImmutableX as ImmutableX,
|
|
29258
29261
|
x_d_ImmutableXConfiguration as ImmutableXConfiguration,
|
|
29262
|
+
ImxModuleConfiguration as ImxClientModuleConfiguration,
|
|
29263
|
+
WalletConnection as ImxClientWalletConnection,
|
|
29259
29264
|
x_d_ImxConfiguration as ImxConfiguration,
|
|
29260
29265
|
x_d_ImxModuleConfiguration as ImxModuleConfiguration,
|
|
29261
29266
|
x_d_ImxOverrides as ImxOverrides,
|
|
@@ -29323,6 +29328,8 @@ declare namespace x_d {
|
|
|
29323
29328
|
x_d_generateLegacyStarkPrivateKey as generateLegacyStarkPrivateKey,
|
|
29324
29329
|
x_d_generateStarkPrivateKey as generateStarkPrivateKey,
|
|
29325
29330
|
x_d_imxClientConfig as imxClientConfig,
|
|
29331
|
+
createStarkSigner as imxClientCreateStarkSigner,
|
|
29332
|
+
generateLegacyStarkPrivateKey as imxClientGenerateLegacyStarkPrivateKey,
|
|
29326
29333
|
};
|
|
29327
29334
|
}
|
|
29328
29335
|
|
package/dist/index.js
CHANGED
|
@@ -7,10 +7,8 @@ import BN$2 from 'bn.js';
|
|
|
7
7
|
import * as encUtils from 'enc-utils';
|
|
8
8
|
import { splitSignature } from '@ethersproject/bytes';
|
|
9
9
|
import hashJS from 'hash.js';
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import * as ethereumjsWallet from 'ethereumjs-wallet';
|
|
13
|
-
import { hdkey as hdkey$1 } from 'ethereumjs-wallet';
|
|
10
|
+
import { ec, curves } from 'elliptic';
|
|
11
|
+
import { hdkey } from 'ethereumjs-wallet';
|
|
14
12
|
import assert from 'assert';
|
|
15
13
|
import { utils as utils$3, Contract as Contract$1, ContractFactory, BigNumber as BigNumber$1, errors, ethers, constants as constants$1, providers } from 'ethers';
|
|
16
14
|
import { Signer as Signer$1 } from '@ethersproject/abstract-signer';
|
|
@@ -161,7 +159,7 @@ const flattenProperties$1 = (properties) => {
|
|
|
161
159
|
};
|
|
162
160
|
|
|
163
161
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
164
|
-
const SDK_VERSION$1 = '1.15.
|
|
162
|
+
const SDK_VERSION$1 = '1.15.5-alpha';
|
|
165
163
|
const getReferrer$1 = () => {
|
|
166
164
|
if (isNode$1()) {
|
|
167
165
|
return '';
|
|
@@ -13537,7 +13535,7 @@ class MultiRollupApiClients {
|
|
|
13537
13535
|
}
|
|
13538
13536
|
|
|
13539
13537
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
13540
|
-
const defaultHeaders$2 = { 'x-sdk-version': 'ts-immutable-sdk-1.15.
|
|
13538
|
+
const defaultHeaders$2 = { 'x-sdk-version': 'ts-immutable-sdk-1.15.5-alpha' };
|
|
13541
13539
|
const createConfig$1 = ({ basePath, headers, }) => {
|
|
13542
13540
|
if (!basePath.trim()) {
|
|
13543
13541
|
throw Error('basePath can not be empty');
|
|
@@ -13609,7 +13607,7 @@ class APIError extends Error {
|
|
|
13609
13607
|
|
|
13610
13608
|
/* eslint-disable implicit-arrow-linebreak */
|
|
13611
13609
|
const defaultHeaders$1 = {
|
|
13612
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.15.
|
|
13610
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.15.5-alpha',
|
|
13613
13611
|
};
|
|
13614
13612
|
/**
|
|
13615
13613
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -14086,11 +14084,11 @@ var blockchain_data = /*#__PURE__*/Object.freeze({
|
|
|
14086
14084
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
14087
14085
|
class ApiConfiguration extends index$2.Configuration {
|
|
14088
14086
|
}
|
|
14089
|
-
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.15.
|
|
14087
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.15.5-alpha' };
|
|
14090
14088
|
/**
|
|
14091
14089
|
* @dev use createImmutableXConfiguration instead
|
|
14092
14090
|
*/
|
|
14093
|
-
const createConfig = ({ coreContractAddress, registrationContractAddress, chainID, basePath, headers, sdkVersion, }) => {
|
|
14091
|
+
const createConfig = ({ coreContractAddress, registrationContractAddress, chainID, basePath, headers, sdkVersion, baseConfig, }) => {
|
|
14094
14092
|
if (!basePath.trim()) {
|
|
14095
14093
|
throw Error('basePath can not be empty');
|
|
14096
14094
|
}
|
|
@@ -14098,7 +14096,11 @@ const createConfig = ({ coreContractAddress, registrationContractAddress, chainI
|
|
|
14098
14096
|
defaultHeaders['x-sdk-version'] = sdkVersion;
|
|
14099
14097
|
}
|
|
14100
14098
|
// eslint-disable-next-line no-param-reassign
|
|
14101
|
-
headers = {
|
|
14099
|
+
headers = {
|
|
14100
|
+
...(headers || {}),
|
|
14101
|
+
...(addKeysToHeadersOverride(baseConfig, { headers })?.headers || {}),
|
|
14102
|
+
...defaultHeaders,
|
|
14103
|
+
};
|
|
14102
14104
|
const apiConfigOptions = {
|
|
14103
14105
|
basePath,
|
|
14104
14106
|
baseOptions: { headers },
|
|
@@ -14116,30 +14118,27 @@ const createConfig = ({ coreContractAddress, registrationContractAddress, chainI
|
|
|
14116
14118
|
* createImmutableXConfiguration to create a custom ImmutableXConfiguration
|
|
14117
14119
|
* other than the production and sandbox defined below.
|
|
14118
14120
|
*/
|
|
14119
|
-
const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress, registrationContractAddress, }) => createConfig({
|
|
14121
|
+
const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress, registrationContractAddress, baseConfig, }) => createConfig({
|
|
14120
14122
|
basePath,
|
|
14121
14123
|
chainID,
|
|
14122
14124
|
coreContractAddress,
|
|
14123
14125
|
registrationContractAddress,
|
|
14124
|
-
sdkVersion: 'ts-immutable-sdk-1.15.
|
|
14126
|
+
sdkVersion: 'ts-immutable-sdk-1.15.5-alpha',
|
|
14127
|
+
baseConfig,
|
|
14125
14128
|
});
|
|
14126
|
-
|
|
14127
|
-
* Sets `sdkVersion` at the time of build
|
|
14128
|
-
*/
|
|
14129
|
-
const production = () => createImmutableXConfiguration({
|
|
14129
|
+
const production = ({ baseConfig }) => createImmutableXConfiguration({
|
|
14130
14130
|
basePath: 'https://api.x.immutable.com',
|
|
14131
14131
|
chainID: 1,
|
|
14132
14132
|
coreContractAddress: '0x5FDCCA53617f4d2b9134B29090C87D01058e27e9',
|
|
14133
14133
|
registrationContractAddress: '0x72a06bf2a1CE5e39cBA06c0CAb824960B587d64c',
|
|
14134
|
+
baseConfig,
|
|
14134
14135
|
});
|
|
14135
|
-
|
|
14136
|
-
* Sets `sdkVersion` at the time of build
|
|
14137
|
-
*/
|
|
14138
|
-
const sandbox = () => createImmutableXConfiguration({
|
|
14136
|
+
const sandbox = ({ baseConfig }) => createImmutableXConfiguration({
|
|
14139
14137
|
basePath: 'https://api.sandbox.x.immutable.com',
|
|
14140
14138
|
chainID: 11155111,
|
|
14141
14139
|
coreContractAddress: '0x2d5C349fD8464DA06a3f90b4B0E9195F3d1b7F98',
|
|
14142
14140
|
registrationContractAddress: '0xDbA6129C02E69405622fAdc3d5A7f8d23eac3b97',
|
|
14141
|
+
baseConfig,
|
|
14143
14142
|
});
|
|
14144
14143
|
class ImxConfiguration {
|
|
14145
14144
|
immutableXConfig;
|
|
@@ -14152,15 +14151,15 @@ class ImxConfiguration {
|
|
|
14152
14151
|
else {
|
|
14153
14152
|
switch (baseConfig.environment) {
|
|
14154
14153
|
case Environment$1.SANDBOX: {
|
|
14155
|
-
this.immutableXConfig = sandbox();
|
|
14154
|
+
this.immutableXConfig = sandbox({ baseConfig });
|
|
14156
14155
|
break;
|
|
14157
14156
|
}
|
|
14158
14157
|
case Environment$1.PRODUCTION: {
|
|
14159
|
-
this.immutableXConfig = production();
|
|
14158
|
+
this.immutableXConfig = production({ baseConfig });
|
|
14160
14159
|
break;
|
|
14161
14160
|
}
|
|
14162
14161
|
default: {
|
|
14163
|
-
this.immutableXConfig = sandbox();
|
|
14162
|
+
this.immutableXConfig = sandbox({ baseConfig });
|
|
14164
14163
|
}
|
|
14165
14164
|
}
|
|
14166
14165
|
}
|
|
@@ -14184,9 +14183,9 @@ const imxClientConfig = (configOptions) => {
|
|
|
14184
14183
|
if (Object.values(Environment$1).indexOf(configOptions.environment) === -1) {
|
|
14185
14184
|
throw new Error(`Invalid environment: ${configOptions.environment}`);
|
|
14186
14185
|
}
|
|
14187
|
-
const clientConfig =
|
|
14186
|
+
const clientConfig = {
|
|
14188
14187
|
baseConfig: new ImmutableConfiguration(configOptions),
|
|
14189
|
-
}
|
|
14188
|
+
};
|
|
14190
14189
|
return clientConfig;
|
|
14191
14190
|
};
|
|
14192
14191
|
|
|
@@ -16336,7 +16335,7 @@ const DEFAULT_ACCOUNT_APPLICATION = 'immutablex';
|
|
|
16336
16335
|
const DEFAULT_ACCOUNT_INDEX = '1';
|
|
16337
16336
|
const prime = new BN$2('800000000000011000000000000000000000000000000000000000000000001', 16);
|
|
16338
16337
|
const order = new BN$2('08000000 00000010 ffffffff ffffffff b781126d cae7b232 1e66a241 adc64d2f', 16);
|
|
16339
|
-
const starkEc = new ec
|
|
16338
|
+
const starkEc = new ec(new curves.PresetCurve({
|
|
16340
16339
|
type: 'short',
|
|
16341
16340
|
prime: null,
|
|
16342
16341
|
p: prime,
|
|
@@ -16409,7 +16408,7 @@ function grindKey$1(privateKey) {
|
|
|
16409
16408
|
return key.mod(ORDER).toString('hex');
|
|
16410
16409
|
}
|
|
16411
16410
|
function getPrivateKeyFromPath$1(seed, path) {
|
|
16412
|
-
return hdkey
|
|
16411
|
+
return hdkey
|
|
16413
16412
|
.fromMasterSeed(Buffer.from(seed.slice(2), 'hex')) // assuming seed is '0x...'
|
|
16414
16413
|
.derivePath(path)
|
|
16415
16414
|
.getWallet()
|
|
@@ -16500,8 +16499,6 @@ async function getStarkPublicKeyFromImx(ethAddress) {
|
|
|
16500
16499
|
return undefined;
|
|
16501
16500
|
}
|
|
16502
16501
|
|
|
16503
|
-
const { ec, curves } = elliptic;
|
|
16504
|
-
const { hdkey } = ethereumjsWallet;
|
|
16505
16502
|
/*
|
|
16506
16503
|
Stark-friendly elliptic curve
|
|
16507
16504
|
|
|
@@ -17028,6 +17025,7 @@ class Workflows {
|
|
|
17028
17025
|
|
|
17029
17026
|
class IMXClient {
|
|
17030
17027
|
immutableX;
|
|
17028
|
+
imxConfig;
|
|
17031
17029
|
assetApi;
|
|
17032
17030
|
balanceApi;
|
|
17033
17031
|
collectionApi;
|
|
@@ -17048,8 +17046,8 @@ class IMXClient {
|
|
|
17048
17046
|
withdrawalsApi;
|
|
17049
17047
|
workflows;
|
|
17050
17048
|
constructor(config) {
|
|
17051
|
-
|
|
17052
|
-
this.immutableX = new ImxApiClients(imxConfig.immutableXConfig.apiConfiguration);
|
|
17049
|
+
this.imxConfig = new ImxConfiguration(config);
|
|
17050
|
+
this.immutableX = new ImxApiClients(this.imxConfig.immutableXConfig.apiConfiguration);
|
|
17053
17051
|
this.assetApi = this.immutableX.assetApi;
|
|
17054
17052
|
this.balanceApi = this.immutableX.balanceApi;
|
|
17055
17053
|
this.collectionApi = this.immutableX.collectionApi;
|
|
@@ -17068,7 +17066,7 @@ class IMXClient {
|
|
|
17068
17066
|
this.transfersApi = this.immutableX.transfersApi;
|
|
17069
17067
|
this.usersApi = this.immutableX.usersApi;
|
|
17070
17068
|
this.withdrawalsApi = this.immutableX.withdrawalsApi;
|
|
17071
|
-
this.workflows = new Workflows(imxConfig.immutableXConfig, this.immutableX.collectionApi, this.immutableX.exchangeApi, this.immutableX.metadataApi, this.immutableX.metadataRefreshesApi, this.immutableX.mintsApi, this.immutableX.primarySalesApi, this.immutableX.projectsApi);
|
|
17069
|
+
this.workflows = new Workflows(this.imxConfig.immutableXConfig, this.immutableX.collectionApi, this.immutableX.exchangeApi, this.immutableX.metadataApi, this.immutableX.metadataRefreshesApi, this.immutableX.mintsApi, this.immutableX.primarySalesApi, this.immutableX.projectsApi);
|
|
17072
17070
|
}
|
|
17073
17071
|
/**
|
|
17074
17072
|
* Get details of a Deposit with the given ID
|
|
@@ -45419,7 +45417,7 @@ const flattenProperties = (properties) => {
|
|
|
45419
45417
|
};
|
|
45420
45418
|
|
|
45421
45419
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
45422
|
-
const SDK_VERSION = '1.15.
|
|
45420
|
+
const SDK_VERSION = '1.15.5-alpha';
|
|
45423
45421
|
const getReferrer = () => {
|
|
45424
45422
|
if (isNode()) {
|
|
45425
45423
|
return '';
|
|
@@ -50599,7 +50597,7 @@ const IMMUTABLE_ZKVEM_GAS_OVERRIDES = {
|
|
|
50599
50597
|
maxPriorityFeePerGas: BigNumber$1.from(10e9),
|
|
50600
50598
|
};
|
|
50601
50599
|
|
|
50602
|
-
const SDK_VERSION_MARKER = '1.15.
|
|
50600
|
+
const SDK_VERSION_MARKER = '1.15.5-alpha';
|
|
50603
50601
|
// This SDK version is replaced by the `yarn build` command ran on the root level
|
|
50604
50602
|
const globalPackageVersion = () => SDK_VERSION_MARKER;
|
|
50605
50603
|
|
|
@@ -55828,7 +55826,9 @@ var x = /*#__PURE__*/Object.freeze({
|
|
|
55828
55826
|
createStarkSigner: createStarkSigner,
|
|
55829
55827
|
generateLegacyStarkPrivateKey: generateLegacyStarkPrivateKey,
|
|
55830
55828
|
generateStarkPrivateKey: generateStarkPrivateKey,
|
|
55831
|
-
imxClientConfig: imxClientConfig
|
|
55829
|
+
imxClientConfig: imxClientConfig,
|
|
55830
|
+
imxClientCreateStarkSigner: createStarkSigner,
|
|
55831
|
+
imxClientGenerateLegacyStarkPrivateKey: generateLegacyStarkPrivateKey
|
|
55832
55832
|
});
|
|
55833
55833
|
|
|
55834
55834
|
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.15.
|
|
134
|
+
const SDK_VERSION = '1.15.5-alpha';
|
|
135
135
|
const getReferrer = () => {
|
|
136
136
|
if (isNode()) {
|
|
137
137
|
return '';
|
package/dist/passport.d.ts
CHANGED
|
@@ -13223,6 +13223,11 @@ interface ImxOverrides {
|
|
|
13223
13223
|
}
|
|
13224
13224
|
interface ImxModuleConfiguration extends ModuleConfiguration<ImxOverrides> {
|
|
13225
13225
|
}
|
|
13226
|
+
declare class ImxConfiguration {
|
|
13227
|
+
readonly immutableXConfig: ImmutableXConfiguration;
|
|
13228
|
+
readonly baseConfig: ImmutableConfiguration;
|
|
13229
|
+
constructor({ baseConfig, overrides }: ImxModuleConfiguration);
|
|
13230
|
+
}
|
|
13226
13231
|
|
|
13227
13232
|
/**
|
|
13228
13233
|
* An abstraction of a Stark account, which can be used to sign messages and transactions on StarkEx to execute state changing operations
|
|
@@ -13485,6 +13490,7 @@ declare class Workflows {
|
|
|
13485
13490
|
|
|
13486
13491
|
declare class IMXClient {
|
|
13487
13492
|
private immutableX;
|
|
13493
|
+
imxConfig: ImxConfiguration;
|
|
13488
13494
|
assetApi: AssetsApi;
|
|
13489
13495
|
balanceApi: BalancesApi;
|
|
13490
13496
|
collectionApi: CollectionsApi;
|