@imtbl/sdk 1.7.1 → 1.7.3-alpha.1
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 +493 -288
- package/dist/blockchain_data.js +152 -4
- package/dist/browser/checkout/sdk.js +7 -7
- package/dist/browser/checkout/widgets.js +63 -63
- package/dist/checkout.d.ts +11 -0
- package/dist/checkout.js +157 -8
- package/dist/config.js +4 -3
- package/dist/index.browser.js +13 -13
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +177 -13
- package/dist/index.d.ts +489 -273
- package/dist/index.js +177 -13
- package/dist/orderbook.js +4 -3
- package/dist/passport.js +151 -8
- package/dist/x.js +5 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -120,7 +120,7 @@ const storeDetail$1 = (key, value) => {
|
|
|
120
120
|
};
|
|
121
121
|
setItem$1(Store$1.RUNTIME, RUNTIME_DETAILS$1);
|
|
122
122
|
};
|
|
123
|
-
const getDetail$1 = (key) => {
|
|
123
|
+
const getDetail$1$1 = (key) => {
|
|
124
124
|
// Handle the scenario where detail is a falsy value
|
|
125
125
|
if (RUNTIME_DETAILS$1[key] === undefined) {
|
|
126
126
|
return undefined;
|
|
@@ -152,7 +152,7 @@ const flattenProperties$1 = (properties) => {
|
|
|
152
152
|
};
|
|
153
153
|
|
|
154
154
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
155
|
-
const SDK_VERSION$1 = '1.7.1';
|
|
155
|
+
const SDK_VERSION$1 = '1.7.3-alpha.1';
|
|
156
156
|
const getReferrer$1 = () => {
|
|
157
157
|
if (isNode$1()) {
|
|
158
158
|
return '';
|
|
@@ -195,7 +195,7 @@ const initialise$2 = async () => {
|
|
|
195
195
|
initialised$1 = true;
|
|
196
196
|
try {
|
|
197
197
|
const runtimeDetails = flattenProperties$1(getRuntimeDetails$1());
|
|
198
|
-
const existingRuntimeId = getDetail$1(Detail$1.RUNTIME_ID);
|
|
198
|
+
const existingRuntimeId = getDetail$1$1(Detail$1.RUNTIME_ID);
|
|
199
199
|
const body = {
|
|
200
200
|
version: 1,
|
|
201
201
|
data: {
|
|
@@ -348,6 +348,7 @@ const setPublishableApiKeyFn$1 = (publishableApiKey) => {
|
|
|
348
348
|
storeDetail$1(Detail$1.PUBLISHABLE_API_KEY, publishableApiKey);
|
|
349
349
|
};
|
|
350
350
|
const setPublishableApiKey = errorBoundary$1(getGlobalisedValue$2('setPublishableApiKey', setPublishableApiKeyFn$1));
|
|
351
|
+
const getDetail = errorBoundary$1(getGlobalisedValue$2('getDetail', getDetail$1$1));
|
|
351
352
|
|
|
352
353
|
var Environment$1;
|
|
353
354
|
(function (Environment) {
|
|
@@ -8418,6 +8419,85 @@ class NftOwnersApi extends BaseAPI$2 {
|
|
|
8418
8419
|
*/
|
|
8419
8420
|
const NftsApiAxiosParamCreator = function (configuration) {
|
|
8420
8421
|
return {
|
|
8422
|
+
/**
|
|
8423
|
+
* Create a mint request to mint a set of NFTs for a given collection
|
|
8424
|
+
* @summary Mint NFTs
|
|
8425
|
+
* @param {string} contractAddress The address of contract
|
|
8426
|
+
* @param {string} chainName The name of chain
|
|
8427
|
+
* @param {CreateMintRequestRequest} createMintRequestRequest the request body
|
|
8428
|
+
* @param {*} [options] Override http request option.
|
|
8429
|
+
* @throws {RequiredError}
|
|
8430
|
+
*/
|
|
8431
|
+
createMintRequest: async (contractAddress, chainName, createMintRequestRequest, options = {}) => {
|
|
8432
|
+
// verify required parameter 'contractAddress' is not null or undefined
|
|
8433
|
+
assertParamExists$2('createMintRequest', 'contractAddress', contractAddress);
|
|
8434
|
+
// verify required parameter 'chainName' is not null or undefined
|
|
8435
|
+
assertParamExists$2('createMintRequest', 'chainName', chainName);
|
|
8436
|
+
// verify required parameter 'createMintRequestRequest' is not null or undefined
|
|
8437
|
+
assertParamExists$2('createMintRequest', 'createMintRequestRequest', createMintRequestRequest);
|
|
8438
|
+
const localVarPath = `/v1/chains/{chain_name}/collections/{contract_address}/nfts/mint-requests`
|
|
8439
|
+
.replace(`{${"contract_address"}}`, encodeURIComponent(String(contractAddress)))
|
|
8440
|
+
.replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
|
|
8441
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
8442
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL$2);
|
|
8443
|
+
let baseOptions;
|
|
8444
|
+
if (configuration) {
|
|
8445
|
+
baseOptions = configuration.baseOptions;
|
|
8446
|
+
}
|
|
8447
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
|
|
8448
|
+
const localVarHeaderParameter = {};
|
|
8449
|
+
const localVarQueryParameter = {};
|
|
8450
|
+
// authentication ImmutableApiKey required
|
|
8451
|
+
await setApiKeyToObject(localVarHeaderParameter, "x-immutable-api-key", configuration);
|
|
8452
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
8453
|
+
setSearchParams$2(localVarUrlObj, localVarQueryParameter);
|
|
8454
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
8455
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
8456
|
+
localVarRequestOptions.data = serializeDataIfNeeded$2(createMintRequestRequest, localVarRequestOptions, configuration);
|
|
8457
|
+
return {
|
|
8458
|
+
url: toPathString$2(localVarUrlObj),
|
|
8459
|
+
options: localVarRequestOptions,
|
|
8460
|
+
};
|
|
8461
|
+
},
|
|
8462
|
+
/**
|
|
8463
|
+
* Retrieve the status of a mint request identified by its reference_id
|
|
8464
|
+
* @summary Mint NFTs
|
|
8465
|
+
* @param {string} contractAddress The address of contract
|
|
8466
|
+
* @param {string} chainName The name of chain
|
|
8467
|
+
* @param {string} referenceId The ID of the mint request
|
|
8468
|
+
* @param {*} [options] Override http request option.
|
|
8469
|
+
* @throws {RequiredError}
|
|
8470
|
+
*/
|
|
8471
|
+
getMintRequest: async (contractAddress, chainName, referenceId, options = {}) => {
|
|
8472
|
+
// verify required parameter 'contractAddress' is not null or undefined
|
|
8473
|
+
assertParamExists$2('getMintRequest', 'contractAddress', contractAddress);
|
|
8474
|
+
// verify required parameter 'chainName' is not null or undefined
|
|
8475
|
+
assertParamExists$2('getMintRequest', 'chainName', chainName);
|
|
8476
|
+
// verify required parameter 'referenceId' is not null or undefined
|
|
8477
|
+
assertParamExists$2('getMintRequest', 'referenceId', referenceId);
|
|
8478
|
+
const localVarPath = `/v1/chains/{chain_name}/collections/{contract_address}/nfts/mint-requests/{reference_id}`
|
|
8479
|
+
.replace(`{${"contract_address"}}`, encodeURIComponent(String(contractAddress)))
|
|
8480
|
+
.replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)))
|
|
8481
|
+
.replace(`{${"reference_id"}}`, encodeURIComponent(String(referenceId)));
|
|
8482
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
8483
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL$2);
|
|
8484
|
+
let baseOptions;
|
|
8485
|
+
if (configuration) {
|
|
8486
|
+
baseOptions = configuration.baseOptions;
|
|
8487
|
+
}
|
|
8488
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
|
|
8489
|
+
const localVarHeaderParameter = {};
|
|
8490
|
+
const localVarQueryParameter = {};
|
|
8491
|
+
// authentication ImmutableApiKey required
|
|
8492
|
+
await setApiKeyToObject(localVarHeaderParameter, "x-immutable-api-key", configuration);
|
|
8493
|
+
setSearchParams$2(localVarUrlObj, localVarQueryParameter);
|
|
8494
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
8495
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
8496
|
+
return {
|
|
8497
|
+
url: toPathString$2(localVarUrlObj),
|
|
8498
|
+
options: localVarRequestOptions,
|
|
8499
|
+
};
|
|
8500
|
+
},
|
|
8421
8501
|
/**
|
|
8422
8502
|
* Get NFT by token ID
|
|
8423
8503
|
* @summary Get NFT by token ID
|
|
@@ -8603,6 +8683,32 @@ const NftsApiAxiosParamCreator = function (configuration) {
|
|
|
8603
8683
|
const NftsApiFp = function (configuration) {
|
|
8604
8684
|
const localVarAxiosParamCreator = NftsApiAxiosParamCreator(configuration);
|
|
8605
8685
|
return {
|
|
8686
|
+
/**
|
|
8687
|
+
* Create a mint request to mint a set of NFTs for a given collection
|
|
8688
|
+
* @summary Mint NFTs
|
|
8689
|
+
* @param {string} contractAddress The address of contract
|
|
8690
|
+
* @param {string} chainName The name of chain
|
|
8691
|
+
* @param {CreateMintRequestRequest} createMintRequestRequest the request body
|
|
8692
|
+
* @param {*} [options] Override http request option.
|
|
8693
|
+
* @throws {RequiredError}
|
|
8694
|
+
*/
|
|
8695
|
+
async createMintRequest(contractAddress, chainName, createMintRequestRequest, options) {
|
|
8696
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.createMintRequest(contractAddress, chainName, createMintRequestRequest, options);
|
|
8697
|
+
return createRequestFunction$2(localVarAxiosArgs, globalAxios$1, BASE_PATH$2, configuration);
|
|
8698
|
+
},
|
|
8699
|
+
/**
|
|
8700
|
+
* Retrieve the status of a mint request identified by its reference_id
|
|
8701
|
+
* @summary Mint NFTs
|
|
8702
|
+
* @param {string} contractAddress The address of contract
|
|
8703
|
+
* @param {string} chainName The name of chain
|
|
8704
|
+
* @param {string} referenceId The ID of the mint request
|
|
8705
|
+
* @param {*} [options] Override http request option.
|
|
8706
|
+
* @throws {RequiredError}
|
|
8707
|
+
*/
|
|
8708
|
+
async getMintRequest(contractAddress, chainName, referenceId, options) {
|
|
8709
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getMintRequest(contractAddress, chainName, referenceId, options);
|
|
8710
|
+
return createRequestFunction$2(localVarAxiosArgs, globalAxios$1, BASE_PATH$2, configuration);
|
|
8711
|
+
},
|
|
8606
8712
|
/**
|
|
8607
8713
|
* Get NFT by token ID
|
|
8608
8714
|
* @summary Get NFT by token ID
|
|
@@ -8670,6 +8776,26 @@ const NftsApiFp = function (configuration) {
|
|
|
8670
8776
|
const NftsApiFactory = function (configuration, basePath, axios) {
|
|
8671
8777
|
const localVarFp = NftsApiFp(configuration);
|
|
8672
8778
|
return {
|
|
8779
|
+
/**
|
|
8780
|
+
* Create a mint request to mint a set of NFTs for a given collection
|
|
8781
|
+
* @summary Mint NFTs
|
|
8782
|
+
* @param {NftsApiCreateMintRequestRequest} requestParameters Request parameters.
|
|
8783
|
+
* @param {*} [options] Override http request option.
|
|
8784
|
+
* @throws {RequiredError}
|
|
8785
|
+
*/
|
|
8786
|
+
createMintRequest(requestParameters, options) {
|
|
8787
|
+
return localVarFp.createMintRequest(requestParameters.contractAddress, requestParameters.chainName, requestParameters.createMintRequestRequest, options).then((request) => request(axios, basePath));
|
|
8788
|
+
},
|
|
8789
|
+
/**
|
|
8790
|
+
* Retrieve the status of a mint request identified by its reference_id
|
|
8791
|
+
* @summary Mint NFTs
|
|
8792
|
+
* @param {NftsApiGetMintRequestRequest} requestParameters Request parameters.
|
|
8793
|
+
* @param {*} [options] Override http request option.
|
|
8794
|
+
* @throws {RequiredError}
|
|
8795
|
+
*/
|
|
8796
|
+
getMintRequest(requestParameters, options) {
|
|
8797
|
+
return localVarFp.getMintRequest(requestParameters.contractAddress, requestParameters.chainName, requestParameters.referenceId, options).then((request) => request(axios, basePath));
|
|
8798
|
+
},
|
|
8673
8799
|
/**
|
|
8674
8800
|
* Get NFT by token ID
|
|
8675
8801
|
* @summary Get NFT by token ID
|
|
@@ -8719,6 +8845,28 @@ const NftsApiFactory = function (configuration, basePath, axios) {
|
|
|
8719
8845
|
* @extends {BaseAPI}
|
|
8720
8846
|
*/
|
|
8721
8847
|
class NftsApi extends BaseAPI$2 {
|
|
8848
|
+
/**
|
|
8849
|
+
* Create a mint request to mint a set of NFTs for a given collection
|
|
8850
|
+
* @summary Mint NFTs
|
|
8851
|
+
* @param {NftsApiCreateMintRequestRequest} requestParameters Request parameters.
|
|
8852
|
+
* @param {*} [options] Override http request option.
|
|
8853
|
+
* @throws {RequiredError}
|
|
8854
|
+
* @memberof NftsApi
|
|
8855
|
+
*/
|
|
8856
|
+
createMintRequest(requestParameters, options) {
|
|
8857
|
+
return NftsApiFp(this.configuration).createMintRequest(requestParameters.contractAddress, requestParameters.chainName, requestParameters.createMintRequestRequest, options).then((request) => request(this.axios, this.basePath));
|
|
8858
|
+
}
|
|
8859
|
+
/**
|
|
8860
|
+
* Retrieve the status of a mint request identified by its reference_id
|
|
8861
|
+
* @summary Mint NFTs
|
|
8862
|
+
* @param {NftsApiGetMintRequestRequest} requestParameters Request parameters.
|
|
8863
|
+
* @param {*} [options] Override http request option.
|
|
8864
|
+
* @throws {RequiredError}
|
|
8865
|
+
* @memberof NftsApi
|
|
8866
|
+
*/
|
|
8867
|
+
getMintRequest(requestParameters, options) {
|
|
8868
|
+
return NftsApiFp(this.configuration).getMintRequest(requestParameters.contractAddress, requestParameters.chainName, requestParameters.referenceId, options).then((request) => request(this.axios, this.basePath));
|
|
8869
|
+
}
|
|
8722
8870
|
/**
|
|
8723
8871
|
* Get NFT by token ID
|
|
8724
8872
|
* @summary Get NFT by token ID
|
|
@@ -11275,7 +11423,7 @@ class MultiRollupApiClients {
|
|
|
11275
11423
|
}
|
|
11276
11424
|
|
|
11277
11425
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
11278
|
-
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-1.7.1' };
|
|
11426
|
+
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-1.7.3-alpha.1' };
|
|
11279
11427
|
const createConfig = ({ basePath, headers, }) => {
|
|
11280
11428
|
if (!basePath.trim()) {
|
|
11281
11429
|
throw Error('basePath can not be empty');
|
|
@@ -11347,7 +11495,7 @@ class APIError extends Error {
|
|
|
11347
11495
|
|
|
11348
11496
|
/* eslint-disable implicit-arrow-linebreak */
|
|
11349
11497
|
const defaultHeaders = {
|
|
11350
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.7.1',
|
|
11498
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.7.3-alpha.1',
|
|
11351
11499
|
};
|
|
11352
11500
|
/**
|
|
11353
11501
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -11780,7 +11928,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
11780
11928
|
chainID,
|
|
11781
11929
|
coreContractAddress,
|
|
11782
11930
|
registrationContractAddress,
|
|
11783
|
-
sdkVersion: 'ts-immutable-sdk-1.7.1',
|
|
11931
|
+
sdkVersion: 'ts-immutable-sdk-1.7.3-alpha.1',
|
|
11784
11932
|
});
|
|
11785
11933
|
/**
|
|
11786
11934
|
* Sets `sdkVersion` at the time of build
|
|
@@ -16514,10 +16662,20 @@ class AuthManager {
|
|
|
16514
16662
|
},
|
|
16515
16663
|
});
|
|
16516
16664
|
};
|
|
16517
|
-
|
|
16665
|
+
/**
|
|
16666
|
+
* login
|
|
16667
|
+
* @param anonymousId Caller can pass an anonymousId if they want to associate their user's identity with immutable's internal instrumentation.
|
|
16668
|
+
*/
|
|
16669
|
+
async login(anonymousId) {
|
|
16518
16670
|
return withPassportError(async () => {
|
|
16671
|
+
const rid = getDetail(Detail$1.RUNTIME_ID);
|
|
16519
16672
|
const popupWindowFeatures = { width: 410, height: 450 };
|
|
16520
16673
|
const oidcUser = await this.userManager.signinPopup({
|
|
16674
|
+
extraQueryParams: {
|
|
16675
|
+
...(this.userManager.settings?.extraQueryParams ?? {}),
|
|
16676
|
+
rid: rid || '',
|
|
16677
|
+
third_party_a_id: anonymousId || '',
|
|
16678
|
+
},
|
|
16521
16679
|
popupWindowFeatures,
|
|
16522
16680
|
});
|
|
16523
16681
|
return AuthManager.mapOidcUserToDomainModel(oidcUser);
|
|
@@ -16537,17 +16695,22 @@ class AuthManager {
|
|
|
16537
16695
|
async loginCallback() {
|
|
16538
16696
|
return withPassportError(async () => this.userManager.signinPopupCallback(), PassportErrorType.AUTHENTICATION_ERROR);
|
|
16539
16697
|
}
|
|
16540
|
-
|
|
16698
|
+
/**
|
|
16699
|
+
* loginWithDeviceFlow
|
|
16700
|
+
* @param anonymousId Caller can pass an anonymousId if they want to associate their user's identity with immutable's internal instrumentation.
|
|
16701
|
+
*/
|
|
16702
|
+
async loginWithDeviceFlow(anonymousId) {
|
|
16541
16703
|
return withPassportError(async () => {
|
|
16542
16704
|
const response = await globalAxios$1.post(`${this.config.authenticationDomain}/oauth/device/code`, {
|
|
16543
16705
|
client_id: this.config.oidcConfiguration.clientId,
|
|
16544
16706
|
scope: this.config.oidcConfiguration.scope,
|
|
16545
16707
|
audience: this.config.oidcConfiguration.audience,
|
|
16546
16708
|
}, formUrlEncodedHeader);
|
|
16709
|
+
const rid = getDetail(Detail$1.RUNTIME_ID);
|
|
16547
16710
|
return {
|
|
16548
16711
|
code: response.data.user_code,
|
|
16549
16712
|
deviceCode: response.data.device_code,
|
|
16550
|
-
url: response.data.verification_uri_complete
|
|
16713
|
+
url: `${response.data.verification_uri_complete}${rid ? `&rid=${rid}` : ''}${anonymousId ? `&third_party_a_id=${anonymousId}` : ''}`,
|
|
16551
16714
|
interval: response.data.interval,
|
|
16552
16715
|
};
|
|
16553
16716
|
}, PassportErrorType.AUTHENTICATION_ERROR);
|
|
@@ -37384,7 +37547,7 @@ const storeDetail = (key, value) => {
|
|
|
37384
37547
|
};
|
|
37385
37548
|
setItem(Store.RUNTIME, RUNTIME_DETAILS);
|
|
37386
37549
|
};
|
|
37387
|
-
const getDetail = (key) => {
|
|
37550
|
+
const getDetail$1 = (key) => {
|
|
37388
37551
|
// Handle the scenario where detail is a falsy value
|
|
37389
37552
|
if (RUNTIME_DETAILS[key] === undefined) {
|
|
37390
37553
|
return undefined;
|
|
@@ -37416,7 +37579,7 @@ const flattenProperties = (properties) => {
|
|
|
37416
37579
|
};
|
|
37417
37580
|
|
|
37418
37581
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
37419
|
-
const SDK_VERSION = '1.7.1';
|
|
37582
|
+
const SDK_VERSION = '1.7.3-alpha.1';
|
|
37420
37583
|
const getReferrer = () => {
|
|
37421
37584
|
if (isNode()) {
|
|
37422
37585
|
return '';
|
|
@@ -37459,7 +37622,7 @@ const initialise = async () => {
|
|
|
37459
37622
|
initialised = true;
|
|
37460
37623
|
try {
|
|
37461
37624
|
const runtimeDetails = flattenProperties(getRuntimeDetails());
|
|
37462
|
-
const existingRuntimeId = getDetail(Detail.RUNTIME_ID);
|
|
37625
|
+
const existingRuntimeId = getDetail$1(Detail.RUNTIME_ID);
|
|
37463
37626
|
const body = {
|
|
37464
37627
|
version: 1,
|
|
37465
37628
|
data: {
|
|
@@ -37591,6 +37754,7 @@ const setPublishableApiKeyFn = (publishableApiKey) => {
|
|
|
37591
37754
|
storeDetail(Detail.PUBLISHABLE_API_KEY, publishableApiKey);
|
|
37592
37755
|
};
|
|
37593
37756
|
errorBoundary(getGlobalisedValue('setPublishableApiKey', setPublishableApiKeyFn));
|
|
37757
|
+
errorBoundary(getGlobalisedValue('getDetail', getDetail$1));
|
|
37594
37758
|
|
|
37595
37759
|
var Environment;
|
|
37596
37760
|
(function (Environment) {
|
|
@@ -42583,7 +42747,7 @@ const IMMUTABLE_ZKVEM_GAS_OVERRIDES = {
|
|
|
42583
42747
|
maxPriorityFeePerGas: BigNumber$1.from(10e9),
|
|
42584
42748
|
};
|
|
42585
42749
|
|
|
42586
|
-
const SDK_VERSION_MARKER = '1.7.1';
|
|
42750
|
+
const SDK_VERSION_MARKER = '1.7.3-alpha.1';
|
|
42587
42751
|
// This SDK version is replaced by the `yarn build` command ran on the root level
|
|
42588
42752
|
const globalPackageVersion = () => SDK_VERSION_MARKER;
|
|
42589
42753
|
|
package/dist/orderbook.js
CHANGED
|
@@ -99,7 +99,7 @@ const storeDetail = (key, value) => {
|
|
|
99
99
|
};
|
|
100
100
|
setItem(Store.RUNTIME, RUNTIME_DETAILS);
|
|
101
101
|
};
|
|
102
|
-
const getDetail = (key) => {
|
|
102
|
+
const getDetail$1 = (key) => {
|
|
103
103
|
// Handle the scenario where detail is a falsy value
|
|
104
104
|
if (RUNTIME_DETAILS[key] === undefined) {
|
|
105
105
|
return undefined;
|
|
@@ -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.7.1';
|
|
134
|
+
const SDK_VERSION = '1.7.3-alpha.1';
|
|
135
135
|
const getReferrer = () => {
|
|
136
136
|
if (isNode()) {
|
|
137
137
|
return '';
|
|
@@ -174,7 +174,7 @@ const initialise = async () => {
|
|
|
174
174
|
initialised = true;
|
|
175
175
|
try {
|
|
176
176
|
const runtimeDetails = flattenProperties(getRuntimeDetails());
|
|
177
|
-
const existingRuntimeId = getDetail(Detail.RUNTIME_ID);
|
|
177
|
+
const existingRuntimeId = getDetail$1(Detail.RUNTIME_ID);
|
|
178
178
|
const body = {
|
|
179
179
|
version: 1,
|
|
180
180
|
data: {
|
|
@@ -306,6 +306,7 @@ const setPublishableApiKeyFn = (publishableApiKey) => {
|
|
|
306
306
|
storeDetail(Detail.PUBLISHABLE_API_KEY, publishableApiKey);
|
|
307
307
|
};
|
|
308
308
|
errorBoundary(getGlobalisedValue('setPublishableApiKey', setPublishableApiKeyFn));
|
|
309
|
+
errorBoundary(getGlobalisedValue('getDetail', getDetail$1));
|
|
309
310
|
|
|
310
311
|
var Environment;
|
|
311
312
|
(function (Environment) {
|
package/dist/passport.js
CHANGED
|
@@ -7465,6 +7465,85 @@ class NftOwnersApi extends BaseAPI$2 {
|
|
|
7465
7465
|
*/
|
|
7466
7466
|
const NftsApiAxiosParamCreator = function (configuration) {
|
|
7467
7467
|
return {
|
|
7468
|
+
/**
|
|
7469
|
+
* Create a mint request to mint a set of NFTs for a given collection
|
|
7470
|
+
* @summary Mint NFTs
|
|
7471
|
+
* @param {string} contractAddress The address of contract
|
|
7472
|
+
* @param {string} chainName The name of chain
|
|
7473
|
+
* @param {CreateMintRequestRequest} createMintRequestRequest the request body
|
|
7474
|
+
* @param {*} [options] Override http request option.
|
|
7475
|
+
* @throws {RequiredError}
|
|
7476
|
+
*/
|
|
7477
|
+
createMintRequest: async (contractAddress, chainName, createMintRequestRequest, options = {}) => {
|
|
7478
|
+
// verify required parameter 'contractAddress' is not null or undefined
|
|
7479
|
+
assertParamExists$2('createMintRequest', 'contractAddress', contractAddress);
|
|
7480
|
+
// verify required parameter 'chainName' is not null or undefined
|
|
7481
|
+
assertParamExists$2('createMintRequest', 'chainName', chainName);
|
|
7482
|
+
// verify required parameter 'createMintRequestRequest' is not null or undefined
|
|
7483
|
+
assertParamExists$2('createMintRequest', 'createMintRequestRequest', createMintRequestRequest);
|
|
7484
|
+
const localVarPath = `/v1/chains/{chain_name}/collections/{contract_address}/nfts/mint-requests`
|
|
7485
|
+
.replace(`{${"contract_address"}}`, encodeURIComponent(String(contractAddress)))
|
|
7486
|
+
.replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
|
|
7487
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
7488
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL$2);
|
|
7489
|
+
let baseOptions;
|
|
7490
|
+
if (configuration) {
|
|
7491
|
+
baseOptions = configuration.baseOptions;
|
|
7492
|
+
}
|
|
7493
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
|
|
7494
|
+
const localVarHeaderParameter = {};
|
|
7495
|
+
const localVarQueryParameter = {};
|
|
7496
|
+
// authentication ImmutableApiKey required
|
|
7497
|
+
await setApiKeyToObject(localVarHeaderParameter, "x-immutable-api-key", configuration);
|
|
7498
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
7499
|
+
setSearchParams$2(localVarUrlObj, localVarQueryParameter);
|
|
7500
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
7501
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
7502
|
+
localVarRequestOptions.data = serializeDataIfNeeded$2(createMintRequestRequest, localVarRequestOptions, configuration);
|
|
7503
|
+
return {
|
|
7504
|
+
url: toPathString$2(localVarUrlObj),
|
|
7505
|
+
options: localVarRequestOptions,
|
|
7506
|
+
};
|
|
7507
|
+
},
|
|
7508
|
+
/**
|
|
7509
|
+
* Retrieve the status of a mint request identified by its reference_id
|
|
7510
|
+
* @summary Mint NFTs
|
|
7511
|
+
* @param {string} contractAddress The address of contract
|
|
7512
|
+
* @param {string} chainName The name of chain
|
|
7513
|
+
* @param {string} referenceId The ID of the mint request
|
|
7514
|
+
* @param {*} [options] Override http request option.
|
|
7515
|
+
* @throws {RequiredError}
|
|
7516
|
+
*/
|
|
7517
|
+
getMintRequest: async (contractAddress, chainName, referenceId, options = {}) => {
|
|
7518
|
+
// verify required parameter 'contractAddress' is not null or undefined
|
|
7519
|
+
assertParamExists$2('getMintRequest', 'contractAddress', contractAddress);
|
|
7520
|
+
// verify required parameter 'chainName' is not null or undefined
|
|
7521
|
+
assertParamExists$2('getMintRequest', 'chainName', chainName);
|
|
7522
|
+
// verify required parameter 'referenceId' is not null or undefined
|
|
7523
|
+
assertParamExists$2('getMintRequest', 'referenceId', referenceId);
|
|
7524
|
+
const localVarPath = `/v1/chains/{chain_name}/collections/{contract_address}/nfts/mint-requests/{reference_id}`
|
|
7525
|
+
.replace(`{${"contract_address"}}`, encodeURIComponent(String(contractAddress)))
|
|
7526
|
+
.replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)))
|
|
7527
|
+
.replace(`{${"reference_id"}}`, encodeURIComponent(String(referenceId)));
|
|
7528
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
7529
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL$2);
|
|
7530
|
+
let baseOptions;
|
|
7531
|
+
if (configuration) {
|
|
7532
|
+
baseOptions = configuration.baseOptions;
|
|
7533
|
+
}
|
|
7534
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
|
|
7535
|
+
const localVarHeaderParameter = {};
|
|
7536
|
+
const localVarQueryParameter = {};
|
|
7537
|
+
// authentication ImmutableApiKey required
|
|
7538
|
+
await setApiKeyToObject(localVarHeaderParameter, "x-immutable-api-key", configuration);
|
|
7539
|
+
setSearchParams$2(localVarUrlObj, localVarQueryParameter);
|
|
7540
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
7541
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
7542
|
+
return {
|
|
7543
|
+
url: toPathString$2(localVarUrlObj),
|
|
7544
|
+
options: localVarRequestOptions,
|
|
7545
|
+
};
|
|
7546
|
+
},
|
|
7468
7547
|
/**
|
|
7469
7548
|
* Get NFT by token ID
|
|
7470
7549
|
* @summary Get NFT by token ID
|
|
@@ -7650,6 +7729,32 @@ const NftsApiAxiosParamCreator = function (configuration) {
|
|
|
7650
7729
|
const NftsApiFp = function (configuration) {
|
|
7651
7730
|
const localVarAxiosParamCreator = NftsApiAxiosParamCreator(configuration);
|
|
7652
7731
|
return {
|
|
7732
|
+
/**
|
|
7733
|
+
* Create a mint request to mint a set of NFTs for a given collection
|
|
7734
|
+
* @summary Mint NFTs
|
|
7735
|
+
* @param {string} contractAddress The address of contract
|
|
7736
|
+
* @param {string} chainName The name of chain
|
|
7737
|
+
* @param {CreateMintRequestRequest} createMintRequestRequest the request body
|
|
7738
|
+
* @param {*} [options] Override http request option.
|
|
7739
|
+
* @throws {RequiredError}
|
|
7740
|
+
*/
|
|
7741
|
+
async createMintRequest(contractAddress, chainName, createMintRequestRequest, options) {
|
|
7742
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.createMintRequest(contractAddress, chainName, createMintRequestRequest, options);
|
|
7743
|
+
return createRequestFunction$2(localVarAxiosArgs, globalAxios$1, BASE_PATH$2, configuration);
|
|
7744
|
+
},
|
|
7745
|
+
/**
|
|
7746
|
+
* Retrieve the status of a mint request identified by its reference_id
|
|
7747
|
+
* @summary Mint NFTs
|
|
7748
|
+
* @param {string} contractAddress The address of contract
|
|
7749
|
+
* @param {string} chainName The name of chain
|
|
7750
|
+
* @param {string} referenceId The ID of the mint request
|
|
7751
|
+
* @param {*} [options] Override http request option.
|
|
7752
|
+
* @throws {RequiredError}
|
|
7753
|
+
*/
|
|
7754
|
+
async getMintRequest(contractAddress, chainName, referenceId, options) {
|
|
7755
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getMintRequest(contractAddress, chainName, referenceId, options);
|
|
7756
|
+
return createRequestFunction$2(localVarAxiosArgs, globalAxios$1, BASE_PATH$2, configuration);
|
|
7757
|
+
},
|
|
7653
7758
|
/**
|
|
7654
7759
|
* Get NFT by token ID
|
|
7655
7760
|
* @summary Get NFT by token ID
|
|
@@ -7717,6 +7822,28 @@ const NftsApiFp = function (configuration) {
|
|
|
7717
7822
|
* @extends {BaseAPI}
|
|
7718
7823
|
*/
|
|
7719
7824
|
class NftsApi extends BaseAPI$2 {
|
|
7825
|
+
/**
|
|
7826
|
+
* Create a mint request to mint a set of NFTs for a given collection
|
|
7827
|
+
* @summary Mint NFTs
|
|
7828
|
+
* @param {NftsApiCreateMintRequestRequest} requestParameters Request parameters.
|
|
7829
|
+
* @param {*} [options] Override http request option.
|
|
7830
|
+
* @throws {RequiredError}
|
|
7831
|
+
* @memberof NftsApi
|
|
7832
|
+
*/
|
|
7833
|
+
createMintRequest(requestParameters, options) {
|
|
7834
|
+
return NftsApiFp(this.configuration).createMintRequest(requestParameters.contractAddress, requestParameters.chainName, requestParameters.createMintRequestRequest, options).then((request) => request(this.axios, this.basePath));
|
|
7835
|
+
}
|
|
7836
|
+
/**
|
|
7837
|
+
* Retrieve the status of a mint request identified by its reference_id
|
|
7838
|
+
* @summary Mint NFTs
|
|
7839
|
+
* @param {NftsApiGetMintRequestRequest} requestParameters Request parameters.
|
|
7840
|
+
* @param {*} [options] Override http request option.
|
|
7841
|
+
* @throws {RequiredError}
|
|
7842
|
+
* @memberof NftsApi
|
|
7843
|
+
*/
|
|
7844
|
+
getMintRequest(requestParameters, options) {
|
|
7845
|
+
return NftsApiFp(this.configuration).getMintRequest(requestParameters.contractAddress, requestParameters.chainName, requestParameters.referenceId, options).then((request) => request(this.axios, this.basePath));
|
|
7846
|
+
}
|
|
7720
7847
|
/**
|
|
7721
7848
|
* Get NFT by token ID
|
|
7722
7849
|
* @summary Get NFT by token ID
|
|
@@ -9146,7 +9273,7 @@ class MultiRollupApiClients {
|
|
|
9146
9273
|
}
|
|
9147
9274
|
|
|
9148
9275
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
9149
|
-
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.7.1' };
|
|
9276
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.7.3-alpha.1' };
|
|
9150
9277
|
const createConfig = ({ basePath, headers, }) => {
|
|
9151
9278
|
if (!basePath.trim()) {
|
|
9152
9279
|
throw Error('basePath can not be empty');
|
|
@@ -9293,7 +9420,7 @@ const storeDetail = (key, value) => {
|
|
|
9293
9420
|
};
|
|
9294
9421
|
setItem(Store.RUNTIME, RUNTIME_DETAILS);
|
|
9295
9422
|
};
|
|
9296
|
-
const getDetail = (key) => {
|
|
9423
|
+
const getDetail$1 = (key) => {
|
|
9297
9424
|
// Handle the scenario where detail is a falsy value
|
|
9298
9425
|
if (RUNTIME_DETAILS[key] === undefined) {
|
|
9299
9426
|
return undefined;
|
|
@@ -9325,7 +9452,7 @@ const flattenProperties = (properties) => {
|
|
|
9325
9452
|
};
|
|
9326
9453
|
|
|
9327
9454
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
9328
|
-
const SDK_VERSION = '1.7.1';
|
|
9455
|
+
const SDK_VERSION = '1.7.3-alpha.1';
|
|
9329
9456
|
const getReferrer = () => {
|
|
9330
9457
|
if (isNode()) {
|
|
9331
9458
|
return '';
|
|
@@ -9368,7 +9495,7 @@ const initialise = async () => {
|
|
|
9368
9495
|
initialised = true;
|
|
9369
9496
|
try {
|
|
9370
9497
|
const runtimeDetails = flattenProperties(getRuntimeDetails());
|
|
9371
|
-
const existingRuntimeId = getDetail(Detail.RUNTIME_ID);
|
|
9498
|
+
const existingRuntimeId = getDetail$1(Detail.RUNTIME_ID);
|
|
9372
9499
|
const body = {
|
|
9373
9500
|
version: 1,
|
|
9374
9501
|
data: {
|
|
@@ -9521,6 +9648,7 @@ const setPublishableApiKeyFn = (publishableApiKey) => {
|
|
|
9521
9648
|
storeDetail(Detail.PUBLISHABLE_API_KEY, publishableApiKey);
|
|
9522
9649
|
};
|
|
9523
9650
|
errorBoundary(getGlobalisedValue('setPublishableApiKey', setPublishableApiKeyFn));
|
|
9651
|
+
const getDetail = errorBoundary(getGlobalisedValue('getDetail', getDetail$1));
|
|
9524
9652
|
|
|
9525
9653
|
var Environment;
|
|
9526
9654
|
(function (Environment) {
|
|
@@ -9537,7 +9665,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
9537
9665
|
chainID,
|
|
9538
9666
|
coreContractAddress,
|
|
9539
9667
|
registrationContractAddress,
|
|
9540
|
-
sdkVersion: 'ts-immutable-sdk-1.7.1',
|
|
9668
|
+
sdkVersion: 'ts-immutable-sdk-1.7.3-alpha.1',
|
|
9541
9669
|
});
|
|
9542
9670
|
/**
|
|
9543
9671
|
* Sets `sdkVersion` at the time of build
|
|
@@ -14262,10 +14390,20 @@ class AuthManager {
|
|
|
14262
14390
|
},
|
|
14263
14391
|
});
|
|
14264
14392
|
};
|
|
14265
|
-
|
|
14393
|
+
/**
|
|
14394
|
+
* login
|
|
14395
|
+
* @param anonymousId Caller can pass an anonymousId if they want to associate their user's identity with immutable's internal instrumentation.
|
|
14396
|
+
*/
|
|
14397
|
+
async login(anonymousId) {
|
|
14266
14398
|
return withPassportError(async () => {
|
|
14399
|
+
const rid = getDetail(Detail.RUNTIME_ID);
|
|
14267
14400
|
const popupWindowFeatures = { width: 410, height: 450 };
|
|
14268
14401
|
const oidcUser = await this.userManager.signinPopup({
|
|
14402
|
+
extraQueryParams: {
|
|
14403
|
+
...(this.userManager.settings?.extraQueryParams ?? {}),
|
|
14404
|
+
rid: rid || '',
|
|
14405
|
+
third_party_a_id: anonymousId || '',
|
|
14406
|
+
},
|
|
14269
14407
|
popupWindowFeatures,
|
|
14270
14408
|
});
|
|
14271
14409
|
return AuthManager.mapOidcUserToDomainModel(oidcUser);
|
|
@@ -14285,17 +14423,22 @@ class AuthManager {
|
|
|
14285
14423
|
async loginCallback() {
|
|
14286
14424
|
return withPassportError(async () => this.userManager.signinPopupCallback(), PassportErrorType.AUTHENTICATION_ERROR);
|
|
14287
14425
|
}
|
|
14288
|
-
|
|
14426
|
+
/**
|
|
14427
|
+
* loginWithDeviceFlow
|
|
14428
|
+
* @param anonymousId Caller can pass an anonymousId if they want to associate their user's identity with immutable's internal instrumentation.
|
|
14429
|
+
*/
|
|
14430
|
+
async loginWithDeviceFlow(anonymousId) {
|
|
14289
14431
|
return withPassportError(async () => {
|
|
14290
14432
|
const response = await globalAxios$1.post(`${this.config.authenticationDomain}/oauth/device/code`, {
|
|
14291
14433
|
client_id: this.config.oidcConfiguration.clientId,
|
|
14292
14434
|
scope: this.config.oidcConfiguration.scope,
|
|
14293
14435
|
audience: this.config.oidcConfiguration.audience,
|
|
14294
14436
|
}, formUrlEncodedHeader);
|
|
14437
|
+
const rid = getDetail(Detail.RUNTIME_ID);
|
|
14295
14438
|
return {
|
|
14296
14439
|
code: response.data.user_code,
|
|
14297
14440
|
deviceCode: response.data.device_code,
|
|
14298
|
-
url: response.data.verification_uri_complete
|
|
14441
|
+
url: `${response.data.verification_uri_complete}${rid ? `&rid=${rid}` : ''}${anonymousId ? `&third_party_a_id=${anonymousId}` : ''}`,
|
|
14299
14442
|
interval: response.data.interval,
|
|
14300
14443
|
};
|
|
14301
14444
|
}, PassportErrorType.AUTHENTICATION_ERROR);
|
package/dist/x.js
CHANGED
|
@@ -104,7 +104,7 @@ const storeDetail = (key, value) => {
|
|
|
104
104
|
};
|
|
105
105
|
setItem(Store.RUNTIME, RUNTIME_DETAILS);
|
|
106
106
|
};
|
|
107
|
-
const getDetail = (key) => {
|
|
107
|
+
const getDetail$1 = (key) => {
|
|
108
108
|
// Handle the scenario where detail is a falsy value
|
|
109
109
|
if (RUNTIME_DETAILS[key] === undefined) {
|
|
110
110
|
return undefined;
|
|
@@ -136,7 +136,7 @@ const flattenProperties = (properties) => {
|
|
|
136
136
|
};
|
|
137
137
|
|
|
138
138
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
139
|
-
const SDK_VERSION = '1.7.1';
|
|
139
|
+
const SDK_VERSION = '1.7.3-alpha.1';
|
|
140
140
|
const getReferrer = () => {
|
|
141
141
|
if (isNode()) {
|
|
142
142
|
return '';
|
|
@@ -179,7 +179,7 @@ const initialise = async () => {
|
|
|
179
179
|
initialised = true;
|
|
180
180
|
try {
|
|
181
181
|
const runtimeDetails = flattenProperties(getRuntimeDetails());
|
|
182
|
-
const existingRuntimeId = getDetail(Detail.RUNTIME_ID);
|
|
182
|
+
const existingRuntimeId = getDetail$1(Detail.RUNTIME_ID);
|
|
183
183
|
const body = {
|
|
184
184
|
version: 1,
|
|
185
185
|
data: {
|
|
@@ -311,6 +311,7 @@ const setPublishableApiKeyFn = (publishableApiKey) => {
|
|
|
311
311
|
storeDetail(Detail.PUBLISHABLE_API_KEY, publishableApiKey);
|
|
312
312
|
};
|
|
313
313
|
errorBoundary(getGlobalisedValue('setPublishableApiKey', setPublishableApiKeyFn));
|
|
314
|
+
errorBoundary(getGlobalisedValue('getDetail', getDetail$1));
|
|
314
315
|
|
|
315
316
|
var Environment;
|
|
316
317
|
(function (Environment) {
|
|
@@ -327,7 +328,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
327
328
|
chainID,
|
|
328
329
|
coreContractAddress,
|
|
329
330
|
registrationContractAddress,
|
|
330
|
-
sdkVersion: 'ts-immutable-sdk-1.7.1',
|
|
331
|
+
sdkVersion: 'ts-immutable-sdk-1.7.3-alpha.1',
|
|
331
332
|
});
|
|
332
333
|
/**
|
|
333
334
|
* Sets `sdkVersion` at the time of build
|
package/package.json
CHANGED