@hinkal/common 0.2.17 → 0.2.19

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 (474) hide show
  1. package/API/API.cjs +1 -1
  2. package/API/API.d.ts +8 -13
  3. package/API/API.mjs +86 -94
  4. package/API/admin-calls.cjs +1 -1
  5. package/API/admin-calls.d.ts +1 -1
  6. package/API/admin-calls.mjs +4 -4
  7. package/API/callLifiAPI.cjs +1 -1
  8. package/API/callLifiAPI.d.ts +1 -1
  9. package/API/callLifiAPI.mjs +5 -5
  10. package/API/callMonitor.cjs +1 -1
  11. package/API/callMonitor.d.ts +1 -1
  12. package/API/callMonitor.mjs +7 -7
  13. package/API/callOdosAPI.cjs +1 -1
  14. package/API/callOdosAPI.mjs +11 -11
  15. package/API/callOkxAPI.cjs +1 -1
  16. package/API/callOkxAPI.d.ts +1 -1
  17. package/API/callOkxAPI.mjs +5 -5
  18. package/API/callOneInchAPI.cjs +1 -1
  19. package/API/callOneInchAPI.mjs +10 -11
  20. package/API/callRelayer.cjs +1 -1
  21. package/API/callRelayer.d.ts +6 -3
  22. package/API/callRelayer.mjs +11 -11
  23. package/API/checkRisk.cjs +1 -1
  24. package/API/checkRisk.d.ts +1 -1
  25. package/API/checkRisk.mjs +4 -4
  26. package/API/fetchCommitmentsCache.cjs +1 -1
  27. package/API/fetchCommitmentsCache.mjs +9 -9
  28. package/API/get-token-data.cjs +1 -1
  29. package/API/get-token-data.d.ts +1 -1
  30. package/API/get-token-data.mjs +5 -5
  31. package/API/get-token-price-chart-data.cjs +1 -0
  32. package/API/get-token-price-chart-data.d.ts +16 -0
  33. package/API/get-token-price-chart-data.mjs +13 -0
  34. package/API/getGasEstimates.cjs +1 -1
  35. package/API/getGasEstimates.mjs +9 -9
  36. package/API/getServerURL.cjs +1 -1
  37. package/API/getServerURL.d.ts +3 -3
  38. package/API/getServerURL.mjs +51 -67
  39. package/API/getTokenPrice.cjs +1 -1
  40. package/API/getTokenPrice.d.ts +5 -0
  41. package/API/getTokenPrice.mjs +14 -7
  42. package/API/getWebsiteURL.d.ts +1 -1
  43. package/API/index.d.ts +0 -3
  44. package/API/is-tx-stateless.cjs +1 -1
  45. package/API/is-tx-stateless.d.ts +1 -1
  46. package/API/is-tx-stateless.mjs +10 -12
  47. package/API/kycCalls.cjs +1 -1
  48. package/API/kycCalls.d.ts +4 -8
  49. package/API/kycCalls.mjs +23 -26
  50. package/API/onrampCalls.cjs +1 -0
  51. package/API/onrampCalls.d.ts +20 -0
  52. package/API/onrampCalls.mjs +15 -0
  53. package/API/proxyAccountsCalls.cjs +1 -1
  54. package/API/proxyAccountsCalls.d.ts +2 -2
  55. package/API/proxyAccountsCalls.mjs +19 -19
  56. package/API/relayCalls.cjs +1 -1
  57. package/API/relayCalls.mjs +4 -4
  58. package/API/scheduled-transactions-calls.cjs +1 -1
  59. package/API/scheduled-transactions-calls.d.ts +1 -1
  60. package/API/scheduled-transactions-calls.mjs +4 -4
  61. package/API/simulate-batch-tx.cjs +1 -1
  62. package/API/simulate-batch-tx.d.ts +2 -2
  63. package/API/simulate-batch-tx.mjs +7 -6
  64. package/API/solana-calls.cjs +1 -1
  65. package/API/solana-calls.d.ts +6 -3
  66. package/API/solana-calls.mjs +15 -15
  67. package/API/token-calls.cjs +1 -1
  68. package/API/token-calls.mjs +6 -5
  69. package/API/unspent-utxos-calls.cjs +1 -1
  70. package/API/unspent-utxos-calls.d.ts +1 -1
  71. package/API/unspent-utxos-calls.mjs +15 -18
  72. package/README.md +237 -61
  73. package/constants/addresses.constants.cjs +1 -1
  74. package/constants/addresses.constants.d.ts +0 -1
  75. package/constants/addresses.constants.mjs +7 -8
  76. package/constants/chains.constants.cjs +1 -1
  77. package/constants/chains.constants.d.ts +0 -5
  78. package/constants/chains.constants.mjs +21 -26
  79. package/constants/coingecko.constants.cjs +1 -1
  80. package/constants/coingecko.constants.d.ts +1 -0
  81. package/constants/coingecko.constants.mjs +11 -10
  82. package/constants/contracts.constants.cjs +1 -1
  83. package/constants/contracts.constants.mjs +34 -41
  84. package/constants/function-signatures.constants.cjs +1 -1
  85. package/constants/function-signatures.constants.d.ts +0 -1
  86. package/constants/function-signatures.constants.mjs +3 -4
  87. package/constants/mediaUrls.constants.cjs +1 -1
  88. package/constants/mediaUrls.constants.d.ts +2 -0
  89. package/constants/mediaUrls.constants.mjs +3 -1
  90. package/constants/mystery-boxes.constants.d.ts +0 -0
  91. package/constants/permit2.constants.cjs +1 -1
  92. package/constants/permit2.constants.d.ts +0 -1
  93. package/constants/permit2.constants.mjs +10 -11
  94. package/constants/server.constants.cjs +1 -1
  95. package/constants/server.constants.d.ts +14 -122
  96. package/constants/server.constants.mjs +44 -152
  97. package/constants/token-data/ethMainnetRegistry.json.cjs +1 -1
  98. package/constants/token-data/ethMainnetRegistry.json.mjs +0 -24
  99. package/constants/token-data/ethMainnetRegistryFixed.json.cjs +1 -1
  100. package/constants/token-data/ethMainnetRegistryFixed.json.mjs +0 -24
  101. package/constants/token-data/index.d.ts +32 -88
  102. package/constants/token-data/localhostRegistry.json.cjs +1 -1
  103. package/constants/token-data/localhostRegistry.json.mjs +0 -26
  104. package/constants/token-data/popularTokens.constants.cjs +1 -1
  105. package/constants/token-data/popularTokens.constants.mjs +0 -1
  106. package/constants/vite.constants.cjs +1 -1
  107. package/constants/vite.constants.mjs +36 -13
  108. package/data-structures/Hinkal/Hinkal.cjs +1 -1
  109. package/data-structures/Hinkal/Hinkal.d.ts +34 -49
  110. package/data-structures/Hinkal/Hinkal.mjs +238 -301
  111. package/data-structures/Hinkal/IHinkal.d.ts +33 -48
  112. package/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
  113. package/data-structures/Hinkal/handleAutoDepositBack.d.ts +1 -1
  114. package/data-structures/Hinkal/handleAutoDepositBack.mjs +42 -42
  115. package/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
  116. package/data-structures/Hinkal/hinkalActionReceive.mjs +25 -23
  117. package/data-structures/Hinkal/hinkalCheckTokenRegistry.cjs +1 -1
  118. package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +9 -9
  119. package/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
  120. package/data-structures/Hinkal/hinkalDeposit.mjs +95 -93
  121. package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
  122. package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +147 -133
  123. package/data-structures/Hinkal/hinkalGetZkMeProvider.cjs +1 -1
  124. package/data-structures/Hinkal/hinkalGetZkMeProvider.mjs +1 -2
  125. package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
  126. package/data-structures/Hinkal/hinkalPrivateWallet.d.ts +1 -1
  127. package/data-structures/Hinkal/hinkalPrivateWallet.mjs +107 -115
  128. package/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -1
  129. package/data-structures/Hinkal/hinkalProoflessDeposit.mjs +36 -34
  130. package/data-structures/Hinkal/hinkalProxySwap.cjs +1 -1
  131. package/data-structures/Hinkal/hinkalProxySwap.mjs +34 -33
  132. package/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -1
  133. package/data-structures/Hinkal/hinkalProxyToPrivate.d.ts +1 -1
  134. package/data-structures/Hinkal/hinkalProxyToPrivate.mjs +26 -24
  135. package/data-structures/Hinkal/hinkalSignSubAccount.cjs +1 -1
  136. package/data-structures/Hinkal/hinkalSignSubAccount.d.ts +1 -2
  137. package/data-structures/Hinkal/hinkalSignSubAccount.mjs +8 -9
  138. package/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
  139. package/data-structures/Hinkal/hinkalSolanaDeposit.d.ts +4 -3
  140. package/data-structures/Hinkal/hinkalSolanaDeposit.mjs +86 -97
  141. package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
  142. package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +2 -1
  143. package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +146 -146
  144. package/data-structures/Hinkal/hinkalSolanaProxySend.cjs +1 -1
  145. package/data-structures/Hinkal/hinkalSolanaProxySend.d.ts +2 -3
  146. package/data-structures/Hinkal/hinkalSolanaProxySend.mjs +38 -38
  147. package/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
  148. package/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +57 -56
  149. package/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
  150. package/data-structures/Hinkal/hinkalSolanaProxySwap.d.ts +1 -1
  151. package/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +59 -58
  152. package/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
  153. package/data-structures/Hinkal/hinkalSolanaSwap.d.ts +1 -1
  154. package/data-structures/Hinkal/hinkalSolanaSwap.mjs +83 -79
  155. package/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
  156. package/data-structures/Hinkal/hinkalSolanaTransfer.d.ts +1 -1
  157. package/data-structures/Hinkal/hinkalSolanaTransfer.mjs +49 -48
  158. package/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
  159. package/data-structures/Hinkal/hinkalSolanaWithdraw.d.ts +2 -1
  160. package/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +67 -64
  161. package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
  162. package/data-structures/Hinkal/hinkalSwap.d.ts +1 -1
  163. package/data-structures/Hinkal/hinkalSwap.mjs +75 -87
  164. package/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
  165. package/data-structures/Hinkal/hinkalTransfer.d.ts +1 -1
  166. package/data-structures/Hinkal/hinkalTransfer.mjs +55 -58
  167. package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
  168. package/data-structures/Hinkal/hinkalWithdraw.mjs +80 -82
  169. package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
  170. package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.d.ts +2 -2
  171. package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +87 -90
  172. package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
  173. package/data-structures/Hinkal/resetMerkleTrees.d.ts +1 -1
  174. package/data-structures/Hinkal/resetMerkleTrees.mjs +105 -53
  175. package/data-structures/IndexedDB/activity-db.cjs +1 -1
  176. package/data-structures/IndexedDB/activity-db.mjs +7 -7
  177. package/data-structures/IndexedDB/balances-db.cjs +1 -1
  178. package/data-structures/IndexedDB/balances-db.mjs +8 -8
  179. package/data-structures/IndexedDB/contact-db.cjs +1 -1
  180. package/data-structures/IndexedDB/contact-db.mjs +10 -10
  181. package/data-structures/IndexedDB/signatures-db.cjs +1 -1
  182. package/data-structures/IndexedDB/signatures-db.mjs +25 -40
  183. package/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
  184. package/data-structures/TokenDBs/EventsPublicTokensDB.mjs +10 -11
  185. package/data-structures/TokenDBs/token-visibility-db.cjs +1 -1
  186. package/data-structures/TokenDBs/token-visibility-db.mjs +22 -36
  187. package/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
  188. package/data-structures/crypto-keys/encryptDecryptUtxo.d.ts +1 -1
  189. package/data-structures/crypto-keys/encryptDecryptUtxo.mjs +14 -14
  190. package/data-structures/event-service/evm/AbstractEventService.cjs +1 -1
  191. package/data-structures/event-service/evm/AbstractEventService.d.ts +1 -0
  192. package/data-structures/event-service/evm/AbstractEventService.mjs +7 -4
  193. package/data-structures/event-service/evm/AbstractSnapshotService.cjs +1 -1
  194. package/data-structures/event-service/evm/AbstractSnapshotService.d.ts +0 -1
  195. package/data-structures/event-service/evm/AbstractSnapshotService.mjs +3 -4
  196. package/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
  197. package/data-structures/event-service/evm/BlockchainEventEmitter.d.ts +3 -1
  198. package/data-structures/event-service/evm/BlockchainEventEmitter.mjs +17 -14
  199. package/data-structures/event-service/solana/AbstractSolanaEventService.cjs +1 -1
  200. package/data-structures/event-service/solana/AbstractSolanaEventService.d.ts +1 -0
  201. package/data-structures/event-service/solana/AbstractSolanaEventService.mjs +9 -6
  202. package/data-structures/event-service/solana/AbstractSolanaSnapshotService.cjs +1 -1
  203. package/data-structures/event-service/solana/AbstractSolanaSnapshotService.d.ts +0 -1
  204. package/data-structures/event-service/solana/AbstractSolanaSnapshotService.mjs +1 -2
  205. package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.cjs +1 -1
  206. package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.d.ts +3 -2
  207. package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.mjs +42 -45
  208. package/data-structures/provider-adapter/IProviderAdapter.d.ts +8 -13
  209. package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.cjs +1 -1
  210. package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.mjs +3 -4
  211. package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.cjs +1 -1
  212. package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.mjs +3 -4
  213. package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.cjs +1 -1
  214. package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.mjs +3 -4
  215. package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.cjs +1 -1
  216. package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.mjs +3 -4
  217. package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.cjs +1 -1
  218. package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.mjs +3 -4
  219. package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.cjs +1 -1
  220. package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.mjs +2 -4
  221. package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.cjs +1 -1
  222. package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.mjs +3 -4
  223. package/data-structures/utxo/Utxo.cjs +1 -1
  224. package/data-structures/utxo/Utxo.d.ts +1 -7
  225. package/data-structures/utxo/Utxo.mjs +26 -36
  226. package/error-handling/error-codes.constants.cjs +1 -1
  227. package/error-handling/error-codes.constants.d.ts +3 -0
  228. package/error-handling/error-codes.constants.mjs +5 -2
  229. package/error-handling/get-error.message.cjs +1 -1
  230. package/error-handling/get-error.message.mjs +21 -27
  231. package/error-handling/index.d.ts +0 -1
  232. package/functions/index.d.ts +0 -1
  233. package/functions/kyc/zkMeHelper.cjs +1 -1
  234. package/functions/kyc/zkMeHelper.mjs +18 -17
  235. package/functions/pre-transaction/constructAdminData.cjs +1 -1
  236. package/functions/pre-transaction/constructAdminData.d.ts +2 -2
  237. package/functions/pre-transaction/constructAdminData.mjs +12 -18
  238. package/functions/pre-transaction/getExternalSwapAddress.cjs +1 -1
  239. package/functions/pre-transaction/getExternalSwapAddress.d.ts +1 -2
  240. package/functions/pre-transaction/getExternalSwapAddress.mjs +8 -8
  241. package/functions/pre-transaction/getFlatFees.cjs +1 -1
  242. package/functions/pre-transaction/getFlatFees.mjs +22 -30
  243. package/functions/pre-transaction/getVolatileTransferAmount.cjs +1 -1
  244. package/functions/pre-transaction/getVolatileTransferAmount.mjs +21 -36
  245. package/functions/pre-transaction/merge-with-fee-structure-emporium.cjs +1 -1
  246. package/functions/pre-transaction/merge-with-fee-structure-emporium.d.ts +1 -1
  247. package/functions/pre-transaction/merge-with-fee-structure-emporium.mjs +17 -17
  248. package/functions/pre-transaction/outputApprovalDataProcessing.cjs +1 -1
  249. package/functions/pre-transaction/outputApprovalDataProcessing.d.ts +1 -9
  250. package/functions/pre-transaction/outputApprovalDataProcessing.mjs +19 -34
  251. package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs +1 -1
  252. package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.d.ts +1 -1
  253. package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs +4 -4
  254. package/functions/pre-transaction/solana-public-signals.cjs +1 -1
  255. package/functions/pre-transaction/solana-public-signals.d.ts +1 -0
  256. package/functions/pre-transaction/solana-public-signals.mjs +29 -26
  257. package/functions/pre-transaction/solana.cjs +1 -1
  258. package/functions/pre-transaction/solana.d.ts +2 -1
  259. package/functions/pre-transaction/solana.mjs +60 -51
  260. package/functions/private-wallet/emporium.helpers.cjs +1 -1
  261. package/functions/private-wallet/emporium.helpers.d.ts +3 -5
  262. package/functions/private-wallet/emporium.helpers.mjs +95 -135
  263. package/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
  264. package/functions/private-wallet/emporium.swap.helpers.d.ts +1 -4
  265. package/functions/private-wallet/emporium.swap.helpers.mjs +100 -102
  266. package/functions/snarkjs/common.snarkjs.cjs +1 -1
  267. package/functions/snarkjs/common.snarkjs.d.ts +1 -1
  268. package/functions/snarkjs/common.snarkjs.mjs +64 -64
  269. package/functions/snarkjs/constructEmporiumProof.cjs +1 -1
  270. package/functions/snarkjs/constructEmporiumProof.d.ts +2 -2
  271. package/functions/snarkjs/constructEmporiumProof.mjs +1 -1
  272. package/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
  273. package/functions/snarkjs/constructGeneralZkProof.d.ts +2 -3
  274. package/functions/snarkjs/constructGeneralZkProof.mjs +117 -121
  275. package/functions/snarkjs/constructSolanaZkProof.cjs +1 -1
  276. package/functions/snarkjs/constructSolanaZkProof.d.ts +1 -1
  277. package/functions/snarkjs/constructSolanaZkProof.mjs +54 -59
  278. package/functions/snarkjs/fetchMerkleTreeSiblings.cjs +1 -1
  279. package/functions/snarkjs/fetchMerkleTreeSiblings.mjs +11 -10
  280. package/functions/snarkjs/generateCircomData.d.ts +1 -1
  281. package/functions/utils/addresses.cjs +1 -1
  282. package/functions/utils/addresses.d.ts +1 -0
  283. package/functions/utils/addresses.mjs +13 -12
  284. package/functions/utils/cacheFunctions.cjs +1 -1
  285. package/functions/utils/cacheFunctions.mjs +2 -2
  286. package/functions/utils/enum.utils.cjs +1 -0
  287. package/functions/utils/enum.utils.mjs +14 -0
  288. package/functions/utils/erc20tokenFunctions.cjs +1 -1
  289. package/functions/utils/erc20tokenFunctions.d.ts +0 -1
  290. package/functions/utils/erc20tokenFunctions.mjs +22 -29
  291. package/functions/utils/get-hinkal-approvals.cjs +1 -1
  292. package/functions/utils/get-hinkal-approvals.d.ts +1 -1
  293. package/functions/utils/get-hinkal-approvals.mjs +16 -16
  294. package/functions/utils/getDataFromTransaction.d.ts +3 -3
  295. package/functions/utils/getUtxosFromReceipt.utils.cjs +1 -1
  296. package/functions/utils/getUtxosFromReceipt.utils.d.ts +1 -1
  297. package/functions/utils/getUtxosFromReceipt.utils.mjs +11 -11
  298. package/functions/utils/involves-permit2-op.cjs +1 -1
  299. package/functions/utils/involves-permit2-op.d.ts +0 -1
  300. package/functions/utils/involves-permit2-op.mjs +4 -6
  301. package/functions/utils/mutexes.utils.cjs +1 -1
  302. package/functions/utils/mutexes.utils.d.ts +1 -1
  303. package/functions/utils/mutexes.utils.mjs +3 -3
  304. package/functions/utils/nftTokenFunctions.cjs +1 -1
  305. package/functions/utils/nftTokenFunctions.mjs +8 -23
  306. package/functions/utils/prepareHinkal.cjs +1 -1
  307. package/functions/utils/prepareHinkal.d.ts +0 -6
  308. package/functions/utils/prepareHinkal.mjs +41 -60
  309. package/functions/utils/token-check.utils.cjs +1 -1
  310. package/functions/utils/token-check.utils.d.ts +3 -0
  311. package/functions/utils/token-check.utils.mjs +18 -7
  312. package/functions/utils/upToDateState.cjs +1 -1
  313. package/functions/utils/upToDateState.d.ts +1 -1
  314. package/functions/utils/upToDateState.mjs +4 -4
  315. package/functions/utils/walletBalances.utils.cjs +1 -1
  316. package/functions/utils/walletBalances.utils.d.ts +1 -16
  317. package/functions/utils/walletBalances.utils.mjs +4 -35
  318. package/functions/web3/events/getApprovedBalance.cjs +1 -1
  319. package/functions/web3/events/getApprovedBalance.d.ts +3 -4
  320. package/functions/web3/events/getApprovedBalance.mjs +39 -44
  321. package/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
  322. package/functions/web3/events/getInputUtxoAndBalance.d.ts +1 -1
  323. package/functions/web3/events/getInputUtxoAndBalance.mjs +114 -121
  324. package/functions/web3/events/getInputUtxosEnclave.d.ts +1 -1
  325. package/functions/web3/events/getShieldedBalance.cjs +2 -2
  326. package/functions/web3/events/getShieldedBalance.d.ts +1 -1
  327. package/functions/web3/events/getShieldedBalance.mjs +71 -70
  328. package/functions/web3/events/getTransactionLogEvents.cjs +1 -1
  329. package/functions/web3/events/getTransactionLogEvents.mjs +7 -7
  330. package/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -1
  331. package/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +7 -7
  332. package/functions/web3/functionCalls/accessTokenCalls.cjs +1 -1
  333. package/functions/web3/functionCalls/accessTokenCalls.d.ts +1 -6
  334. package/functions/web3/functionCalls/accessTokenCalls.mjs +12 -21
  335. package/functions/web3/functionCalls/approveToken.cjs +1 -1
  336. package/functions/web3/functionCalls/approveToken.d.ts +1 -1
  337. package/functions/web3/functionCalls/approveToken.mjs +71 -63
  338. package/functions/web3/functionCalls/approveTokensToHinkal.cjs +1 -1
  339. package/functions/web3/functionCalls/approveTokensToHinkal.d.ts +1 -1
  340. package/functions/web3/functionCalls/approveTokensToHinkal.mjs +6 -6
  341. package/functions/web3/functionCalls/estimateGasRelayer.cjs +1 -1
  342. package/functions/web3/functionCalls/estimateGasRelayer.d.ts +1 -2
  343. package/functions/web3/functionCalls/estimateGasRelayer.mjs +10 -10
  344. package/functions/web3/functionCalls/recoverTransactionFromError.cjs +1 -0
  345. package/functions/web3/functionCalls/recoverTransactionFromError.d.ts +2 -0
  346. package/functions/web3/functionCalls/recoverTransactionFromError.mjs +23 -0
  347. package/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
  348. package/functions/web3/functionCalls/transactCallDirect.d.ts +1 -1
  349. package/functions/web3/functionCalls/transactCallDirect.mjs +45 -36
  350. package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
  351. package/functions/web3/functionCalls/transactCallRelayer.d.ts +1 -1
  352. package/functions/web3/functionCalls/transactCallRelayer.mjs +44 -43
  353. package/functions/web3/getPublicAddressBalance.cjs +1 -1
  354. package/functions/web3/getPublicAddressBalance.d.ts +1 -1
  355. package/functions/web3/getPublicAddressBalance.mjs +6 -6
  356. package/functions/web3/getTokenHolder.cjs +1 -1
  357. package/functions/web3/getTokenHolder.mjs +8 -8
  358. package/functions/web3/lifiAPI.cjs +1 -1
  359. package/functions/web3/lifiAPI.d.ts +1 -1
  360. package/functions/web3/lifiAPI.mjs +12 -12
  361. package/functions/web3/odosAPI.cjs +1 -1
  362. package/functions/web3/odosAPI.mjs +6 -19
  363. package/functions/web3/okxAPI.cjs +1 -1
  364. package/functions/web3/okxAPI.mjs +22 -22
  365. package/functions/web3/oneInchAPI.cjs +1 -1
  366. package/functions/web3/oneInchAPI.mjs +7 -20
  367. package/functions/web3/runContractFunction.cjs +1 -1
  368. package/functions/web3/runContractFunction.mjs +38 -56
  369. package/functions/web3/uniswapAPI.cjs +1 -1
  370. package/functions/web3/uniswapAPI.mjs +22 -34
  371. package/index.cjs +1 -1
  372. package/index.mjs +937 -967
  373. package/package.json +2 -2
  374. package/providers/EthersProviderAdapter.cjs +1 -1
  375. package/providers/EthersProviderAdapter.d.ts +10 -17
  376. package/providers/EthersProviderAdapter.mjs +48 -76
  377. package/providers/SolanaProviderAdapter.cjs +1 -1
  378. package/providers/SolanaProviderAdapter.d.ts +7 -11
  379. package/providers/SolanaProviderAdapter.mjs +16 -31
  380. package/providers/WagmiProviderAdapter.cjs +1 -1
  381. package/providers/WagmiProviderAdapter.d.ts +11 -17
  382. package/providers/WagmiProviderAdapter.mjs +86 -117
  383. package/providers/prepareEthersHinkal.cjs +1 -1
  384. package/providers/prepareEthersHinkal.mjs +6 -7
  385. package/providers/prepareWagmiHinkal.cjs +1 -1
  386. package/providers/prepareWagmiHinkal.mjs +5 -5
  387. package/types/TransactionSimulator.types.d.ts +2 -9
  388. package/types/admin.types.cjs +1 -1
  389. package/types/admin.types.d.ts +3 -7
  390. package/types/admin.types.mjs +2 -2
  391. package/types/balances.types.d.ts +0 -1
  392. package/types/cache.types.cjs +1 -1
  393. package/types/cache.types.d.ts +2 -3
  394. package/types/cache.types.mjs +1 -1
  395. package/types/coingecko.types.d.ts +5 -0
  396. package/types/ethereum-network.types.cjs +1 -1
  397. package/types/ethereum-network.types.d.ts +1 -8
  398. package/types/ethereum-network.types.mjs +1 -1
  399. package/types/external-action.types.cjs +1 -1
  400. package/types/external-action.types.d.ts +0 -1
  401. package/types/external-action.types.mjs +1 -1
  402. package/types/hinkal.types.cjs +1 -1
  403. package/types/hinkal.types.d.ts +1 -7
  404. package/types/hinkal.types.mjs +22 -23
  405. package/types/index.d.ts +1 -3
  406. package/types/onramp.types.cjs +1 -0
  407. package/types/onramp.types.d.ts +58 -0
  408. package/types/onramp.types.mjs +4 -0
  409. package/types/proxy.types.d.ts +1 -0
  410. package/types/sandbox.types.cjs +1 -1
  411. package/types/sandbox.types.d.ts +8 -39
  412. package/types/sandbox.types.mjs +2 -2
  413. package/types/session.types.d.ts +2 -0
  414. package/types/solana.types.d.ts +3 -0
  415. package/types/token-prices.types.cjs +1 -1
  416. package/types/token-prices.types.d.ts +7 -0
  417. package/types/token-prices.types.mjs +4 -2
  418. package/types/transactions.types.cjs +1 -1
  419. package/types/transactions.types.d.ts +6 -4
  420. package/types/transactions.types.mjs +4 -3
  421. package/webworker/snarkjsWorker/snarkjsWorkerLauncher.cjs +1 -1
  422. package/webworker/snarkjsWorker/snarkjsWorkerLauncher.mjs +1 -1
  423. package/webworker/utxoWorker/utxoWorkerLauncher.cjs +1 -1
  424. package/webworker/utxoWorker/utxoWorkerLauncher.mjs +1 -1
  425. package/webworker/zkProofWorker/zkProofWorkerLauncher.cjs +1 -1
  426. package/webworker/zkProofWorker/zkProofWorkerLauncher.mjs +1 -1
  427. package/API/ai-calls.cjs +0 -1
  428. package/API/ai-calls.d.ts +0 -17
  429. package/API/ai-calls.mjs +0 -21
  430. package/API/duneAPI.cjs +0 -1
  431. package/API/duneAPI.d.ts +0 -11
  432. package/API/duneAPI.mjs +0 -25
  433. package/API/getBridgeProtocols.cjs +0 -1
  434. package/API/getBridgeProtocols.d.ts +0 -7
  435. package/API/getBridgeProtocols.mjs +0 -8
  436. package/API/getLifiStatus.cjs +0 -1
  437. package/API/getLifiStatus.d.ts +0 -24
  438. package/API/getLifiStatus.mjs +0 -15
  439. package/API/getRelayerURL.cjs +0 -1
  440. package/API/getRelayerURL.d.ts +0 -1
  441. package/API/getRelayerURL.mjs +0 -10
  442. package/API/passwordCalls.cjs +0 -1
  443. package/API/passwordCalls.d.ts +0 -9
  444. package/API/passwordCalls.mjs +0 -13
  445. package/API/restoreSnapshots.cjs +0 -1
  446. package/API/restoreSnapshots.d.ts +0 -1
  447. package/API/restoreSnapshots.mjs +0 -10
  448. package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.cjs +0 -1
  449. package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.d.ts +0 -7
  450. package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.mjs +0 -42
  451. package/data-structures/Hinkal/hinkalActionStake.d.ts +0 -3
  452. package/data-structures/Hinkal/hinkalApprove.cjs +0 -1
  453. package/data-structures/Hinkal/hinkalApprove.d.ts +0 -3
  454. package/data-structures/Hinkal/hinkalApprove.mjs +0 -115
  455. package/data-structures/Hinkal/hinkalInsideTransact.cjs +0 -1
  456. package/data-structures/Hinkal/hinkalInsideTransact.d.ts +0 -4
  457. package/data-structures/Hinkal/hinkalInsideTransact.mjs +0 -121
  458. package/error-handling/handleErrorRestore.cjs +0 -1
  459. package/error-handling/handleErrorRestore.d.ts +0 -2
  460. package/error-handling/handleErrorRestore.mjs +0 -11
  461. package/functions/staking/index.cjs +0 -1
  462. package/functions/staking/index.d.ts +0 -11
  463. package/functions/staking/index.mjs +0 -42
  464. package/functions/utils/replaceAddressInCalldata.cjs +0 -1
  465. package/functions/utils/replaceAddressInCalldata.d.ts +0 -1
  466. package/functions/utils/replaceAddressInCalldata.mjs +0 -7
  467. package/functions/web3/functionCalls/inHinkalApprovalCalls.cjs +0 -1
  468. package/functions/web3/functionCalls/inHinkalApprovalCalls.d.ts +0 -5
  469. package/functions/web3/functionCalls/inHinkalApprovalCalls.mjs +0 -32
  470. package/types/bridging.types.d.ts +0 -29
  471. package/types/duneAPI.types.d.ts +0 -9
  472. package/types/hinkal.stake.types.cjs +0 -1
  473. package/types/hinkal.stake.types.d.ts +0 -11
  474. package/types/hinkal.stake.types.mjs +0 -4
