@hinkal/common 0.3.13 → 0.3.14

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 (226) hide show
  1. package/README.md +67 -4
  2. package/common/src/API/API.cjs +1 -1
  3. package/common/src/API/API.d.ts +0 -2
  4. package/common/src/API/API.mjs +92 -94
  5. package/common/src/API/admin-calls.cjs +1 -1
  6. package/common/src/API/admin-calls.d.ts +2 -1
  7. package/common/src/API/admin-calls.mjs +1 -0
  8. package/common/src/API/evm-token-assets.cjs +1 -1
  9. package/common/src/API/evm-token-assets.mjs +2 -13
  10. package/common/src/API/get-token-price-chart-data.cjs +1 -1
  11. package/common/src/API/get-token-price-chart-data.mjs +2 -2
  12. package/common/src/API/getTokenPrice.cjs +1 -1
  13. package/common/src/API/getTokenPrice.mjs +2 -2
  14. package/common/src/API/index.cjs +1 -1
  15. package/common/src/API/index.d.ts +1 -0
  16. package/common/src/API/index.mjs +1 -0
  17. package/common/src/API/privacy-score-calls.cjs +1 -1
  18. package/common/src/API/privacy-score-calls.mjs +2 -2
  19. package/common/src/API/receiveVaultCalls.cjs +1 -1
  20. package/common/src/API/receiveVaultCalls.d.ts +4 -2
  21. package/common/src/API/receiveVaultCalls.mjs +8 -4
  22. package/common/src/constants/chains.constants.cjs +1 -1
  23. package/common/src/constants/chains.constants.d.ts +2 -0
  24. package/common/src/constants/chains.constants.mjs +106 -93
  25. package/common/src/constants/coingecko.constants.cjs +1 -1
  26. package/common/src/constants/coingecko.constants.d.ts +2 -0
  27. package/common/src/constants/coingecko.constants.mjs +1 -1
  28. package/common/src/constants/deploy-data/deploy-data-arbMainnet.json.cjs +1 -1
  29. package/common/src/constants/deploy-data/deploy-data-arbMainnet.json.mjs +2 -1
  30. package/common/src/constants/deploy-data/deploy-data-arcTestnet.json.cjs +1 -1
  31. package/common/src/constants/deploy-data/deploy-data-arcTestnet.json.mjs +3 -2
  32. package/common/src/constants/deploy-data/deploy-data-base.json.cjs +1 -1
  33. package/common/src/constants/deploy-data/deploy-data-base.json.mjs +2 -1
  34. package/common/src/constants/deploy-data/deploy-data-bnbMainnet.json.cjs +1 -1
  35. package/common/src/constants/deploy-data/deploy-data-bnbMainnet.json.mjs +2 -1
  36. package/common/src/constants/deploy-data/deploy-data-ethMainnet.json.cjs +1 -1
  37. package/common/src/constants/deploy-data/deploy-data-ethMainnet.json.mjs +2 -1
  38. package/common/src/constants/deploy-data/deploy-data-polygon.json.cjs +1 -1
  39. package/common/src/constants/deploy-data/deploy-data-polygon.json.mjs +2 -1
  40. package/common/src/constants/deploy-data/deploy-data-solanaDevnet.json.cjs +1 -0
  41. package/common/src/constants/deploy-data/deploy-data-solanaDevnet.json.mjs +6 -0
  42. package/common/src/constants/deploy-data/deploy-data-tempo.json.cjs +1 -1
  43. package/common/src/constants/deploy-data/deploy-data-tempo.json.mjs +2 -1
  44. package/common/src/constants/deploy-data/deploy-data-tronMainnet.json.cjs +1 -1
  45. package/common/src/constants/deploy-data/deploy-data-tronMainnet.json.mjs +1 -1
  46. package/common/src/constants/deploy-data/deploy-data-tronNile.json.cjs +1 -1
  47. package/common/src/constants/deploy-data/deploy-data-tronNile.json.mjs +1 -1
  48. package/common/src/constants/deploy-data/index.cjs +1 -1
  49. package/common/src/constants/deploy-data/index.d.ts +2 -1
  50. package/common/src/constants/deploy-data/index.mjs +7 -6
  51. package/common/src/constants/deploy-data/shared-deploy-data-evm.json.cjs +1 -1
  52. package/common/src/constants/deploy-data/shared-deploy-data-evm.json.mjs +1 -1
  53. package/common/src/constants/deploy-data/shared-deploy-data-solana.json.cjs +1 -1
  54. package/common/src/constants/deploy-data/shared-deploy-data-solana.json.mjs +1 -1
  55. package/common/src/constants/deploy-data/shared-deploy-data-tron.json.cjs +1 -1
  56. package/common/src/constants/deploy-data/shared-deploy-data-tron.json.mjs +1 -1
  57. package/common/src/constants/index.cjs +1 -1
  58. package/common/src/constants/index.mjs +1 -1
  59. package/common/src/constants/protocol.constants.cjs +2 -2
  60. package/common/src/constants/protocol.constants.d.ts +0 -2
  61. package/common/src/constants/protocol.constants.mjs +2 -2
  62. package/common/src/constants/save-depths.cjs +1 -1
  63. package/common/src/constants/save-depths.d.ts +1 -0
  64. package/common/src/constants/save-depths.mjs +1 -0
  65. package/common/src/constants/server.constants.cjs +1 -1
  66. package/common/src/constants/server.constants.d.ts +8 -6
  67. package/common/src/constants/server.constants.mjs +8 -6
  68. package/common/src/constants/tokens.constants.cjs +1 -1
  69. package/common/src/constants/tokens.constants.mjs +1 -1
  70. package/common/src/data-structures/Hinkal/Hinkal.cjs +1 -1
  71. package/common/src/data-structures/Hinkal/Hinkal.d.ts +4 -4
  72. package/common/src/data-structures/Hinkal/Hinkal.mjs +37 -37
  73. package/common/src/data-structures/Hinkal/IHinkal.d.ts +4 -4
  74. package/common/src/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
  75. package/common/src/data-structures/Hinkal/handleAutoDepositBack.mjs +5 -5
  76. package/common/src/data-structures/Hinkal/hinkalBridgePrivateToPrivate.cjs +1 -1
  77. package/common/src/data-structures/Hinkal/hinkalBridgePrivateToPrivate.mjs +1 -1
  78. package/common/src/data-structures/Hinkal/hinkalDepositAndBridge.cjs +1 -1
  79. package/common/src/data-structures/Hinkal/hinkalDepositAndBridge.mjs +55 -54
  80. package/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
  81. package/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +60 -57
  82. package/common/src/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
  83. package/common/src/data-structures/Hinkal/hinkalPrivateWallet.d.ts +1 -1
  84. package/common/src/data-structures/Hinkal/hinkalPrivateWallet.mjs +29 -29
  85. package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.utils.cjs +1 -1
  86. package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.utils.mjs +1 -1
  87. package/common/src/data-structures/Hinkal/hinkalProxySwap.cjs +1 -1
  88. package/common/src/data-structures/Hinkal/hinkalProxySwap.mjs +1 -1
  89. package/common/src/data-structures/Hinkal/hinkalReceiveVaultAccount.cjs +1 -1
  90. package/common/src/data-structures/Hinkal/hinkalReceiveVaultAccount.mjs +7 -15
  91. package/common/src/data-structures/Hinkal/hinkalReceiveVaultCreate.cjs +1 -1
  92. package/common/src/data-structures/Hinkal/hinkalReceiveVaultCreate.d.ts +2 -2
  93. package/common/src/data-structures/Hinkal/hinkalReceiveVaultCreate.mjs +24 -28
  94. package/common/src/data-structures/Hinkal/hinkalReceiveVaultRecover.cjs +1 -1
  95. package/common/src/data-structures/Hinkal/hinkalReceiveVaultRecover.mjs +47 -40
  96. package/common/src/data-structures/Hinkal/hinkalReceiveVaultSettle.d.ts +1 -1
  97. package/common/src/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
  98. package/common/src/data-structures/Hinkal/hinkalSolanaDeposit.mjs +22 -42
  99. package/common/src/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
  100. package/common/src/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +72 -70
  101. package/common/src/data-structures/Hinkal/hinkalSolanaProxySend.cjs +1 -1
  102. package/common/src/data-structures/Hinkal/hinkalSolanaProxySend.mjs +9 -9
  103. package/common/src/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
  104. package/common/src/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +15 -15
  105. package/common/src/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
  106. package/common/src/data-structures/Hinkal/hinkalSolanaProxySwap.d.ts +1 -1
  107. package/common/src/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +47 -45
  108. package/common/src/data-structures/Hinkal/hinkalSolanaReceiveVault.cjs +1 -0
  109. package/common/src/data-structures/Hinkal/hinkalSolanaReceiveVault.d.ts +5 -0
  110. package/common/src/data-structures/Hinkal/hinkalSolanaReceiveVault.mjs +60 -0
  111. package/common/src/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
  112. package/common/src/data-structures/Hinkal/hinkalWithdraw.mjs +35 -26
  113. package/common/src/data-structures/Hinkal/index.d.ts +1 -0
  114. package/common/src/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
  115. package/common/src/data-structures/Hinkal/resetMerkleTrees.mjs +13 -13
  116. package/common/src/error-handling/error-codes.constants.cjs +1 -1
  117. package/common/src/error-handling/error-codes.constants.d.ts +2 -0
  118. package/common/src/error-handling/error-codes.constants.mjs +2 -0
  119. package/common/src/error-handling/get-error.message.cjs +1 -1
  120. package/common/src/error-handling/get-error.message.mjs +10 -1
  121. package/common/src/functions/index.cjs +1 -1
  122. package/common/src/functions/index.mjs +6 -2
  123. package/common/src/functions/pre-transaction/addressTableLookup.d.ts +1 -0
  124. package/common/src/functions/pre-transaction/calculateSolanaNullifierCount.cjs +1 -1
  125. package/common/src/functions/pre-transaction/calculateSolanaNullifierCount.mjs +7 -7
  126. package/common/src/functions/pre-transaction/constructAdminData.cjs +1 -1
  127. package/common/src/functions/pre-transaction/constructAdminData.mjs +4 -3
  128. package/common/src/functions/pre-transaction/sendV0Transaction.cjs +1 -1
  129. package/common/src/functions/pre-transaction/sendV0Transaction.d.ts +1 -0
  130. package/common/src/functions/pre-transaction/sendV0Transaction.mjs +22 -2
  131. package/common/src/functions/private-wallet/emporium.helpers.cjs +1 -1
  132. package/common/src/functions/private-wallet/emporium.helpers.mjs +15 -15
  133. package/common/src/functions/snarkjs/fetchOnChainRootHashes.cjs +1 -1
  134. package/common/src/functions/snarkjs/fetchOnChainRootHashes.mjs +6 -6
  135. package/common/src/functions/utils/addresses.cjs +1 -1
  136. package/common/src/functions/utils/addresses.d.ts +4 -0
  137. package/common/src/functions/utils/addresses.mjs +17 -17
  138. package/common/src/functions/utils/admin-dimensions.cjs +1 -0
  139. package/common/src/functions/utils/admin-dimensions.d.ts +4 -0
  140. package/common/src/functions/utils/admin-dimensions.mjs +206 -0
  141. package/common/src/functions/utils/create-provider.cjs +1 -1
  142. package/common/src/functions/utils/create-provider.mjs +5 -1
  143. package/common/src/functions/utils/fees.utils.cjs +1 -1
  144. package/common/src/functions/utils/fees.utils.d.ts +2 -0
  145. package/common/src/functions/utils/fees.utils.mjs +31 -33
  146. package/common/src/functions/utils/gas-token.utils.cjs +1 -0
  147. package/common/src/functions/utils/gas-token.utils.d.ts +3 -0
  148. package/common/src/functions/utils/gas-token.utils.mjs +7 -0
  149. package/common/src/functions/utils/getUtxosFromReceiptSolana.d.ts +9 -4
  150. package/common/src/functions/utils/index.cjs +1 -1
  151. package/common/src/functions/utils/index.d.ts +4 -0
  152. package/common/src/functions/utils/index.mjs +5 -1
  153. package/common/src/functions/utils/publicBalance.utils.cjs +1 -1
  154. package/common/src/functions/utils/publicBalance.utils.mjs +7 -7
  155. package/common/src/functions/utils/receive-vault-account.utils.cjs +1 -1
  156. package/common/src/functions/utils/receive-vault-account.utils.d.ts +2 -1
  157. package/common/src/functions/utils/receive-vault-account.utils.mjs +16 -15
  158. package/common/src/functions/utils/receive-vault-scan.utils.cjs +1 -1
  159. package/common/src/functions/utils/receive-vault-scan.utils.mjs +37 -42
  160. package/common/src/functions/utils/receive-vault-solana.utils.cjs +1 -0
  161. package/common/src/functions/utils/receive-vault-solana.utils.d.ts +8 -0
  162. package/common/src/functions/utils/receive-vault-solana.utils.mjs +45 -0
  163. package/common/src/functions/utils/receive-vault.utils.cjs +2 -2
  164. package/common/src/functions/utils/receive-vault.utils.d.ts +13 -11
  165. package/common/src/functions/utils/receive-vault.utils.mjs +97 -82
  166. package/common/src/functions/utils/token-check.utils.d.ts +1 -0
  167. package/common/src/functions/utils/wallet-token-discovery.utils.cjs +1 -1
  168. package/common/src/functions/utils/wallet-token-discovery.utils.d.ts +5 -0
  169. package/common/src/functions/utils/wallet-token-discovery.utils.mjs +25 -31
  170. package/common/src/functions/web3/getContractMetadata.cjs +1 -1
  171. package/common/src/functions/web3/getContractMetadata.mjs +6 -6
  172. package/common/src/functions/web3/index.cjs +1 -1
  173. package/common/src/functions/web3/index.mjs +1 -1
  174. package/common/src/types/admin.types.cjs +1 -1
  175. package/common/src/types/admin.types.d.ts +64 -9
  176. package/common/src/types/admin.types.mjs +10 -2
  177. package/common/src/types/connector.types.d.ts +1 -0
  178. package/common/src/types/ethereum-network.types.d.ts +1 -0
  179. package/common/src/types/external-action.types.cjs +1 -1
  180. package/common/src/types/external-action.types.d.ts +2 -1
  181. package/common/src/types/external-action.types.mjs +1 -1
  182. package/common/src/types/receive-vault.types.cjs +1 -1
  183. package/common/src/types/receive-vault.types.d.ts +15 -20
  184. package/common/src/types/receive-vault.types.mjs +4 -2
  185. package/common/src/webworker/{logError-BeXPKuv9.js → logError-C-ej_TX9.js} +1 -1
  186. package/common/src/webworker/package.json +1 -1
  187. package/common/src/webworker/snarkjsWorker/snarkjsWorkerLauncher.ts?worker&url.cjs +1 -1
  188. package/common/src/webworker/snarkjsWorker/snarkjsWorkerLauncher.ts?worker&url.mjs +1 -1
  189. package/common/src/webworker/snarkjsWorkerNode.cjs +1 -1
  190. package/common/src/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.cjs +1 -1
  191. package/common/src/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.mjs +1 -1
  192. package/common/src/webworker/utxoWorkerNode.cjs +1 -1
  193. package/common/src/webworker/viteWorkerURL.constant.cjs +3 -3
  194. package/common/src/webworker/viteWorkerURL.constant.mjs +3 -3
  195. package/common/src/webworker/workerProxy-CE-rYA3W.js +1 -0
  196. package/common/src/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.cjs +1 -1
  197. package/common/src/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.mjs +1 -1
  198. package/common/src/webworker/zkProofWorkerNode.cjs +1 -1
  199. package/index.cjs +1 -1
  200. package/index.mjs +3 -2
  201. package/internal/monitorConnectedAddress.cjs +1 -1
  202. package/internal/monitorConnectedAddress.d.ts +1 -1
  203. package/internal/monitorConnectedAddress.mjs +1 -3
  204. package/package.json +1 -1
  205. package/providers/prepareEthersHinkal.cjs +1 -1
  206. package/providers/prepareEthersHinkal.mjs +1 -1
  207. package/providers/prepareSolanaHinkal.cjs +1 -1
  208. package/providers/prepareSolanaHinkal.mjs +1 -1
  209. package/providers/prepareTronHinkal.cjs +1 -1
  210. package/providers/prepareTronHinkal.mjs +1 -1
  211. package/providers/prepareWagmiHinkal.cjs +1 -1
  212. package/providers/prepareWagmiHinkal.mjs +1 -1
  213. package/services/Hinkal.cjs +1 -1
  214. package/services/Hinkal.d.ts +6 -2
  215. package/services/Hinkal.mjs +74 -51
  216. package/types/IHinkal.d.ts +6 -1
  217. package/types/index.cjs +1 -1
  218. package/types/index.d.ts +1 -0
  219. package/types/index.mjs +2 -0
  220. package/types/receive-vault.types.cjs +1 -0
  221. package/types/receive-vault.types.d.ts +14 -0
  222. package/types/receive-vault.types.mjs +2 -0
  223. package/common/src/API/getOdosPriceForToken.cjs +0 -1
  224. package/common/src/API/getOdosPriceForToken.d.ts +0 -1
  225. package/common/src/API/getOdosPriceForToken.mjs +0 -14
  226. package/common/src/webworker/workerProxy-DF35H7vU.js +0 -1
