@hinkal/common 0.2.22 → 0.2.23

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 (242) hide show
  1. package/API/proxyAccountsCalls.cjs +1 -1
  2. package/API/proxyAccountsCalls.mjs +13 -13
  3. package/README.md +63 -267
  4. package/constants/activity.constants.cjs +1 -1
  5. package/constants/activity.constants.mjs +0 -1
  6. package/constants/addresses.constants.cjs +1 -1
  7. package/constants/addresses.constants.mjs +9 -10
  8. package/constants/contracts.constants.cjs +1 -1
  9. package/constants/contracts.constants.d.ts +3 -3
  10. package/constants/contracts.constants.mjs +29 -29
  11. package/constants/server.constants.cjs +1 -1
  12. package/constants/server.constants.mjs +28 -29
  13. package/constants/tasks.constants.cjs +1 -1
  14. package/constants/tasks.constants.mjs +4 -5
  15. package/crypto/poseidon.cjs +1 -1
  16. package/crypto/poseidon.mjs +10 -10
  17. package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.cjs +1 -1
  18. package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.mjs +24 -24
  19. package/data-structures/Hinkal/Hinkal.cjs +1 -1
  20. package/data-structures/Hinkal/Hinkal.mjs +4 -5
  21. package/data-structures/Hinkal/IHinkal.d.ts +2 -2
  22. package/data-structures/Hinkal/hinkalApprove.cjs +1 -1
  23. package/data-structures/Hinkal/hinkalApprove.mjs +40 -40
  24. package/data-structures/Hinkal/hinkalCheckTokenRegistry.cjs +1 -1
  25. package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +7 -8
  26. package/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
  27. package/data-structures/Hinkal/hinkalDeposit.mjs +4 -5
  28. package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
  29. package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +2 -3
  30. package/data-structures/Hinkal/hinkalDepositOnChainUtxos.cjs +1 -1
  31. package/data-structures/Hinkal/hinkalDepositOnChainUtxos.mjs +18 -19
  32. package/data-structures/Hinkal/hinkalDepostAndBridge.cjs +1 -1
  33. package/data-structures/Hinkal/hinkalDepostAndBridge.mjs +3 -4
  34. package/data-structures/Hinkal/hinkalInsideTransact.cjs +1 -1
  35. package/data-structures/Hinkal/hinkalInsideTransact.mjs +14 -13
  36. package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
  37. package/data-structures/Hinkal/hinkalPrivateWallet.mjs +2 -3
  38. package/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -1
  39. package/data-structures/Hinkal/hinkalProoflessDeposit.mjs +27 -26
  40. package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
  41. package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +38 -39
  42. package/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
  43. package/data-structures/Hinkal/hinkalSolanaSwap.mjs +16 -17
  44. package/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
  45. package/data-structures/Hinkal/hinkalSolanaTransfer.mjs +24 -25
  46. package/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
  47. package/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +15 -16
  48. package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
  49. package/data-structures/Hinkal/hinkalSwap.mjs +2 -3
  50. package/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
  51. package/data-structures/Hinkal/hinkalTransfer.mjs +2 -3
  52. package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
  53. package/data-structures/Hinkal/hinkalWithdraw.mjs +9 -10
  54. package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
  55. package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +8 -9
  56. package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
  57. package/data-structures/Hinkal/resetMerkleTrees.mjs +10 -10
  58. package/data-structures/IndexedDB/activity-db.cjs +1 -1
  59. package/data-structures/IndexedDB/activity-db.mjs +39 -41
  60. package/data-structures/IndexedDB/balances-db.cjs +1 -1
  61. package/data-structures/IndexedDB/balances-db.mjs +8 -9
  62. package/data-structures/IndexedDB/contact-db.cjs +1 -1
  63. package/data-structures/IndexedDB/contact-db.mjs +21 -23
  64. package/data-structures/IndexedDB/signatures-db.cjs +1 -1
  65. package/data-structures/IndexedDB/signatures-db.mjs +2 -3
  66. package/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
  67. package/data-structures/TokenDBs/EventsPublicTokensDB.mjs +34 -36
  68. package/data-structures/crypto-keys/decodeUTXO.cjs +1 -1
  69. package/data-structures/crypto-keys/decodeUTXO.mjs +45 -45
  70. package/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
  71. package/data-structures/crypto-keys/encryptDecryptUtxo.mjs +28 -27
  72. package/data-structures/crypto-keys/keys.cjs +1 -1
  73. package/data-structures/crypto-keys/keys.d.ts +2 -3
  74. package/data-structures/crypto-keys/keys.mjs +56 -57
  75. package/data-structures/event-service/evm/AbstractEventService.cjs +1 -1
  76. package/data-structures/event-service/evm/AbstractEventService.mjs +14 -14
  77. package/data-structures/event-service/evm/AbstractNullifierSnapshotService.cjs +1 -1
  78. package/data-structures/event-service/evm/AbstractNullifierSnapshotService.d.ts +2 -3
  79. package/data-structures/event-service/evm/AbstractNullifierSnapshotService.mjs +5 -4
  80. package/data-structures/event-service/evm/AbstractSnapshotService.cjs +1 -1
  81. package/data-structures/event-service/evm/AbstractSnapshotService.mjs +6 -3
  82. package/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
  83. package/data-structures/event-service/evm/BlockchainEventEmitter.d.ts +1 -1
  84. package/data-structures/event-service/evm/BlockchainEventEmitter.mjs +22 -18
  85. package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.cjs +1 -1
  86. package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.mjs +2 -2
  87. package/data-structures/presale/PresaleContractWrapper.cjs +1 -1
  88. package/data-structures/presale/PresaleContractWrapper.d.ts +3 -3
  89. package/data-structures/presale/PresaleContractWrapper.mjs +10 -10
  90. package/data-structures/provider-adapter/IProviderAdapter.d.ts +7 -7
  91. package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.cjs +1 -1
  92. package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.mjs +16 -14
  93. package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.cjs +1 -1
  94. package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.mjs +7 -5
  95. package/error-handling/get-error.message.cjs +1 -1
  96. package/error-handling/get-error.message.mjs +2 -3
  97. package/functions/kyc/zkMeHelper.cjs +1 -1
  98. package/functions/kyc/zkMeHelper.mjs +3 -3
  99. package/functions/pre-transaction/getFlatFees.cjs +1 -1
  100. package/functions/pre-transaction/getFlatFees.mjs +2 -3
  101. package/functions/pre-transaction/getSolanaCalldataHash.cjs +1 -1
  102. package/functions/pre-transaction/getSolanaCalldataHash.mjs +21 -21
  103. package/functions/pre-transaction/getVolatileTransferAmount.cjs +1 -1
  104. package/functions/pre-transaction/getVolatileTransferAmount.mjs +2 -3
  105. package/functions/pre-transaction/interaction-to-action.cjs +1 -1
  106. package/functions/pre-transaction/interaction-to-action.mjs +2 -3
  107. package/functions/private-wallet/emporium.helpers.cjs +1 -1
  108. package/functions/private-wallet/emporium.helpers.d.ts +6 -7
  109. package/functions/private-wallet/emporium.helpers.mjs +104 -105
  110. package/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
  111. package/functions/private-wallet/emporium.swap.helpers.mjs +44 -43
  112. package/functions/private-wallet/opProducer.cjs +1 -1
  113. package/functions/private-wallet/opProducer.mjs +1 -1
  114. package/functions/snarkjs/common.snarkjs.cjs +1 -1
  115. package/functions/snarkjs/common.snarkjs.mjs +21 -18
  116. package/functions/snarkjs/constructSolanaZkProof.cjs +1 -1
  117. package/functions/snarkjs/constructSolanaZkProof.mjs +11 -12
  118. package/functions/utils/addresses.cjs +1 -1
  119. package/functions/utils/addresses.mjs +6 -6
  120. package/functions/utils/cacheFunctions.cjs +1 -1
  121. package/functions/utils/cacheFunctions.d.ts +1 -1
  122. package/functions/utils/cacheFunctions.mjs +55 -54
  123. package/functions/utils/convertEmporiumOpToCallInfo.cjs +1 -1
  124. package/functions/utils/convertEmporiumOpToCallInfo.mjs +5 -5
  125. package/functions/utils/create-provider.cjs +1 -1
  126. package/functions/utils/create-provider.d.ts +2 -2
  127. package/functions/utils/create-provider.mjs +5 -5
  128. package/functions/utils/encryptInputForEnclave.cjs +1 -1
  129. package/functions/utils/encryptInputForEnclave.mjs +9 -9
  130. package/functions/utils/ethers-formatter.utils.d.ts +1 -1
  131. package/functions/utils/external-action.utils.cjs +1 -1
  132. package/functions/utils/external-action.utils.mjs +2 -2
  133. package/functions/utils/getContractAddress.cjs +1 -0
  134. package/functions/utils/getContractAddress.d.ts +2 -0
  135. package/functions/utils/getContractAddress.mjs +9 -0
  136. package/functions/utils/getDataFromTransaction.cjs +1 -1
  137. package/functions/utils/getDataFromTransaction.d.ts +0 -11
  138. package/functions/utils/getDataFromTransaction.mjs +26 -50
  139. package/functions/utils/getRecipientInfoFromUserKeys.cjs +1 -1
  140. package/functions/utils/getRecipientInfoFromUserKeys.mjs +1 -1
  141. package/functions/utils/getSignerFromContract.cjs +1 -0
  142. package/functions/utils/getSignerFromContract.d.ts +3 -0
  143. package/functions/utils/getSignerFromContract.mjs +16 -0
  144. package/functions/utils/getUtxosFromReceipt.utils.cjs +1 -1
  145. package/functions/utils/getUtxosFromReceipt.utils.d.ts +1 -1
  146. package/functions/utils/getUtxosFromReceipt.utils.mjs +15 -16
  147. package/functions/utils/inLogicMetadata.cjs +1 -1
  148. package/functions/utils/inLogicMetadata.mjs +2 -2
  149. package/functions/utils/nftTokenFunctions.cjs +1 -1
  150. package/functions/utils/nftTokenFunctions.mjs +2 -3
  151. package/functions/utils/publicBalance.utils.cjs +1 -1
  152. package/functions/utils/publicBalance.utils.d.ts +1 -1
  153. package/functions/utils/publicBalance.utils.mjs +42 -42
  154. package/functions/utils/rpc-int-encode.cjs +1 -1
  155. package/functions/utils/rpc-int-encode.d.ts +1 -2
  156. package/functions/utils/rpc-int-encode.mjs +3 -6
  157. package/functions/utils/solanaMint.utils.cjs +1 -1
  158. package/functions/utils/solanaMint.utils.mjs +6 -6
  159. package/functions/web3/EIP-712.cjs +1 -1
  160. package/functions/web3/EIP-712.d.ts +4 -4
  161. package/functions/web3/EIP-712.mjs +1 -1
  162. package/functions/web3/etherFunctions.cjs +1 -1
  163. package/functions/web3/etherFunctions.mjs +32 -29
  164. package/functions/web3/events/balanceChangedCustomHandler.cjs +1 -1
  165. package/functions/web3/events/balanceChangedCustomHandler.mjs +4 -5
  166. package/functions/web3/events/balanceChangedHandler.cjs +1 -1
  167. package/functions/web3/events/balanceChangedHandler.mjs +2 -3
  168. package/functions/web3/events/getApprovedBalance.cjs +1 -1
  169. package/functions/web3/events/getApprovedBalance.mjs +1 -1
  170. package/functions/web3/events/getInputUtxosEnclave.cjs +1 -1
  171. package/functions/web3/events/getInputUtxosEnclave.mjs +20 -20
  172. package/functions/web3/events/getTransactionLogEvents.cjs +1 -1
  173. package/functions/web3/events/getTransactionLogEvents.d.ts +3 -3
  174. package/functions/web3/events/getTransactionLogEvents.mjs +6 -5
  175. package/functions/web3/events/index.d.ts +0 -1
  176. package/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -1
  177. package/functions/web3/fetchSolanaMerkleTreeRootHash.d.ts +1 -2
  178. package/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +4 -5
  179. package/functions/web3/functionCalls/accessTokenCalls.cjs +1 -1
  180. package/functions/web3/functionCalls/accessTokenCalls.mjs +10 -11
  181. package/functions/web3/functionCalls/approveToken.cjs +1 -1
  182. package/functions/web3/functionCalls/approveToken.mjs +61 -58
  183. package/functions/web3/functionCalls/constructBatchCall.cjs +1 -1
  184. package/functions/web3/functionCalls/constructBatchCall.d.ts +2 -2
  185. package/functions/web3/functionCalls/constructBatchCall.mjs +10 -9
  186. package/functions/web3/functionCalls/estimateGasRelayer.cjs +1 -1
  187. package/functions/web3/functionCalls/estimateGasRelayer.mjs +1 -1
  188. package/functions/web3/functionCalls/inHinkalApprovalCalls.cjs +1 -1
  189. package/functions/web3/functionCalls/inHinkalApprovalCalls.mjs +18 -21
  190. package/functions/web3/functionCalls/recoverTransactionFromError.d.ts +1 -1
  191. package/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
  192. package/functions/web3/functionCalls/transactCallDirect.mjs +38 -34
  193. package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
  194. package/functions/web3/functionCalls/transactCallRelayer.mjs +8 -10
  195. package/functions/web3/getContractMetadata.cjs +1 -1
  196. package/functions/web3/getContractMetadata.d.ts +1 -1
  197. package/functions/web3/getContractMetadata.mjs +25 -25
  198. package/functions/web3/getPublicAddressBalance.cjs +1 -1
  199. package/functions/web3/getPublicAddressBalance.mjs +7 -6
  200. package/functions/web3/getTokenHolder.cjs +1 -1
  201. package/functions/web3/getTokenHolder.mjs +16 -15
  202. package/functions/web3/odosAPI.cjs +1 -1
  203. package/functions/web3/odosAPI.mjs +6 -7
  204. package/functions/web3/oneInchAPI.cjs +1 -1
  205. package/functions/web3/oneInchAPI.mjs +2 -3
  206. package/functions/web3/runContractFunction.cjs +1 -1
  207. package/functions/web3/runContractFunction.d.ts +6 -5
  208. package/functions/web3/runContractFunction.mjs +41 -45
  209. package/functions/web3/uniswapAPI.cjs +1 -1
  210. package/functions/web3/uniswapAPI.d.ts +2 -2
  211. package/functions/web3/uniswapAPI.mjs +23 -24
  212. package/index.cjs +1 -1
  213. package/index.mjs +336 -340
  214. package/package.json +3 -4
  215. package/providers/CustomEthersProvider.d.ts +1 -1
  216. package/providers/EthersProviderAdapter.cjs +1 -1
  217. package/providers/EthersProviderAdapter.d.ts +7 -7
  218. package/providers/EthersProviderAdapter.mjs +46 -44
  219. package/providers/SolanaProviderAdapter.d.ts +1 -1
  220. package/providers/WagmiProviderAdapter.cjs +1 -1
  221. package/providers/WagmiProviderAdapter.d.ts +5 -5
  222. package/providers/WagmiProviderAdapter.mjs +37 -33
  223. package/providers/prepareEthersHinkal.cjs +1 -1
  224. package/providers/prepareEthersHinkal.d.ts +2 -2
  225. package/providers/prepareEthersHinkal.mjs +3 -5
  226. package/providers/prepareWagmiHinkal.cjs +1 -1
  227. package/providers/prepareWagmiHinkal.mjs +3 -5
  228. package/types/activities.types.d.ts +2 -3
  229. package/types/big-intable.types.d.ts +3 -2
  230. package/types/ethereum-network.types.d.ts +10 -10
  231. package/types/transactions.types.cjs +1 -1
  232. package/types/transactions.types.d.ts +2 -3
  233. package/types/transactions.types.mjs +6 -7
  234. package/webworker/utxoWorker/utxoWorkerLauncher.cjs +1 -1
  235. package/webworker/utxoWorker/utxoWorkerLauncher.mjs +1 -1
  236. package/webworker/utxoWorker/utxoWorkerLogic.cjs +1 -1
  237. package/webworker/utxoWorker/utxoWorkerLogic.mjs +1 -1
  238. package/webworker/zkProofWorker/zkProofWorkerLauncher.cjs +1 -1
  239. package/webworker/zkProofWorker/zkProofWorkerLauncher.mjs +1 -1
  240. package/functions/web3/events/web3RetrieveEvents.cjs +0 -1
  241. package/functions/web3/events/web3RetrieveEvents.d.ts +0 -14
  242. package/functions/web3/events/web3RetrieveEvents.mjs +0 -9
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../constants/server.constants.cjs"),u=require("./getServerURL.cjs"),n=require("ethers"),d=require("../functions/utils/addresses.cjs"),i=require("../data-structures/http/HttpClient.cjs");require("axios");const a=(t,e)=>{const r=e.getShieldedPrivateKey(),s=`HinkalProxyAccounts|${t.toLowerCase()}|${r}`;return n.ethers.utils.keccak256(n.ethers.utils.toUtf8Bytes(s))},P=async(t,e,r)=>{const s=a(e,r);return await i.httpClient.get(`${u.getServerURL(t)}${c.API_CONFIG.ROUTES.getProxyAccounts(s)}`)},g=async(t,e,r,s)=>{const o=a(e,r),y=d.hashEthereumAddress(e);return await i.httpClient.post(`${u.getServerURL(t)}${c.API_CONFIG.ROUTES.updateProxyAccounts}`,{secureKey:o,hashedEthereumAddress:y,proxyAccounts:s})};exports.getProxyAccounts=P;exports.updateProxyAccounts=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../constants/server.constants.cjs"),u=require("./getServerURL.cjs"),d=require("../functions/utils/addresses.cjs"),a=require("../data-structures/http/HttpClient.cjs");require("axios");const n=require("ethers"),i=(t,e)=>{const r=e.getShieldedPrivateKey(),s=`HinkalProxyAccounts|${t.toLowerCase()}|${r}`;return n.ethers.keccak256(n.ethers.toUtf8Bytes(s))},P=async(t,e,r)=>{const s=i(e,r);return await a.httpClient.get(`${u.getServerURL(t)}${c.API_CONFIG.ROUTES.getProxyAccounts(s)}`)},g=async(t,e,r,s)=>{const o=i(e,r),y=d.hashEthereumAddress(e);return await a.httpClient.post(`${u.getServerURL(t)}${c.API_CONFIG.ROUTES.updateProxyAccounts}`,{secureKey:o,hashedEthereumAddress:y,proxyAccounts:s})};exports.getProxyAccounts=P;exports.updateProxyAccounts=g;
@@ -1,26 +1,26 @@
1
1
  import { API_CONFIG as c } from "../constants/server.constants.mjs";