package/README.md CHANGED
@@ -1,8 +1,14 @@
1
1
  # Hinkal SDK
2
2
 
3
- Hinkal is middleware and a set of smart contracts on EVM chains that use ZK-proofs and stealth addresses to enable compliant and private transactions on major dApps. Users can privately store assets and transact on platforms such as Uniswap, Pendle, Lido, Curve, and others.
3
+ Hinkal is a privacy middleware and smart-contract SDK for public blockchains that enables confidential transactions and settlement flows without changing wallets, custody, or chains.
4
4
 
5
- This SDK enables users to perform arbitrary smart contract interactions privately.
5
+ The SDK allows wallets, dApps, and payment platforms to integrate protocol-level privacy on Ethereum, Solana, Polygon, Base, Arbitrum, and Optimis. It hides transaction history, wallet relationships, and asset flows on-chain while preserving public-chain finality and compliance.
6
+
7
+ With Hinkal SDK, developers can:
8
+ • Enable private sends between public wallets
9
+ • Perform confidential payouts and settlements
10
+ • Route transactions through Hinkal’s privacy contracts without exposing sender, recipient, or amounts
11
+ • Maintain non-custodial control with optional compliance visibility via viewing keys
6
12
 
7
13
  ## Installation
8
14
 
@@ -18,18 +24,24 @@ Or, yarn:
18
24
  yarn add @hinkal/common
