@imtbl/sdk 0.23.2 → 0.24.0-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 +467 -0
- package/dist/blockchain_data.js +135 -11
- package/dist/browser/checkout.js +2 -2
- package/dist/checkout_sdk.d.ts +2 -13
- package/dist/checkout_sdk.js +291 -126
- package/dist/checkout_widgets.js +1 -1
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +13 -13
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +294 -129
- package/dist/index.d.ts +469 -13
- package/dist/index.js +294 -129
- package/dist/passport.js +2 -2
- package/package.json +1 -1
package/dist/blockchain_data.js
CHANGED
|
@@ -946,6 +946,46 @@ const MetadataApiAxiosParamCreator = function (configuration) {
|
|
|
946
946
|
options: localVarRequestOptions,
|
|
947
947
|
};
|
|
948
948
|
},
|
|
949
|
+
/**
|
|
950
|
+
* refresh metadata of a list of nfts
|
|
951
|
+
* @summary refresh the metedata data of a list of nfts by token id
|
|
952
|
+
* @param {string} contractAddress The address of contract
|
|
953
|
+
* @param {string} chainName The name of chain
|
|
954
|
+
* @param {RefreshNFTMetadataByTokenIDRequest} refreshNFTMetadataByTokenIDRequest the request body
|
|
955
|
+
* @param {*} [options] Override http request option.
|
|
956
|
+
* @throws {RequiredError}
|
|
957
|
+
*/
|
|
958
|
+
refreshNFTMetadataByTokenID: async (contractAddress, chainName, refreshNFTMetadataByTokenIDRequest, options = {}) => {
|
|
959
|
+
// verify required parameter 'contractAddress' is not null or undefined
|
|
960
|
+
assertParamExists('refreshNFTMetadataByTokenID', 'contractAddress', contractAddress);
|
|
961
|
+
// verify required parameter 'chainName' is not null or undefined
|
|
962
|
+
assertParamExists('refreshNFTMetadataByTokenID', 'chainName', chainName);
|
|
963
|
+
// verify required parameter 'refreshNFTMetadataByTokenIDRequest' is not null or undefined
|
|
964
|
+
assertParamExists('refreshNFTMetadataByTokenID', 'refreshNFTMetadataByTokenIDRequest', refreshNFTMetadataByTokenIDRequest);
|
|
965
|
+
const localVarPath = `/v1/chains/{chain_name}/collections/{contract_address}/nfts/refresh-metadata`
|
|
966
|
+
.replace(`{${"contract_address"}}`, encodeURIComponent(String(contractAddress)))
|
|
967
|
+
.replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
|
|
968
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
969
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
970
|
+
let baseOptions;
|
|
971
|
+
if (configuration) {
|
|
972
|
+
baseOptions = configuration.baseOptions;
|
|
973
|
+
}
|
|
974
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
|
|
975
|
+
const localVarHeaderParameter = {};
|
|
976
|
+
const localVarQueryParameter = {};
|
|
977
|
+
// authentication ImmutableApiKey required
|
|
978
|
+
await setApiKeyToObject(localVarHeaderParameter, "X-Immutable-API-Key", configuration);
|
|
979
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
980
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
981
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
982
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
983
|
+
localVarRequestOptions.data = serializeDataIfNeeded(refreshNFTMetadataByTokenIDRequest, localVarRequestOptions, configuration);
|
|
984
|
+
return {
|
|
985
|
+
url: toPathString(localVarUrlObj),
|
|
986
|
+
options: localVarRequestOptions,
|
|
987
|
+
};
|
|
988
|
+
},
|
|
949
989
|
};
|
|
950
990
|
};
|
|
951
991
|
/**
|
|
@@ -980,6 +1020,19 @@ const MetadataApiFp = function (configuration) {
|
|
|
980
1020
|
const localVarAxiosArgs = await localVarAxiosParamCreator.refreshMetadataByID(chainName, contractAddress, refreshMetadataByIDRequest, options);
|
|
981
1021
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
982
1022
|
},
|
|
1023
|
+
/**
|
|
1024
|
+
* refresh metadata of a list of nfts
|
|
1025
|
+
* @summary refresh the metedata data of a list of nfts by token id
|
|
1026
|
+
* @param {string} contractAddress The address of contract
|
|
1027
|
+
* @param {string} chainName The name of chain
|
|
1028
|
+
* @param {RefreshNFTMetadataByTokenIDRequest} refreshNFTMetadataByTokenIDRequest the request body
|
|
1029
|
+
* @param {*} [options] Override http request option.
|
|
1030
|
+
* @throws {RequiredError}
|
|
1031
|
+
*/
|
|
1032
|
+
async refreshNFTMetadataByTokenID(contractAddress, chainName, refreshNFTMetadataByTokenIDRequest, options) {
|
|
1033
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.refreshNFTMetadataByTokenID(contractAddress, chainName, refreshNFTMetadataByTokenIDRequest, options);
|
|
1034
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
1035
|
+
},
|
|
983
1036
|
};
|
|
984
1037
|
};
|
|
985
1038
|
/**
|
|
@@ -1012,6 +1065,18 @@ const MetadataApiFactory = function (configuration, basePath, axios) {
|
|
|
1012
1065
|
refreshMetadataByID(chainName, contractAddress, refreshMetadataByIDRequest, options) {
|
|
1013
1066
|
return localVarFp.refreshMetadataByID(chainName, contractAddress, refreshMetadataByIDRequest, options).then((request) => request(axios, basePath));
|
|
1014
1067
|
},
|
|
1068
|
+
/**
|
|
1069
|
+
* refresh metadata of a list of nfts
|
|
1070
|
+
* @summary refresh the metedata data of a list of nfts by token id
|
|
1071
|
+
* @param {string} contractAddress The address of contract
|
|
1072
|
+
* @param {string} chainName The name of chain
|
|
1073
|
+
* @param {RefreshNFTMetadataByTokenIDRequest} refreshNFTMetadataByTokenIDRequest the request body
|
|
1074
|
+
* @param {*} [options] Override http request option.
|
|
1075
|
+
* @throws {RequiredError}
|
|
1076
|
+
*/
|
|
1077
|
+
refreshNFTMetadataByTokenID(contractAddress, chainName, refreshNFTMetadataByTokenIDRequest, options) {
|
|
1078
|
+
return localVarFp.refreshNFTMetadataByTokenID(contractAddress, chainName, refreshNFTMetadataByTokenIDRequest, options).then((request) => request(axios, basePath));
|
|
1079
|
+
},
|
|
1015
1080
|
};
|
|
1016
1081
|
};
|
|
1017
1082
|
/**
|
|
@@ -1042,6 +1107,17 @@ class MetadataApi extends BaseAPI {
|
|
|
1042
1107
|
refreshMetadataByID(requestParameters, options) {
|
|
1043
1108
|
return MetadataApiFp(this.configuration).refreshMetadataByID(requestParameters.chainName, requestParameters.contractAddress, requestParameters.refreshMetadataByIDRequest, options).then((request) => request(this.axios, this.basePath));
|
|
1044
1109
|
}
|
|
1110
|
+
/**
|
|
1111
|
+
* refresh metadata of a list of nfts
|
|
1112
|
+
* @summary refresh the metedata data of a list of nfts by token id
|
|
1113
|
+
* @param {MetadataApiRefreshNFTMetadataByTokenIDRequest} requestParameters Request parameters.
|
|
1114
|
+
* @param {*} [options] Override http request option.
|
|
1115
|
+
* @throws {RequiredError}
|
|
1116
|
+
* @memberof MetadataApi
|
|
1117
|
+
*/
|
|
1118
|
+
refreshNFTMetadataByTokenID(requestParameters, options) {
|
|
1119
|
+
return MetadataApiFp(this.configuration).refreshNFTMetadataByTokenID(requestParameters.contractAddress, requestParameters.chainName, requestParameters.refreshNFTMetadataByTokenIDRequest, options).then((request) => request(this.axios, this.basePath));
|
|
1120
|
+
}
|
|
1045
1121
|
}
|
|
1046
1122
|
|
|
1047
1123
|
/* tslint:disable */
|
|
@@ -2857,29 +2933,24 @@ class APIError extends Error {
|
|
|
2857
2933
|
|
|
2858
2934
|
/* eslint-disable implicit-arrow-linebreak */
|
|
2859
2935
|
const defaultHeaders = {
|
|
2860
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.
|
|
2936
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.24.0-alpha.1',
|
|
2861
2937
|
};
|
|
2862
2938
|
/**
|
|
2863
2939
|
* createAPIConfiguration to create a custom Configuration
|
|
2864
2940
|
* other than the production and sandbox defined below.
|
|
2865
2941
|
*/
|
|
2866
|
-
const createAPIConfiguration = ({ basePath, headers: baseHeaders, }) => {
|
|
2942
|
+
const createAPIConfiguration = ({ baseConfig, basePath, headers: baseHeaders, }) => {
|
|
2867
2943
|
if (!basePath.trim()) {
|
|
2868
2944
|
throw Error('basePath can not be empty');
|
|
2869
2945
|
}
|
|
2870
2946
|
const headers = { ...(baseHeaders || {}), ...defaultHeaders };
|
|
2871
2947
|
const configParams = {
|
|
2948
|
+
...baseConfig,
|
|
2872
2949
|
basePath,
|
|
2873
2950
|
baseOptions: { headers },
|
|
2874
2951
|
};
|
|
2875
2952
|
return new index.Configuration(configParams);
|
|
2876
2953
|
};
|
|
2877
|
-
const production = () => createAPIConfiguration({
|
|
2878
|
-
basePath: 'https://indexer-mr.imtbl.com',
|
|
2879
|
-
});
|
|
2880
|
-
const sandbox = () => createAPIConfiguration({
|
|
2881
|
-
basePath: 'https://api.sandbox.immutable.com',
|
|
2882
|
-
});
|
|
2883
2954
|
class BlockchainDataConfiguration {
|
|
2884
2955
|
apiConfig;
|
|
2885
2956
|
baseConfig;
|
|
@@ -2891,15 +2962,24 @@ class BlockchainDataConfiguration {
|
|
|
2891
2962
|
else {
|
|
2892
2963
|
switch (baseConfig.environment) {
|
|
2893
2964
|
case Environment.SANDBOX: {
|
|
2894
|
-
this.apiConfig =
|
|
2965
|
+
this.apiConfig = createAPIConfiguration({
|
|
2966
|
+
basePath: 'https://api.sandbox.immutable.com',
|
|
2967
|
+
baseConfig,
|
|
2968
|
+
});
|
|
2895
2969
|
break;
|
|
2896
2970
|
}
|
|
2897
2971
|
case Environment.PRODUCTION: {
|
|
2898
|
-
this.apiConfig =
|
|
2972
|
+
this.apiConfig = createAPIConfiguration({
|
|
2973
|
+
basePath: 'https://indexer-mr.imtbl.com',
|
|
2974
|
+
baseConfig,
|
|
2975
|
+
});
|
|
2899
2976
|
break;
|
|
2900
2977
|
}
|
|
2901
2978
|
default: {
|
|
2902
|
-
this.apiConfig =
|
|
2979
|
+
this.apiConfig = createAPIConfiguration({
|
|
2980
|
+
basePath: 'https://api.sandbox.immutable.com',
|
|
2981
|
+
baseConfig,
|
|
2982
|
+
});
|
|
2903
2983
|
}
|
|
2904
2984
|
}
|
|
2905
2985
|
}
|
|
@@ -2949,6 +3029,7 @@ class BlockchainData {
|
|
|
2949
3029
|
nfts;
|
|
2950
3030
|
nftOwners;
|
|
2951
3031
|
tokens;
|
|
3032
|
+
metadata;
|
|
2952
3033
|
constructor(moduleConfig) {
|
|
2953
3034
|
this.config = new BlockchainDataConfiguration(moduleConfig);
|
|
2954
3035
|
this.activities = new index.ActivitiesApi(this.config.apiConfig);
|
|
@@ -2957,6 +3038,7 @@ class BlockchainData {
|
|
|
2957
3038
|
this.nfts = new index.NftsApi(this.config.apiConfig);
|
|
2958
3039
|
this.nftOwners = new index.NftOwnersApi(this.config.apiConfig);
|
|
2959
3040
|
this.tokens = new index.TokensApi(this.config.apiConfig);
|
|
3041
|
+
this.metadata = new index.MetadataApi(this.config.apiConfig);
|
|
2960
3042
|
}
|
|
2961
3043
|
/**
|
|
2962
3044
|
* List all activities
|
|
@@ -3126,6 +3208,48 @@ class BlockchainData {
|
|
|
3126
3208
|
throw formatError(err);
|
|
3127
3209
|
});
|
|
3128
3210
|
}
|
|
3211
|
+
/**
|
|
3212
|
+
* Refresh collection metadata
|
|
3213
|
+
* @param request - the request object containing the parameters to be provided in the API request
|
|
3214
|
+
* @returns a promise that resolves with the updated collection
|
|
3215
|
+
* @throws {@link index.APIError}
|
|
3216
|
+
*/
|
|
3217
|
+
async refreshCollectionMetadata(request) {
|
|
3218
|
+
return await this.collections
|
|
3219
|
+
.refreshCollectionMetadata(request)
|
|
3220
|
+
.then((res) => res.data)
|
|
3221
|
+
.catch((err) => {
|
|
3222
|
+
throw formatError(err);
|
|
3223
|
+
});
|
|
3224
|
+
}
|
|
3225
|
+
/**
|
|
3226
|
+
* Refresh metadata for specific NFTs
|
|
3227
|
+
* @param request - the request object containing the parameters to be provided in the API request
|
|
3228
|
+
* @returns a promise that resolves with the remaining rate limits
|
|
3229
|
+
* @throws {@link index.APIError}
|
|
3230
|
+
*/
|
|
3231
|
+
async refreshNFTMetadata(request) {
|
|
3232
|
+
return await this.metadata
|
|
3233
|
+
.refreshNFTMetadataByTokenID(request)
|
|
3234
|
+
.then((res) => res.data)
|
|
3235
|
+
.catch((err) => {
|
|
3236
|
+
throw formatError(err);
|
|
3237
|
+
});
|
|
3238
|
+
}
|
|
3239
|
+
/**
|
|
3240
|
+
* Refresh metadata by ID. This will refresh metadata for all NFTs that reference the given metadata ID.
|
|
3241
|
+
* @param request - the request object containing the parameters to be provided in the API request
|
|
3242
|
+
* @returns a promise that resolves with the remaining rate limits
|
|
3243
|
+
* @throws {@link index.APIError}
|
|
3244
|
+
*/
|
|
3245
|
+
async refreshStackedMetadata(request) {
|
|
3246
|
+
return await this.metadata
|
|
3247
|
+
.refreshMetadataByID(request)
|
|
3248
|
+
.then((res) => res.data)
|
|
3249
|
+
.catch((err) => {
|
|
3250
|
+
throw formatError(err);
|
|
3251
|
+
});
|
|
3252
|
+
}
|
|
3129
3253
|
}
|
|
3130
3254
|
|
|
3131
3255
|
export { APIError, BlockchainData };
|