@imtbl/sdk 0.1.9-alpha.1 → 0.1.9-alpha.3

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/index.cjs CHANGED
@@ -14,11 +14,6 @@ var seaportJs = require('@opensea/seaport-js');
14
14
  var units = require('@ethersproject/units');
15
15
  var bignumber = require('@ethersproject/bignumber');
16
16
  var detectEthereumProvider = require('@metamask/detect-provider');
17
- var ethers$1 = require('ethers/lib/ethers');
18
- var bridgeSdk = require('@imtbl/bridge-sdk');
19
- var dexSdk = require('@imtbl/dex-sdk');
20
- var jsxRuntime = require('react/jsx-runtime');
21
- require('react');
22
17
 
23
18
  function _interopNamespaceDefault(e) {
24
19
  var n = Object.create(null);
@@ -68,7 +63,7 @@ class ImmutableConfiguration {
68
63
  */
69
64
  // Some imports not used depending on template conditions
70
65
  // @ts-ignore
71
- const BASE_PATH$1 = "https://indexer-mr.dev.imtbl.com".replace(/\/+$/, "");
66
+ const BASE_PATH$1 = "https://indexer-mr.sandbox.imtbl.com".replace(/\/+$/, "");
72
67
  /**
73
68
  *
74
69
  * @export
@@ -751,96 +746,32 @@ class CollectionsApi extends BaseAPI$1 {
751
746
  * Do not edit the class manually.
752
747
  */
753
748
  /**
754
- * ListingsApi - axios parameter creator
749
+ * NftOwnersApi - axios parameter creator
755
750
  * @export
756
751
  */
757
- const ListingsApiAxiosParamCreator = function (configuration) {
752
+ const NftOwnersApiAxiosParamCreator = function (configuration) {
758
753
  return {
759
754
  /**
760
- * Create a listing
761
- * @summary Create a listing
762
- * @param {string} chainName
763
- * @param {CreateListingRequestBody} createListingRequestBody
764
- * @param {*} [options] Override http request option.
765
- * @throws {RequiredError}
766
- */
767
- createListing: async (chainName, createListingRequestBody, options = {}) => {
768
- // verify required parameter 'chainName' is not null or undefined
769
- assertParamExists$1('createListing', 'chainName', chainName);
770
- // verify required parameter 'createListingRequestBody' is not null or undefined
771
- assertParamExists$1('createListing', 'createListingRequestBody', createListingRequestBody);
772
- const localVarPath = `/v1/chains/{chain_name}/listings`
773
- .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
774
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
775
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL$1);
776
- let baseOptions;
777
- if (configuration) {
778
- baseOptions = configuration.baseOptions;
779
- }
780
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
781
- const localVarHeaderParameter = {};
782
- const localVarQueryParameter = {};
783
- localVarHeaderParameter['Content-Type'] = 'application/json';
784
- setSearchParams$1(localVarUrlObj, localVarQueryParameter);
785
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
786
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
787
- localVarRequestOptions.data = serializeDataIfNeeded(createListingRequestBody, localVarRequestOptions, configuration);
788
- return {
789
- url: toPathString$1(localVarUrlObj),
790
- options: localVarRequestOptions,
791
- };
792
- },
793
- /**
794
- * Get a single listing by ID
795
- * @summary Get a single listing by ID
796
- * @param {string} chainName
797
- * @param {string} listingId Global Order identifier
798
- * @param {*} [options] Override http request option.
799
- * @throws {RequiredError}
800
- */
801
- getListing: async (chainName, listingId, options = {}) => {
802
- // verify required parameter 'chainName' is not null or undefined
803
- assertParamExists$1('getListing', 'chainName', chainName);
804
- // verify required parameter 'listingId' is not null or undefined
805
- assertParamExists$1('getListing', 'listingId', listingId);
806
- const localVarPath = `/v1/chains/{chain_name}/listings/{listing_id}`
807
- .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)))
808
- .replace(`{${"listing_id"}}`, encodeURIComponent(String(listingId)));
809
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
810
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL$1);
811
- let baseOptions;
812
- if (configuration) {
813
- baseOptions = configuration.baseOptions;
814
- }
815
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
816
- const localVarHeaderParameter = {};
817
- const localVarQueryParameter = {};
818
- setSearchParams$1(localVarUrlObj, localVarQueryParameter);
819
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
820
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
821
- return {
822
- url: toPathString$1(localVarUrlObj),
823
- options: localVarRequestOptions,
824
- };
825
- },
826
- /**
827
- * List all listings
828
- * @summary List all listings
829
- * @param {string} chainName
830
- * @param {OrderStatus} [status] Order status to filter by
831
- * @param {string} [sellItemContractAddress] Sell item contract address to filter by
832
- * @param {string} [sellItemTokenId] Sell item token identifier to filter by
833
- * @param {number} [pageSize] Maximum number of orders to return per page
834
- * @param {'created_at' | 'updated_at' | 'buy_item_amount'} [sortBy] Order field to sort by
835
- * @param {'asc' | 'desc'} [sortDirection] Ascending or descending direction for sort
836
- * @param {string} [pageCursor] Page cursor to retrieve previous or next page. Use the value returned in the response.
755
+ * List NFT owners by token ID
756
+ * @summary List NFT owners by token ID
757
+ * @param {string} contractAddress The address of contract
758
+ * @param {string} tokenId An `uint256` token id as string
759
+ * @param {string} chainName The name of chain
760
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
761
+ * @param {number} [pageSize] Maximum number of items to return
837
762
  * @param {*} [options] Override http request option.
838
763
  * @throws {RequiredError}
839
764
  */