19
25
  ```
20
26
 
21
- ### Usage
27
+ ## Usage
28
+
29
+ ### Initialization
22
30
 
23
- #### Initialization
31
+ To begin using Hinkal in your application, you'll need to initialize the SDK with your preferred Web3 connection library. Hinkal supports multiple popular libraries out of the box, allowing seamless integration with your existing wallet connection setup.
32
+
33
+ Initializing the SDK creates a `Hinkal` object that encapsulates:
34
+ - The user's shielded balances
35
+ - Actions the user can perform, such as shielding (depositing), transfers, and swapping
36
+ - Cryptographic keys for privacy-preserving operations
24
37
 
25
- To get started with Hinkal, initialize it based on the Web3 connection library you’re using:
26
38
 
27
39
  **ethers.js:**
28
40
 
29
41
  ```typescript
30
42
  import { prepareEthersHinkal } from '@hinkal/common/providers/prepareEthersHinkal';
31
43
  // signer: ethers.Signer
32
- const hinkal = await prepareEthersHinkal(signer);
44
+ const hinkal = await prepareEthersHinkal(signer, hinkalConfig);
33
45
  ```
34
46
 
35
47
  **wagmi:**
@@ -37,128 +49,292 @@ const hinkal = await prepareEthersHinkal(signer);
37
49
  ```typescript
