@imtbl/sdk 1.15.3-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 +34 -32
- package/dist/index.d.ts +9 -2
- package/dist/index.js +33 -31
- 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 +61 -28
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -9,7 +9,7 @@ var BN$2 = require('bn.js');
|
|
|
9
9
|
var encUtils = require('enc-utils');
|
|
10
10
|
var bytes = require('@ethersproject/bytes');
|
|
11
11
|
var hashJS = require('hash.js');
|
|
12
|
-
var
|
|
12
|
+
var elliptic = require('elliptic');
|
|
13
13
|
var ethereumjsWallet = require('ethereumjs-wallet');
|
|
14
14
|
var assert = require('assert');
|
|
15
15
|
var ethers = require('ethers');
|
|
@@ -52,7 +52,6 @@ function _interopNamespaceDefault(e) {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
var encUtils__namespace = /*#__PURE__*/_interopNamespaceDefault(encUtils);
|
|
55
|
-
var pkg__namespace = /*#__PURE__*/_interopNamespaceDefault(pkg);
|
|
56
55
|
var crypto__namespace = /*#__PURE__*/_interopNamespaceDefault(crypto);
|
|
57
56
|
var Uniswap__namespace = /*#__PURE__*/_interopNamespaceDefault(Uniswap);
|
|
58
57
|
|
|
@@ -182,7 +181,7 @@ const flattenProperties$1 = (properties) => {
|
|
|
182
181
|
};
|
|
183
182
|
|
|
184
183
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
185
|
-
const SDK_VERSION$1 = '1.15.
|
|
184
|
+
const SDK_VERSION$1 = '1.15.5-alpha';
|
|
186
185
|
const getReferrer$1 = () => {
|
|
187
186
|
if (isNode$1()) {
|
|
188
187
|
return '';
|
|
@@ -13558,7 +13557,7 @@ class MultiRollupApiClients {
|
|
|
13558
13557
|
}
|
|
13559
13558
|
|
|
13560
13559
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
13561
|
-
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' };
|
|
13562
13561
|
const createConfig$1 = ({ basePath, headers, }) => {
|
|
13563
13562
|
if (!basePath.trim()) {
|
|
13564
13563
|
throw Error('basePath can not be empty');
|
|
@@ -13630,7 +13629,7 @@ class APIError extends Error {
|
|
|
13630
13629
|
|
|
13631
13630
|
/* eslint-disable implicit-arrow-linebreak */
|
|
13632
13631
|
const defaultHeaders$1 = {
|
|
13633
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.15.
|
|
13632
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.15.5-alpha',
|
|
13634
13633
|
};
|
|
13635
13634
|
/**
|
|
13636
13635
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -14107,11 +14106,11 @@ var blockchain_data = /*#__PURE__*/Object.freeze({
|
|
|
14107
14106
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
14108
14107
|
class ApiConfiguration extends index$2.Configuration {
|
|
14109
14108
|
}
|
|
14110
|
-
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.15.
|
|
14109
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.15.5-alpha' };
|
|
14111
14110
|
/**
|
|
14112
14111
|
* @dev use createImmutableXConfiguration instead
|
|
14113
14112
|
*/
|
|
14114
|
-
const createConfig = ({ coreContractAddress, registrationContractAddress, chainID, basePath, headers, sdkVersion, }) => {
|
|
14113
|
+
const createConfig = ({ coreContractAddress, registrationContractAddress, chainID, basePath, headers, sdkVersion, baseConfig, }) => {
|
|
14115
14114
|
if (!basePath.trim()) {
|
|
14116
14115
|
throw Error('basePath can not be empty');
|
|
14117
14116
|
}
|
|
@@ -14119,7 +14118,11 @@ const createConfig = ({ coreContractAddress, registrationContractAddress, chainI
|
|
|
14119
14118
|
defaultHeaders['x-sdk-version'] = sdkVersion;
|
|
14120
14119
|
}
|
|
14121
14120
|
// eslint-disable-next-line no-param-reassign
|
|
14122
|
-
headers = {
|
|
14121
|
+
headers = {
|
|
14122
|
+
...(headers || {}),
|
|
14123
|
+
...(addKeysToHeadersOverride(baseConfig, { headers })?.headers || {}),
|
|
14124
|
+
...defaultHeaders,
|
|
14125
|
+
};
|
|
14123
14126
|
const apiConfigOptions = {
|
|
14124
14127
|
basePath,
|
|
14125
14128
|
baseOptions: { headers },
|
|
@@ -14137,30 +14140,27 @@ const createConfig = ({ coreContractAddress, registrationContractAddress, chainI
|
|
|
14137
14140
|
* createImmutableXConfiguration to create a custom ImmutableXConfiguration
|
|
14138
14141
|
* other than the production and sandbox defined below.
|
|
14139
14142
|
*/
|
|
14140
|
-
const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress, registrationContractAddress, }) => createConfig({
|
|
14143
|
+
const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress, registrationContractAddress, baseConfig, }) => createConfig({
|
|
14141
14144
|
basePath,
|
|
14142
14145
|
chainID,
|
|
14143
14146
|
coreContractAddress,
|
|
14144
14147
|
registrationContractAddress,
|
|
14145
|
-
sdkVersion: 'ts-immutable-sdk-1.15.
|
|
14148
|
+
sdkVersion: 'ts-immutable-sdk-1.15.5-alpha',
|
|
14149
|
+
baseConfig,
|
|
14146
14150
|
});
|
|
14147
|
-
|
|
14148
|
-
* Sets `sdkVersion` at the time of build
|
|
14149
|
-
*/
|
|
14150
|
-
const production = () => createImmutableXConfiguration({
|
|
14151
|
+
const production = ({ baseConfig }) => createImmutableXConfiguration({
|
|
14151
14152
|
basePath: 'https://api.x.immutable.com',
|
|
14152
14153
|
chainID: 1,
|
|
14153
14154
|
coreContractAddress: '0x5FDCCA53617f4d2b9134B29090C87D01058e27e9',
|
|
14154
14155
|
registrationContractAddress: '0x72a06bf2a1CE5e39cBA06c0CAb824960B587d64c',
|
|
14156
|
+
baseConfig,
|
|
14155
14157
|
});
|
|
14156
|
-
|
|
14157
|
-
* Sets `sdkVersion` at the time of build
|
|
14158
|
-
*/
|
|
14159
|
-
const sandbox = () => createImmutableXConfiguration({
|
|
14158
|
+
const sandbox = ({ baseConfig }) => createImmutableXConfiguration({
|
|
14160
14159
|
basePath: 'https://api.sandbox.x.immutable.com',
|
|
14161
14160
|
chainID: 11155111,
|
|
14162
14161
|
coreContractAddress: '0x2d5C349fD8464DA06a3f90b4B0E9195F3d1b7F98',
|
|
14163
14162
|
registrationContractAddress: '0xDbA6129C02E69405622fAdc3d5A7f8d23eac3b97',
|
|
14163
|
+
baseConfig,
|
|
14164
14164
|
});
|
|
14165
14165
|
class ImxConfiguration {
|
|
14166
14166
|
immutableXConfig;
|
|
@@ -14173,15 +14173,15 @@ class ImxConfiguration {
|
|
|
14173
14173
|
else {
|
|
14174
14174
|
switch (baseConfig.environment) {
|
|
14175
14175
|
case Environment$1.SANDBOX: {
|
|
14176
|
-
this.immutableXConfig = sandbox();
|
|
14176
|
+
this.immutableXConfig = sandbox({ baseConfig });
|
|
14177
14177
|
break;
|
|
14178
14178
|
}
|
|
14179
14179
|
case Environment$1.PRODUCTION: {
|
|
14180
|
-
this.immutableXConfig = production();
|
|
14180
|
+
this.immutableXConfig = production({ baseConfig });
|
|
14181
14181
|
break;
|
|
14182
14182
|
}
|
|
14183
14183
|
default: {
|
|
14184
|
-
this.immutableXConfig = sandbox();
|
|
14184
|
+
this.immutableXConfig = sandbox({ baseConfig });
|
|
14185
14185
|
}
|
|
14186
14186
|
}
|
|
14187
14187
|
}
|
|
@@ -14205,9 +14205,9 @@ const imxClientConfig = (configOptions) => {
|
|
|
14205
14205
|
if (Object.values(Environment$1).indexOf(configOptions.environment) === -1) {
|
|
14206
14206
|
throw new Error(`Invalid environment: ${configOptions.environment}`);
|
|
14207
14207
|
}
|
|
14208
|
-
const clientConfig =
|
|
14208
|
+
const clientConfig = {
|
|
14209
14209
|
baseConfig: new ImmutableConfiguration(configOptions),
|
|
14210
|
-
}
|
|
14210
|
+
};
|
|
14211
14211
|
return clientConfig;
|
|
14212
14212
|
};
|
|
14213
14213
|
|
|
@@ -16357,7 +16357,7 @@ const DEFAULT_ACCOUNT_APPLICATION = 'immutablex';
|
|
|
16357
16357
|
const DEFAULT_ACCOUNT_INDEX = '1';
|
|
16358
16358
|
const prime = new BN$2('800000000000011000000000000000000000000000000000000000000000001', 16);
|
|
16359
16359
|
const order = new BN$2('08000000 00000010 ffffffff ffffffff b781126d cae7b232 1e66a241 adc64d2f', 16);
|
|
16360
|
-
const starkEc = new
|
|
16360
|
+
const starkEc = new elliptic.ec(new elliptic.curves.PresetCurve({
|
|
16361
16361
|
type: 'short',
|
|
16362
16362
|
prime: null,
|
|
16363
16363
|
p: prime,
|
|
@@ -16521,7 +16521,6 @@ async function getStarkPublicKeyFromImx(ethAddress) {
|
|
|
16521
16521
|
return undefined;
|
|
16522
16522
|
}
|
|
16523
16523
|
|
|
16524
|
-
const { ec, curves } = pkg__namespace;
|
|
16525
16524
|
/*
|
|
16526
16525
|
Stark-friendly elliptic curve
|
|
16527
16526
|
|
|
@@ -16547,7 +16546,7 @@ https://docs.starkware.co/starkex-v4/crypto/stark-curve
|
|
|
16547
16546
|
*/
|
|
16548
16547
|
const starkEcOrder = new BN$2('08000000 00000010 ffffffff ffffffff b781126d cae7b232 1e66a241 adc64d2f', 16);
|
|
16549
16548
|
// eslint-disable-next-line new-cap
|
|
16550
|
-
new ec(new curves.PresetCurve({
|
|
16549
|
+
new elliptic.ec(new elliptic.curves.PresetCurve({
|
|
16551
16550
|
type: 'short',
|
|
16552
16551
|
prime: null,
|
|
16553
16552
|
p: '08000000 00000011 00000000 00000000 00000000 00000000 00000000 00000001',
|
|
@@ -17048,6 +17047,7 @@ class Workflows {
|
|
|
17048
17047
|
|
|
17049
17048
|
class IMXClient {
|
|
17050
17049
|
immutableX;
|
|
17050
|
+
imxConfig;
|
|
17051
17051
|
assetApi;
|
|
17052
17052
|
balanceApi;
|
|
17053
17053
|
collectionApi;
|
|
@@ -17068,8 +17068,8 @@ class IMXClient {
|
|
|
17068
17068
|
withdrawalsApi;
|
|
17069
17069
|
workflows;
|
|
17070
17070
|
constructor(config) {
|
|
17071
|
-
|
|
17072
|
-
this.immutableX = new ImxApiClients(imxConfig.immutableXConfig.apiConfiguration);
|
|
17071
|
+
this.imxConfig = new ImxConfiguration(config);
|
|
17072
|
+
this.immutableX = new ImxApiClients(this.imxConfig.immutableXConfig.apiConfiguration);
|
|
17073
17073
|
this.assetApi = this.immutableX.assetApi;
|
|
17074
17074
|
this.balanceApi = this.immutableX.balanceApi;
|
|
17075
17075
|
this.collectionApi = this.immutableX.collectionApi;
|
|
@@ -17088,7 +17088,7 @@ class IMXClient {
|
|
|
17088
17088
|
this.transfersApi = this.immutableX.transfersApi;
|
|
17089
17089
|
this.usersApi = this.immutableX.usersApi;
|
|
17090
17090
|
this.withdrawalsApi = this.immutableX.withdrawalsApi;
|
|
17091
|
-
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);
|
|
17092
17092
|
}
|
|
17093
17093
|
/**
|
|
17094
17094
|
* Get details of a Deposit with the given ID
|
|
@@ -45439,7 +45439,7 @@ const flattenProperties = (properties) => {
|
|
|
45439
45439
|
};
|
|
45440
45440
|
|
|
45441
45441
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
45442
|
-
const SDK_VERSION = '1.15.
|
|
45442
|
+
const SDK_VERSION = '1.15.5-alpha';
|
|
45443
45443
|
const getReferrer = () => {
|
|
45444
45444
|
if (isNode()) {
|
|
45445
45445
|
return '';
|
|
@@ -50619,7 +50619,7 @@ const IMMUTABLE_ZKVEM_GAS_OVERRIDES = {
|
|
|
50619
50619
|
maxPriorityFeePerGas: ethers.BigNumber.from(10e9),
|
|
50620
50620
|
};
|
|
50621
50621
|
|
|
50622
|
-
const SDK_VERSION_MARKER = '1.15.
|
|
50622
|
+
const SDK_VERSION_MARKER = '1.15.5-alpha';
|
|
50623
50623
|
// This SDK version is replaced by the `yarn build` command ran on the root level
|
|
50624
50624
|
const globalPackageVersion = () => SDK_VERSION_MARKER;
|
|
50625
50625
|
|
|
@@ -55848,7 +55848,9 @@ var x = /*#__PURE__*/Object.freeze({
|
|
|
55848
55848
|
createStarkSigner: createStarkSigner,
|
|
55849
55849
|
generateLegacyStarkPrivateKey: generateLegacyStarkPrivateKey,
|
|
55850
55850
|
generateStarkPrivateKey: generateStarkPrivateKey,
|
|
55851
|
-
imxClientConfig: imxClientConfig
|
|
55851
|
+
imxClientConfig: imxClientConfig,
|
|
55852
|
+
imxClientCreateStarkSigner: createStarkSigner,
|
|
55853
|
+
imxClientGenerateLegacyStarkPrivateKey: generateLegacyStarkPrivateKey
|
|
55852
55854
|
});
|
|
55853
55855
|
|
|
55854
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,8 +7,7 @@ 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 { ec as ec$1, curves as curves$1 } from 'elliptic';
|
|
10
|
+
import { ec, curves } from 'elliptic';
|
|
12
11
|
import { hdkey } from 'ethereumjs-wallet';
|
|
13
12
|
import assert from 'assert';
|
|
14
13
|
import { utils as utils$3, Contract as Contract$1, ContractFactory, BigNumber as BigNumber$1, errors, ethers, constants as constants$1, providers } from 'ethers';
|
|
@@ -160,7 +159,7 @@ const flattenProperties$1 = (properties) => {
|
|
|
160
159
|
};
|
|
161
160
|
|
|
162
161
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
163
|
-
const SDK_VERSION$1 = '1.15.
|
|
162
|
+
const SDK_VERSION$1 = '1.15.5-alpha';
|
|
164
163
|
const getReferrer$1 = () => {
|
|
165
164
|
if (isNode$1()) {
|
|
166
165
|
return '';
|
|
@@ -13536,7 +13535,7 @@ class MultiRollupApiClients {
|
|
|
13536
13535
|
}
|
|
13537
13536
|
|
|
13538
13537
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
13539
|
-
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' };
|
|
13540
13539
|
const createConfig$1 = ({ basePath, headers, }) => {
|
|
13541
13540
|
if (!basePath.trim()) {
|
|
13542
13541
|
throw Error('basePath can not be empty');
|
|
@@ -13608,7 +13607,7 @@ class APIError extends Error {
|
|
|
13608
13607
|
|
|
13609
13608
|
/* eslint-disable implicit-arrow-linebreak */
|
|
13610
13609
|
const defaultHeaders$1 = {
|
|
13611
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.15.
|
|
13610
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.15.5-alpha',
|
|
13612
13611
|
};
|
|
13613
13612
|
/**
|
|
13614
13613
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -14085,11 +14084,11 @@ var blockchain_data = /*#__PURE__*/Object.freeze({
|
|
|
14085
14084
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
14086
14085
|
class ApiConfiguration extends index$2.Configuration {
|
|
14087
14086
|
}
|
|
14088
|
-
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.15.
|
|
14087
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.15.5-alpha' };
|
|
14089
14088
|
/**
|
|
14090
14089
|
* @dev use createImmutableXConfiguration instead
|
|
14091
14090
|
*/
|
|
14092
|
-
const createConfig = ({ coreContractAddress, registrationContractAddress, chainID, basePath, headers, sdkVersion, }) => {
|
|
14091
|
+
const createConfig = ({ coreContractAddress, registrationContractAddress, chainID, basePath, headers, sdkVersion, baseConfig, }) => {
|
|
14093
14092
|
if (!basePath.trim()) {
|
|
14094
14093
|
throw Error('basePath can not be empty');
|
|
14095
14094
|
}
|
|
@@ -14097,7 +14096,11 @@ const createConfig = ({ coreContractAddress, registrationContractAddress, chainI
|
|
|
14097
14096
|
defaultHeaders['x-sdk-version'] = sdkVersion;
|
|
14098
14097
|
}
|
|
14099
14098
|
// eslint-disable-next-line no-param-reassign
|
|
14100
|
-
headers = {
|
|
14099
|
+
headers = {
|
|
14100
|
+
...(headers || {}),
|
|
14101
|
+
...(addKeysToHeadersOverride(baseConfig, { headers })?.headers || {}),
|
|
14102
|
+
...defaultHeaders,
|
|
14103
|
+
};
|
|
14101
14104
|
const apiConfigOptions = {
|
|
14102
14105
|
basePath,
|
|
14103
14106
|
baseOptions: { headers },
|
|
@@ -14115,30 +14118,27 @@ const createConfig = ({ coreContractAddress, registrationContractAddress, chainI
|
|
|
14115
14118
|
* createImmutableXConfiguration to create a custom ImmutableXConfiguration
|
|
14116
14119
|
* other than the production and sandbox defined below.
|
|
14117
14120
|
*/
|
|
14118
|
-
const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress, registrationContractAddress, }) => createConfig({
|
|
14121
|
+
const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress, registrationContractAddress, baseConfig, }) => createConfig({
|
|
14119
14122
|
basePath,
|
|
14120
14123
|
chainID,
|
|
14121
14124
|
coreContractAddress,
|
|
14122
14125
|
registrationContractAddress,
|
|
14123
|
-
sdkVersion: 'ts-immutable-sdk-1.15.
|
|
14126
|
+
sdkVersion: 'ts-immutable-sdk-1.15.5-alpha',
|
|
14127
|
+
baseConfig,
|
|
14124
14128
|
});
|
|
14125
|
-
|
|
14126
|
-
* Sets `sdkVersion` at the time of build
|
|
14127
|
-
*/
|
|
14128
|
-
const production = () => createImmutableXConfiguration({
|
|
14129
|
+
const production = ({ baseConfig }) => createImmutableXConfiguration({
|
|
14129
14130
|
basePath: 'https://api.x.immutable.com',
|
|
14130
14131
|
chainID: 1,
|
|
14131
14132
|
coreContractAddress: '0x5FDCCA53617f4d2b9134B29090C87D01058e27e9',
|
|
14132
14133
|
registrationContractAddress: '0x72a06bf2a1CE5e39cBA06c0CAb824960B587d64c',
|
|
14134
|
+
baseConfig,
|
|
14133
14135
|
});
|
|
14134
|
-
|
|
14135
|
-
* Sets `sdkVersion` at the time of build
|
|
14136
|
-
*/
|
|
14137
|
-
const sandbox = () => createImmutableXConfiguration({
|
|
14136
|
+
const sandbox = ({ baseConfig }) => createImmutableXConfiguration({
|
|
14138
14137
|
basePath: 'https://api.sandbox.x.immutable.com',
|
|
14139
14138
|
chainID: 11155111,
|
|
14140
14139
|
coreContractAddress: '0x2d5C349fD8464DA06a3f90b4B0E9195F3d1b7F98',
|
|
14141
14140
|
registrationContractAddress: '0xDbA6129C02E69405622fAdc3d5A7f8d23eac3b97',
|
|
14141
|
+
baseConfig,
|
|
14142
14142
|
});
|
|
14143
14143
|
class ImxConfiguration {
|
|
14144
14144
|
immutableXConfig;
|
|
@@ -14151,15 +14151,15 @@ class ImxConfiguration {
|
|
|
14151
14151
|
else {
|
|
14152
14152
|
switch (baseConfig.environment) {
|
|
14153
14153
|
case Environment$1.SANDBOX: {
|
|
14154
|
-
this.immutableXConfig = sandbox();
|
|
14154
|
+
this.immutableXConfig = sandbox({ baseConfig });
|
|
14155
14155
|
break;
|
|
14156
14156
|
}
|
|
14157
14157
|
case Environment$1.PRODUCTION: {
|
|
14158
|
-
this.immutableXConfig = production();
|
|
14158
|
+
this.immutableXConfig = production({ baseConfig });
|
|
14159
14159
|
break;
|
|
14160
14160
|
}
|
|
14161
14161
|
default: {
|
|
14162
|
-
this.immutableXConfig = sandbox();
|
|
14162
|
+
this.immutableXConfig = sandbox({ baseConfig });
|
|
14163
14163
|
}
|
|
14164
14164
|
}
|
|
14165
14165
|
}
|
|
@@ -14183,9 +14183,9 @@ const imxClientConfig = (configOptions) => {
|
|
|
14183
14183
|
if (Object.values(Environment$1).indexOf(configOptions.environment) === -1) {
|
|
14184
14184
|
throw new Error(`Invalid environment: ${configOptions.environment}`);
|
|
14185
14185
|
}
|
|
14186
|
-
const clientConfig =
|
|
14186
|
+
const clientConfig = {
|
|
14187
14187
|
baseConfig: new ImmutableConfiguration(configOptions),
|
|
14188
|
-
}
|
|
14188
|
+
};
|
|
14189
14189
|
return clientConfig;
|
|
14190
14190
|
};
|
|
14191
14191
|
|
|
@@ -16335,7 +16335,7 @@ const DEFAULT_ACCOUNT_APPLICATION = 'immutablex';
|
|
|
16335
16335
|
const DEFAULT_ACCOUNT_INDEX = '1';
|
|
16336
16336
|
const prime = new BN$2('800000000000011000000000000000000000000000000000000000000000001', 16);
|
|
16337
16337
|
const order = new BN$2('08000000 00000010 ffffffff ffffffff b781126d cae7b232 1e66a241 adc64d2f', 16);
|
|
16338
|
-
const starkEc = new ec
|
|
16338
|
+
const starkEc = new ec(new curves.PresetCurve({
|
|
16339
16339
|
type: 'short',
|
|
16340
16340
|
prime: null,
|
|
16341
16341
|
p: prime,
|
|
@@ -16499,7 +16499,6 @@ async function getStarkPublicKeyFromImx(ethAddress) {
|
|
|
16499
16499
|
return undefined;
|
|
16500
16500
|
}
|
|
16501
16501
|
|
|
16502
|
-
const { ec, curves } = pkg;
|
|
16503
16502
|
/*
|
|
16504
16503
|
Stark-friendly elliptic curve
|
|
16505
16504
|
|
|
@@ -17026,6 +17025,7 @@ class Workflows {
|
|
|
17026
17025
|
|
|
17027
17026
|
class IMXClient {
|
|
17028
17027
|
immutableX;
|
|
17028
|
+
imxConfig;
|
|
17029
17029
|
assetApi;
|
|
17030
17030
|
balanceApi;
|
|
17031
17031
|
collectionApi;
|
|
@@ -17046,8 +17046,8 @@ class IMXClient {
|
|
|
17046
17046
|
withdrawalsApi;
|
|
17047
17047
|
workflows;
|
|
17048
17048
|
constructor(config) {
|
|
17049
|
-
|
|
17050
|
-
this.immutableX = new ImxApiClients(imxConfig.immutableXConfig.apiConfiguration);
|
|
17049
|
+
this.imxConfig = new ImxConfiguration(config);
|
|
17050
|
+
this.immutableX = new ImxApiClients(this.imxConfig.immutableXConfig.apiConfiguration);
|
|
17051
17051
|
this.assetApi = this.immutableX.assetApi;
|
|
17052
17052
|
this.balanceApi = this.immutableX.balanceApi;
|
|
17053
17053
|
this.collectionApi = this.immutableX.collectionApi;
|
|
@@ -17066,7 +17066,7 @@ class IMXClient {
|
|
|
17066
17066
|
this.transfersApi = this.immutableX.transfersApi;
|
|
17067
17067
|
this.usersApi = this.immutableX.usersApi;
|
|
17068
17068
|
this.withdrawalsApi = this.immutableX.withdrawalsApi;
|
|
17069
|
-
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);
|
|
17070
17070
|
}
|
|
17071
17071
|
/**
|
|
17072
17072
|
* Get details of a Deposit with the given ID
|
|
@@ -45417,7 +45417,7 @@ const flattenProperties = (properties) => {
|
|
|
45417
45417
|
};
|
|
45418
45418
|
|
|
45419
45419
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
45420
|
-
const SDK_VERSION = '1.15.
|
|
45420
|
+
const SDK_VERSION = '1.15.5-alpha';
|
|
45421
45421
|
const getReferrer = () => {
|
|
45422
45422
|
if (isNode()) {
|
|
45423
45423
|
return '';
|
|
@@ -50597,7 +50597,7 @@ const IMMUTABLE_ZKVEM_GAS_OVERRIDES = {
|
|
|
50597
50597
|
maxPriorityFeePerGas: BigNumber$1.from(10e9),
|
|
50598
50598
|
};
|
|
50599
50599
|
|
|
50600
|
-
const SDK_VERSION_MARKER = '1.15.
|
|
50600
|
+
const SDK_VERSION_MARKER = '1.15.5-alpha';
|
|
50601
50601
|
// This SDK version is replaced by the `yarn build` command ran on the root level
|
|
50602
50602
|
const globalPackageVersion = () => SDK_VERSION_MARKER;
|
|
50603
50603
|
|
|
@@ -55826,7 +55826,9 @@ var x = /*#__PURE__*/Object.freeze({
|
|
|
55826
55826
|
createStarkSigner: createStarkSigner,
|
|
55827
55827
|
generateLegacyStarkPrivateKey: generateLegacyStarkPrivateKey,
|
|
55828
55828
|
generateStarkPrivateKey: generateStarkPrivateKey,
|
|
55829
|
-
imxClientConfig: imxClientConfig
|
|
55829
|
+
imxClientConfig: imxClientConfig,
|
|
55830
|
+
imxClientCreateStarkSigner: createStarkSigner,
|
|
55831
|
+
imxClientGenerateLegacyStarkPrivateKey: generateLegacyStarkPrivateKey
|
|
55830
55832
|
});
|
|
55831
55833
|
|
|
55832
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;
|