2
- import { getServerURL as i } from "./getServerURL.mjs";
3
- import { ethers as n } from "ethers";
2
+ import { getServerURL as a } from "./getServerURL.mjs";
4
3
  import { hashEthereumAddress as y } from "../functions/utils/addresses.mjs";
5
- import { httpClient as a } from "../data-structures/http/HttpClient.mjs";
4
+ import { httpClient as i } from "../data-structures/http/HttpClient.mjs";
6
5
  import "axios";
7
- const u = (t, e) => {
6
+ import { ethers as n } from "ethers";
7
+ const p = (t, e) => {
8
8
  const o = e.getShieldedPrivateKey(), r = `HinkalProxyAccounts|${t.toLowerCase()}|${o}`;
9
- return n.utils.keccak256(n.utils.toUtf8Bytes(r));
9
+ return n.keccak256(n.toUtf8Bytes(r));
10
10
  }, f = async (t, e, o) => {
11
- const r = u(e, o);
12
- return await a.get(
13
- `${i(t)}${c.ROUTES.getProxyAccounts(r)}`
11
+ const r = p(e, o);
12
+ return await i.get(
13
+ `${a(t)}${c.ROUTES.getProxyAccounts(r)}`
14
14
  );
15
- }, l = async (t, e, o, r) => {
16
- const s = u(e, o), p = y(e);
17
- return await a.post(`${i(t)}${c.ROUTES.updateProxyAccounts}`, {
15
+ }, S = async (t, e, o, r) => {
16
+ const s = p(e, o), u = y(e);
17
+ return await i.post(`${a(t)}${c.ROUTES.updateProxyAccounts}`, {
18
18
  secureKey: s,
19
- hashedEthereumAddress: p,
19
+ hashedEthereumAddress: u,
20
20
  proxyAccounts: r
21
21
  });
22
22
  };
23
23
  export {
24
24
  f as getProxyAccounts,
25
- l as updateProxyAccounts
25
+ S as updateProxyAccounts
26
26
  };
package/README.md CHANGED
@@ -5,17 +5,11 @@ 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
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
12
 
13
- ## Compatibility
14
-
15
- | Environment | Supported | Notes |
16
- | ----------- | --------- | -------------------------- |
17
- | Node.js | ✅ | v18+ |
18
- | Browser | ✅ | React, Next.js, vanilla JS |
19
13
 
20
14
  ## Installation
21
15
 
@@ -31,24 +25,18 @@ Or, yarn:
31
25
  yarn add @hinkal/common
32
26
  ```
33
27
 
34
- ## Usage
35
-
36
- ### Initialization
37
-
38
- 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.
28
+ ### Usage
39
29
 
40
- Initializing the SDK creates a `Hinkal` object that encapsulates:
30
+ #### Initialization
41
31
 
42
- - The user's shielded balances
43
- - Actions the user can perform, such as shielding (depositing), transfers, and swapping
44
- - Cryptographic keys for privacy-preserving operations
32
+ To get started with Hinkal, initialize it based on the Web3 connection library you’re using:
45
33
 
46
34
  **ethers.js:**
47
35
 
48
36
  ```typescript
49
37
  import { prepareEthersHinkal } from '@hinkal/common/providers/prepareEthersHinkal';
50
38
  // signer: ethers.Signer
51
- const hinkal = await prepareEthersHinkal(signer, hinkalConfig);
39
+ const hinkal = await prepareEthersHinkal(signer);
52
40
  ```
53
41
 
54
42
  **wagmi:**
@@ -56,320 +44,128 @@ const hinkal = await prepareEthersHinkal(signer, hinkalConfig);
56
44
  ```typescript
57
45
  import { prepareWagmiHinkal } from '@hinkal/common/providers/prepareWagmiHinkal';
58
46
  // connector: wagmi.Connector
59
- // wagmiConfig: wagmi.Config
60
- const hinkal = await prepareWagmiHinkal(connector, wagmiConfig, hinkalConfig);
61
- ```
62
-
63
- The `hinkalConfig` is defined as follows:
64
-
65
- ```typescript
66
- type HinkalConfig = {
67
- /** Disables caching in browser localStorage, storing data only in memory. Front-end only. Defaults to false. */
68
- disableCaching?: boolean;
69
-
70
- /** If true, allows caching in a file locally. Node.js only. Defaults to false. */
71
- useFileCache?: boolean;
72
-
73
- /**
74
- * Path to the cache file used for storing temporary data. Node.js only.
75
- * It should be a valid file path string. Defaults to hinkalCache.json in the current working directory.
76
- */
77
- cacheFilePath?: string;
78
-
79
- /**
80
- * Indicator controlling wether the proof should be constructed remotely in secure enclave. Defaults to true.
81
- */
82
- generateProofRemotely?: boolean;
83
- };
47
+ // config: wagmi.Config
48
+ const hinkal = await prepareWagmiHinkal(connector, config);
84
49
  ```
85
50
 
86
- ### Shielded balance
51
+ #### Shielded balance
87
52
 
88
- 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:
53
+ Once the Hinkal object is initialized, shielded balances become accessible and can be calculated as needed:
89
54
 
90
55
  ```typescript
91
- const balances: Promise<Map<string, TokenBalance>> = await hinkal.getBalances();
56
+ const balances = await hinkal.getBalances();
92
57
  ```
93
58
 
94
- This returns a map from token address to balance for all tokens held by the user, including ERC20 and ERC721 tokens.
95
-
96
- ### Shielding: depositing funds to the shielded balance
97
-
98
- 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.
59
+ #### Depositing funds to the shielded balance
99
60
 
100
61
  A user can deposit funds to their shielded address using:
101
62
 
102
63
  ```typescript
103
- function deposit(erc20Tokens: ERC20Token[], amountChanges: bigint[]): Promise<ethers.providers.TransactionResponse>;
64
+ function deposit(erc20addresses: string[], amountChanges: bigint[]): Promise<TransactionObject>;
104
65
  ```
105
66
 
106
- where:
67
+ where erc20Addresses is an array of token addresses, and amountChanges represents the token amounts for the deposit.
107
68
 
108
- - `erc20Tokens` is an array of tokens to deposit
109
- - `amountChanges` represents the corresponding token amounts for the deposit
69
+ #### Interacting with smart contracts privately
110
70
 
111
- The `ERC20Token` type is defined as follows:
112
-
113
- ```typescript
114
- type ERC20Token = {
115
- chainId: number;
116
- erc20TokenAddress: string;
117
- name: string;
118
- symbol: string;
119
- decimals: number;
120
- };
121
- ```
122
-
123
- ### Private Send to Public Address: withdrawing funds from the shielded balance
124
-
125
- 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.
126
-
127
- A user can withdraw funds from their shielded address to a public address using:
128
-
129
- ```typescript
130
- function withdraw(
131
- erc20Tokens: ERC20Token[],
132
- deltaAmounts: bigint[],
133
- recipientAddress: string,
134
- isRelayerOff: boolean,
135
- ): Promise<string>;
136
- ```
137
-
138
- where:
139
-
140
- - `recipientAddress` is the public address that will receive the withdrawn funds
141
- - `isRelayerOff` determines whether to use a relayer for the transaction (when `false`, a relayer handles gas fees; when `true`, the user pays gas directly)
142
- - `string` type represents the transaction response from the relayer service.
143
-
144
- ### Private Send to Private Address: transfering funds from shielded balance
145
-
146
- 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.
147
-
148
- A user can transfer tokens from their shielded balance to another shielded address using:
149
-
150
- ```typescript
151
- function transfer(erc20Tokens: ERC20Token[], deltaAmounts: bigint[], privateRecipientAddress: string): Promise<string>;
152
- ```
153
-
154
- where:
155
-
156
- - `privateRecipientAddress` is the recipient's private address, formatted as a comma-separated string with five components:
157
- - `randomization` - a random value for privacy
158
- - `stealthAddress` - the recipient's stealth address (hex format starting with `0x`)
159
- - `encryptionKey` - the recipient's encryption key (hex format starting with `0x`, 66 characters)
160
- - `H0` - the first hash component of elliptic curve point for stealth address derivation
161
- - `H1` - the second hash component of elliptic curve point for stealth address derivation
162
-
163
- ### Private Send from Public to Public addresses
164
-
165
- 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.
166
-
167
- A user can perform a private transfer between public addresses using:
168
-
169
- ```typescript
170
- function depositAndWithdraw(
171
- erc20Token: ERC20Token,
172
- recipientAmounts: bigint[],
173
- recipientAddresses: string[],
174
- txCompletionTime?: number,
175
- ): Promise<string>;
176
- ```
177
-
178
- where:
179
-
180
- - `erc20Token` is the token to transfer (only single token transfers are supported for this method)
181
- - `recipientAmounts` is an array of amounts to send to each recipient (in the token's smallest unit)
182
- - `recipientAddresses` is an array of public addresses that will receive the funds
183
- - `txCompletionTime` (optional) specifies a delay in milliseconds before the withdrawal completes
184
-
185
- ### Swapping tokens from the shielded balance
186
-
187
- 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.
188
-
189
- A user can swap tokens directly from their shielded balance using:
190
-
191
- ```typescript
192
- function swap(
193
- erc20Tokens: ERC20Token[],
194
- deltaAmounts: bigint[],
195
- externalActionId: ExternalActionId,
196
- swapData: string,
197
- ): Promise<string>;
198
- ```
199
-
200
- where:
201
-
202
- - `externalActionId` identifies the external swap protocol to use. Possible values include:
203
- - `ExternalActionId.Uniswap` - for Uniswap swaps
204
- - `ExternalActionId.OneInch` - for 1Inch swaps
205
- - `ExternalActionId.Odos` - for Odos swaps
206
- - `swapData` contains the encoded swap parameters specific to the chosen protocol
207
-
208
- **Getting swap calldata:**
209
-
210
- To obtain the swap calldata using the Hinkal SDK, you can use the built-in swap data generation utilities.
211
-
212
- 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:
213
-
214
- **1Inch:**
215
-
216
- ```typescript
217
- function getOneInchPrice(
218
- chainId: number,
219
- inSwapToken: ERC20Token,
220
- outSwapToken: ERC20Token,
221
- inSwapAmount: string,
222
- slippagePercentage?: number,
223
- ): Promise<{
224
- outSwapAmountValue: bigint;
225
- oneInchDataValue: string;
226
- }>;
227
- ```
228
-
229
- Similar functions are available for other supported swap protocols:
230
-
231
- - **Uniswap:** `getUniswapPrice`
232
- - **Odos:** `getOdosPrice`
233
- - **LiFi:** `getLifiPrice`
234
-
235
- ### Interacting with smart contracts privately
236
-
237
- 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.
71
+ After a user’s shielded balance is updated, they can perform any smart contract interaction privately using:
238
72
 
239
73
  ```typescript
240
74
  function actionPrivateWallet(
241
- chainId: number,
242
- erc20Tokens: ERC20Token[],
243
- deltaAmounts: bigint[],
75
+ erc20Addresses: string[],
76
+ amountChanges: bigint[],
244
77
  onChainCreation: boolean[],
245
78
  ops: string[],
246
- ): Promise<string>;
79
+ ): Promise<TransactionObject>;
247
80
  ```
248
81
 
249
- Parameters:
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.
250
83
 
251
- - `chainId` - the blockchain network identifier
252
- - `onChainCreation` - array of booleans indicating the direction of token changes: `true` for positive changes (tokens received), `false` for negative changes (tokens spent)
253
- - `ops` - array of encoded user operations to execute (see User operations below)
254
-
255
- 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.
256
-
257
- To generate user operations, a user will need the `emporiumOp` function.
84
+ ##### User operations
258
85
 
86
+ To generate user operations (`ops`) you will need the `emporiumOp` function.
259
87
  ```typescript
260
- function emporiumOp(
261
- contract: ethers.Contract | string;
262
- func?: string;
263
- args?: any[];
264
- callDataString?: string;
265
- invokeWallet?: boolean;
266
- value?: bigint;
267
- ): Promise<string>;
88
+ import {emporiumOp} from "@hinkal/common";
268
89
  ```
269
90
 
270
91
  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.
271
97
 
272
- 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.
273
- 2. `func` _(optional)_ - the name of the function to be called on the target address.
274
- 3. `args` _(optional)_ - arguments of the function to be called on the target address.
275
- 4. `callDataString` _(optional)_ - pre-encoded calldata string. If provided, `func` and `args` should not be used.
276
- 5. `invokeWallet` _(optional)_ - boolean flag that determines the type of interaction (see the stateless/stateful interactions below).
277
- 6. `value` _(optional)_ - the value field to the user operation call.
278
-
279
- When the Emporium contract executes a user operation, it receives the data in this format:
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.
280
99
 
100
+ To execute on a smart contract, the user operation will be received in the following format:
281
101
  ```solidity
282
102
  (address endpoint, bool invokeWallet, uint256 value, bytes data)
283
103
  ```
284
104
 
285
- This enables the Emporium contract to execute generic calls using user operations:
286
-
105
+ This will make it possible to make that kind of call:
287
106
  ```solidity
288
107
  (bool success, bytes memory err) = endpoint.call{value: value}(data);
289
108
  ```
290
109
 
291
- User operations can be categorized into two types based on whether the target protocol needs to track the caller account's history:
110
+ ##### Stateless and stateful
111
+
112
+ The best way to demonstrate how this works is with an example.
292
113
 
293
- **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.
114
+ **Stateless interaction**
294
115
 
295
- 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.
116
+ Let's say we need to exchange USDC for ETH using DEX.
296
117
 
297
118
  ```typescript
298
119
  const operations = [
299
- emporiumOp({ contract: usdcContractInstance, func: 'approve', args: [swapRouterAddress, amountIn] }),
300
- emporiumOp({ contract: swapRouterContractInstance, func: 'exactInputSingle', args: [swapSingleParams] }),
301
- emporiumOp({ contract: wethContractInstance, func: 'withdraw', args: [amountOut] }),
120
+ emporiumOp(usdcContractInstance, 'approve', [swapRouterAddress, amountIn]),
121
+ emporiumOp(swapRouterContractInstance, 'exactInputSingle', [swapSingleParams]),
122
+ emporiumOp(wethContractInstance, 'withdraw', [amountOut]),
302
123
  ];
303
124
  ```
304
125
 
305
- In this example:
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.
306
127
 
307
- - First operation approves the swap router to spend USDC tokens
308
- - Second operation executes the swap from USDC to WETH
309
- - Third operation unwraps WETH to ETH
128
+ In this case it will be **stateless interaction**, so there is no need to change the default value of the `invokeWallet` flag.
310
129
 
311
- **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.
130
+ **Stateful interaction**
312
131
 
313
- 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.
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.
314
133
 
315
- ```typescript
134
+ Let's imagine that you already have Curve LP tokens and need to make a stake.
135
+
136
+ ```solidity
316
137
  const operations = [
317
- emporiumOp({ contract: lpTokenInstance, func: 'approve', args: [gaugeAddressInstance, amount], invokeWallet: true }),
318
- emporiumOp({
319
- contract: gaugeAddressInstance,
320
- func: 'deposit',
321
- args: [amount, invokeWalletAddress],
322
- invokeWallet: true,
323
- }),
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
324
140
  ];
325
141
  ```
326
142
 
327
- In this example:
328
-
329
- - First operation approves the gauge contract to spend LP tokens, executed from the persistent wallet
330
- - Second operation deposits LP tokens into the gauge, with the wallet address as the recipient for reward tracking
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.
331
144
 
332
- ## Access Tokens
145
+ ### Access Tokens
333
146
 
334
- 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.
147
+ Before interacting with Hinkal smart contracts, users need to mint an access token after passing compliance checks.
335
148
 
336
- 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.
337
-
338
- To check whether a user already has an access token on a specific chain, use the `checkAccessToken` function:
149
+ To check whether a user already has an access token, use the checkAccessToken function:
339
150
 
340
151
  ```typescript
341
152
  function checkAccessToken(): Promise<boolean>;
342
153
  ```
343
154
 
344
- 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.
345
-
346
- To get a list of all available compliance providers that can be used for verification:
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:
347
156
 
348
157
  ```typescript
349
158
  function getSupportedPassportLinks(): string[];
350
159
  ```
351
160
 
352
- 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.
353
-
354
- ## Supported Chains
355
-
356
- Hinkal SDK is available on the following blockchain networks:
357
-
358
- | Chain | Chain ID | Status |
359
- | -------- | -------- | -------------- |
360
- | Ethereum | 1 | ✅ Live |
361
- | Polygon | 137 | ✅ Live |
362
- | Base | 8453 | ✅ Live |
363
- | Arbitrum | 42161 | ✅ Live |
364
- | Optimism | 10 | ✅ Live |
365
- | Solana | - | 🚧 In Progress |
161
+ After passing the compliance check, the user can mint an access token using:
366
162
 
367
- Each chain supports the full suite of Hinkal privacy features including shielding, transfers, and confidential interactions with DeFi protocols.
368
-
369
- ## References
370
-
371
- Wallet: [Hinkal Wallet](https://chromewebstore.google.com/detail/hinkal-wallet/khfjgapjfcdoffmklchibpepboholpbe)
163
+ ```typescript
164
+ const { signatureData } = await hinkal.getAPI().getAccessTokenSignature(chainId, ethereumAddress, accessKey);
165
+ await mintAccessToken(this, signatureData);
166
+ ```
372
167
 
373
- Application: [Private Send](https://send.hinkal.io)
168
+ ### References
374
169
 
375
- Docs: [Hinkal Documentation](https://hinkal-team.gitbook.io/hinkal)
170
+ Application: [Hinkal](https://app.hinkal.pro)
171
+ 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");require("../types/transactions.types.cjs");const t=require("../types/activities.types.cjs"),e=[t.ActivityTypes.SHIELD,t.ActivityTypes.RECIEVE,t.ActivityTypes.ONBOARDING_DEPOSIT,t.ActivityTypes.SEND,t.ActivityTypes.UNSHIELD,t.ActivityTypes.DAPP_INTERACTION];exports.TVL_CHANGER_ACTIVITY_TYPES=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../types/circom-data.types.cjs");const t=require("../types/activities.types.cjs"),i=[t.ActivityTypes.SHIELD,t.ActivityTypes.RECIEVE,t.ActivityTypes.ONBOARDING_DEPOSIT,t.ActivityTypes.SEND,t.ActivityTypes.UNSHIELD,t.ActivityTypes.DAPP_INTERACTION];exports.TVL_CHANGER_ACTIVITY_TYPES=i;
@@ -1,5 +1,4 @@
1
1
  import "../types/circom-data.types.mjs";
2
- import "../types/transactions.types.mjs";
3
2
  import { ActivityTypes as E } from "../types/activities.types.mjs";
4
3
  const N = [
5
4
  E.SHIELD,
@@ -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="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
+ "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/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,9 +1,8 @@
1
1
  import "../types/circom-data.types.mjs";
2
2
  import { ExternalActionId as a } from "../types/external-action.types.mjs";
3
- import "../types/transactions.types.mjs";
4
3
  import "../types/activities.types.mjs";
5
4
  import { chainIds as E } from "./chains.constants.mjs";
6
- const F = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", A = {
5
+ const D = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", F = {
7
6
  [a.Uniswap]: {
8
7
  [E.ethMainnet]: "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",
9
8
  [E.polygon]: "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",
@@ -43,7 +42,7 @@ const F = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", A = {
43
42
  [E.avalanche]: "0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE",
44
43
  [E.base]: "0x1231DEB6f5749EF6cE6943a275A1D3E7486F4EaE"
45
44
  }
46
- }, c = {
45
+ }, A = {
47
46
  [E.ethMainnet]: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
48
47
  [E.polygon]: "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",
49
48
  [E.optimism]: "0x4200000000000000000000000000000000000006",
@@ -51,7 +50,7 @@ const F = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", A = {
51
50
  [E.bnbMainnet]: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
52
51
  [E.avalanche]: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",
53
52
  [E.base]: "0x4200000000000000000000000000000000000006"
54
- }, d = {
53
+ }, c = {
55
54
  [E.ethMainnet]: "0xdaC7Fb8AC2e47F412e8556Fd13256D90FBae08CD",
56
55
  [E.polygon]: "0x9759Baf5eEfa817E3FdF4C488ED51a334e948C05",
57
56
  [E.optimism]: "0xDe6A7d13c7E01582F5989b14cdf64d4bc6608364",
@@ -59,7 +58,7 @@ const F = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", A = {
59
58
  [E.bnbMainnet]: "0x5fa6773A7dC2CA3fB411f9Ef157F30e91aa1e53d",
60
59
  [E.avalanche]: "0xD201f9ae495b23805C12ed74a816AE4ef0c00b05",
61
60
  [E.base]: "0x86B9e7F2698C0776b988085b5Ca8d7D6A1Dff74b"
62
- }, x = {
61
+ }, d = {
63
62
  [E.ethMainnet]: "0x1D69943ea7D9874b43f9FbcC2B6a4f0f433F602d",
64
63
  [E.polygon]: "0x5181606B45302Bb7b83e03DC7c5390ec9e4d973f",
65
64
  [E.optimism]: "0x0720a259A8CaBb9ef0F6a6334fEB4da5f45a8579",
@@ -71,9 +70,9 @@ const F = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", A = {
71
70
  [E.base]: "0xB69B207994506697196E5C1Ce40233c06040BB79"
72
71
  };
73
72
  export {
74
- c as NATIVE_TOKEN_WRAPPER_ADDRESSES,
75
- x as SWAP_FEE_TAKER_ADDRESSES,
76
- A as SWAP_ROUTER_ADDRESSES,
77
- F as WETH_ERC20_TOKEN_ADDRESS,
78
- d as WRAPPER_TOKEN_EXCHANGE_ADDRESSES
73
+ A as NATIVE_TOKEN_WRAPPER_ADDRESSES,
74
+ d as SWAP_FEE_TAKER_ADDRESSES,
75
+ F as SWAP_ROUTER_ADDRESSES,
76
+ D as WETH_ERC20_TOKEN_ADDRESS,
77
+ c as WRAPPER_TOKEN_EXCHANGE_ADDRESSES
79
78
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("ethers"),r=require("../externalABIs/index.cjs"),b=require("../externalABIs/ERC20.json.cjs"),h=require("../externalABIs/IQuoterV2.json.cjs"),A=require("../externalABIs/IUniswapV3Factory.json.cjs"),w=require("../externalABIs/IUniswapV3Pool.json.cjs"),k=require("../externalABIs/UniswapV2PoolAbi.json.cjs"),i=require("./chains.constants.cjs"),e=require("../types/ethereum-network.types.cjs"),o={abi:A.default.abi},s={abi:w.default.abi},c={abi:k.default.abi},p={abi:h.default.abi},y={[e.ContractType.HinkalContract]:t=>({abi:t.hinkalABI,address:t.hinkalAddress}),[e.ContractType.HinkalHelperContract]:t=>({abi:t.hinkalHelperABI,address:t.hinkalHelperAddress}),[e.ContractType.AccessTokenContract]:t=>({abi:t.accessTokenABI,address:t.accessTokenAddress}),[e.ContractType.MerkleTreeContract]:()=>({abi:new n.ethers.utils.Interface(["function getRootHash() public view returns (uint256)"])}),[e.ContractType.UniswapV3FactoryContract]:()=>({abi:o.abi}),[e.ContractType.UniswapV3PoolContract]:()=>({abi:s.abi}),[e.ContractType.UniswapV2PoolContract]:()=>({abi:c.abi}),[e.ContractType.UniswapV3QuoterContract]:()=>({abi:p.abi}),[e.ContractType.ERC20Contract]:()=>({abi:b.default.abi}),[e.ContractType.ERC721Contract]:()=>({abi:r.ERC721ABI}),[e.ContractType.ERC1155Contract]:()=>({abi:r.ERC1155ABI}),[e.ContractType.WATokenContract]:t=>({abi:t.waTokenABI}),[e.ContractType.ContractWithNonces]:()=>({abi:new n.ethers.utils.Interface(["function nonces(address owner) external view returns (uint)"])}),[e.ContractType.PermitterContract]:t=>({abi:t.permitterABI,address:t.permitterAddress}),[e.ContractType.OneInchExternalActionContract]:t=>({address:t.oneInchExternalActionInstanceAddress}),[e.ContractType.HinkalWrapper]:t=>({abi:t.hinkalWrapperABI,address:t.hinkalWrapperAddress}),[e.ContractType.HinkalWrapper2]:t=>({abi:t.HinkalWrapper2ABI??t.hinkalWrapperABI,address:t.hinkalWrapper2Address??t.hinkalWrapperAddress}),[e.ContractType.DepositOnChainUtxos]:t=>({abi:t.depositOnChainUtxosExternalActionABI,address:t.depositOnChainUtxosExternalActionAddress})},T=t=>{const{contractData:d}=i.networkRegistry[i.getNonLocalhostChainId(t)],l=JSON.stringify(d.hinkalABI),a=new n.utils.Interface(l),C=a.getSighash("transact"),u=a.getSighash("transactWithExternalAction");return{hinkalInterface:a,transactMethodId:C,transactWithExternalActionMethodId:u,NewCommitment:"NewCommitment",NewCommitmentTopic:"0xc2e3bd2d00c3cf4d09298e5a0cfd317cf7a6e5bf15d467cfa805a91e1a4a221d"}};exports.contractMetadataMapping=y;exports.getHinkalParameters=T;exports.uniswapV2PoolData=c;exports.uniswapV3FactoryData=o;exports.uniswapV3PoolData=s;exports.uniswapV3QuoterData=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("ethers"),n=require("../externalABIs/index.cjs"),b=require("../externalABIs/ERC20.json.cjs"),A=require("../externalABIs/IQuoterV2.json.cjs"),h=require("../externalABIs/IUniswapV3Factory.json.cjs"),k=require("../externalABIs/IUniswapV3Pool.json.cjs"),w=require("../externalABIs/UniswapV2PoolAbi.json.cjs"),r=require("./chains.constants.cjs"),e=require("../types/ethereum-network.types.cjs"),o={abi:h.default.abi},i={abi:k.default.abi},s={abi:w.default.abi},c={abi:A.default.abi},y={[e.ContractType.HinkalContract]:t=>({abi:t.hinkalABI,address:t.hinkalAddress}),[e.ContractType.HinkalHelperContract]:t=>({abi:t.hinkalHelperABI,address:t.hinkalHelperAddress}),[e.ContractType.AccessTokenContract]:t=>({abi:t.accessTokenABI,address:t.accessTokenAddress}),[e.ContractType.MerkleTreeContract]:()=>({abi:["function getRootHash() public view returns (uint256)"]}),[e.ContractType.UniswapV3FactoryContract]:()=>({abi:o.abi}),[e.ContractType.UniswapV3PoolContract]:()=>({abi:i.abi}),[e.ContractType.UniswapV2PoolContract]:()=>({abi:s.abi}),[e.ContractType.UniswapV3QuoterContract]:()=>({abi:c.abi}),[e.ContractType.ERC20Contract]:()=>({abi:b.default.abi}),[e.ContractType.ERC721Contract]:()=>({abi:n.ERC721ABI}),[e.ContractType.ERC1155Contract]:()=>({abi:n.ERC1155ABI}),[e.ContractType.WATokenContract]:t=>({abi:t.waTokenABI}),[e.ContractType.ContractWithNonces]:()=>({abi:["function nonces(address owner) external view returns (uint)"]}),[e.ContractType.PermitterContract]:t=>({abi:t.permitterABI,address:t.permitterAddress}),[e.ContractType.OneInchExternalActionContract]:t=>({address:t.oneInchExternalActionInstanceAddress}),[e.ContractType.HinkalWrapper]:t=>({abi:t.hinkalWrapperABI,address:t.hinkalWrapperAddress}),[e.ContractType.HinkalWrapper2]:t=>({abi:t.HinkalWrapper2ABI??t.hinkalWrapperABI,address:t.hinkalWrapper2Address??t.hinkalWrapperAddress}),[e.ContractType.DepositOnChainUtxos]:t=>({abi:t.depositOnChainUtxosExternalActionABI,address:t.depositOnChainUtxosExternalActionAddress})},T=t=>{const{contractData:p}=r.networkRegistry[r.getNonLocalhostChainId(t)],d=JSON.stringify(p.hinkalABI),a=new u.ethers.Interface(d),l=a.getFunction("transact")?.selector,C=a.getFunction("transactWithExternalAction")?.selector;return{hinkalInterface:a,transactMethodId:l,transactWithExternalActionMethodId:C,NewCommitment:"NewCommitment",NewCommitmentTopic:"0xc2e3bd2d00c3cf4d09298e5a0cfd317cf7a6e5bf15d467cfa805a91e1a4a221d"}};exports.contractMetadataMapping=y;exports.getHinkalParameters=T;exports.uniswapV2PoolData=s;exports.uniswapV3FactoryData=o;exports.uniswapV3PoolData=i;exports.uniswapV3QuoterData=c;
@@ -111,9 +111,9 @@ export declare const uniswapV3QuoterData: {
111
111
  };
112
112
  export declare const contractMetadataMapping: Record<ContractType, (contractData: ContractData) => ContractMetadata>;
113
113
  export declare const getHinkalParameters: (chainId: number) => {
114
- hinkalInterface: ethers.utils.Interface;
115
- transactMethodId: string;
116
- transactWithExternalActionMethodId: string;
114
+ hinkalInterface: ethers.Interface;
115
+ transactMethodId: string | undefined;
116
+ transactWithExternalActionMethodId: string | undefined;
117
117
  NewCommitment: string;
118
118
  NewCommitmentTopic: string;
119
119
  };