38
50
  import { prepareWagmiHinkal } from '@hinkal/common/providers/prepareWagmiHinkal';
39
51
  // connector: wagmi.Connector
40
- // config: wagmi.Config
41
- const hinkal = await prepareWagmiHinkal(connector, config);
52
+ // wagmiConfig: wagmi.Config
53
+ const hinkal = await prepareWagmiHinkal(connector, wagmiConfig, hinkalConfig);
54
+ ```
55
+ The `hinkalConfig` is defined as follows:
56
+ ```typescript
57
+ type HinkalConfig = {
58
+ /**
59
+ * Path to the cache file used for storing temporary data.
60
+ * It should be a valid file path string.
61
+ */
62
+ cacheFilePath?: string;
63
+ /**
64
+ * Indicator to use caching on a file level.
65
+ * Node only.
66
+ */
67
+ useFileCache?: boolean;
68
+ disableCaching?: boolean;
69
+ serializedCache?: Record<string, string>;
70
+ /**
71
+ * Indicator controlling wether the proof should be constructed remotely in secure enclave.
72
+ */
73
+ generateProofRemotely?: boolean;
74
+ disableMerkleTreeUpdates?: boolean;
75
+ };
42
76
  ```
43
77
 
44
- #### Shielded balance
78
+ ### Shielded balance
45
79
 
46
- Once the Hinkal object is initialized, shielded balances become accessible and can be calculated as needed:
80
+ Shielded balances are encrypted token holdings stored within the Hinkal protocol. Unlike regular blockchain balances that are publicly visible, shielded balances are hidden from external observers, providing privacy for your assets. After initializing the Hinkal object, you can access and calculate your shielded balances:
47
81
 
48
82
  ```typescript
49
- const balances = await hinkal.getBalances();
83
+ const balances: Promise<Map<string, TokenBalance>> = await hinkal.getBalances();
50
84
  ```
51
85
 
52
- #### Depositing funds to the shielded balance
86
+ This returns a map from token address to balance for all tokens held by the user, including ERC20 and ERC721 tokens.
87
+
88
+
89
+ ### Shielding: depositing funds to the shielded balance
90
+
91
+ Shielding is the process of moving your tokens from a public blockchain address into a private, encrypted balance. Once shielded, your tokens are no longer visible on-chain to external observers. This provides privacy for your holdings and subsequent transactions.
53
92
 
54
93
  A user can deposit funds to their shielded address using:
55
94
 
56
95
  ```typescript
57
- function deposit(erc20addresses: string[], amountChanges: bigint[]): Promise<TransactionObject>;
96
+ function deposit(erc20Tokens: ERC20Token[], amountChanges: bigint[]): Promise<ethers.providers.TransactionResponse>;
97
+ ```
98
+
99
+ where:
100
+ - `erc20Tokens` is an array of tokens to deposit
101
+ - `amountChanges` represents the corresponding token amounts for the deposit
102
+
103
+ The `ERC20Token` type is defined as follows:
104
+
105
+ ```typescript
106
+ type ERC20Token = {
107
+ chainId: number;
108
+ erc20TokenAddress: string;
109
+ name: string;
110
+ symbol: string;
111
+ decimals: number;
112
+ };
113
+ ```
114
+
115
+ ### Private Send to Public Address: withdrawing funds from the shielded balance
116
+
117
+ Private Send to Public Address allows you to send tokens from your private, shielded balance directly to any public blockchain address. The sender's identity is not exposed during this transaction. The recipient receives the funds at their public address, where the tokens become visible on-chain. This is useful when you need to interact with public DeFi protocols, send funds to exchanges, or transfer to any public wallet while maintaining privacy for your shielded balance.
118
+
119
+ A user can withdraw funds from their shielded address to a public address using:
120
+
121
+ ```typescript
122
+ function withdraw(
123
+ erc20Tokens: ERC20Token[],
124
+ deltaAmounts: bigint[],
125
+ recipientAddress: string,
126
+ isRelayerOff: boolean,
127
+ ): Promise<RelayerTransaction>;
128
+ ```
129
+
130
+ where:
131
+ - `recipientAddress` is the public address that will receive the withdrawn funds
132
+ - `isRelayerOff` determines whether to use a relayer for the transaction (when `false`, a relayer handles gas fees; when `true`, the user pays gas directly)
133
+ - `RelayerTransaction` type represents the transaction response from the relayer service.
134
+
135
+ ### Private Send to Private Address: transfering funds from shielded balance
136
+
137
+ Private Send to Private Address enables fully confidential transfers between shielded balances. Both the sender and recipient remain anonymous, and the transaction amount is hidden from external observers. This is the most private way to transfer tokens, as neither party's identity nor the transaction details are exposed on-chain.
138
+
139
+ A user can transfer tokens from their shielded balance to another shielded address using:
140
+
141
+ ```typescript
142
+ function transfer(
143
+ erc20Tokens: ERC20Token[],
144
+ deltaAmounts: bigint[],
145
+ privateRecipientAddress: string,
146
+ ): Promise<RelayerTransaction>;
147
+ ```
148
+ where:
149
+ - `privateRecipientAddress` is the recipient's private address, formatted as a comma-separated string with five components:
150
+ - `randomization` - a random value for privacy
151
+ - `stealthAddress` - the recipient's stealth address (hex format starting with `0x`)
152
+ - `encryptionKey` - the recipient's encryption key (hex format starting with `0x`, 66 characters)
153
+ - `H0` - the first hash component of elliptic curve point for stealth address derivation
154
+ - `H1` - the second hash component of elliptic curve point for stealth address derivation
155
+
156
+ ### Private Send from Public to Public addresses
157
+
158
+ Private Send from Public to Public addresses enables you to transfer tokens between two public addresses while using Hinkal's privacy infrastructure. The tokens are first shielded from the sender's public address, then unshielded to the recipient's public address either immediately or after some interval. This ensures there is no traceable connection between the sender and recipient on-chain, providing transaction privacy even when both parties use public addresses.
159
+
160
+ A user can perform a private transfer between public addresses using:
161
+
162
+ ```typescript
163
+ function depositAndWithdraw(
164
+ erc20Token: ERC20Token,
165
+ ecipientAmounts: bigint[],
166
+ recipientAddresses: string[],
167
+ txCompletionTime?: number,
168
+ ): Promise<RelayerTransaction>;
58
169
  ```
59
170
 
60
- where erc20Addresses is an array of token addresses, and amountChanges represents the token amounts for the deposit.
171
+ where:
172
+ - `erc20Token` is the token to transfer (only single token transfers are supported for this method)
173
+ - `recipientAmounts` is an array of amounts to send to each recipient (in the token's smallest unit)
174
+ - `recipientAddresses` is an array of public addresses that will receive the funds
175
+ - `txCompletionTime` (optional) specifies a delay in milliseconds before the withdrawal completes
176
+
61
177
 
62
- #### Interacting with smart contracts privately
178
+ ### Swapping tokens from the shielded balance
63
179
 
64
- After a user’s shielded balance is updated, they can perform any smart contract interaction privately using:
180
+ Swapping allows you to exchange tokens directly from your shielded balance without revealing your identity. The swap is executed through integrated DEX protocols (Uniswap, 1Inch, Odos) while keeping your transaction private. Your tokens are withdrawn from your shielded balance, swapped through the specified protocol, and the resulting tokens are deposited back into your shielded balance—all in a single private transaction.
181
+
182
+ A user can swap tokens directly from their shielded balance using:
183
+
184
+ ```typescript
185
+ function swap(
186
+ erc20Tokens: ERC20Token[],
187
+ deltaAmounts: bigint[],
188
+ externalActionId: ExternalActionId,
189
+ swapData: string,
190
+ ): Promise<RelayerTransaction>;
191
+ ```
192
+
193
+ where:
194
+ - `externalActionId` identifies the external swap protocol to use. Possible values include:
195
+ - `ExternalActionId.Uniswap` - for Uniswap swaps
196
+ - `ExternalActionId.OneInch` - for 1Inch swaps
197
+ - `ExternalActionId.Odos` - for Odos swaps
198
+ - `swapData` contains the encoded swap parameters specific to the chosen protocol
199
+
200
+ **Getting swap calldata:**
201
+
202
+ To obtain the swap calldata using the Hinkal SDK, you can use the built-in swap data generation utilities.
203
+
204
+ To get swap data for 1Inch, you can use the `getOneInchPrice` function. This function fetches a quote from the 1Inch aggregator and returns both the expected output amount and the encoded swap data that can be passed to the `swap` function:
205
+
206
+
207
+ **1Inch:**
208
+ ```typescript
209
+ function getOneInchPrice(
210
+ chainId: number,
211
+ inSwapToken: ERC20Token,
212
+ outSwapToken: ERC20Token,
213
+ inSwapAmount: string,
214
+ slippagePercentage?: number,
215
+ ): Promise<{
216
+ outSwapAmountValue: bigint;
217
+ oneInchDataValue: string;
218
+ }>
219
+ ```
220
+ Similar functions are available for other supported swap protocols:
221
+ - **Uniswap:** `getUniswapPrice`
222
+ - **Odos:** `getOdosPrice`
223
+ - **LiFi:** `getLifiPrice`
224
+
225
+ ### Interacting with smart contracts privately
226
+
227
+ The SDK lets you interact with any smart contract on the blockchain while keeping your identity private. When you initiate a private wallet action, your funds are first unshielded from your Hinkal shielded balance to an intermediary called an Emporium contract. The Emporium then executes your desired actions on-chain (such as swaps, staking, or other DeFi interactions) without exposing who initiated them. After the operations complete, the resulting tokens are automatically shielded back into your Hinkal shielded balance. This means you can use DeFi protocols, NFT marketplaces, or any other smart contract while maintaining full anonymity.
65
228
 
66
229
  ```typescript
67
230
  function actionPrivateWallet(
231
+ chainId:number,
68
232
  erc20Addresses: string[],
69
- amountChanges: bigint[],
233
+ deltaAmounts: bigint[],
70
234
  onChainCreation: boolean[],
71
235
  ops: string[],
72
- ): Promise<TransactionObject>;
236
+ ): Promise<RelayerTransaction>;
73
237
  ```
74
238
 
75
- where onChainCreation indicates the amounts of tokens that are uncertain before the transaction is executed on-chain. The ops array contains encoded user operations.
239
+ Parameters:
240
+ - `chainId` - the blockchain network identifier
241
+ - `onChainCreation` - array of booleans indicating the direction of token changes: `true` for positive changes (tokens received), `false` for negative changes (tokens spent)
242
+ - `ops` - array of encoded user operations to execute (see User operations below)
243
+
244
+ User operations (`ops`) are encoded instructions that tell the Emporium contract what actions to perform. Each operation specifies a target contract, the function to call, and any necessary parameters. For example, to stake ETH with Lido, you would create an operation that calls Lido's `submit` function with the appropriate value.
76
245
 
77
- ##### User operations
246
+ To generate user operations, a user will need the `emporiumOp` function.
78
247
 
79
- To generate user operations (`ops`) you will need the `emporiumOp` function.
80
248
  ```typescript
