@hinkal/common 0.2.18 → 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 (454) 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/index.d.ts +0 -3
  43. package/API/is-tx-stateless.cjs +1 -1
  44. package/API/is-tx-stateless.d.ts +1 -1
  45. package/API/is-tx-stateless.mjs +10 -12
  46. package/API/kycCalls.cjs +1 -1
  47. package/API/kycCalls.d.ts +4 -8
  48. package/API/kycCalls.mjs +23 -26
  49. package/API/onrampCalls.cjs +1 -0
  50. package/API/onrampCalls.d.ts +20 -0
  51. package/API/onrampCalls.mjs +15 -0
  52. package/API/proxyAccountsCalls.cjs +1 -1
  53. package/API/proxyAccountsCalls.d.ts +2 -2
  54. package/API/proxyAccountsCalls.mjs +19 -19
  55. package/API/relayCalls.cjs +1 -1
  56. package/API/relayCalls.mjs +4 -4
  57. package/API/scheduled-transactions-calls.cjs +1 -1
  58. package/API/scheduled-transactions-calls.d.ts +1 -1
  59. package/API/scheduled-transactions-calls.mjs +4 -4
  60. package/API/simulate-batch-tx.cjs +1 -1
  61. package/API/simulate-batch-tx.d.ts +2 -2
  62. package/API/simulate-batch-tx.mjs +7 -6
  63. package/API/solana-calls.cjs +1 -1
  64. package/API/solana-calls.d.ts +6 -3
  65. package/API/solana-calls.mjs +15 -15
  66. package/API/token-calls.cjs +1 -1
  67. package/API/token-calls.mjs +6 -5
  68. package/API/unspent-utxos-calls.cjs +1 -1
  69. package/API/unspent-utxos-calls.d.ts +1 -1
  70. package/API/unspent-utxos-calls.mjs +15 -18
  71. package/README.md +233 -64
  72. package/constants/addresses.constants.cjs +1 -1
  73. package/constants/addresses.constants.d.ts +0 -1
  74. package/constants/addresses.constants.mjs +7 -8
  75. package/constants/chains.constants.cjs +1 -1
  76. package/constants/chains.constants.d.ts +0 -5
  77. package/constants/chains.constants.mjs +19 -24
  78. package/constants/coingecko.constants.cjs +1 -1
  79. package/constants/coingecko.constants.d.ts +1 -0
  80. package/constants/coingecko.constants.mjs +11 -10
  81. package/constants/contracts.constants.cjs +1 -1
  82. package/constants/contracts.constants.mjs +34 -41
  83. package/constants/function-signatures.constants.cjs +1 -1
  84. package/constants/function-signatures.constants.d.ts +0 -1
  85. package/constants/function-signatures.constants.mjs +3 -4
  86. package/constants/mystery-boxes.constants.d.ts +0 -0
  87. package/constants/permit2.constants.cjs +1 -1
  88. package/constants/permit2.constants.d.ts +0 -1
  89. package/constants/permit2.constants.mjs +10 -11
  90. package/constants/server.constants.cjs +1 -1
  91. package/constants/server.constants.d.ts +14 -122
  92. package/constants/server.constants.mjs +44 -152
  93. package/constants/token-data/ethMainnetRegistry.json.cjs +1 -1
  94. package/constants/token-data/ethMainnetRegistry.json.mjs +0 -24
  95. package/constants/token-data/ethMainnetRegistryFixed.json.cjs +1 -1
  96. package/constants/token-data/ethMainnetRegistryFixed.json.mjs +0 -24
  97. package/constants/token-data/index.d.ts +32 -88
  98. package/constants/token-data/localhostRegistry.json.cjs +1 -1
  99. package/constants/token-data/localhostRegistry.json.mjs +0 -26
  100. package/constants/token-data/popularTokens.constants.cjs +1 -1
  101. package/constants/token-data/popularTokens.constants.mjs +0 -1
  102. package/data-structures/Hinkal/Hinkal.cjs +1 -1
  103. package/data-structures/Hinkal/Hinkal.d.ts +33 -48
  104. package/data-structures/Hinkal/Hinkal.mjs +237 -300
  105. package/data-structures/Hinkal/IHinkal.d.ts +32 -47
  106. package/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
  107. package/data-structures/Hinkal/handleAutoDepositBack.d.ts +1 -1
  108. package/data-structures/Hinkal/handleAutoDepositBack.mjs +42 -42
  109. package/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
  110. package/data-structures/Hinkal/hinkalActionReceive.mjs +25 -23
  111. package/data-structures/Hinkal/hinkalCheckTokenRegistry.cjs +1 -1
  112. package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +9 -9
  113. package/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
  114. package/data-structures/Hinkal/hinkalDeposit.mjs +95 -93
  115. package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
  116. package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +111 -115
  117. package/data-structures/Hinkal/hinkalGetZkMeProvider.cjs +1 -1
  118. package/data-structures/Hinkal/hinkalGetZkMeProvider.mjs +1 -2
  119. package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
  120. package/data-structures/Hinkal/hinkalPrivateWallet.d.ts +1 -1
  121. package/data-structures/Hinkal/hinkalPrivateWallet.mjs +107 -115
  122. package/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -1
  123. package/data-structures/Hinkal/hinkalProoflessDeposit.mjs +36 -34
  124. package/data-structures/Hinkal/hinkalProxySwap.cjs +1 -1
  125. package/data-structures/Hinkal/hinkalProxySwap.mjs +34 -33
  126. package/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -1
  127. package/data-structures/Hinkal/hinkalProxyToPrivate.mjs +26 -24
  128. package/data-structures/Hinkal/hinkalSignSubAccount.cjs +1 -1
  129. package/data-structures/Hinkal/hinkalSignSubAccount.d.ts +1 -2
  130. package/data-structures/Hinkal/hinkalSignSubAccount.mjs +8 -9
  131. package/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
  132. package/data-structures/Hinkal/hinkalSolanaDeposit.d.ts +4 -3
  133. package/data-structures/Hinkal/hinkalSolanaDeposit.mjs +86 -97
  134. package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
  135. package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +2 -1
  136. package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +146 -146
  137. package/data-structures/Hinkal/hinkalSolanaProxySend.cjs +1 -1
  138. package/data-structures/Hinkal/hinkalSolanaProxySend.d.ts +2 -3
  139. package/data-structures/Hinkal/hinkalSolanaProxySend.mjs +38 -38
  140. package/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
  141. package/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +57 -56
  142. package/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
  143. package/data-structures/Hinkal/hinkalSolanaProxySwap.d.ts +1 -1
  144. package/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +59 -58
  145. package/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
  146. package/data-structures/Hinkal/hinkalSolanaSwap.d.ts +1 -1
  147. package/data-structures/Hinkal/hinkalSolanaSwap.mjs +83 -79
  148. package/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
  149. package/data-structures/Hinkal/hinkalSolanaTransfer.mjs +49 -48
  150. package/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
  151. package/data-structures/Hinkal/hinkalSolanaWithdraw.d.ts +2 -1
  152. package/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +67 -64
  153. package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
  154. package/data-structures/Hinkal/hinkalSwap.mjs +75 -87
  155. package/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
  156. package/data-structures/Hinkal/hinkalTransfer.mjs +55 -58
  157. package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
  158. package/data-structures/Hinkal/hinkalWithdraw.mjs +80 -82
  159. package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
  160. package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +98 -102
  161. package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
  162. package/data-structures/Hinkal/resetMerkleTrees.d.ts +1 -1
  163. package/data-structures/Hinkal/resetMerkleTrees.mjs +105 -53
  164. package/data-structures/IndexedDB/activity-db.cjs +1 -1
  165. package/data-structures/IndexedDB/activity-db.mjs +7 -7
  166. package/data-structures/IndexedDB/balances-db.cjs +1 -1
  167. package/data-structures/IndexedDB/balances-db.mjs +8 -8
  168. package/data-structures/IndexedDB/contact-db.cjs +1 -1
  169. package/data-structures/IndexedDB/contact-db.mjs +10 -10
  170. package/data-structures/IndexedDB/signatures-db.cjs +1 -1
  171. package/data-structures/IndexedDB/signatures-db.mjs +25 -40
  172. package/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
  173. package/data-structures/TokenDBs/EventsPublicTokensDB.mjs +10 -11
  174. package/data-structures/TokenDBs/token-visibility-db.cjs +1 -1
  175. package/data-structures/TokenDBs/token-visibility-db.mjs +22 -36
  176. package/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
  177. package/data-structures/crypto-keys/encryptDecryptUtxo.d.ts +1 -1
  178. package/data-structures/crypto-keys/encryptDecryptUtxo.mjs +14 -14
  179. package/data-structures/event-service/evm/AbstractEventService.cjs +1 -1
  180. package/data-structures/event-service/evm/AbstractEventService.d.ts +1 -0
  181. package/data-structures/event-service/evm/AbstractEventService.mjs +7 -4
  182. package/data-structures/event-service/evm/AbstractSnapshotService.cjs +1 -1
  183. package/data-structures/event-service/evm/AbstractSnapshotService.d.ts +0 -1
  184. package/data-structures/event-service/evm/AbstractSnapshotService.mjs +3 -4
  185. package/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
  186. package/data-structures/event-service/evm/BlockchainEventEmitter.d.ts +3 -1
  187. package/data-structures/event-service/evm/BlockchainEventEmitter.mjs +17 -14
  188. package/data-structures/event-service/solana/AbstractSolanaEventService.cjs +1 -1
  189. package/data-structures/event-service/solana/AbstractSolanaEventService.d.ts +1 -0
  190. package/data-structures/event-service/solana/AbstractSolanaEventService.mjs +9 -6
  191. package/data-structures/event-service/solana/AbstractSolanaSnapshotService.cjs +1 -1
  192. package/data-structures/event-service/solana/AbstractSolanaSnapshotService.d.ts +0 -1
  193. package/data-structures/event-service/solana/AbstractSolanaSnapshotService.mjs +1 -2
  194. package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.cjs +1 -1
  195. package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.d.ts +3 -2
  196. package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.mjs +42 -45
  197. package/data-structures/provider-adapter/IProviderAdapter.d.ts +8 -13
  198. package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.cjs +1 -1
  199. package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.mjs +3 -4
  200. package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.cjs +1 -1
  201. package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.mjs +3 -4
  202. package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.cjs +1 -1
  203. package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.mjs +3 -4
  204. package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.cjs +1 -1
  205. package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.mjs +3 -4
  206. package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.cjs +1 -1
  207. package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.mjs +3 -4
  208. package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.cjs +1 -1
  209. package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.mjs +2 -4
  210. package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.cjs +1 -1
  211. package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.mjs +3 -4
  212. package/data-structures/utxo/Utxo.cjs +1 -1
  213. package/data-structures/utxo/Utxo.d.ts +1 -7
  214. package/data-structures/utxo/Utxo.mjs +26 -36
  215. package/error-handling/error-codes.constants.cjs +1 -1
  216. package/error-handling/error-codes.constants.d.ts +1 -0
  217. package/error-handling/error-codes.constants.mjs +2 -1
  218. package/error-handling/get-error.message.cjs +1 -1
  219. package/error-handling/get-error.message.mjs +21 -27
  220. package/error-handling/index.d.ts +0 -1
  221. package/functions/index.d.ts +0 -1
  222. package/functions/kyc/zkMeHelper.cjs +1 -1
  223. package/functions/kyc/zkMeHelper.mjs +18 -17
  224. package/functions/pre-transaction/constructAdminData.cjs +1 -1
  225. package/functions/pre-transaction/constructAdminData.d.ts +2 -2
  226. package/functions/pre-transaction/constructAdminData.mjs +12 -18
  227. package/functions/pre-transaction/getExternalSwapAddress.cjs +1 -1
  228. package/functions/pre-transaction/getExternalSwapAddress.d.ts +1 -2
  229. package/functions/pre-transaction/getExternalSwapAddress.mjs +8 -8
  230. package/functions/pre-transaction/getFlatFees.cjs +1 -1
  231. package/functions/pre-transaction/getFlatFees.mjs +22 -30
  232. package/functions/pre-transaction/getVolatileTransferAmount.cjs +1 -1
  233. package/functions/pre-transaction/getVolatileTransferAmount.mjs +21 -36
  234. package/functions/pre-transaction/merge-with-fee-structure-emporium.cjs +1 -1
  235. package/functions/pre-transaction/merge-with-fee-structure-emporium.d.ts +1 -1
  236. package/functions/pre-transaction/merge-with-fee-structure-emporium.mjs +17 -17
  237. package/functions/pre-transaction/outputApprovalDataProcessing.cjs +1 -1
  238. package/functions/pre-transaction/outputApprovalDataProcessing.d.ts +1 -9
  239. package/functions/pre-transaction/outputApprovalDataProcessing.mjs +19 -34
  240. package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs +1 -1
  241. package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.d.ts +1 -1
  242. package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs +4 -4
  243. package/functions/pre-transaction/solana-public-signals.cjs +1 -1
  244. package/functions/pre-transaction/solana-public-signals.d.ts +1 -0
  245. package/functions/pre-transaction/solana-public-signals.mjs +29 -26
  246. package/functions/pre-transaction/solana.cjs +1 -1
  247. package/functions/pre-transaction/solana.d.ts +2 -1
  248. package/functions/pre-transaction/solana.mjs +60 -51
  249. package/functions/private-wallet/emporium.helpers.cjs +1 -1
  250. package/functions/private-wallet/emporium.helpers.d.ts +3 -5
  251. package/functions/private-wallet/emporium.helpers.mjs +95 -135
  252. package/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
  253. package/functions/private-wallet/emporium.swap.helpers.d.ts +1 -4
  254. package/functions/private-wallet/emporium.swap.helpers.mjs +100 -102
  255. package/functions/snarkjs/common.snarkjs.cjs +1 -1
  256. package/functions/snarkjs/common.snarkjs.d.ts +1 -1
  257. package/functions/snarkjs/common.snarkjs.mjs +64 -64
  258. package/functions/snarkjs/constructEmporiumProof.cjs +1 -1
  259. package/functions/snarkjs/constructEmporiumProof.mjs +1 -1
  260. package/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
  261. package/functions/snarkjs/constructGeneralZkProof.d.ts +1 -2
  262. package/functions/snarkjs/constructGeneralZkProof.mjs +117 -121
  263. package/functions/snarkjs/constructSolanaZkProof.cjs +1 -1
  264. package/functions/snarkjs/constructSolanaZkProof.d.ts +1 -1
  265. package/functions/snarkjs/constructSolanaZkProof.mjs +54 -59
  266. package/functions/snarkjs/fetchMerkleTreeSiblings.cjs +1 -1
  267. package/functions/snarkjs/fetchMerkleTreeSiblings.mjs +11 -10
  268. package/functions/utils/addresses.cjs +1 -1
  269. package/functions/utils/addresses.d.ts +1 -0
  270. package/functions/utils/addresses.mjs +13 -12
  271. package/functions/utils/cacheFunctions.cjs +1 -1
  272. package/functions/utils/cacheFunctions.mjs +2 -2
  273. package/functions/utils/erc20tokenFunctions.cjs +1 -1
  274. package/functions/utils/erc20tokenFunctions.d.ts +0 -1
  275. package/functions/utils/erc20tokenFunctions.mjs +22 -29
  276. package/functions/utils/get-hinkal-approvals.cjs +1 -1
  277. package/functions/utils/get-hinkal-approvals.d.ts +1 -1
  278. package/functions/utils/get-hinkal-approvals.mjs +16 -16
  279. package/functions/utils/getUtxosFromReceipt.utils.cjs +1 -1
  280. package/functions/utils/getUtxosFromReceipt.utils.d.ts +1 -1
  281. package/functions/utils/getUtxosFromReceipt.utils.mjs +11 -11
  282. package/functions/utils/involves-permit2-op.cjs +1 -1
  283. package/functions/utils/involves-permit2-op.d.ts +0 -1
  284. package/functions/utils/involves-permit2-op.mjs +4 -6
  285. package/functions/utils/mutexes.utils.cjs +1 -1
  286. package/functions/utils/mutexes.utils.d.ts +1 -1
  287. package/functions/utils/mutexes.utils.mjs +3 -3
  288. package/functions/utils/nftTokenFunctions.cjs +1 -1
  289. package/functions/utils/nftTokenFunctions.mjs +8 -23
  290. package/functions/utils/prepareHinkal.cjs +1 -1
  291. package/functions/utils/prepareHinkal.d.ts +0 -6
  292. package/functions/utils/prepareHinkal.mjs +41 -60
  293. package/functions/utils/token-check.utils.cjs +1 -1
  294. package/functions/utils/token-check.utils.d.ts +3 -0
  295. package/functions/utils/token-check.utils.mjs +18 -7
  296. package/functions/utils/upToDateState.cjs +1 -1
  297. package/functions/utils/upToDateState.d.ts +1 -1
  298. package/functions/utils/upToDateState.mjs +4 -4
  299. package/functions/utils/walletBalances.utils.cjs +1 -1
  300. package/functions/utils/walletBalances.utils.d.ts +1 -16
  301. package/functions/utils/walletBalances.utils.mjs +4 -35
  302. package/functions/web3/events/getApprovedBalance.cjs +1 -1
  303. package/functions/web3/events/getApprovedBalance.d.ts +3 -4
  304. package/functions/web3/events/getApprovedBalance.mjs +39 -44
  305. package/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
  306. package/functions/web3/events/getInputUtxoAndBalance.d.ts +1 -1
  307. package/functions/web3/events/getInputUtxoAndBalance.mjs +114 -121
  308. package/functions/web3/events/getShieldedBalance.cjs +2 -2
  309. package/functions/web3/events/getShieldedBalance.d.ts +1 -1
  310. package/functions/web3/events/getShieldedBalance.mjs +71 -70
  311. package/functions/web3/events/getTransactionLogEvents.cjs +1 -1
  312. package/functions/web3/events/getTransactionLogEvents.mjs +7 -7
  313. package/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -1
  314. package/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +7 -7
  315. package/functions/web3/functionCalls/accessTokenCalls.cjs +1 -1
  316. package/functions/web3/functionCalls/accessTokenCalls.d.ts +1 -6
  317. package/functions/web3/functionCalls/accessTokenCalls.mjs +12 -21
  318. package/functions/web3/functionCalls/approveToken.cjs +1 -1
  319. package/functions/web3/functionCalls/approveToken.d.ts +1 -1
  320. package/functions/web3/functionCalls/approveToken.mjs +50 -46
  321. package/functions/web3/functionCalls/approveTokensToHinkal.cjs +1 -1
  322. package/functions/web3/functionCalls/approveTokensToHinkal.d.ts +1 -1
  323. package/functions/web3/functionCalls/approveTokensToHinkal.mjs +6 -6
  324. package/functions/web3/functionCalls/estimateGasRelayer.cjs +1 -1
  325. package/functions/web3/functionCalls/estimateGasRelayer.d.ts +1 -2
  326. package/functions/web3/functionCalls/estimateGasRelayer.mjs +10 -10
  327. package/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
  328. package/functions/web3/functionCalls/transactCallDirect.d.ts +1 -1
  329. package/functions/web3/functionCalls/transactCallDirect.mjs +38 -42
  330. package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
  331. package/functions/web3/functionCalls/transactCallRelayer.d.ts +1 -1
  332. package/functions/web3/functionCalls/transactCallRelayer.mjs +34 -34
  333. package/functions/web3/getPublicAddressBalance.cjs +1 -1
  334. package/functions/web3/getPublicAddressBalance.d.ts +1 -1
  335. package/functions/web3/getPublicAddressBalance.mjs +6 -6
  336. package/functions/web3/getTokenHolder.cjs +1 -1
  337. package/functions/web3/getTokenHolder.mjs +8 -8
  338. package/functions/web3/lifiAPI.cjs +1 -1
  339. package/functions/web3/lifiAPI.d.ts +1 -1
  340. package/functions/web3/lifiAPI.mjs +12 -12
  341. package/functions/web3/odosAPI.cjs +1 -1
  342. package/functions/web3/odosAPI.mjs +6 -19
  343. package/functions/web3/okxAPI.cjs +1 -1
  344. package/functions/web3/okxAPI.mjs +22 -22
  345. package/functions/web3/oneInchAPI.cjs +1 -1
  346. package/functions/web3/oneInchAPI.mjs +7 -20
  347. package/functions/web3/runContractFunction.cjs +1 -1
  348. package/functions/web3/runContractFunction.mjs +38 -56
  349. package/functions/web3/uniswapAPI.cjs +1 -1
  350. package/functions/web3/uniswapAPI.mjs +22 -34
  351. package/index.cjs +1 -1
  352. package/index.mjs +939 -970
  353. package/package.json +1 -1
  354. package/providers/EthersProviderAdapter.cjs +1 -1
  355. package/providers/EthersProviderAdapter.d.ts +10 -17
  356. package/providers/EthersProviderAdapter.mjs +48 -76
  357. package/providers/SolanaProviderAdapter.cjs +1 -1
  358. package/providers/SolanaProviderAdapter.d.ts +7 -11
  359. package/providers/SolanaProviderAdapter.mjs +16 -31
  360. package/providers/WagmiProviderAdapter.cjs +1 -1
  361. package/providers/WagmiProviderAdapter.d.ts +11 -17
  362. package/providers/WagmiProviderAdapter.mjs +86 -117
  363. package/providers/prepareEthersHinkal.cjs +1 -1
  364. package/providers/prepareEthersHinkal.mjs +6 -7
  365. package/providers/prepareWagmiHinkal.cjs +1 -1
  366. package/providers/prepareWagmiHinkal.mjs +5 -5
  367. package/types/TransactionSimulator.types.d.ts +2 -9
  368. package/types/admin.types.cjs +1 -1
  369. package/types/admin.types.d.ts +0 -6
  370. package/types/admin.types.mjs +2 -2
  371. package/types/balances.types.d.ts +0 -1
  372. package/types/cache.types.cjs +1 -1
  373. package/types/cache.types.d.ts +2 -3
  374. package/types/cache.types.mjs +1 -1
  375. package/types/coingecko.types.d.ts +5 -0
  376. package/types/ethereum-network.types.cjs +1 -1
  377. package/types/ethereum-network.types.d.ts +1 -8
  378. package/types/ethereum-network.types.mjs +1 -1
  379. package/types/external-action.types.cjs +1 -1
  380. package/types/external-action.types.d.ts +0 -1
  381. package/types/external-action.types.mjs +1 -1
  382. package/types/hinkal.types.cjs +1 -1
  383. package/types/hinkal.types.d.ts +1 -7
  384. package/types/hinkal.types.mjs +22 -23
  385. package/types/index.d.ts +1 -3
  386. package/types/onramp.types.cjs +1 -0
  387. package/types/onramp.types.d.ts +58 -0
  388. package/types/onramp.types.mjs +4 -0
  389. package/types/proxy.types.d.ts +1 -0
  390. package/types/sandbox.types.cjs +1 -1
  391. package/types/sandbox.types.d.ts +8 -39
  392. package/types/sandbox.types.mjs +2 -2
  393. package/types/session.types.d.ts +2 -0
  394. package/types/solana.types.d.ts +1 -0
  395. package/types/token-prices.types.cjs +1 -1
  396. package/types/token-prices.types.d.ts +7 -0
  397. package/types/token-prices.types.mjs +4 -2
  398. package/types/transactions.types.cjs +1 -1
  399. package/types/transactions.types.d.ts +2 -4
  400. package/types/transactions.types.mjs +3 -3
  401. package/webworker/snarkjsWorker/snarkjsWorkerLauncher.cjs +1 -1
  402. package/webworker/snarkjsWorker/snarkjsWorkerLauncher.mjs +1 -1
  403. package/webworker/utxoWorker/utxoWorkerLauncher.cjs +1 -1
  404. package/webworker/utxoWorker/utxoWorkerLauncher.mjs +1 -1
  405. package/webworker/zkProofWorker/zkProofWorkerLauncher.cjs +1 -1
  406. package/webworker/zkProofWorker/zkProofWorkerLauncher.mjs +2 -2
  407. package/API/ai-calls.cjs +0 -1
  408. package/API/ai-calls.d.ts +0 -17
  409. package/API/ai-calls.mjs +0 -21
  410. package/API/duneAPI.cjs +0 -1
  411. package/API/duneAPI.d.ts +0 -11
  412. package/API/duneAPI.mjs +0 -25
  413. package/API/getBridgeProtocols.cjs +0 -1
  414. package/API/getBridgeProtocols.d.ts +0 -7
  415. package/API/getBridgeProtocols.mjs +0 -8
  416. package/API/getLifiStatus.cjs +0 -1
  417. package/API/getLifiStatus.d.ts +0 -24
  418. package/API/getLifiStatus.mjs +0 -15
  419. package/API/getRelayerURL.cjs +0 -1
  420. package/API/getRelayerURL.d.ts +0 -1
  421. package/API/getRelayerURL.mjs +0 -10
  422. package/API/passwordCalls.cjs +0 -1
  423. package/API/passwordCalls.d.ts +0 -9
  424. package/API/passwordCalls.mjs +0 -13
  425. package/API/restoreSnapshots.cjs +0 -1
  426. package/API/restoreSnapshots.d.ts +0 -1
  427. package/API/restoreSnapshots.mjs +0 -10
  428. package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.cjs +0 -1
  429. package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.d.ts +0 -7
  430. package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.mjs +0 -42
  431. package/data-structures/Hinkal/hinkalActionStake.d.ts +0 -3
  432. package/data-structures/Hinkal/hinkalApprove.cjs +0 -1
  433. package/data-structures/Hinkal/hinkalApprove.d.ts +0 -3
  434. package/data-structures/Hinkal/hinkalApprove.mjs +0 -115
  435. package/data-structures/Hinkal/hinkalInsideTransact.cjs +0 -1
  436. package/data-structures/Hinkal/hinkalInsideTransact.d.ts +0 -4
  437. package/data-structures/Hinkal/hinkalInsideTransact.mjs +0 -121
  438. package/error-handling/handleErrorRestore.cjs +0 -1
  439. package/error-handling/handleErrorRestore.d.ts +0 -2
  440. package/error-handling/handleErrorRestore.mjs +0 -11
  441. package/functions/staking/index.cjs +0 -1
  442. package/functions/staking/index.d.ts +0 -11
  443. package/functions/staking/index.mjs +0 -42
  444. package/functions/utils/replaceAddressInCalldata.cjs +0 -1
  445. package/functions/utils/replaceAddressInCalldata.d.ts +0 -1
  446. package/functions/utils/replaceAddressInCalldata.mjs +0 -7
  447. package/functions/web3/functionCalls/inHinkalApprovalCalls.cjs +0 -1
  448. package/functions/web3/functionCalls/inHinkalApprovalCalls.d.ts +0 -5
  449. package/functions/web3/functionCalls/inHinkalApprovalCalls.mjs +0 -32
  450. package/types/bridging.types.d.ts +0 -29
  451. package/types/duneAPI.types.d.ts +0 -9
  452. package/types/hinkal.stake.types.cjs +0 -1
  453. package/types/hinkal.stake.types.d.ts +0 -11
  454. package/types/hinkal.stake.types.mjs +0 -4
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../constants/server.constants.cjs"),n=require("../data-structures/http/HttpClient.cjs"),s=require("./getRelayerURL.cjs"),c=(e,t)=>n.httpClient.get(`${s.getRelayerURL(e)}${r.RELAYER_CONFIG.getScheduledTransactions(t)}`);exports.getScheduledTransactions=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../constants/server.constants.cjs"),r=require("../data-structures/http/HttpClient.cjs"),n=require("./getServerURL.cjs"),s=e=>r.httpClient.get(`${n.RELAYER_URL}${t.RELAYER_CONFIG.getScheduledTransactions(e)}`);exports.getScheduledTransactions=s;
@@ -2,5 +2,5 @@ import { ScheduledTransactionResponseItem } from '../types';
2
2
  interface ScheduledTransactionResponseInterface {
3
3
  transactions: ScheduledTransactionResponseItem[];
4
4
  }