840
- listListings: async (chainName, status, sellItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options = {}) => {
765
+ listNFTOwners: async (contractAddress, tokenId, chainName, pageCursor, pageSize, options = {}) => {
766
+ // verify required parameter 'contractAddress' is not null or undefined
767
+ assertParamExists$1('listNFTOwners', 'contractAddress', contractAddress);
768
+ // verify required parameter 'tokenId' is not null or undefined
769
+ assertParamExists$1('listNFTOwners', 'tokenId', tokenId);
841
770
  // verify required parameter 'chainName' is not null or undefined
842
- assertParamExists$1('listListings', 'chainName', chainName);
843
- const localVarPath = `/v1/chains/{chain_name}/listings`
771
+ assertParamExists$1('listNFTOwners', 'chainName', chainName);
772
+ const localVarPath = `/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}/owners`
773
+ .replace(`{${"contract_address"}}`, encodeURIComponent(String(contractAddress)))
774
+ .replace(`{${"token_id"}}`, encodeURIComponent(String(tokenId)))
844
775
  .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
845
776
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
846
777
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL$1);
@@ -851,27 +782,12 @@ const ListingsApiAxiosParamCreator = function (configuration) {
851
782
  const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
852
783
  const localVarHeaderParameter = {};
853
784
  const localVarQueryParameter = {};
854
- if (status !== undefined) {
855
- localVarQueryParameter['status'] = status;
856
- }
857
- if (sellItemContractAddress !== undefined) {
858
- localVarQueryParameter['sell_item_contract_address'] = sellItemContractAddress;
859
- }
860
- if (sellItemTokenId !== undefined) {
861
- localVarQueryParameter['sell_item_token_id'] = sellItemTokenId;
785
+ if (pageCursor !== undefined) {
786
+ localVarQueryParameter['page_cursor'] = pageCursor;
862
787
  }
863
788
  if (pageSize !== undefined) {
864
789
  localVarQueryParameter['page_size'] = pageSize;
865
790
  }
866
- if (sortBy !== undefined) {
867
- localVarQueryParameter['sort_by'] = sortBy;
868
- }
869
- if (sortDirection !== undefined) {
870
- localVarQueryParameter['sort_direction'] = sortDirection;
871
- }
872
- if (pageCursor !== undefined) {
873
- localVarQueryParameter['page_cursor'] = pageCursor;
874
- }
875
791
  setSearchParams$1(localVarUrlObj, localVarQueryParameter);
876
792
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
877
793
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
@@ -883,143 +799,69 @@ const ListingsApiAxiosParamCreator = function (configuration) {
883
799
  };
884
800
  };
885
801
  /**
886
- * ListingsApi - functional programming interface
802
+ * NftOwnersApi - functional programming interface
887
803
  * @export
888
804
  */
889
- const ListingsApiFp = function (configuration) {
890
- const localVarAxiosParamCreator = ListingsApiAxiosParamCreator(configuration);
805
+ const NftOwnersApiFp = function (configuration) {
806
+ const localVarAxiosParamCreator = NftOwnersApiAxiosParamCreator(configuration);
891
807
  return {
892
808
  /**
893
- * Create a listing
894
- * @summary Create a listing
895
- * @param {string} chainName
896
- * @param {CreateListingRequestBody} createListingRequestBody
897
- * @param {*} [options] Override http request option.
898
- * @throws {RequiredError}
899
- */
900
- async createListing(chainName, createListingRequestBody, options) {
901
- const localVarAxiosArgs = await localVarAxiosParamCreator.createListing(chainName, createListingRequestBody, options);
902
- return createRequestFunction$1(localVarAxiosArgs, globalAxios$1, BASE_PATH$1, configuration);
903
- },
904
- /**
905
- * Get a single listing by ID
906
- * @summary Get a single listing by ID
907
- * @param {string} chainName
908
- * @param {string} listingId Global Order identifier
909
- * @param {*} [options] Override http request option.
910
- * @throws {RequiredError}
911
- */
912
- async getListing(chainName, listingId, options) {
913
- const localVarAxiosArgs = await localVarAxiosParamCreator.getListing(chainName, listingId, options);
914
- return createRequestFunction$1(localVarAxiosArgs, globalAxios$1, BASE_PATH$1, configuration);
915
- },
916
- /**
917
- * List all listings
918
- * @summary List all listings
919
- * @param {string} chainName
920
- * @param {OrderStatus} [status] Order status to filter by
921
- * @param {string} [sellItemContractAddress] Sell item contract address to filter by
922
- * @param {string} [sellItemTokenId] Sell item token identifier to filter by
923
- * @param {number} [pageSize] Maximum number of orders to return per page
924
- * @param {'created_at' | 'updated_at' | 'buy_item_amount'} [sortBy] Order field to sort by
925
- * @param {'asc' | 'desc'} [sortDirection] Ascending or descending direction for sort
926
- * @param {string} [pageCursor] Page cursor to retrieve previous or next page. Use the value returned in the response.
809
+ * List NFT owners by token ID
810
+ * @summary List NFT owners by token ID
811
+ * @param {string} contractAddress The address of contract
812
+ * @param {string} tokenId An `uint256` token id as string
813
+ * @param {string} chainName The name of chain
814
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
815
+ * @param {number} [pageSize] Maximum number of items to return
927
816
  * @param {*} [options] Override http request option.
928
817
  * @throws {RequiredError}
929
818
  */
930
- async listListings(chainName, status, sellItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options) {
931
- const localVarAxiosArgs = await localVarAxiosParamCreator.listListings(chainName, status, sellItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options);
819
+ async listNFTOwners(contractAddress, tokenId, chainName, pageCursor, pageSize, options) {
820
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listNFTOwners(contractAddress, tokenId, chainName, pageCursor, pageSize, options);
932
821
  return createRequestFunction$1(localVarAxiosArgs, globalAxios$1, BASE_PATH$1, configuration);
933
822
  },
934
823
  };
935
824
  };
936
825
  /**
937
- * ListingsApi - factory interface
826
+ * NftOwnersApi - factory interface
938
827
  * @export
939
828
  */
940
- const ListingsApiFactory = function (configuration, basePath, axios) {
941
- const localVarFp = ListingsApiFp(configuration);
829
+ const NftOwnersApiFactory = function (configuration, basePath, axios) {
830
+ const localVarFp = NftOwnersApiFp(configuration);
942
831
  return {
943
832
  /**
944
- * Create a listing
945
- * @summary Create a listing
946
- * @param {string} chainName
947
- * @param {CreateListingRequestBody} createListingRequestBody
948
- * @param {*} [options] Override http request option.
949
- * @throws {RequiredError}
950
- */
951
- createListing(chainName, createListingRequestBody, options) {
952
- return localVarFp.createListing(chainName, createListingRequestBody, options).then((request) => request(axios, basePath));
953
- },
954
- /**
955
- * Get a single listing by ID
956
- * @summary Get a single listing by ID
957
- * @param {string} chainName
958
- * @param {string} listingId Global Order identifier
959
- * @param {*} [options] Override http request option.
960
- * @throws {RequiredError}
961
- */
962
- getListing(chainName, listingId, options) {
963
- return localVarFp.getListing(chainName, listingId, options).then((request) => request(axios, basePath));
964
- },
965
- /**
966
- * List all listings
967
- * @summary List all listings
968
- * @param {string} chainName
969
- * @param {OrderStatus} [status] Order status to filter by
970
- * @param {string} [sellItemContractAddress] Sell item contract address to filter by
971
- * @param {string} [sellItemTokenId] Sell item token identifier to filter by
972
- * @param {number} [pageSize] Maximum number of orders to return per page
973
- * @param {'created_at' | 'updated_at' | 'buy_item_amount'} [sortBy] Order field to sort by
974
- * @param {'asc' | 'desc'} [sortDirection] Ascending or descending direction for sort
975
- * @param {string} [pageCursor] Page cursor to retrieve previous or next page. Use the value returned in the response.
833
+ * List NFT owners by token ID
834
+ * @summary List NFT owners by token ID
835
+ * @param {string} contractAddress The address of contract
836
+ * @param {string} tokenId An `uint256` token id as string
837
+ * @param {string} chainName The name of chain
838
+ * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
839
+ * @param {number} [pageSize] Maximum number of items to return
976
840
  * @param {*} [options] Override http request option.
977
841
  * @throws {RequiredError}
978
842
  */
979
- listListings(chainName, status, sellItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options) {
980
- return localVarFp.listListings(chainName, status, sellItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options).then((request) => request(axios, basePath));
843
+ listNFTOwners(contractAddress, tokenId, chainName, pageCursor, pageSize, options) {
844
+ return localVarFp.listNFTOwners(contractAddress, tokenId, chainName, pageCursor, pageSize, options).then((request) => request(axios, basePath));
981
845
  },
982
846
  };
983
847
  };
984
848
  /**
985
- * ListingsApi - object-oriented interface
849
+ * NftOwnersApi - object-oriented interface
986
850
  * @export
987
- * @class ListingsApi
851
+ * @class NftOwnersApi
988
852
  * @extends {BaseAPI}
989
853
  */
990
- class ListingsApi extends BaseAPI$1 {
991
- /**
992
- * Create a listing
993
- * @summary Create a listing
994
- * @param {ListingsApiCreateListingRequest} requestParameters Request parameters.
995
- * @param {*} [options] Override http request option.
996
- * @throws {RequiredError}
997
- * @memberof ListingsApi
998
- */
999
- createListing(requestParameters, options) {
1000
- return ListingsApiFp(this.configuration).createListing(requestParameters.chainName, requestParameters.createListingRequestBody, options).then((request) => request(this.axios, this.basePath));
1001
- }
1002
- /**
1003
- * Get a single listing by ID
1004
- * @summary Get a single listing by ID
1005
- * @param {ListingsApiGetListingRequest} requestParameters Request parameters.
1006
- * @param {*} [options] Override http request option.
1007
- * @throws {RequiredError}
1008
- * @memberof ListingsApi
1009
- */
1010
- getListing(requestParameters, options) {
1011
- return ListingsApiFp(this.configuration).getListing(requestParameters.chainName, requestParameters.listingId, options).then((request) => request(this.axios, this.basePath));
1012
- }
854
+ class NftOwnersApi extends BaseAPI$1 {
1013
855
  /**
1014
- * List all listings
1015
- * @summary List all listings
1016
- * @param {ListingsApiListListingsRequest} requestParameters Request parameters.
856
+ * List NFT owners by token ID
857
+ * @summary List NFT owners by token ID
858
+ * @param {NftOwnersApiListNFTOwnersRequest} requestParameters Request parameters.
1017
859
  * @param {*} [options] Override http request option.
1018
860
  * @throws {RequiredError}
1019
- * @memberof ListingsApi
861
+ * @memberof NftOwnersApi
1020
862
  */
1021
- listListings(requestParameters, options) {
1022
- return ListingsApiFp(this.configuration).listListings(requestParameters.chainName, requestParameters.status, requestParameters.sellItemContractAddress, requestParameters.sellItemTokenId, requestParameters.pageSize, requestParameters.sortBy, requestParameters.sortDirection, requestParameters.pageCursor, options).then((request) => request(this.axios, this.basePath));
863
+ listNFTOwners(requestParameters, options) {
864
+ return NftOwnersApiFp(this.configuration).listNFTOwners(requestParameters.contractAddress, requestParameters.tokenId, requestParameters.chainName, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
1023
865
  }
1024
866
  }
1025
867
 
@@ -1037,161 +879,28 @@ class ListingsApi extends BaseAPI$1 {
1037
879
  * Do not edit the class manually.
1038
880
  */
1039
881
  /**
1040
- * NftOwnersApi - axios parameter creator
882
+ * NftsApi - axios parameter creator
1041
883
  * @export
1042
884
  */
1043
- const NftOwnersApiAxiosParamCreator = function (configuration) {
885
+ const NftsApiAxiosParamCreator = function (configuration) {
1044
886
  return {
1045
887
  /**
1046
- * List NFT owners by token ID
1047
- * @summary List NFT owners by token ID
1048
- * @param {string} contractAddress The address of contract
888
+ * Get NFT by token ID
889
+ * @summary Get NFT by token ID
890
+ * @param {string} contractAddress The address of NFT contract
1049
891
  * @param {string} tokenId An `uint256` token id as string
1050
892
  * @param {string} chainName The name of chain
1051
- * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
1052
- * @param {number} [pageSize] Maximum number of items to return
1053
893
  * @param {*} [options] Override http request option.
1054
894
  * @throws {RequiredError}
1055
895
  */
1056
- listNFTOwners: async (contractAddress, tokenId, chainName, pageCursor, pageSize, options = {}) => {
896
+ getNFT: async (contractAddress, tokenId, chainName, options = {}) => {
1057
897
  // verify required parameter 'contractAddress' is not null or undefined
1058
- assertParamExists$1('listNFTOwners', 'contractAddress', contractAddress);
898
+ assertParamExists$1('getNFT', 'contractAddress', contractAddress);
1059
899
  // verify required parameter 'tokenId' is not null or undefined
1060
- assertParamExists$1('listNFTOwners', 'tokenId', tokenId);
900
+ assertParamExists$1('getNFT', 'tokenId', tokenId);
1061
901
  // verify required parameter 'chainName' is not null or undefined
1062
- assertParamExists$1('listNFTOwners', 'chainName', chainName);
1063
- const localVarPath = `/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}/owners`
1064
- .replace(`{${"contract_address"}}`, encodeURIComponent(String(contractAddress)))
1065
- .replace(`{${"token_id"}}`, encodeURIComponent(String(tokenId)))
1066
- .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
1067
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1068
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL$1);
1069
- let baseOptions;
1070
- if (configuration) {
1071
- baseOptions = configuration.baseOptions;
1072
- }
1073
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
1074
- const localVarHeaderParameter = {};
1075
- const localVarQueryParameter = {};
1076
- if (pageCursor !== undefined) {
1077
- localVarQueryParameter['page_cursor'] = pageCursor;
1078
- }
1079
- if (pageSize !== undefined) {
1080
- localVarQueryParameter['page_size'] = pageSize;
1081
- }
1082
- setSearchParams$1(localVarUrlObj, localVarQueryParameter);
1083
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1084
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1085
- return {
1086
- url: toPathString$1(localVarUrlObj),
1087
- options: localVarRequestOptions,
1088
- };
1089
- },
1090
- };
1091
- };
1092
- /**
1093
- * NftOwnersApi - functional programming interface
1094
- * @export
1095
- */
1096
- const NftOwnersApiFp = function (configuration) {
1097
- const localVarAxiosParamCreator = NftOwnersApiAxiosParamCreator(configuration);
1098
- return {
1099
- /**
1100
- * List NFT owners by token ID
1101
- * @summary List NFT owners by token ID
1102
- * @param {string} contractAddress The address of contract
1103
- * @param {string} tokenId An `uint256` token id as string
1104
- * @param {string} chainName The name of chain
1105
- * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
1106
- * @param {number} [pageSize] Maximum number of items to return
1107
- * @param {*} [options] Override http request option.
1108
- * @throws {RequiredError}
1109
- */
1110
- async listNFTOwners(contractAddress, tokenId, chainName, pageCursor, pageSize, options) {
1111
- const localVarAxiosArgs = await localVarAxiosParamCreator.listNFTOwners(contractAddress, tokenId, chainName, pageCursor, pageSize, options);
1112
- return createRequestFunction$1(localVarAxiosArgs, globalAxios$1, BASE_PATH$1, configuration);
1113
- },
1114
- };
1115
- };
1116
- /**
1117
- * NftOwnersApi - factory interface
1118
- * @export
1119
- */
1120
- const NftOwnersApiFactory = function (configuration, basePath, axios) {
1121
- const localVarFp = NftOwnersApiFp(configuration);
1122
- return {
1123
- /**
1124
- * List NFT owners by token ID
1125
- * @summary List NFT owners by token ID
1126
- * @param {string} contractAddress The address of contract
1127
- * @param {string} tokenId An `uint256` token id as string
1128
- * @param {string} chainName The name of chain
1129
- * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
1130
- * @param {number} [pageSize] Maximum number of items to return
1131
- * @param {*} [options] Override http request option.
1132
- * @throws {RequiredError}
1133
- */
1134
- listNFTOwners(contractAddress, tokenId, chainName, pageCursor, pageSize, options) {
1135
- return localVarFp.listNFTOwners(contractAddress, tokenId, chainName, pageCursor, pageSize, options).then((request) => request(axios, basePath));
1136
- },
1137
- };
1138
- };
1139
- /**
1140
- * NftOwnersApi - object-oriented interface
1141
- * @export
1142
- * @class NftOwnersApi
1143
- * @extends {BaseAPI}
1144
- */
1145
- class NftOwnersApi extends BaseAPI$1 {
1146
- /**
1147
- * List NFT owners by token ID
1148
- * @summary List NFT owners by token ID
1149
- * @param {NftOwnersApiListNFTOwnersRequest} requestParameters Request parameters.
1150
- * @param {*} [options] Override http request option.
1151
- * @throws {RequiredError}
1152
- * @memberof NftOwnersApi
1153
- */
1154
- listNFTOwners(requestParameters, options) {
1155
- return NftOwnersApiFp(this.configuration).listNFTOwners(requestParameters.contractAddress, requestParameters.tokenId, requestParameters.chainName, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
1156
- }
1157
- }
1158
-
1159
- /* tslint:disable */
1160
- /* eslint-disable */
1161
- /**
1162
- * Immutable X API
1163
- * Immutable Multi Rollup API
1164
- *
1165
- * The version of the OpenAPI document: 1.0.0
1166
- * Contact: support@immutable.com
1167
- *
1168
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
1169
- * https://openapi-generator.tech
1170
- * Do not edit the class manually.
1171
- */
1172
- /**
1173
- * NftsApi - axios parameter creator
1174
- * @export
1175
- */
1176
- const NftsApiAxiosParamCreator = function (configuration) {
1177
- return {
1178
- /**
1179
- * Get NFT by token ID
1180
- * @summary Get NFT by token ID
1181
- * @param {string} contractAddress The address of NFT contract
1182
- * @param {string} tokenId An `uint256` token id as string
1183
- * @param {string} chainName The name of chain
1184
- * @param {*} [options] Override http request option.
1185
- * @throws {RequiredError}
1186
- */
1187
- getNFT: async (contractAddress, tokenId, chainName, options = {}) => {
1188
- // verify required parameter 'contractAddress' is not null or undefined
1189
- assertParamExists$1('getNFT', 'contractAddress', contractAddress);
1190
- // verify required parameter 'tokenId' is not null or undefined
1191
- assertParamExists$1('getNFT', 'tokenId', tokenId);
1192
- // verify required parameter 'chainName' is not null or undefined
1193
- assertParamExists$1('getNFT', 'chainName', chainName);
1194
- const localVarPath = `/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}`
902
+ assertParamExists$1('getNFT', 'chainName', chainName);
903
+ const localVarPath = `/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}`
1195
904
  .replace(`{${"contract_address"}}`, encodeURIComponent(String(contractAddress)))
1196
905
  .replace(`{${"token_id"}}`, encodeURIComponent(String(tokenId)))
1197
906
  .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
@@ -1473,7 +1182,7 @@ const OrdersApiAxiosParamCreator = function (configuration) {
1473
1182
  assertParamExists$1('createListing', 'chainName', chainName);
1474
1183
  // verify required parameter 'createListingRequestBody' is not null or undefined
1475
1184
  assertParamExists$1('createListing', 'createListingRequestBody', createListingRequestBody);
1476
- const localVarPath = `/v1/chains/{chain_name}/listings`
1185
+ const localVarPath = `/v1/chains/{chain_name}/orders/listings`
1477
1186
  .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
1478
1187
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
1479
1188
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL$1);
@@ -1507,7 +1216,7 @@ const OrdersApiAxiosParamCreator = function (configuration) {
1507
1216
  assertParamExists$1('getListing', 'chainName', chainName);
1508
1217
  // verify required parameter 'listingId' is not null or undefined
1509
1218
  assertParamExists$1('getListing', 'listingId', listingId);
1510
- const localVarPath = `/v1/chains/{chain_name}/listings/{listing_id}`
1219
+ const localVarPath = `/v1/chains/{chain_name}/orders/listings/{listing_id}`
1511
1220
  .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)))
1512
1221
  .replace(`{${"listing_id"}}`, encodeURIComponent(String(listingId)));
1513
1222
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
@@ -1533,6 +1242,7 @@ const OrdersApiAxiosParamCreator = function (configuration) {
1533
1242
  * @param {string} chainName
1534
1243
  * @param {OrderStatus} [status] Order status to filter by
1535
1244
  * @param {string} [sellItemContractAddress] Sell item contract address to filter by
1245
+ * @param {string} [buyItemContractAddress] Buy item contract address to filter by
1536
1246
  * @param {string} [sellItemTokenId] Sell item token identifier to filter by
1537
1247
  * @param {number} [pageSize] Maximum number of orders to return per page
1538
1248
  * @param {'created_at' | 'updated_at' | 'buy_item_amount'} [sortBy] Order field to sort by
@@ -1541,10 +1251,10 @@ const OrdersApiAxiosParamCreator = function (configuration) {
1541
1251
  * @param {*} [options] Override http request option.
1542
1252
  * @throws {RequiredError}
1543
1253
  */
1544
- listListings: async (chainName, status, sellItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options = {}) => {
1254
+ listListings: async (chainName, status, sellItemContractAddress, buyItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options = {}) => {
1545
1255
  // verify required parameter 'chainName' is not null or undefined
1546
1256
  assertParamExists$1('listListings', 'chainName', chainName);
1547
- const localVarPath = `/v1/chains/{chain_name}/listings`
1257
+ const localVarPath = `/v1/chains/{chain_name}/orders/listings`
1548
1258
  .replace(`{${"chain_name"}}`, encodeURIComponent(String(chainName)));
1549
1259
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
1550
1260
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL$1);
@@ -1561,6 +1271,9 @@ const OrdersApiAxiosParamCreator = function (configuration) {
1561
1271
  if (sellItemContractAddress !== undefined) {
1562
1272
  localVarQueryParameter['sell_item_contract_address'] = sellItemContractAddress;
1563
1273
  }
1274
+ if (buyItemContractAddress !== undefined) {
1275
+ localVarQueryParameter['buy_item_contract_address'] = buyItemContractAddress;
1276
+ }
1564
1277
  if (sellItemTokenId !== undefined) {
1565
1278
  localVarQueryParameter['sell_item_token_id'] = sellItemTokenId;
1566
1279
  }
@@ -1623,6 +1336,7 @@ const OrdersApiFp = function (configuration) {
1623
1336
  * @param {string} chainName
1624
1337
  * @param {OrderStatus} [status] Order status to filter by
1625
1338
  * @param {string} [sellItemContractAddress] Sell item contract address to filter by
1339
+ * @param {string} [buyItemContractAddress] Buy item contract address to filter by
1626
1340
  * @param {string} [sellItemTokenId] Sell item token identifier to filter by
1627
1341
  * @param {number} [pageSize] Maximum number of orders to return per page
1628
1342
  * @param {'created_at' | 'updated_at' | 'buy_item_amount'} [sortBy] Order field to sort by
@@ -1631,8 +1345,8 @@ const OrdersApiFp = function (configuration) {
1631
1345
  * @param {*} [options] Override http request option.
1632
1346
  * @throws {RequiredError}
1633
1347
  */
1634
- async listListings(chainName, status, sellItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options) {
1635
- const localVarAxiosArgs = await localVarAxiosParamCreator.listListings(chainName, status, sellItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options);
1348
+ async listListings(chainName, status, sellItemContractAddress, buyItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options) {
1349
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listListings(chainName, status, sellItemContractAddress, buyItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options);
1636
1350
  return createRequestFunction$1(localVarAxiosArgs, globalAxios$1, BASE_PATH$1, configuration);
1637
1351
  },
1638
1352
  };
@@ -1672,6 +1386,7 @@ const OrdersApiFactory = function (configuration, basePath, axios) {
1672
1386
  * @param {string} chainName
1673
1387
  * @param {OrderStatus} [status] Order status to filter by
1674
1388
  * @param {string} [sellItemContractAddress] Sell item contract address to filter by
1389
+ * @param {string} [buyItemContractAddress] Buy item contract address to filter by
1675
1390
  * @param {string} [sellItemTokenId] Sell item token identifier to filter by
1676
1391
  * @param {number} [pageSize] Maximum number of orders to return per page
1677
1392
  * @param {'created_at' | 'updated_at' | 'buy_item_amount'} [sortBy] Order field to sort by
@@ -1680,8 +1395,8 @@ const OrdersApiFactory = function (configuration, basePath, axios) {
1680
1395
  * @param {*} [options] Override http request option.
1681
1396
  * @throws {RequiredError}
1682
1397
  */
1683
- listListings(chainName, status, sellItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options) {
1684
- return localVarFp.listListings(chainName, status, sellItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options).then((request) => request(axios, basePath));
1398
+ listListings(chainName, status, sellItemContractAddress, buyItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options) {
1399
+ return localVarFp.listListings(chainName, status, sellItemContractAddress, buyItemContractAddress, sellItemTokenId, pageSize, sortBy, sortDirection, pageCursor, options).then((request) => request(axios, basePath));
1685
1400
  },
1686
1401
  };
1687
1402
  };
@@ -1723,7 +1438,7 @@ class OrdersApi extends BaseAPI$1 {
1723
1438
  * @memberof OrdersApi
1724
1439
  */
1725
1440
  listListings(requestParameters, options) {
1726
- return OrdersApiFp(this.configuration).listListings(requestParameters.chainName, requestParameters.status, requestParameters.sellItemContractAddress, requestParameters.sellItemTokenId, requestParameters.pageSize, requestParameters.sortBy, requestParameters.sortDirection, requestParameters.pageCursor, options).then((request) => request(this.axios, this.basePath));
1441
+ return OrdersApiFp(this.configuration).listListings(requestParameters.chainName, requestParameters.status, requestParameters.sellItemContractAddress, requestParameters.buyItemContractAddress, requestParameters.sellItemTokenId, requestParameters.pageSize, requestParameters.sortBy, requestParameters.sortDirection, requestParameters.pageCursor, options).then((request) => request(this.axios, this.basePath));
1727
1442
  }
1728
1443
  }
1729
1444
 
@@ -1756,7 +1471,7 @@ const PassportApiAxiosParamCreator = function (configuration) {
1756
1471
  createCounterfactualAddress: async (createCounterfactualAddressRequest, options = {}) => {
1757
1472
  // verify required parameter 'createCounterfactualAddressRequest' is not null or undefined
1758
1473
  assertParamExists$1('createCounterfactualAddress', 'createCounterfactualAddressRequest', createCounterfactualAddressRequest);
1759
- const localVarPath = `/v1/counterfactual-address`;
1474
+ const localVarPath = `/passport-mr/v1/counterfactual-address`;
1760
1475
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
1761
1476
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL$1);
1762
1477
  let baseOptions;
@@ -2256,9 +1971,13 @@ const ActivityType = {
2256
1971
  * https://openapi-generator.tech
2257
1972
  * Do not edit the class manually.
2258
1973
  */
2259
- const BuyItemItemTypeEnum = {
2260
- Native: 'NATIVE',
2261
- Erc20: 'ERC20'
1974
+ /**
1975
+ * The collection contract type
1976
+ * @export
1977
+ * @enum {string}
1978
+ */
1979
+ const CollectionContractType = {
1980
+ Erc721: 'ERC721'
2262
1981
  };
2263
1982
 
2264
1983
  /* tslint:disable */
@@ -2274,13 +1993,25 @@ const BuyItemItemTypeEnum = {
2274
1993
  * https://openapi-generator.tech
2275
1994
  * Do not edit the class manually.
2276
1995
  */
1996
+ const CreateOrderProtocolDataOrderTypeEnum = {
1997
+ FullRestricted: 'FULL_RESTRICTED'
1998
+ };
1999
+
2000
+ /* tslint:disable */
2001
+ /* eslint-disable */
2277
2002
  /**
2278
- * The collection contract type
2279
- * @export
2280
- * @enum {string}
2003
+ * Immutable X API
2004
+ * Immutable Multi Rollup API
2005
+ *
2006
+ * The version of the OpenAPI document: 1.0.0
2007
+ * Contact: support@immutable.com
2008
+ *
2009
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2010
+ * https://openapi-generator.tech
2011
+ * Do not edit the class manually.
2281
2012
  */
2282
- const CollectionContractType = {
2283
- Erc721: 'ERC721'
2013
+ const ERC20ItemItemTypeEnum = {
2014
+ Erc20: 'ERC20'
2284
2015
  };
2285
2016
 
2286
2017
  /* tslint:disable */
@@ -2296,8 +2027,8 @@ const CollectionContractType = {
2296
2027
  * https://openapi-generator.tech
2297
2028
  * Do not edit the class manually.
2298
2029
  */
2299
- const CreateOrderProtocolDataOrderTypeEnum = {
2300
- FullRestricted: 'FULL_RESTRICTED'
2030
+ const ERC721ItemItemTypeEnum = {
2031
+ Erc721: 'ERC721'
2301
2032
  };
2302
2033
 
2303
2034
  /* tslint:disable */
@@ -2352,18 +2083,8 @@ const NFTContractType = {
2352
2083
  * https://openapi-generator.tech
2353
2084
  * Do not edit the class manually.
2354
2085
  */
2355
- /**
2356
- * The Order status
2357
- * @export
2358
- * @enum {string}
2359
- */
2360
- const OrderStatus$1 = {
2361
- Pending: 'PENDING',
2362
- Active: 'ACTIVE',
2363
- Inactive: 'INACTIVE',
2364
- Filled: 'FILLED',
2365
- Cancelled: 'CANCELLED',
2366
- Expired: 'EXPIRED'
2086
+ const NativeItemItemTypeEnum = {
2087
+ Native: 'NATIVE'
2367
2088
  };
2368
2089
 
2369
2090
  /* tslint:disable */
@@ -2379,8 +2100,18 @@ const OrderStatus$1 = {
2379
2100
  * https://openapi-generator.tech
2380
2101
  * Do not edit the class manually.
2381
2102
  */
2382
- const SaleFeeTypeEnum = {
2383
- Royalty: 'ROYALTY'
2103
+ /**
2104
+ * The Order status
2105
+ * @export
2106
+ * @enum {string}
2107
+ */
2108
+ const OrderStatus$1 = {
2109
+ Pending: 'PENDING',
2110
+ Active: 'ACTIVE',
2111
+ Inactive: 'INACTIVE',
2112
+ Filled: 'FILLED',
2113
+ Cancelled: 'CANCELLED',
2114
+ Expired: 'EXPIRED'
2384
2115
  };
2385
2116
 
2386
2117
  /* tslint:disable */
@@ -2396,8 +2127,8 @@ const SaleFeeTypeEnum = {
2396
2127
  * https://openapi-generator.tech
2397
2128
  * Do not edit the class manually.
2398
2129
  */
2399
- const SellItemItemTypeEnum = {
2400
- Erc721: 'ERC721'
2130
+ const SaleFeeTypeEnum = {
2131
+ Royalty: 'ROYALTY'
2401
2132
  };
2402
2133
 
2403
2134
  /* tslint:disable */
@@ -2449,7 +2180,6 @@ var index = /*#__PURE__*/Object.freeze({
2449
2180
  ActivitiesApiFactory: ActivitiesApiFactory,
2450
2181
  ActivitiesApiFp: ActivitiesApiFp,
2451
2182
  ActivityType: ActivityType,
2452
- BuyItemItemTypeEnum: BuyItemItemTypeEnum,
2453
2183
  ChainsApi: ChainsApi,
2454
2184
  ChainsApiAxiosParamCreator: ChainsApiAxiosParamCreator,
2455
2185
  ChainsApiFactory: ChainsApiFactory,
@@ -2461,12 +2191,11 @@ var index = /*#__PURE__*/Object.freeze({
2461
2191
  CollectionsApiFp: CollectionsApiFp,
2462
2192
  Configuration: Configuration$1,
2463
2193
  CreateOrderProtocolDataOrderTypeEnum: CreateOrderProtocolDataOrderTypeEnum,
2194
+ ERC20ItemItemTypeEnum: ERC20ItemItemTypeEnum,
2195
+ ERC721ItemItemTypeEnum: ERC721ItemItemTypeEnum,
2464
2196
  FeeFeeTypeEnum: FeeFeeTypeEnum,
2465
- ListingsApi: ListingsApi,
2466
- ListingsApiAxiosParamCreator: ListingsApiAxiosParamCreator,
2467
- ListingsApiFactory: ListingsApiFactory,
2468
- ListingsApiFp: ListingsApiFp,
2469
2197
  NFTContractType: NFTContractType,
2198
+ NativeItemItemTypeEnum: NativeItemItemTypeEnum,
2470
2199
  NftOwnersApi: NftOwnersApi,
2471
2200
  NftOwnersApiAxiosParamCreator: NftOwnersApiAxiosParamCreator,
2472
2201
  NftOwnersApiFactory: NftOwnersApiFactory,
@@ -2485,7 +2214,6 @@ var index = /*#__PURE__*/Object.freeze({
2485
2214
  PassportApiFactory: PassportApiFactory,
2486
2215
  PassportApiFp: PassportApiFp,
2487
2216
  SaleFeeTypeEnum: SaleFeeTypeEnum,
2488
- SellItemItemTypeEnum: SellItemItemTypeEnum,
2489
2217
  TokenContractType: TokenContractType,
2490
2218
  TokensApi: TokensApi,
2491
2219
  TokensApiAxiosParamCreator: TokensApiAxiosParamCreator,
@@ -7049,7 +6777,7 @@ class AuthManager {
7049
6777
  }
7050
6778
  static mapOidcUserToDomainModel = (oidcUser) => {
7051
6779
  const passport = oidcUser.profile?.passport;
7052
- return {
6780
+ const user = {
7053
6781
  expired: oidcUser.expired,
7054
6782
  idToken: oidcUser.id_token,
7055
6783
  accessToken: oidcUser.access_token,
@@ -7059,10 +6787,21 @@ class AuthManager {
7059
6787
  email: oidcUser.profile.email,
7060
6788
  nickname: oidcUser.profile.nickname,
7061
6789
  },
7062
- etherKey: passport?.ether_key || '',
7063
- starkKey: passport?.stark_key || '',
7064
- userAdminKey: passport?.user_admin_key || '',
7065
6790
  };
6791
+ if (passport?.imx_eth_address) {
6792
+ user.imx = {
6793
+ ethAddress: passport?.imx_eth_address,
6794
+ starkAddress: passport?.imx_stark_address,
6795
+ userAdminAddress: passport?.imx_user_admin_address,
6796
+ };
6797
+ }
6798
+ if (passport?.zkevm_eth_address) {
6799
+ user.zkEvm = {
6800
+ ethAddress: passport?.zkevm_eth_address,
6801
+ userAdminAddress: passport?.zkevm_user_admin_address,
6802
+ };
6803
+ }
6804
+ return user;
7066
6805
  };
7067
6806
  async login() {
7068
6807
  return withPassportError(async () => {
@@ -7130,7 +6869,7 @@ const getStarkSigner = async (signer) => withPassportError(async () => {
7130
6869
 
7131
6870
  async function exchangeTransfer$1({ user, starkSigner, request, exchangesApi, }) {
7132
6871
  return withPassportError(async () => {
7133
- const ethAddress = user.etherKey;
6872
+ const { ethAddress } = user.imx;
7134
6873
  const transferAmount = request.amount;
7135
6874
  const signableResult = await exchangesApi.getExchangeSignableTransfer({
7136
6875
  id: request.transactionID,
@@ -7328,7 +7067,7 @@ class ConfirmationScreen {
7328
7067
  const ERC721$1 = 'ERC721';
7329
7068
  async function createOrder$1({ starkSigner, user, request, ordersApi, confirmationScreen, }) {
7330
7069
  return withPassportError(async () => {
7331
- const ethAddress = user.etherKey;
7070
+ const { ethAddress } = user.imx;
7332
7071
  const amountSell = request.sell.type === ERC721$1 ? '1' : request.sell.amount;
7333
7072
  const amountBuy = request.buy.type === ERC721$1 ? '1' : request.buy.amount;
7334
7073
  const getSignableOrderRequestV3 = {
@@ -7444,7 +7183,7 @@ async function registerPassport({ ethSigner, starkSigner, usersApi }, authorizat
7444
7183
 
7445
7184
  async function createTrade$1({ request, tradesApi, user, starkSigner, confirmationScreen, }) {
7446
7185
  return withPassportError(async () => {
7447
- const ethAddress = user.etherKey;
7186
+ const { ethAddress } = user.imx;
7448
7187
  const getSignableTradeRequest = {
7449
7188
  expiration_timestamp: request.expiration_timestamp,
7450
7189
  fees: request.fees,
@@ -7554,7 +7293,7 @@ async function transfer$1({ request, transfersApi, starkSigner, user, imxPublicA
7554
7293
  return withPassportError(async () => {
7555
7294
  const transferAmount = request.type === ERC721$2 ? '1' : request.amount;
7556
7295
  const getSignableTransferRequest = {
7557
- sender: user.etherKey,
7296
+ sender: user.imx.ethAddress,
7558
7297
  token: convertToSignableToken(request),
7559
7298
  amount: transferAmount,
7560
7299
  receiver: request.receiver,
@@ -7600,7 +7339,7 @@ async function transfer$1({ request, transfersApi, starkSigner, user, imxPublicA
7600
7339
  }
7601
7340
  async function batchNftTransfer({ user, starkSigner, request, transfersApi, confirmationScreen, }) {
7602
7341
  return withPassportError(async () => {
7603
- const ethAddress = user.etherKey;
7342
+ const { ethAddress } = user.imx;
7604
7343
  const signableRequests = request.map((nftTransfer) => ({
7605
7344
  amount: '1',
7606
7345
  token: convertToSignableToken({
@@ -7752,7 +7491,7 @@ class PassportImxProvider {
7752
7491
  throw new PassportError('Operation not supported', PassportErrorType.OPERATION_NOT_SUPPORTED_ERROR);
7753
7492
  }
7754
7493
  getAddress() {
7755
- return Promise.resolve(this.user.etherKey);
7494
+ return Promise.resolve(this.user.imx.ethAddress);
7756
7495
  }
7757
7496
  }
7758
7497
 
@@ -7788,10 +7527,10 @@ class PassportImxProviderFactory {
7788
7527
  const web3Provider = new providers.Web3Provider(magicRpcProvider);
7789
7528
  const ethSigner = web3Provider.getSigner();
7790
7529
  const starkSigner = await getStarkSigner(ethSigner);
7791
- if (!user.etherKey) {
7792
- const userWithEtherKey = await this.registerStarkEx(ethSigner, starkSigner, user.accessToken);
7530
+ if (!user.imx?.ethAddress) {
7531
+ const userImx = await this.registerStarkEx(ethSigner, starkSigner, user.accessToken);
7793
7532
  return new PassportImxProvider({
7794
- user: userWithEtherKey,
7533
+ user: userImx,
7795
7534
  starkSigner,
7796
7535
  immutableXClient: this.immutableXClient,
7797
7536
  imxPublicApiDomain: this.config.imxPublicApiDomain,
@@ -7816,7 +7555,7 @@ class PassportImxProviderFactory {
7816
7555
  // User metadata is updated asynchronously. Poll userinfo endpoint until it is updated.
7817
7556
  const updatedUser = await retryWithDelay(async () => {
7818
7557
  const user = await this.authManager.loginSilent();
7819
- const metadataExists = !!user?.etherKey && !!user?.starkKey && !!user?.userAdminKey;
7558
+ const metadataExists = !!user?.imx;
7820
7559
  if (metadataExists) {
7821
7560
  return user;
7822
7561
  }
@@ -7827,11 +7566,11 @@ class PassportImxProviderFactory {
7827
7566
  }
7828
7567
  }
7829
7568
 
7830
- var Networks;
7569
+ exports.Networks = void 0;
7831
7570
  (function (Networks) {
7832
7571
  Networks["PRODUCTION"] = "mainnet";
7833
7572
  Networks["SANDBOX"] = "goerli";
7834
- })(Networks || (Networks = {}));
7573
+ })(exports.Networks || (exports.Networks = {}));
7835
7574
 
7836
7575
  const validateConfiguration = (configuration, requiredKeys, prefix) => {
7837
7576
  const missingKeys = requiredKeys
@@ -7881,7 +7620,7 @@ class PassportConfiguration {
7881
7620
  else {
7882
7621
  switch (baseConfig.environment) {
7883
7622
  case exports.Environment.PRODUCTION: {
7884
- this.network = Networks.PRODUCTION;
7623
+ this.network = exports.Networks.PRODUCTION;
7885
7624
  this.authenticationDomain = 'https://auth.immutable.com';
7886
7625
  this.magicPublishableApiKey = 'pk_live_10F423798A540ED7';
7887
7626
  this.magicProviderId = 'fSMzaRQ4O7p4fttl7pCyGVtJS_G70P8SNsLXtPPGHo0=';
@@ -7891,7 +7630,7 @@ class PassportConfiguration {
7891
7630
  }
7892
7631
  case exports.Environment.SANDBOX:
7893
7632
  default: {
7894
- this.network = Networks.SANDBOX;
7633
+ this.network = exports.Networks.SANDBOX;
7895
7634
  this.authenticationDomain = 'https://auth.immutable.com';
7896
7635
  this.magicPublishableApiKey = 'pk_live_10F423798A540ED7';
7897
7636
  this.magicProviderId = 'fSMzaRQ4O7p4fttl7pCyGVtJS_G70P8SNsLXtPPGHo0=';
@@ -8863,7 +8602,7 @@ class ImmutableApiClient {
8863
8602
  ...listOrderParams,
8864
8603
  });
8865
8604
  }
8866
- async createListing({ orderHash, orderComponents, offerer, orderSignature, }) {
8605
+ async createListing({ orderHash, orderComponents, orderSignature, }) {
8867
8606
  if (orderComponents.offer.length !== 1) {
8868
8607
  throw new Error('Only one item can be listed at a time');
8869
8608
  }
@@ -8881,7 +8620,7 @@ class ImmutableApiClient {
8881
8620
  chainName: this.chainName,
8882
8621
  requestBody: {
8883
8622
  order_hash: orderHash,
8884
- account_address: offerer,
8623
+ account_address: orderComponents.offerer,
8885
8624
  buy: [
8886
8625
  {
8887
8626
  item_type: Number(orderComponents.consideration[0].itemType)
@@ -9912,10 +9651,10 @@ class Orderbook {
9912
9651
  * the unsigned approval transaction, the typed order message for signing and
9913
9652
  * the order components that can be submitted to `createListing` with a signature.
9914
9653
  */
9915
- async prepareListing({ offerer, listingItem, considerationItem, orderExpiry, }) {
9916
- const erc721 = new ERC721Factory(listingItem.contractAddress, this.config.provider).create();
9917
- const royaltyInfo = await erc721.royaltyInfo(listingItem.tokenId, considerationItem.amount);
9918
- return this.seaport.prepareSeaportOrder(offerer, listingItem, considerationItem, royaltyInfo,
9654
+ async prepareListing({ makerAddress, sell, buy, orderExpiry, }) {
9655
+ const erc721 = new ERC721Factory(sell.contractAddress, this.config.provider).create();
9656
+ const royaltyInfo = await erc721.royaltyInfo(sell.tokenId, buy.amount);
9657
+ return this.seaport.prepareSeaportOrder(makerAddress, sell, buy, royaltyInfo,
9919
9658
  // Default order start to now
9920
9659
  new Date(),
9921
9660
  // Default order expiry to 2 years from now
@@ -9937,12 +9676,12 @@ class Orderbook {
9937
9676
  * @param {string} fulfillerAddress - The address of the account fulfilling the order.
9938
9677
  * @return {FulfillOrderResponse} Approval and fulfilment transactions.
9939
9678
  */
9940
- async fulfillOrder(listingId, fulfillerAddress) {
9679
+ async fulfillOrder(listingId, takerAddress) {
9941
9680
  const orderResult = await this.apiClient.getListing(listingId);
9942
9681
  if (orderResult.result.status !== OrderStatus.ACTIVE) {
9943
9682
  throw new Error(`Cannot fulfil order that is not active. Current status: ${orderResult.result.status}`);
9944
9683
  }
9945
- return this.seaport.fulfilOrder(orderResult.result, fulfillerAddress);
9684
+ return this.seaport.fulfilOrder(orderResult.result, takerAddress);
9946
9685
  }
9947
9686
  /**
9948
9687
  * Get an unsigned cancel order transaction. Orders can only be cancelled by
@@ -11024,1308 +10763,6 @@ class ProviderConfiguration {
11024
10763
  }
11025
10764
  }
11026
10765
 
11027
- function $parcel$interopDefault(a) {
11028
- return a && a.__esModule ? a.default : a;
11029
- }
11030
- /* eslint-disable class-methods-use-this */
11031
- const $762782b6c862d954$export$db5daa1b5156ccfe = [
11032
- {
11033
- constant: true,
11034
- inputs: [],
11035
- name: "name",
11036
- outputs: [
11037
- {
11038
- name: "",
11039
- type: "string"
11040
- }
11041
- ],
11042
- payable: false,
11043
- type: "function"
11044
- },
11045
- {
11046
- constant: true,
11047
- inputs: [],
11048
- name: "decimals",
11049
- outputs: [
11050
- {
11051
- name: "",
11052
- type: "uint8"
11053
- }
11054
- ],
11055
- payable: false,
11056
- type: "function"
11057
- },
11058
- {
11059
- constant: true,
11060
- inputs: [
11061
- {
11062
- name: "_owner",
11063
- type: "address"
11064
- }
11065
- ],
11066
- name: "balanceOf",
11067
- outputs: [
11068
- {
11069
- name: "balance",
11070
- type: "uint256"
11071
- }
11072
- ],
11073
- payable: false,
11074
- type: "function"
11075
- },
11076
- {
11077
- constant: true,
11078
- inputs: [],
11079
- name: "symbol",
11080
- outputs: [
11081
- {
11082
- name: "",
11083
- type: "string"
11084
- }
11085
- ],
11086
- payable: false,
11087
- type: "function"
11088
- }
11089
- ];
11090
-
11091
-
11092
- /**
11093
- * Enum representing the supported chains with their corresponding IDs.
11094
- */ exports.ChainId = void 0;
11095
- (function(ChainId) {
11096
- ChainId[ChainId["ETHEREUM"] = 1] = "ETHEREUM";
11097
- ChainId[ChainId["IMTBL_ZKEVM_TESTNET"] = 13372] = "IMTBL_ZKEVM_TESTNET";
11098
- ChainId[ChainId["SEPOLIA"] = 11155111] = "SEPOLIA";
11099
- ChainId[ChainId["IMTBL_ZKEVM_DEVNET"] = 13383] = "IMTBL_ZKEVM_DEVNET";
11100
- })(exports.ChainId || (exports.ChainId = {}));
11101
-
11102
-
11103
-
11104
- const $bc2bfebf768286d3$export$6a2ba3c3bd042990 = {
11105
- baseConfig: {
11106
- environment: (exports.Environment).SANDBOX
11107
- }
11108
- };
11109
-
11110
-
11111
- exports.ConnectionProviders = void 0;
11112
- (function(ConnectionProviders) {
11113
- ConnectionProviders["METAMASK"] = "metamask";
11114
- })(exports.ConnectionProviders || (exports.ConnectionProviders = {}));
11115
-
11116
-
11117
- exports.GasEstimateType = void 0;
11118
- (function(GasEstimateType) {
11119
- GasEstimateType["BRIDGE_TO_L2"] = "BRIDGE_TO_L2";
11120
- GasEstimateType["SWAP"] = "SWAP";
11121
- })(exports.GasEstimateType || (exports.GasEstimateType = {}));
11122
-
11123
-
11124
-
11125
- const $a47e48dd2c04791b$export$345c852d0dc8f1df = new Map([
11126
- [
11127
- (exports.ChainId).ETHEREUM,
11128
- "https://checkout-api.dev.immutable.com/v1/rpc/eth-mainnet"
11129
- ],
11130
- [
11131
- (exports.ChainId).IMTBL_ZKEVM_TESTNET,
11132
- "https://zkevm-rpc.sandbox.x.immutable.com"
11133
- ],
11134
- [
11135
- (exports.ChainId).SEPOLIA,
11136
- "https://checkout-api.dev.immutable.com/v1/rpc/eth-sepolia"
11137
- ],
11138
- [
11139
- (exports.ChainId).IMTBL_ZKEVM_DEVNET,
11140
- "https://zkevm-rpc.dev.x.immutable.com"
11141
- ]
11142
- ]);
11143
- const $a47e48dd2c04791b$export$6f24f3cef7d501c4 = new Map([
11144
- [
11145
- (exports.ChainId).ETHEREUM,
11146
- {
11147
- chainIdHex: "0x1",
11148
- chainName: "Ethereum",
11149
- rpcUrls: [
11150
- $a47e48dd2c04791b$export$345c852d0dc8f1df.get((exports.ChainId).ETHEREUM)
11151
- ],
11152
- nativeCurrency: {
11153
- name: "Ethereum",
11154
- symbol: "ETH",
11155
- decimals: 18
11156
- },
11157
- blockExplorerUrls: [
11158
- "https://etherscan.io/"
11159
- ]
11160
- }
11161
- ],
11162
- [
11163
- (exports.ChainId).IMTBL_ZKEVM_TESTNET,
11164
- {
11165
- chainIdHex: "0x343C",
11166
- chainName: "Immutable zkEVM Testnet",
11167
- rpcUrls: [
11168
- $a47e48dd2c04791b$export$345c852d0dc8f1df.get((exports.ChainId).IMTBL_ZKEVM_TESTNET)
11169
- ],
11170
- nativeCurrency: {
11171
- name: "IMX",
11172
- symbol: "IMX",
11173
- decimals: 18
11174
- }
11175
- }
11176
- ]
11177
- ]);
11178
- const $a47e48dd2c04791b$export$3e81fc0987227f10 = new Map([
11179
- [
11180
- (exports.ChainId).SEPOLIA,
11181
- {
11182
- chainIdHex: "0xaa36a7",
11183
- chainName: "Sepolia",
11184
- rpcUrls: [
11185
- $a47e48dd2c04791b$export$345c852d0dc8f1df.get((exports.ChainId).SEPOLIA)
11186
- ],
11187
- nativeCurrency: {
11188
- name: "Sep Eth",
11189
- symbol: "ETH",
11190
- decimals: 18
11191
- },
11192
- blockExplorerUrls: [
11193
- "https://sepolia.etherscan.io/"
11194
- ]
11195
- }
11196
- ],
11197
- [
11198
- (exports.ChainId).IMTBL_ZKEVM_DEVNET,
11199
- {
11200
- chainIdHex: "0x3447",
11201
- chainName: "Immutable zkEVM Devnet",
11202
- rpcUrls: [
11203
- $a47e48dd2c04791b$export$345c852d0dc8f1df.get((exports.ChainId).IMTBL_ZKEVM_DEVNET)
11204
- ],
11205
- nativeCurrency: {
11206
- name: "IMX",
11207
- symbol: "IMX",
11208
- decimals: 18
11209
- }
11210
- }
11211
- ]
11212
- ]);
11213
- exports.NetworkFilterTypes = void 0;
11214
- (function(NetworkFilterTypes) {
11215
- NetworkFilterTypes["ALL"] = "all";
11216
- })(exports.NetworkFilterTypes || (exports.NetworkFilterTypes = {}));
11217
-
11218
-
11219
-
11220
-
11221
- exports.TokenFilterTypes = void 0;
11222
- (function(TokenFilterTypes) {
11223
- TokenFilterTypes["SWAP"] = "swap";
11224
- TokenFilterTypes["BRIDGE"] = "bridge";
11225
- TokenFilterTypes["ALL"] = "all";
11226
- })(exports.TokenFilterTypes || (exports.TokenFilterTypes = {}));
11227
-
11228
-
11229
- /**
11230
- * Interface representing token information.
11231
- * @property {string} name - The token name.
11232
- * @property {string} symbol - The token symbol.
11233
- * @property {number} decimals - The token decimals.
11234
- * @property {string} [address] - The token contract address.
11235
- * @property {string} [icon] - The token icon URL/data:image.
11236
- */
11237
-
11238
-
11239
-
11240
- var $4f91c5f280efe242$export$35b06f0d33f57e26;
11241
- (function(WalletAction) {
11242
- WalletAction["CHECK_CONNECTION"] = "eth_accounts";
11243
- WalletAction["CONNECT"] = "eth_requestAccounts";
11244
- WalletAction["ADD_NETWORK"] = "wallet_addEthereumChain";
11245
- WalletAction["SWITCH_NETWORK"] = "wallet_switchEthereumChain";
11246
- WalletAction["GET_CHAINID"] = "eth_chainId";
11247
- })($4f91c5f280efe242$export$35b06f0d33f57e26 || ($4f91c5f280efe242$export$35b06f0d33f57e26 = {}));
11248
- exports.WalletFilterTypes = void 0;
11249
- (function(WalletFilterTypes) {
11250
- WalletFilterTypes["ALL"] = "all";
11251
- WalletFilterTypes["DESKTOP"] = "desktop";
11252
- WalletFilterTypes["MOBILE"] = "mobile";
11253
- })(exports.WalletFilterTypes || (exports.WalletFilterTypes = {}));
11254
-
11255
-
11256
- exports.WalletProviderName = void 0;
11257
- (function(WalletProviderName) {
11258
- WalletProviderName["METAMASK"] = "metamask";
11259
- })(exports.WalletProviderName || (exports.WalletProviderName = {}));
11260
- const $e768639828688ca3$export$44dde05038008549 = {
11261
- allowMistmatchedChainId: false,
11262
- allowUnsupportedProvider: false
11263
- };
11264
-
11265
-
11266
-
11267
-
11268
- /**
11269
- * The different types of errors that can be returned by the checkout process.
11270
- */ exports.CheckoutErrorType = void 0;
11271
- (function(CheckoutErrorType) {
11272
- CheckoutErrorType["WEB3_PROVIDER_ERROR"] = "WEB3_PROVIDER_ERROR";
11273
- CheckoutErrorType["PROVIDER_ERROR"] = "PROVIDER_ERROR";
11274
- CheckoutErrorType["DEFAULT_PROVIDER_ERROR"] = "DEFAULT_PROVIDER_ERROR";
11275
- CheckoutErrorType["CONNECT_PROVIDER_ERROR"] = "CONNECT_PROVIDER_ERROR";
11276
- CheckoutErrorType["GET_BALANCE_ERROR"] = "GET_BALANCE_ERROR";
11277
- CheckoutErrorType["GET_ERC20_BALANCE_ERROR"] = "GET_ERC20_BALANCE_ERROR";
11278
- CheckoutErrorType["GET_NETWORK_INFO_ERROR"] = "GET_NETWORK_INFO_ERROR";
11279
- CheckoutErrorType["METAMASK_PROVIDER_ERROR"] = "METAMASK_PROVIDER_ERROR";
11280
- CheckoutErrorType["CHAIN_NOT_SUPPORTED_ERROR"] = "CHAIN_NOT_SUPPORTED_ERROR";
11281
- CheckoutErrorType["PROVIDER_REQUEST_MISSING_ERROR"] = "PROVIDER_REQUEST_MISSING_ERROR";
11282
- CheckoutErrorType["PROVIDER_REQUEST_FAILED_ERROR"] = "PROVIDER_REQUEST_FAILED_ERROR";
11283
- CheckoutErrorType["USER_REJECTED_REQUEST_ERROR"] = "USER_REJECTED_REQUEST_ERROR";
11284
- CheckoutErrorType["TRANSACTION_FAILED"] = "TRANSACTION_FAILED";
11285
- CheckoutErrorType["INSUFFICIENT_FUNDS"] = "INSUFFICIENT_FUNDS";
11286
- CheckoutErrorType["UNPREDICTABLE_GAS_LIMIT"] = "UNPREDICTABLE_GAS_LIMIT";
11287
- CheckoutErrorType["INVALID_GAS_ESTIMATE_TYPE"] = "INVALID_GAS_ESTIMATE_TYPE";
11288
- })(exports.CheckoutErrorType || (exports.CheckoutErrorType = {}));
11289
- class $a8bc256d81a5e2c1$export$b722478a3cbfa3bc extends Error {
11290
- message;
11291
- type;
11292
- data;
11293
- constructor(message, type, data){
11294
- super(message);
11295
- this.message = message;
11296
- this.type = type;
11297
- this.data = data;
11298
- }
11299
- }
11300
- var $a8bc256d81a5e2c1$export$a22d4e0719ee6def;
11301
- (function(CheckoutInternalErrorType) {
11302
- CheckoutInternalErrorType["REJECTED_SWITCH_AFTER_ADDING_NETWORK"] = "REJECTED_SWITCH_AFTER_ADDING_NETWORK";
11303
- })($a8bc256d81a5e2c1$export$a22d4e0719ee6def || ($a8bc256d81a5e2c1$export$a22d4e0719ee6def = {}));
11304
- const $a8bc256d81a5e2c1$export$bacc563de539c6c3 = async (fn, customError)=>{
11305
- try {
11306
- return await fn();
11307
- } catch (error) {
11308
- const cause = `${error.message}` || "UnknownError";
11309
- const errorMessage = customError.message ? `[${customError.type}]:${customError.message}. Cause:${cause}` : `[${customError.type}] Cause:${cause}`;
11310
- if (error instanceof $a8bc256d81a5e2c1$export$b722478a3cbfa3bc) throw new $a8bc256d81a5e2c1$export$b722478a3cbfa3bc(errorMessage, customError.type, {
11311
- ...customError.data,
11312
- innerErrorType: error.type,
11313
- ...error.data
11314
- });
11315
- throw new $a8bc256d81a5e2c1$export$b722478a3cbfa3bc(errorMessage, customError.type, {
11316
- ...customError.data
11317
- });
11318
- }
11319
- };
11320
-
11321
-
11322
-
11323
-
11324
- /* eslint-disable @typescript-eslint/no-explicit-any */
11325
-
11326
-
11327
- var $497c134ecbc8a50f$exports = {};
11328
- $497c134ecbc8a50f$exports = JSON.parse('[{"chainId":1},{"chainId":11155111},{"chainId":13372},{"chainId":13383}]');
11329
-
11330
-
11331
- // this function needs to be in a separate file to prevent circular dependencies with ./network
11332
-
11333
-
11334
- async function $a1555a1d2c8d059b$export$c3ba3e93a9fee972(web3Provider) {
11335
- if (!web3Provider.provider.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Parsed provider is not a valid Web3Provider", (exports.CheckoutErrorType).WEB3_PROVIDER_ERROR);
11336
- const chainId = await web3Provider.provider.request({
11337
- method: ($4f91c5f280efe242$export$35b06f0d33f57e26).GET_CHAINID,
11338
- params: []
11339
- });
11340
- return parseInt(chainId, 16);
11341
- }
11342
-
11343
-
11344
- const $de192de6ef100f9f$var$UNRECOGNISED_CHAIN_ERROR_CODE = 4902; // error code (MetaMask)
11345
- // these functions should not be exported. These functions should be used as part of an exported function e.g switchWalletNetwork() above.
11346
- // make sure to check if(provider.provider?.request) in the exported function and throw an error
11347
- // eslint-disable-next-line consistent-return
11348
- async function $de192de6ef100f9f$var$switchNetworkInWallet(networkMap, web3Provider, chainId) {
11349
- if (web3Provider.provider?.request) return await web3Provider.provider.request({
11350
- method: ($4f91c5f280efe242$export$35b06f0d33f57e26).SWITCH_NETWORK,
11351
- params: [
11352
- {
11353
- chainId: networkMap.get(chainId)?.chainIdHex
11354
- }
11355
- ]
11356
- });
11357
- }
11358
- // TODO: Should these functions always return something?
11359
- // eslint-disable-next-line consistent-return
11360
- async function $de192de6ef100f9f$var$addNetworkToWallet(networkMap, web3Provider, chainId) {
11361
- if (web3Provider.provider?.request) {
11362
- const networkDetails = networkMap.get(chainId);
11363
- const addNetwork = {
11364
- chainId: networkDetails?.chainIdHex,
11365
- chainName: networkDetails?.chainName,
11366
- rpcUrls: networkDetails?.rpcUrls,
11367
- nativeCurrency: networkDetails?.nativeCurrency,
11368
- blockExplorerUrls: networkDetails?.blockExplorerUrls
11369
- };
11370
- return await web3Provider.provider.request({
11371
- method: ($4f91c5f280efe242$export$35b06f0d33f57e26).ADD_NETWORK,
11372
- params: [
11373
- addNetwork
11374
- ]
11375
- });
11376
- }
11377
- }
11378
- async function $de192de6ef100f9f$export$3043f6442a9ef563(config, { type: type = (exports.NetworkFilterTypes).ALL , exclude: exclude }) {
11379
- const { networkMap: networkMap } = config;
11380
- const list = ((/*@__PURE__*/$parcel$interopDefault($497c134ecbc8a50f$exports))).filter((network)=>{
11381
- const allowAllTokens = type === (exports.NetworkFilterTypes).ALL;
11382
- const networkNotExcluded = !(exclude || []).map((exc)=>exc.chainId).includes(network.chainId);
11383
- return allowAllTokens && networkNotExcluded;
11384
- });
11385
- const allowedNetworks = [];
11386
- list.forEach((element)=>{
11387
- const newNetwork = networkMap.get(element.chainId);
11388
- if (newNetwork) allowedNetworks.push({
11389
- name: newNetwork.chainName,
11390
- chainId: parseInt(newNetwork.chainIdHex, 16),
11391
- nativeCurrency: newNetwork.nativeCurrency,
11392
- isSupported: true
11393
- });
11394
- });
11395
- return {
11396
- networks: allowedNetworks
11397
- };
11398
- }
11399
- async function $de192de6ef100f9f$export$79f13b4cfaaf0d09(config, web3Provider) {
11400
- const { networkMap: networkMap } = config;
11401
- return ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
11402
- try {
11403
- const network = await web3Provider.getNetwork();
11404
- if (Array.from(networkMap.keys()).includes(network.chainId)) {
11405
- const chainIdNetworkInfo = networkMap.get(network.chainId);
11406
- return {
11407
- name: chainIdNetworkInfo.chainName,
11408
- chainId: parseInt(chainIdNetworkInfo.chainIdHex, 16),
11409
- nativeCurrency: chainIdNetworkInfo.nativeCurrency,
11410
- isSupported: true
11411
- };
11412
- }
11413
- return {
11414
- chainId: network.chainId,
11415
- name: network.name,
11416
- isSupported: false
11417
- };
11418
- } catch (err) {
11419
- const chainId = await ($a1555a1d2c8d059b$export$c3ba3e93a9fee972)(web3Provider);
11420
- const isSupported = Array.from(networkMap.keys()).includes(chainId);
11421
- return {
11422
- chainId: chainId,
11423
- isSupported: isSupported
11424
- };
11425
- }
11426
- }, {
11427
- type: (exports.CheckoutErrorType).GET_NETWORK_INFO_ERROR
11428
- });
11429
- }
11430
- async function $de192de6ef100f9f$export$b827d9418aeb5dbd(config, web3Provider, chainId) {
11431
- const { networkMap: networkMap } = config;
11432
- const allowedNetworks = await $de192de6ef100f9f$export$3043f6442a9ef563(config, {
11433
- type: (exports.NetworkFilterTypes).ALL
11434
- });
11435
- if (!allowedNetworks.networks.some((network)=>network.chainId === chainId)) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Chain:${chainId} is not a supported chain`, (exports.CheckoutErrorType).CHAIN_NOT_SUPPORTED_ERROR);
11436
- // WT-1146 - Refer to the README in this folder for explantion on the switch network flow
11437
- try {
11438
- await $de192de6ef100f9f$var$switchNetworkInWallet(networkMap, web3Provider, chainId);
11439
- } catch (err) {
11440
- if (err.code === $de192de6ef100f9f$var$UNRECOGNISED_CHAIN_ERROR_CODE) try {
11441
- await $de192de6ef100f9f$var$addNetworkToWallet(networkMap, web3Provider, chainId);
11442
- // eslint-disable-next-line @typescript-eslint/no-shadow
11443
- } catch (err) {
11444
- throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("User cancelled add network request", (exports.CheckoutErrorType).USER_REJECTED_REQUEST_ERROR);
11445
- }
11446
- else throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("User cancelled switch network request", (exports.CheckoutErrorType).USER_REJECTED_REQUEST_ERROR);
11447
- }
11448
- const newProvider = new (providers.Web3Provider)(web3Provider.provider);
11449
- const newProviderNetwork = await newProvider.getNetwork();
11450
- if (newProviderNetwork.chainId !== chainId) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("User cancelled switch network request", (exports.CheckoutErrorType).USER_REJECTED_REQUEST_ERROR);
11451
- const networkInfo = await $de192de6ef100f9f$export$79f13b4cfaaf0d09(config, newProvider);
11452
- return {
11453
- network: networkInfo,
11454
- provider: newProvider
11455
- };
11456
- }
11457
-
11458
-
11459
-
11460
-
11461
-
11462
- var $cda6003506e4182e$exports = {};
11463
- $cda6003506e4182e$exports = JSON.parse("[{\"chainId\":13383,\"name\":\"IMX\",\"symbol\":\"IMX\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 139 113' style='enable-background:new 0 0 139 113;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bclip-path:url(%23SVGID_00000053504646934646330740000009134454895836103350_);%7D .st1%7Bfill:%2317B5CB;%7D%0A%3C/style%3E%3Cg%3E%3Cdefs%3E%3Crect id='SVGID_1_' width='139' height='113'/%3E%3C/defs%3E%3CclipPath id='SVGID_00000035518931339590433170000002358037249938198420_'%3E%3Cuse xlink:href='%23SVGID_1_' style='overflow:visible;'/%3E%3C/clipPath%3E%3Cg style='clip-path:url(%23SVGID_00000035518931339590433170000002358037249938198420_);'%3E%3Cpath class='st1' d='M124.1,0h14.6L79.5,67.6c-1.5,1.7-1.6,4.3-0.1,6.1l34.1,39.7H98.3L66.8,76.6l-1.6-2c-1.5-1.7-1.4-4.4,0.1-6.1 L124.1,0z'/%3E%3Cpath class='st1' d='M91.2,73.7c-1-1.1-1.3-2.7-1-4.1c0.3-0.8,0.8-1.6,1.4-2.2l3.9-4.3l43.5,50.3h-13.8 C125.2,113.4,99.7,83.6,91.2,73.7z'/%3E%3Cpath class='st1' d='M15.2,113.4H0l46.6-53.9c1.5-1.7,1.5-4.3,0-6L0.4,0H15l46.5,53.9c1.2,1.6,1.4,3.9,0.1,5.4 C49.4,73.4,15.2,113.4,15.2,113.4z'/%3E%3Cpath class='st1' d='M40.6,0h-14l43.1,49.9c0,0,0.1-0.1,4.9-5.8c1.3-1.5,1.6-3.4,0.1-4.9C65.7,30,40.6,0,40.6,0z'/%3E%3Cpath class='st1' d='M82.6,34.8L112.5,0H98.3L82.7,18.2l-4.5,5.3c-1.5,1.7-1.6,4.3-0.1,6.1C79.2,30.9,82.6,34.8,82.6,34.8z'/%3E%3Cpath class='st1' d='M56.6,78.6l-29.9,34.8h14.1l15.6-18.2l4.5-5.3c1.5-1.7,1.6-4.3,0.1-6.1C59.9,82.5,56.6,78.6,56.6,78.6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":13383,\"name\":\"FUN token\",\"address\":\"0xFEa9FF93DC0C6DC73F8Be009Fe7a22Bb9dcE8A2d\",\"symbol\":\"FUN\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":13383,\"name\":\"USDC\",\"address\":\"0x5893A5c7bc615Dfd36D7383366d00FFFca5f7178\",\"symbol\":\"USDC\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":13383,\"name\":\"WETH\",\"address\":\"0xD6d9321DCC42377C1fa8cFec665182c463b2392C\",\"symbol\":\"WETH\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":1,\"name\":\"Ethereum\",\"symbol\":\"ETH\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"address\":\"0xF57e7e7C23978C3cAEC3C3548E3D615c346e79fF\",\"chainId\":1,\"name\":\"Immutable X\",\"symbol\":\"IMX\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 139 113' style='enable-background:new 0 0 139 113;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bclip-path:url(%23SVGID_00000053504646934646330740000009134454895836103350_);%7D .st1%7Bfill:%2317B5CB;%7D%0A%3C/style%3E%3Cg%3E%3Cdefs%3E%3Crect id='SVGID_1_' width='139' height='113'/%3E%3C/defs%3E%3CclipPath id='SVGID_00000035518931339590433170000002358037249938198420_'%3E%3Cuse xlink:href='%23SVGID_1_' style='overflow:visible;'/%3E%3C/clipPath%3E%3Cg style='clip-path:url(%23SVGID_00000035518931339590433170000002358037249938198420_);'%3E%3Cpath class='st1' d='M124.1,0h14.6L79.5,67.6c-1.5,1.7-1.6,4.3-0.1,6.1l34.1,39.7H98.3L66.8,76.6l-1.6-2c-1.5-1.7-1.4-4.4,0.1-6.1 L124.1,0z'/%3E%3Cpath class='st1' d='M91.2,73.7c-1-1.1-1.3-2.7-1-4.1c0.3-0.8,0.8-1.6,1.4-2.2l3.9-4.3l43.5,50.3h-13.8 C125.2,113.4,99.7,83.6,91.2,73.7z'/%3E%3Cpath class='st1' d='M15.2,113.4H0l46.6-53.9c1.5-1.7,1.5-4.3,0-6L0.4,0H15l46.5,53.9c1.2,1.6,1.4,3.9,0.1,5.4 C49.4,73.4,15.2,113.4,15.2,113.4z'/%3E%3Cpath class='st1' d='M40.6,0h-14l43.1,49.9c0,0,0.1-0.1,4.9-5.8c1.3-1.5,1.6-3.4,0.1-4.9C65.7,30,40.6,0,40.6,0z'/%3E%3Cpath class='st1' d='M82.6,34.8L112.5,0H98.3L82.7,18.2l-4.5,5.3c-1.5,1.7-1.6,4.3-0.1,6.1C79.2,30.9,82.6,34.8,82.6,34.8z'/%3E%3Cpath class='st1' d='M56.6,78.6l-29.9,34.8h14.1l15.6-18.2l4.5-5.3c1.5-1.7,1.6-4.3,0.1-6.1C59.9,82.5,56.6,78.6,56.6,78.6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":11155111,\"name\":\"Sep Eth\",\"symbol\":\"ETH\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\"]},{\"chainId\":11155111,\"name\":\"Immutable Test token\",\"address\":\"0xd1da7e9b2Ce1a4024DaD52b3D37F4c5c91a525C1\",\"symbol\":\"TEST\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 139 113' style='enable-background:new 0 0 139 113;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bclip-path:url(%23SVGID_00000053504646934646330740000009134454895836103350_);%7D .st1%7Bfill:%2317B5CB;%7D%0A%3C/style%3E%3Cg%3E%3Cdefs%3E%3Crect id='SVGID_1_' width='139' height='113'/%3E%3C/defs%3E%3CclipPath id='SVGID_00000035518931339590433170000002358037249938198420_'%3E%3Cuse xlink:href='%23SVGID_1_' style='overflow:visible;'/%3E%3C/clipPath%3E%3Cg style='clip-path:url(%23SVGID_00000035518931339590433170000002358037249938198420_);'%3E%3Cpath class='st1' d='M124.1,0h14.6L79.5,67.6c-1.5,1.7-1.6,4.3-0.1,6.1l34.1,39.7H98.3L66.8,76.6l-1.6-2c-1.5-1.7-1.4-4.4,0.1-6.1 L124.1,0z'/%3E%3Cpath class='st1' d='M91.2,73.7c-1-1.1-1.3-2.7-1-4.1c0.3-0.8,0.8-1.6,1.4-2.2l3.9-4.3l43.5,50.3h-13.8 C125.2,113.4,99.7,83.6,91.2,73.7z'/%3E%3Cpath class='st1' d='M15.2,113.4H0l46.6-53.9c1.5-1.7,1.5-4.3,0-6L0.4,0H15l46.5,53.9c1.2,1.6,1.4,3.9,0.1,5.4 C49.4,73.4,15.2,113.4,15.2,113.4z'/%3E%3Cpath class='st1' d='M40.6,0h-14l43.1,49.9c0,0,0.1-0.1,4.9-5.8c1.3-1.5,1.6-3.4,0.1-4.9C65.7,30,40.6,0,40.6,0z'/%3E%3Cpath class='st1' d='M82.6,34.8L112.5,0H98.3L82.7,18.2l-4.5,5.3c-1.5,1.7-1.6,4.3-0.1,6.1C79.2,30.9,82.6,34.8,82.6,34.8z'/%3E%3Cpath class='st1' d='M56.6,78.6l-29.9,34.8h14.1l15.6-18.2l4.5-5.3c1.5-1.7,1.6-4.3,0.1-6.1C59.9,82.5,56.6,78.6,56.6,78.6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":11155111,\"name\":\"FUN token\",\"address\":\"0x741185AEFC3E539c1F42c1d6eeE8bFf1c89D70FE\",\"symbol\":\"FUN\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":11155111,\"name\":\"US Dollar Coin\",\"address\":\"0x1836E16b2036088490C2CFe4d11970Fc8e5884C4\",\"symbol\":\"USDC\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":13383,\"name\":\"DEX\",\"address\":\"0x8AC26EfCbf5D700b37A27aA00E6934e6904e7B8e\",\"symbol\":\"DEX\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":11155111,\"name\":\"DEX\",\"address\":\"0xaC953a0d7B67Fae17c87abf79f09D0f818AC66A2\",\"symbol\":\"DEX\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":1442,\"name\":\"WETH\",\"address\":\"0x4F062A3EAeC3730560aB89b5CE5aC0ab2C5517aE\",\"symbol\":\"WETH\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"address\":\"0x72958b06abdF2701AcE6ceb3cE0B8B1CE11E0851\",\"chainId\":1442,\"name\":\"Immutable X\",\"symbol\":\"IMX\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 139 113' style='enable-background:new 0 0 139 113;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bclip-path:url(%23SVGID_00000053504646934646330740000009134454895836103350_);%7D .st1%7Bfill:%2317B5CB;%7D%0A%3C/style%3E%3Cg%3E%3Cdefs%3E%3Crect id='SVGID_1_' width='139' height='113'/%3E%3C/defs%3E%3CclipPath id='SVGID_00000035518931339590433170000002358037249938198420_'%3E%3Cuse xlink:href='%23SVGID_1_' style='overflow:visible;'/%3E%3C/clipPath%3E%3Cg style='clip-path:url(%23SVGID_00000035518931339590433170000002358037249938198420_);'%3E%3Cpath class='st1' d='M124.1,0h14.6L79.5,67.6c-1.5,1.7-1.6,4.3-0.1,6.1l34.1,39.7H98.3L66.8,76.6l-1.6-2c-1.5-1.7-1.4-4.4,0.1-6.1 L124.1,0z'/%3E%3Cpath class='st1' d='M91.2,73.7c-1-1.1-1.3-2.7-1-4.1c0.3-0.8,0.8-1.6,1.4-2.2l3.9-4.3l43.5,50.3h-13.8 C125.2,113.4,99.7,83.6,91.2,73.7z'/%3E%3Cpath class='st1' d='M15.2,113.4H0l46.6-53.9c1.5-1.7,1.5-4.3,0-6L0.4,0H15l46.5,53.9c1.2,1.6,1.4,3.9,0.1,5.4 C49.4,73.4,15.2,113.4,15.2,113.4z'/%3E%3Cpath class='st1' d='M40.6,0h-14l43.1,49.9c0,0,0.1-0.1,4.9-5.8c1.3-1.5,1.6-3.4,0.1-4.9C65.7,30,40.6,0,40.6,0z'/%3E%3Cpath class='st1' d='M82.6,34.8L112.5,0H98.3L82.7,18.2l-4.5,5.3c-1.5,1.7-1.6,4.3-0.1,6.1C79.2,30.9,82.6,34.8,82.6,34.8z'/%3E%3Cpath class='st1' d='M56.6,78.6l-29.9,34.8h14.1l15.6-18.2l4.5-5.3c1.5-1.7,1.6-4.3,0.1-6.1C59.9,82.5,56.6,78.6,56.6,78.6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]}]");
11464
-
11465
-
11466
- const $efe60cea83bfc4e8$var$filterTokenList = ({ type: type , chainId: chainId , exclude: exclude })=>((/*@__PURE__*/$parcel$interopDefault($cda6003506e4182e$exports))).filter((token)=>{
11467
- const skipChainIdCheck = !chainId;
11468
- const chainIdMatches = token.chainId === chainId;
11469
- const tokenNotExcluded = !exclude?.map((excludeToken)=>excludeToken.address).includes(token.address || "");
11470
- const allowAllTokens = type === (exports.TokenFilterTypes).ALL;
11471
- const tokenAllowedForType = token.tokenFeatures.includes(type);
11472
- return (skipChainIdCheck || chainIdMatches) && tokenNotExcluded && (allowAllTokens || tokenAllowedForType);
11473
- });
11474
- const $efe60cea83bfc4e8$export$473cec51305fdae8 = async ({ type: type = (exports.TokenFilterTypes).ALL , chainId: chainId , exclude: exclude })=>{
11475
- const filteredTokenList = $efe60cea83bfc4e8$var$filterTokenList({
11476
- type: type,
11477
- chainId: chainId,
11478
- exclude: exclude
11479
- }).map((token)=>({
11480
- name: token.name,
11481
- symbol: token.symbol,
11482
- decimals: token.decimals,
11483
- address: token.address,
11484
- icon: token.icon
11485
- }));
11486
- return {
11487
- tokens: filteredTokenList
11488
- };
11489
- };
11490
-
11491
-
11492
-
11493
-
11494
- const $1564e43dde50bb61$export$df96cd8d56be0ab1 = async (config, web3Provider, walletAddress)=>await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
11495
- const networkInfo = await ($de192de6ef100f9f$export$79f13b4cfaaf0d09)(config, web3Provider);
11496
- if (!networkInfo.isSupported) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Chain:${networkInfo.chainId} is not a supported chain`, (exports.CheckoutErrorType).CHAIN_NOT_SUPPORTED_ERROR, {
11497
- chainName: networkInfo.name
11498
- });
11499
- const balance = await web3Provider.getBalance(walletAddress);
11500
- return {
11501
- balance: balance,
11502
- formattedBalance: (ethers.utils).formatUnits(balance, networkInfo.nativeCurrency.decimals),
11503
- token: networkInfo.nativeCurrency
11504
- };
11505
- }, {
11506
- type: (exports.CheckoutErrorType).GET_BALANCE_ERROR
11507
- });
11508
- async function $1564e43dde50bb61$export$60e0fe116a0e6ed0(web3Provider, walletAddress, contractAddress) {
11509
- return await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
11510
- const contract = new (ethers.Contract)(contractAddress, JSON.stringify(($762782b6c862d954$export$db5daa1b5156ccfe)), web3Provider);
11511
- const name = await contract.name();
11512
- const symbol = await contract.symbol();
11513
- const balance = await contract.balanceOf(walletAddress);
11514
- const decimals = await contract.decimals();
11515
- const formattedBalance = (ethers.utils).formatUnits(balance, decimals);
11516
- return {
11517
- balance: balance,
11518
- formattedBalance: formattedBalance,
11519
- token: {
11520
- name: name,
11521
- symbol: symbol,
11522
- decimals: decimals,
11523
- address: contractAddress
11524
- }
11525
- };
11526
- }, {
11527
- type: (exports.CheckoutErrorType).GET_ERC20_BALANCE_ERROR
11528
- });
11529
- }
11530
- const $1564e43dde50bb61$export$fee49741664a4d7e = async (config, web3Provider, walletAddress, chainId)=>{
11531
- const tokenList = await ($efe60cea83bfc4e8$export$473cec51305fdae8)({
11532
- type: (exports.TokenFilterTypes).ALL,
11533
- chainId: chainId
11534
- });
11535
- const allBalancePromises = [];
11536
- allBalancePromises.push($1564e43dde50bb61$export$df96cd8d56be0ab1(config, web3Provider, walletAddress));
11537
- tokenList.tokens.filter((token)=>token.address).forEach((token)=>allBalancePromises.push($1564e43dde50bb61$export$60e0fe116a0e6ed0(web3Provider, walletAddress, token.address ?? "")));
11538
- const balanceResults = await Promise.allSettled(allBalancePromises);
11539
- const getBalanceResults = balanceResults.filter((result)=>result.status === "fulfilled").map((fulfilledResult)=>fulfilledResult.value);
11540
- return {
11541
- balances: getBalanceResults
11542
- };
11543
- };
11544
-
11545
-
11546
-
11547
-
11548
-
11549
- /* eslint-disable @typescript-eslint/no-explicit-any */
11550
-
11551
- async function $c99672cf2294e839$export$2d040992269b4717(web3Provider) {
11552
- if (!web3Provider?.provider?.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Check wallet connection request failed", (exports.CheckoutErrorType).PROVIDER_REQUEST_FAILED_ERROR, {
11553
- rpcMethod: ($4f91c5f280efe242$export$35b06f0d33f57e26).CHECK_CONNECTION
11554
- });
11555
- let accounts = [];
11556
- try {
11557
- accounts = await web3Provider.provider.request({
11558
- method: (0, $4f91c5f280efe242$export$35b06f0d33f57e26).CHECK_CONNECTION,
11559
- params: []
11560
- });
11561
- } catch (err) {
11562
- throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Check wallet connection request failed", (exports.CheckoutErrorType).PROVIDER_REQUEST_FAILED_ERROR, {
11563
- rpcMethod: ($4f91c5f280efe242$export$35b06f0d33f57e26).CHECK_CONNECTION
11564
- });
11565
- }
11566
- // accounts[0] will have the active account if connected.
11567
- return {
11568
- isConnected: accounts && accounts.length > 0,
11569
- walletAddress: accounts[0] ?? ""
11570
- };
11571
- }
11572
- async function $c99672cf2294e839$export$43f7168eb392a88c(web3Provider) {
11573
- await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
11574
- if (!web3Provider || !web3Provider?.provider?.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Incompatible provider", (exports.CheckoutErrorType).PROVIDER_REQUEST_MISSING_ERROR, {
11575
- details: "Attempting to connect with an incompatible provider"
11576
- });
11577
- // this makes the request to the wallet to connect i.e request eth accounts ('eth_requestAccounts')
11578
- await web3Provider.provider.request({
11579
- method: ($4f91c5f280efe242$export$35b06f0d33f57e26).CONNECT,
11580
- params: []
11581
- });
11582
- }, {
11583
- type: (exports.CheckoutErrorType).USER_REJECTED_REQUEST_ERROR
11584
- });
11585
- return web3Provider;
11586
- }
11587
-
11588
-
11589
-
11590
-
11591
- /* eslint-disable @typescript-eslint/no-explicit-any */
11592
-
11593
-
11594
-
11595
- async function $5c763be0b0b81038$var$getMetaMaskProvider() {
11596
- const provider = await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>await (detectEthereumProvider)(), {
11597
- type: (exports.CheckoutErrorType).METAMASK_PROVIDER_ERROR
11598
- });
11599
- if (!provider || !provider.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("No MetaMask provider installed.", (exports.CheckoutErrorType).METAMASK_PROVIDER_ERROR);
11600
- return new (providers.Web3Provider)(provider);
11601
- }
11602
- async function $5c763be0b0b81038$export$500fbc0cd14cdbaa(defaultProvider) {
11603
- let web3Provider = null;
11604
- switch(defaultProvider){
11605
- case (exports.WalletProviderName).METAMASK:
11606
- web3Provider = await $5c763be0b0b81038$var$getMetaMaskProvider();
11607
- break;
11608
- default:
11609
- throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Provider not supported", (exports.CheckoutErrorType).DEFAULT_PROVIDER_ERROR);
11610
- }
11611
- return web3Provider;
11612
- }
11613
-
11614
-
11615
- // this function needs to be in a separate file to prevent circular dependencies with ./network
11616
-
11617
-
11618
-
11619
-
11620
-
11621
- function $bb88265fe45a0393$export$ebe4804963e71f98(web3Provider) {
11622
- if (web3Provider && web3Provider instanceof (providers.Web3Provider) && web3Provider.provider?.request) return true;
11623
- return false;
11624
- }
11625
- async function $bb88265fe45a0393$export$9e1fd9cc88c637a0(config, web3Provider, validateProviderOptions) {
11626
- return ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
11627
- if (!$bb88265fe45a0393$export$ebe4804963e71f98(web3Provider)) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Parsed provider is not a valid Web3Provider", (exports.CheckoutErrorType).WEB3_PROVIDER_ERROR);
11628
- // this sets the default options and overrides them with any parsed options
11629
- const options = {
11630
- ...($e768639828688ca3$export$44dde05038008549),
11631
- ...validateProviderOptions
11632
- };
11633
- const underlyingChainId = await ($a1555a1d2c8d059b$export$c3ba3e93a9fee972)(web3Provider);
11634
- let web3ChainId = web3Provider.network?.chainId;
11635
- try {
11636
- web3ChainId = web3Provider.network?.chainId;
11637
- if (!web3ChainId) web3ChainId = (await web3Provider.getNetwork()).chainId;
11638
- } catch (err) {
11639
- throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Unable to detect the web3Provider network", (exports.CheckoutErrorType).WEB3_PROVIDER_ERROR);
11640
- }
11641
- if (web3ChainId !== underlyingChainId && !options.allowMistmatchedChainId) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Your wallet has changed network, please switch to a supported network", (exports.CheckoutErrorType).WEB3_PROVIDER_ERROR);
11642
- const allowedNetworks = await ($de192de6ef100f9f$export$3043f6442a9ef563)(config, {
11643
- type: (exports.NetworkFilterTypes).ALL
11644
- });
11645
- const isAllowed = allowedNetworks.networks.some((network)=>network.chainId === underlyingChainId);
11646
- if (!isAllowed && !options.allowUnsupportedProvider) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Your wallet is connected to an unsupported network, please switch to a supported network", (exports.CheckoutErrorType).WEB3_PROVIDER_ERROR);
11647
- return web3Provider;
11648
- }, {
11649
- type: (exports.CheckoutErrorType).WEB3_PROVIDER_ERROR
11650
- });
11651
- }
11652
-
11653
-
11654
-
11655
-
11656
-
11657
- var $6f3c55a615003cbf$exports = {};
11658
- $6f3c55a615003cbf$exports = JSON.parse('[{"providerName":"metamask","icon":"some-icon-url","name":"MetaMask","description":"complete web3 wallet solution","platform":["desktop"]},{"providerName":"passport","icon":"pp-icon","name":"Passport","description":"Web3 with your email!","platform":["mobile","desktop"]},{"providerName":"gamestop","icon":"gme-icon","name":"GameStop","description":"Never stopping the game!","platform":["mobile"]}]');
11659
-
11660
-
11661
- async function $5cdde2ffe6360fec$export$a822caa90d7eef09({ type: type = (exports.WalletFilterTypes).ALL , exclude: exclude }) {
11662
- // todo:For async API call, use the CheckoutError with errorType:API_CALL_ERROR?? or any other
11663
- const filteredWalletsList = ((/*@__PURE__*/$parcel$interopDefault($6f3c55a615003cbf$exports))).filter((wallet)=>{
11664
- const walletNotExcluded = !exclude?.map((excludeWallet)=>excludeWallet.providerName).includes(wallet.providerName);
11665
- const allowAllWallets = type === (exports.WalletFilterTypes).ALL;
11666
- const walletsAllowedForType = wallet.platform.includes(type);
11667
- return walletNotExcluded && (allowAllWallets || walletsAllowedForType);
11668
- }).map((wallet)=>{
11669
- const { platform: platform , ...walletInfo } = wallet;
11670
- return walletInfo;
11671
- });
11672
- return {
11673
- wallets: filteredWalletsList
11674
- };
11675
- }
11676
-
11677
-
11678
-
11679
-
11680
-
11681
-
11682
-
11683
- const $dbe95599a4661140$export$8e0e7ffc78696d30 = async (web3Provider, transaction)=>{
11684
- try {
11685
- const transactionResponse = await web3Provider.getSigner().sendTransaction(transaction);
11686
- return {
11687
- transactionResponse: transactionResponse
11688
- };
11689
- } catch (err) {
11690
- if (err.code === (ethers.ethers).errors.INSUFFICIENT_FUNDS) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(err.message, (exports.CheckoutErrorType).INSUFFICIENT_FUNDS);
11691
- if (err.code === (ethers.ethers).errors.ACTION_REJECTED) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(err.message, (exports.CheckoutErrorType).USER_REJECTED_REQUEST_ERROR);
11692
- if (err.code === (ethers.ethers).errors.UNPREDICTABLE_GAS_LIMIT) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(err.message, (exports.CheckoutErrorType).UNPREDICTABLE_GAS_LIMIT);
11693
- throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(err.message, (exports.CheckoutErrorType).TRANSACTION_FAILED);
11694
- }
11695
- };
11696
-
11697
-
11698
-
11699
-
11700
-
11701
-
11702
-
11703
-
11704
-
11705
-
11706
-
11707
- const $570856c68db0bd36$var$GAS_LIMIT = 140000;
11708
- async function $570856c68db0bd36$var$getTokenInfoByAddress(tokenAddress, chainId) {
11709
- return (await $efe60cea83bfc4e8$export$473cec51305fdae8({
11710
- type: (exports.TokenFilterTypes).ALL,
11711
- chainId: chainId
11712
- })).tokens.find((token)=>(token.address || "NATIVE") === tokenAddress);
11713
- }
11714
- const $570856c68db0bd36$var$doesChainSupportEIP1559 = (feeData)=>!!feeData.maxFeePerGas && !!feeData.maxPriorityFeePerGas;
11715
- const $570856c68db0bd36$var$getGasPriceInWei = (feeData)=>$570856c68db0bd36$var$doesChainSupportEIP1559(feeData) ? (ethers.BigNumber).from(feeData.maxFeePerGas).add((ethers.BigNumber).from(feeData.maxPriorityFeePerGas)) : feeData.gasPrice && (ethers.BigNumber).from(feeData.gasPrice);
11716
- const $570856c68db0bd36$var$getGasEstimates = async (provider)=>{
11717
- const txnGasLimitInWei = $570856c68db0bd36$var$GAS_LIMIT; // todo: fetch gasLimit from bridgeSDK when they add new fn
11718
- const feeData = await provider.getFeeData();
11719
- const gasPriceInWei = $570856c68db0bd36$var$getGasPriceInWei(feeData);
11720
- if (!gasPriceInWei) return undefined;
11721
- return gasPriceInWei.mul(txnGasLimitInWei);
11722
- };
11723
- async function $570856c68db0bd36$export$51010590edbe56a6(provider, chainId, isApproveTxnRequired, gasTokenAddress) {
11724
- const token = await $570856c68db0bd36$var$getTokenInfoByAddress(gasTokenAddress || "NATIVE", chainId);
11725
- let estimatedAmount = await $570856c68db0bd36$var$getGasEstimates(provider);
11726
- if (!estimatedAmount) return {
11727
- estimatedAmount: undefined,
11728
- token: token
11729
- };
11730
- if (isApproveTxnRequired) estimatedAmount = estimatedAmount.add(estimatedAmount);
11731
- const result = {
11732
- estimatedAmount: estimatedAmount,
11733
- token: token
11734
- };
11735
- return result;
11736
- }
11737
- async function $570856c68db0bd36$export$9e73e22953cebcfc(tokenBridge, tokenAddress, destinationChainId) {
11738
- const bridgeFeeReq = {
11739
- token: tokenAddress
11740
- };
11741
- const bridgeFeeResponse = await tokenBridge.getFee(bridgeFeeReq);
11742
- const tokenInfo = await $570856c68db0bd36$var$getTokenInfoByAddress(tokenAddress, destinationChainId);
11743
- return {
11744
- bridgeFee: {
11745
- estimatedAmount: bridgeFeeResponse.feeAmount,
11746
- token: tokenInfo
11747
- },
11748
- bridgeable: bridgeFeeResponse.bridgeable
11749
- };
11750
- }
11751
-
11752
-
11753
-
11754
-
11755
-
11756
-
11757
- const $be6f32539b5e2cc9$var$chainId = 13383;
11758
- const $be6f32539b5e2cc9$var$commonRoutingTokens = [
11759
- {
11760
- chainId: $be6f32539b5e2cc9$var$chainId,
11761
- address: "0xFEa9FF93DC0C6DC73F8Be009Fe7a22Bb9dcE8A2d",
11762
- decimals: 18,
11763
- symbol: "FUN",
11764
- name: "The Fungibles Token"
11765
- },
11766
- {
11767
- chainId: $be6f32539b5e2cc9$var$chainId,
11768
- address: "0x12739A8f1A8035F439092D016DAE19A2874F30d2",
11769
- decimals: 18,
11770
- symbol: "USDC",
11771
- name: "US Dollar Coin"
11772
- },
11773
- {
11774
- chainId: $be6f32539b5e2cc9$var$chainId,
11775
- address: "0x8AC26EfCbf5D700b37A27aA00E6934e6904e7B8e",
11776
- decimals: 18,
11777
- symbol: "DEX",
11778
- name: "Dex"
11779
- }
11780
- ];
11781
- const $be6f32539b5e2cc9$var$contractOverrides = {
11782
- multicall: "0x7b19942581c9462D54155801fCA4a17edf3fD135",
11783
- coreFactory: "0xD17c98b38bA28c7eA1080317EB9AB2b9663BEd92",
11784
- quoterV2: "0x786ec643F231960D4C1A4E336990F8E7bF8f1277",
11785
- peripheryRouter: "0x0d44bB14Cc1dD999255aBB1576b4964D0439C63D",
11786
- migrator: "0x0Afe6F5f4DC34461A801420634239FFaD50A2e44",
11787
- nonfungiblePositionManager: "0xF674847fBcca5C80315e3AE37043Dce99F6CC529",
11788
- tickLens: "0x38034F18D38b74bdE496bdF60CCdBcb25B879e8d"
11789
- };
11790
- const $be6f32539b5e2cc9$export$3e9a43ac784794d5 = ()=>({
11791
- rpcURL: "https://zkevm-rpc.dev.x.immutable.com",
11792
- exchangeContracts: $be6f32539b5e2cc9$var$contractOverrides,
11793
- commonRoutingTokens: $be6f32539b5e2cc9$var$commonRoutingTokens,
11794
- nativeToken: {
11795
- chainId: $be6f32539b5e2cc9$var$chainId,
11796
- address: "",
11797
- decimals: 18,
11798
- symbol: "IMX",
11799
- name: "Immutable X Token"
11800
- }
11801
- });
11802
-
11803
-
11804
- async function $67fc622a2b913d5f$export$989eefe1274a439c(fromChainId, toChainId, readOnlyProviders, environment) {
11805
- const rootChainProvider = readOnlyProviders.get(fromChainId);
11806
- const childChainProvider = readOnlyProviders.get(toChainId);
11807
- if (!rootChainProvider) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Chain:${fromChainId} is not a supported chain`, (exports.CheckoutErrorType).CHAIN_NOT_SUPPORTED_ERROR);
11808
- if (!childChainProvider) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Chain:${toChainId} is not a supported chain`, (exports.CheckoutErrorType).CHAIN_NOT_SUPPORTED_ERROR);
11809
- const bridgeConfig = new (bridgeSdk.BridgeConfiguration)({
11810
- baseConfig: new (ImmutableConfiguration)({
11811
- environment: environment
11812
- }),
11813
- bridgeInstance: environment === (exports.Environment).PRODUCTION ? (bridgeSdk.ETH_MAINNET_TO_ZKEVM_MAINNET) : (bridgeSdk.ETH_SEPOLIA_TO_ZKEVM_DEVNET),
11814
- rootProvider: rootChainProvider,
11815
- childProvider: childChainProvider
11816
- });
11817
- return new (bridgeSdk.TokenBridge)(bridgeConfig);
11818
- }
11819
- async function $67fc622a2b913d5f$export$7cf6178417769841(chainId, environment) {
11820
- const exchange = new (dexSdk.Exchange)(new (dexSdk.ExchangeConfiguration)({
11821
- chainId: chainId,
11822
- baseConfig: new (ImmutableConfiguration)({
11823
- environment: environment
11824
- }),
11825
- overrides: ($be6f32539b5e2cc9$export$3e9a43ac784794d5)()
11826
- }));
11827
- return exchange;
11828
- }
11829
-
11830
-
11831
-
11832
-
11833
- var $d7b15ec974df6f92$exports = {};
11834
- $d7b15ec974df6f92$exports = JSON.parse('{"11155111":{"bridgeToL2Addresses":{"gasTokenAddress":"NATIVE","fromAddress":"0xd1da7e9b2Ce1a4024DaD52b3D37F4c5c91a525C1"},"swapAddresses":{"inAddress":"0xFEa9FF93DC0C6DC73F8Be009Fe7a22Bb9dcE8A2d","outAddress":"0x8AC26EfCbf5D700b37A27aA00E6934e6904e7B8e"}}}');
11835
-
11836
-
11837
- const $2e7bf45a7c9a9570$var$DUMMY_WALLET_ADDRESS = "0x0000000000000000000000000000000000000000";
11838
- const $2e7bf45a7c9a9570$var$DEFAULT_TOKEN_DECIMALS = 18;
11839
- const $2e7bf45a7c9a9570$var$getL1ChainId = (environment)=>{
11840
- if (environment === (exports.Environment).PRODUCTION) return (exports.ChainId).SEPOLIA;
11841
- return (exports.ChainId).SEPOLIA;
11842
- };
11843
- const $2e7bf45a7c9a9570$var$getL2ChainId = (environment)=>{
11844
- if (environment === (exports.Environment).PRODUCTION) return (exports.ChainId).IMTBL_ZKEVM_TESTNET;
11845
- return (exports.ChainId).IMTBL_ZKEVM_DEVNET;
11846
- };
11847
- async function $2e7bf45a7c9a9570$var$bridgeToL2GasEstimator(readOnlyProviders, environment, isSpendingCapApprovalRequired, tokenAddress) {
11848
- const fromChainId = $2e7bf45a7c9a9570$var$getL1ChainId(environment);
11849
- const toChainId = $2e7bf45a7c9a9570$var$getL2ChainId(environment);
11850
- const tokenAddresses = environment === (exports.Environment).PRODUCTION ? ((/*@__PURE__*/$parcel$interopDefault($d7b15ec974df6f92$exports)))[(exports.ChainId).SEPOLIA] : ((/*@__PURE__*/$parcel$interopDefault($d7b15ec974df6f92$exports)))[(exports.ChainId).SEPOLIA];
11851
- const { gasTokenAddress: gasTokenAddress , fromAddress: fromAddress } = tokenAddresses.bridgeToL2Addresses;
11852
- const provider = readOnlyProviders.get(fromChainId);
11853
- try {
11854
- const { estimatedAmount: estimatedAmount , token: token } = await (0, $570856c68db0bd36$export$51010590edbe56a6)(provider, fromChainId, isSpendingCapApprovalRequired, tokenAddress ?? gasTokenAddress);
11855
- const tokenBridge = await $67fc622a2b913d5f$export$989eefe1274a439c(fromChainId, toChainId, readOnlyProviders, environment);
11856
- const { bridgeFee: bridgeFee , bridgeable: bridgeable } = await (0, $570856c68db0bd36$export$9e73e22953cebcfc)(tokenBridge, fromAddress, toChainId);
11857
- return {
11858
- gasEstimateType: (0, exports.GasEstimateType).BRIDGE_TO_L2,
11859
- gasFee: {
11860
- estimatedAmount: estimatedAmount,
11861
- token: token
11862
- },
11863
- bridgeFee: {
11864
- estimatedAmount: bridgeFee?.estimatedAmount,
11865
- token: bridgeFee?.token
11866
- },
11867
- bridgeable: bridgeable
11868
- };
11869
- } catch {
11870
- // In the case of an error, just return an empty gas & bridge fee estimate
11871
- return {
11872
- gasEstimateType: (exports.GasEstimateType).BRIDGE_TO_L2,
11873
- gasFee: {},
11874
- bridgeFee: {},
11875
- bridgeable: false
11876
- };
11877
- }
11878
- }
11879
- async function $2e7bf45a7c9a9570$var$swapGasEstimator(environment) {
11880
- const tokenAddresses = environment === (exports.Environment).PRODUCTION ? ((/*@__PURE__*/$parcel$interopDefault($d7b15ec974df6f92$exports)))[(exports.ChainId).SEPOLIA] : ((/*@__PURE__*/$parcel$interopDefault($d7b15ec974df6f92$exports)))[(exports.ChainId).SEPOLIA];
11881
- const { inAddress: inAddress , outAddress: outAddress } = tokenAddresses.swapAddresses;
11882
- const chainId = $2e7bf45a7c9a9570$var$getL2ChainId(environment);
11883
- try {
11884
- const exchange = await $67fc622a2b913d5f$export$7cf6178417769841(chainId, environment);
11885
- // Create a fake transaction to get the gas from the quote
11886
- const { info: info } = await exchange.getUnsignedSwapTxFromAmountIn($2e7bf45a7c9a9570$var$DUMMY_WALLET_ADDRESS, inAddress, outAddress, (0, ethers$1.BigNumber).from((0, ethers$1.utils).parseUnits("1", $2e7bf45a7c9a9570$var$DEFAULT_TOKEN_DECIMALS)));
11887
- if (info.gasFeeEstimate === null) return {
11888
- gasEstimateType: (0, exports.GasEstimateType).SWAP,
11889
- gasFee: {}
11890
- };
11891
- let estimatedAmount;
11892
- if (info.gasFeeEstimate.amount) estimatedAmount = (0, ethers$1.BigNumber).from(info.gasFeeEstimate.amount);
11893
- return {
11894
- gasEstimateType: (0, exports.GasEstimateType).SWAP,
11895
- gasFee: {
11896
- estimatedAmount: estimatedAmount,
11897
- token: {
11898
- address: info.gasFeeEstimate?.token.address,
11899
- symbol: info.gasFeeEstimate?.token.symbol ?? "",
11900
- name: info.gasFeeEstimate?.token.name ?? "",
11901
- decimals: info.gasFeeEstimate?.token.decimals ?? $2e7bf45a7c9a9570$var$DEFAULT_TOKEN_DECIMALS
11902
- }
11903
- }
11904
- };
11905
- } catch {
11906
- // In the case of an error, just return an empty gas fee estimate
11907
- return {
11908
- gasEstimateType: (exports.GasEstimateType).SWAP,
11909
- gasFee: {}
11910
- };
11911
- }
11912
- }
11913
- async function $2e7bf45a7c9a9570$export$942c8de7174809fc(params, readOnlyProviders, environment) {
11914
- switch(params.gasEstimateType){
11915
- case (exports.GasEstimateType).BRIDGE_TO_L2:
11916
- return await $2e7bf45a7c9a9570$var$bridgeToL2GasEstimator(readOnlyProviders, environment, params.isSpendingCapApprovalRequired, params.tokenAddress);
11917
- case (exports.GasEstimateType).SWAP:
11918
- return await $2e7bf45a7c9a9570$var$swapGasEstimator(environment);
11919
- default:
11920
- throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Invalid type provided for gasEstimateType", (exports.CheckoutErrorType).INVALID_GAS_ESTIMATE_TYPE);
11921
- }
11922
- }
11923
-
11924
-
11925
-
11926
-
11927
-
11928
-
11929
-
11930
-
11931
- class $4013c5c91bb535f6$export$47a4ed4a38b9eecf extends Error {
11932
- message;
11933
- constructor(message){
11934
- super(message);
11935
- this.message = message;
11936
- }
11937
- }
11938
- class $4013c5c91bb535f6$export$4823433c4a67bbc6 {
11939
- environment;
11940
- networkMap;
11941
- constructor(config){
11942
- // validate input
11943
- if (!Object.values((exports.Environment)).includes(config.baseConfig.environment)) throw new $4013c5c91bb535f6$export$47a4ed4a38b9eecf("Invalid checkout configuration of environment");
11944
- this.environment = config.baseConfig.environment;
11945
- this.networkMap = config.baseConfig.environment === (exports.Environment).PRODUCTION ? ($a47e48dd2c04791b$export$6f24f3cef7d501c4) : ($a47e48dd2c04791b$export$3e81fc0987227f10);
11946
- }
11947
- }
11948
-
11949
-
11950
-
11951
-
11952
-
11953
-
11954
-
11955
-
11956
- async function $0e0060cb42e136d2$export$339cb2be73677b30(config, existingReadOnlyProviders) {
11957
- if (config.environment === (exports.Environment).PRODUCTION && existingReadOnlyProviders?.has((exports.ChainId).ETHEREUM) || config.environment === (exports.Environment).SANDBOX && existingReadOnlyProviders?.has((exports.ChainId).SEPOLIA)) return existingReadOnlyProviders;
11958
- const readOnlyProviders = new Map();
11959
- const allowedNetworks = await $de192de6ef100f9f$export$3043f6442a9ef563(config, {
11960
- type: (exports.NetworkFilterTypes).ALL
11961
- });
11962
- allowedNetworks.networks.forEach((networkInfo)=>{
11963
- const rpcUrl = config.networkMap.get(networkInfo.chainId)?.rpcUrls[0];
11964
- const provider = new (ethers.ethers).providers.JsonRpcProvider(rpcUrl);
11965
- readOnlyProviders.set(networkInfo.chainId, provider);
11966
- });
11967
- return readOnlyProviders;
11968
- }
11969
-
11970
-
11971
- class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
11972
- config;
11973
- readOnlyProviders;
11974
- constructor(config = ($bc2bfebf768286d3$export$6a2ba3c3bd042990)){
11975
- this.config = new ($4013c5c91bb535f6$export$4823433c4a67bbc6)(config);
11976
- this.readOnlyProviders = new Map();
11977
- }
11978
- /**
11979
- * Create a provider object which can be used within the Checkout class methods.
11980
- * @param {CreateProviderParams} params The data required to create a provider
11981
- * @returns A new provider object
11982
- * @throws {@link ErrorType}
11983
- */ async createProvider(params) {
11984
- const web3Provider = await $5c763be0b0b81038$export$500fbc0cd14cdbaa(params.walletProvider);
11985
- return {
11986
- provider: web3Provider
11987
- };
11988
- }
11989
- /**
11990
- * Check if a wallet is connected to the current application
11991
- * without requesting permission from the wallet and hence triggering a connect popup.
11992
- * @param {CheckConnectionParams} params - The necessary data required to verify a wallet connection status.
11993
- * @returns Wallet connection status details.
11994
- * @throws {@link ErrorType}
11995
- */ async checkIsWalletConnected(params) {
11996
- const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider, {
11997
- allowUnsupportedProvider: true
11998
- });
11999
- return $c99672cf2294e839$export$2d040992269b4717(web3Provider);
12000
- }
12001
- /**
12002
- * Establish a connection with a wallet provider such as MetaMask and returns the provider object and the current network details.
12003
- * @param {ConnectParams} params - The necessary data required to establish a connection with a wallet provider.
12004
- * @returns Wallet provider and current network information.
12005
- * @throws {@link ErrorType}
12006
- */ async connect(params) {
12007
- const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider, {
12008
- allowUnsupportedProvider: true
12009
- });
12010
- await $c99672cf2294e839$export$43f7168eb392a88c(web3Provider);
12011
- const networkInfo = await $de192de6ef100f9f$export$79f13b4cfaaf0d09(this.config, web3Provider);
12012
- return {
12013
- provider: web3Provider,
12014
- network: networkInfo
12015
- };
12016
- }
12017
- /**
12018
- * Switch the currently connected wallet to a new network.
12019
- * @param {SwitchNetworkParams} params - The necessary data required to switch network.
12020
- * @returns The new network information.
12021
- * @throws {@link ErrorType}
12022
- */ async switchNetwork(params) {
12023
- const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider, {
12024
- allowUnsupportedProvider: true,
12025
- allowMistmatchedChainId: true
12026
- });
12027
- const switchNetworkRes = await $de192de6ef100f9f$export$b827d9418aeb5dbd(this.config, web3Provider, params.chainId);
12028
- return switchNetworkRes;
12029
- }
12030
- /**
12031
- * Fetch the balance of the native token of the current connected network or,
12032
- * if a contract address is provided, it will return the balance of that ERC20 token. For example,
12033
- * if the wallet is connected to the Ethereum Mainnet then the function gets the wallet ETH L1 balance.
12034
- * @param {GetBalanceParams} params - The necessary data required to fetch the wallet balance.
12035
- * @returns Native token balance for the given wallet.
12036
- * @throws {@link ErrorType}
12037
- */ async getBalance(params) {
12038
- const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider);
12039
- if (!params.contractAddress || params.contractAddress === "") return await $1564e43dde50bb61$export$df96cd8d56be0ab1(this.config, web3Provider, params.walletAddress);
12040
- return await $1564e43dde50bb61$export$60e0fe116a0e6ed0(web3Provider, params.walletAddress, params.contractAddress);
12041
- }
12042
- /**
12043
- * Fetch all available balances (ERC20 & Native) of the current connected network of the given wallet.
12044
- * It will loop through the list of allowed tokens and check for balance on each one.
12045
- * @param {GetAllBalancesParams} params - The necessary data required to fetch all the wallet balances.
12046
- * @returns List of tokens balance for the given wallet.
12047
- * @throws {@link ErrorType}
12048
- */ async getAllBalances(params) {
12049
- const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider);
12050
- return $1564e43dde50bb61$export$fee49741664a4d7e(this.config, web3Provider, params.walletAddress, params.chainId);
12051
- }
12052
- /**
12053
- * Fetch the list of available networks that a wallet can add or/and switch to.
12054
- * @param {GetNetworkAllowListParams} params - The necessary data required to fetch the list of available networks.
12055
- * @returns List of networks.
12056
- * @throws {@link ErrorType}
12057
- */ async getNetworkAllowList(params) {
12058
- return await $de192de6ef100f9f$export$3043f6442a9ef563(this.config, params);
12059
- }
12060
- /**
12061
- * Get the list of tokens which are allowed to be used with the product.
12062
- * @param {GetTokenAllowListParams} params - The necessary data required to fetch the list of allowed tokens.
12063
- * @returns List of allowed tokens.
12064
- * @throws {@link ErrorType}
12065
- */ async getTokenAllowList(params) {
12066
- return await $efe60cea83bfc4e8$export$473cec51305fdae8(params);
12067
- }
12068
- /**
12069
- * Fetch the list of wallets which are available to connect with.
12070
- * @param {GetWalletAllowListParams} params - The necessary data required to fetch the list of allowed wallets.
12071
- * @returns List of allowed wallets.
12072
- * @throws {@link ErrorType}
12073
- */ async getWalletAllowList(params) {
12074
- return await $5cdde2ffe6360fec$export$a822caa90d7eef09(params);
12075
- }
12076
- /**
12077
- * Send a generic transaction to the provider.
12078
- * @param {SendTransactionParams} params - The necessary data required to send a transaction.
12079
- * @returns Transaction response.
12080
- * @throws {@link ErrorType}
12081
- * @remarks
12082
- * Further documenation can be found at [MetaMask | Sending Transactions](https://docs.metamask.io/guide/sending-transactions.html).
12083
- */ async sendTransaction(params) {
12084
- const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider);
12085
- return await $dbe95599a4661140$export$8e0e7ffc78696d30(web3Provider, params.transaction);
12086
- }
12087
- /**
12088
- * Get network information about the currently selected network.
12089
- * @param {GetNetworkParams} params - The necessary data required to get the current network information.
12090
- * @returns Network details.
12091
- * @throws {@link ErrorType}
12092
- */ async getNetworkInfo(params) {
12093
- const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider, {
12094
- allowUnsupportedProvider: true,
12095
- allowMistmatchedChainId: true
12096
- });
12097
- return await $de192de6ef100f9f$export$79f13b4cfaaf0d09(this.config, web3Provider);
12098
- }
12099
- static isWeb3Provider(web3Provider) {
12100
- return $bb88265fe45a0393$export$ebe4804963e71f98(web3Provider);
12101
- }
12102
- /**
12103
- * Estimates the gas to perform an action.
12104
- * @param {GasEstimateParams} params - The params required to calculate a gas estimate
12105
- * @returns The gas estimate for the given action.
12106
- */ async gasEstimate(params) {
12107
- this.readOnlyProviders = await ($0e0060cb42e136d2$export$339cb2be73677b30)(this.config, this.readOnlyProviders);
12108
- return await $2e7bf45a7c9a9570$export$942c8de7174809fc(params, this.readOnlyProviders, this.config.environment);
12109
- }
12110
- }
12111
-
12112
- function $parcel$export(e, n, v, s) {
12113
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
12114
- }
12115
- // Definitions | Events
12116
- var $207ed853f11d19d5$exports = {};
12117
-
12118
- $parcel$export($207ed853f11d19d5$exports, "IMTBLWidgetEvents", () => exports.IMTBLWidgetEvents);
12119
- exports.IMTBLWidgetEvents = void 0;
12120
- (function(IMTBLWidgetEvents) {
12121
- IMTBLWidgetEvents["IMTBL_CONNECT_WIDGET_EVENT"] = "imtbl-connect-widget";
12122
- IMTBLWidgetEvents["IMTBL_WALLET_WIDGET_EVENT"] = "imtbl-wallet-widget";
12123
- IMTBLWidgetEvents["IMTBL_SWAP_WIDGET_EVENT"] = "imtbl-swap-widget";
12124
- IMTBLWidgetEvents["IMTBL_BRIDGE_WIDGET_EVENT"] = "imtbl-bridge-widget";
12125
- })(exports.IMTBLWidgetEvents || (exports.IMTBLWidgetEvents = {}));
12126
-
12127
-
12128
- var $a85ecdbd885c58ad$exports = {};
12129
-
12130
- $parcel$export($a85ecdbd885c58ad$exports, "ConnectEventType", () => exports.ConnectEventType);
12131
- exports.ConnectEventType = void 0;
12132
- (function(ConnectEventType) {
12133
- ConnectEventType["CLOSE_WIDGET"] = "close-widget";
12134
- ConnectEventType["SUCCESS"] = "success";
12135
- ConnectEventType["FAILURE"] = "failure";
12136
- })(exports.ConnectEventType || (exports.ConnectEventType = {}));
12137
-
12138
-
12139
- var $77b6aac5c353d4a9$exports = {};
12140
-
12141
- $parcel$export($77b6aac5c353d4a9$exports, "WalletEventType", () => exports.WalletEventType);
12142
- exports.WalletEventType = void 0;
12143
- (function(WalletEventType) {
12144
- WalletEventType["CLOSE_WIDGET"] = "close-widget";
12145
- WalletEventType["NETWORK_SWITCH"] = "network-switch";
12146
- WalletEventType["DISCONNECT_WALLET"] = "disconnect-wallet";
12147
- })(exports.WalletEventType || (exports.WalletEventType = {}));
12148
-
12149
-
12150
- var $53d219e7f6bf0cd6$exports = {};
12151
-
12152
- $parcel$export($53d219e7f6bf0cd6$exports, "SwapEventType", () => exports.SwapEventType);
12153
- /**
12154
- * Enum representing possible Swap Widget event types.
12155
- */ exports.SwapEventType = void 0;
12156
- (function(SwapEventType) {
12157
- SwapEventType["CLOSE_WIDGET"] = "close-widget";
12158
- SwapEventType["SUCCESS"] = "success";
12159
- SwapEventType["FAILURE"] = "failure";
12160
- SwapEventType["REJECTED"] = "rejected";
12161
- })(exports.SwapEventType || (exports.SwapEventType = {}));
12162
-
12163
-
12164
- var $15cc9e120aa6f3bf$exports = {};
12165
-
12166
- $parcel$export($15cc9e120aa6f3bf$exports, "BridgeEventType", () => exports.BridgeEventType);
12167
- /**
12168
- * Enum of possible Bridge Widget event types.
12169
- */ exports.BridgeEventType = void 0;
12170
- (function(BridgeEventType) {
12171
- BridgeEventType["CLOSE_WIDGET"] = "close-widget";
12172
- BridgeEventType["SUCCESS"] = "success";
12173
- BridgeEventType["FAILURE"] = "failure";
12174
- })(exports.BridgeEventType || (exports.BridgeEventType = {}));
12175
-
12176
-
12177
- var $ad06b030b1a3ba34$exports = {};
12178
-
12179
- $parcel$export($ad06b030b1a3ba34$exports, "OrchestrationEventType", () => exports.OrchestrationEventType);
12180
- exports.OrchestrationEventType = void 0;
12181
- (function(OrchestrationEventType) {
12182
- OrchestrationEventType["REQUEST_CONNECT"] = "request-connect";
12183
- OrchestrationEventType["REQUEST_WALLET"] = "request-wallet";
12184
- OrchestrationEventType["REQUEST_SWAP"] = "request-swap";
12185
- OrchestrationEventType["REQUEST_BRIDGE"] = "request-bridge";
12186
- OrchestrationEventType["REQUEST_ONRAMP"] = "request-onramp";
12187
- })(exports.OrchestrationEventType || (exports.OrchestrationEventType = {}));
12188
- /* eslint-disable @typescript-eslint/naming-convention */
12189
-
12190
- var $045213b18e9f1f94$exports = {};
12191
-
12192
- $parcel$export($045213b18e9f1f94$exports, "Network", () => exports.Network);
12193
- $parcel$export($045213b18e9f1f94$exports, "WidgetTheme", () => exports.WidgetTheme);
12194
- $parcel$export($045213b18e9f1f94$exports, "CheckoutWidgetTagNames", () => exports.CheckoutWidgetTagNames);
12195
- /**
12196
- * Enum representing the networks supported by Checkout.
12197
- */ exports.Network = void 0;
12198
- (function(Network) {
12199
- Network["ETHEREUM"] = "Ethereum";
12200
- Network["SEPOLIA"] = "Sepolia";
12201
- Network["IMTBL_ZKEVM_TESTNET"] = "Immutable zkEVM Testnet";
12202
- Network["IMTBL_ZKEVM_DEVNET"] = "Immutable zkEVM Devnet";
12203
- Network["POLYGON_ZKEVM_TESTNET"] = "Polygon zkEVM Testnet";
12204
- Network["POLYGON_ZKEVM"] = "Polygon zkEVM";
12205
- })(exports.Network || (exports.Network = {}));
12206
- exports.WidgetTheme = void 0;
12207
- (function(WidgetTheme) {
12208
- WidgetTheme["LIGHT"] = "light";
12209
- WidgetTheme["DARK"] = "dark";
12210
- WidgetTheme["CUSTOM"] = "custom";
12211
- })(exports.WidgetTheme || (exports.WidgetTheme = {}));
12212
- exports.CheckoutWidgetTagNames = void 0;
12213
- (function(CheckoutWidgetTagNames) {
12214
- CheckoutWidgetTagNames["CONNECT"] = "imtbl-connect";
12215
- CheckoutWidgetTagNames["WALLET"] = "imtbl-wallet";
12216
- CheckoutWidgetTagNames["SWAP"] = "imtbl-swap";
12217
- CheckoutWidgetTagNames["BRIDGE"] = "imtbl-bridge";
12218
- })(exports.CheckoutWidgetTagNames || (exports.CheckoutWidgetTagNames = {}));
12219
-
12220
-
12221
- var $1f969328e5988c99$exports = {};
12222
-
12223
- $parcel$export($1f969328e5988c99$exports, "BridgeReact", () => $1f969328e5988c99$export$30f61ebf204c69f6);
12224
-
12225
-
12226
- function $1f969328e5988c99$export$30f61ebf204c69f6(props) {
12227
- const { walletProvider: walletProvider , fromContractAddress: fromContractAddress , amount: amount , fromNetwork: fromNetwork } = props;
12228
- const config = window.ImtblCheckoutWidgetConfig;
12229
- return /*#__PURE__*/ (jsxRuntime.jsx)("imtbl-bridge", {
12230
- widgetConfig: config,
12231
- walletProvider: walletProvider,
12232
- fromContractAddress: fromContractAddress ?? "",
12233
- fromNetwork: fromNetwork ?? "",
12234
- amount: amount ?? ""
12235
- });
12236
- }
12237
-
12238
-
12239
- var $f2083cd30e2f5c56$exports = {};
12240
-
12241
- $parcel$export($f2083cd30e2f5c56$exports, "ConnectReact", () => $f2083cd30e2f5c56$export$49d62957f420a1e2);
12242
-
12243
-
12244
- function $f2083cd30e2f5c56$export$49d62957f420a1e2(props) {
12245
- const { walletProvider: walletProvider } = props;
12246
- const config = window.ImtblCheckoutWidgetConfig;
12247
- return /*#__PURE__*/ (jsxRuntime.jsx)("imtbl-connect", {
12248
- widgetConfig: config,
12249
- walletProvider: walletProvider
12250
- });
12251
- }
12252
-
12253
-
12254
- var $a4fbb8e3a6aeff58$exports = {};
12255
-
12256
- $parcel$export($a4fbb8e3a6aeff58$exports, "SwapReact", () => $a4fbb8e3a6aeff58$export$971e031379577f4);
12257
- /* eslint-disable max-len */
12258
-
12259
- function $a4fbb8e3a6aeff58$export$971e031379577f4(props) {
12260
- const { walletProvider: walletProvider , fromContractAddress: fromContractAddress , amount: amount , toContractAddress: toContractAddress } = props;
12261
- const config = window.ImtblCheckoutWidgetConfig;
12262
- return /*#__PURE__*/ (jsxRuntime.jsx)("imtbl-swap", {
12263
- widgetConfig: config,
12264
- walletProvider: walletProvider,
12265
- fromContractAddress: fromContractAddress ?? "",
12266
- toContractAddress: toContractAddress ?? "",
12267
- amount: amount ?? ""
12268
- });
12269
- }
12270
-
12271
-
12272
- var $89d55ace0f8f1c07$exports = {};
12273
-
12274
- $parcel$export($89d55ace0f8f1c07$exports, "WalletReact", () => $89d55ace0f8f1c07$export$ceaac94f34dba154);
12275
-
12276
-
12277
- function $89d55ace0f8f1c07$export$ceaac94f34dba154(props) {
12278
- const { walletProvider: walletProvider } = props;
12279
- const config = window.ImtblCheckoutWidgetConfig;
12280
- return /*#__PURE__*/ (jsxRuntime.jsx)("imtbl-wallet", {
12281
- widgetConfig: config,
12282
- walletProvider: walletProvider
12283
- });
12284
- }
12285
-
12286
-
12287
- var $430e3eda76fa4d5f$exports = {};
12288
-
12289
- $parcel$export($430e3eda76fa4d5f$exports, "CheckoutWidgets", () => $430e3eda76fa4d5f$export$af210a0808087845);
12290
- $parcel$export($430e3eda76fa4d5f$exports, "UpdateConfig", () => $430e3eda76fa4d5f$export$bf1548ba7e61c17f);
12291
- $parcel$export($430e3eda76fa4d5f$exports, "SetProvider", () => $430e3eda76fa4d5f$export$931068bc678f0d73);
12292
- function $430e3eda76fa4d5f$export$af210a0808087845(config) {
12293
- const checkoutWidgetJS = document.createElement("script");
12294
- checkoutWidgetJS.setAttribute("src", "http://localhost:3000/lib/js/imtbl-checkout.js");
12295
- document.head.appendChild(checkoutWidgetJS);
12296
- window.ImtblCheckoutWidgetConfig = JSON.stringify(config);
12297
- }
12298
- function $430e3eda76fa4d5f$export$bf1548ba7e61c17f(config) {
12299
- window.ImtblCheckoutWidgetConfig = JSON.stringify(config);
12300
- }
12301
- function $430e3eda76fa4d5f$export$931068bc678f0d73(tagName, provider) {
12302
- if (!provider) {
12303
- // eslint-disable-next-line no-console
12304
- console.error("no provider parsed");
12305
- return;
12306
- }
12307
- let attempts = 0;
12308
- const maxAttempts = 10;
12309
- let timer;
12310
- const attemptToSetProvider = ()=>{
12311
- try {
12312
- const elements = document.getElementsByTagName(tagName);
12313
- const widget = elements[0];
12314
- widget.setProvider(provider);
12315
- window.clearInterval(timer);
12316
- } catch (err) {
12317
- attempts++;
12318
- if (attempts >= maxAttempts) {
12319
- window.clearInterval(timer);
12320
- // eslint-disable-next-line no-console
12321
- console.error("failed to set the provider");
12322
- }
12323
- }
12324
- };
12325
- timer = window.setInterval(attemptToSetProvider, 10);
12326
- attemptToSetProvider();
12327
- }
12328
-
12329
10766
  /* Autogenerated file. Do not edit manually. */
12330
10767
  /* tslint:disable */
12331
10768
  /* eslint-disable */
@@ -13833,25 +12270,25 @@ class ERC721PermissionedMintable {
13833
12270
  /**
13834
12271
  * @returns a populated transaction for the setApprovalForAll contract function
13835
12272
  */
13836
- async setApprovalForAll(operator, approved, overrides = {}) {
12273
+ async populateSetApprovalForAll(operator, approved, overrides = {}) {
13837
12274
  return await this.contract.populateTransaction.setApprovalForAll(operator, approved, overrides);
13838
12275
  }
13839
12276
  /**
13840
12277
  * @returns a populated transaction for the setBaseURI contract function
13841
12278
  */
13842
- async setBaseURI(baseURI_, overrides = {}) {
12279
+ async populateSetBaseURI(baseURI_, overrides = {}) {
13843
12280
  return await this.contract.populateTransaction.setBaseURI(baseURI_, overrides);
13844
12281
  }
13845
12282
  /**
13846
12283
  * @returns a populated transaction for the setContractURI contract function
13847
12284
  */
13848
- async setContractURI(_contractURI, overrides = {}) {
12285
+ async populateSetContractURI(_contractURI, overrides = {}) {
13849
12286
  return await this.contract.populateTransaction.setContractURI(_contractURI, overrides);
13850
12287
  }
13851
12288
  /**
13852
12289
  * @returns a populated transaction for the setRoyaltyAllowlistRegistry contract function
13853
12290
  */
13854
- async setRoyaltyAllowlistRegistry(_royaltyAllowlist, overrides = {}) {
12291
+ async populateSetRoyaltyAllowlistRegistry(_royaltyAllowlist, overrides = {}) {
13855
12292
  return await this.contract.populateTransaction.setRoyaltyAllowlistRegistry(_royaltyAllowlist, overrides);
13856
12293
  }
13857
12294
  }
@@ -13866,10 +12303,6 @@ Object.defineProperty(exports, 'imxClientGenerateLegacyStarkPrivateKey', {
13866
12303
  });
13867
12304
  exports.APIError = APIError;
13868
12305
  exports.BlockchainData = BlockchainData;
13869
- exports.BridgeReact = $1f969328e5988c99$export$30f61ebf204c69f6;
13870
- exports.Checkout = $a8cb37a3fc8eb863$export$1f60ba4ec72508a0;
13871
- exports.CheckoutWidgets = $430e3eda76fa4d5f$export$af210a0808087845;
13872
- exports.ConnectReact = $f2083cd30e2f5c56$export$49d62957f420a1e2;
13873
12306
  exports.ERC20 = ERC20;
13874
12307
  exports.ERC721PermissionedMintable = ERC721PermissionedMintable;
13875
12308
  exports.GenericIMXProvider = GenericIMXProvider;
@@ -13880,9 +12313,4 @@ exports.Orderbook = Orderbook;
13880
12313
  exports.Passport = Passport;
13881
12314
  exports.PassportError = PassportError;
13882
12315
  exports.ProviderConfiguration = ProviderConfiguration;
13883
- exports.RPC_URL_MAP = $a47e48dd2c04791b$export$345c852d0dc8f1df;
13884
- exports.SetProvider = $430e3eda76fa4d5f$export$931068bc678f0d73;
13885
- exports.SwapReact = $a4fbb8e3a6aeff58$export$971e031379577f4;
13886
- exports.UpdateConfig = $430e3eda76fa4d5f$export$bf1548ba7e61c17f;
13887
- exports.WalletReact = $89d55ace0f8f1c07$export$ceaac94f34dba154;
13888
12316
  exports.module = module$1;