81
- import {emporiumOp} from "@hinkal/common";
249
+ function emporiumOp(
250
+ contract: ethers.Contract | string;
251
+ func?: string;
252
+ args?: any[];
253
+ callDataString?: string;
254
+ invokeWallet?: boolean;
255
+ value?: bigint;
256
+ ): Promise<RelayerTransaction>;
82
257
  ```
83
258
 
84
259
  The function accepts the following arguments:
85
- 1. `endpoint` *(required)* - target address or contract instance (with address). The contract instance will be used to properly encode the call function, if any, in the custom operation.
86
- 2. `func` *(optional)* - the name of the function to be called on the target address.
87
- 3. `args` *(optional)* - arguments of the function to be called on the target address.
88
- 4. `invokeWallet` *(optional)* - bool flag that determines the type of transaction. There are two types: stateful and stateless interaction. The default is false (stateless).
89
- 5. `value` *(optional)* - the amount of native currency to transfer to the target address.
260
+ 1. `contract` _(required)_ - target address or contract instance (with address). The contract instance will be used to properly encode the call function, if any, in the custom operation.
261
+ 2. `func` _(optional)_ - the name of the function to be called on the target address.
262
+ 3. `args` _(optional)_ - arguments of the function to be called on the target address.
263
+ 4. `callDataString` _(optional)_ - pre-encoded calldata string. If provided, `func` and `args` should not be used.
264
+ 5. `invokeWallet` _(optional)_ - boolean flag that determines the type of interaction (see the stateless/stateful interactions below).
265
+ 6. `value` _(optional)_ - the value field to the user operation call.
90
266
 
91
- The `emporiumOp` function will generate data for subsequent calls, supporting both stateful interaction (with state preservation) and stateless interaction (without state preservation). This is determined by the `invokeWallet` flag.
92
267
 
93
- To execute on a smart contract, the user operation will be received in the following format:
268
+ When the Emporium contract executes a user operation, it receives the data in this format:
269
+
94
270
  ```solidity
95
271
  (address endpoint, bool invokeWallet, uint256 value, bytes data)
96
272
  ```
97
273
 
98
- This will make it possible to make that kind of call:
274
+ This enables the Emporium contract to execute generic calls using user operations:
275
+
99
276
  ```solidity
100
277
  (bool success, bytes memory err) = endpoint.call{value: value}(data);
101
278
  ```
102
279
 
103
- ##### Stateless and stateful
104
-
105
- The best way to demonstrate how this works is with an example.
280
+ User operations can be categorized into two types based on whether the target protocol needs to track the caller account's history:
106
281
 
107
- **Stateless interaction**
282
+ **Stateless interactions** are operations where the resulting token amount changes depend only on the calldata provided. Two different accounts executing the same calldata should receive the same result, regardless of their transaction history. Examples include token swaps, liquidity provision, and simple staking operations.
108
283
 
109
- Let's say we need to exchange USDC for ETH using DEX.
284
+ For example, consider exchanging USDC for ETH using a DEX. To perform a swap, the DEX does not need to know historical data about the caller (e.g., when and what swaps have been performed from his account in the past). It only needs to know how much token to swap and the exchange rate.
110
285
 
111
286
  ```typescript
112
287
  const operations = [
113
- emporiumOp(usdcContractInstance, 'approve', [swapRouterAddress, amountIn]),
114
- emporiumOp(swapRouterContractInstance, 'exactInputSingle', [swapSingleParams]),
115
- emporiumOp(wethContractInstance, 'withdraw', [amountOut]),
288
+ emporiumOp({ contract: usdcContractInstance, func: 'approve', args: [swapRouterAddress, amountIn] }),
289
+ emporiumOp({ contract: swapRouterContractInstance, func: 'exactInputSingle', args: [swapSingleParams] }),
290
+ emporiumOp({ contract: wethContractInstance, func: 'withdraw', args: [amountOut] }),
116
291
  ];
117
292
  ```
293
+ In this example:
294
+ - First operation approves the swap router to spend USDC tokens
295
+ - Second operation executes the swap from USDC to WETH
296
+ - Third operation unwraps WETH to ETH
118
297
 
119
- To perform a DEX swap, DEX does not need to know historical data about the calling party (e.g. when and what swaps have been performed from this account in the past). It only needs the current token balance for the exchange.
120
298
 
121
- In this case it will be **stateless interaction**, so there is no need to change the default value of the `invokeWallet` flag.
299
+ **Stateful interactions** are operations where the target protocol needs to track the account's history for future calculations, such as staking rewards, voting power, or checkpoints. In these cases, set `invokeWallet: true` to ensure the operation is executed from a persistent wallet address that the protocol can track.
122
300
 
123
- **Stateful interaction**
301
+ Consider a scenario where you have already staked Curve LP tokens and want to claim your rewards. The gauge contract needs to track your staking history to calculate accumulated rewards, so it must recognize the same wallet address across multiple interactions.
124
302
 
125
- Another example is when the protocol with which an account interacts needs to know what actions this account has done before, for example, to gain rewards. In this case, some account state will be required.
126
-
127
- Let's imagine that you already have Curve LP tokens and need to make a stake.
128
-
129
- ```solidity
303
+ ```typescript
130
304
  const operations = [
131
- emporiumOp(lpTokenInstance, 'approve', [gaugeAddressInstance, amount]), // without flag, because is's stateless interaction
132
- emporiumOp(gaugeAddressInstance, 'deposit', [amount, invokeWalletAddress], true), // with flag, because it's stateful interaction
305
+ emporiumOp({ contract: lpTokenInstance, func: 'approve', args: [gaugeAddressInstance, amount], invokeWallet: true }),
306
+ emporiumOp({ contract: gaugeAddressInstance, func: 'deposit', args: [amount, invokeWalletAddress], invokeWallet: true }),
133
307
  ];
134
308
  ```
309
+ In this example:
310
+ - First operation approves the gauge contract to spend LP tokens, executed from the persistent wallet
311
+ - Second operation deposits LP tokens into the gauge, with the wallet address as the recipient for reward tracking
135
312
 
136
- As you can see, in this case `approve` is a stateless interaction, but `deposit` is a stateful interaction, because under the hood Curve will record this address and timestamp in order to calculate the checkpoint correctly in the future.
313
+ ## Access Tokens
137
314
 
138
- ### Access Tokens
315
+ Access tokens are required credentials that allow users to interact with Hinkal's privacy smart contracts. Think of them as a "passport" that proves you've completed the necessary compliance verification.
139
316
 
140
- Before interacting with Hinkal smart contracts, users need to mint an access token after passing compliance checks.
317
+ Before you can deposit funds, make transfers, or perform any private transactions through Hinkal, you must have a valid access token associated with your wallet. This is a one-time requirement—once you have an access token, you can use Hinkal's features without needing to verify again.
141
318
 
142
- To check whether a user already has an access token, use the checkAccessToken function:
319
+ To check whether a user already has an access token on a specific chain, use the `checkAccessToken` function:
143
320
 
144
321
  ```typescript
145
322
  function checkAccessToken(): Promise<boolean>;
146
323
  ```
147
324
 
148
- If the user does not have an access token, they must use one of the compliance providers to pass the check. To view the available providers:
325
+ If the user does not have an access token, they need to complete a compliance verification through one of Hinkal's supported compliance providers. This is a one-time process that verifies the user meets regulatory requirements before they can use the privacy features.
149
326
 
327
+ To get a list of all available compliance providers that can be used for verification:
150
328
  ```typescript
151
329
  function getSupportedPassportLinks(): string[];
152
330
  ```
153
331
 
154
- After passing the compliance check, the user can mint an access token using:
332
+ After passing the compliance check with one of the supported providers, the access token will be automatically minted during the user's first transaction with Hinkal. This token is stored on-chain and grants the user permission to interact with Hinkal's privacy contracts.
155
333
 
