@imtbl/sdk 1.28.3-alpha.1 → 1.28.5

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.
Files changed (36) hide show
  1. package/dist/blockchain_data.js +2 -2
  2. package/dist/browser/checkout/{BridgeWidget-c098bac1.js → BridgeWidget-c13db542.js} +1 -1
  3. package/dist/browser/checkout/{HorizontalMenu-actual-1c03a13a.js → HorizontalMenu-actual-4839c025.js} +1 -1
  4. package/dist/browser/checkout/{OnRampWidget-483500c9.js → OnRampWidget-4cdce305.js} +1 -1
  5. package/dist/browser/checkout/{SaleWidget-51776764.js → SaleWidget-c815d5bf.js} +1 -1
  6. package/dist/browser/checkout/{SpendingCapHero-06d2a4bf.js → SpendingCapHero-3796316b.js} +1 -1
  7. package/dist/browser/checkout/{SwapWidget-da61119f.js → SwapWidget-c2be5ea7.js} +1 -1
  8. package/dist/browser/checkout/TopUpView-36554491.js +1 -0
  9. package/dist/browser/checkout/{WalletWidget-f0e10d75.js → WalletWidget-f18b5337.js} +1 -1
  10. package/dist/browser/checkout/{auto-track-10db0184.js → auto-track-2ef0c5b1.js} +1 -1
  11. package/dist/browser/checkout/{balance-a4a9a910.js → balance-db7ddc43.js} +1 -1
  12. package/dist/browser/checkout/{index-c700684b.js → index-008b03aa.js} +1 -1
  13. package/dist/browser/checkout/{index-5c9dcd29.js → index-221aac4d.js} +1 -1
  14. package/dist/browser/checkout/{index-9a012a82.js → index-2afbd720.js} +1 -1
  15. package/dist/browser/checkout/{index-13a2dee1.js → index-37d968ab.js} +1 -1
  16. package/dist/browser/checkout/{index-15cb29dc.js → index-3c243042.js} +2 -2
  17. package/dist/browser/checkout/{index-442a954b.js → index-581df2dd.js} +1 -1
  18. package/dist/browser/checkout/{index-ba11c013.js → index-6d33e910.js} +1 -1
  19. package/dist/browser/checkout/index-d9c7fb5b.js +1 -0
  20. package/dist/browser/checkout/{index.umd-9c769e0c.js → index.umd-d72441fd.js} +1 -1
  21. package/dist/browser/checkout/{retry-082dfd95.js → retry-c0af13a7.js} +1 -1
  22. package/dist/browser/checkout/sdk.js +5 -5
  23. package/dist/browser/checkout/widgets-esm.js +1 -1
  24. package/dist/browser/checkout/widgets.js +6 -6
  25. package/dist/checkout.js +4 -4
  26. package/dist/config.js +1 -1
  27. package/dist/index.browser.js +4 -4
  28. package/dist/index.browser.js.map +1 -1
  29. package/dist/index.cjs +34 -29
  30. package/dist/index.js +34 -29
  31. package/dist/orderbook.js +1 -1
  32. package/dist/passport.js +31 -26
  33. package/dist/x.js +3 -3
  34. package/package.json +1 -1
  35. package/dist/browser/checkout/TopUpView-e7147bc4.js +0 -1
  36. package/dist/browser/checkout/index-49bd4ac3.js +0 -1
package/dist/index.cjs CHANGED
@@ -183,7 +183,7 @@ const flattenProperties$1 = (properties) => {
183
183
  };
184
184
 
185
185
  // WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