5
- export declare const getScheduledTransactions: (chainId: number, hashedEthereumAddress: string) => Promise<ScheduledTransactionResponseInterface>;
5
+ export declare const getScheduledTransactions: (hashedEthereumAddress: string) => Promise<ScheduledTransactionResponseInterface>;
6
6
  export {};
@@ -1,8 +1,8 @@
1
1
  import { RELAYER_CONFIG as r } from "../constants/server.constants.mjs";
2
- import { httpClient as o } from "../data-structures/http/HttpClient.mjs";
3
- import { getRelayerURL as n } from "./getRelayerURL.mjs";
4
- const c = (t, e) => o.get(
5
- `${n(t)}${r.getScheduledTransactions(e)}`
2
+ import { httpClient as e } from "../data-structures/http/HttpClient.mjs";
3
+ import { RELAYER_URL as o } from "./getServerURL.mjs";
4
+ const c = (t) => e.get(
5
+ `${o}${r.getScheduledTransactions(t)}`
6
6
  );
7
7
  export {
8
8
  c as getScheduledTransactions
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./getServerURL.cjs"),s=require("../constants/server.constants.cjs"),n=require("../data-structures/http/HttpClient.cjs");require("axios");const i=async(e,t)=>await n.httpClient.post(`${r.getServerURL(e)}${s.API_CONFIG.ROUTES.simulateBatchTx}`,{batchCalls:t});exports.simulateBatchTx=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./getServerURL.cjs"),s=require("../constants/server.constants.cjs"),n=require("../data-structures/http/HttpClient.cjs");require("axios");const i=async(e,t)=>await n.httpClient.post(`${r.SERVER_URL}${s.API_CONFIG.ROUTES.simulateBatchTx}`,{chainId:e,batchCalls:t});exports.simulateBatchTx=i;
@@ -1,3 +1,3 @@
1
- import { TransactionSimulatorMinimalResult } from '../types/TransactionSimulator.types';
1
+ import { TransactionSimulatorResult } from '../types/TransactionSimulator.types';
2
2
  import { WCTransactionParameters } from '../types';
3
- export declare const simulateBatchTx: (chainId: number, batchCalls: WCTransactionParameters[]) => Promise<TransactionSimulatorMinimalResult<string>>;
3
+ export declare const simulateBatchTx: (chainId: number, batchCalls: WCTransactionParameters[]) => Promise<TransactionSimulatorResult<string>>;
@@ -1,11 +1,12 @@
1
- import { getServerURL as o } from "./getServerURL.mjs";
2
- import { API_CONFIG as e } from "../constants/server.constants.mjs";
3
- import { httpClient as s } from "../data-structures/http/HttpClient.mjs";
1
+ import { SERVER_URL as r } from "./getServerURL.mjs";
2
+ import { API_CONFIG as s } from "../constants/server.constants.mjs";
3
+ import { httpClient as e } from "../data-structures/http/HttpClient.mjs";
4
4
  import "axios";
5
- const c = async (t, r) => await s.post(
6
- `${o(t)}${e.ROUTES.simulateBatchTx}`,
5
+ const c = async (t, o) => await e.post(
6
+ `${r}${s.ROUTES.simulateBatchTx}`,
7
7
  {
8
- batchCalls: r
8
+ chainId: t,
9
+ batchCalls: o
9
10
  }
10
11
  );
11
12
  export {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../data-structures/http/HttpClient.cjs");require("axios");const r=require("../constants/server.constants.cjs"),n=require("./getServerURL.cjs"),i=async(e,t)=>s.httpClient.post(`${n.getServerURL(e)}${r.API_CONFIG.ROUTES.generateProoflessDepositLimitless}`,t),o=async(e,t)=>s.httpClient.post(`${n.getServerURL(e)}${r.API_CONFIG.ROUTES.generateMultiPaymentDepositLimitless}`,t),l=async(e,t)=>s.httpClient.post(`${n.getServerURL(e)}${r.API_CONFIG.ROUTES.generateAddAccessToken}`,t);exports.generateAddAccessToken=l;exports.generateMultiPaymentDepositLimitless=o;exports.generateProoflessDepositLimitless=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../data-structures/http/HttpClient.cjs");require("axios");const s=require("../constants/server.constants.cjs"),n=require("./getServerURL.cjs"),r=async e=>t.httpClient.post(`${n.SERVER_URL}${s.API_CONFIG.ROUTES.generateProoflessDepositLimitless}`,e),i=async e=>t.httpClient.post(`${n.SERVER_URL}${s.API_CONFIG.ROUTES.generateMultiPaymentDepositLimitless}`,e),o=async e=>t.httpClient.post(`${n.SERVER_URL}${s.API_CONFIG.ROUTES.generateAddAccessToken}`,e);exports.generateAddAccessToken=o;exports.generateMultiPaymentDepositLimitless=i;exports.generateProoflessDepositLimitless=r;
@@ -5,6 +5,7 @@ interface GenerateProoflessDepositLimitlessInput {
5
5
  mint: string;
6
6
  amount: string;
7
7
  stealthAddressStructure: AnchorStealthAddressStructure;
8
+ chainId: number;
8
9
  }
9
10
  interface GenerateMultiPaymentDepositLimitlessInput {
10
11
  payer: string;
@@ -12,23 +13,25 @@ interface GenerateMultiPaymentDepositLimitlessInput {
12
13
  mint: string;
13
14
  amounts: string[];
14
15
  stealthAddressStructure: AnchorStealthAddressStructure;
16
+ chainId: number;
15
17
  }
16
18
  interface GenerateProoflessDepositLimitlessOutput {
17
19
  serializedTransaction: string;
18
20
  blockhash: string;
19
21
  lastValidBlockHeight: number;
20
22
  }
21
- export declare const generateProoflessDepositLimitless: (chainId: number, input: GenerateProoflessDepositLimitlessInput) => Promise<GenerateProoflessDepositLimitlessOutput>;
22
- export declare const generateMultiPaymentDepositLimitless: (chainId: number, input: GenerateMultiPaymentDepositLimitlessInput) => Promise<GenerateProoflessDepositLimitlessOutput>;
23
+ export declare const generateProoflessDepositLimitless: (input: GenerateProoflessDepositLimitlessInput) => Promise<GenerateProoflessDepositLimitlessOutput>;
24
+ export declare const generateMultiPaymentDepositLimitless: (input: GenerateMultiPaymentDepositLimitlessInput) => Promise<GenerateProoflessDepositLimitlessOutput>;
23
25
  interface GenerateAddTokenPublicKeyInput {
24
26
  payer: string;
25
27
  accessKey: string;
26
28
  ethereumAddress: string;
29
+ chainId: number;
27
30
  }
28
31
  interface GenerateAddAccessTokenOutput {
29
32
  serializedTransaction: string;
30
33
  blockhash: string;
31
34
  lastValidBlockHeight: number;
32
35
  }
33
- export declare const generateAddAccessToken: (chainId: number, input: GenerateAddTokenPublicKeyInput) => Promise<GenerateAddAccessTokenOutput>;
36
+ export declare const generateAddAccessToken: (input: GenerateAddTokenPublicKeyInput) => Promise<GenerateAddAccessTokenOutput>;
34
37
  export {};
@@ -1,19 +1,19 @@
1
- import { httpClient as s } from "../data-structures/http/HttpClient.mjs";
1
+ import { httpClient as t } from "../data-structures/http/HttpClient.mjs";
2
2
  import "axios";
3
- import { API_CONFIG as o } from "../constants/server.constants.mjs";
4
- import { getServerURL as r } from "./getServerURL.mjs";
5
- const a = async (e, t) => s.post(
6
- `${r(e)}${o.ROUTES.generateProoflessDepositLimitless}`,
7
- t
8
- ), c = async (e, t) => s.post(
9
- `${r(e)}${o.ROUTES.generateMultiPaymentDepositLimitless}`,
10
- t
11
- ), l = async (e, t) => s.post(
12
- `${r(e)}${o.ROUTES.generateAddAccessToken}`,
13
- t
3
+ import { API_CONFIG as s } from "../constants/server.constants.mjs";
4
+ import { SERVER_URL as o } from "./getServerURL.mjs";
5
+ const p = async (e) => t.post(
6
+ `${o}${s.ROUTES.generateProoflessDepositLimitless}`,
7
+ e
8
+ ), a = async (e) => t.post(
9
+ `${o}${s.ROUTES.generateMultiPaymentDepositLimitless}`,
10
+ e
11
+ ), c = async (e) => t.post(
12
+ `${o}${s.ROUTES.generateAddAccessToken}`,
13
+ e
14
14
  );
15
15
  export {
16
- l as generateAddAccessToken,
17
- c as generateMultiPaymentDepositLimitless,
18
- a as generateProoflessDepositLimitless
16
+ c as generateAddAccessToken,
17
+ a as generateMultiPaymentDepositLimitless,
18
+ p as generateProoflessDepositLimitless
19
19
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../constants/server.constants.cjs"),s=require("./getServerURL.cjs"),o=require("../data-structures/http/HttpClient.cjs");require("axios");const i=async(e,t,r=!1)=>await o.httpClient.post(`${s.getServerURL(e)}${n.API_CONFIG.ROUTES.getTokensInfo}`,{tokenAddresses:t,waitForOffsetUpdate:r});exports.tokensInfoCall=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../constants/server.constants.cjs"),s=require("./getServerURL.cjs"),o=require("../data-structures/http/HttpClient.cjs");require("axios");const i=async(e,t,n=!1)=>await o.httpClient.post(`${s.SERVER_URL}${r.API_CONFIG.ROUTES.getTokensInfo}`,{chainId:e,tokenAddresses:t,waitForOffsetUpdate:n});exports.tokensInfoCall=i;
@@ -1,12 +1,13 @@
1
- import { API_CONFIG as r } from "../constants/server.constants.mjs";
2
- import { getServerURL as n } from "./getServerURL.mjs";
1
+ import { API_CONFIG as e } from "../constants/server.constants.mjs";
2
+ import { SERVER_URL as n } from "./getServerURL.mjs";
3
3
  import { httpClient as s } from "../data-structures/http/HttpClient.mjs";
4
4
  import "axios";
5
- const l = async (o, t, e = !1) => await s.post(
6
- `${n(o)}${r.ROUTES.getTokensInfo}`,
5
+ const l = async (o, t, r = !1) => await s.post(
6
+ `${n}${e.ROUTES.getTokensInfo}`,
7
7
  {
8
+ chainId: o,
8
9
  tokenAddresses: t,
9
- waitForOffsetUpdate: e
10
+ waitForOffsetUpdate: r
10
11
  }
11
12
  );
12
13
  export {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../constants/server.constants.cjs"),r=require("./getRelayerURL.cjs"),o=require("../data-structures/http/HttpClient.cjs"),a=e=>{const t=e.getConstructableParams();return{...t,amount:t.amount.toString(),randomization:t.randomization?.toString()}},U=(e,t)=>o.httpClient.post(`${r.getRelayerURL(e)}${s.RELAYER_CONFIG.storeUnspentUtxos}`,{hashedEthereumAddress:t.hashedEthereumAddress,chainId:t.chainId,utxos:t.utxos.map(n=>a(n))}),i=(e,t)=>o.httpClient.get(`${r.getRelayerURL(e)}${s.RELAYER_CONFIG.getUnspentUtxos(t)}`),p=(e,t,n)=>o.httpClient.delete(`${r.getRelayerURL(e)}${s.RELAYER_CONFIG.deleteUnspentUtxos}`,{data:{hashedEthereumAddress:t,nullifiers:n}});exports.deleteUnspentUtxos=p;exports.getUnspentUtxos=i;exports.storeUnspentUtxos=U;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../constants/server.constants.cjs"),s=require("./getServerURL.cjs"),r=require("../data-structures/http/HttpClient.cjs"),U=t=>{const e=t.getConstructableParams();return{...e,amount:e.amount.toString(),randomization:e.randomization?.toString()}},a=t=>r.httpClient.post(`${s.RELAYER_URL}${n.RELAYER_CONFIG.storeUnspentUtxos}`,{hashedEthereumAddress:t.hashedEthereumAddress,chainId:t.chainId,utxos:t.utxos.map(e=>U(e))}),i=(t,e)=>r.httpClient.get(`${s.RELAYER_URL}${n.RELAYER_CONFIG.getUnspentUtxos(t,e)}`),p=(t,e,o)=>r.httpClient.delete(`${s.RELAYER_URL}${n.RELAYER_CONFIG.deleteUnspentUtxos}`,{data:{hashedEthereumAddress:e,nullifiers:o,chainId:t}});exports.deleteUnspentUtxos=p;exports.getUnspentUtxos=i;exports.storeUnspentUtxos=a;
@@ -8,7 +8,7 @@ interface StoreUnspentUtxosResponse {
8
8
  status: string;
9
9
  message: string;
10
10
  }
11
- export declare const storeUnspentUtxos: (chainId: number, body: StoreUnspentUtxosRequestBody) => Promise<StoreUnspentUtxosResponse>;
11
+ export declare const storeUnspentUtxos: (body: StoreUnspentUtxosRequestBody) => Promise<StoreUnspentUtxosResponse>;
12
12
  interface UnspentUtxo {
13
13
  id: string;
14
14
  utxo: IUtxoConstructor<string>;
@@ -1,25 +1,22 @@
1
- import { RELAYER_CONFIG as o } from "../constants/server.constants.mjs";
2
- import { getRelayerURL as s } from "./getRelayerURL.mjs";
3
- import { httpClient as r } from "../data-structures/http/HttpClient.mjs";
4
- const a = (e) => {
5
- const t = e.getConstructableParams();
1
+ import { RELAYER_CONFIG as n } from "../constants/server.constants.mjs";
2
+ import { RELAYER_URL as o } from "./getServerURL.mjs";
3
+ import { httpClient as s } from "../data-structures/http/HttpClient.mjs";
4
+ const a = (t) => {
5
+ const e = t.getConstructableParams();
6
6
  return {
7
- ...t,
8
- amount: t.amount.toString(),
9
- randomization: t.randomization?.toString()
7
+ ...e,
8
+ amount: e.amount.toString(),
9
+ randomization: e.randomization?.toString()
10
10
  };
11
- }, U = (e, t) => r.post(`${s(e)}${o.storeUnspentUtxos}`, {
11
+ }, U = (t) => s.post(`${o}${n.storeUnspentUtxos}`, {
12
12
  hashedEthereumAddress: t.hashedEthereumAddress,
13
13
  chainId: t.chainId,
14
- utxos: t.utxos.map((n) => a(n))
15
- }), d = (e, t) => r.get(
16
- `${s(e)}${o.getUnspentUtxos(t)}`
17
- ), u = (e, t, n) => r.delete(
18
- `${s(e)}${o.deleteUnspentUtxos}`,
19
- {
20
- data: { hashedEthereumAddress: t, nullifiers: n }
21
- }
22
- );
14
+ utxos: t.utxos.map((e) => a(e))
15
+ }), d = (t, e) => s.get(
16
+ `${o}${n.getUnspentUtxos(t, e)}`
17
+ ), u = (t, e, r) => s.delete(`${o}${n.deleteUnspentUtxos}`, {
18
+ data: { hashedEthereumAddress: e, nullifiers: r, chainId: t }
19
+ });
23
20
  export {
24
21
  u as deleteUnspentUtxos,
25
22
  d as getUnspentUtxos,
package/README.md CHANGED
@@ -5,11 +5,10 @@ Hinkal is a privacy middleware and smart-contract SDK for public blockchains tha
5
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
6
 
7
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
12
-
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
13
12
 
14
13
  ## Installation
15
14
 
@@ -25,18 +24,24 @@ Or, yarn:
25
24
  yarn add @hinkal/common
26
25
  ```
27
26
 
28
- ### Usage
27
+ ## Usage
28
+
29
+ ### Initialization
29
30
 
30
- #### 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
31
37
 
32
- To get started with Hinkal, initialize it based on the Web3 connection library you’re using:
33
38
 
34
39
  **ethers.js:**
35
40
 
36
41
  ```typescript
37
42
  import { prepareEthersHinkal } from '@hinkal/common/providers/prepareEthersHinkal';
38
43
  // signer: ethers.Signer
39
- const hinkal = await prepareEthersHinkal(signer);
44
+ const hinkal = await prepareEthersHinkal(signer, hinkalConfig);
40
45
  ```
41
46
 
42
47
  **wagmi:**
@@ -44,128 +49,292 @@ const hinkal = await prepareEthersHinkal(signer);
44
49
  ```typescript
45
50
  import { prepareWagmiHinkal } from '@hinkal/common/providers/prepareWagmiHinkal';
46
51
  // connector: wagmi.Connector
47
- // config: wagmi.Config
48
- 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
+ };
49
76
  ```
50
77
 
51
- #### Shielded balance
78
+ ### Shielded balance
52
79
 
53
- 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:
54
81
 
55
82
  ```typescript
56
- const balances = await hinkal.getBalances();
83
+ const balances: Promise<Map<string, TokenBalance>> = await hinkal.getBalances();
57
84
  ```
58
85
 
59
- #### 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.
60
92
 
61
93
  A user can deposit funds to their shielded address using:
62
94
 
63
95
  ```typescript
64
- 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>;
65
169
  ```
66
170
 
67
- 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
+
68
177
 
69
- #### Interacting with smart contracts privately
178
+ ### Swapping tokens from the shielded balance
70
179
 
71
- 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.
72
228
 
73
229
  ```typescript
74
230
  function actionPrivateWallet(
231
+ chainId:number,
75
232
  erc20Addresses: string[],
76
- amountChanges: bigint[],
233
+ deltaAmounts: bigint[],
77
234
  onChainCreation: boolean[],
78
235
  ops: string[],
79
- ): Promise<TransactionObject>;
236
+ ): Promise<RelayerTransaction>;
80
237
  ```
81
238
 
82
- 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.
83
245
 
84
- ##### User operations
246
+ To generate user operations, a user will need the `emporiumOp` function.
85
247
 
86
- To generate user operations (`ops`) you will need the `emporiumOp` function.
87
248
  ```typescript
88
- 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>;
89
257
  ```
90
258
 
91
259
  The function accepts the following arguments:
92
- 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.
93
- 2. `func` *(optional)* - the name of the function to be called on the target address.
94
- 3. `args` *(optional)* - arguments of the function to be called on the target address.
95
- 4. `invokeWallet` *(optional)* - bool flag that determines the type of transaction. There are two types: stateful and stateless interaction. The default is false (stateless).
96
- 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.
97
266
 
98
- 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.
99
267
 
100
- 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
+
101
270
  ```solidity
102
271
  (address endpoint, bool invokeWallet, uint256 value, bytes data)
103
272
  ```
104
273
 
105
- 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
+
106
276
  ```solidity
107
277
  (bool success, bytes memory err) = endpoint.call{value: value}(data);
108
278
  ```
109
279
 
110
- ##### Stateless and stateful
111
-
112
- 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:
113
281
 
114
- **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.
115
283
 
116
- 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.
117
285
 
118
286
  ```typescript
119
287
  const operations = [
120
- emporiumOp(usdcContractInstance, 'approve', [swapRouterAddress, amountIn]),
121
- emporiumOp(swapRouterContractInstance, 'exactInputSingle', [swapSingleParams]),
122
- 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] }),
123
291
  ];
124
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
125
297
 
126
- 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.
127
298
 
128
- 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.
129
300
 
130
- **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.
131
302
 
132
- 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.
133
-
134
- Let's imagine that you already have Curve LP tokens and need to make a stake.
135
-
136
- ```solidity
303
+ ```typescript
137
304
  const operations = [
138
- emporiumOp(lpTokenInstance, 'approve', [gaugeAddressInstance, amount]), // without flag, because is's stateless interaction
139
- 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 }),
140
307
  ];