156
- ```typescript
157
- const { signatureData } = await hinkal.getAPI().getAccessTokenSignature(chainId, ethereumAddress, accessKey);
158
- await mintAccessToken(this, signatureData);
159
- ```
334
+ ## References
335
+
336
+ Wallet: [Hinkal Wallet](https://chromewebstore.google.com/detail/hinkal-wallet/khfjgapjfcdoffmklchibpepboholpbe)
160
337
 
161
- ### References
338
+ Application: [Private Send](https://send.hinkal.io)
162
339
 
163
- Application: [Hinkal](https://app.hinkal.pro)
164
- Docs: [Hinkal Documentation](https://hinkal-team.gitbook.io/hinkal)
340
+ Docs: [Hinkal Documentation](https://hinkal-team.gitbook.io/hinkal)
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../types/circom-data.types.cjs");const E=require("../types/external-action.types.cjs");require("../types/transactions.types.cjs");require("../types/activities.types.cjs");const a=require("./chains.constants.cjs"),n="0x270B7748CdF8243bFe68FaCE7230ef0fCE695389",c="0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",e={[E.ExternalActionId.Uniswap]:{[a.chainIds.ethMainnet]:"0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",[a.chainIds.polygon]:"0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",[a.chainIds.optimism]:"0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",[a.chainIds.arbMainnet]:"0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",[a.chainIds.bnbMainnet]:"0xB971eF87ede563556b2ED4b1C0b0019111Dd85d2",[a.chainIds.avalanche]:"0xbb00FF08d01D300023C629E8fFfFcb65A5a578cE",[a.chainIds.base]:"0x2626664c2603336E57B271c5C0b26F421741e481"},[E.ExternalActionId.Odos]:{[a.chainIds.ethMainnet]:"0xCf5540fFFCdC3d510B18bFcA6d2b9987b0772559",[a.chainIds.polygon]:"0x4E3288c9ca110bCC82bf38F09A7b425c095d92Bf",[a.chainIds.optimism]:"0xCa423977156BB05b13A2BA3b76Bc5419E2fE9680",[a.chainIds.arbMainnet]:"0xa669e7A0d4b3e4Fa48af2dE86BD4CD7126Be4e13",[a.chainIds.bnbMainnet]:"0x89b8AA89FDd0507a99d334CBe3C808fAFC7d850E",[a.chainIds.avalanche]:"0x88de50B233052e4Fb783d4F6db78Cc34fEa3e9FC",[a.chainIds.base]:"0x19cEeAd7105607Cd444F5ad10dd51356436095a1"},[E.ExternalActionId.OneInch]:{[a.chainIds.ethMainnet]:"0x1111111254EEB25477B68fb85Ed929f73A960582",[a.chainIds.polygon]:"0x1111111254EEB25477B68fb85Ed929f73A960582",[a.chainIds.optimism]:"0x1111111254EEB25477B68fb85Ed929f73A960582",[a.chainIds.arbMainnet]:"0x1111111254EEB25477B68fb85Ed929f73A960582",[a.chainIds.bnbMainnet]:"0x1111111254EEB25477B68fb85Ed929f73A960582",[a.chainIds.avalanche]:"0x1111111254EEB25477B68fb85Ed929f73A960582",[a.chainIds.base]:"0x1111111254EEB25477B68fb85Ed929f73A960582"},[E.ExternalActionId.Lifi]:{[a.chainIds.ethMainnet]:"0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",[a.chainIds.polygon]:"0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",[a.chainIds.optimism]:"0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",[a.chainIds.arbMainnet]:"0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",[a.chainIds.bnbMainnet]:"0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",[a.chainIds.avalanche]:"0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",[a.chainIds.base]:"0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE"}},d={[a.chainIds.ethMainnet]:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",[a.chainIds.polygon]:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",[a.chainIds.optimism]:"0x4200000000000000000000000000000000000006",[a.chainIds.arbMainnet]:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",[a.chainIds.bnbMainnet]:"0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",[a.chainIds.avalanche]:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",[a.chainIds.base]:"0x4200000000000000000000000000000000000006"},i={[a.chainIds.ethMainnet]:"0xdaC7Fb8AC2e47F412e8556Fd13256D90FBae08CD",[a.chainIds.polygon]:"0x9759Baf5eEfa817E3FdF4C488ED51a334e948C05",[a.chainIds.optimism]:"0xDe6A7d13c7E01582F5989b14cdf64d4bc6608364",[a.chainIds.arbMainnet]:"0xF43D84490c6A155f2DDDF501db378D77151590f4",[a.chainIds.bnbMainnet]:"0x5fa6773A7dC2CA3fB411f9Ef157F30e91aa1e53d",[a.chainIds.avalanche]:"0xD201f9ae495b23805C12ed74a816AE4ef0c00b05",[a.chainIds.base]:"0x86B9e7F2698C0776b988085b5Ca8d7D6A1Dff74b"},b={[a.chainIds.ethMainnet]:"0x1D69943ea7D9874b43f9FbcC2B6a4f0f433F602d",[a.chainIds.polygon]:"0x5181606B45302Bb7b83e03DC7c5390ec9e4d973f",[a.chainIds.optimism]:"0x0720a259A8CaBb9ef0F6a6334fEB4da5f45a8579",[a.chainIds.arbMainnet]:"0x7ae4AD3f4D2df012807C3CC50fc0d4bB19Cc9800",[a.chainIds.bnbMainnet]:"0x4200000000000000000000000000000000000000",[a.chainIds.avalanche]:"0x4200000000000000000000000000000000000000",[a.chainIds.base]:"0xB69B207994506697196E5C1Ce40233c06040BB79"};exports.HETH_ERC20_TOKEN_ADDRESS=n;exports.NATIVE_TOKEN_WRAPPER_ADDRESSES=d;exports.SWAP_FEE_TAKER_ADDRESSES=b;exports.SWAP_ROUTER_ADDRESSES=e;exports.WETH_ERC20_TOKEN_ADDRESS=c;exports.WRAPPER_TOKEN_EXCHANGE_ADDRESSES=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../types/circom-data.types.cjs");const E=require("../types/external-action.types.cjs");require("../types/transactions.types.cjs");require("../types/activities.types.cjs");const a=require("./chains.constants.cjs"),n="0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",c={[E.ExternalActionId.Uniswap]:{[a.chainIds.ethMainnet]:"0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",[a.chainIds.polygon]:"0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",[a.chainIds.optimism]:"0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",[a.chainIds.arbMainnet]:"0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",[a.chainIds.bnbMainnet]:"0xB971eF87ede563556b2ED4b1C0b0019111Dd85d2",[a.chainIds.avalanche]:"0xbb00FF08d01D300023C629E8fFfFcb65A5a578cE",[a.chainIds.base]:"0x2626664c2603336E57B271c5C0b26F421741e481"},[E.ExternalActionId.Odos]:{[a.chainIds.ethMainnet]:"0xCf5540fFFCdC3d510B18bFcA6d2b9987b0772559",[a.chainIds.polygon]:"0x4E3288c9ca110bCC82bf38F09A7b425c095d92Bf",[a.chainIds.optimism]:"0xCa423977156BB05b13A2BA3b76Bc5419E2fE9680",[a.chainIds.arbMainnet]:"0xa669e7A0d4b3e4Fa48af2dE86BD4CD7126Be4e13",[a.chainIds.bnbMainnet]:"0x89b8AA89FDd0507a99d334CBe3C808fAFC7d850E",[a.chainIds.avalanche]:"0x88de50B233052e4Fb783d4F6db78Cc34fEa3e9FC",[a.chainIds.base]:"0x19cEeAd7105607Cd444F5ad10dd51356436095a1"},[E.ExternalActionId.OneInch]:{[a.chainIds.ethMainnet]:"0x1111111254EEB25477B68fb85Ed929f73A960582",[a.chainIds.polygon]:"0x1111111254EEB25477B68fb85Ed929f73A960582",[a.chainIds.optimism]:"0x1111111254EEB25477B68fb85Ed929f73A960582",[a.chainIds.arbMainnet]:"0x1111111254EEB25477B68fb85Ed929f73A960582",[a.chainIds.bnbMainnet]:"0x1111111254EEB25477B68fb85Ed929f73A960582",[a.chainIds.avalanche]:"0x1111111254EEB25477B68fb85Ed929f73A960582",[a.chainIds.base]:"0x1111111254EEB25477B68fb85Ed929f73A960582"},[E.ExternalActionId.Lifi]:{[a.chainIds.ethMainnet]:"0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",[a.chainIds.polygon]:"0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",[a.chainIds.optimism]:"0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",[a.chainIds.arbMainnet]:"0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",[a.chainIds.bnbMainnet]:"0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",[a.chainIds.avalanche]:"0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",[a.chainIds.base]:"0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE"}},e={[a.chainIds.ethMainnet]:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",[a.chainIds.polygon]:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",[a.chainIds.optimism]:"0x4200000000000000000000000000000000000006",[a.chainIds.arbMainnet]:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",[a.chainIds.bnbMainnet]:"0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",[a.chainIds.avalanche]:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",[a.chainIds.base]:"0x4200000000000000000000000000000000000006"},d={[a.chainIds.ethMainnet]:"0xdaC7Fb8AC2e47F412e8556Fd13256D90FBae08CD",[a.chainIds.polygon]:"0x9759Baf5eEfa817E3FdF4C488ED51a334e948C05",[a.chainIds.optimism]:"0xDe6A7d13c7E01582F5989b14cdf64d4bc6608364",[a.chainIds.arbMainnet]:"0xF43D84490c6A155f2DDDF501db378D77151590f4",[a.chainIds.bnbMainnet]:"0x5fa6773A7dC2CA3fB411f9Ef157F30e91aa1e53d",[a.chainIds.avalanche]:"0xD201f9ae495b23805C12ed74a816AE4ef0c00b05",[a.chainIds.base]:"0x86B9e7F2698C0776b988085b5Ca8d7D6A1Dff74b"},i={[a.chainIds.ethMainnet]:"0x1D69943ea7D9874b43f9FbcC2B6a4f0f433F602d",[a.chainIds.polygon]:"0x5181606B45302Bb7b83e03DC7c5390ec9e4d973f",[a.chainIds.optimism]:"0x0720a259A8CaBb9ef0F6a6334fEB4da5f45a8579",[a.chainIds.arbMainnet]:"0x7ae4AD3f4D2df012807C3CC50fc0d4bB19Cc9800",[a.chainIds.bnbMainnet]:"0x4200000000000000000000000000000000000000",[a.chainIds.avalanche]:"0x4200000000000000000000000000000000000000",[a.chainIds.base]:"0xB69B207994506697196E5C1Ce40233c06040BB79"};exports.NATIVE_TOKEN_WRAPPER_ADDRESSES=e;exports.SWAP_FEE_TAKER_ADDRESSES=i;exports.SWAP_ROUTER_ADDRESSES=c;exports.WETH_ERC20_TOKEN_ADDRESS=n;exports.WRAPPER_TOKEN_EXCHANGE_ADDRESSES=d;
@@ -1,4 +1,3 @@
1
- export declare const HETH_ERC20_TOKEN_ADDRESS = "0x270B7748CdF8243bFe68FaCE7230ef0fCE695389";
2
1
  export declare const WETH_ERC20_TOKEN_ADDRESS = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2";
3
2
  export declare const SWAP_ROUTER_ADDRESSES: {
4
3
  Uniswap: {
@@ -3,7 +3,7 @@ import { ExternalActionId as a } from "../types/external-action.types.mjs";
3
3
  import "../types/transactions.types.mjs";
4
4
  import "../types/activities.types.mjs";
5
5
  import { chainIds as E } from "./chains.constants.mjs";
6
- const F = "0x270B7748CdF8243bFe68FaCE7230ef0fCE695389", A = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", c = {
6
+ const F = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", A = {
7
7
  [a.Uniswap]: {
8
8
  [E.ethMainnet]: "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",
9
9
  [E.polygon]: "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",
@@ -43,7 +43,7 @@ const F = "0x270B7748CdF8243bFe68FaCE7230ef0fCE695389", A = "0xC02aaA39b223FE8D0
43
43
  [E.avalanche]: "0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",
44
44
  [E.base]: "0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE"
45
45
  }
46
- }, d = {
46
+ }, c = {
47
47
  [E.ethMainnet]: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
48
48
  [E.polygon]: "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",
49
49
  [E.optimism]: "0x4200000000000000000000000000000000000006",
@@ -51,7 +51,7 @@ const F = "0x270B7748CdF8243bFe68FaCE7230ef0fCE695389", A = "0xC02aaA39b223FE8D0
51
51
  [E.bnbMainnet]: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
52
52
  [E.avalanche]: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",
53
53
  [E.base]: "0x4200000000000000000000000000000000000006"
54
- }, C = {
54
+ }, d = {
55
55
  [E.ethMainnet]: "0xdaC7Fb8AC2e47F412e8556Fd13256D90FBae08CD",
56
56
  [E.polygon]: "0x9759Baf5eEfa817E3FdF4C488ED51a334e948C05",
57
57
  [E.optimism]: "0xDe6A7d13c7E01582F5989b14cdf64d4bc6608364",
@@ -71,10 +71,9 @@ const F = "0x270B7748CdF8243bFe68FaCE7230ef0fCE695389", A = "0xC02aaA39b223FE8D0
71
71
  [E.base]: "0xB69B207994506697196E5C1Ce40233c06040BB79"
72
72
  };
73
73
  export {
74
- F as HETH_ERC20_TOKEN_ADDRESS,
75
- d as NATIVE_TOKEN_WRAPPER_ADDRESSES,
74
+ c as NATIVE_TOKEN_WRAPPER_ADDRESSES,
76
75
  x as SWAP_FEE_TAKER_ADDRESSES,
77
- c as SWAP_ROUTER_ADDRESSES,
78
- A as WETH_ERC20_TOKEN_ADDRESS,
79
- C as WRAPPER_TOKEN_EXCHANGE_ADDRESSES
76
+ A as SWAP_ROUTER_ADDRESSES,
77
+ F as WETH_ERC20_TOKEN_ADDRESS,
78
+ d as WRAPPER_TOKEN_EXCHANGE_ADDRESSES
80
79
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./deploy-data/deploy-data-bnbMainnet.json.cjs"),d=require("./deploy-data/deploy-data-arbMainnet.json.cjs"),h=require("./deploy-data/deploy-data-ethMainnet.json.cjs"),u=require("./deploy-data/deploy-data-optimism.json.cjs"),m=require("./deploy-data/deploy-data-polygon.json.cjs"),b=require("./deploy-data/deploy-data-avalanche.json.cjs"),y=require("./deploy-data/deploy-data-base.json.cjs"),A=require("./deploy-data/deploy-data-localhost.json.cjs"),f=require("./deploy-data/deploy-data-arcTestnet.json.cjs"),c=require("./deploy-data/deploy-data-solana.json.cjs"),r=require("./vite.constants.cjs"),t={polygon:137,arbMainnet:42161,ethMainnet:1,avalanche:43114,bnbMainnet:56,optimism:10,base:8453,bnbTestnet:97,polygonMumbai:80001,mainnetSepolia:11155111,optimismSepolia:11155420,localhost:31337,hardhat:31337,arcTestnet:5042002,solanaMainnet:501,solanaLocalnet:102},D="4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ",n=t.ethMainnet,s=a=>!![t.localhost].includes(a),E=a=>a?s(a)?n:a:n,i="X4IiEZsSzGOrJq8tzq7Y3",e=r.isNotProduction?i:"XzUgeU8YiIIzkD7j2GWnTsFUck7wGgK9",F="https://mainnet.helius-rpc.com/?api-key=24718f72-c710-45d6-853e-d447cf530579",o={[t.ethMainnet]:{name:"Ethereum",chainId:t.ethMainnet,rpcUrl:"https://rpc.ankr.com/eth",fetchRpcUrl:`https://eth-mainnet.g.alchemy.com/v2/${e}`,supported:!0,contractData:h.default,quoterV2Address:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",uniswapV3FactoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",priority:1,privateMempoolRpcUrl:"https://relay.flashbots.net"},[t.arbMainnet]:{name:"Arbitrum",chainId:t.arbMainnet,rpcUrl:"https://endpoints.omniatech.io/v1/arbitrum/one/public",fetchRpcUrl:`https://arb-mainnet.g.alchemy.com/v2/${e}`,supported:!0,contractData:d.default,quoterV2Address:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",uniswapV3FactoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",priority:2},[t.optimism]:{name:"Optimism",chainId:t.optimism,rpcUrl:"https://optimism-mainnet.infura.io/v3/c26b99456bb6464bb498926ff5162903",fetchRpcUrl:`https://opt-mainnet.g.alchemy.com/v2/${e}`,supported:!0,contractData:u.default,quoterV2Address:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",uniswapV3FactoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",priority:3},[t.polygon]:{name:"Polygon",chainId:t.polygon,rpcUrl:"https://polygon-rpc.com",fetchRpcUrl:`https://polygon-mainnet.g.alchemy.com/v2/${e}`,supported:!0,contractData:m.default,quoterV2Address:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",uniswapV3FactoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",priority:4,maxPageSize:1e6},[t.avalanche]:{name:"Avalanche",chainId:t.avalanche,rpcUrl:"https://api.avax.network/ext/bc/C/rpc",fetchRpcUrl:`https://avax-mainnet.g.alchemy.com/v2/${e}`,supported:!0,contractData:b.default,quoterV2Address:"0xbe0F5544EC67e9B3b2D979aaA43f18Fd87E6257F",uniswapV3FactoryAddress:"0x740b1c1de25031C31FF4fC9A62f554A55cdC1baD",priority:5},[t.bnbMainnet]:{name:"BNB Chain",chainId:t.bnbMainnet,rpcUrl:"https://bsc-dataseed.binance.org",fetchRpcUrl:`https://bnb-mainnet.g.alchemy.com/v2/${e}`,supported:!0,contractData:l.default,quoterV2Address:"0x78D78E420Da98ad378D7799bE8f4AF69033EB077",uniswapV3FactoryAddress:"0xdB1d10011AD0Ff90774D0C6Bb92e5C5c8b4461F7",priority:6},[t.base]:{name:"Base",chainId:t.base,rpcUrl:"https://mainnet.base.org/",fetchRpcUrl:`https://base-mainnet.g.alchemy.com/v2/${e}`,supported:!0,contractData:y.default,quoterV2Address:"0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a",uniswapV3FactoryAddress:"0x33128a8fC17869897dcE68Ed026d694621f6FDfD",priority:7},[t.arcTestnet]:{name:"Arc Testnet",chainId:t.arcTestnet,rpcUrl:`https://arc-testnet.g.alchemy.com/v2/${e}`,fetchRpcUrl:`https://arc-testnet.g.alchemy.com/v2/${e}`,supported:!0,contractData:f.default,priority:8,maxPageSize:9999},[t.solanaMainnet]:{name:"Solana",chainId:t.solanaMainnet,rpcUrl:"https://api.mainnet-beta.solana.com",fetchRpcUrl:"https://wider-side-sunset.solana-mainnet.quiknode.pro/61054262c1a2b13dd570243c5fdd017c05cf7fe1",supported:!0,contractData:c.default,priority:8},[t.solanaLocalnet]:{name:"Solana Localnet",chainId:t.solanaLocalnet,rpcUrl:"http://127.0.0.1:8899",fetchRpcUrl:"http://127.0.0.1:8899",supported:!0,contractData:c.default,priority:9},...r.isDevelopment?{}:{}},L={name:"Localhost",chainId:t.localhost,rpcUrl:"http://127.0.0.1:8545",fetchRpcUrl:"http://127.0.0.1:8545",supported:!0,contractData:A.default,quoterV2Address:o[n].quoterV2Address,uniswapV3FactoryAddress:o[n].uniswapV3FactoryAddress,priority:7};r.isDevelopment&&(o[t.localhost]=L);var p=(a=>(a.Mainnet="Mainnet",a.Testnet="Testnet",a.Local="Local",a))(p||{});const I={Mainnet:[t.polygon,t.arbMainnet,t.ethMainnet,t.bnbMainnet,t.optimism,t.avalanche,t.base],Testnet:[t.bnbTestnet,t.polygonMumbai,t.arcTestnet],Local:[t.localhost]},M=a=>[t.optimism,t.base].includes(a),U=a=>[t.solanaMainnet,t.solanaLocalnet].includes(a),g=t.ethMainnet,T=[t.ethMainnet,t.optimism,t.base,t.polygon,t.arbMainnet,t.arcTestnet,t.solanaMainnet];exports.ALCHEMY_API_KEY=e;exports.ALCHEMY_TEST_KEY=i;exports.EthereumNetworkType=p;exports.HELIUS_RPC_URL=F;exports.WALLET_INITIAL_CHAIN_ID=g;exports.WALLET_SUPPORTED_CHAINS=T;exports.chainIds=t;exports.chainIdsByType=I;exports.getNonLocalhostChainId=E;exports.isLocalNetwork=s;exports.isOptimismLike=M;exports.isSolanaLike=U;exports.localhostNetwork=n;exports.networkRegistry=o;exports.solanaChainIdStr=D;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./deploy-data/deploy-data-bnbMainnet.json.cjs"),d=require("./deploy-data/deploy-data-arbMainnet.json.cjs"),h=require("./deploy-data/deploy-data-ethMainnet.json.cjs"),u=require("./deploy-data/deploy-data-optimism.json.cjs"),m=require("./deploy-data/deploy-data-polygon.json.cjs"),b=require("./deploy-data/deploy-data-avalanche.json.cjs"),y=require("./deploy-data/deploy-data-base.json.cjs"),A=require("./deploy-data/deploy-data-localhost.json.cjs"),f=require("./deploy-data/deploy-data-arcTestnet.json.cjs"),c=require("./deploy-data/deploy-data-solana.json.cjs"),o=require("./vite.constants.cjs"),t={polygon:137,arbMainnet:42161,ethMainnet:1,avalanche:43114,bnbMainnet:56,optimism:10,base:8453,localhost:31337,arcTestnet:5042002,solanaMainnet:501,solanaLocalnet:102},D="4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ",n=t.ethMainnet,s=a=>!![t.localhost].includes(a),E=a=>a?s(a)?n:a:n,i="X4IiEZsSzGOrJq8tzq7Y3",e=o.isNotProduction?i:"XzUgeU8YiIIzkD7j2GWnTsFUck7wGgK9",F="https://mainnet.helius-rpc.com/?api-key=24718f72-c710-45d6-853e-d447cf530579",r={[t.ethMainnet]:{name:"Ethereum",chainId:t.ethMainnet,rpcUrl:"https://rpc.ankr.com/eth",fetchRpcUrl:`https://eth-mainnet.g.alchemy.com/v2/${e}`,supported:!0,contractData:h.default,quoterV2Address:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",uniswapV3FactoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",priority:1,privateMempoolRpcUrl:"https://relay.flashbots.net"},[t.arbMainnet]:{name:"Arbitrum",chainId:t.arbMainnet,rpcUrl:"https://endpoints.omniatech.io/v1/arbitrum/one/public",fetchRpcUrl:`https://arb-mainnet.g.alchemy.com/v2/${e}`,supported:!0,contractData:d.default,quoterV2Address:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",uniswapV3FactoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",priority:2},[t.optimism]:{name:"Optimism",chainId:t.optimism,rpcUrl:"https://optimism-mainnet.infura.io/v3/c26b99456bb6464bb498926ff5162903",fetchRpcUrl:`https://opt-mainnet.g.alchemy.com/v2/${e}`,supported:!0,contractData:u.default,quoterV2Address:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",uniswapV3FactoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",priority:3},[t.polygon]:{name:"Polygon",chainId:t.polygon,rpcUrl:"https://polygon-rpc.com",fetchRpcUrl:`https://polygon-mainnet.g.alchemy.com/v2/${e}`,supported:!0,contractData:m.default,quoterV2Address:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",uniswapV3FactoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",priority:4,maxPageSize:1e6},[t.avalanche]:{name:"Avalanche",chainId:t.avalanche,rpcUrl:"https://api.avax.network/ext/bc/C/rpc",fetchRpcUrl:`https://avax-mainnet.g.alchemy.com/v2/${e}`,supported:!0,contractData:b.default,quoterV2Address:"0xbe0F5544EC67e9B3b2D979aaA43f18Fd87E6257F",uniswapV3FactoryAddress:"0x740b1c1de25031C31FF4fC9A62f554A55cdC1baD",priority:5},[t.bnbMainnet]:{name:"BNB Chain",chainId:t.bnbMainnet,rpcUrl:"https://bsc-dataseed.binance.org",fetchRpcUrl:`https://bnb-mainnet.g.alchemy.com/v2/${e}`,supported:!0,contractData:l.default,quoterV2Address:"0x78D78E420Da98ad378D7799bE8f4AF69033EB077",uniswapV3FactoryAddress:"0xdB1d10011AD0Ff90774D0C6Bb92e5C5c8b4461F7",priority:6},[t.base]:{name:"Base",chainId:t.base,rpcUrl:"https://mainnet.base.org/",fetchRpcUrl:`https://base-mainnet.g.alchemy.com/v2/${e}`,supported:!0,contractData:y.default,quoterV2Address:"0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a",uniswapV3FactoryAddress:"0x33128a8fC17869897dcE68Ed026d694621f6FDfD",priority:7},[t.arcTestnet]:{name:"Arc Testnet",chainId:t.arcTestnet,rpcUrl:`https://arc-testnet.g.alchemy.com/v2/${e}`,fetchRpcUrl:`https://arc-testnet.g.alchemy.com/v2/${e}`,supported:!0,contractData:f.default,priority:8,maxPageSize:9999},[t.solanaMainnet]:{name:"Solana",chainId:t.solanaMainnet,rpcUrl:"https://api.mainnet-beta.solana.com",fetchRpcUrl:"https://wider-side-sunset.solana-mainnet.quiknode.pro/61054262c1a2b13dd570243c5fdd017c05cf7fe1",supported:!0,contractData:c.default,priority:8},[t.solanaLocalnet]:{name:"Solana Localnet",chainId:t.solanaLocalnet,rpcUrl:"http://127.0.0.1:8899",fetchRpcUrl:"http://127.0.0.1:8899",supported:!0,contractData:c.default,priority:9},...o.isDevelopment?{}:{}},L={name:"Localhost",chainId:t.localhost,rpcUrl:"http://127.0.0.1:8545",fetchRpcUrl:"http://127.0.0.1:8545",supported:!0,contractData:A.default,quoterV2Address:r[n].quoterV2Address,uniswapV3FactoryAddress:r[n].uniswapV3FactoryAddress,priority:7};o.isDevelopment&&(r[t.localhost]=L);var p=(a=>(a.Mainnet="Mainnet",a.Testnet="Testnet",a.Local="Local",a))(p||{});const I={Mainnet:[t.polygon,t.arbMainnet,t.ethMainnet,t.bnbMainnet,t.optimism,t.avalanche,t.base],Testnet:[t.arcTestnet],Local:[t.localhost]},M=a=>[t.optimism,t.base].includes(a),U=a=>[t.solanaMainnet,t.solanaLocalnet].includes(a),g=t.ethMainnet,v=[t.ethMainnet,t.optimism,t.base,t.polygon,t.arbMainnet,t.arcTestnet];exports.ALCHEMY_API_KEY=e;exports.ALCHEMY_TEST_KEY=i;exports.EthereumNetworkType=p;exports.HELIUS_RPC_URL=F;exports.WALLET_INITIAL_CHAIN_ID=g;exports.WALLET_SUPPORTED_CHAINS=v;exports.chainIds=t;exports.chainIdsByType=I;exports.getNonLocalhostChainId=E;exports.isLocalNetwork=s;exports.isOptimismLike=M;exports.isSolanaLike=U;exports.localhostNetwork=n;exports.networkRegistry=r;exports.solanaChainIdStr=D;
@@ -7,12 +7,7 @@ export declare const chainIds: {
7
7
  bnbMainnet: number;
8
8
  optimism: number;
9
9
  base: number;
10
- bnbTestnet: number;
11
- polygonMumbai: number;
12
- mainnetSepolia: number;
13
- optimismSepolia: number;
14
10
  localhost: number;
15
- hardhat: number;
16
11
  arcTestnet: number;
17
12
  solanaMainnet: number;
18
13
  solanaLocalnet: number;
@@ -3,11 +3,11 @@ import i from "./deploy-data/deploy-data-arbMainnet.json.mjs";
3
3
  import p from "./deploy-data/deploy-data-ethMainnet.json.mjs";
4
4
  import l from "./deploy-data/deploy-data-optimism.json.mjs";
5
5
  import m from "./deploy-data/deploy-data-polygon.json.mjs";
6
- import h from "./deploy-data/deploy-data-avalanche.json.mjs";
7
- import d from "./deploy-data/deploy-data-base.json.mjs";
6
+ import d from "./deploy-data/deploy-data-avalanche.json.mjs";
7
+ import h from "./deploy-data/deploy-data-base.json.mjs";
8
8
  import b from "./deploy-data/deploy-data-localhost.json.mjs";
9
9
  import u from "./deploy-data/deploy-data-arcTestnet.json.mjs";
10
- import r from "./deploy-data/deploy-data-solana.json.mjs";
10
+ import o from "./deploy-data/deploy-data-solana.json.mjs";
11
11
  import { isDevelopment as c, isNotProduction as f } from "./vite.constants.mjs";
12
12
  const t = {
13
13
  polygon: 137,
@@ -17,19 +17,14 @@ const t = {
17
17
  bnbMainnet: 56,
18
18
  optimism: 10,
19
19
  base: 8453,
20
- bnbTestnet: 97,
21
- polygonMumbai: 80001,
22
- mainnetSepolia: 11155111,
23
- optimismSepolia: 11155420,
24
20
  localhost: 31337,
25
- hardhat: 31337,
26
21
  arcTestnet: 5042002,
27
22
  // Custom numeric IDs reserved for Solana clusters to avoid collision with any EVM chain IDs
28
23
  // These values are chosen from the commonly referenced Solana cluster identifiers and
29
24
  // are not used by any known EVM networks in this codebase
30
25
  solanaMainnet: 501,
31
26
  solanaLocalnet: 102
32
- }, V = "4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ", n = t.ethMainnet, y = (a) => !![t.localhost].includes(a), R = (a) => a ? y(a) ? n : a : n, A = "X4IiEZsSzGOrJq8tzq7Y3", e = f ? A : "XzUgeU8YiIIzkD7j2GWnTsFUck7wGgK9", w = "https://mainnet.helius-rpc.com/?api-key=24718f72-c710-45d6-853e-d447cf530579", o = {
27
+ }, R = "4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ", n = t.ethMainnet, y = (a) => !![t.localhost].includes(a), T = (a) => a ? y(a) ? n : a : n, A = "X4IiEZsSzGOrJq8tzq7Y3", e = f ? A : "XzUgeU8YiIIzkD7j2GWnTsFUck7wGgK9", w = "https://mainnet.helius-rpc.com/?api-key=24718f72-c710-45d6-853e-d447cf530579", r = {
33
28
  [t.ethMainnet]: {
34
29
  name: "Ethereum",
35
30
  chainId: t.ethMainnet,
@@ -82,7 +77,7 @@ const t = {
82
77
  rpcUrl: "https://api.avax.network/ext/bc/C/rpc",
83
78
  fetchRpcUrl: `https://avax-mainnet.g.alchemy.com/v2/${e}`,
84
79
  supported: !0,
85
- contractData: h,
80
+ contractData: d,
86
81
  quoterV2Address: "0xbe0F5544EC67e9B3b2D979aaA43f18Fd87E6257F",
87
82
  uniswapV3FactoryAddress: "0x740b1c1de25031C31FF4fC9A62f554A55cdC1baD",
88
83
  priority: 5
@@ -106,7 +101,7 @@ const t = {
106
101
  // maxPageSize: 1000,
107
102
  fetchRpcUrl: `https://base-mainnet.g.alchemy.com/v2/${e}`,
108
103
  supported: !0,
109
- contractData: d,
104
+ contractData: h,
110
105
  quoterV2Address: "0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a",
111
106
  uniswapV3FactoryAddress: "0x33128a8fC17869897dcE68Ed026d694621f6FDfD",
112
107
  priority: 7
@@ -127,7 +122,7 @@ const t = {
127
122
  rpcUrl: "https://api.mainnet-beta.solana.com",
128
123
  fetchRpcUrl: "https://wider-side-sunset.solana-mainnet.quiknode.pro/61054262c1a2b13dd570243c5fdd017c05cf7fe1",
129
124
  supported: !0,
130
- contractData: r,
125
+ contractData: o,
131
126
  priority: 8
132
127
  },
133
128
  [t.solanaLocalnet]: {
@@ -136,7 +131,7 @@ const t = {
136
131
  rpcUrl: "http://127.0.0.1:8899",
137
132
  fetchRpcUrl: "http://127.0.0.1:8899",
138
133
  supported: !0,
139
- contractData: r,
134
+ contractData: o,
140
135
  priority: 9
141
136
  },
142
137
  ...c ? {} : {}
@@ -147,13 +142,13 @@ const t = {
147
142
  fetchRpcUrl: "http://127.0.0.1:8545",
148
143
  supported: !0,
149
144
  contractData: b,
150
- quoterV2Address: o[n].quoterV2Address,
151
- uniswapV3FactoryAddress: o[n].uniswapV3FactoryAddress,
145
+ quoterV2Address: r[n].quoterV2Address,
146
+ uniswapV3FactoryAddress: r[n].uniswapV3FactoryAddress,
152
147
  priority: 7
153
148
  };
154
- c && (o[t.localhost] = D);
149
+ c && (r[t.localhost] = D);
155
150
  var F = /* @__PURE__ */ ((a) => (a.Mainnet = "Mainnet", a.Testnet = "Testnet", a.Local = "Local", a))(F || {});
156
- const S = {
151
+ const q = {
157
152
  Mainnet: [
158
153
  t.polygon,
159
154
  t.arbMainnet,
@@ -163,16 +158,16 @@ const S = {
163
158
  t.avalanche,
164
159
  t.base
165
160
  ],
166
- Testnet: [t.bnbTestnet, t.polygonMumbai, t.arcTestnet],
161
+ Testnet: [t.arcTestnet],
167
162
  Local: [t.localhost]
168
- }, q = (a) => [t.optimism, t.base].includes(a), _ = (a) => [t.solanaMainnet, t.solanaLocalnet].includes(a), k = t.ethMainnet, $ = [
163
+ }, S = (a) => [t.optimism, t.base].includes(a), _ = (a) => [t.solanaMainnet, t.solanaLocalnet].includes(a), k = t.ethMainnet, $ = [
169
164
  t.ethMainnet,
170
165
  t.optimism,
171
166
  t.base,
172
167
  t.polygon,
173
168
  t.arbMainnet,
174
- t.arcTestnet,
175
- t.solanaMainnet
169
+ t.arcTestnet
170
+ // chainIds.solanaMainnet,
176
171
  ];
177
172
  export {
178
173
  e as ALCHEMY_API_KEY,
@@ -182,12 +177,12 @@ export {
182
177
  k as WALLET_INITIAL_CHAIN_ID,
183
178
  $ as WALLET_SUPPORTED_CHAINS,
184
179
  t as chainIds,
185
- S as chainIdsByType,
186
- R as getNonLocalhostChainId,
180
+ q as chainIdsByType,
181
+ T as getNonLocalhostChainId,
187
182
  y as isLocalNetwork,
188
- q as isOptimismLike,
183
+ S as isOptimismLike,
189
184
  _ as isSolanaLike,
190
185
  n as localhostNetwork,
191
- o as networkRegistry,
192
- V as solanaChainIdStr
186
+ r as networkRegistry,
187
+ R as solanaChainIdStr
193
188
  };