@imtbl/sdk 1.46.0 → 1.46.1-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blockchain_data.d.ts +23 -4
- package/dist/blockchain_data.js +235 -15
- package/dist/checkout.d.ts +53 -3
- package/dist/checkout.js +250 -18
- package/dist/config.js +1 -1
- package/dist/index.browser.js +26 -26
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +311 -20
- package/dist/index.d.ts +102 -7
- package/dist/index.js +311 -20
- package/dist/minting_backend.d.ts +23 -4
- package/dist/minting_backend.js +235 -15
- package/dist/orderbook.js +1 -1
- package/dist/passport.d.ts +43 -23
- package/dist/passport.js +135 -14
- package/dist/webhook.js +1 -1
- package/dist/x.js +3 -3
- package/package.json +1 -1
package/dist/passport.js
CHANGED
|
@@ -9746,13 +9746,14 @@ const NftsApiAxiosParamCreator = function (configuration) {
|
|
|
9746
9746
|
* @param {string} accountAddress Account address
|
|
9747
9747
|
* @param {string} chainName The name of chain
|
|
9748
9748
|
* @param {string} [contractAddress] The address of contract
|
|
9749
|
+
* @param {Array<string>} [tokenId] List of token IDs to filter by
|
|
9749
9750
|
* @param {string} [fromUpdatedAt] Datetime to use as the oldest updated timestamp
|
|
9750
9751
|
* @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
|
|
9751
9752
|
* @param {number} [pageSize] Maximum number of items to return
|
|
9752
9753
|
* @param {*} [options] Override http request option.
|
|
9753
9754
|
* @throws {RequiredError}
|
|
9754
9755
|
*/
|
|
9755
|
-
listNFTsByAccountAddress: async (accountAddress, chainName, contractAddress, fromUpdatedAt, pageCursor, pageSize, options = {}) => {
|
|
9756
|
+
listNFTsByAccountAddress: async (accountAddress, chainName, contractAddress, tokenId, fromUpdatedAt, pageCursor, pageSize, options = {}) => {
|
|
9756
9757
|
// verify required parameter 'accountAddress' is not null or undefined
|
|
9757
9758
|
assertParamExists$2('listNFTsByAccountAddress', 'accountAddress', accountAddress);
|
|
9758
9759
|
// verify required parameter 'chainName' is not null or undefined
|
|
@@ -9772,6 +9773,9 @@ const NftsApiAxiosParamCreator = function (configuration) {
|
|
|
9772
9773
|
if (contractAddress !== undefined) {
|
|
9773
9774
|
localVarQueryParameter['contract_address'] = contractAddress;
|
|
9774
9775
|
}
|
|
9776
|
+
if (tokenId) {
|
|
9777
|
+
localVarQueryParameter['token_id'] = tokenId;
|
|
9778
|
+
}
|
|
9775
9779
|
if (fromUpdatedAt !== undefined) {
|
|
9776
9780
|
localVarQueryParameter['from_updated_at'] = (fromUpdatedAt instanceof Date) ?
|
|
9777
9781
|
fromUpdatedAt.toISOString() :
|
|
@@ -9890,14 +9894,15 @@ const NftsApiFp = function (configuration) {
|
|
|
9890
9894
|
* @param {string} accountAddress Account address
|
|
9891
9895
|
* @param {string} chainName The name of chain
|
|
9892
9896
|
* @param {string} [contractAddress] The address of contract
|
|
9897
|
+
* @param {Array<string>} [tokenId] List of token IDs to filter by
|
|
9893
9898
|
* @param {string} [fromUpdatedAt] Datetime to use as the oldest updated timestamp
|
|
9894
9899
|
* @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
|
|
9895
9900
|
* @param {number} [pageSize] Maximum number of items to return
|
|
9896
9901
|
* @param {*} [options] Override http request option.
|
|
9897
9902
|
* @throws {RequiredError}
|
|
9898
9903
|
*/
|
|
9899
|
-
async listNFTsByAccountAddress(accountAddress, chainName, contractAddress, fromUpdatedAt, pageCursor, pageSize, options) {
|
|
9900
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.listNFTsByAccountAddress(accountAddress, chainName, contractAddress, fromUpdatedAt, pageCursor, pageSize, options);
|
|
9904
|
+
async listNFTsByAccountAddress(accountAddress, chainName, contractAddress, tokenId, fromUpdatedAt, pageCursor, pageSize, options) {
|
|
9905
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.listNFTsByAccountAddress(accountAddress, chainName, contractAddress, tokenId, fromUpdatedAt, pageCursor, pageSize, options);
|
|
9901
9906
|
return createRequestFunction$2(localVarAxiosArgs, globalAxios$1, BASE_PATH$2, configuration);
|
|
9902
9907
|
},
|
|
9903
9908
|
};
|
|
@@ -9984,7 +9989,7 @@ class NftsApi extends BaseAPI$2 {
|
|
|
9984
9989
|
* @memberof NftsApi
|
|
9985
9990
|
*/
|
|
9986
9991
|
listNFTsByAccountAddress(requestParameters, options) {
|
|
9987
|
-
return NftsApiFp(this.configuration).listNFTsByAccountAddress(requestParameters.accountAddress, requestParameters.chainName, requestParameters.contractAddress, requestParameters.fromUpdatedAt, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
|
|
9992
|
+
return NftsApiFp(this.configuration).listNFTsByAccountAddress(requestParameters.accountAddress, requestParameters.chainName, requestParameters.contractAddress, requestParameters.tokenId, requestParameters.fromUpdatedAt, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
|
|
9988
9993
|
}
|
|
9989
9994
|
}
|
|
9990
9995
|
|
|
@@ -10188,7 +10193,7 @@ const OrdersApiAxiosParamCreator = function (configuration) {
|
|
|
10188
10193
|
* @param {string} [sellItemTokenId] Sell item token identifier to filter by
|
|
10189
10194
|
* @param {string} [fromUpdatedAt] From updated at including given date
|
|
10190
10195
|
* @param {number} [pageSize] Maximum number of orders to return per page
|
|
10191
|
-
* @param {ListListingsSortByEnum} [sortBy] Order field to sort by
|
|
10196
|
+
* @param {ListListingsSortByEnum} [sortBy] Order field to sort by. `buy_item_amount` sorts by per token price, for example if 5 ERC-1155s are on sale for 10eth, it’s sorted as 2eth for `buy_item_amount`.
|
|
10192
10197
|
* @param {ListListingsSortDirectionEnum} [sortDirection] Ascending or descending direction for sort
|
|
10193
10198
|
* @param {string} [pageCursor] Page cursor to retrieve previous or next page. Use the value returned in the response.
|
|
10194
10199
|
* @param {*} [options] Override http request option.
|
|
@@ -10259,6 +10264,7 @@ const OrdersApiAxiosParamCreator = function (configuration) {
|
|
|
10259
10264
|
* @summary List all trades
|
|
10260
10265
|
* @param {string} chainName
|
|
10261
10266
|
* @param {string} [accountAddress]
|
|
10267
|
+
* @param {string} [sellItemContractAddress]
|
|
10262
10268
|
* @param {string} [fromIndexedAt] From indexed at including given date
|
|
10263
10269
|
* @param {number} [pageSize] Maximum number of trades to return per page
|
|
10264
10270
|
* @param {ListTradesSortByEnum} [sortBy] Trade field to sort by
|
|
@@ -10267,7 +10273,7 @@ const OrdersApiAxiosParamCreator = function (configuration) {
|
|
|
10267
10273
|
* @param {*} [options] Override http request option.
|
|
10268
10274
|
* @throws {RequiredError}
|
|
10269
10275
|
*/
|
|
10270
|
-
listTrades: async (chainName, accountAddress, fromIndexedAt, pageSize, sortBy, sortDirection, pageCursor, options = {}) => {
|
|
10276
|
+
listTrades: async (chainName, accountAddress, sellItemContractAddress, fromIndexedAt, pageSize, sortBy, sortDirection, pageCursor, options = {}) => {
|
|
10271
10277
|
// verify required parameter 'chainName' is not null or undefined
|
|
10272
10278
|
assertParamExists$2('listTrades', 'chainName', chainName);
|
|
10273
10279
|
const localVarPath = `/v1/chains/{chain_name}/trades`
|
|
@@ -10284,6 +10290,9 @@ const OrdersApiAxiosParamCreator = function (configuration) {
|
|
|
10284
10290
|
if (accountAddress !== undefined) {
|
|
10285
10291
|
localVarQueryParameter['account_address'] = accountAddress;
|
|
10286
10292
|
}
|
|
10293
|
+
if (sellItemContractAddress !== undefined) {
|
|
10294
|
+
localVarQueryParameter['sell_item_contract_address'] = sellItemContractAddress;
|
|
10295
|
+
}
|
|
10287
10296
|
if (fromIndexedAt !== undefined) {
|
|
10288
10297
|
localVarQueryParameter['from_indexed_at'] = (fromIndexedAt instanceof Date) ?
|
|
10289
10298
|
fromIndexedAt.toISOString() :
|
|
@@ -10391,7 +10400,7 @@ const OrdersApiFp = function (configuration) {
|
|
|
10391
10400
|
* @param {string} [sellItemTokenId] Sell item token identifier to filter by
|
|
10392
10401
|
* @param {string} [fromUpdatedAt] From updated at including given date
|
|
10393
10402
|
* @param {number} [pageSize] Maximum number of orders to return per page
|
|
10394
|
-
* @param {ListListingsSortByEnum} [sortBy] Order field to sort by
|
|
10403
|
+
* @param {ListListingsSortByEnum} [sortBy] Order field to sort by. `buy_item_amount` sorts by per token price, for example if 5 ERC-1155s are on sale for 10eth, it’s sorted as 2eth for `buy_item_amount`.
|
|
10395
10404
|
* @param {ListListingsSortDirectionEnum} [sortDirection] Ascending or descending direction for sort
|
|
10396
10405
|
* @param {string} [pageCursor] Page cursor to retrieve previous or next page. Use the value returned in the response.
|
|
10397
10406
|
* @param {*} [options] Override http request option.
|
|
@@ -10406,6 +10415,7 @@ const OrdersApiFp = function (configuration) {
|
|
|
10406
10415
|
* @summary List all trades
|
|
10407
10416
|
* @param {string} chainName
|
|
10408
10417
|
* @param {string} [accountAddress]
|
|
10418
|
+
* @param {string} [sellItemContractAddress]
|
|
10409
10419
|
* @param {string} [fromIndexedAt] From indexed at including given date
|
|
10410
10420
|
* @param {number} [pageSize] Maximum number of trades to return per page
|
|
10411
10421
|
* @param {ListTradesSortByEnum} [sortBy] Trade field to sort by
|
|
@@ -10414,8 +10424,8 @@ const OrdersApiFp = function (configuration) {
|
|
|
10414
10424
|
* @param {*} [options] Override http request option.
|
|
10415
10425
|
* @throws {RequiredError}
|
|
10416
10426
|
*/
|
|
10417
|
-
async listTrades(chainName, accountAddress, fromIndexedAt, pageSize, sortBy, sortDirection, pageCursor, options) {
|
|
10418
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.listTrades(chainName, accountAddress, fromIndexedAt, pageSize, sortBy, sortDirection, pageCursor, options);
|
|
10427
|
+
async listTrades(chainName, accountAddress, sellItemContractAddress, fromIndexedAt, pageSize, sortBy, sortDirection, pageCursor, options) {
|
|
10428
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.listTrades(chainName, accountAddress, sellItemContractAddress, fromIndexedAt, pageSize, sortBy, sortDirection, pageCursor, options);
|
|
10419
10429
|
return createRequestFunction$2(localVarAxiosArgs, globalAxios$1, BASE_PATH$2, configuration);
|
|
10420
10430
|
},
|
|
10421
10431
|
};
|
|
@@ -10502,7 +10512,7 @@ let OrdersApi$2 = class OrdersApi extends BaseAPI$2 {
|
|
|
10502
10512
|
* @memberof OrdersApi
|
|
10503
10513
|
*/
|
|
10504
10514
|
listTrades(requestParameters, options) {
|
|
10505
|
-
return OrdersApiFp(this.configuration).listTrades(requestParameters.chainName, requestParameters.accountAddress, requestParameters.fromIndexedAt, requestParameters.pageSize, requestParameters.sortBy, requestParameters.sortDirection, requestParameters.pageCursor, options).then((request) => request(this.axios, this.basePath));
|
|
10515
|
+
return OrdersApiFp(this.configuration).listTrades(requestParameters.chainName, requestParameters.accountAddress, requestParameters.sellItemContractAddress, requestParameters.fromIndexedAt, requestParameters.pageSize, requestParameters.sortBy, requestParameters.sortDirection, requestParameters.pageCursor, options).then((request) => request(this.axios, this.basePath));
|
|
10506
10516
|
}
|
|
10507
10517
|
};
|
|
10508
10518
|
|
|
@@ -10891,6 +10901,37 @@ const PassportProfileApiAxiosParamCreator = function (configuration) {
|
|
|
10891
10901
|
options: localVarRequestOptions,
|
|
10892
10902
|
};
|
|
10893
10903
|
},
|
|
10904
|
+
/**
|
|
10905
|
+
* Link an external EOA wallet to an Immutable Passport account by providing an EIP-712 signature.
|
|
10906
|
+
* @summary Link wallet v2
|
|
10907
|
+
* @param {LinkWalletV2Request} [linkWalletV2Request]
|
|
10908
|
+
* @param {*} [options] Override http request option.
|
|
10909
|
+
* @throws {RequiredError}
|
|
10910
|
+
*/
|
|
10911
|
+
linkWalletV2: async (linkWalletV2Request, options = {}) => {
|
|
10912
|
+
const localVarPath = `/passport-profile/v2/linked-wallets`;
|
|
10913
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
10914
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL$2);
|
|
10915
|
+
let baseOptions;
|
|
10916
|
+
if (configuration) {
|
|
10917
|
+
baseOptions = configuration.baseOptions;
|
|
10918
|
+
}
|
|
10919
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
|
|
10920
|
+
const localVarHeaderParameter = {};
|
|
10921
|
+
const localVarQueryParameter = {};
|
|
10922
|
+
// authentication BearerAuth required
|
|
10923
|
+
// http bearer authentication required
|
|
10924
|
+
await setBearerAuthToObject$1(localVarHeaderParameter, configuration);
|
|
10925
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
10926
|
+
setSearchParams$2(localVarUrlObj, localVarQueryParameter);
|
|
10927
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
10928
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
10929
|
+
localVarRequestOptions.data = serializeDataIfNeeded$2(linkWalletV2Request, localVarRequestOptions, configuration);
|
|
10930
|
+
return {
|
|
10931
|
+
url: toPathString$2(localVarUrlObj),
|
|
10932
|
+
options: localVarRequestOptions,
|
|
10933
|
+
};
|
|
10934
|
+
},
|
|
10894
10935
|
};
|
|
10895
10936
|
};
|
|
10896
10937
|
/**
|
|
@@ -10910,6 +10951,17 @@ const PassportProfileApiFp = function (configuration) {
|
|
|
10910
10951
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getUserInfo(options);
|
|
10911
10952
|
return createRequestFunction$2(localVarAxiosArgs, globalAxios$1, BASE_PATH$2, configuration);
|
|
10912
10953
|
},
|
|
10954
|
+
/**
|
|
10955
|
+
* Link an external EOA wallet to an Immutable Passport account by providing an EIP-712 signature.
|
|
10956
|
+
* @summary Link wallet v2
|
|
10957
|
+
* @param {LinkWalletV2Request} [linkWalletV2Request]
|
|
10958
|
+
* @param {*} [options] Override http request option.
|
|
10959
|
+
* @throws {RequiredError}
|
|
10960
|
+
*/
|
|
10961
|
+
async linkWalletV2(linkWalletV2Request, options) {
|
|
10962
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.linkWalletV2(linkWalletV2Request, options);
|
|
10963
|
+
return createRequestFunction$2(localVarAxiosArgs, globalAxios$1, BASE_PATH$2, configuration);
|
|
10964
|
+
},
|
|
10913
10965
|
};
|
|
10914
10966
|
};
|
|
10915
10967
|
/**
|
|
@@ -10929,6 +10981,17 @@ class PassportProfileApi extends BaseAPI$2 {
|
|
|
10929
10981
|
getUserInfo(options) {
|
|
10930
10982
|
return PassportProfileApiFp(this.configuration).getUserInfo(options).then((request) => request(this.axios, this.basePath));
|
|
10931
10983
|
}
|
|
10984
|
+
/**
|
|
10985
|
+
* Link an external EOA wallet to an Immutable Passport account by providing an EIP-712 signature.
|
|
10986
|
+
* @summary Link wallet v2
|
|
10987
|
+
* @param {PassportProfileApiLinkWalletV2Request} requestParameters Request parameters.
|
|
10988
|
+
* @param {*} [options] Override http request option.
|
|
10989
|
+
* @throws {RequiredError}
|
|
10990
|
+
* @memberof PassportProfileApi
|
|
10991
|
+
*/
|
|
10992
|
+
linkWalletV2(requestParameters = {}, options) {
|
|
10993
|
+
return PassportProfileApiFp(this.configuration).linkWalletV2(requestParameters.linkWalletV2Request, options).then((request) => request(this.axios, this.basePath));
|
|
10994
|
+
}
|
|
10932
10995
|
}
|
|
10933
10996
|
|
|
10934
10997
|
/* tslint:disable */
|
|
@@ -11460,7 +11523,7 @@ class MultiRollupApiClients {
|
|
|
11460
11523
|
}
|
|
11461
11524
|
|
|
11462
11525
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
11463
|
-
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-1.46.
|
|
11526
|
+
const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-1.46.1-alpha' };
|
|
11464
11527
|
const createConfig$1 = ({ basePath, headers, }) => {
|
|
11465
11528
|
if (!basePath.trim()) {
|
|
11466
11529
|
throw Error('basePath can not be empty');
|
|
@@ -11669,7 +11732,7 @@ const flattenProperties = (properties) => {
|
|
|
11669
11732
|
};
|
|
11670
11733
|
|
|
11671
11734
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
11672
|
-
const SDK_VERSION = '1.46.
|
|
11735
|
+
const SDK_VERSION = '1.46.1-alpha';
|
|
11673
11736
|
const getFrameParentDomain = () => {
|
|
11674
11737
|
if (isNode()) {
|
|
11675
11738
|
return '';
|
|
@@ -12097,7 +12160,7 @@ const addKeysToHeadersOverride = (baseConfig, overrides) => {
|
|
|
12097
12160
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
12098
12161
|
class ApiConfiguration extends index$2.Configuration {
|
|
12099
12162
|
}
|
|
12100
|
-
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.46.
|
|
12163
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.46.1-alpha' };
|
|
12101
12164
|
/**
|
|
12102
12165
|
* @dev use createImmutableXConfiguration instead
|
|
12103
12166
|
*/
|
|
@@ -12138,7 +12201,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
12138
12201
|
coreContractAddress,
|
|
12139
12202
|
registrationContractAddress,
|
|
12140
12203
|
registrationV4ContractAddress,
|
|
12141
|
-
sdkVersion: 'ts-immutable-sdk-1.46.
|
|
12204
|
+
sdkVersion: 'ts-immutable-sdk-1.46.1-alpha',
|
|
12142
12205
|
baseConfig,
|
|
12143
12206
|
});
|
|
12144
12207
|
const production = ({ baseConfig }) => createImmutableXConfiguration({
|
|
@@ -19916,6 +19979,11 @@ var PassportErrorType;
|
|
|
19916
19979
|
PassportErrorType["EXCHANGE_TRANSFER_ERROR"] = "EXCHANGE_TRANSFER_ERROR";
|
|
19917
19980
|
PassportErrorType["CREATE_TRADE_ERROR"] = "CREATE_TRADE_ERROR";
|
|
19918
19981
|
PassportErrorType["OPERATION_NOT_SUPPORTED_ERROR"] = "OPERATION_NOT_SUPPORTED_ERROR";
|
|
19982
|
+
PassportErrorType["LINK_WALLET_ALREADY_LINKED_ERROR"] = "LINK_WALLET_ALREADY_LINKED_ERROR";
|
|
19983
|
+
PassportErrorType["LINK_WALLET_MAX_WALLETS_LINKED_ERROR"] = "LINK_WALLET_MAX_WALLETS_LINKED_ERROR";
|
|
19984
|
+
PassportErrorType["LINK_WALLET_VALIDATION_ERROR"] = "LINK_WALLET_VALIDATION_ERROR";
|
|
19985
|
+
PassportErrorType["LINK_WALLET_DUPLICATE_NONCE_ERROR"] = "LINK_WALLET_DUPLICATE_NONCE_ERROR";
|
|
19986
|
+
PassportErrorType["LINK_WALLET_GENERIC_ERROR"] = "LINK_WALLET_GENERIC_ERROR";
|
|
19919
19987
|
})(PassportErrorType || (PassportErrorType = {}));
|
|
19920
19988
|
function isAPIError(error) {
|
|
19921
19989
|
return 'code' in error && 'message' in error;
|
|
@@ -23503,6 +23571,59 @@ class Passport {
|
|
|
23503
23571
|
const getUserInfoResult = await this.multiRollupApiClients.passportProfileApi.getUserInfo({ headers });
|
|
23504
23572
|
return getUserInfoResult.data.linked_addresses;
|
|
23505
23573
|
}
|
|
23574
|
+
async linkExternalWallet(params) {
|
|
23575
|
+
track('passport', 'linkWallet', { type: params.type });
|
|
23576
|
+
const user = await this.authManager.getUser();
|
|
23577
|
+
if (!user) {
|
|
23578
|
+
throw new PassportError('User is not logged in', PassportErrorType.NOT_LOGGED_IN_ERROR);
|
|
23579
|
+
}
|
|
23580
|
+
const isRegisteredWithIMX = isUserImx(user);
|
|
23581
|
+
const isRegisteredWithZkEvm = isUserZkEvm(user);
|
|
23582
|
+
if (!isRegisteredWithIMX && !isRegisteredWithZkEvm) {
|
|
23583
|
+
throw new PassportError('User has not been registered', PassportErrorType.USER_NOT_REGISTERED_ERROR);
|
|
23584
|
+
}
|
|
23585
|
+
const headers = { Authorization: `Bearer ${user.accessToken}` };
|
|
23586
|
+
const linkWalletV2Request = {
|
|
23587
|
+
type: params.type,
|
|
23588
|
+
wallet_address: params.walletAddress,
|
|
23589
|
+
signature: params.signature,
|
|
23590
|
+
nonce: params.nonce,
|
|
23591
|
+
};
|
|
23592
|
+
try {
|
|
23593
|
+
const linkWalletV2Result = await this.multiRollupApiClients
|
|
23594
|
+
.passportProfileApi.linkWalletV2({ linkWalletV2Request }, { headers });
|
|
23595
|
+
return { ...linkWalletV2Result.data };
|
|
23596
|
+
}
|
|
23597
|
+
catch (error) {
|
|
23598
|
+
trackError('passport', 'linkWallet', error);
|
|
23599
|
+
if (isAxiosError$1(error) && error.response) {
|
|
23600
|
+
if (error.response.data && isAPIError(error.response.data)) {
|
|
23601
|
+
const { code, message } = error.response.data;
|
|
23602
|
+
switch (code) {
|
|
23603
|
+
case 'ALREADY_LINKED':
|
|
23604
|
+
throw new PassportError(message, PassportErrorType.LINK_WALLET_ALREADY_LINKED_ERROR);
|
|
23605
|
+
case 'MAX_WALLETS_LINKED':
|
|
23606
|
+
throw new PassportError(message, PassportErrorType.LINK_WALLET_MAX_WALLETS_LINKED_ERROR);
|
|
23607
|
+
case 'DUPLICATE_NONCE':
|
|
23608
|
+
throw new PassportError(message, PassportErrorType.LINK_WALLET_DUPLICATE_NONCE_ERROR);
|
|
23609
|
+
case 'VALIDATION_ERROR':
|
|
23610
|
+
throw new PassportError(message, PassportErrorType.LINK_WALLET_VALIDATION_ERROR);
|
|
23611
|
+
default:
|
|
23612
|
+
throw new PassportError(message, PassportErrorType.LINK_WALLET_GENERIC_ERROR);
|
|
23613
|
+
}
|
|
23614
|
+
}
|
|
23615
|
+
else if (error.response.status) {
|
|
23616
|
+
// Handle unexpected error with a generic error message
|
|
23617
|
+
throw new PassportError(`Link wallet request failed with status code ${error.response.status}`, PassportErrorType.LINK_WALLET_GENERIC_ERROR);
|
|
23618
|
+
}
|
|
23619
|
+
}
|
|
23620
|
+
let message = 'Link wallet request failed';
|
|
23621
|
+
if (error instanceof Error) {
|
|
23622
|
+
message += `: ${error.message}`;
|
|
23623
|
+
}
|
|
23624
|
+
throw new PassportError(message, PassportErrorType.LINK_WALLET_GENERIC_ERROR);
|
|
23625
|
+
}
|
|
23626
|
+
}
|
|
23506
23627
|
}
|
|
23507
23628
|
|
|
23508
23629
|
export { JsonRpcError, Passport, PassportError, ProviderErrorCode, ProviderEvent, RpcErrorCode };
|
package/dist/webhook.js
CHANGED
|
@@ -145,7 +145,7 @@ const flattenProperties = (properties) => {
|
|
|
145
145
|
};
|
|
146
146
|
|
|
147
147
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
148
|
-
const SDK_VERSION = '1.46.
|
|
148
|
+
const SDK_VERSION = '1.46.1-alpha';
|
|
149
149
|
const getFrameParentDomain = () => {
|
|
150
150
|
if (isNode()) {
|
|
151
151
|
return '';
|
package/dist/x.js
CHANGED
|
@@ -9019,7 +9019,7 @@ const flattenProperties = (properties) => {
|
|
|
9019
9019
|
};
|
|
9020
9020
|
|
|
9021
9021
|
// WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
|
|
9022
|
-
const SDK_VERSION = '1.46.
|
|
9022
|
+
const SDK_VERSION = '1.46.1-alpha';
|
|
9023
9023
|
const getFrameParentDomain = () => {
|
|
9024
9024
|
if (isNode()) {
|
|
9025
9025
|
return '';
|
|
@@ -9288,7 +9288,7 @@ const addKeysToHeadersOverride = (baseConfig, overrides) => {
|
|
|
9288
9288
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
9289
9289
|
class ApiConfiguration extends index$2.Configuration {
|
|
9290
9290
|
}
|
|
9291
|
-
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.46.
|
|
9291
|
+
const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.46.1-alpha' };
|
|
9292
9292
|
/**
|
|
9293
9293
|
* @dev use createImmutableXConfiguration instead
|
|
9294
9294
|
*/
|
|
@@ -9329,7 +9329,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
|
|
|
9329
9329
|
coreContractAddress,
|
|
9330
9330
|
registrationContractAddress,
|
|
9331
9331
|
registrationV4ContractAddress,
|
|
9332
|
-
sdkVersion: 'ts-immutable-sdk-1.46.
|
|
9332
|
+
sdkVersion: 'ts-immutable-sdk-1.46.1-alpha',
|
|
9333
9333
|
baseConfig,
|
|
9334
9334
|
});
|
|
9335
9335
|
const production = ({ baseConfig }) => createImmutableXConfiguration({
|
package/package.json
CHANGED