@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,6 +1,5 @@
1
1
  import { IntegrationProvider } from './hinkal.types';
2
2
  import { ERC20Token } from './token.types';
3
- import { BigNumber } from 'ethers';
4
3
  export declare enum ActivityStatus {
5
4
  PENDING = "PENDING",
6
5
  SUCCESSFUL = "SUCCESSFUL",
@@ -51,8 +50,8 @@ export interface ActivityAddRequest {
51
50
  value?: string;
52
51
  status?: ActivityStatus;
53
52
  txHash?: string;
54
- gas?: BigNumber;
55
- gasPrice?: BigNumber;
53
+ gas?: bigint;
54
+ gasPrice?: bigint;
56
55
  gasInDollar?: string;
57
56
  tokensReceive?: TokenAmountInfo[];
58
57
  tokensSpend?: TokenAmountInfo[];
@@ -1,2 +1,3 @@
1
- import { BigNumber } from 'ethers';
2
- export type BigIntable = BigNumber | string | number | boolean | bigint;
1
+ export type BigIntable = string | number | boolean | bigint | {
2
+ toBigInt: () => bigint;
3
+ };
@@ -1,7 +1,7 @@
1
- import { ContractInterface } from 'ethers';
1
+ import type { InterfaceAbi } from 'ethers';
2
2
  import type { Idl } from '@coral-xyz/anchor';
3
3
  export type ContractMetadata = {
4
- abi?: ContractInterface;
4
+ abi?: InterfaceAbi;
5
5
  address?: string;
6
6
  };
7
7
  export declare enum ContractType {
@@ -26,27 +26,27 @@ export declare enum ContractType {
26
26
  }
27
27
  export interface ContractData {
28
28
  hinkalAddress: string;
29
- hinkalABI?: ContractInterface;
29
+ hinkalABI?: InterfaceAbi;
30
30
  hinkalIdl?: Idl;
31
31
  hinkalHelperAddress?: string;
32
- hinkalHelperABI?: ContractInterface;
32
+ hinkalHelperABI?: InterfaceAbi;
33
33
  accessTokenAddress?: string;
34
- accessTokenABI?: ContractInterface;
34
+ accessTokenABI?: InterfaceAbi;
35
35
  permitterAddress?: string;
36
- permitterABI?: ContractInterface;
36
+ permitterABI?: InterfaceAbi;
37
37
  uniswapExternalActionAddress?: string;
38
38
  odosExternalActionInstanceAddress?: string;
39
39
  oneInchExternalActionInstanceAddress?: string;
40
- waTokenABI?: ContractInterface;
40
+ waTokenABI?: InterfaceAbi;
41
41
  hinkalWrapperAddress?: string;
42
42
  hinkalWrapper2Address?: string;
43
- hinkalWrapperABI?: ContractInterface;
44
- HinkalWrapper2ABI?: ContractInterface;
43
+ hinkalWrapperABI?: InterfaceAbi;
44
+ HinkalWrapper2ABI?: InterfaceAbi;
45
45
  emporiumAddress?: string;
46
46
  hinkalWalletAddress?: string;
47
47
  originalDeployer?: string;
48
48
  depositOnChainUtxosExternalActionAddress?: string;
49
- depositOnChainUtxosExternalActionABI?: ContractInterface;
49
+ depositOnChainUtxosExternalActionABI?: InterfaceAbi;
50
50
  }
51
51
  export interface EthereumNetwork {
52
52
  name: string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("ethers"),u=d.BigNumber.from(0),p={blockNumber:0,timeStamp:0,methodId:"",input:"",decodedInput:{erc20TokenAddresses:[],amountChanges:[],flatFees:[0n,0n].map(e=>d.BigNumber.from(e)),externalActionId:u,externalActionMetadata:"",encryptedOutputs:[],hookData:{hookContract:"",preHookContract:"",preHookMetadata:"",postHookMetadata:""},stealthAddressStructure:{extraRandomization:0n,stealthAddress:0n,H0:0n,H1:0n}},logs:[],hash:"",gas:0,gasPrice:0,isError:"",status:""};var m=(e=>(e[e.NotStarted=0]="NotStarted",e[e.Loading=1]="Loading",e[e.Confirmed=2]="Confirmed",e[e.Failed=3]="Failed",e))(m||{}),r=(e=>(e[e.None=0]="None",e[e.Deposit=1]="Deposit",e[e.Mint=2]="Mint",e[e.PoolAdd=3]="PoolAdd",e[e.PoolRemove=4]="PoolRemove",e[e.Redeem=5]="Redeem",e[e.Swap=6]="Swap",e[e.Bridge=7]="Bridge",e[e.Transfer=8]="Transfer",e[e.Withdraw=9]="Withdraw",e[e.Send=10]="Send",e[e.Fund=11]="Fund",e[e.Receive=12]="Receive",e))(r||{}),l=(e=>(e[e.Failed=0]="Failed",e[e.Succeeded=1]="Succeeded",e))(l||{});exports.TransactionAction=r;exports.TransactionReceiptStatus=l;exports.TransactionStatus=m;exports.emptyDecodedTx=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=0n,p={blockNumber:0,timeStamp:0,methodId:"",input:"",decodedInput:{erc20TokenAddresses:[],amountChanges:[],flatFees:[0n,0n],externalActionId:r,externalActionMetadata:"",encryptedOutputs:[],hookData:{hookContract:"",preHookContract:"",preHookMetadata:"",postHookMetadata:""},stealthAddressStructure:{extraRandomization:0n,stealthAddress:0n,H0:0n,H1:0n}},logs:[],hash:"",gas:0,gasPrice:0,isError:"",status:""};var d=(e=>(e[e.NotStarted=0]="NotStarted",e[e.Loading=1]="Loading",e[e.Confirmed=2]="Confirmed",e[e.Failed=3]="Failed",e))(d||{}),l=(e=>(e[e.None=0]="None",e[e.Deposit=1]="Deposit",e[e.Mint=2]="Mint",e[e.PoolAdd=3]="PoolAdd",e[e.PoolRemove=4]="PoolRemove",e[e.Redeem=5]="Redeem",e[e.Swap=6]="Swap",e[e.Bridge=7]="Bridge",e[e.Transfer=8]="Transfer",e[e.Withdraw=9]="Withdraw",e[e.Send=10]="Send",e[e.Fund=11]="Fund",e[e.Receive=12]="Receive",e))(l||{}),m=(e=>(e[e.Failed=0]="Failed",e[e.Succeeded=1]="Succeeded",e))(m||{});exports.TransactionAction=l;exports.TransactionReceiptStatus=m;exports.TransactionStatus=d;exports.emptyDecodedTx=p;
@@ -1,4 +1,3 @@
1
- import { BigNumber } from 'ethers';
2
1
  import { HookDataType, StealthAddressStructure } from './circom-data.types';
3
2
  export interface RawTx {
4
3
  blockNumber: number;
@@ -29,7 +28,7 @@ export interface EventLog {
29
28
  transactionHash: string;
30
29
  transactionIndex: string;
31
30
  }
32
- export interface DecodedTx<T = bigint, K = BigNumber> extends RawTx {
31
+ export interface DecodedTx<T = bigint, K = bigint> extends RawTx {
33
32
  decodedInput: {
34
33
  erc20TokenAddresses: string[];
35
34
  amountChanges: K[];
@@ -42,7 +41,7 @@ export interface DecodedTx<T = bigint, K = BigNumber> extends RawTx {
42
41
  };
43
42
  status: string;
44
43
  }
45
- export interface DecodedTxWithUtxos<T = bigint, K = BigNumber> extends DecodedTx<T, K> {
44
+ export interface DecodedTxWithUtxos<T = bigint, K = bigint> extends DecodedTx<T, K> {
46
45
  utxosArray?: OnChainUtxo<T>[];
47
46
  }
48
47
  export type OnChainUtxo<AmountType = bigint> = {
@@ -1,5 +1,4 @@
1
- import { BigNumber as d } from "ethers";
2
- const m = d.from(0), h = {
1
+ const d = 0n, h = {
3
2
  blockNumber: 0,
4
3
  timeStamp: 0,
5
4
  methodId: "",
@@ -7,8 +6,8 @@ const m = d.from(0), h = {
7
6
  decodedInput: {
8
7
  erc20TokenAddresses: [],
9
8
  amountChanges: [],
10
- flatFees: [0n, 0n].map((e) => d.from(e)),
11
- externalActionId: m,
9
+ flatFees: [0n, 0n],
10
+ externalActionId: d,
12
11
  externalActionMetadata: "",
13
12
  encryptedOutputs: [],
14
13
  hookData: {
@@ -31,10 +30,10 @@ const m = d.from(0), h = {
31
30
  isError: "",
32
31
  status: ""
33
32
  };
34
- var l = /* @__PURE__ */ ((e) => (e[e.NotStarted = 0] = "NotStarted", e[e.Loading = 1] = "Loading", e[e.Confirmed = 2] = "Confirmed", e[e.Failed = 3] = "Failed", e))(l || {}), p = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Deposit = 1] = "Deposit", e[e.Mint = 2] = "Mint", e[e.PoolAdd = 3] = "PoolAdd", e[e.PoolRemove = 4] = "PoolRemove", e[e.Redeem = 5] = "Redeem", e[e.Swap = 6] = "Swap", e[e.Bridge = 7] = "Bridge", e[e.Transfer = 8] = "Transfer", e[e.Withdraw = 9] = "Withdraw", e[e.Send = 10] = "Send", e[e.Fund = 11] = "Fund", e[e.Receive = 12] = "Receive", e))(p || {}), r = /* @__PURE__ */ ((e) => (e[e.Failed = 0] = "Failed", e[e.Succeeded = 1] = "Succeeded", e))(r || {});
33
+ var l = /* @__PURE__ */ ((e) => (e[e.NotStarted = 0] = "NotStarted", e[e.Loading = 1] = "Loading", e[e.Confirmed = 2] = "Confirmed", e[e.Failed = 3] = "Failed", e))(l || {}), m = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Deposit = 1] = "Deposit", e[e.Mint = 2] = "Mint", e[e.PoolAdd = 3] = "PoolAdd", e[e.PoolRemove = 4] = "PoolRemove", e[e.Redeem = 5] = "Redeem", e[e.Swap = 6] = "Swap", e[e.Bridge = 7] = "Bridge", e[e.Transfer = 8] = "Transfer", e[e.Withdraw = 9] = "Withdraw", e[e.Send = 10] = "Send", e[e.Fund = 11] = "Fund", e[e.Receive = 12] = "Receive", e))(m || {}), p = /* @__PURE__ */ ((e) => (e[e.Failed = 0] = "Failed", e[e.Succeeded = 1] = "Succeeded", e))(p || {});
35
34
  export {
36
- p as TransactionAction,
37
- r as TransactionReceiptStatus,
35
+ m as TransactionAction,
36
+ p as TransactionReceiptStatus,
38
37
  l as TransactionStatus,
39
38
  h as emptyDecodedTx
40
39
  };
@@ -1 +1 @@
1
- "use strict";const e=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/../../assets/utxoWorkerLauncher-CBMN4NR_.js").href:new URL("../../assets/utxoWorkerLauncher-CBMN4NR_.js",document.currentScript&&document.currentScript.src||document.baseURI).href);module.exports=e;
1
+ "use strict";const e=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/../../assets/utxoWorkerLauncher-DIu_LMBb.js").href:new URL("../../assets/utxoWorkerLauncher-DIu_LMBb.js",document.currentScript&&document.currentScript.src||document.baseURI).href);module.exports=e;
@@ -1,4 +1,4 @@
1
- const e = "" + new URL("../../assets/utxoWorkerLauncher-CBMN4NR_.js", import.meta.url).href;
1
+ const e = "" + new URL("../../assets/utxoWorkerLauncher-DIu_LMBb.js", import.meta.url).href;
2
2
  export {
3
3
  e as default
4
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const k=require("../../crypto/preProcessing.cjs"),l=require("../../data-structures/crypto-keys/keys.cjs"),f=require("../../data-structures/utxo/Utxo.cjs"),h=require("../../data-structures/crypto-keys/encryptDecryptUtxo.cjs"),y=require("../../data-structures/crypto-keys/decodeUTXO.cjs"),T=require("../../error-handling/logger.cjs"),w=require("../workerProxy.cjs"),d=require("./utxoWorker.types.cjs"),n=new w.WorkerProxy,p=async({data:e})=>{const{utxos:t,nullifiers:s}=e,i=t.filter(r=>{const c=new f.Utxo(r);return!s.has(c.getNullifier())});n.postMessageToMainThread({utxoConstructors:i,stealthPairCache:l.stealthPairCacheDevice.serialize(),stealthAddressCache:l.stealthAddressCacheDevice.serialize()})},g=async({data:e})=>{const t=new l.UserKeys(e.signature),s=t.getShieldedPrivateKey(),i=e.encryptedOutputs.map(r=>{try{const c=r.isPositive?h.decryptUtxoConstructorArgs(Buffer.from(r.value.slice(2),"hex"),t):y.decodeUtxoConstructorArgs(r.value,s,e.chainId);return c.isBlocked=r.isBlocked,c}catch{return}}).filter(r=>r!==void 0&&r.amount!==0n);n.postMessageToMainThread(i)},x=async({data:e})=>{const t=new l.UserKeys(e.signature),s=[],{encryptedOutputs:i}=e;let{lastOutput:r}=e;const c=t.getShieldedPrivateKey();for(let u=0;u<i.length;u+=1){const a=i[u];if(r=a.value,a.isPositive)try{const o=h.decryptUtxo(Buffer.from(r.slice(2),"hex"),t);if(o.isBlocked=a.isBlocked,!o.erc20TokenAddress||!o.amount||!o.stealthAddress)throw Error("bruh");s.push(a)}catch{}else try{y.checkUtxoSignature(r,c,e.chainId)&&s.push(a)}catch{}}n.postMessageToMainThread({additionalEncryptedOutputs:s,lastOutput:r})},U=async e=>{try{await k.preProcessing();const{type:t}=e.payload;switch(t){case d.UtxoWorkerActionType.BATCH_FILTER_UTXOS_WITH_NULLIFIER:await p(e.payload);return;case d.UtxoWorkerActionType.BUILD_UTXOS:await g(e.payload);return;case d.UtxoWorkerActionType.DECIPHER_OUTPUTS:await x(e.payload);return;default:throw Error(`Unknown worker message type ${t}`)}}catch(t){T.Logger.error("utxo worker message failed",t),n.postErrorToMainThread(t)}};n.attachWorkerSideOnMessage(U);exports.default=n;exports.handleBuildUtxosMessage=g;exports.handleDecipherMessage=x;exports.handleFilterUtxosWithNullifier=p;exports.onWorkerMessage=U;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const k=require("../../crypto/preProcessing.cjs"),l=require("../../data-structures/crypto-keys/keys.cjs"),f=require("../../data-structures/utxo/Utxo.cjs"),h=require("../../data-structures/crypto-keys/encryptDecryptUtxo.cjs"),y=require("../../data-structures/crypto-keys/decodeUTXO.cjs"),T=require("../../error-handling/logger.cjs"),w=require("../workerProxy.cjs"),d=require("./utxoWorker.types.cjs"),n=new w.WorkerProxy,p=async({data:e})=>{const{utxos:t,nullifiers:s}=e,i=t.filter(r=>{const c=new f.Utxo(r);return!s.has(c.getNullifier())});n.postMessageToMainThread({utxoConstructors:i,stealthPairCache:l.stealthPairCacheDevice.serialize(),stealthAddressCache:l.stealthAddressCacheDevice.serialize()})},g=async({data:e})=>{const t=new l.UserKeys(e.signature),s=t.getShieldedPrivateKey(),i=e.encryptedOutputs.map(r=>{try{const c=r.isPositive?h.decryptUtxoConstructorArgs(Buffer.from(r.value.slice(2),"hex"),t):y.decodeUtxoConstructorArgs(r.value,s,e.chainId);return c.isBlocked=r.isBlocked,c}catch{return}}).filter(r=>r!==void 0&&r.amount!==0n);n.postMessageToMainThread(i)},x=async({data:e})=>{const t=new l.UserKeys(e.signature),s=[],{encryptedOutputs:i}=e;let{lastOutput:r}=e;const c=t.getShieldedPrivateKey();for(let u=0;u<i.length;u+=1){const a=i[u];if(r=a.value,a.isPositive)try{const o=h.decryptUtxo(Buffer.from(r.slice(2),"hex"),t);if(o.isBlocked=a.isBlocked,!o.erc20TokenAddress||!o.amount||!o.stealthAddress)throw Error("bruh");s.push(a)}catch{}else try{y.checkUtxoSignature(r,c,e.chainId)&&s.push(a)}catch{}}n.postMessageToMainThread({additionalEncryptedOutputs:s,lastOutput:r})},U=async e=>{try{await k.preProcessing();const{type:t}=e.payload;switch(t){case d.UtxoWorkerActionType.BATCH_FILTER_UTXOS_WITH_NULLIFIER:await p(e.payload);return;case d.UtxoWorkerActionType.BUILD_UTXOS:await g(e.payload);return;case d.UtxoWorkerActionType.DECIPHER_OUTPUTS:await x(e.payload);return;default:throw Error(`Unknown worker message type ${t}`)}}catch(t){T.Logger.error("utxo worker message failed",t,e),n.postErrorToMainThread(t)}};n.attachWorkerSideOnMessage(U);exports.default=n;exports.handleBuildUtxosMessage=g;exports.handleDecipherMessage=x;exports.handleFilterUtxosWithNullifier=p;exports.onWorkerMessage=U;
@@ -65,7 +65,7 @@ const n = new k(), w = async ({ data: e }) => {
65
65
  throw Error(`Unknown worker message type ${t}`);
66
66
  }
67
67
  } catch (t) {
68
- T.error("utxo worker message failed", t), n.postErrorToMainThread(t);
68
+ T.error("utxo worker message failed", t, e), n.postErrorToMainThread(t);
69
69
  }
70
70
  };
71
71
  n.attachWorkerSideOnMessage(M);
@@ -1 +1 @@
1
- "use strict";const e=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/../../assets/zkProofWorkerLauncher-yJp7qc7F.js").href:new URL("../../assets/zkProofWorkerLauncher-yJp7qc7F.js",document.currentScript&&document.currentScript.src||document.baseURI).href);module.exports=e;
1
+ "use strict";const e=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/../../assets/zkProofWorkerLauncher-EF0nGZ3A.js").href:new URL("../../assets/zkProofWorkerLauncher-EF0nGZ3A.js",document.currentScript&&document.currentScript.src||document.baseURI).href);module.exports=e;
@@ -1,4 +1,4 @@
1
- const r = "" + new URL("../../assets/zkProofWorkerLauncher-yJp7qc7F.js", import.meta.url).href;
1
+ const r = "" + new URL("../../assets/zkProofWorkerLauncher-EF0nGZ3A.js", import.meta.url).href;
2
2
  export {
3
3
  r as default
4
4
  };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=async(e,s,...r)=>{if(!e.filters?.[s])throw new Error("Contract Event not found");return await e.queryFilter(e.filters?.[s](...r),39561411)},o=async(e,s)=>(await n(e,"NewTransaction")).map(t=>t.args[1]===s&&BigInt(t.args[2])>=0n?new Date(t.args[0]*1e3):new Date(0)).filter(t=>t.getTime()!==0);exports.getDepositEvents=o;exports.retrieveEvents=n;
@@ -1,14 +0,0 @@
1
- import { Contract, ethers } from 'ethers';
2
- /**
3
- * to get contract events
4
- * @param eventName to retrieve specific events
5
- * @param eventArgs event arguments
6
- * @returns array of the specific events
7
- */
8
- export declare const retrieveEvents: (hinkalContract: ethers.Contract, eventName: string, ...eventArgs: unknown[]) => Promise<ethers.Event[]>;
9
- /**
10
- *
11
- * @param web3Provider instance to get hinkal contract
12
- * @returns array of deposit timestamps in JS new Date format
13
- */
14
- export declare const getDepositEvents: (hinkalContract: Contract, erc20TokenAddress: string) => Promise<Date[]>;
@@ -1,9 +0,0 @@
1
- const i = async (e, s, ...n) => {
2
- if (!e.filters?.[s])
3
- throw new Error("Contract Event not found");
4
- return await e.queryFilter(e.filters?.[s](...n), 39561411);
5
- }, o = async (e, s) => (await i(e, "NewTransaction")).map((t) => t.args[1] === s && BigInt(t.args[2]) >= 0n ? new Date(t.args[0] * 1e3) : /* @__PURE__ */ new Date(0)).filter((t) => t.getTime() !== 0);
6
- export {
7
- o as getDepositEvents,
8
- i as retrieveEvents
9
- };