@@ -1,2 +1,2 @@
1
1
  var e={WC_NO_MATCHING_KEY:`creating the transaction failed
2
- version`,CONNECTION_PROBLEM:`Failed to connect wallet. Please try again.`,REQUEST_PENDING:`request of type 'wallet_requestpermissions' already pending for origin`},t={INSUFFICIENT_FUNDS:`Insufficient funds`,INSUFFICIENT_FUNDS_WITHDRAW:`Not enough funds to withdraw`,INSUFFICIENT_FUNDS_TRANSFER:`Not enough funds to transfer`,INSUFFICIENT_FUNDS_TO_TRANSACT:`Not enough funds to transact`,INSUFFICIENT_FUNDS_GAS:`Insufficient funds for gas * price`,INSUFFICIENT_TRON_BALANCE_FOR_FEE:`Insufficient TRX balance to cover transfer amount and transaction fee reserve`,INSUFFICIENT_SOL_BALANCE:`Insufficient SOL balance`},n={GAS_PRICE_EXCEEDS_AUTOSHIELD_LIMIT:`Skipped shielding due to gas fee exceeding your limit.`,AUTO_SHIELD_INSUFFICIENT_GAS:`Auto-Shield skipped due to insufficient gas.`},r={...e,...t,...n,SOME_ERROR:`Some error has occurred. Please try again in a few minutes. If the issue persists, please report it in Discord`,TOO_HIGH_AMOUNT:`ApproxParamsInvalid`,NOT_ENOUGH_TOKENS:`Transfer amount exceeds balance`,TRANSACTION_NOT_CONFIRMED:`The transaction was not confirmed by the network. Please, try again`,RPC_PROVIDER_LIMIT_ERROR:`Non-200 status code: '429'`,RELAYER_NOT_AVAILABLE:`All relayers are busy, please try in a few seconds`,NO_STUCK_BALANCE_TO_WITHDRAW:`No stuck balance found to withdraw`,TRANSACTION_TIMEOUT:`Your transaction got stale. Please, try in a few seconds`,CONNECT_ERROR:`Connection error`,CONNECT_ERROR2:`DOMException: Failed`,USER_REJECTED_TX:`Transaction rejected`,USER_REJECTED_SIGN:`User rejected signing`,USER_REJECTED_TRANSACTION:`user rejected transaction`,USER_REJECTED_ACTION:`user rejected action`,USER_REJECTED_SIGN2:`User rejected the request`,USER_REJECTED_CONNECTION:`The user rejected connection.`,USER_REJECTED_RPC:`User has rejected`,SIMULATION_FAILED:`Simulation failed:`,USER_DENIED_TRANSACTION_SIGNATURE:`User denied transaction signature.`,USER_DENIED_REQUEST_SIGNATURE:`User denied request signature.`,SIGNING_FAILED:`The signing failed. Please, try again`,SIGNATURE_UNSUPPORTED_CHAINS:`Details: Unsupported chains`,SIGNATURE_UNSUPPORTED_CHAINS2:`User disapproved requested chains`,SIGNATURE_REQUEST_EXPIRED:`Request expired. Please try again`,SIGNATURE_UNSUPPORTED_PERSONAL_SIGN:`The method personal_sign does not exist`,USER_DISAPPROVED_REQUESTED_METHODS:`User disapproved requested methods`,INVALID_AUTHORIZATION:`The requested account and/or method has not been authorized by the user`,INVALID_NULLIFIER:`Nullifier cannot be reused`,SANCTIONED_ADDRESS:`Address is sanctioned`,INVALID_AMOUNT:`Please, select correct amount`,RECIPIENT_FORMAT_INCORRECT:`Recipient Information format is incorrect`,INVALID_TOKEN:`Invalid token provided`,STATE_TO_UPDATE:`Error in template Verifier_219 line: 121`,INVALID_RECEIVER:`Receiver address doesn't match`,INVALID_RELAYER:`Relayer address doesn't match`,INVALID_RELAYER_FEE:`Relayer fee amount is not valid`,TIMESTAMP_STALE:`Timestamp provided does not align with current time`,INVALID_ZKP:`Proof must be valid`,NO_TRANSACTIONS_TO_CERTIFY:`This week, you do not have transactions to certify`,RECIPIENT_AMOUNT_INVALID:`Recipient amount is invalid`,UNSUPPORTED_NETWORK:`The selected network is not supported. Please switch to another network to continue.`,SIG_BY_OWNER:`Signature must be signed by the owner of the contract`,AMOUNT_EMPTY:`Please, specify amount`,RELAYER_ISSUE:`Relayer has some issues. Try again later`,RELAYER_GAS_ESTIMATE:`Relayer was not able to estimate the gas costs of tx. Please, try later`,RECEIVER_EMPTY:`Please, enter recipient address`,VALID_ETHEREUM_ADDRESS:`Please, input valid ethereum address`,METAMASK_NOT_INSTALLED:`Please, install Metamask Wallet`,VIABLE_TX:`The transaction is not viable. Please increase the swap amount to swap with Relayer`,TRANSACTION_REPLACED:`transaction was replaced`,TRANSACTION_REPLACED2:`replacement fee too low`,TRANSACTION_CANCELED:`Transaction was cancelled. Please try again`,NONCE_HIGH:`Nonce too high`,WALLET_CONNECT_MATCHING_KEYS:`No matching key. keychain`,UNKNOWN_PROVIDER:`Unknown provider`,SAFE_ERC:`SafeERC20: low-level call failed`,SAFE_ERC_APPROVE:`SafeERC20: approve from non-zero to non-zero allowance`,SWAP_RELAYER_MIN:`Relayer minimum fee is not satisfied`,LOW_LEVEL_CALL:`low-level delegate call failed`,INTEGRAL_CURVE_ZERO:`previous integral cannot be zero`,YOU_CANCELED_REQUEST:`You canceled the request`,YOU_CANCELED_TRANSACTION_REQUEST:`You cancelled the transaction request.`,SLIPPAGE_LIMIT:`Slippage Limit Exceeded`,SLIPPAGE_LIMIT_1:`Slippage screwed you`,QUOTE_EXPIRED:`Quote has expired`,REVERT_NO_STRING:`Transaction reverted without a reason string`,CONNECTION_FAILED:`Failed to connect`,FAILED_TO_SWITCH_NETWORKS:`Please switch networks in your wallet settings`,INVALID_FROM:`Invalid from token`,INVALID_TO:`Invalid to token`,Invalid_Password:`Invalid password`,INTERNAL_ERROR:`Internal error: please, try again`,INVALID_MERKLE_ROOT:`Invalid merkle tree root`,MERLE_TREE_SNARK:`Error in template ForceEqualIfEnabled`,ERROR_MESSAGE_CHAIN_ADDRESS_CHANGED:`Chain/address changed: balance updated canceled`,DECIMALS_LIMIT:`Number of decimals exceed maximum`,MERKLE_TREE_INCOMPLETE:`Merkle tree is incomplete`,FAIL_ESTIMATE_GAS:`Failed to estimate gas: check the transaction parameters`,LEDGER_IS_LOCKED:`Ledger device: Locked device`,LEDGER_BLIDN_SIGNING_NOT_ALLOWED:`Ledger device: UNKNOWN_ERROR (0x6a8c)`,LEDGER_IS_NOT_AVAILABLE:`Ledger device: UNKNOWN_ERROR`,LEDGER_ACCESS_DENIED:`Access denied to use Ledger device.`,GAS_ESTIMATION_ERROR:`Failed Gas Estimates Response`,GAS_ESTIMATE_INCORRECT_PARAMETERS:`Incorrect Parameters for Gas Estimate`,CONNECTIVITY_ERROR:`Request failed with status code 500`,TRANSACTION_FAILED:`Transaction Failed: Revert`,NO_SWAP_QUOTES:`No swap quotes available`,FEES_OVER_TRANSACTION_VALUE:`Fees are over transaction value. Please, increase the amount`,GAS_STATION_NOT_AVAILABLE:`Gas Station Not Available`,INBALANCE_IN_TOKEN:`Inbalance in token detected`,BALANCE_EQUATION_FAILED:`Balance Diff Should be equal to sum of onchain and offchain created commitments`,TOKEN_ADD_ERROR:`Error occoured while adding token. Please make sure you are adding a valid ERC-20 token`,CANNOT_ESTIMATE_GAS:`transaction may require manual gas limit`,NETWORK_ERROR:`Network Error`,MAX_FEE_GAS_ERROR:`max fee per gas less than block base fee`,CORS_ERROR:`has been blocked by CORS policy`,CANNOT_ESTIMATE_GAS2:`transaction may fail or may require manual gas limit`,NO_RESPONSE_PRIVATE:`No resonse from private relay`,TRY_AGAIN_AFTER_TRANSACTION:`Please, try again`,ALREADY_SUBSCRIBED:`User Already Subscribed`,PREFERRED_TOKEN_OR_ADDRESS_MISSING:`Please, specify both the preferred token and public wallet address`,SNAPSHOT_FILE_NOT_FOUND:`We are updating our servers. Please try again in some time`,SAME_ADDRESS_FORBIDDEN:`You cannot recieve staked tokens on the same ethereum address`,NOT_VALID_ETHEREUM_ADDRESS:`Please enter a valid Ethereum address`,MUST_STAKE_AT_LEAST_ONE_ETH:`Amount too low, Please stake at least 1 ETH`,OUT_OF_MEMORY:`Out of memory: Cannot allocate Wasm memory`,OUT_OF_MEMORY2:`could not allocate memory`,OUT_OF_MEMORY3:`out of memory`,UNKNOWN:`Unknown error`,TRANSACTION_WRONG_REQUEST:`The requested Transaction type is not supported`,INSUFFICIENT_LAMPORTS:`insufficient lamports`,TOKENS_DO_NOT_BELONG_SAME_CHAIN:`Tokens belong to different chains. All tokens must belong to the same chain`,OKX_MIN_RETURN_NOT_REACHED:`custom program error: 0x177a`,MIN_RETURNED_NOT_REACHED:`MinReturnNotReached`,SOLANA_RECEIVED_LOWER_THAN_EXPECTED:`ReceivedAmountLowerThanExpected`,AUTO_SHIELD_SKIPPED:`We skipped auto-shield because the asset was an NFT or the remaining token was used as gas.`,LOW_OUTPUT_AMOUNT:`Gas fees exceed received amount. Please try adjusting amount or lowering slippage.`,EXECUTION_REVERTED:`execution reverted`,SOLANA_TRANSACTION_LOG_SIZE_LIMIT:`Transaction logs are too large. Please try again later`,COMPUTATIONAL_BUDGET_EXCEEDED:`ComputationalBudgetExceeded`,RELAY_FEE_OVER_WITHDRAW_AMOUNT:`Relay Fee is over withdraw amount`,TRON_CONFIRMATION_DECLINED:`Confirmation declined by user`,BLACKLISTED_INPUT_COMMITMENT_ADDRESS:`One of the source addresses is restricted from private transactions`,ACCOUNT_RESOURCE_INSUFFICIENT_ERROR:`Account resource insufficient error`,TRON_ROOT_HASH_STALE:`Hinkal Root Hash Is Stale For Insertion`,TRON_TX_IN_FLIGHT:`Another Hinkal transaction is in progress`,SOLANA_CONFIRMATION_TIMEOUT:`Transaction was not confirmed in`,BRIDGE_ARRIVAL_TIMEOUT:`Bridge did not land on destination temp wallet`},i=`Not enough memory. Please, close some tabs/applications to free up memory and try again`,a=`Your transaction didn’t go through due to price slippage. Try increasing your slippage tolerance`,o={USER_REJECTED_TRANSACTION:`You cancelled the transaction`,SOME_ERROR:`Some error has occurred. Please try again in a few minutes. If the issue persists, please report it in Discord`,TOO_HIGH_AMOUNT:`The amount you provided is too high, please adjust the amount`,NOT_ENOUGH_TOKENS:`Transfer amount exceeds balance. Try lowering amount or add funds and retry.`,WC_NO_MATCHING_KEY:`Wallet Connect error. Please, try again`,RPC_PROVIDER_LIMIT_ERROR:`Rate Limit: please, use different rpc provider in your wallet`,INSUFFICIENT_FUNDS_GAS:`Your balance is too low to cover the transaction fees. Please add funds to proceed`,INSUFFICIENT_TRON_BALANCE_FOR_FEE:`Your TRX balance is too low to cover amount and transaction fee`,INVALID_NULLIFIER:`There seems to be an issue with syncing your balance. Please press the refresh icon next to your shielded balance`,STATE_TO_UPDATE:`A technical issue has occurred. Please create a ticket on Hinkal discord server`,INVALID_ZKP:`The Zero Knowledge Proof provided is invalid. Please check and try again`,NONCE_HIGH:`To resolve this issue, please reset your wallet in the Settings`,UNKNOWN_PROVIDER:`The provider is not recognized. Please check your settings`,TRANSACTION_REPLACED:`Your transaction was replaced by another. Please submit your transaction again`,TRANSACTION_REPLACED2:`This transaction was replaced. Please try submitting again`,TRANSACTION_TIMEOUT:`Your transaction got stale. Please, try in a few seconds`,SAFE_ERC:`Your approved amount is lower than what you’re trying to send. Increase the approval or adjust the amount, then try again.`,SIMULATION_FAILED:`Transaction simulation failed. Please try again.`,SAFE_ERC_APPROVE:`The selected ERC20 Token could not be approved. Please contact the Hinkal support team`,INTEGRAL_CURVE_ZERO:`There's an issue with the pool's staking function. Please contact the Hinkal support team for assistance`,LOW_LEVEL_CALL:`A technical issue occurred. Please contact the Hinkal team for assistance`,YOU_CANCELED_REQUEST:`You canceled the request`,YOU_CANCELED_TRANSACTION_REQUEST:`You cancelled the transaction request.`,USER_REJECTED_ACTION:`You cancelled the transaction`,USER_REJECTED_SIGN2:`You canceled the request`,USER_REJECTED_RPC:`You canceled the request`,USER_DENIED_TRANSACTION_SIGNATURE:`You canceled the request`,USER_DENIED_REQUEST_SIGNATURE:`You canceled the request`,CONNECT_ERROR2:`Oops, there are connectivity issues. Please check your internet connection and try again`,WALLET_CONNECT_MATCHING_KEYS:`An internal WalletConnect error occurred. Please try reconnecting`,SIGNATURE_UNSUPPORTED_CHAINS:`The transaction couldn’t be signed: this network is not supported`,SIGNATURE_UNSUPPORTED_CHAINS2:`The transaction couldn’t be signed: this network is not supported`,SIGNATURE_UNSUPPORTED_PERSONAL_SIGN:`Your active wallet doesn't support personal signatures. Please use a different wallet`,REVERT_NO_STRING:`Your transaction didn’t go through due to technical issues. Please submit a ticket on Hinkal discord server`,INVALID_MERKLE_ROOT:`There's an issue with the merkle tree root. Please submit a ticket on Hinkal discord server`,MERLE_TREE_SNARK:`An error occurred in the circuit processing. Please submit a ticket on Hinkal discord server`,MAX_FEE_GAS_ERROR:`Your transaction was rejected due to high network congestion`,MERKLE_TREE_INCOMPLETE:`A technical issue has occurred. Please submit a ticket on Hinkal discord server`,CORS_ERROR:`Unable to reach the remote client. Please submit a ticket on Hinkal discord server`,NETWORK_ERROR:`Connection error. Please, check back later`,CONNECTIVITY_ERROR:`A connectivity issue occurred. Please check your network connection`,LEDGER_IS_LOCKED:`Your wallet is locked. Please unlock your wallet`,LEDGER_BLIDN_SIGNING_NOT_ALLOWED:`Your ledger is not allowed to sign transactions. Please allow blind signing`,LEDGER_IS_NOT_AVAILABLE:`Access denied to use Ledger device.`,LEDGER_ACCESS_DENIED:`Access denied to use Ledger device.`,INBALANCE_IN_TOKEN:a,OKX_MIN_RETURN_NOT_REACHED:a,SOLANA_RECEIVED_LOWER_THAN_EXPECTED:a,MIN_RETURNED_NOT_REACHED:a,BALANCE_EQUATION_FAILED:`There's an issue with the balance calculation. Please adjust your transaction parameters`,SLIPPAGE_LIMIT_1:`Your transaction didn’t go through due to price slippage. Adjust slippage settings and retry`,CANNOT_ESTIMATE_GAS:`Unable to estimate the gas required. Please set the gas limit manually`,CANNOT_ESTIMATE_GAS2:`Your transaction didn’t go through. Please try setting gas limit manually`,GAS_STATION_NOT_AVAILABLE:`The Gas Station service is currently unavailable. Please submit a ticket on Hinkal discord server`,TIMESTAMP_STALE:`This transaction is outdated. Please initiate a new transaction`,ALREADY_SUBSCRIBED:`This email is already subscribed to the Hinkal newsletter`,OUT_OF_MEMORY:i,OUT_OF_MEMORY2:i,OUT_OF_MEMORY3:i,INVALID_RECOVERY_PHRASE:`Invalid recovery phrase`,PHRASES_DONT_MATCH:`Phrases do not match. You can go back and verify your recovery phrase.`,PASSWORDS_DONT_MATCH:`Passwords do not match`,PASSWORD_SAME_AS_OLD:`Password cannot be the same as the old one`,PASSWORD_TOO_SMALL:`Password must be at least 8 characters`,PASSWORD_NOT_CORRECT:`Incorrect current password`,CODE_ALREADY_USED:`This code has already been used`,ACCESS_CODE_REQUIRED:`Access code is required`,ACCESS_CODE_IS_ALREADY_IN_USE:`Access code is already in use`,ACCESS_CODE_IS_ALREADY_IN_USE1:`Access code already in use. Import or connect existing wallet`,ERROR_DURING_PHRASE_CONFIRMATION:`Error during Phrase confirmation`,INSUFFICIENT_LAMPORTS:`Your SOL balance is too low to complete this transaction`,EXECUTION_REVERTED:`Your transaction reverted.`,COMPUTATIONAL_BUDGET_EXCEEDED:`Your transaction exceeded the limited compute units. Please try again.`,RELAY_FEE_OVER_WITHDRAW_AMOUNT:`Your transaction didn’t go through because the relay fee exceeded the transaction amount`,TRON_CONFIRMATION_DECLINED:`You canceled the request`,INVALID_RELAYER_FEE:`The transaction fee changed while submitting. Please try again.`,REQUEST_PENDING:`A request is already pending in your wallet. Please confirm to connect.`,BLACKLISTED_INPUT_COMMITMENT_ADDRESS:`The funds you’re trying to use have been flagged as sanctioned.`,NO_SWAP_QUOTES:`No swap route available for this token pair on the selected network at the moment. Please try again later or adjust the swap parameters.`,TRON_ROOT_HASH_STALE:`Another transaction was processed just before yours. Please try again`,TRON_TX_IN_FLIGHT:`Another transaction is currently being processed. Please try again in a few seconds`,TRON_ACCOUNT_NOT_ACTIVATED:`Ensure to first activate the TRON account you're connected with.`,NO_LIFI_PRICE:`Li-Fi provider couldn't fetch the price. please, retry in a few seconds.`,SOLANA_CONFIRMATION_TIMEOUT:`Network didn't confirm your transfer in time. It may still be confirmed - please, check Solscan before retrying.`,BRIDGE_ARRIVAL_TIMEOUT:`The bridge is taking longer than usual. Your funds left the source chain and are not lost - once they arrive, claim them from Recovery Funds.`},s=/account\s*\[[^\]]*\]\s*does not exist/i,c={UTXO_LIMITATIONS:`Your transaction exceeds the UTXO limit`,INSUFFICIENT_BALANCE_FOR_FEES:`Fees are high right now and would consume a large portion of your balance. Consider reducing the amount or retrying later.`,HIGH_FEE_WARNING:`Total fees exceed your available balance. Consider adding funds or retry later when fees decrease.`,INSUFFICIENT_FUNDS_FOR_RECOVERY_FEES:`Insufficient funds to cover recovery fees`};exports.DIRECTLY_SHOW_MESSAGE_ERROR_CODES=c,exports.TRON_ACCOUNT_NOT_ACTIVATED_PATTERN=s,exports.UserFriendlyErrorCodes=o,exports.gasErrorCodes=n,exports.insufficientResourcesErrorCodes=t,exports.transactionErrorCodes=r;
2
+ version`,CONNECTION_PROBLEM:`Failed to connect wallet. Please try again.`,REQUEST_PENDING:`request of type 'wallet_requestpermissions' already pending for origin`},t={INSUFFICIENT_FUNDS:`Insufficient funds`,INSUFFICIENT_FUNDS_WITHDRAW:`Not enough funds to withdraw`,INSUFFICIENT_FUNDS_TRANSFER:`Not enough funds to transfer`,INSUFFICIENT_FUNDS_TO_TRANSACT:`Not enough funds to transact`,INSUFFICIENT_FUNDS_GAS:`Insufficient funds for gas * price`,INSUFFICIENT_TRON_BALANCE_FOR_FEE:`Insufficient TRX balance to cover transfer amount and transaction fee reserve`,INSUFFICIENT_SOL_BALANCE:`Insufficient SOL balance`},n={GAS_PRICE_EXCEEDS_AUTOSHIELD_LIMIT:`Skipped shielding due to gas fee exceeding your limit.`,AUTO_SHIELD_INSUFFICIENT_GAS:`Auto-Shield skipped due to insufficient gas.`},r={...e,...t,...n,SOME_ERROR:`Some error has occurred. Please try again in a few minutes. If the issue persists, please report it in Discord`,TOO_HIGH_AMOUNT:`ApproxParamsInvalid`,BRIDGE_AMOUNT_TOO_LOW:`Amount is too low for bridge`,NOT_ENOUGH_TOKENS:`Transfer amount exceeds balance`,TRANSACTION_NOT_CONFIRMED:`The transaction was not confirmed by the network. Please, try again`,RPC_PROVIDER_LIMIT_ERROR:`Non-200 status code: '429'`,RELAYER_NOT_AVAILABLE:`All relayers are busy, please try in a few seconds`,NO_STUCK_BALANCE_TO_WITHDRAW:`No stuck balance found to withdraw`,TRANSACTION_TIMEOUT:`Your transaction got stale. Please, try in a few seconds`,CONNECT_ERROR:`Connection error`,CONNECT_ERROR2:`DOMException: Failed`,USER_REJECTED_TX:`Transaction rejected`,USER_REJECTED_SIGN:`User rejected signing`,USER_REJECTED_TRANSACTION:`user rejected transaction`,USER_REJECTED_ACTION:`user rejected action`,USER_REJECTED_SIGN2:`User rejected the request`,USER_REJECTED_CONNECTION:`The user rejected connection.`,USER_REJECTED_RPC:`User has rejected`,SIMULATION_FAILED:`Simulation failed:`,USER_DENIED_TRANSACTION_SIGNATURE:`User denied transaction signature.`,USER_DENIED_REQUEST_SIGNATURE:`User denied request signature.`,SIGNING_FAILED:`The signing failed. Please, try again`,SIGNATURE_UNSUPPORTED_CHAINS:`Details: Unsupported chains`,SIGNATURE_UNSUPPORTED_CHAINS2:`User disapproved requested chains`,SIGNATURE_REQUEST_EXPIRED:`Request expired. Please try again`,SIGNATURE_UNSUPPORTED_PERSONAL_SIGN:`The method personal_sign does not exist`,USER_DISAPPROVED_REQUESTED_METHODS:`User disapproved requested methods`,INVALID_AUTHORIZATION:`The requested account and/or method has not been authorized by the user`,INVALID_NULLIFIER:`Nullifier cannot be reused`,SANCTIONED_ADDRESS:`Address is sanctioned`,INVALID_AMOUNT:`Please, select correct amount`,RECIPIENT_FORMAT_INCORRECT:`Recipient Information format is incorrect`,INVALID_TOKEN:`Invalid token provided`,STATE_TO_UPDATE:`Error in template Verifier_219 line: 121`,INVALID_RECEIVER:`Receiver address doesn't match`,INVALID_RELAYER:`Relayer address doesn't match`,INVALID_RELAYER_FEE:`Relayer fee amount is not valid`,TIMESTAMP_STALE:`Timestamp provided does not align with current time`,INVALID_ZKP:`Proof must be valid`,NO_TRANSACTIONS_TO_CERTIFY:`This week, you do not have transactions to certify`,RECIPIENT_AMOUNT_INVALID:`Recipient amount is invalid`,UNSUPPORTED_NETWORK:`The selected network is not supported. Please switch to another network to continue.`,SIG_BY_OWNER:`Signature must be signed by the owner of the contract`,AMOUNT_EMPTY:`Please, specify amount`,RELAYER_ISSUE:`Relayer has some issues. Try again later`,RELAYER_GAS_ESTIMATE:`Relayer was not able to estimate the gas costs of tx. Please, try later`,RECEIVER_EMPTY:`Please, enter recipient address`,VALID_ETHEREUM_ADDRESS:`Please, input valid ethereum address`,METAMASK_NOT_INSTALLED:`Please, install Metamask Wallet`,VIABLE_TX:`The transaction is not viable. Please increase the swap amount to swap with Relayer`,TRANSACTION_REPLACED:`transaction was replaced`,TRANSACTION_REPLACED2:`replacement fee too low`,TRANSACTION_CANCELED:`Transaction was cancelled. Please try again`,NONCE_HIGH:`Nonce too high`,WALLET_CONNECT_MATCHING_KEYS:`No matching key. keychain`,UNKNOWN_PROVIDER:`Unknown provider`,SAFE_ERC:`SafeERC20: low-level call failed`,SAFE_ERC_APPROVE:`SafeERC20: approve from non-zero to non-zero allowance`,SWAP_RELAYER_MIN:`Relayer minimum fee is not satisfied`,LOW_LEVEL_CALL:`low-level delegate call failed`,INTEGRAL_CURVE_ZERO:`previous integral cannot be zero`,YOU_CANCELED_REQUEST:`You canceled the request`,YOU_CANCELED_TRANSACTION_REQUEST:`You cancelled the transaction request.`,SLIPPAGE_LIMIT:`Slippage Limit Exceeded`,SLIPPAGE_LIMIT_1:`Slippage screwed you`,QUOTE_EXPIRED:`Quote has expired`,REVERT_NO_STRING:`Transaction reverted without a reason string`,CONNECTION_FAILED:`Failed to connect`,FAILED_TO_SWITCH_NETWORKS:`Please switch networks in your wallet settings`,INVALID_FROM:`Invalid from token`,INVALID_TO:`Invalid to token`,Invalid_Password:`Invalid password`,INTERNAL_ERROR:`Internal error: please, try again`,INVALID_MERKLE_ROOT:`Invalid merkle tree root`,MERLE_TREE_SNARK:`Error in template ForceEqualIfEnabled`,ERROR_MESSAGE_CHAIN_ADDRESS_CHANGED:`Chain/address changed: balance updated canceled`,DECIMALS_LIMIT:`Number of decimals exceed maximum`,MERKLE_TREE_INCOMPLETE:`Merkle tree is incomplete`,FAIL_ESTIMATE_GAS:`Failed to estimate gas: check the transaction parameters`,LEDGER_IS_LOCKED:`Ledger device: Locked device`,LEDGER_BLIDN_SIGNING_NOT_ALLOWED:`Ledger device: UNKNOWN_ERROR (0x6a8c)`,LEDGER_IS_NOT_AVAILABLE:`Ledger device: UNKNOWN_ERROR`,LEDGER_ACCESS_DENIED:`Access denied to use Ledger device.`,GAS_ESTIMATION_ERROR:`Failed Gas Estimates Response`,GAS_ESTIMATE_INCORRECT_PARAMETERS:`Incorrect Parameters for Gas Estimate`,CONNECTIVITY_ERROR:`Request failed with status code 500`,TRANSACTION_FAILED:`Transaction Failed: Revert`,NO_SWAP_QUOTES:`No swap quotes available`,FEES_OVER_TRANSACTION_VALUE:`Fees are over transaction value. Please, increase the amount`,GAS_STATION_NOT_AVAILABLE:`Gas Station Not Available`,INBALANCE_IN_TOKEN:`Inbalance in token detected`,BALANCE_EQUATION_FAILED:`Balance Diff Should be equal to sum of onchain and offchain created commitments`,TOKEN_ADD_ERROR:`Error occoured while adding token. Please make sure you are adding a valid ERC-20 token`,CANNOT_ESTIMATE_GAS:`transaction may require manual gas limit`,NETWORK_ERROR:`Network Error`,MAX_FEE_GAS_ERROR:`max fee per gas less than block base fee`,CORS_ERROR:`has been blocked by CORS policy`,CANNOT_ESTIMATE_GAS2:`transaction may fail or may require manual gas limit`,NO_RESPONSE_PRIVATE:`No resonse from private relay`,TRY_AGAIN_AFTER_TRANSACTION:`Please, try again`,ALREADY_SUBSCRIBED:`User Already Subscribed`,PREFERRED_TOKEN_OR_ADDRESS_MISSING:`Please, specify both the preferred token and public wallet address`,SNAPSHOT_FILE_NOT_FOUND:`We are updating our servers. Please try again in some time`,SAME_ADDRESS_FORBIDDEN:`You cannot recieve staked tokens on the same ethereum address`,NOT_VALID_ETHEREUM_ADDRESS:`Please enter a valid Ethereum address`,MUST_STAKE_AT_LEAST_ONE_ETH:`Amount too low, Please stake at least 1 ETH`,OUT_OF_MEMORY:`Out of memory: Cannot allocate Wasm memory`,OUT_OF_MEMORY2:`could not allocate memory`,OUT_OF_MEMORY3:`out of memory`,UNKNOWN:`Unknown error`,TRANSACTION_WRONG_REQUEST:`The requested Transaction type is not supported`,INSUFFICIENT_LAMPORTS:`insufficient lamports`,TOKENS_DO_NOT_BELONG_SAME_CHAIN:`Tokens belong to different chains. All tokens must belong to the same chain`,OKX_MIN_RETURN_NOT_REACHED:`custom program error: 0x177a`,MIN_RETURNED_NOT_REACHED:`MinReturnNotReached`,SOLANA_RECEIVED_LOWER_THAN_EXPECTED:`ReceivedAmountLowerThanExpected`,AUTO_SHIELD_SKIPPED:`We skipped auto-shield because the asset was an NFT or the remaining token was used as gas.`,LOW_OUTPUT_AMOUNT:`Gas fees exceed received amount. Please try adjusting amount or lowering slippage.`,EXECUTION_REVERTED:`execution reverted`,SOLANA_TRANSACTION_LOG_SIZE_LIMIT:`Transaction logs are too large. Please try again later`,COMPUTATIONAL_BUDGET_EXCEEDED:`ComputationalBudgetExceeded`,RELAY_FEE_OVER_WITHDRAW_AMOUNT:`Relay Fee is over withdraw amount`,TRON_CONFIRMATION_DECLINED:`Confirmation declined by user`,BLACKLISTED_INPUT_COMMITMENT_ADDRESS:`One of the source addresses is restricted from private transactions`,ACCOUNT_RESOURCE_INSUFFICIENT_ERROR:`Account resource insufficient error`,TRON_ROOT_HASH_STALE:`Hinkal Root Hash Is Stale For Insertion`,TRON_TX_IN_FLIGHT:`Another Hinkal transaction is in progress`,SOLANA_CONFIRMATION_TIMEOUT:`Transaction was not confirmed in`,BRIDGE_ARRIVAL_TIMEOUT:`Bridge did not land on destination temp wallet`},i=`Not enough memory. Please, close some tabs/applications to free up memory and try again`,a=`Your transaction didn’t go through due to price slippage. Try increasing your slippage tolerance`,o={USER_REJECTED_TRANSACTION:`You cancelled the transaction`,SOME_ERROR:`Some error has occurred. Please try again in a few minutes. If the issue persists, please report it in Discord`,TOO_HIGH_AMOUNT:`The amount you provided is too high, please adjust the amount`,BRIDGE_AMOUNT_TOO_LOW:`The amount is too low for this swap. Please increase the amount and try again`,NOT_ENOUGH_TOKENS:`Transfer amount exceeds balance. Try lowering amount or add funds and retry.`,WC_NO_MATCHING_KEY:`Wallet Connect error. Please, try again`,RPC_PROVIDER_LIMIT_ERROR:`Rate Limit: please, use different rpc provider in your wallet`,INSUFFICIENT_FUNDS_GAS:`Your balance is too low to cover the transaction fees. Please add funds to proceed`,INSUFFICIENT_TRON_BALANCE_FOR_FEE:`Your TRX balance is too low to cover amount and transaction fee`,INVALID_NULLIFIER:`There seems to be an issue with syncing your balance. Please press the refresh icon next to your shielded balance`,STATE_TO_UPDATE:`A technical issue has occurred. Please create a ticket on Hinkal discord server`,INVALID_ZKP:`The Zero Knowledge Proof provided is invalid. Please check and try again`,NONCE_HIGH:`To resolve this issue, please reset your wallet in the Settings`,UNKNOWN_PROVIDER:`The provider is not recognized. Please check your settings`,TRANSACTION_REPLACED:`Your transaction was replaced by another. Please submit your transaction again`,TRANSACTION_REPLACED2:`This transaction was replaced. Please try submitting again`,TRANSACTION_TIMEOUT:`Your transaction got stale. Please, try in a few seconds`,SAFE_ERC:`Your approved amount is lower than what you’re trying to send. Increase the approval or adjust the amount, then try again.`,SIMULATION_FAILED:`Transaction simulation failed. Please try again.`,SAFE_ERC_APPROVE:`The selected ERC20 Token could not be approved. Please contact the Hinkal support team`,INTEGRAL_CURVE_ZERO:`There's an issue with the pool's staking function. Please contact the Hinkal support team for assistance`,LOW_LEVEL_CALL:`A technical issue occurred. Please contact the Hinkal team for assistance`,YOU_CANCELED_REQUEST:`You canceled the request`,YOU_CANCELED_TRANSACTION_REQUEST:`You cancelled the transaction request.`,USER_REJECTED_ACTION:`You cancelled the transaction`,USER_REJECTED_SIGN2:`You canceled the request`,USER_REJECTED_RPC:`You canceled the request`,USER_DENIED_TRANSACTION_SIGNATURE:`You canceled the request`,USER_DENIED_REQUEST_SIGNATURE:`You canceled the request`,CONNECT_ERROR2:`Oops, there are connectivity issues. Please check your internet connection and try again`,WALLET_CONNECT_MATCHING_KEYS:`An internal WalletConnect error occurred. Please try reconnecting`,SIGNATURE_UNSUPPORTED_CHAINS:`The transaction couldn’t be signed: this network is not supported`,SIGNATURE_UNSUPPORTED_CHAINS2:`The transaction couldn’t be signed: this network is not supported`,SIGNATURE_UNSUPPORTED_PERSONAL_SIGN:`Your active wallet doesn't support personal signatures. Please use a different wallet`,REVERT_NO_STRING:`Your transaction didn’t go through due to technical issues. Please submit a ticket on Hinkal discord server`,INVALID_MERKLE_ROOT:`There's an issue with the merkle tree root. Please submit a ticket on Hinkal discord server`,MERLE_TREE_SNARK:`An error occurred in the circuit processing. Please submit a ticket on Hinkal discord server`,MAX_FEE_GAS_ERROR:`Your transaction was rejected due to high network congestion`,MERKLE_TREE_INCOMPLETE:`A technical issue has occurred. Please submit a ticket on Hinkal discord server`,CORS_ERROR:`Unable to reach the remote client. Please submit a ticket on Hinkal discord server`,NETWORK_ERROR:`Connection error. Please, check back later`,CONNECTIVITY_ERROR:`A connectivity issue occurred. Please check your network connection`,LEDGER_IS_LOCKED:`Your wallet is locked. Please unlock your wallet`,LEDGER_BLIDN_SIGNING_NOT_ALLOWED:`Your ledger is not allowed to sign transactions. Please allow blind signing`,LEDGER_IS_NOT_AVAILABLE:`Access denied to use Ledger device.`,LEDGER_ACCESS_DENIED:`Access denied to use Ledger device.`,INBALANCE_IN_TOKEN:a,OKX_MIN_RETURN_NOT_REACHED:a,SOLANA_RECEIVED_LOWER_THAN_EXPECTED:a,MIN_RETURNED_NOT_REACHED:a,BALANCE_EQUATION_FAILED:`There's an issue with the balance calculation. Please adjust your transaction parameters`,SLIPPAGE_LIMIT_1:`Your transaction didn’t go through due to price slippage. Adjust slippage settings and retry`,CANNOT_ESTIMATE_GAS:`Unable to estimate the gas required. Please set the gas limit manually`,CANNOT_ESTIMATE_GAS2:`Your transaction didn’t go through. Please try setting gas limit manually`,GAS_STATION_NOT_AVAILABLE:`The Gas Station service is currently unavailable. Please submit a ticket on Hinkal discord server`,TIMESTAMP_STALE:`This transaction is outdated. Please initiate a new transaction`,ALREADY_SUBSCRIBED:`This email is already subscribed to the Hinkal newsletter`,OUT_OF_MEMORY:i,OUT_OF_MEMORY2:i,OUT_OF_MEMORY3:i,INVALID_RECOVERY_PHRASE:`Invalid recovery phrase`,PHRASES_DONT_MATCH:`Phrases do not match. You can go back and verify your recovery phrase.`,PASSWORDS_DONT_MATCH:`Passwords do not match`,PASSWORD_SAME_AS_OLD:`Password cannot be the same as the old one`,PASSWORD_TOO_SMALL:`Password must be at least 8 characters`,PASSWORD_NOT_CORRECT:`Incorrect current password`,CODE_ALREADY_USED:`This code has already been used`,ACCESS_CODE_REQUIRED:`Access code is required`,ACCESS_CODE_IS_ALREADY_IN_USE:`Access code is already in use`,ACCESS_CODE_IS_ALREADY_IN_USE1:`Access code already in use. Import or connect existing wallet`,ERROR_DURING_PHRASE_CONFIRMATION:`Error during Phrase confirmation`,INSUFFICIENT_LAMPORTS:`Your SOL balance is too low to complete this transaction`,EXECUTION_REVERTED:`Your transaction reverted.`,COMPUTATIONAL_BUDGET_EXCEEDED:`Your transaction exceeded the limited compute units. Please try again.`,RELAY_FEE_OVER_WITHDRAW_AMOUNT:`Your transaction didn’t go through because the relay fee exceeded the transaction amount`,TRON_CONFIRMATION_DECLINED:`You canceled the request`,INVALID_RELAYER_FEE:`The transaction fee changed while submitting. Please try again.`,REQUEST_PENDING:`A request is already pending in your wallet. Please confirm to connect.`,BLACKLISTED_INPUT_COMMITMENT_ADDRESS:`The funds you’re trying to use have been flagged as sanctioned.`,NO_SWAP_QUOTES:`No swap route available for this token pair on the selected network at the moment. Please try again later or adjust the swap parameters.`,TRON_ROOT_HASH_STALE:`Another transaction was processed just before yours. Please try again`,TRON_TX_IN_FLIGHT:`Another transaction is currently being processed. Please try again in a few seconds`,TRON_ACCOUNT_NOT_ACTIVATED:`Ensure to first activate the TRON account you're connected with.`,NO_LIFI_PRICE:`Li-Fi provider couldn't fetch the price. please, retry in a few seconds.`,SOLANA_CONFIRMATION_TIMEOUT:`Network didn't confirm your transfer in time. It may still be confirmed - please, check Solscan before retrying.`,BRIDGE_ARRIVAL_TIMEOUT:`The bridge is taking longer than usual. Your funds left the source chain and are not lost - once they arrive, claim them from Recovery Funds.`},s=/account\s*\[[^\]]*\]\s*does not exist/i,c={UTXO_LIMITATIONS:`Your transaction exceeds the UTXO limit`,INSUFFICIENT_BALANCE_FOR_FEES:`Fees are high right now and would consume a large portion of your balance. Consider reducing the amount or retrying later.`,HIGH_FEE_WARNING:`Total fees exceed your available balance. Consider adding funds or retry later when fees decrease.`,INSUFFICIENT_FUNDS_FOR_RECOVERY_FEES:`Insufficient funds to cover recovery fees`};exports.DIRECTLY_SHOW_MESSAGE_ERROR_CODES=c,exports.TRON_ACCOUNT_NOT_ACTIVATED_PATTERN=s,exports.UserFriendlyErrorCodes=o,exports.gasErrorCodes=n,exports.insufficientResourcesErrorCodes=t,exports.transactionErrorCodes=r;
@@ -18,6 +18,7 @@ export declare const gasErrorCodes: {
18
18
  export declare const transactionErrorCodes: {
19
19
  SOME_ERROR: string;
20
20
  TOO_HIGH_AMOUNT: string;
21
+ BRIDGE_AMOUNT_TOO_LOW: string;
21
22
  NOT_ENOUGH_TOKENS: string;
22
23
  TRANSACTION_NOT_CONFIRMED: string;
23
24
  RPC_PROVIDER_LIMIT_ERROR: string;
@@ -161,6 +162,7 @@ export declare const UserFriendlyErrorCodes: {
161
162
  USER_REJECTED_TRANSACTION: string;
162
163
  SOME_ERROR: string;
163
164
  TOO_HIGH_AMOUNT: string;
165
+ BRIDGE_AMOUNT_TOO_LOW: string;
164
166
  NOT_ENOUGH_TOKENS: string;
165
167
  WC_NO_MATCHING_KEY: string;
166
168
  RPC_PROVIDER_LIMIT_ERROR: string;
@@ -20,6 +20,7 @@ var e = {
20
20
  ...n,
21
21
  SOME_ERROR: "Some error has occurred. Please try again in a few minutes. If the issue persists, please report it in Discord",
22
22
  TOO_HIGH_AMOUNT: "ApproxParamsInvalid",
23
+ BRIDGE_AMOUNT_TOO_LOW: "Amount is too low for bridge",
23
24
  NOT_ENOUGH_TOKENS: "Transfer amount exceeds balance",
24
25
  TRANSACTION_NOT_CONFIRMED: "The transaction was not confirmed by the network. Please, try again",
25
26
  RPC_PROVIDER_LIMIT_ERROR: "Non-200 status code: '429'",
@@ -150,6 +151,7 @@ var e = {
150
151
  USER_REJECTED_TRANSACTION: "You cancelled the transaction",
151
152
  SOME_ERROR: "Some error has occurred. Please try again in a few minutes. If the issue persists, please report it in Discord",
152
153
  TOO_HIGH_AMOUNT: "The amount you provided is too high, please adjust the amount",
154
+ BRIDGE_AMOUNT_TOO_LOW: "The amount is too low for this swap. Please increase the amount and try again",
153
155
  NOT_ENOUGH_TOKENS: "Transfer amount exceeds balance. Try lowering amount or add funds and retry.",
154
156
  WC_NO_MATCHING_KEY: "Wallet Connect error. Please, try again",
155
157
  RPC_PROVIDER_LIMIT_ERROR: "Rate Limit: please, use different rpc provider in your wallet",
@@ -1 +1 @@
1
- const e=require(`./error-codes.constants.cjs`),t=require(`./customErrors/ErrorWithAmount.cjs`),n=require(`./customErrors/FeeOverTransactionValueError.cjs`),r=require(`./types.cjs`),i=require(`./customErrors/customErrors.helpers.cjs`);require(`./customErrors/index.cjs`);const a=require(`../types/transaction.types.cjs`);require(`../types/index.cjs`);const o=require(`./isInsufficientFundsError.cjs`);var s=(e,t)=>{let n=t.reduce((e,t)=>{if(!(typeof e!=`object`||!e||!(t in e)))return e[t]},e);return typeof n==`string`&&n?n:void 0},c=e=>{if(typeof e==`object`&&e){let t=s(e,[`response`,`data`,`message`])??s(e,[`response`,`data`,`detail`])??s(e,[`data`,`message`])??s(e,[`data`,`detail`]);if(t)return t;if(`message`in e&&typeof e.message==`string`&&e.message)return e.message;if(`error`in e&&typeof e.error==`string`&&e.error)return e.error}if(e instanceof Error)return e.message;if(typeof e==`string`)return e},l=t=>{switch(t){case r.ErrorCategory.DEPOSIT:return`Deposit failed`;case r.ErrorCategory.SWAP:return`Swap failed`;case r.ErrorCategory.BRIDGE:return`Bridge failed`;case r.ErrorCategory.WITHDRAW:return`Send failed`;case r.ErrorCategory.Fund:return`Unshield failed`;case r.ErrorCategory.Receive:return`Shield failed`;case r.ErrorCategory.DappTransaction:return`DApp transaction failed`;case r.ErrorCategory.Approve:return`Approval failed`;default:return e.transactionErrorCodes.UNKNOWN}},u=(r,a)=>{if(r instanceof n.FeeOverTransactionValueError)return i.getGenericFeeOverTransactionValueErrorMessage(r,a);if(r instanceof t.ErrorWithAmount)return r.message;let s=c(r);if(s&&o.isInsufficientFundsError(s))return e.insufficientResourcesErrorCodes.INSUFFICIENT_FUNDS;if(s&&e.TRON_ACCOUNT_NOT_ACTIVATED_PATTERN.test(s))return e.UserFriendlyErrorCodes.TRON_ACCOUNT_NOT_ACTIVATED;if(s){let t=s.toLowerCase(),n=Object.keys(e.transactionErrorCodes).find(n=>t===e.transactionErrorCodes[n].toLowerCase());if(n&&n in e.UserFriendlyErrorCodes)return e.UserFriendlyErrorCodes[n];let r=Object.entries(e.transactionErrorCodes).find(([e,n])=>t.includes(n.toLowerCase()));if(r)return e.UserFriendlyErrorCodes[r[0]]??r[1];if(Object.values(e.DIRECTLY_SHOW_MESSAGE_ERROR_CODES).find(e=>t.includes(e.toLowerCase())))return s}return a?l(a):e.transactionErrorCodes.UNKNOWN},d=(e,t)=>{let n;switch(t){case a.TransactionRequestType.Send:case a.TransactionRequestType.ProxySend:n=r.ErrorCategory.WITHDRAW;break;case a.TransactionRequestType.SwapTokens:case a.TransactionRequestType.ProxySwapTokens:n=r.ErrorCategory.SWAP;break;case a.TransactionRequestType.ReceiveFromShieldedAccount:n=r.ErrorCategory.Receive;break;case a.TransactionRequestType.Fund:n=r.ErrorCategory.Fund;break;case a.TransactionRequestType.PrivateTransactionFromProxy:n=r.ErrorCategory.DappTransaction;break;default:n=void 0;break}return u(e,n)};exports.extractMessage=c,exports.getErrorMessage=u,exports.getErrorMessageFromTransactionRequest=d;
1
+ const e=require(`./error-codes.constants.cjs`),t=require(`./customErrors/ErrorWithAmount.cjs`),n=require(`./customErrors/FeeOverTransactionValueError.cjs`),r=require(`./types.cjs`),i=require(`./customErrors/customErrors.helpers.cjs`);require(`./customErrors/index.cjs`);const a=require(`../types/transaction.types.cjs`);require(`../types/index.cjs`);const o=require(`./isInsufficientFundsError.cjs`);var s=(e,t)=>{let n=t.reduce((e,t)=>{if(!(typeof e!=`object`||!e||!(t in e)))return e[t]},e);return typeof n==`string`&&n?n:void 0},c=e=>{if(typeof e==`object`&&e){let t=s(e,[`response`,`data`,`message`])??s(e,[`response`,`data`,`detail`])??s(e,[`response`,`data`,`error`,`message`])??s(e,[`data`,`message`])??s(e,[`data`,`detail`])??s(e,[`data`,`error`,`message`]);if(t)return t;if(`message`in e&&typeof e.message==`string`&&e.message)return e.message;if(`error`in e&&typeof e.error==`string`&&e.error)return e.error}if(e instanceof Error)return e.message;if(typeof e==`string`)return e},l=t=>{switch(t){case r.ErrorCategory.DEPOSIT:return`Deposit failed`;case r.ErrorCategory.SWAP:return`Swap failed`;case r.ErrorCategory.BRIDGE:return`Bridge failed`;case r.ErrorCategory.WITHDRAW:return`Send failed`;case r.ErrorCategory.Fund:return`Unshield failed`;case r.ErrorCategory.Receive:return`Shield failed`;case r.ErrorCategory.DappTransaction:return`DApp transaction failed`;case r.ErrorCategory.Approve:return`Approval failed`;default:return e.transactionErrorCodes.UNKNOWN}},u=(r,a)=>{if(r instanceof n.FeeOverTransactionValueError)return i.getGenericFeeOverTransactionValueErrorMessage(r,a);if(r instanceof t.ErrorWithAmount)return r.message;let s=c(r);if(s&&o.isInsufficientFundsError(s))return e.insufficientResourcesErrorCodes.INSUFFICIENT_FUNDS;if(s&&e.TRON_ACCOUNT_NOT_ACTIVATED_PATTERN.test(s))return e.UserFriendlyErrorCodes.TRON_ACCOUNT_NOT_ACTIVATED;if(s){let t=s.toLowerCase(),n=Object.keys(e.transactionErrorCodes).find(n=>t===e.transactionErrorCodes[n].toLowerCase());if(n&&n in e.UserFriendlyErrorCodes)return e.UserFriendlyErrorCodes[n];let r=Object.entries(e.transactionErrorCodes).find(([e,n])=>t.includes(n.toLowerCase()));if(r)return e.UserFriendlyErrorCodes[r[0]]??r[1];if(Object.values(e.DIRECTLY_SHOW_MESSAGE_ERROR_CODES).find(e=>t.includes(e.toLowerCase())))return s}return a?l(a):e.transactionErrorCodes.UNKNOWN},d=(e,t)=>{let n;switch(t){case a.TransactionRequestType.Send:case a.TransactionRequestType.ProxySend:n=r.ErrorCategory.WITHDRAW;break;case a.TransactionRequestType.SwapTokens:case a.TransactionRequestType.ProxySwapTokens:n=r.ErrorCategory.SWAP;break;case a.TransactionRequestType.ReceiveFromShieldedAccount:n=r.ErrorCategory.Receive;break;case a.TransactionRequestType.Fund:n=r.ErrorCategory.Fund;break;case a.TransactionRequestType.PrivateTransactionFromProxy:n=r.ErrorCategory.DappTransaction;break;default:n=void 0;break}return u(e,n)};exports.extractMessage=c,exports.getErrorMessage=u,exports.getErrorMessageFromTransactionRequest=d;
@@ -23,7 +23,16 @@ var d = (e, t) => {
23
23
  "response",
24
24
  "data",
25
25
  "detail"
26
- ]) ?? d(e, ["data", "message"]) ?? d(e, ["data", "detail"]);
26
+ ]) ?? d(e, [
27
+ "response",
28
+ "data",
29
+ "error",
30
+ "message"
31
+ ]) ?? d(e, ["data", "message"]) ?? d(e, ["data", "detail"]) ?? d(e, [
32
+ "data",
33
+ "error",
34
+ "message"
35
+ ]);
27
36
  if (t) return t;
28
37
  if ("message" in e && typeof e.message == "string" && e.message) return e.message;
29
38
  if ("error" in e && typeof e.error == "string" && e.error) return e.error;
@@ -1 +1 @@
1
- require(`./utils/abi.utils.cjs`),require(`./utils/serialize.utils.cjs`),require(`./utils/caseInsensitive.utils.cjs`),require(`./utils/amounts.utils.cjs`),require(`./web3/etherFunctions.cjs`),require(`./utils/time.utils.cjs`),require(`./utils/upToDateState.cjs`),require(`./utils/cacheFunctions.cjs`),require(`./utils/encodeTokenWithId.cjs`),require(`./utils/enclaveHandshakeService.cjs`),require(`./utils/encryptInputForEnclave.cjs`),require(`./utils/solanaMint.utils.cjs`),require(`./utils/serialize-utxos.utils.cjs`),require(`./utils/customEnclaveFunctionsRegister.cjs`),require(`./utils/tron.utils.cjs`),require(`./utils/addresses.cjs`),require(`./web3/events/getInputUtxoAndBalance.cjs`),require(`./utils/legacyKeys.cjs`),require(`./utils/auth.utils.cjs`),require(`./utils/receive-vault.utils.cjs`),require(`./utils/string.utils.cjs`),require(`./utils/token-check.utils.cjs`),require(`./utils/map.utils.cjs`),require(`./utils/mutexes.utils.cjs`),require(`./utils/erc20tokenFunctions.cjs`),require(`./web3/events/getShieldedBalance.cjs`),require(`./pre-transaction/outputUtxoProcessing.cjs`),require(`./utils/external-action.utils.cjs`),require(`./snarkjs/common.snarkjs.cjs`),require(`./pre-transaction/solana.cjs`),require(`./snarkjs/signedMessageHash.cjs`),require(`./pre-transaction/process-gas-estimates.cjs`),require(`./pre-transaction/getVolatileTransferAmount.cjs`),require(`./pre-transaction/constructAdminData.cjs`),require(`./utils/create-provider.cjs`),require(`./pre-transaction/calculateSolanaNullifierCount.cjs`),require(`./pre-transaction/convert-okx-instructions.cjs`),require(`./utils/process.utils.cjs`),require(`./pre-transaction/sendV0Transaction.cjs`),require(`./utils/bytes32.utils.cjs`),require(`./pre-transaction/getFeeStructure.cjs`),require(`./utils/fees.utils.cjs`),require(`./pre-transaction/getExternalSwapAddress.cjs`),require(`./pre-transaction/speculativeUtxo.cjs`),require(`./pre-transaction/buildCommitmentValidationData.cjs`),require(`./pre-transaction/index.cjs`),require(`./snarkjs/generateZkProof.cjs`),require(`./snarkjs/generateMainAndCommitmentZkProof.cjs`),require(`./web3/getContractMetadata.cjs`),require(`./utils/solana-program.utils.cjs`),require(`./snarkjs/fetchOnChainRootHashes.cjs`),require(`./utils/getContractAddress.cjs`),require(`./private-wallet/emporium.helpers.cjs`),require(`./snarkjs/constructGeneralZkProof.cjs`),require(`./utils/getSignerFromContract.cjs`),require(`./utils/tronSimulation.utils.cjs`),require(`./utils/resolve-sync.utils.cjs`),require(`./utils/cacheDevice.utils.cjs`),require(`./utils/involves-permit2-op.cjs`),require(`./utils/convertEmporiumOpToCallInfo.cjs`),require(`./utils/getRecipientInfoFromUserKeys.cjs`),require(`./utils/publicBalance.utils.cjs`),require(`./utils/postToOffscreen.cjs`),require(`./utils/proxyAvatar.utils.cjs`),require(`./utils/enclave-utxo-storage.cjs`),require(`./utils/enclave-signature-storage.cjs`),require(`./utils/tx-confirmation.utils.cjs`),require(`./utils/bridge-arrival.utils.cjs`),require(`./utils/solana-sponsored.utils.cjs`),require(`./utils/temp-wallet.utils.cjs`),require(`./utils/mnemonics.cjs`),require(`./utils/nearIntents.utils.cjs`),require(`./utils/index.cjs`),require(`./web3/lifiAPI.cjs`),require(`./web3/okxAPI.cjs`),require(`./web3/index.cjs`),require(`./snarkjs/constructSolanaZkProof.cjs`),require(`./snarkjs/index.cjs`),require(`./private-wallet/emporium.swap.helpers.cjs`),require(`./private-wallet/index.cjs`),require(`./auto-deposit-back-helpers/get-tokens-to-deposit-back.cjs`),require(`./auto-deposit-back-helpers/get-gas-token-records.cjs`),require(`./auto-deposit-back-helpers/select-gas-token.cjs`),require(`./auto-deposit-back-helpers/update-hinkal.cjs`),require(`./auto-deposit-back-helpers/index.cjs`);
1
+ require(`./utils/abi.utils.cjs`),require(`./utils/serialize.utils.cjs`),require(`./utils/caseInsensitive.utils.cjs`),require(`./utils/amounts.utils.cjs`),require(`./web3/etherFunctions.cjs`),require(`./utils/time.utils.cjs`),require(`./utils/upToDateState.cjs`),require(`./utils/cacheFunctions.cjs`),require(`./utils/encodeTokenWithId.cjs`),require(`./utils/enclaveHandshakeService.cjs`),require(`./utils/encryptInputForEnclave.cjs`),require(`./utils/solanaMint.utils.cjs`),require(`./utils/serialize-utxos.utils.cjs`),require(`./utils/customEnclaveFunctionsRegister.cjs`),require(`./utils/tron.utils.cjs`),require(`./utils/addresses.cjs`),require(`./web3/events/getInputUtxoAndBalance.cjs`),require(`./utils/legacyKeys.cjs`),require(`./utils/auth.utils.cjs`),require(`./utils/create-provider.cjs`),require(`./web3/getContractMetadata.cjs`),require(`./utils/receive-vault-solana.utils.cjs`),require(`./utils/receive-vault.utils.cjs`),require(`./utils/string.utils.cjs`),require(`./utils/token-check.utils.cjs`),require(`./utils/map.utils.cjs`),require(`./utils/mutexes.utils.cjs`),require(`./utils/erc20tokenFunctions.cjs`),require(`./web3/events/getShieldedBalance.cjs`),require(`./pre-transaction/outputUtxoProcessing.cjs`),require(`./utils/external-action.utils.cjs`),require(`./snarkjs/common.snarkjs.cjs`),require(`./pre-transaction/solana.cjs`),require(`./snarkjs/signedMessageHash.cjs`),require(`./pre-transaction/process-gas-estimates.cjs`),require(`./pre-transaction/getVolatileTransferAmount.cjs`),require(`./pre-transaction/constructAdminData.cjs`),require(`./pre-transaction/calculateSolanaNullifierCount.cjs`),require(`./pre-transaction/convert-okx-instructions.cjs`),require(`./utils/process.utils.cjs`),require(`./pre-transaction/sendV0Transaction.cjs`),require(`./utils/bytes32.utils.cjs`),require(`./pre-transaction/getFeeStructure.cjs`),require(`./utils/gas-token.utils.cjs`),require(`./utils/fees.utils.cjs`),require(`./pre-transaction/getExternalSwapAddress.cjs`),require(`./pre-transaction/speculativeUtxo.cjs`),require(`./pre-transaction/buildCommitmentValidationData.cjs`),require(`./pre-transaction/index.cjs`),require(`./snarkjs/generateZkProof.cjs`),require(`./snarkjs/generateMainAndCommitmentZkProof.cjs`),require(`./utils/solana-program.utils.cjs`),require(`./snarkjs/fetchOnChainRootHashes.cjs`),require(`./utils/getContractAddress.cjs`),require(`./private-wallet/emporium.helpers.cjs`),require(`./snarkjs/constructGeneralZkProof.cjs`),require(`./utils/getSignerFromContract.cjs`),require(`./utils/tronSimulation.utils.cjs`),require(`./utils/resolve-sync.utils.cjs`),require(`./utils/admin-dimensions.cjs`),require(`./utils/cacheDevice.utils.cjs`),require(`./utils/involves-permit2-op.cjs`),require(`./utils/convertEmporiumOpToCallInfo.cjs`),require(`./utils/getRecipientInfoFromUserKeys.cjs`),require(`./utils/publicBalance.utils.cjs`),require(`./utils/wallet-token-discovery.utils.cjs`),require(`./utils/postToOffscreen.cjs`),require(`./utils/proxyAvatar.utils.cjs`),require(`./utils/enclave-utxo-storage.cjs`),require(`./utils/enclave-signature-storage.cjs`),require(`./utils/tx-confirmation.utils.cjs`),require(`./utils/bridge-arrival.utils.cjs`),require(`./utils/solana-sponsored.utils.cjs`),require(`./utils/temp-wallet.utils.cjs`),require(`./utils/mnemonics.cjs`),require(`./utils/nearIntents.utils.cjs`),require(`./utils/index.cjs`),require(`./web3/lifiAPI.cjs`),require(`./web3/okxAPI.cjs`),require(`./web3/index.cjs`),require(`./snarkjs/constructSolanaZkProof.cjs`),require(`./snarkjs/index.cjs`),require(`./private-wallet/emporium.swap.helpers.cjs`),require(`./private-wallet/index.cjs`),require(`./auto-deposit-back-helpers/get-tokens-to-deposit-back.cjs`),require(`./auto-deposit-back-helpers/get-gas-token-records.cjs`),require(`./auto-deposit-back-helpers/select-gas-token.cjs`),require(`./auto-deposit-back-helpers/update-hinkal.cjs`),require(`./auto-deposit-back-helpers/index.cjs`);
@@ -17,6 +17,9 @@ import "./utils/addresses.mjs";
17
17
  import "./web3/events/getInputUtxoAndBalance.mjs";
18
18
  import "./utils/legacyKeys.mjs";
19
19
  import "./utils/auth.utils.mjs";
20
+ import "./utils/create-provider.mjs";
21
+ import "./web3/getContractMetadata.mjs";
22
+ import "./utils/receive-vault-solana.utils.mjs";
20
23
  import "./utils/receive-vault.utils.mjs";
21
24
  import "./utils/string.utils.mjs";
22
25
  import "./utils/token-check.utils.mjs";
@@ -32,13 +35,13 @@ import "./snarkjs/signedMessageHash.mjs";
32
35
  import "./pre-transaction/process-gas-estimates.mjs";
33
36
  import "./pre-transaction/getVolatileTransferAmount.mjs";
34
37
  import "./pre-transaction/constructAdminData.mjs";
35
- import "./utils/create-provider.mjs";
36
38
  import "./pre-transaction/calculateSolanaNullifierCount.mjs";
37
39
  import "./pre-transaction/convert-okx-instructions.mjs";
38
40
  import "./utils/process.utils.mjs";
39
41
  import "./pre-transaction/sendV0Transaction.mjs";
40
42
  import "./utils/bytes32.utils.mjs";
41
43
  import "./pre-transaction/getFeeStructure.mjs";
44
+ import "./utils/gas-token.utils.mjs";
42
45
  import "./utils/fees.utils.mjs";
43
46
  import "./pre-transaction/getExternalSwapAddress.mjs";
44
47
  import "./pre-transaction/speculativeUtxo.mjs";
@@ -46,7 +49,6 @@ import "./pre-transaction/buildCommitmentValidationData.mjs";
46
49
  import "./pre-transaction/index.mjs";
47
50
  import "./snarkjs/generateZkProof.mjs";
48
51
  import "./snarkjs/generateMainAndCommitmentZkProof.mjs";
49
- import "./web3/getContractMetadata.mjs";
50
52
  import "./utils/solana-program.utils.mjs";
51
53
  import "./snarkjs/fetchOnChainRootHashes.mjs";
52
54
  import "./utils/getContractAddress.mjs";
@@ -55,11 +57,13 @@ import "./snarkjs/constructGeneralZkProof.mjs";
55
57
  import "./utils/getSignerFromContract.mjs";
56
58
  import "./utils/tronSimulation.utils.mjs";
57
59
  import "./utils/resolve-sync.utils.mjs";
60
+ import "./utils/admin-dimensions.mjs";
58
61
  import "./utils/cacheDevice.utils.mjs";
59
62
  import "./utils/involves-permit2-op.mjs";
60
63
  import "./utils/convertEmporiumOpToCallInfo.mjs";
61
64
  import "./utils/getRecipientInfoFromUserKeys.mjs";
62
65
  import "./utils/publicBalance.utils.mjs";
66
+ import "./utils/wallet-token-discovery.utils.mjs";
63
67
  import "./utils/postToOffscreen.mjs";
64
68
  import "./utils/proxyAvatar.utils.mjs";
65
69
  import "./utils/enclave-utxo-storage.mjs";
@@ -1,4 +1,5 @@
1
1
  import { AnchorProvider, Provider } from '@coral-xyz/anchor';
2
2
  import { Keypair, PublicKey } from '@solana/web3.js';
3
3
  export declare const getAddressLookupTableAccounts: (provider: AnchorProvider, addressLookupTableAccounts: string[] | undefined) => Promise<import('@solana/web3.js').AddressLookupTableAccount[] | undefined>;
4
+ export declare const extendAddressLookupTable: (provider: Provider, lookupTableAddress: PublicKey, accounts: PublicKey[], payer: Keypair) => Promise<void>;
4
5
  export declare const createAndExtendAddressLookupTable: (provider: Provider, accounts: PublicKey[], payer: Keypair) => Promise<PublicKey>;
@@ -1 +1 @@
1
- require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../error-handling/logger.cjs`),n=require(`../web3/events/getShieldedBalance.cjs`),r=require(`./solana.cjs`),i=require(`../utils/create-provider.cjs`),a=require(`../snarkjs/constructTxEnclave.cjs`);let o=require(`@solana/web3.js`);var s=6,c=async(c,l,u,d)=>{if(!e.isSolanaLike(l)||u.length===0||d.length===0)return 0;if(c.generateProofRemotely)try{return await a.estimateNullifiersEnclaveCall(c,{chainId:l,mintAddresses:u,amountChanges:d})}catch(e){return t.Logger.error(`calculateSolanaNullifierCount: enclave estimate failed, charging maximum rent`,e),s}let f;try{f=(await n.addPaddingToUtxos(c,l,u,d,6)).flat().filter(e=>e.amount!==0n)}catch(e){return t.Logger.log(`Error during getting inputUtxos locally:`,e),s}if(f.length===0)return 0;try{let{contractData:t,rpcUrl:n}=e.networkRegistry[l],{originalDeployer:a,hinkalIdl:s}=t;if(!a)throw Error(`Original deployer not found for chain ID`);if(!s)throw Error(`Hinkal IDL not found for chain ID`);let c=i.createCustomSolanaConnection(n),u=new o.PublicKey(a),d=new o.PublicKey(s.address),p=f.map(e=>r.getNullifierAccount(BigInt(e.getNullifier()),u,d));return(await c.getMultipleAccountsInfo(p)).filter(e=>e===null).length}catch(e){return t.Logger.error(`calculateSolanaNullifierCount: nullifier probe failed, charging for every note`,e),f.length}};exports.calculateSolanaNullifierCount=c;
1
+ require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../error-handling/logger.cjs`),n=require(`../utils/create-provider.cjs`),r=require(`../web3/events/getShieldedBalance.cjs`),i=require(`./solana.cjs`),a=require(`../snarkjs/constructTxEnclave.cjs`);let o=require(`@solana/web3.js`);var s=6,c=async(c,l,u,d)=>{if(!e.isSolanaLike(l)||u.length===0||d.length===0)return 0;if(c.generateProofRemotely)try{return await a.estimateNullifiersEnclaveCall(c,{chainId:l,mintAddresses:u,amountChanges:d})}catch(e){return t.Logger.error(`calculateSolanaNullifierCount: enclave estimate failed, charging maximum rent`,e),s}let f;try{f=(await r.addPaddingToUtxos(c,l,u,d,6)).flat().filter(e=>e.amount!==0n)}catch(e){return t.Logger.log(`Error during getting inputUtxos locally:`,e),s}if(f.length===0)return 0;try{let{contractData:t,rpcUrl:r}=e.networkRegistry[l],{originalDeployer:a,hinkalIdl:s}=t;if(!a)throw Error(`Original deployer not found for chain ID`);if(!s)throw Error(`Hinkal IDL not found for chain ID`);let c=n.createCustomSolanaConnection(r),u=new o.PublicKey(a),d=new o.PublicKey(s.address),p=f.map(e=>i.getNullifierAccount(BigInt(e.getNullifier()),u,d));return(await c.getMultipleAccountsInfo(p)).filter(e=>e===null).length}catch(e){return t.Logger.error(`calculateSolanaNullifierCount: nullifier probe failed, charging for every note`,e),f.length}};exports.calculateSolanaNullifierCount=c;
@@ -1,8 +1,8 @@
1
1
  import { isSolanaLike as e, networkRegistry as t } from "../../constants/chains.constants.mjs";
2
2
  import { Logger as n } from "../../error-handling/logger.mjs";
3
- import { addPaddingToUtxos as r } from "../web3/events/getShieldedBalance.mjs";
4
- import { getNullifierAccount as i } from "./solana.mjs";
5
- import { createCustomSolanaConnection as a } from "../utils/create-provider.mjs";
3
+ import { createCustomSolanaConnection as r } from "../utils/create-provider.mjs";
4
+ import { addPaddingToUtxos as i } from "../web3/events/getShieldedBalance.mjs";
5
+ import { getNullifierAccount as a } from "./solana.mjs";
6
6
  import { estimateNullifiersEnclaveCall as o } from "../snarkjs/constructTxEnclave.mjs";
7
7
  import { PublicKey as s } from "@solana/web3.js";
8
8
  //#region libs/shared/common/src/functions/pre-transaction/calculateSolanaNullifierCount.ts
@@ -19,16 +19,16 @@ var c = 6, l = async (l, u, d, f) => {
19
19
  }
20
20
  let p;
21
21
  try {
22
- p = (await r(l, u, d, f, 6)).flat().filter((e) => e.amount !== 0n);
22
+ p = (await i(l, u, d, f, 6)).flat().filter((e) => e.amount !== 0n);
23
23
  } catch (e) {
24
24
  return n.log("Error during getting inputUtxos locally:", e), c;
25
25
  }
26
26
  if (p.length === 0) return 0;
27
27
  try {
28
- let { contractData: e, rpcUrl: n } = t[u], { originalDeployer: r, hinkalIdl: o } = e;
29
- if (!r) throw Error("Original deployer not found for chain ID");
28
+ let { contractData: e, rpcUrl: n } = t[u], { originalDeployer: i, hinkalIdl: o } = e;
29
+ if (!i) throw Error("Original deployer not found for chain ID");
30
30
  if (!o) throw Error("Hinkal IDL not found for chain ID");
31
- let c = a(n), l = new s(r), d = new s(o.address), f = p.map((e) => i(BigInt(e.getNullifier()), l, d));
31
+ let c = r(n), l = new s(i), d = new s(o.address), f = p.map((e) => a(BigInt(e.getNullifier()), l, d));
32
32
  return (await c.getMultipleAccountsInfo(f)).filter((e) => e === null).length;
33
33
  } catch (e) {
34
34
  return n.error("calculateSolanaNullifierCount: nullifier probe failed, charging for every note", e), p.length;
@@ -1 +1 @@
1
- const e=require(`../utils/addresses.cjs`);var t=(t,n,r,i,a,o)=>{if(!t)return;let s;return o&&(s={tokenIn:{symbol:o[0]?.symbol,address:o[0]?.erc20TokenAddress.toLowerCase()},tokenOut:{symbol:o[1]?.symbol,address:o[1]?.erc20TokenAddress.toLowerCase()}}),{hashedOwner:e.hashEthereumAddress(a),chainId:n,timestamp:Date.now(),action:t,erc20TokenAddresses:r,erc20TokenAmount:i.map(String),swapPair:s}};exports.constructAdminData=t;
1
+ const e=require(`../utils/addresses.cjs`);var t=(t,n,r,i,a,o)=>{if(!t)return;let s,c;return o&&(c=o[1]?.chainId,s={tokenIn:{symbol:o[0]?.symbol,address:o[0]?.erc20TokenAddress.toLowerCase()},tokenOut:{symbol:o[1]?.symbol,address:o[1]?.erc20TokenAddress.toLowerCase()}}),{hashedOwner:e.hashEthereumAddress(a),chainId:n,timestamp:Date.now(),action:t,erc20TokenAddresses:r,erc20TokenAmount:i.map(String),swapPair:s,destinationChainId:c||void 0}};exports.constructAdminData=t;
@@ -2,8 +2,8 @@ import { hashEthereumAddress as e } from "../utils/addresses.mjs";
2
2
  //#region libs/shared/common/src/functions/pre-transaction/constructAdminData.ts
3
3
  var t = (t, n, r, i, a, o) => {
4
4
  if (!t) return;
5
- let s;
6
- return o && (s = {
5
+ let s, c;
6
+ return o && (c = o[1]?.chainId, s = {
7
7
  tokenIn: {
8
8
  symbol: o[0]?.symbol,
9
9
  address: o[0]?.erc20TokenAddress.toLowerCase()
@@ -19,7 +19,8 @@ var t = (t, n, r, i, a, o) => {
19
19
  action: t,
20
20
  erc20TokenAddresses: r,
21
21
  erc20TokenAmount: i.map(String),
22
- swapPair: s
22
+ swapPair: s,
23
+ destinationChainId: c || void 0
23
24
  };
24
25
  };
25
26
  //#endregion
@@ -1,2 +1,2 @@
1
1
  require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../utils/serialize.utils.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../error-handling/logger.cjs`),r=require(`../../data-structures/AccountActions/AccountActions.cjs`),i=require(`../../types/fee.types.cjs`),a=require(`../../API/solana-priority-fee.cjs`),o=require(`../utils/process.utils.cjs`),s=require(`../../error-handling/retrySolanaError.cjs`);let c=require(`@solana/web3.js`);require(`@solana/spl-token`);var l=5e3,u=6e4,d=async(e,t,n=`confirmed`)=>await o.pollForValue(()=>e.getTransaction(t,{commitment:n,maxSupportedTransactionVersion:0}),{timeoutMs:u,intervalMs:l})??null,f=async(r,i,a,o,s=!1)=>{try{let{blockhash:l}=await r.getLatestBlockhash(),u=new c.VersionedTransaction(new c.TransactionMessage({payerKey:i,recentBlockhash:l,instructions:[c.ComputeBudgetProgram.setComputeUnitLimit({units:t.MAX_COMPUTE_UNIT_LIMIT}),...s?[c.ComputeBudgetProgram.requestHeapFrame({bytes:t.MAX_SOLANA_HEAP_FRAME_BYTES})]:[],...a]}).compileToV0Message(o)),d=await r.simulateTransaction(u,{sigVerify:!1,replaceRecentBlockhash:!0});d.value.err&&n.Logger.error(`Solana compute-unit simulation failed:`,{error:e.safeJsonStringify(d.value.err),logs:d.value.logs});let{unitsConsumed:f}=d.value;if(!f)return t.MAX_COMPUTE_UNIT_LIMIT;let p=Math.ceil(f*(1+t.COMPUTE_UNIT_PADDING_PERCENTAGE));return Math.max(t.MIN_COMPUTE_UNIT_LIMIT,Math.min(p,t.MAX_COMPUTE_UNIT_LIMIT))}catch(e){return n.Logger.error(`Solana compute-unit estimation threw:`,e),t.MAX_COMPUTE_UNIT_LIMIT}},p=(e,t,n,r)=>{let i=new Set;return t&&i.add(t.toBase58()),n?.forEach(e=>i.add(e.toBase58())),e.forEach(e=>{i.add(e.programId.toBase58()),e.keys.forEach(e=>{i.add(e.pubkey.toBase58())})}),r&&r.forEach(e=>{i.add(e.key.toBase58()),e.state.addresses.forEach(e=>{i.add(e.toBase58())})}),[...i].map(e=>new c.PublicKey(e))},m=(t,r)=>{if(!t)throw Error(`Failed to fetch Solana transaction details for signature${r?` ${r}`:``}`);if(t.meta?.err){let i=e.safeJsonStringify(t.meta.err),a=t.meta.logMessages?.join(`
2
- `);n.Logger.error(`Solana transaction failed on-chain`,{signature:r,error:i,logs:t.meta.logMessages});let o=r?` (signature: ${r})`:``;throw Error(a?`Solana transaction failed on-chain${o}: ${i}\n${a}`:`Solana transaction failed on-chain${o}: ${i}`)}},h=async(e,n,r,i,o,s=!1)=>{if(r.some(e=>e.programId.equals(c.ComputeBudgetProgram.programId)))return r.map(e=>e.programId.equals(c.ComputeBudgetProgram.programId)&&e.data[0]===2?c.ComputeBudgetProgram.setComputeUnitLimit({units:t.MAX_COMPUTE_UNIT_LIMIT}):e);let l=r.filter(e=>!e.programId.equals(c.ComputeBudgetProgram.programId)),u=await f(e,n,l,i,s),d=c.ComputeBudgetProgram.setComputeUnitLimit({units:u}),m=await a.getSolanaPriorityFeeFromServer(p(l,n,[c.ComputeBudgetProgram.programId],i),o);return[d,...m>0?[c.ComputeBudgetProgram.setComputeUnitPrice({microLamports:m})]:[],...s?[c.ComputeBudgetProgram.requestHeapFrame({bytes:t.MAX_SOLANA_HEAP_FRAME_BYTES})]:[],...l]},g=async({connection:e,chainId:t,subAccount:n,payerPublicKey:a,instructions:o,lookupTableAccounts:l})=>{let u=r.AccountActions.getPrivateKeyFromSubAccount(t,n);if(!u)throw Error(`Private key is not available`);for(let t=0;t<10;t+=1){let n=t===9;try{let t=await h(e,a,o,l,n?i.SolanaPriorityFeeMode.HIGH:i.SolanaPriorityFeeMode.RECOMMENDED),{blockhash:s,lastValidBlockHeight:f}=await e.getLatestBlockhash(),p=new c.VersionedTransaction(new c.TransactionMessage({payerKey:a,recentBlockhash:s,instructions:t}).compileToV0Message(l)),g=await r.AccountActions.sendAndSignSolanaTransactionFromPrivateKey(e,u,p,!0);return await e.confirmTransaction({signature:g,blockhash:s,lastValidBlockHeight:f},`confirmed`),m(await d(e,g),g),g}catch(e){if(s.shouldRetryForSolanaError(e)&&!n)continue;throw e}}throw Error(`Failed to send proxy v0 transaction due to expired blockheight after all retries`)};exports.estimateComputeUnitLimit=f,exports.fetchSolanaTransaction=d,exports.getAccountsFromInstructions=p,exports.handleSolanaTransactionError=m,exports.sendProxyV0Transaction=g;
2
+ `);n.Logger.error(`Solana transaction failed on-chain`,{signature:r,error:i,logs:t.meta.logMessages});let o=r?` (signature: ${r})`:``;throw Error(a?`Solana transaction failed on-chain${o}: ${i}\n${a}`:`Solana transaction failed on-chain${o}: ${i}`)}},h=async(e,n,r,i,o,s=!1)=>{if(r.some(e=>e.programId.equals(c.ComputeBudgetProgram.programId)))return r.map(e=>e.programId.equals(c.ComputeBudgetProgram.programId)&&e.data[0]===2?c.ComputeBudgetProgram.setComputeUnitLimit({units:t.MAX_COMPUTE_UNIT_LIMIT}):e);let l=r.filter(e=>!e.programId.equals(c.ComputeBudgetProgram.programId)),u=await f(e,n,l,i,s),d=c.ComputeBudgetProgram.setComputeUnitLimit({units:u}),m=await a.getSolanaPriorityFeeFromServer(p(l,n,[c.ComputeBudgetProgram.programId],i),o);return[d,...m>0?[c.ComputeBudgetProgram.setComputeUnitPrice({microLamports:m})]:[],...s?[c.ComputeBudgetProgram.requestHeapFrame({bytes:t.MAX_SOLANA_HEAP_FRAME_BYTES})]:[],...l]},g=async(e,t,n,r)=>{for(let i=0;i<10;i+=1){let a=i===9;try{let{blockhash:i,lastValidBlockHeight:a}=await e.getLatestBlockhash(),o=new c.VersionedTransaction(new c.TransactionMessage({payerKey:n,recentBlockhash:i,instructions:r}).compileToV0Message()),s=await t.signTransaction(o),l=await e.sendTransaction(s);return await e.confirmTransaction({signature:l,blockhash:i,lastValidBlockHeight:a},`confirmed`),l}catch(e){if(s.shouldRetryForSolanaError(e)&&!a)continue;throw e}}return``},_=async({connection:e,chainId:t,subAccount:n,payerPublicKey:a,instructions:o,lookupTableAccounts:l})=>{let u=r.AccountActions.getPrivateKeyFromSubAccount(t,n);if(!u)throw Error(`Private key is not available`);for(let t=0;t<10;t+=1){let n=t===9;try{let t=await h(e,a,o,l,n?i.SolanaPriorityFeeMode.HIGH:i.SolanaPriorityFeeMode.RECOMMENDED),{blockhash:s,lastValidBlockHeight:f}=await e.getLatestBlockhash(),p=new c.VersionedTransaction(new c.TransactionMessage({payerKey:a,recentBlockhash:s,instructions:t}).compileToV0Message(l)),g=await r.AccountActions.sendAndSignSolanaTransactionFromPrivateKey(e,u,p,!0);return await e.confirmTransaction({signature:g,blockhash:s,lastValidBlockHeight:f},`confirmed`),m(await d(e,g),g),g}catch(e){if(s.shouldRetryForSolanaError(e)&&!n)continue;throw e}}throw Error(`Failed to send proxy v0 transaction due to expired blockheight after all retries`)};exports.estimateComputeUnitLimit=f,exports.fetchSolanaTransaction=d,exports.getAccountsFromInstructions=p,exports.handleSolanaTransactionError=m,exports.sendInstructions=g,exports.sendProxyV0Transaction=_;
@@ -5,6 +5,7 @@ export declare const estimateComputeUnitLimit: (connection: Connection, payerKey
5
5
  export declare const getAccountsFromInstructions: (instructions: TransactionInstruction[], payerKey?: PublicKey, additionalAccounts?: PublicKey[], lookupTableAccounts?: AddressLookupTableAccount[]) => PublicKey[];
6
6
  export declare const handleSolanaTransactionError: (transactionResponse: VersionedTransactionResponse | null, signature?: string) => void;
7
7
  export declare const sendV0Transaction: (connection: Connection, instructions: TransactionInstruction[], payer: Keypair, signers: Keypair[], lookupTableAccounts?: AddressLookupTableAccount[], requestHeapFrame?: boolean) => Promise<string>;
8
+ export declare const sendInstructions: (connection: Connection, wallet: any, publicKey: PublicKey, instructions: TransactionInstruction[]) => Promise<string>;
8
9
  export declare const sendSignedV0Transaction: (connection: Connection, transaction: VersionedTransaction) => Promise<string>;
9
10
  export declare const ensureAtaExists: (connection: Connection, payer: Keypair, mintPubkey: PublicKey | null, owner: PublicKey) => Promise<PublicKey | null>;
10
11
  type SendProxyV0TransactionParams = {
@@ -72,7 +72,27 @@ var h = 5e3, g = 6e4, _ = async (e, t, n = "confirmed") => await l(() => e.getTr
72
72
  ...s ? [d.requestHeapFrame({ bytes: r })] : [],
73
73
  ...l
74
74
  ];
75
- }, S = async ({ connection: e, chainId: t, subAccount: n, payerPublicKey: r, instructions: i, lookupTableAccounts: a }) => {
75
+ }, S = async (e, t, n, r) => {
76
+ for (let i = 0; i < 10; i += 1) {
77
+ let a = i === 9;
78
+ try {
79
+ let { blockhash: i, lastValidBlockHeight: a } = await e.getLatestBlockhash(), o = new m(new p({
80
+ payerKey: n,
81
+ recentBlockhash: i,
82
+ instructions: r
83
+ }).compileToV0Message()), s = await t.signTransaction(o), c = await e.sendTransaction(s);
84
+ return await e.confirmTransaction({
85
+ signature: c,
86
+ blockhash: i,
87
+ lastValidBlockHeight: a
88
+ }, "confirmed"), c;
89
+ } catch (e) {
90
+ if (u(e) && !a) continue;
91
+ throw e;
92
+ }
93
+ }
94
+ return "";
95
+ }, C = async ({ connection: e, chainId: t, subAccount: n, payerPublicKey: r, instructions: i, lookupTableAccounts: a }) => {
76
96
  let c = o.getPrivateKeyFromSubAccount(t, n);
77
97
  if (!c) throw Error("Private key is not available");
78
98
  for (let t = 0; t < 10; t += 1) {
@@ -96,4 +116,4 @@ var h = 5e3, g = 6e4, _ = async (e, t, n = "confirmed") => await l(() => e.getTr
96
116
  throw Error("Failed to send proxy v0 transaction due to expired blockheight after all retries");
97
117
  };
98
118
  //#endregion
99
- export { v as estimateComputeUnitLimit, _ as fetchSolanaTransaction, y as getAccountsFromInstructions, b as handleSolanaTransactionError, S as sendProxyV0Transaction };
119
+ export { v as estimateComputeUnitLimit, _ as fetchSolanaTransaction, y as getAccountsFromInstructions, b as handleSolanaTransactionError, S as sendInstructions, C as sendProxyV0Transaction };
@@ -1 +1 @@
1
- require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../utils/caseInsensitive.utils.cjs`),r=require(`../../error-handling/logger.cjs`),i=require(`../../types/ethereum-network.types.cjs`),a=require(`../utils/create-provider.cjs`),o=require(`../../data-structures/AccountActions/AccountActions.cjs`),s=require(`../web3/getContractMetadata.cjs`),c=require(`../utils/getContractAddress.cjs`);let l=require(`ethers`);var u=e=>{if(typeof e.target==`string`)return e.target;if(e.address)return e.address;throw Error(`Contract address not found`)},d=`tuple(address endpoint, bool invokeWallet, uint128 value, bytes callData)`,f=`tuple(uint8 v, bytes32 r, bytes32 s, address signerAddress, ${d}[] ops, uint256 maxFee, uint256 deadline)`,p=1200,m=e=>{let[t]=l.ethers.AbiCoder.defaultAbiCoder().decode([d],e);return{endpoint:t.endpoint,invokeWallet:t.invokeWallet,value:BigInt(t.value),callData:t.callData}},h=({contract:e,func:t,args:n,callDataString:r,invokeWallet:i,value:a})=>{let o,s=r??`0x`;if(typeof e==`object`){if(o=u(e),r?.length&&r?.length>0)throw Error(`If function and args are providedm no calldata is needed`);t&&n&&!r&&(s=e.interface.encodeFunctionData(t,n))}else o=e;return l.ethers.AbiCoder.defaultAbiCoder().encode([d],[{endpoint:o,invokeWallet:!!i,value:a??0n,callData:s}])},g=async(n,r,i,a,s,c,u)=>{let d=e.getOnchainChainId(n),h=a.map(m),g=0n,_=i&&c?await(async()=>{if(u===void 0)throw Error(`maxFee required if making tx from emporium`);return g=BigInt(Math.floor(Date.now()/1e3)+p),o.AccountActions.signTypedDataFromPrivateKey(d,i,{name:`Emporium`,version:`1.0.0`,chainId:d,verifyingContract:r},{EmporiumSignature:[{name:`message`,type:`uint256`},{name:`ops`,type:`EmporiumOperation[]`},{name:`maxFee`,type:`uint256`},{name:`deadline`,type:`uint256`}],EmporiumOperation:[{name:`endpoint`,type:`address`},{name:`invokeWallet`,type:`bool`},{name:`value`,type:`uint128`},{name:`callData`,type:`bytes`}]},{message:s,ops:h,maxFee:u,deadline:g})})():void 0,{v,r:y,s:b}=_?l.ethers.Signature.from(_):{v:0,r:l.ethers.ZeroHash,s:l.ethers.ZeroHash};return l.ethers.AbiCoder.defaultAbiCoder().encode([f],[{v,r:y,s:b,signerAddress:c??t.zeroAddress,ops:h,maxFee:u??0n,deadline:g}])},_=(e,t,n,r)=>h(e?{contract:e,func:`transfer`,args:[t,n],invokeWallet:r}:{contract:t,value:n,invokeWallet:r}),v=(e,r,a,o,s)=>{let l=e.getContractWithFetcherByChainId(r,i.ContractType.HinkalContract);return a.map((a,u)=>_(n.caseInsensitiveEqual(a,t.zeroAddress)?void 0:e.getContractWithFetcherByChainId(r,i.ContractType.ERC20Contract,a),s??c.getContractAddress(l),o[u],!0))},y=(e,t,n,r)=>h({contract:e,func:`approve`,args:[t,n],invokeWallet:r}),b=(e,r,a,o,c,l,u)=>{let d=[];for(let o=0;o<r.length;o+=1){let c=r[o],u=n.caseInsensitiveEqual(c,t.zeroAddress)?void 0:s.getContractWithFetcherByChainId(e,i.ContractType.ERC20Contract,c);d.push(_(u,l,a[o],!1))}if(u)for(let r=0;r<o.length;r+=1){let a=o[r];if(!n.caseInsensitiveEqual(a,t.zeroAddress)){let t=s.getContractWithFetcherByChainId(e,i.ContractType.ERC20Contract,a);d.push(y(t,u,c[r],!0))}}return d},x=(e,r,i,a,o,s,c,l)=>{let u=[],d=[o],f=[s];l.nativeFee>0n&&!n.caseInsensitiveEqual(o,t.zeroAddress)&&(d.push(t.zeroAddress),f.push(l.nativeFee));let p=b(r,d,f,[o],[c],i,a);u.push(...p);let m=l.nativeFee;return n.caseInsensitiveEqual(o,t.zeroAddress)&&(m+=c),u.push(h({contract:a,callDataString:l.calldata,value:m>0n?m:void 0,invokeWallet:!0})),u},S=`0xef0100`,C=async(e,t)=>{try{let n=a.createJsonRpcProvider(e),r=await n.getCode(t);if(r===`0x`||!r)return{delegated:!1,implementation:void 0,nonce:void 0};if(r.toLowerCase().startsWith(S)&&r.length===48){let e=`0x${r.slice(8)}`,i=await n.getTransactionCount(t);return{delegated:!0,implementation:l.ethers.getAddress(e),nonce:i}}else throw Error(`checkEOAWithDelegation: It is a contract`)}catch(e){throw r.Logger.error(`checkEOAWithDelegation error`,{error:e}),e}},w=r=>{let{hinkalWalletAddress:i}=e.networkRegistry[r].contractData;if(!i||n.caseInsensitiveEqual(i,t.zeroAddress))throw Error(`Hinkal Wallet Address is not set`);return i},T=async(t,r)=>{if(t===e.chainIds.localhost||!r)return;let i=e.getOnchainChainId(t),{delegated:a,implementation:s}=await C(t,o.AccountActions.getSignerAddressFromPrivateKey(t,r)),c=w(t);if(!a||!n.caseInsensitiveEqual(s,c)){let e=await o.AccountActions.authorizeDelegation(i,r,c);return{v:e.signature.v.toString(),r:e.signature.r,s:e.signature.s,nonce:e.nonce.toString(),address:c,chainId:String(i)}}};exports.checkEOAWithDelegation=C,exports.createApproveEmporiumOp=y,exports.createLifiBridgeOps=x,exports.createTransaferEmporiumOpsBatch=v,exports.createTransferToEmporiumOp=_,exports.emporiumOp=h,exports.encodeEmporiumMetadata=g,exports.generateFundAndApproveOps=b,exports.getAuthorizationDataIfNeeded=T;
1
+ require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../utils/caseInsensitive.utils.cjs`),r=require(`../../error-handling/logger.cjs`),i=require(`../../types/ethereum-network.types.cjs`),a=require(`../utils/create-provider.cjs`),o=require(`../web3/getContractMetadata.cjs`),s=require(`../../data-structures/AccountActions/AccountActions.cjs`),c=require(`../utils/getContractAddress.cjs`);let l=require(`ethers`);var u=e=>{if(typeof e.target==`string`)return e.target;if(e.address)return e.address;throw Error(`Contract address not found`)},d=`tuple(address endpoint, bool invokeWallet, uint128 value, bytes callData)`,f=`tuple(uint8 v, bytes32 r, bytes32 s, address signerAddress, ${d}[] ops, uint256 maxFee, uint256 deadline)`,p=1200,m=e=>{let[t]=l.ethers.AbiCoder.defaultAbiCoder().decode([d],e);return{endpoint:t.endpoint,invokeWallet:t.invokeWallet,value:BigInt(t.value),callData:t.callData}},h=({contract:e,func:t,args:n,callDataString:r,invokeWallet:i,value:a})=>{let o,s=r??`0x`;if(typeof e==`object`){if(o=u(e),r?.length&&r?.length>0)throw Error(`If function and args are providedm no calldata is needed`);t&&n&&!r&&(s=e.interface.encodeFunctionData(t,n))}else o=e;return l.ethers.AbiCoder.defaultAbiCoder().encode([d],[{endpoint:o,invokeWallet:!!i,value:a??0n,callData:s}])},g=async(n,r,i,a,o,c,u)=>{let d=e.getOnchainChainId(n),h=a.map(m),g=0n,_=i&&c?await(async()=>{if(u===void 0)throw Error(`maxFee required if making tx from emporium`);return g=BigInt(Math.floor(Date.now()/1e3)+p),s.AccountActions.signTypedDataFromPrivateKey(d,i,{name:`Emporium`,version:`1.0.0`,chainId:d,verifyingContract:r},{EmporiumSignature:[{name:`message`,type:`uint256`},{name:`ops`,type:`EmporiumOperation[]`},{name:`maxFee`,type:`uint256`},{name:`deadline`,type:`uint256`}],EmporiumOperation:[{name:`endpoint`,type:`address`},{name:`invokeWallet`,type:`bool`},{name:`value`,type:`uint128`},{name:`callData`,type:`bytes`}]},{message:o,ops:h,maxFee:u,deadline:g})})():void 0,{v,r:y,s:b}=_?l.ethers.Signature.from(_):{v:0,r:l.ethers.ZeroHash,s:l.ethers.ZeroHash};return l.ethers.AbiCoder.defaultAbiCoder().encode([f],[{v,r:y,s:b,signerAddress:c??t.zeroAddress,ops:h,maxFee:u??0n,deadline:g}])},_=(e,t,n,r)=>h(e?{contract:e,func:`transfer`,args:[t,n],invokeWallet:r}:{contract:t,value:n,invokeWallet:r}),v=(e,r,a,o,s)=>{let l=e.getContractWithFetcherByChainId(r,i.ContractType.HinkalContract);return a.map((a,u)=>_(n.caseInsensitiveEqual(a,t.zeroAddress)?void 0:e.getContractWithFetcherByChainId(r,i.ContractType.ERC20Contract,a),s??c.getContractAddress(l),o[u],!0))},y=(e,t,n,r)=>h({contract:e,func:`approve`,args:[t,n],invokeWallet:r}),b=(e,r,a,s,c,l,u)=>{let d=[];for(let s=0;s<r.length;s+=1){let c=r[s],u=n.caseInsensitiveEqual(c,t.zeroAddress)?void 0:o.getContractWithFetcherByChainId(e,i.ContractType.ERC20Contract,c);d.push(_(u,l,a[s],!1))}if(u)for(let r=0;r<s.length;r+=1){let a=s[r];if(!n.caseInsensitiveEqual(a,t.zeroAddress)){let t=o.getContractWithFetcherByChainId(e,i.ContractType.ERC20Contract,a);d.push(y(t,u,c[r],!0))}}return d},x=(e,r,i,a,o,s,c,l)=>{let u=[],d=[o],f=[s];l.nativeFee>0n&&!n.caseInsensitiveEqual(o,t.zeroAddress)&&(d.push(t.zeroAddress),f.push(l.nativeFee));let p=b(r,d,f,[o],[c],i,a);u.push(...p);let m=l.nativeFee;return n.caseInsensitiveEqual(o,t.zeroAddress)&&(m+=c),u.push(h({contract:a,callDataString:l.calldata,value:m>0n?m:void 0,invokeWallet:!0})),u},S=`0xef0100`,C=async(e,t)=>{try{let n=a.createJsonRpcProvider(e),r=await n.getCode(t);if(r===`0x`||!r)return{delegated:!1,implementation:void 0,nonce:void 0};if(r.toLowerCase().startsWith(S)&&r.length===48){let e=`0x${r.slice(8)}`,i=await n.getTransactionCount(t);return{delegated:!0,implementation:l.ethers.getAddress(e),nonce:i}}else throw Error(`checkEOAWithDelegation: It is a contract`)}catch(e){throw r.Logger.error(`checkEOAWithDelegation error`,{error:e}),e}},w=r=>{let{hinkalWalletAddress:i}=e.networkRegistry[r].contractData;if(!i||n.caseInsensitiveEqual(i,t.zeroAddress))throw Error(`Hinkal Wallet Address is not set`);return i},T=async(t,r)=>{if(t===e.chainIds.localhost||!r)return;let i=e.getOnchainChainId(t),{delegated:a,implementation:o}=await C(t,s.AccountActions.getSignerAddressFromPrivateKey(t,r)),c=w(t);if(!a||!n.caseInsensitiveEqual(o,c)){let e=await s.AccountActions.authorizeDelegation(i,r,c);return{v:e.signature.v.toString(),r:e.signature.r,s:e.signature.s,nonce:e.nonce.toString(),address:c,chainId:String(i)}}};exports.checkEOAWithDelegation=C,exports.createApproveEmporiumOp=y,exports.createLifiBridgeOps=x,exports.createTransaferEmporiumOpsBatch=v,exports.createTransferToEmporiumOp=_,exports.emporiumOp=h,exports.encodeEmporiumMetadata=g,exports.generateFundAndApproveOps=b,exports.getAuthorizationDataIfNeeded=T;
@@ -4,8 +4,8 @@ import { caseInsensitiveEqual as i } from "../utils/caseInsensitive.utils.mjs";
4
4
  import { Logger as a } from "../../error-handling/logger.mjs";
5
5
  import { ContractType as o } from "../../types/ethereum-network.types.mjs";
6
6
  import { createJsonRpcProvider as s } from "../utils/create-provider.mjs";
7
- import { AccountActions as c } from "../../data-structures/AccountActions/AccountActions.mjs";
8
- import { getContractWithFetcherByChainId as l } from "../web3/getContractMetadata.mjs";
7
+ import { getContractWithFetcherByChainId as c } from "../web3/getContractMetadata.mjs";
8
+ import { AccountActions as l } from "../../data-structures/AccountActions/AccountActions.mjs";
9
9
  import { getContractAddress as u } from "../utils/getContractAddress.mjs";
10
10
  import { ethers as d } from "ethers";
11
11
  //#region libs/shared/common/src/functions/private-wallet/emporium.helpers.ts
@@ -33,10 +33,10 @@ var f = (e) => {
33
33
  value: a ?? 0n,
34
34
  callData: s
35
35
  }]);
36
- }, v = async (e, n, i, a, o, s, l) => {
36
+ }, v = async (e, n, i, a, o, s, c) => {
37
37
  let u = t(e), f = a.map(g), p = 0n, _ = i && s ? await (async () => {
38
- if (l === void 0) throw Error("maxFee required if making tx from emporium");
39
- return p = BigInt(Math.floor(Date.now() / 1e3) + h), c.signTypedDataFromPrivateKey(u, i, {
38
+ if (c === void 0) throw Error("maxFee required if making tx from emporium");
39
+ return p = BigInt(Math.floor(Date.now() / 1e3) + h), l.signTypedDataFromPrivateKey(u, i, {
40
40
  name: "Emporium",
41
41
  version: "1.0.0",
42
42
  chainId: u,
@@ -81,7 +81,7 @@ var f = (e) => {
81
81
  }, {
82
82
  message: o,
83
83
  ops: f,
84
- maxFee: l,
84
+ maxFee: c,
85
85
  deadline: p
86
86
  });
87
87
  })() : void 0, { v, r: y, s: b } = _ ? d.Signature.from(_) : {
@@ -95,7 +95,7 @@ var f = (e) => {
95
95
  s: b,
96
96
  signerAddress: s ?? r,
97
97
  ops: f,
98
- maxFee: l ?? 0n,
98
+ maxFee: c ?? 0n,
99
99
  deadline: p
100
100
  }]);
101
101
  }, y = (e, t, n, r) => _(e ? {
@@ -115,16 +115,16 @@ var f = (e) => {
115
115
  func: "approve",
116
116
  args: [t, n],
117
117
  invokeWallet: r
118
- }), S = (e, t, n, a, s, c, u) => {
118
+ }), S = (e, t, n, a, s, l, u) => {
119
119
  let d = [];
120
120
  for (let a = 0; a < t.length; a += 1) {
121
- let s = t[a], u = i(s, r) ? void 0 : l(e, o.ERC20Contract, s);
122
- d.push(y(u, c, n[a], !1));
121
+ let s = t[a], u = i(s, r) ? void 0 : c(e, o.ERC20Contract, s);
122
+ d.push(y(u, l, n[a], !1));
123
123
  }
124
124
  if (u) for (let t = 0; t < a.length; t += 1) {
125
125
  let n = a[t];
126
126
  if (!i(n, r)) {
127
- let r = l(e, o.ERC20Contract, n);
127
+ let r = c(e, o.ERC20Contract, n);
128
128
  d.push(x(r, u, s[t], !0));
129
129
  }
130
130
  }
@@ -166,15 +166,15 @@ var f = (e) => {
166
166
  return t;
167
167
  }, D = async (n, r) => {
168
168
  if (n === e.localhost || !r) return;
169
- let a = t(n), { delegated: o, implementation: s } = await T(n, c.getSignerAddressFromPrivateKey(n, r)), l = E(n);
170
- if (!o || !i(s, l)) {
171
- let e = await c.authorizeDelegation(a, r, l);
169
+ let a = t(n), { delegated: o, implementation: s } = await T(n, l.getSignerAddressFromPrivateKey(n, r)), c = E(n);
170
+ if (!o || !i(s, c)) {
171
+ let e = await l.authorizeDelegation(a, r, c);
172
172
  return {
173
173
  v: e.signature.v.toString(),
174
174
  r: e.signature.r,
175
175
  s: e.signature.s,
176
176
  nonce: e.nonce.toString(),
177
- address: l,
177
+ address: c,
178
178
  chainId: String(a)
179
179
  };
180
180
  }
@@ -1 +1 @@
1
- require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../types/ethereum-network.types.cjs`),n=require(`../pre-transaction/solana.cjs`),r=require(`../utils/create-provider.cjs`),i=require(`../web3/getContractMetadata.cjs`),a=require(`../utils/solana-program.utils.cjs`),o=require(`../web3/fetchSolanaMerkleTreeRootHash.cjs`);let s=require(`@solana/web3.js`);var c=async e=>{let n=i.getContractWithFetcherByChainId(e,t.ContractType.HinkalContract);return{hinkalRootHash:await n.getRootHash(),hinkalRootHashIndex:BigInt(await n.m_index())-1n}},l=async t=>{let{contractData:i,rpcUrl:c}=e.networkRegistry[t],{hinkalIdl:l,hinkalAddress:u,originalDeployer:d}=i;if(!l||!u||!d)throw Error(`Missing Solana configuration for chain ${t}`);return{hinkalRootHash:await o.fetchSolanaMerkleTreeRootHash(a.createReadOnlySolanaProgram(r.createCustomSolanaConnection(c),l),n.getMerkleAccountPublicKey(new s.PublicKey(u),new s.PublicKey(d))),hinkalRootHashIndex:0n}},u=async t=>e.isSolanaLike(t)?l(t):c(t);exports.fetchOnChainRootHashes=u;
1
+ require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../types/ethereum-network.types.cjs`),n=require(`../utils/create-provider.cjs`),r=require(`../web3/getContractMetadata.cjs`),i=require(`../pre-transaction/solana.cjs`),a=require(`../utils/solana-program.utils.cjs`),o=require(`../web3/fetchSolanaMerkleTreeRootHash.cjs`);let s=require(`@solana/web3.js`);var c=async e=>{let n=r.getContractWithFetcherByChainId(e,t.ContractType.HinkalContract);return{hinkalRootHash:await n.getRootHash(),hinkalRootHashIndex:BigInt(await n.m_index())-1n}},l=async t=>{let{contractData:r,rpcUrl:c}=e.networkRegistry[t],{hinkalIdl:l,hinkalAddress:u,originalDeployer:d}=r;if(!l||!u||!d)throw Error(`Missing Solana configuration for chain ${t}`);return{hinkalRootHash:await o.fetchSolanaMerkleTreeRootHash(a.createReadOnlySolanaProgram(n.createCustomSolanaConnection(c),l),i.getMerkleAccountPublicKey(new s.PublicKey(u),new s.PublicKey(d))),hinkalRootHashIndex:0n}},u=async t=>e.isSolanaLike(t)?l(t):c(t);exports.fetchOnChainRootHashes=u;
@@ -1,23 +1,23 @@
1
1
  import { isSolanaLike as e, networkRegistry as t } from "../../constants/chains.constants.mjs";
2
2
  import { ContractType as n } from "../../types/ethereum-network.types.mjs";
3
- import { getMerkleAccountPublicKey as r } from "../pre-transaction/solana.mjs";
4
- import { createCustomSolanaConnection as i } from "../utils/create-provider.mjs";
5
- import { getContractWithFetcherByChainId as a } from "../web3/getContractMetadata.mjs";
3
+ import { createCustomSolanaConnection as r } from "../utils/create-provider.mjs";
4
+ import { getContractWithFetcherByChainId as i } from "../web3/getContractMetadata.mjs";
5
+ import { getMerkleAccountPublicKey as a } from "../pre-transaction/solana.mjs";
6
6
  import { createReadOnlySolanaProgram as o } from "../utils/solana-program.utils.mjs";
7
7
  import { fetchSolanaMerkleTreeRootHash as s } from "../web3/fetchSolanaMerkleTreeRootHash.mjs";
8
8
  import { PublicKey as c } from "@solana/web3.js";
9
9
  //#region libs/shared/common/src/functions/snarkjs/fetchOnChainRootHashes.ts
10
10
  var l = async (e) => {
11
- let t = a(e, n.HinkalContract);
11
+ let t = i(e, n.HinkalContract);
12
12
  return {
13
13
  hinkalRootHash: await t.getRootHash(),
14
14
  hinkalRootHashIndex: BigInt(await t.m_index()) - 1n
15
15
  };
16
16
  }, u = async (e) => {
17
- let { contractData: n, rpcUrl: a } = t[e], { hinkalIdl: l, hinkalAddress: u, originalDeployer: d } = n;
17
+ let { contractData: n, rpcUrl: i } = t[e], { hinkalIdl: l, hinkalAddress: u, originalDeployer: d } = n;
18
18
  if (!l || !u || !d) throw Error(`Missing Solana configuration for chain ${e}`);
19
19
  return {
20
- hinkalRootHash: await s(o(i(a), l), r(new c(u), new c(d))),
20
+ hinkalRootHash: await s(o(r(i), l), a(new c(u), new c(d))),
21
21
  hinkalRootHashIndex: 0n
22
22
  };
23
23
  }, d = async (t) => e(t) ? u(t) : l(t);
@@ -1 +1 @@
1
- require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`./caseInsensitive.utils.cjs`),r=require(`./tron.utils.cjs`);let i=require(`ethers`),a=require(`@solana/web3.js`);require(`tronweb`);var o=[`http://`,`https://`,`/payment/`,`.app/`,`.com/`,`.netlify.`],s=e=>{if(o.some(t=>e.includes(t)))return!1;let[t,n,r,i,a,s]=e.split(`,`),c=!t||!s||!n||!r||!i||!a,l=t?.substring(0,2)!==`0x`||s?.substring(0,2)!==`0x`,u=s?.length!==66||t?.length>66||t?.length<64,d=e?.includes(`"`);return!(c||l||u||d)},c=e=>{let[t,n,r,i,a]=e.split(`,`);return{H0x:BigInt(n),H0y:BigInt(r),H1x:BigInt(i),H1y:BigInt(a),stealthAddress:BigInt(t)}},l=e=>{let[,,,,,t]=e.split(`,`);if(!t)throw Error(`recipientInfo is missing an encryption key`);return t},u=e=>i.ethers.keccak256(i.ethers.toUtf8Bytes(e.toLowerCase())),d=(t,n)=>u(e.isSolanaLike(t)?n:r.addressToHexFormat(n)),f=e=>i.ethers.keccak256(i.ethers.toUtf8Bytes(e)),p=e=>{try{return new a.PublicKey(e).toBase58()===e}catch{return!1}},m=(r,i)=>(r=r.trim(),r?i===void 0?n.caseInsensitiveEqual(r,t.zeroAddress)||n.caseInsensitiveEqual(r,`11111111111111111111111111111111`):e.isSolanaLike(i)?n.caseInsensitiveEqual(r,t.solanaNativeAddress):n.caseInsensitiveEqual(r,t.zeroAddress):!1);exports.constructStealthAddressStructure=c,exports.getEncryptionKeyFromRecipientInfo=l,exports.hashEthereumAddress=u,exports.hashOwnerAddressForChain=d,exports.hashString=f,exports.isNativePlaceholderAddress=m,exports.isValidPrivateAddress=s,exports.isValidSolanaPublicKey=p;
1
+ require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`./caseInsensitive.utils.cjs`),r=require(`./tron.utils.cjs`);let i=require(`ethers`),a=require(`@solana/web3.js`);require(`tronweb`);var o=[`http://`,`https://`,`/payment/`,`.app/`,`.com/`,`.netlify.`],s=e=>{if(o.some(t=>e.includes(t)))return!1;let[t,n,r,i,a,s]=e.split(`,`),c=!t||!s||!n||!r||!i||!a,l=t?.substring(0,2)!==`0x`||s?.substring(0,2)!==`0x`,u=s?.length!==66||t?.length>66||t?.length<64,d=e?.includes(`"`);return!(c||l||u||d)},c=e=>{let[t,n,r,i,a]=e.split(`,`);return{H0x:BigInt(n),H0y:BigInt(r),H1x:BigInt(i),H1y:BigInt(a),stealthAddress:BigInt(t)}},l=e=>{let[,,,,,t]=e.split(`,`);if(!t)throw Error(`recipientInfo is missing an encryption key`);return t},u=e=>i.ethers.keccak256(i.ethers.toUtf8Bytes(e.toLowerCase())),d=(t,n)=>u(e.isSolanaLike(t)?n:r.addressToHexFormat(n)),f=e=>i.ethers.keccak256(i.ethers.toUtf8Bytes(e)),p=e=>{try{return new a.PublicKey(e).toBase58()===e}catch{return!1}},m=(r,i)=>(r=r.trim(),r?i===void 0?n.caseInsensitiveEqual(r,t.zeroAddress)||n.caseInsensitiveEqual(r,`11111111111111111111111111111111`):e.isSolanaLike(i)?n.caseInsensitiveEqual(r,t.solanaNativeAddress):n.caseInsensitiveEqual(r,t.zeroAddress):!1),h=(t,n)=>e.isSolanaLike(t)?n:(e.isTronLike(t)?r.addressToHexFormat(n):n).toLowerCase(),g=(e,t,n)=>!!t&&!!n&&h(e,t)===h(e,n);exports.addressEqual=g,exports.constructStealthAddressStructure=c,exports.getEncryptionKeyFromRecipientInfo=l,exports.hashEthereumAddress=u,exports.hashOwnerAddressForChain=d,exports.hashString=f,exports.isNativePlaceholderAddress=m,exports.isValidPrivateAddress=s,exports.isValidSolanaPublicKey=p,exports.normalizeAddress=h;
@@ -10,3 +10,7 @@ export declare const isNativePlaceholderAddress: (address: string, chainId?: num
10
10
  export declare const formatAddress: (address?: string) => string;
11
11
  export declare const isValidTronAddress: (address: string) => boolean;
12
12
  export declare const isRecipientAddressInvalid: (address: string, isSolana: boolean, isTron: boolean) => boolean;
13
+ /** Solana addresses are base58, where case carries meaning; hex chains compare case-insensitively,
14
+ * and Tron addresses reach us in both base58 and hex form, so they normalize to hex first. */
15
+ export declare const normalizeAddress: (chainId: number, address: string) => string;
16
+ export declare const addressEqual: (chainId: number, a?: string | null, b?: string | null) => boolean;
@@ -1,23 +1,23 @@
1
- import { isSolanaLike as e } from "../../constants/chains.constants.mjs";
2
- import { solanaNativeAddress as t, zeroAddress as n } from "../../constants/protocol.constants.mjs";
3
- import { caseInsensitiveEqual as r } from "./caseInsensitive.utils.mjs";
4
- import { addressToHexFormat as i } from "./tron.utils.mjs";
5
- import { ethers as a } from "ethers";
6
- import { PublicKey as o } from "@solana/web3.js";
1
+ import { isSolanaLike as e, isTronLike as t } from "../../constants/chains.constants.mjs";
2
+ import { solanaNativeAddress as n, zeroAddress as r } from "../../constants/protocol.constants.mjs";
3
+ import { caseInsensitiveEqual as i } from "./caseInsensitive.utils.mjs";
4
+ import { addressToHexFormat as a } from "./tron.utils.mjs";
5
+ import { ethers as o } from "ethers";
6
+ import { PublicKey as s } from "@solana/web3.js";
7
7
  import "tronweb";
8
8
  //#region libs/shared/common/src/functions/utils/addresses.ts
9
- var s = [
9
+ var c = [
10
10
  "http://",
11
11
  "https://",
12
12
  "/payment/",
13
13
  ".app/",
14
14
  ".com/",
15
15
  ".netlify."
16
- ], c = (e) => {
17
- if (s.some((t) => e.includes(t))) return !1;
18
- let [t, n, r, i, a, o] = e.split(","), c = !t || !o || !n || !r || !i || !a, l = t?.substring(0, 2) !== "0x" || o?.substring(0, 2) !== "0x", u = o?.length !== 66 || t?.length > 66 || t?.length < 64, d = e?.includes("\"");
19
- return !(c || l || u || d);
20
- }, l = (e) => {
16
+ ], l = (e) => {
17
+ if (c.some((t) => e.includes(t))) return !1;
18
+ let [t, n, r, i, a, o] = e.split(","), s = !t || !o || !n || !r || !i || !a, l = t?.substring(0, 2) !== "0x" || o?.substring(0, 2) !== "0x", u = o?.length !== 66 || t?.length > 66 || t?.length < 64, d = e?.includes("\"");
19
+ return !(s || l || u || d);
20
+ }, u = (e) => {
21
21
  let [t, n, r, i, a] = e.split(",");
22
22
  return {
23
23
  H0x: BigInt(n),
@@ -26,16 +26,16 @@ var s = [
26
26
  H1y: BigInt(a),
27
27
  stealthAddress: BigInt(t)
28
28
  };
29
- }, u = (e) => {
29
+ }, d = (e) => {
30
30
  let [, , , , , t] = e.split(",");
31
31
  if (!t) throw Error("recipientInfo is missing an encryption key");
32
32
  return t;
33
- }, d = (e) => a.keccak256(a.toUtf8Bytes(e.toLowerCase())), f = (t, n) => d(e(t) ? n : i(n)), p = (e) => a.keccak256(a.toUtf8Bytes(e)), m = (e) => {
33
+ }, f = (e) => o.keccak256(o.toUtf8Bytes(e.toLowerCase())), p = (t, n) => f(e(t) ? n : a(n)), m = (e) => o.keccak256(o.toUtf8Bytes(e)), h = (e) => {
34
34
  try {
35
- return new o(e).toBase58() === e;
35
+ return new s(e).toBase58() === e;
36
36
  } catch {
37
37
  return !1;
38
38
  }
39
- }, h = (i, a) => (i = i.trim(), i ? a === void 0 ? r(i, n) || r(i, "11111111111111111111111111111111") : e(a) ? r(i, t) : r(i, n) : !1);
39
+ }, g = (t, a) => (t = t.trim(), t ? a === void 0 ? i(t, r) || i(t, "11111111111111111111111111111111") : e(a) ? i(t, n) : i(t, r) : !1), _ = (n, r) => e(n) ? r : (t(n) ? a(r) : r).toLowerCase(), v = (e, t, n) => !!t && !!n && _(e, t) === _(e, n);
40
40
  //#endregion
41
- export { l as constructStealthAddressStructure, u as getEncryptionKeyFromRecipientInfo, d as hashEthereumAddress, f as hashOwnerAddressForChain, p as hashString, h as isNativePlaceholderAddress, c as isValidPrivateAddress, m as isValidSolanaPublicKey };
41
+ export { v as addressEqual, u as constructStealthAddressStructure, d as getEncryptionKeyFromRecipientInfo, f as hashEthereumAddress, p as hashOwnerAddressForChain, m as hashString, g as isNativePlaceholderAddress, l as isValidPrivateAddress, h as isValidSolanaPublicKey, _ as normalizeAddress };
@@ -0,0 +1 @@
1
+ const e=require(`../../types/admin.types.cjs`);var{Transfer:t,Swap:n,Other:r}=e.AdminActivity,{PublicToPublic:i,PublicToPrivate:a,PrivateToPrivate:o,PrivateToPublic:s}=e.AdminPrivacyFlow,{SameChain:c,CrossChain:l}=e.AdminRoute,{Wallet:u,Pay:d,Prime:f}=e.AdminProduct,p={[e.AdminTransactionType.Shield]:{product:u,activity:t,privacyFlow:a,route:c},[e.AdminTransactionType.PublicToPublicSend]:{product:u,activity:t,privacyFlow:i,route:c},[e.AdminTransactionType.PublicToPrivateSend]:{product:u,activity:t,privacyFlow:a,route:c},[e.AdminTransactionType.PublicToPublicBridgeSend]:{product:u,activity:t,privacyFlow:i,route:l},[e.AdminTransactionType.PublicSwap]:{product:u,activity:n,privacyFlow:i,route:c},[e.AdminTransactionType.PublicBridgeSwap]:{product:u,activity:n,privacyFlow:i,route:l},[e.AdminTransactionType.Unshield]:{product:u,activity:t,privacyFlow:s,route:c},[e.AdminTransactionType.PrivateSwap]:{product:u,activity:n,privacyFlow:o,route:c},[e.AdminTransactionType.PrivateToPrivateSend]:{product:u,activity:t,privacyFlow:o,route:c},[e.AdminTransactionType.PrivateToPublicSend]:{product:u,activity:t,privacyFlow:s,route:c},[e.AdminTransactionType.AutoShield]:{product:u,activity:t,privacyFlow:a,route:c},[e.AdminTransactionType.PaymentLink]:{product:d,activity:t,privacyFlow:a,route:c},[e.AdminTransactionType.PublicDappTransaction]:{product:u,activity:r,privacyFlow:i,route:c},[e.AdminTransactionType.PayShield]:{product:d,activity:t,privacyFlow:a,route:c},[e.AdminTransactionType.PayPublicToPublicSend]:{product:d,activity:t,privacyFlow:i,route:c},[e.AdminTransactionType.PayPublicToPrivateSend]:{product:d,activity:t,privacyFlow:a,route:c},[e.AdminTransactionType.PayPublicToPublicBridgeSend]:{product:d,activity:t,privacyFlow:i,route:l},[e.AdminTransactionType.PayPublicSwap]:{product:d,activity:n,privacyFlow:i,route:c},[e.AdminTransactionType.PayPublicBridgeSwap]:{product:d,activity:n,privacyFlow:i,route:l},[e.AdminTransactionType.PayUnshield]:{product:d,activity:t,privacyFlow:s,route:c},[e.AdminTransactionType.PayPrivateToPrivateSend]:{product:d,activity:t,privacyFlow:o,route:c},[e.AdminTransactionType.PayPrivateToPublicSend]:{product:d,activity:t,privacyFlow:s,route:c},[e.AdminTransactionType.PayPrivateToPrivateBridgeSend]:{product:d,activity:t,privacyFlow:o,route:l},[e.AdminTransactionType.PayPrivateSwap]:{product:d,activity:n,privacyFlow:o,route:c},[e.AdminTransactionType.PayPrivateBridgeSwap]:{product:d,activity:n,privacyFlow:o,route:l},[e.AdminTransactionType.PrimeShield]:{product:f,activity:t,privacyFlow:a,route:c},[e.AdminTransactionType.PrimePublicToPrivateSend]:{product:f,activity:t,privacyFlow:a,route:c},[e.AdminTransactionType.PrimePublicToPublicSend]:{product:f,activity:t,privacyFlow:i,route:c},[e.AdminTransactionType.PrimePublicToPublicBridgeSend]:{product:f,activity:t,privacyFlow:i,route:l},[e.AdminTransactionType.PrimeUnshield]:{product:f,activity:t,privacyFlow:s,route:c},[e.AdminTransactionType.PrimePrivateToPrivateSend]:{product:f,activity:t,privacyFlow:o,route:c},[e.AdminTransactionType.PrimePrivateToPublicSend]:{product:f,activity:t,privacyFlow:s,route:c},[e.AdminTransactionType.PrimePrivateToPrivateBridgeSend]:{product:f,activity:t,privacyFlow:o,route:l}},m=e=>p[e],h=(e,t,r)=>{if(!(!e||m(e)?.activity!==n))return r?[t[0],r]:t};exports.resolveAdminDimensions=m,exports.resolveSwapPairTokens=h;