141
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
142
312
 
143
- 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
144
314
 
145
- ### 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.
146
316
 
147
- 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.
148
318
 
149
- 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:
150
320
 
151
321
  ```typescript
152
322
  function checkAccessToken(): Promise<boolean>;
153
323
  ```
154
324
 
155
- 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.
156
326
 
327
+ To get a list of all available compliance providers that can be used for verification:
157
328
  ```typescript
158
329
  function getSupportedPassportLinks(): string[];
159
330
  ```
160
331
 
161
- 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.
162
333
 
163
- ```typescript
164
- const { signatureData } = await hinkal.getAPI().getAccessTokenSignature(chainId, ethereumAddress, accessKey);
165
- await mintAccessToken(this, signatureData);
166
- ```
334
+ ## References
335
+
336
+ Wallet: [Hinkal Wallet](https://chromewebstore.google.com/detail/hinkal-wallet/khfjgapjfcdoffmklchibpepboholpbe)
167
337
 
168
- ### References
338
+ Application: [Private Send](https://send.hinkal.io)
169
339
 
170
- Application: [Hinkal](https://app.hinkal.pro)
171
- Docs: [Hinkal Documentation](https://hinkal-team.gitbook.io/hinkal)
340
+ Docs: [Hinkal Documentation](https://hinkal-team.gitbook.io/hinkal)