186
- const SDK_VERSION$1 = '1.28.3-alpha.1';
186
+ const SDK_VERSION$1 = '1.28.5';
187
187
  const getReferrer$1 = () => {
188
188
  if (isNode$1()) {
189
189
  return '';
@@ -14335,7 +14335,7 @@ class MultiRollupApiClients {
14335
14335
  }
14336
14336
 
14337
14337
  // eslint-disable-next-line @typescript-eslint/naming-convention
14338
- const defaultHeaders$2 = { 'x-sdk-version': 'ts-immutable-sdk-1.28.3-alpha.1' };
14338
+ const defaultHeaders$2 = { 'x-sdk-version': 'ts-immutable-sdk-1.28.5' };
14339
14339
  const createConfig$1 = ({ basePath, headers, }) => {
14340
14340
  if (!basePath.trim()) {
14341
14341
  throw Error('basePath can not be empty');
@@ -14407,7 +14407,7 @@ class APIError extends Error {
14407
14407
 
14408
14408
  /* eslint-disable implicit-arrow-linebreak */
14409
14409
  const defaultHeaders$1 = {
14410
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.28.3-alpha.1',
14410
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.28.5',
14411
14411
  };
14412
14412
  /**
14413
14413
  * createAPIConfiguration to create a custom Configuration
@@ -14881,7 +14881,7 @@ var blockchain_data = /*#__PURE__*/Object.freeze({
14881
14881
  /* eslint-disable @typescript-eslint/naming-convention */
14882
14882
  class ApiConfiguration extends index$2.Configuration {
14883
14883
  }
14884
- const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.28.3-alpha.1' };
14884
+ const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.28.5' };
14885
14885
  /**
14886
14886
  * @dev use createImmutableXConfiguration instead
14887
14887
  */
@@ -14920,7 +14920,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
14920
14920
  chainID,
14921
14921
  coreContractAddress,
14922
14922
  registrationContractAddress,
14923
- sdkVersion: 'ts-immutable-sdk-1.28.3-alpha.1',
14923
+ sdkVersion: 'ts-immutable-sdk-1.28.5',
14924
14924
  baseConfig,
14925
14925
  });
14926
14926
  const production = ({ baseConfig }) => createImmutableXConfiguration({
@@ -26869,8 +26869,7 @@ const getMetaTransactions = async (metaTransaction, nonce, chainId, walletAddres
26869
26869
  }
26870
26870
  return [metaTransaction, feeMetaTransaction];
26871
26871
  };
26872
- const sendTransaction$1 = ({ params, ethSigner, rpcProvider, relayerClient, guardianClient, zkevmAddress, }) => guardianClient
26873
- .withConfirmationScreen({ width: 480, height: 720 })(async () => {
26872
+ const sendTransaction$1 = async ({ params, ethSigner, rpcProvider, relayerClient, guardianClient, zkevmAddress, }) => {
26874
26873
  const transactionRequest = params[0];
26875
26874
  if (!transactionRequest.to) {
26876
26875
  throw new JsonRpcError(RpcErrorCode.INVALID_PARAMS, 'eth_sendTransaction requires a "to" field');
@@ -26925,7 +26924,7 @@ const sendTransaction$1 = ({ params, ethSigner, rpcProvider, relayerClient, guar
26925
26924
  throw new JsonRpcError(RpcErrorCode.RPC_SERVER_ERROR, errorMessage);
26926
26925
  }
26927
26926
  return relayerTransaction.hash;
26928
- });
26927
+ };
26929
26928
 
26930
26929
  const REQUIRED_TYPED_DATA_PROPERTIES = ['types', 'domain', 'primaryType', 'message'];
26931
26930
  const isValidTypedDataPayload = (typedData) => (REQUIRED_TYPED_DATA_PROPERTIES.every((key) => key in typedData));
@@ -26965,8 +26964,7 @@ const transformTypedData = (typedData, chainId) => {
26965
26964
  }
26966
26965
  return transformedTypedData;
26967
26966
  };
26968
- const signTypedDataV4 = async ({ params, method, ethSigner, rpcProvider, relayerClient, guardianClient, }) => guardianClient
26969
- .withConfirmationScreen({ width: 480, height: 720 })(async () => {
26967
+ const signTypedDataV4 = async ({ params, method, ethSigner, rpcProvider, relayerClient, guardianClient, }) => {
26970
26968
  const fromAddress = params[0];
26971
26969
  const typedDataParam = params[1];
26972
26970
  if (!fromAddress || !typedDataParam) {
@@ -26977,7 +26975,7 @@ const signTypedDataV4 = async ({ params, method, ethSigner, rpcProvider, relayer
26977
26975
  await guardianClient.validateMessage({ chainID: String(chainId), payload: typedData });
26978
26976
  const relayerSignature = await relayerClient.imSignTypedData(fromAddress, typedData);
26979
26977
  return getSignedTypedData(typedData, relayerSignature, ethers.BigNumber.from(chainId), fromAddress, ethSigner);
26980
- });
26978
+ };
26981
26979
 
26982
26980
  const isZkEvmUser = (user) => 'zkEvm' in user;
26983
26981
  class ZkEvmProvider {
@@ -27095,20 +27093,25 @@ class ZkEvmProvider {
27095
27093
  this.#zkEvmAddress = user.zkEvm.ethAddress;
27096
27094
  }
27097
27095
  this.#eventEmitter.emit(ProviderEvent.ACCOUNTS_CHANGED, [this.#zkEvmAddress]);
27096
+ identify({
27097
+ passportId: user.profile.sub,
27098
+ });
27098
27099
  return [this.#zkEvmAddress];
27099
27100
  }
27100
27101
  case 'eth_sendTransaction': {
27101
27102
  if (!this.#zkEvmAddress) {
27102
27103
  throw new JsonRpcError(ProviderErrorCode.UNAUTHORIZED, 'Unauthorised - call eth_requestAccounts first');
27103
27104
  }
27104
- const ethSigner = await this.#getSigner();
27105
- return sendTransaction$1({
27106
- params: request.params || [],
27107
- ethSigner,
27108
- guardianClient: this.#guardianClient,
27109
- rpcProvider: this.#rpcProvider,
27110
- relayerClient: this.#relayerClient,
27111
- zkevmAddress: this.#zkEvmAddress,
27105
+ return this.#guardianClient.withConfirmationScreen({ width: 480, height: 720 })(async () => {
27106
+ const ethSigner = await this.#getSigner();
27107
+ return sendTransaction$1({
27108
+ params: request.params || [],
27109
+ ethSigner,
27110
+ guardianClient: this.#guardianClient,
27111
+ rpcProvider: this.#rpcProvider,
27112
+ relayerClient: this.#relayerClient,
27113
+ zkevmAddress: this.#zkEvmAddress,
27114
+ });
27112
27115
  });
27113
27116
  }
27114
27117
  case 'eth_accounts': {
@@ -27119,14 +27122,16 @@ class ZkEvmProvider {
27119
27122
  if (!this.#zkEvmAddress) {
27120
27123
  throw new JsonRpcError(ProviderErrorCode.UNAUTHORIZED, 'Unauthorised - call eth_requestAccounts first');
27121
27124
  }
27122
- const ethSigner = await this.#getSigner();
27123
- return signTypedDataV4({
27124
- method: request.method,
27125
- params: request.params || [],
27126
- ethSigner,
27127
- rpcProvider: this.#rpcProvider,
27128
- relayerClient: this.#relayerClient,
27129
- guardianClient: this.#guardianClient,
27125
+ return this.#guardianClient.withConfirmationScreen({ width: 480, height: 720 })(async () => {
27126
+ const ethSigner = await this.#getSigner();
27127
+ return signTypedDataV4({
27128
+ method: request.method,
27129
+ params: request.params || [],
27130
+ ethSigner,
27131
+ rpcProvider: this.#rpcProvider,
27132
+ relayerClient: this.#relayerClient,
27133
+ guardianClient: this.#guardianClient,
27134
+ });
27130
27135
  });
27131
27136
  }
27132
27137
  case 'eth_chainId': {
@@ -46361,7 +46366,7 @@ const flattenProperties = (properties) => {
46361
46366
  };
46362
46367
 
46363
46368
  // WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
46364
- const SDK_VERSION = '1.28.3-alpha.1';
46369
+ const SDK_VERSION = '1.28.5';
46365
46370
  const getReferrer = () => {
46366
46371
  if (isNode()) {
46367
46372
  return '';
@@ -51556,7 +51561,7 @@ const IMMUTABLE_ZKVEM_GAS_OVERRIDES = {
51556
51561
  maxPriorityFeePerGas: ethers.BigNumber.from(10e9),
51557
51562
  };
51558
51563
 
51559
- const SDK_VERSION_MARKER = '1.28.3-alpha.1';
51564
+ const SDK_VERSION_MARKER = '1.28.5';
51560
51565
  // This SDK version is replaced by the `yarn build` command ran on the root level
51561
51566
  const globalPackageVersion = () => SDK_VERSION_MARKER;
51562
51567
 
package/dist/index.js CHANGED
@@ -160,7 +160,7 @@ const flattenProperties$1 = (properties) => {
160
160
  };
161
161
 
162
162
  // WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
163
- const SDK_VERSION$1 = '1.28.3-alpha.1';
163
+ const SDK_VERSION$1 = '1.28.5';
164
164
  const getReferrer$1 = () => {
165
165
  if (isNode$1()) {
166
166
  return '';
@@ -14312,7 +14312,7 @@ class MultiRollupApiClients {
14312
14312
  }
14313
14313
 
14314
14314
  // eslint-disable-next-line @typescript-eslint/naming-convention
14315
- const defaultHeaders$2 = { 'x-sdk-version': 'ts-immutable-sdk-1.28.3-alpha.1' };
14315
+ const defaultHeaders$2 = { 'x-sdk-version': 'ts-immutable-sdk-1.28.5' };
14316
14316
  const createConfig$1 = ({ basePath, headers, }) => {
14317
14317
  if (!basePath.trim()) {
14318
14318
  throw Error('basePath can not be empty');
@@ -14384,7 +14384,7 @@ class APIError extends Error {
14384
14384
 
14385
14385
  /* eslint-disable implicit-arrow-linebreak */
14386
14386
  const defaultHeaders$1 = {
14387
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.28.3-alpha.1',
14387
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.28.5',
14388
14388
  };
14389
14389
  /**
14390
14390
  * createAPIConfiguration to create a custom Configuration
@@ -14858,7 +14858,7 @@ var blockchain_data = /*#__PURE__*/Object.freeze({
14858
14858
  /* eslint-disable @typescript-eslint/naming-convention */
14859
14859
  class ApiConfiguration extends index$2.Configuration {
14860
14860
  }
14861
- const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.28.3-alpha.1' };
14861
+ const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.28.5' };
14862
14862
  /**
14863
14863
  * @dev use createImmutableXConfiguration instead
14864
14864
  */
@@ -14897,7 +14897,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
14897
14897
  chainID,
14898
14898
  coreContractAddress,
14899
14899
  registrationContractAddress,
14900
- sdkVersion: 'ts-immutable-sdk-1.28.3-alpha.1',
14900
+ sdkVersion: 'ts-immutable-sdk-1.28.5',
14901
14901
  baseConfig,
14902
14902
  });
14903
14903
  const production = ({ baseConfig }) => createImmutableXConfiguration({
@@ -26846,8 +26846,7 @@ const getMetaTransactions = async (metaTransaction, nonce, chainId, walletAddres
26846
26846
  }
26847
26847
  return [metaTransaction, feeMetaTransaction];
26848
26848
  };
26849
- const sendTransaction$1 = ({ params, ethSigner, rpcProvider, relayerClient, guardianClient, zkevmAddress, }) => guardianClient
26850
- .withConfirmationScreen({ width: 480, height: 720 })(async () => {
26849
+ const sendTransaction$1 = async ({ params, ethSigner, rpcProvider, relayerClient, guardianClient, zkevmAddress, }) => {
26851
26850
  const transactionRequest = params[0];
26852
26851
  if (!transactionRequest.to) {
26853
26852
  throw new JsonRpcError(RpcErrorCode.INVALID_PARAMS, 'eth_sendTransaction requires a "to" field');
@@ -26902,7 +26901,7 @@ const sendTransaction$1 = ({ params, ethSigner, rpcProvider, relayerClient, guar
26902
26901
  throw new JsonRpcError(RpcErrorCode.RPC_SERVER_ERROR, errorMessage);
26903
26902
  }
26904
26903
  return relayerTransaction.hash;
26905
- });
26904
+ };
26906
26905
 
26907
26906
  const REQUIRED_TYPED_DATA_PROPERTIES = ['types', 'domain', 'primaryType', 'message'];
26908
26907
  const isValidTypedDataPayload = (typedData) => (REQUIRED_TYPED_DATA_PROPERTIES.every((key) => key in typedData));
@@ -26942,8 +26941,7 @@ const transformTypedData = (typedData, chainId) => {
26942
26941
  }
26943
26942
  return transformedTypedData;
26944
26943
  };
26945
- const signTypedDataV4 = async ({ params, method, ethSigner, rpcProvider, relayerClient, guardianClient, }) => guardianClient
26946
- .withConfirmationScreen({ width: 480, height: 720 })(async () => {
26944
+ const signTypedDataV4 = async ({ params, method, ethSigner, rpcProvider, relayerClient, guardianClient, }) => {
26947
26945
  const fromAddress = params[0];
26948
26946
  const typedDataParam = params[1];
26949
26947
  if (!fromAddress || !typedDataParam) {
@@ -26954,7 +26952,7 @@ const signTypedDataV4 = async ({ params, method, ethSigner, rpcProvider, relayer
26954
26952
  await guardianClient.validateMessage({ chainID: String(chainId), payload: typedData });
26955
26953
  const relayerSignature = await relayerClient.imSignTypedData(fromAddress, typedData);
26956
26954
  return getSignedTypedData(typedData, relayerSignature, BigNumber$1.from(chainId), fromAddress, ethSigner);
26957
- });
26955
+ };
26958
26956
 
26959
26957
  const isZkEvmUser = (user) => 'zkEvm' in user;
26960
26958
  class ZkEvmProvider {
@@ -27072,20 +27070,25 @@ class ZkEvmProvider {
27072
27070
  this.#zkEvmAddress = user.zkEvm.ethAddress;
27073
27071
  }
27074
27072
  this.#eventEmitter.emit(ProviderEvent.ACCOUNTS_CHANGED, [this.#zkEvmAddress]);
27073
+ identify({
27074
+ passportId: user.profile.sub,
27075
+ });
27075
27076
  return [this.#zkEvmAddress];
27076
27077
  }
27077
27078
  case 'eth_sendTransaction': {
27078
27079
  if (!this.#zkEvmAddress) {
27079
27080
  throw new JsonRpcError(ProviderErrorCode.UNAUTHORIZED, 'Unauthorised - call eth_requestAccounts first');
27080
27081
  }
27081
- const ethSigner = await this.#getSigner();
27082
- return sendTransaction$1({
27083
- params: request.params || [],
27084
- ethSigner,
27085
- guardianClient: this.#guardianClient,
27086
- rpcProvider: this.#rpcProvider,
27087
- relayerClient: this.#relayerClient,
27088
- zkevmAddress: this.#zkEvmAddress,
27082
+ return this.#guardianClient.withConfirmationScreen({ width: 480, height: 720 })(async () => {
27083
+ const ethSigner = await this.#getSigner();
27084
+ return sendTransaction$1({
27085
+ params: request.params || [],
27086
+ ethSigner,
27087
+ guardianClient: this.#guardianClient,
27088
+ rpcProvider: this.#rpcProvider,
27089
+ relayerClient: this.#relayerClient,
27090
+ zkevmAddress: this.#zkEvmAddress,
27091
+ });
27089
27092
  });
27090
27093
  }
27091
27094
  case 'eth_accounts': {
@@ -27096,14 +27099,16 @@ class ZkEvmProvider {
27096
27099
  if (!this.#zkEvmAddress) {
27097
27100
  throw new JsonRpcError(ProviderErrorCode.UNAUTHORIZED, 'Unauthorised - call eth_requestAccounts first');
27098
27101
  }
27099
- const ethSigner = await this.#getSigner();
27100
- return signTypedDataV4({
27101
- method: request.method,
27102
- params: request.params || [],
27103
- ethSigner,
27104
- rpcProvider: this.#rpcProvider,
27105
- relayerClient: this.#relayerClient,
27106
- guardianClient: this.#guardianClient,
27102
+ return this.#guardianClient.withConfirmationScreen({ width: 480, height: 720 })(async () => {
27103
+ const ethSigner = await this.#getSigner();
27104
+ return signTypedDataV4({
27105
+ method: request.method,
27106
+ params: request.params || [],
27107
+ ethSigner,
27108
+ rpcProvider: this.#rpcProvider,
27109
+ relayerClient: this.#relayerClient,
27110
+ guardianClient: this.#guardianClient,
27111
+ });
27107
27112
  });
27108
27113
  }
27109
27114
  case 'eth_chainId': {
@@ -46338,7 +46343,7 @@ const flattenProperties = (properties) => {
46338
46343
  };
46339
46344
 
46340
46345
  // WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
46341
- const SDK_VERSION = '1.28.3-alpha.1';
46346
+ const SDK_VERSION = '1.28.5';
46342
46347
  const getReferrer = () => {
46343
46348
  if (isNode()) {
46344
46349
  return '';
@@ -51533,7 +51538,7 @@ const IMMUTABLE_ZKVEM_GAS_OVERRIDES = {
51533
51538
  maxPriorityFeePerGas: BigNumber$1.from(10e9),
51534
51539
  };
51535
51540
 
51536
- const SDK_VERSION_MARKER = '1.28.3-alpha.1';
51541
+ const SDK_VERSION_MARKER = '1.28.5';
51537
51542
  // This SDK version is replaced by the `yarn build` command ran on the root level
51538
51543
  const globalPackageVersion = () => SDK_VERSION_MARKER;
51539
51544
 
package/dist/orderbook.js CHANGED
@@ -132,7 +132,7 @@ const flattenProperties = (properties) => {
132
132
  };
133
133
 
134
134
  // WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
135
- const SDK_VERSION = '1.28.3-alpha.1';
135
+ const SDK_VERSION = '1.28.5';
136
136
  const getReferrer = () => {
137
137
  if (isNode()) {
138
138
  return '';
package/dist/passport.js CHANGED
@@ -11564,7 +11564,7 @@ class MultiRollupApiClients {
11564
11564
  }
11565
11565
 
11566
11566
  // eslint-disable-next-line @typescript-eslint/naming-convention
11567
- const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-1.28.3-alpha.1' };
11567
+ const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-1.28.5' };
11568
11568
  const createConfig$1 = ({ basePath, headers, }) => {
11569
11569
  if (!basePath.trim()) {
11570
11570
  throw Error('basePath can not be empty');
@@ -11743,7 +11743,7 @@ const flattenProperties = (properties) => {
11743
11743
  };
11744
11744
 
11745
11745
  // WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
11746
- const SDK_VERSION = '1.28.3-alpha.1';
11746
+ const SDK_VERSION = '1.28.5';
11747
11747
  const getReferrer = () => {
11748
11748
  if (isNode()) {
11749
11749
  return '';
@@ -11993,7 +11993,7 @@ const addKeysToHeadersOverride = (baseConfig, overrides) => {
11993
11993
  /* eslint-disable @typescript-eslint/naming-convention */
11994
11994
  class ApiConfiguration extends index$2.Configuration {
11995
11995
  }
11996
- const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.28.3-alpha.1' };
11996
+ const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.28.5' };
11997
11997
  /**
11998
11998
  * @dev use createImmutableXConfiguration instead
11999
11999
  */
@@ -12032,7 +12032,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
12032
12032
  chainID,
12033
12033
  coreContractAddress,
12034
12034
  registrationContractAddress,
12035
- sdkVersion: 'ts-immutable-sdk-1.28.3-alpha.1',
12035
+ sdkVersion: 'ts-immutable-sdk-1.28.5',
12036
12036
  baseConfig,
12037
12037
  });
12038
12038
  const production = ({ baseConfig }) => createImmutableXConfiguration({
@@ -21545,8 +21545,7 @@ const getMetaTransactions = async (metaTransaction, nonce, chainId, walletAddres
21545
21545
  }
21546
21546
  return [metaTransaction, feeMetaTransaction];
21547
21547
  };
21548
- const sendTransaction = ({ params, ethSigner, rpcProvider, relayerClient, guardianClient, zkevmAddress, }) => guardianClient
21549
- .withConfirmationScreen({ width: 480, height: 720 })(async () => {
21548
+ const sendTransaction = async ({ params, ethSigner, rpcProvider, relayerClient, guardianClient, zkevmAddress, }) => {
21550
21549
  const transactionRequest = params[0];
21551
21550
  if (!transactionRequest.to) {
21552
21551
  throw new JsonRpcError(RpcErrorCode.INVALID_PARAMS, 'eth_sendTransaction requires a "to" field');
@@ -21601,7 +21600,7 @@ const sendTransaction = ({ params, ethSigner, rpcProvider, relayerClient, guardi
21601
21600
  throw new JsonRpcError(RpcErrorCode.RPC_SERVER_ERROR, errorMessage);
21602
21601
  }
21603
21602
  return relayerTransaction.hash;
21604
- });
21603
+ };
21605
21604
 
21606
21605
  const REQUIRED_TYPED_DATA_PROPERTIES = ['types', 'domain', 'primaryType', 'message'];
21607
21606
  const isValidTypedDataPayload = (typedData) => (REQUIRED_TYPED_DATA_PROPERTIES.every((key) => key in typedData));
@@ -21641,8 +21640,7 @@ const transformTypedData = (typedData, chainId) => {
21641
21640
  }
21642
21641
  return transformedTypedData;
21643
21642
  };
21644
- const signTypedDataV4 = async ({ params, method, ethSigner, rpcProvider, relayerClient, guardianClient, }) => guardianClient
21645
- .withConfirmationScreen({ width: 480, height: 720 })(async () => {
21643
+ const signTypedDataV4 = async ({ params, method, ethSigner, rpcProvider, relayerClient, guardianClient, }) => {
21646
21644
  const fromAddress = params[0];
21647
21645
  const typedDataParam = params[1];
21648
21646
  if (!fromAddress || !typedDataParam) {
@@ -21653,7 +21651,7 @@ const signTypedDataV4 = async ({ params, method, ethSigner, rpcProvider, relayer
21653
21651
  await guardianClient.validateMessage({ chainID: String(chainId), payload: typedData });
21654
21652
  const relayerSignature = await relayerClient.imSignTypedData(fromAddress, typedData);
21655
21653
  return getSignedTypedData(typedData, relayerSignature, BigNumber.from(chainId), fromAddress, ethSigner);
21656
- });
21654
+ };
21657
21655
 
21658
21656
  const isZkEvmUser = (user) => 'zkEvm' in user;
21659
21657
  class ZkEvmProvider {
@@ -21771,20 +21769,25 @@ class ZkEvmProvider {
21771
21769
  this.#zkEvmAddress = user.zkEvm.ethAddress;
21772
21770
  }
21773
21771
  this.#eventEmitter.emit(ProviderEvent.ACCOUNTS_CHANGED, [this.#zkEvmAddress]);
21772
+ identify({
21773
+ passportId: user.profile.sub,
21774
+ });
21774
21775
  return [this.#zkEvmAddress];
21775
21776
  }
21776
21777
  case 'eth_sendTransaction': {
21777
21778
  if (!this.#zkEvmAddress) {
21778
21779
  throw new JsonRpcError(ProviderErrorCode.UNAUTHORIZED, 'Unauthorised - call eth_requestAccounts first');
21779
21780
  }
21780
- const ethSigner = await this.#getSigner();
21781
- return sendTransaction({
21782
- params: request.params || [],
21783
- ethSigner,
21784
- guardianClient: this.#guardianClient,
21785
- rpcProvider: this.#rpcProvider,
21786
- relayerClient: this.#relayerClient,
21787
- zkevmAddress: this.#zkEvmAddress,
21781
+ return this.#guardianClient.withConfirmationScreen({ width: 480, height: 720 })(async () => {
21782
+ const ethSigner = await this.#getSigner();
21783
+ return sendTransaction({
21784
+ params: request.params || [],
21785
+ ethSigner,
21786
+ guardianClient: this.#guardianClient,
21787
+ rpcProvider: this.#rpcProvider,
21788
+ relayerClient: this.#relayerClient,
21789
+ zkevmAddress: this.#zkEvmAddress,
21790
+ });
21788
21791
  });
21789
21792
  }
21790
21793
  case 'eth_accounts': {
@@ -21795,14 +21798,16 @@ class ZkEvmProvider {
21795
21798
  if (!this.#zkEvmAddress) {
21796
21799
  throw new JsonRpcError(ProviderErrorCode.UNAUTHORIZED, 'Unauthorised - call eth_requestAccounts first');
21797
21800
  }
21798
- const ethSigner = await this.#getSigner();
21799
- return signTypedDataV4({
21800
- method: request.method,
21801
- params: request.params || [],
21802
- ethSigner,
21803
- rpcProvider: this.#rpcProvider,
21804
- relayerClient: this.#relayerClient,
21805
- guardianClient: this.#guardianClient,
21801
+ return this.#guardianClient.withConfirmationScreen({ width: 480, height: 720 })(async () => {
21802
+ const ethSigner = await this.#getSigner();
21803
+ return signTypedDataV4({
21804
+ method: request.method,
21805
+ params: request.params || [],
21806
+ ethSigner,
21807
+ rpcProvider: this.#rpcProvider,
21808
+ relayerClient: this.#relayerClient,
21809
+ guardianClient: this.#guardianClient,
21810
+ });
21806
21811
  });
21807
21812
  }
21808
21813
  case 'eth_chainId': {
package/dist/x.js CHANGED
@@ -9003,7 +9003,7 @@ const flattenProperties = (properties) => {
9003
9003
  };
9004
9004
 
9005
9005
  // WARNING: DO NOT CHANGE THE STRING BELOW. IT GETS REPLACED AT BUILD TIME.
9006
- const SDK_VERSION = '1.28.3-alpha.1';
9006
+ const SDK_VERSION = '1.28.5';
9007
9007
  const getReferrer = () => {
9008
9008
  if (isNode()) {
9009
9009
  return '';
@@ -9246,7 +9246,7 @@ const addKeysToHeadersOverride = (baseConfig, overrides) => {
9246
9246
  /* eslint-disable @typescript-eslint/naming-convention */
9247
9247
  class ApiConfiguration extends index$2.Configuration {
9248
9248
  }
9249
- const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.28.3-alpha.1' };
9249
+ const defaultHeaders = { 'x-sdk-version': 'ts-immutable-sdk-1.28.5' };
9250
9250
  /**
9251
9251
  * @dev use createImmutableXConfiguration instead
9252
9252
  */
@@ -9285,7 +9285,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
9285
9285
  chainID,
9286
9286
  coreContractAddress,
9287
9287
  registrationContractAddress,
9288
- sdkVersion: 'ts-immutable-sdk-1.28.3-alpha.1',
9288
+ sdkVersion: 'ts-immutable-sdk-1.28.5',
9289
9289
  baseConfig,
9290
9290
  });
9291
9291
  const production = ({ baseConfig }) => createImmutableXConfiguration({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@imtbl/sdk",
3
3
  "description": "Immutable Unified SDK",
4
- "version": "1.28.3-alpha.1",
4
+ "version": "1.28.5",
5
5
  "author": "Immutable",
6
6
  "browser": "./dist/index.browser.js",
7
7
  "bugs": "https://github.com/immutable/ts-immutable-sdk/issues",
@@ -1 +0,0 @@
1
- import{a4 as t,bN as e,d2 as o,bR as n,d3 as r,bq as i,d4 as s,r as a,a2 as c,bl as l,a as u,j as f,M as d,B as m,u as h,V as E,E as g,e as p,cB as S,z as _,G as v,H as w,b as A,J as b,I,d as T,o as C}from"./index-15cb29dc.js";const y=new e(o),O={},R=t.from(0),x=t.from(-1);function N(t,o,n,r){const i={fault:o,operation:n};return void 0!==r&&(i.value=r),y.throwError(t,e.errors.NUMERIC_FAULT,i)}let F="0";for(;F.length<256;)F+=F;function P(e){if("number"!=typeof e)try{e=t.from(e).toNumber()}catch(t){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+F.substring(0,e):y.throwArgumentError("invalid decimal size","decimals",e)}function L(e,o){null==o&&(o=0);const n=P(o),r=(e=t.from(e)).lt(R);r&&(e=e.mul(x));let i=e.mod(n).toString();for(;i.length<n.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const s=e.div(n).toString();return e=1===n.length?s:s+"."+i,r&&(e="-"+e),e}function U(e,o){null==o&&(o=0);const n=P(o);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||y.throwArgumentError("invalid decimal value","value",e);const r="-"===e.substring(0,1);r&&(e=e.substring(1)),"."===e&&y.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&y.throwArgumentError("too many decimal points","value",e);let s=i[0],a=i[1];for(s||(s="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>n.length-1&&N("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.length<n.length-1;)a+="0";const c=t.from(s),l=t.from(a);let u=c.mul(n).add(l);return r&&(u=u.mul(x)),u}class W{constructor(t,o,n,r){t!==O&&y.throwError("cannot use FixedFormat constructor; use FixedFormat.from",e.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=o,this.width=n,this.decimals=r,this.name=(o?"":"u")+"fixed"+String(n)+"x"+String(r),this._multiplier=P(r),Object.freeze(this)}static from(t){if(t instanceof W)return t;"number"==typeof t&&(t=`fixed128x${t}`);let e=!0,o=128,n=18;if("string"==typeof t)if("fixed"===t);else if("ufixed"===t)e=!1;else{const r=t.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);r||y.throwArgumentError("invalid fixed format","format",t),e="u"!==r[1],o=parseInt(r[2]),n=parseInt(r[3])}else if(t){const r=(e,o,n)=>null==t[e]?n:(typeof t[e]!==o&&y.throwArgumentError("invalid fixed format ("+e+" not "+o+")","format."+e,t[e]),t[e]);e=r("signed","boolean",e),o=r("width","number",o),n=r("decimals","number",n)}return o%8&&y.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",o),n>80&&y.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new W(O,e,o,n)}}class k{constructor(t,o,n,r){t!==O&&y.throwError("cannot use FixedNumber constructor; use FixedNumber.from",e.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=r,this._hex=o,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&y.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);const e=U(this._value,this.format.decimals),o=U(t._value,t.format.decimals);return k.fromValue(e.add(o),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);const e=U(this._value,this.format.decimals),o=U(t._value,t.format.decimals);return k.fromValue(e.sub(o),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);const e=U(this._value,this.format.decimals),o=U(t._value,t.format.decimals);return k.fromValue(e.mul(o).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);const e=U(this._value,this.format.decimals),o=U(t._value,t.format.decimals);return k.fromValue(e.mul(this.format._multiplier).div(o),this.format.decimals,this.format)}floor(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=k.from(t[0],this.format);const o=!t[1].match(/^(0*)$/);return this.isNegative()&&o&&(e=e.subUnsafe(B.toFormat(e.format))),e}ceiling(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=k.from(t[0],this.format);const o=!t[1].match(/^(0*)$/);return!this.isNegative()&&o&&(e=e.addUnsafe(B.toFormat(e.format))),e}round(t){null==t&&(t=0);const e=this.toString().split(".");if(1===e.length&&e.push("0"),(t<0||t>80||t%1)&&y.throwArgumentError("invalid decimal count","decimals",t),e[1].length<=t)return this;const o=k.from("1"+F.substring(0,t),this.format),n=D.toFormat(this.format);return this.mulUnsafe(o).addUnsafe(n).floor().divUnsafe(o)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&y.throwArgumentError("invalid byte width","width",e);const o=t.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return n(o,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return k.fromString(this._value,t)}static fromValue(t,e,o){return null!=o||null==e||r(e)||(o=e,e=null),null==e&&(e=0),null==o&&(o="fixed"),k.fromString(L(t,e),W.from(o))}static fromString(t,e){null==e&&(e="fixed");const o=W.from(e),r=U(t,o.decimals);!o.signed&&r.lt(R)&&N("unsigned value cannot be negative","overflow","value",t);let i=null;o.signed?i=r.toTwos(o.width).toHexString():(i=r.toHexString(),i=n(i,o.width/8));const s=L(r,o.decimals);return new k(O,i,s,o)}static fromBytes(e,o){null==o&&(o="fixed");const n=W.from(o);if(i(e).length>n.width/8)throw new Error("overflow");let r=t.from(e);n.signed&&(r=r.fromTwos(n.width));const s=r.toTwos((n.signed?0:1)+n.width).toHexString(),a=L(r,n.decimals);return new k(O,s,a,n)}static from(t,o){if("string"==typeof t)return k.fromString(t,o);if(s(t))return k.fromBytes(t,o);try{return k.fromValue(t,0,o)}catch(t){if(t.code!==e.errors.INVALID_ARGUMENT)throw t}return y.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!(!t||!t._isFixedNumber)}}const B=k.from(1),D=k.from("0.5"),M=new e("units/5.7.0"),$=["wei","kwei","mwei","gwei","szabo","finney","ether"];function V(t,e){if("string"==typeof e){const t=$.indexOf(e);-1!==t&&(e=3*t)}return L(t,null!=e?e:18)}function G(t,e){if("string"!=typeof t&&M.throwArgumentError("value must be a string","value",t),"string"==typeof e){const t=$.indexOf(e);-1!==t&&(e=3*t)}return U(t,null!=e?e:18)}function H(t){return G(t,18)}var K,Y=Object.freeze({__proto__:null,commify:function(t){const e=String(t).split(".");(e.length>2||!e[0].match(/^-?[0-9]*$/)||e[1]&&!e[1].match(/^[0-9]*$/)||"."===t||"-."===t)&&M.throwArgumentError("invalid value","value",t);let o=e[0],n="";for("-"===o.substring(0,1)&&(n="-",o=o.substring(1));"0"===o.substring(0,1);)o=o.substring(1);""===o&&(o="0");let r="";for(2===e.length&&(r="."+(e[1]||"0"));r.length>2&&"0"===r[r.length-1];)r=r.substring(0,r.length-1);const i=[];for(;o.length;){if(o.length<=3){i.unshift(o);break}{const t=o.length-3;i.unshift(o.substring(t)),o=o.substring(0,t)}}return n+i.join(",")+r},formatEther:function(t){return V(t,18)},formatUnits:V,parseEther:H,parseUnits:G});!function(t){t.USD="usd"}(K||(K={}));const z={cryptoFiat:null,fiatSymbol:K.USD,tokenSymbols:[],conversions:new Map};var j;!function(t){t.SET_CRYPTO_FIAT="SET_CRYPTO_FIAT",t.SET_FIAT_SYMBOL="SET_FIAT_SYMBOL",t.SET_TOKEN_SYMBOLS="SET_TOKEN_SYMBOLS",t.SET_CONVERSIONS="SET_CONVERSIONS"}(j||(j={}));const q=a.createContext({cryptoFiatState:z,cryptoFiatDispatch:()=>{}}),J=(t,e)=>{switch(e.payload.type){case j.SET_CRYPTO_FIAT:return{...t,cryptoFiat:e.payload.cryptoFiat};case j.SET_FIAT_SYMBOL:return{...t,fiatSymbol:e.payload.fiatSymbol};case j.SET_TOKEN_SYMBOLS:return{...t,tokenSymbols:e.payload.tokenSymbols};case j.SET_CONVERSIONS:return{...t,conversions:e.payload.conversions};default:return t}};var X;!function(t){t.SWAP="SWAP",t.IN_PROGRESS="IN_PROGRESS",t.SUCCESS="SUCCESS",t.FAIL="FAIL",t.PRICE_SURGE="PRICE_SURGE",t.APPROVE_ERC20="APPROVE_ERC20_SWAP"}(X||(X={}));class Z{baseConfig;constructor({baseConfig:t}){this.baseConfig=t}}const Q={[c.SANDBOX]:"https://checkout-api.sandbox.immutable.com",[c.PRODUCTION]:"https://checkout-api.immutable.com"};class tt{coinsCache;overridesCache;config;constructor(t){this.coinsCache=null,this.overridesCache=null,this.config=t.baseConfig}urlWithPath(t){return Q[this.config.environment]+t}async fetchOverrides(){if(null!==this.overridesCache)return;const t=this.urlWithPath("/v1/fiat/coins/overrides"),e=await l.get(t);if(200!==e.status)throw new Error(`Error fetching coins overrides: ${e.status} ${e.statusText}`);this.overridesCache=new Map(Object.entries(e.data))}async fetchCoins(){if(null!==this.coinsCache)return;await this.fetchOverrides();const t=this.urlWithPath("/v1/fiat/coins/all"),e=await l.get(t);if(200!==e.status)throw new Error(`Error fetching coins list: ${e.status} ${e.statusText}`);const{data:o}=e;this.coinsCache=new Map;for(const t of o){const e=this.overridesCache.get(t.symbol.toLowerCase());this.coinsCache.set(t.symbol.toLowerCase(),e||t.id.toLowerCase())}}async convert({tokenSymbols:t,fiatSymbols:e=[]}){if(!t||0===t.length)throw new Error("Error missing token symbols to convert");const o=e.filter((t=>""!==t));0===o.length&&o.push("usd"),await this.fetchCoins();const n=t.map((t=>this.coinsCache.get(t.toLowerCase()))).filter((t=>""!==t&&void 0!==t)).join(","),r=o.join(",").toLowerCase(),i=this.urlWithPath(`/v1/fiat/conversion?ids=${n}&currencies=${r}`),s=await l.get(i);if(200!==s.status)throw new Error(`Error fetching prices: ${s.status} ${s.statusText}`);const{data:a}=s,c={};for(const e of t){const t=e.toLowerCase(),o=this.coinsCache.get(t);c[t]={},o&&(c[t]=a[o]||{})}return c}}const et=async(t,e,o)=>{try{if(0===o.length)return new Map;return((t,e)=>{const o=new Map;for(const n in t){const r=t[n][e];void 0!==r&&o.set(n,r)}return o})(await t.convert({tokenSymbols:o,fiatSymbol:e}),e)}catch(t){return new Map}},ot=["ETH","IMX"];function nt({environment:t,children:e}){const[o,n]=a.useReducer(J,z),{cryptoFiat:r,fiatSymbol:i,tokenSymbols:s}=o;return a.useEffect((()=>{n({payload:{type:j.SET_CRYPTO_FIAT,cryptoFiat:new tt(new Z({baseConfig:{environment:t}}))}})}),[]),a.useEffect((()=>{r&&i&&(async()=>{const t=await et(r,i,[...new Set([...s,...ot])]);n({payload:{type:j.SET_CONVERSIONS,conversions:t}})})()}),[r,s,i]),u(q.Provider,{value:{cryptoFiatState:o,cryptoFiatDispatch:n},children:e})}var rt;!function(t){t.WALLET_NETWORK_SELECTION="WALLET_NETWORK_SELECTION",t.BRIDGE_FORM="BRIDGE_FORM",t.BRIDGE_REVIEW="BRIDGE_REVIEW",t.IN_PROGRESS="IN_PROGRESS",t.BRIDGE_FAILURE="BRIDGE_FAILURE",t.APPROVE_TRANSACTION="APPROVE_TRANSACTION",t.TRANSACTIONS="TRANSACTIONS",t.CLAIM_WITHDRAWAL="CLAIM_WITHDRAWAL",t.CLAIM_WITHDRAWAL_IN_PROGRESS="CLAIM_WITHDRAWAL_IN_PROGRESS",t.CLAIM_WITHDRAWAL_SUCCESS="CLAIM_WITHDRAWAL_SUCCESS",t.CLAIM_WITHDRAWAL_FAILURE="CLAIM_WITHDRAWAL_FAILURE"}(rt||(rt={}));const it=(t,e)=>{const{fees:o,token:n}=t;if(void 0===o.totalFees)return"-.--";if(void 0===n)return"-.--";const r=((t,e,o)=>{let n=-1;if(t&&e){const r=V(t,e.decimals),i=o.get(e.symbol.toLocaleLowerCase());if(i){const t=parseFloat(r);if(Number.isNaN(t))return n;n=t*i}}return n})(o.totalFees,n,e);return r<0?"-.--":function(t){if(t<0)return"-.--";const e=t.toString();if(e.includes("e")||0===t)return"0.00";if(t<.01)for(let o=0;o<e.length;o++)if("0"!==e[o]&&"."!==e[o])return t.toFixed(o-1);return t.toFixed(2)}(r)};var st;function at({testId:t,icon:e,heading:o,caption:n,onClick:r,renderFeeFunction:i,isDisabled:s}){return u(m,{testId:"top-up-view",sx:{paddingY:"1px"},children:f(d,{testId:`menu-item-${t}`,size:"medium",emphasized:!0,onClick:s?void 0:r,sx:s?{opacity:"0.5",cursor:"not-allowed"}:{},children:[u(d.Icon,{icon:e}),u(d.Label,{size:"medium",children:o}),u(d.IntentIcon,{}),f(d.Caption,{testId:`menu-item-caption-${t}`,children:[n,u("br",{}),s?"":i("-.--",!1)]})]})})}function ct({widgetEvent:t,checkout:e,provider:o,showOnrampOption:n,showSwapOption:r,showBridgeOption:i,tokenAddress:s,amount:c,analytics:l,onCloseButtonClick:d,onBackButtonClick:y,heading:O,subheading:R}){const{t:x}=h(),{userJourney:N}=l,{viewDispatch:F}=a.useContext(E),{cryptoFiatState:P,cryptoFiatDispatch:L}=a.useContext(q),{conversions:U,fiatSymbol:W}=P,{eventTargetState:{eventTarget:k}}=a.useContext(g),[B,D]=a.useState("-.--"),[M,$]=a.useState("-.--"),[V,G]=a.useState(!0),H=O?x(...O):x("views.TOP_UP_VIEW.header.title"),K=R?x(...R):null,{page:Y,track:z}=p();a.useEffect((()=>{Y({userJourney:N,screen:"TopUp"})}),[]),a.useEffect((()=>{L&&L({payload:{type:j.SET_TOKEN_SYMBOLS,tokenSymbols:ot}})}),[L]),a.useEffect((()=>{e&&(async()=>{const t=await e.gasEstimate({gasEstimateType:S.BRIDGE_TO_L2}),o=await it(t,U);$(o)})()}),[void 0!==e]),a.useEffect((()=>{e&&(async()=>{const t=(t=>{const{minPercentage:e,maxPercentage:o}=t;return void 0===e||void 0===o?"-.--":`${e}% to ${o}`})(await e.getExchangeFeeEstimate());D(t)})()}),[void 0!==e]),a.useEffect((()=>{e&&(async()=>{G(await e.isSwapAvailable())})()}),[void 0!==e]);const J=(t,e,o="Button")=>{z({userJourney:N,screen:"TopUp",control:t,controlType:o,extras:e})},Z=t=>u(m,{sx:{fontSize:"base.text.caption.small.regular.fontSize",c:"base.color.translucent.standard.600"},children:t}),Q=[{testId:"onramp",icon:"BankCard",textConfigKey:"views.TOP_UP_VIEW.topUpOptions.onramp",onClickEvent:()=>{if(t===I.IMTBL_ONRAMP_WIDGET_EVENT){const e={tokenAddress:"",amount:""};return F({payload:{type:T.UPDATE_VIEW,view:{type:st.ONRAMP,data:e}}}),void J("OnRamp",{...e,widgetEvent:t})}const e={tokenAddress:s??"",amount:c??""};C.sendRequestOnrampEvent(k,t,e),J("OnRamp",{...e,widgetEvent:t})},fee:()=>Z(`${x("views.TOP_UP_VIEW.topUpOptions.onramp.subcaption")} ≈ ${B}%`),isAvailable:!0,isEnabled:n},{testId:"swap",icon:"Swap",textConfigKey:"views.TOP_UP_VIEW.topUpOptions.swap",onClickEvent:()=>{if(t===I.IMTBL_SWAP_WIDGET_EVENT){const e={toTokenAddress:"",fromAmount:"",fromTokenAddress:""};return F({payload:{type:T.UPDATE_VIEW,view:{type:X.SWAP,data:e}}}),void J("Swap",{...e,widgetEvent:t})}const e={fromTokenAddress:"",toTokenAddress:s??"",amount:""};C.sendRequestSwapEvent(k,t,e),J("Swap",{...e,widgetEvent:t})},fee:()=>Z(`${x("views.TOP_UP_VIEW.topUpOptions.swap.subcaption")} ≈ $0.05 ${W.toUpperCase()}`),isAvailable:V,isEnabled:r},{testId:"bridge",icon:"Minting",textConfigKey:"views.TOP_UP_VIEW.topUpOptions.bridge",onClickEvent:()=>{if(t===I.IMTBL_BRIDGE_WIDGET_EVENT){const e={fromTokenAddress:"",fromAmount:""};return F({payload:{type:T.UPDATE_VIEW,view:{type:rt.WALLET_NETWORK_SELECTION,data:e}}}),void J("Bridge",{...e,widgetEvent:t})}const e={tokenAddress:"",amount:""};C.sendRequestBridgeEvent(k,t,e),J("Bridge",{...e,widgetEvent:t})},fee:()=>Z(`${x("views.TOP_UP_VIEW.topUpOptions.bridge.subcaption")} ≈ $${M} ${W.toUpperCase()}`),isAvailable:!0,isEnabled:i}];return u(b,{header:u(_,{onBackButtonClick:y,onCloseButtonClick:d,showBack:!0}),footer:u(v,{}),children:f(m,{sx:{paddingX:"base.spacing.x4",paddingY:"base.spacing.x4"},children:[u(w,{size:"small",children:H}),K&&u(A,{size:"small",sx:{color:"base.color.text.body.secondary"},children:K}),u(m,{sx:{paddingY:"base.spacing.x4"},children:Q.sort(((t,e)=>Number(e.isAvailable)-Number(t.isAvailable))).map((t=>t.isEnabled&&u(at,{testId:t.testId,icon:t.icon,heading:x(`${t.textConfigKey}.heading`),caption:t.isAvailable?x(`${t.textConfigKey}.caption`):x(`${t.textConfigKey}.disabledCaption`),onClick:t.onClickEvent,renderFeeFunction:t.fee,isDisabled:!t.isAvailable},x(`${t.textConfigKey}.heading`).toLowerCase())))})]})})}!function(t){t.ONRAMP="ONRAMP",t.IN_PROGRESS_LOADING="IN_PROGRESS_LOADING",t.IN_PROGRESS="IN_PROGRESS",t.SUCCESS="SUCCESS",t.FAIL="FAIL"}(st||(st={}));export{rt as B,q as C,st as O,X as S,ct as T,j as a,nt as b,H as c,V as f,Y as l,G as p};
@@ -1 +0,0 @@
1
- import{de as n,df as t}from"./index-15cb29dc.js";function i(i){return n(this,void 0,void 0,(function(){var n;return t(this,(function(t){switch(t.label){case 0:return[4,import("./index.umd-9c769e0c.js").then((function(n){return n.i}))];case 1:return n=t.sent(),i._plugins=n,[2]}}))}))}export{i as loadLegacyVideoPlugins};