@hinkal/common 0.2.9 → 0.2.11

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 (284) hide show
  1. package/API/API.d.mts +49 -0
  2. package/API/HinkalPointsCalls.d.mts +20 -0
  3. package/API/callBeefyGraphAPI.d.mts +2 -0
  4. package/API/callCurveAPI.d.mts +9 -0
  5. package/API/callMonitor.d.mts +1 -0
  6. package/API/callOdosAPI.d.mts +63 -0
  7. package/API/callOneInchAPI.d.mts +18 -0
  8. package/API/callRelayer.d.mts +10 -0
  9. package/API/checkRisk.d.mts +1 -0
  10. package/API/dataServerCalls.d.mts +2 -0
  11. package/API/duneAPI.d.mts +11 -0
  12. package/API/fetchCommitmentsCache.d.mts +20 -0
  13. package/API/fetchNullifiers.d.mts +5 -0
  14. package/API/getAxelarGasEstimate.d.mts +5 -0
  15. package/API/getCoingeckoPrice.d.mts +22 -0
  16. package/API/getConnextReceiveFee.d.mts +2 -0
  17. package/API/getGasEstimates.d.mts +9 -0
  18. package/API/getRelayerURL.d.mts +1 -0
  19. package/API/getServerURL.d.mts +2 -0
  20. package/API/getTokenPrice.d.mts +16 -0
  21. package/API/index.d.mts +14 -0
  22. package/API/kycCalls.d.mts +30 -0
  23. package/API/passwordCalls.d.mts +9 -0
  24. package/API/referralProgramCalls.d.mts +36 -0
  25. package/API/relayCalls.d.mts +5 -0
  26. package/API/restoreSnapshots.d.mts +1 -0
  27. package/API/rewardsPointsCalls.d.mts +13 -0
  28. package/API/userVerifyTransactions.d.mts +19 -0
  29. package/constants/assets.constants.d.mts +13 -0
  30. package/constants/axelar.constants.d.mts +5 -0
  31. package/constants/backend.constants.d.mts +11 -0
  32. package/constants/beefy.registry.d.mts +8 -0
  33. package/constants/chains.constants.d.mts +36 -0
  34. package/constants/coingecko.constants.d.mts +13 -0
  35. package/constants/contracts.constants.d.mts +119 -0
  36. package/constants/crvCvx.registry.d.mts +20 -0
  37. package/constants/crvDynamic.registry.d.mts +1 -0
  38. package/constants/deploy-data/index.d.mts +11 -0
  39. package/constants/fees.constants.d.mts +11 -0
  40. package/constants/index.d.mts +20 -0
  41. package/constants/kyc.constants.d.mts +28 -0
  42. package/constants/lido.constants.d.mts +10 -0
  43. package/constants/pendle.registry.d.mts +21 -0
  44. package/constants/protocol.constants.d.mts +18 -0
  45. package/constants/reorg-depths.constants.d.mts +3 -0
  46. package/constants/rewards.constants.d.mts +19 -0
  47. package/constants/server.constants.d.mts +155 -0
  48. package/constants/token-data/ERC20Registry.d.mts +3 -0
  49. package/constants/token-data/index.d.mts +976 -0
  50. package/constants/token-data/popularTokens.constants.d.mts +3 -0
  51. package/constants/token-data/tokenPricing.consts.d.mts +5 -0
  52. package/constants/vite.constants.d.mts +14 -0
  53. package/crypto/babyJub.d.mts +16 -0
  54. package/crypto/index.d.mts +3 -0
  55. package/crypto/poseidon.d.mts +15 -0
  56. package/crypto/preProcessing.d.mts +1 -0
  57. package/data-structures/Hinkal/Hinkal.d.mts +100 -0
  58. package/data-structures/Hinkal/IHinkal.d.mts +93 -0
  59. package/data-structures/Hinkal/hinkalActionBeefy.d.mts +3 -0
  60. package/data-structures/Hinkal/hinkalActionConvex.d.mts +12 -0
  61. package/data-structures/Hinkal/hinkalActionCurve.d.mts +12 -0
  62. package/data-structures/Hinkal/hinkalActionLidoEth.d.mts +4 -0
  63. package/data-structures/Hinkal/hinkalActionPendle.d.mts +3 -0
  64. package/data-structures/Hinkal/hinkalActionPendleLP.d.mts +7 -0
  65. package/data-structures/Hinkal/hinkalActionStake.d.mts +3 -0
  66. package/data-structures/Hinkal/hinkalActionVolatile.d.mts +3 -0
  67. package/data-structures/Hinkal/hinkalDeposit.d.mts +3 -0
  68. package/data-structures/Hinkal/hinkalGetRecipientInfo.d.mts +2 -0
  69. package/data-structures/Hinkal/hinkalGetZkMeProvider.d.mts +3 -0
  70. package/data-structures/Hinkal/hinkalPrivateWallet.d.mts +2 -0
  71. package/data-structures/Hinkal/hinkalSwap.d.mts +3 -0
  72. package/data-structures/Hinkal/hinkalTransfer.d.mts +1 -0
  73. package/data-structures/Hinkal/hinkalWithdraw.d.mts +2 -0
  74. package/data-structures/Hinkal/index.d.mts +12 -0
  75. package/data-structures/Hinkal/resetMerkleTrees.d.mts +2 -0
  76. package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.d.mts +20 -0
  77. package/data-structures/ValueCache/ValueCache.d.mts +10 -0
  78. package/data-structures/ValueCache/index.d.mts +1 -0
  79. package/data-structures/cacheDevices/BaseCacheDevice.d.mts +8 -0
  80. package/data-structures/cacheDevices/FileCacheDevice.d.mts +9 -0
  81. package/data-structures/cacheDevices/LocalStorageCacheDevice.d.mts +7 -0
  82. package/data-structures/cacheDevices/index.d.mts +2 -0
  83. package/data-structures/crypto-keys/decodeUTXO.d.mts +14 -0
  84. package/data-structures/crypto-keys/encryptDecryptUtxo.d.mts +18 -0
  85. package/data-structures/crypto-keys/index.d.mts +4 -0
  86. package/data-structures/crypto-keys/keyUtils.d.mts +2 -0
  87. package/data-structures/crypto-keys/keys.d.mts +58 -0
  88. package/data-structures/custom-token-registry/CustomTokenRegistry.d.mts +13 -0
  89. package/data-structures/event-service/AbstractAccessTokenSnapshotService.d.mts +35 -0
  90. package/data-structures/event-service/AbstractCommitmentsSnapshotService.d.mts +30 -0
  91. package/data-structures/event-service/AbstractEventService.cjs +1 -1
  92. package/data-structures/event-service/AbstractEventService.d.mts +31 -0
  93. package/data-structures/event-service/AbstractEventService.mjs +42 -30
  94. package/data-structures/event-service/AbstractNullifierSnapshotService.d.mts +22 -0
  95. package/data-structures/event-service/AbstractSnapshotService.d.mts +23 -0
  96. package/data-structures/event-service/index.d.mts +5 -0
  97. package/data-structures/index.d.mts +13 -0
  98. package/data-structures/merkle-tree/MerkleTree.d.mts +78 -0
  99. package/data-structures/merkle-tree/MerkleTreeIncompleteError.d.mts +3 -0
  100. package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.d.mts +3 -0
  101. package/data-structures/merkle-tree/index.d.mts +3 -0
  102. package/data-structures/provider-adapter/IProviderAdapter.d.mts +35 -0
  103. package/data-structures/snapshot/ClientAccessTokenSnapshotService.cjs +1 -1
  104. package/data-structures/snapshot/ClientAccessTokenSnapshotService.d.mts +7 -0
  105. package/data-structures/snapshot/ClientAccessTokenSnapshotService.mjs +10 -5
  106. package/data-structures/snapshot/ClientCommitmentsSnapshotService.cjs +1 -1
  107. package/data-structures/snapshot/ClientCommitmentsSnapshotService.d.mts +7 -0
  108. package/data-structures/snapshot/ClientCommitmentsSnapshotService.mjs +10 -5
  109. package/data-structures/snapshot/ClientNullifierSnapshotService.cjs +1 -1
  110. package/data-structures/snapshot/ClientNullifierSnapshotService.d.mts +7 -0
  111. package/data-structures/snapshot/ClientNullifierSnapshotService.mjs +8 -3
  112. package/data-structures/token-price-fetcher/TokenChecker.d.mts +20 -0
  113. package/data-structures/token-price-fetcher/index.d.mts +1 -0
  114. package/data-structures/transactions-manager/TransactionsManager.d.mts +27 -0
  115. package/data-structures/transactions-manager/history/getBeefyData.d.mts +3 -0
  116. package/data-structures/transactions-manager/history/getConvexData.d.mts +6 -0
  117. package/data-structures/transactions-manager/history/getCurveData.d.mts +6 -0
  118. package/data-structures/transactions-manager/history/getDepositData.d.mts +2 -0
  119. package/data-structures/transactions-manager/history/getLidoData.d.mts +10 -0
  120. package/data-structures/transactions-manager/history/getPendleData.d.mts +3 -0
  121. package/data-structures/transactions-manager/history/getSwapData.d.mts +3 -0
  122. package/data-structures/transactions-manager/history/getTxDetails.d.mts +3 -0
  123. package/data-structures/transactions-manager/history/getVolatileData.d.mts +32 -0
  124. package/data-structures/transactions-manager/history/history.types.d.mts +95 -0
  125. package/data-structures/transactions-manager/history/history.utils.d.mts +8 -0
  126. package/data-structures/transactions-manager/index.d.mts +2 -0
  127. package/data-structures/utxo/Utxo.d.mts +63 -0
  128. package/data-structures/volatile-helper/VolatileHelper.d.mts +57 -0
  129. package/data-structures/volatile-helper/index.d.mts +1 -0
  130. package/error-handling/customErrors/ErrorWithAmount.d.mts +4 -0
  131. package/error-handling/customErrors/FeeOverTransactionValueError.d.mts +9 -0
  132. package/error-handling/customErrors/customErrors.helpers.d.mts +5 -0
  133. package/error-handling/customErrors/index.d.mts +3 -0
  134. package/error-handling/error-codes.constants.cjs +1 -1
  135. package/error-handling/error-codes.constants.d.mts +181 -0
  136. package/error-handling/error-codes.constants.mjs +13 -13
  137. package/error-handling/get-error.message.d.mts +3 -0
  138. package/error-handling/handleErrorRestore.d.mts +2 -0
  139. package/error-handling/index.d.mts +7 -0
  140. package/error-handling/logError.d.mts +1 -0
  141. package/error-handling/types.d.mts +5 -0
  142. package/externalABIs/BUSD.d.mts +38 -0
  143. package/externalABIs/DAI.d.mts +45 -0
  144. package/externalABIs/ERC20.d.mts +1 -0
  145. package/externalABIs/SanctionsList.d.mts +35 -0
  146. package/externalABIs/USDC.d.mts +28 -0
  147. package/externalABIs/USDR.d.mts +28 -0
  148. package/externalABIs/USDR3CRV.d.mts +49 -0
  149. package/externalABIs/USDT.d.mts +41 -0
  150. package/externalABIs/WETH.d.mts +38 -0
  151. package/externalABIs/amToken.d.mts +28 -0
  152. package/externalABIs/crvFRAX.d.mts +38 -0
  153. package/externalABIs/index.d.mts +323 -0
  154. package/externalABIs/swapAbi.d.mts +77 -0
  155. package/functions/index.d.mts +14 -0
  156. package/functions/kyc/aiPriseHelper.d.mts +0 -0
  157. package/functions/kyc/authentoHelper.d.mts +12 -0
  158. package/functions/kyc/index.d.mts +3 -0
  159. package/functions/kyc/openDefaultPassportWindow.d.mts +1 -0
  160. package/functions/kyc/passportHelper.d.mts +3 -0
  161. package/functions/kyc/zkMeHelper.d.mts +4 -0
  162. package/functions/pre-transaction/getFlatFees.d.mts +12 -0
  163. package/functions/pre-transaction/index.d.mts +5 -0
  164. package/functions/pre-transaction/interaction-to-action.d.mts +2 -0
  165. package/functions/pre-transaction/outputUtxoProcessing.d.mts +5 -0
  166. package/functions/pre-transaction/process-gas-estimates.d.mts +5 -0
  167. package/functions/pre-transaction/processAmountChanges.d.mts +12 -0
  168. package/functions/private-wallet/emporium.helpers.d.mts +5 -0
  169. package/functions/private-wallet/index.d.mts +2 -0
  170. package/functions/private-wallet/opProducer.d.mts +5 -0
  171. package/functions/protocols/convex.protocols.d.mts +1 -0
  172. package/functions/protocols/curve.protocols.d.mts +1 -0
  173. package/functions/protocols/index.d.mts +3 -0
  174. package/functions/protocols/pendle.helpers.d.mts +8 -0
  175. package/functions/snarkjs/common.snarkjs.d.mts +22 -0
  176. package/functions/snarkjs/constant.d.mts +151 -0
  177. package/functions/snarkjs/constructEmporiumProof.d.mts +10 -0
  178. package/functions/snarkjs/constructGeneralZkProof.d.mts +12 -0
  179. package/functions/snarkjs/generateCircomData.d.mts +4 -0
  180. package/functions/snarkjs/generateZkProof.d.mts +5 -0
  181. package/functions/snarkjs/generateZkProofEnclave.d.mts +5 -0
  182. package/functions/snarkjs/generateZkProofSelf.d.mts +5 -0
  183. package/functions/snarkjs/getZKFiles.d.mts +2 -0
  184. package/functions/snarkjs/index.d.mts +4 -0
  185. package/functions/staking/index.d.mts +11 -0
  186. package/functions/utils/amounts.utils.d.mts +21 -0
  187. package/functions/utils/axelar.utils.d.mts +2 -0
  188. package/functions/utils/cacheDevice.utils.d.mts +3 -0
  189. package/functions/utils/cacheFunctions.d.mts +17 -0
  190. package/functions/utils/caseInsensitive.utils.d.mts +3 -0
  191. package/functions/utils/convertIntegrationProviderToExternalActionId.d.mts +2 -0
  192. package/functions/utils/create-provider.d.mts +2 -0
  193. package/functions/utils/enum.utils.d.mts +9 -0
  194. package/functions/utils/erc20tokenFunctions.d.mts +4 -0
  195. package/functions/utils/evmNetworkFunctions.d.mts +4 -0
  196. package/functions/utils/external-action.utils.d.mts +8 -0
  197. package/functions/utils/getDataFromTransaction.d.mts +45 -0
  198. package/functions/utils/index.d.mts +21 -0
  199. package/functions/utils/memoize.utils.d.mts +1 -0
  200. package/functions/utils/nickname.utils.d.mts +1 -0
  201. package/functions/utils/process.utils.d.mts +7 -0
  202. package/functions/utils/reloadPage.d.mts +1 -0
  203. package/functions/utils/requireEnv.d.mts +1 -0
  204. package/functions/utils/resolve-sync.utils.d.mts +6 -0
  205. package/functions/utils/serialize.utils.d.mts +1 -0
  206. package/functions/utils/string.utils.d.mts +8 -0
  207. package/functions/utils/time.utils.d.mts +1 -0
  208. package/functions/utils/userAgent.d.mts +2 -0
  209. package/functions/utils/volatile-patcher.utils.d.mts +1 -0
  210. package/functions/web3/etherFunctions.d.mts +20 -0
  211. package/functions/web3/events/balanceChangedHandler.d.mts +1 -0
  212. package/functions/web3/events/getInputUtxoAndBalance.d.mts +24 -0
  213. package/functions/web3/events/getShieldedBalance.cjs +2 -2
  214. package/functions/web3/events/getShieldedBalance.d.mts +18 -0
  215. package/functions/web3/events/getShieldedBalance.mjs +66 -58
  216. package/functions/web3/events/index.d.mts +4 -0
  217. package/functions/web3/events/web3RetrieveEvents.d.mts +14 -0
  218. package/functions/web3/functionCalls/accessTokenCalls.d.mts +6 -0
  219. package/functions/web3/functionCalls/approveToken.d.mts +4 -0
  220. package/functions/web3/functionCalls/estimateGasRelayer.d.mts +4 -0
  221. package/functions/web3/functionCalls/getRootHash.d.mts +2 -0
  222. package/functions/web3/functionCalls/relayFunctions.d.mts +17 -0
  223. package/functions/web3/functionCalls/transactCallDirect.d.mts +6 -0
  224. package/functions/web3/functionCalls/transactCallRelayer.d.mts +7 -0
  225. package/functions/web3/getContractMetadata.d.mts +5 -0
  226. package/functions/web3/index.d.mts +6 -0
  227. package/functions/web3/odosAPI.d.mts +5 -0
  228. package/functions/web3/oneInchAPI.d.mts +5 -0
  229. package/functions/web3/runContractFunction.d.mts +15 -0
  230. package/functions/web3/uniswapAPI.d.mts +16 -0
  231. package/index.d.mts +8 -0
  232. package/package.json +42 -11
  233. package/providers/EthersProviderAdapter.d.mts +39 -0
  234. package/providers/WagmiProviderAdapter.d.mts +46 -0
  235. package/providers/exportProviers.d.mts +3 -0
  236. package/providers/prepareEthersHinkal.d.mts +4 -0
  237. package/providers/prepareWagmiHinkal.d.mts +3 -0
  238. package/types/API.types.d.mts +23 -0
  239. package/types/ICacheDevice.d.mts +4 -0
  240. package/types/IMultiThreadedUtxoUtils.d.mts +8 -0
  241. package/types/admin.types.d.mts +22 -0
  242. package/types/axelar.types.d.mts +14 -0
  243. package/types/beefy.types.d.mts +11 -0
  244. package/types/big-intable.types.d.mts +2 -0
  245. package/types/circom-data.types.d.mts +70 -0
  246. package/types/coingecko.types.d.mts +8 -0
  247. package/types/commitments.types.d.mts +26 -0
  248. package/types/connext.types.d.mts +13 -0
  249. package/types/crypto.types.d.mts +7 -0
  250. package/types/curve.types.d.mts +133 -0
  251. package/types/duneAPI.types.d.mts +9 -0
  252. package/types/ethereum-network.types.d.mts +142 -0
  253. package/types/external-action.types.d.mts +28 -0
  254. package/types/hinkal.stake.types.d.mts +11 -0
  255. package/types/hinkal.types.d.mts +150 -0
  256. package/types/hinkalTvl.types.d.mts +4 -0
  257. package/types/index.d.mts +27 -0
  258. package/types/kyc.types.d.mts +39 -0
  259. package/types/pendle.api.types.d.mts +233 -0
  260. package/types/pendle.types.d.mts +222 -0
  261. package/types/relayer.types.d.mts +25 -0
  262. package/types/remote-proof.types.d.mts +15 -0
  263. package/types/rewards.types.d.mts +230 -0
  264. package/types/slippage.types.d.mts +15 -0
  265. package/types/snark.types.d.mts +40 -0
  266. package/types/time.types.d.mts +31 -0
  267. package/types/token.types.d.mts +36 -0
  268. package/types/transactions.types.d.mts +55 -0
  269. package/webworker/performTaskWithWorker.d.mts +5 -0
  270. package/webworker/snarkjsWorker/snarkjsWorker.types.d.mts +14 -0
  271. package/webworker/snarkjsWorker/snarkjsWorkerLauncher.d.mts +1 -0
  272. package/webworker/snarkjsWorker/snarkjsWorkerLogic.d.mts +10 -0
  273. package/webworker/utxoWorker/utxoWorker.types.d.mts +29 -0
  274. package/webworker/utxoWorker/utxoWorkerLauncher.d.mts +1 -0
  275. package/webworker/utxoWorker/utxoWorkerLogic.d.mts +8 -0
  276. package/webworker/viteWorkerURL.constant.d.mts +9 -0
  277. package/webworker/worker.registry.d.mts +10 -0
  278. package/webworker/worker.types.d.mts +33 -0
  279. package/webworker/workerErrorHandler.d.mts +1 -0
  280. package/webworker/workerFactory.d.mts +7 -0
  281. package/webworker/workerProxy.d.mts +40 -0
  282. package/webworker/zkProofWorker/zkProofWorker.types.d.mts +38 -0
  283. package/webworker/zkProofWorker/zkProofWorkerLauncher.d.mts +1 -0
  284. package/webworker/zkProofWorker/zkProofWorkerLogic.d.mts +8 -0
@@ -0,0 +1,77 @@
1
+ export declare const ERC20ABI: ({
2
+ inputs: {
3
+ internalType: string;
4
+ name: string;
5
+ type: string;
6
+ }[];
7
+ stateMutability: string;
8
+ type: string;
9
+ anonymous?: undefined;
10
+ name?: undefined;
11
+ outputs?: undefined;
12
+ } | {
13
+ anonymous: boolean;
14
+ inputs: {
15
+ indexed: boolean;
16
+ internalType: string;
17
+ name: string;
18
+ type: string;
19
+ }[];
20
+ name: string;
21
+ type: string;
22
+ stateMutability?: undefined;
23
+ outputs?: undefined;
24
+ } | {
25
+ inputs: {
26
+ internalType: string;
27
+ name: string;
28
+ type: string;
29
+ }[];
30
+ name: string;
31
+ outputs: {
32
+ internalType: string;
33
+ name: string;
34
+ type: string;
35
+ }[];
36
+ stateMutability: string;
37
+ type: string;
38
+ anonymous?: undefined;
39
+ })[];
40
+ export declare const WETHABI: ({
41
+ constant: boolean;
42
+ inputs: {
43
+ name: string;
44
+ type: string;
45
+ }[];
46
+ name: string;
47
+ outputs: {
48
+ name: string;
49
+ type: string;
50
+ }[];
51
+ payable: boolean;
52
+ stateMutability: string;
53
+ type: string;
54
+ anonymous?: undefined;
55
+ } | {
56
+ payable: boolean;
57
+ stateMutability: string;
58
+ type: string;
59
+ constant?: undefined;
60
+ inputs?: undefined;
61
+ name?: undefined;
62
+ outputs?: undefined;
63
+ anonymous?: undefined;
64
+ } | {
65
+ anonymous: boolean;
66
+ inputs: {
67
+ indexed: boolean;
68
+ name: string;
69
+ type: string;
70
+ }[];
71
+ name: string;
72
+ type: string;
73
+ constant?: undefined;
74
+ outputs?: undefined;
75
+ payable?: undefined;
76
+ stateMutability?: undefined;
77
+ })[];
@@ -0,0 +1,14 @@
1
+ export * from './kyc';
2
+ export * from './utils';
3
+ export * from './web3';
4
+ export * from './snarkjs';
5
+ export * from './pre-transaction';
6
+ export * from './protocols';
7
+ export * from './staking';
8
+ export * from './private-wallet';
9
+ export * from './pre-transaction/getFlatFees';
10
+ export * from './pre-transaction/outputUtxoProcessing';
11
+ export * from './utils/requireEnv';
12
+ export * from './utils/resolve-sync.utils';
13
+ export * from './utils/getDataFromTransaction';
14
+ export * from './web3/uniswapAPI';
File without changes
@@ -0,0 +1,12 @@
1
+ import { IHinkal } from '../../data-structures/Hinkal/IHinkal';
2
+ export declare const AUTHENTO: {
3
+ verifyMessageText: string;
4
+ domainName: string;
5
+ type: {
6
+ Message: {
7
+ name: string;
8
+ type: string;
9
+ }[];
10
+ };
11
+ };
12
+ export declare const authentoKycHandler: (hinkal: IHinkal, shortName: string, onboardURL: string) => Promise<void>;
@@ -0,0 +1,3 @@
1
+ export * from '../web3/functionCalls/accessTokenCalls';
2
+ export * from './passportHelper';
3
+ export * from './openDefaultPassportWindow';
@@ -0,0 +1 @@
1
+ export declare const openDefaultPassportWindow: (onboardURL: string, shortName: string, height?: number, width?: number) => void;
@@ -0,0 +1,3 @@
1
+ import { Passports } from '../../types/kyc.types';
2
+ import { IHinkal } from '../../data-structures/Hinkal/IHinkal';
3
+ export declare const openPassportWindow: (passport: Passports, hinkal: IHinkal, height?: number, width?: number) => void;
@@ -0,0 +1,4 @@
1
+ import { IHinkal } from '../../data-structures/Hinkal/IHinkal';
2
+ export declare const zkMeKycHandler: (hinkal: IHinkal, shortName: string, onboardURL: string, params: {
3
+ merchId: string;
4
+ }) => Promise<void>;
@@ -0,0 +1,12 @@
1
+ import { ERC20Token, ExternalActionId, ValidExternalAction } from '../../types';
2
+ /**
3
+ * Infer INTERACTION type from given @param externalActionId and @param action
4
+ * and return `flatFee` along with `feeUnit` - the token corespond with the fee,
5
+ * `priceOfTransactionInToken`, and `priceOfTransactionInUSD`
6
+ */
7
+ export declare const getFlatFees: (chainId: number, erc20Addresses: string[], externalActionId: ExternalActionId, amountChanges: bigint[], action?: ValidExternalAction, gasTokenAddress?: string) => Promise<{
8
+ flatFees: bigint[];
9
+ priceOfTransactionInToken: bigint | undefined;
10
+ feeUnit: ERC20Token | undefined;
11
+ priceOfTransactionInUSD: number | undefined;
12
+ }>;
@@ -0,0 +1,5 @@
1
+ export * from './interaction-to-action';
2
+ export * from './outputUtxoProcessing';
3
+ export * from './process-gas-estimates';
4
+ export * from './processAmountChanges';
5
+ export * from './getFlatFees';
@@ -0,0 +1,2 @@
1
+ import { ExternalActionId, INTERACTION, ValidExternalAction } from '../../types';
2
+ export declare const getInteractionFromAction: (externalActionId: ExternalActionId, action?: ValidExternalAction) => INTERACTION;
@@ -0,0 +1,5 @@
1
+ import { UserKeys } from '../../data-structures/crypto-keys/keys';
2
+ import { Utxo } from '../../data-structures/utxo/Utxo';
3
+ export declare const outputUtxoProcessing: (userKeys: UserKeys, inputUtxos: Utxo[], amountChange: bigint, timeStamp?: string, tokenId?: number) => {
4
+ outputUtxos: Utxo[];
5
+ };
@@ -0,0 +1,5 @@
1
+ import { ERC20Token, ExternalActionId, ValidExternalAction } from '../../types';
2
+ export declare const processGasEstimates: (chainId: number, token: ERC20Token, externalActionId: ExternalActionId, action: ValidExternalAction | undefined, erc20TokenAddressLength: number, gasAmount?: number) => Promise<{
3
+ priceOfTransactionInUSD: number | undefined;
4
+ priceOfTransactionInToken: bigint | undefined;
5
+ }>;
@@ -0,0 +1,12 @@
1
+ import { ERC20Token, ExternalActionId, ValidExternalAction } from '../../types';
2
+ export interface ProcessAmountChangesParam {
3
+ erc20Addresses: string[];
4
+ amountChanges: bigint[];
5
+ flatFees: bigint[];
6
+ feeUnit?: ERC20Token;
7
+ externalActionId: ExternalActionId;
8
+ action?: ValidExternalAction;
9
+ /** if provided, gas will be estimated using this token */
10
+ gasTokenAddress?: string;
11
+ }
12
+ export declare const processAmountChanges: ({ erc20Addresses, amountChanges, flatFees, feeUnit, externalActionId, action, gasTokenAddress, }: ProcessAmountChangesParam) => bigint[];
@@ -0,0 +1,5 @@
1
+ import { Contract, ContractTransaction } from 'ethers';
2
+ export declare const emporiumOp: <ContractInstance extends Contract, ContractFunctions extends ContractInstance["functions"], ExactFunction extends { [K in keyof ContractFunctions]: ReturnType<ContractFunctions[K]> extends Promise<ContractTransaction> ? K : never; }[keyof ContractFunctions], FunctionArguments extends Parameters<ContractFunctions[ExactFunction]>>(contract: ContractInstance | string, func?: ExactFunction, args?: FunctionArguments extends [
3
+ ] ? [
4
+ ] : FunctionArguments, invokeWallet?: boolean, value?: bigint) => string;
5
+ export declare const encodeEmporiumMetadata: (ops: string[], walletSalt?: string) => string;
@@ -0,0 +1,2 @@
1
+ export * from './emporium.helpers';
2
+ export * from './opProducer';
@@ -0,0 +1,5 @@
1
+ export declare enum OpType {
2
+ Erc20Token = 0,
3
+ Uniswap = 1
4
+ }
5
+ export declare const produceOp: (opType: OpType, contractAddress: string, func?: string, args?: any[], invokeWallet?: boolean, value?: bigint) => string;
@@ -0,0 +1 @@
1
+ export declare const getCVX: (chainId: number | undefined) => "0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B" | "0x4257ea7637c355f81616050cbb6a9b709fd72683" | "0xb952a807345991bd529fdded05009f5e80fe8f45" | "0x81ab7e0d570b01411fcc4afd3d50ec8c241cb74b";
@@ -0,0 +1 @@
1
+ export declare const getCRV: (chainId: number | undefined) => "0xD533a949740bb3306d119CC777fa900bA034cd52" | "0x0994206dfe8de6ec6920ff4d779b0d950605fb53" | "0x8Ee73c484A26e0A5df2Ee2a4960B789967dd0415" | "0x172370d5Cd63279eFa6d502DAB29171933a610AF" | "0x11cdb42b0eb46d95f990bedd4695a6e3fa034978" | "0x47536F17F4fF30e64A96a7555826b8f9e66ec468";
@@ -0,0 +1,3 @@
1
+ export * from './curve.protocols';
2
+ export * from './convex.protocols';
3
+ export * from './pendle.helpers';
@@ -0,0 +1,8 @@
1
+ import { ERC20Token, PendleAsset, PendleAssetType, PendleMarket, PendleSwapType, ValidExternalAction } from '../../types';
2
+ export declare function erc20TokenFromPendleAsset(asset: PendleAsset | undefined): ERC20Token | undefined;
3
+ /** Extract a specific Pendle Asset section from a market */
4
+ export declare function getAssetTypeFromPendleMarket(market: PendleMarket | undefined, selectedMarketAssetType: PendleAssetType | undefined): PendleAsset | undefined;
5
+ export declare const determinePendleSwapType: (market: PendleMarket, inSwapToken: ERC20Token, outSwapToken: ERC20Token) => PendleSwapType | undefined;
6
+ export declare const determinePendleSwapTypeApiRoute: (swapType: PendleSwapType | undefined) => string;
7
+ /** determines which token (by index in a list of tokens) should be used for calcuating gas and */
8
+ export declare const getTokenIndexForPendleFlatFee: (action: ValidExternalAction | undefined, amountChanges: bigint[], erc20Addresses: string[], flatFeeTokenAddressSelectedByUser?: string | undefined) => number;
@@ -0,0 +1,22 @@
1
+ import { Utxo } from '../../data-structures/utxo/Utxo';
2
+ import { UserKeys } from '../../data-structures/crypto-keys/keys';
3
+ import { MerkleTree } from '../../data-structures/merkle-tree';
4
+ import { CircomDataJsonType, CircomDataType, HookDataType, StealthAddressStructure } from '../../types/circom-data.types';
5
+ import { ExternalActionId } from '../../types/external-action.types';
6
+ export declare const buildInNullifiers: (inputUtxos: Utxo[][], onChainCreation: boolean[]) => string[][];
7
+ export declare const buildOutCommitments: (outputUtxos: Utxo[][], onChainCreation: boolean[]) => string[][];
8
+ export declare const calcAmountChanges: (inputUtxos: Utxo[][], outputUtxos: Utxo[][], forCircomData?: boolean) => bigint[];
9
+ export declare const calcEncryptedOutputs: (outputUtxos: Utxo[][], forceZeroAmount: boolean) => string[][];
10
+ export declare const calcCommitmentsSiblingAndSides: (inputUtxos: Utxo[][], merkleTree: MerkleTree<bigint>) => {
11
+ inCommitmentSiblings: string[][][];
12
+ inCommitmentSiblingSides: string[][][];
13
+ };
14
+ export declare const calcAccessTokenSiblingsAndSides: (userKeys: UserKeys, merkleTreeAccessToken: MerkleTree<bigint>) => {
15
+ accessTokenSiblings: string[];
16
+ accessTokenSiblingSides: string[];
17
+ };
18
+ export declare const serializeCircomData: (circomData: CircomDataType) => CircomDataJsonType;
19
+ export declare const deserializeCircomData: (circomData: CircomDataJsonType) => CircomDataJsonType;
20
+ export declare const createCallDataHash: (publicSignalCount: number, relay: string, externalAddress: string | undefined, externalActionId: bigint | ExternalActionId, externalActionMetadata: string, encryptedOutputs: string[][], flatFees: bigint[], hookData: HookDataType | undefined) => bigint;
21
+ export declare const calcPublicSignalCount: (verifierName: string, erc20TokenAddresses: string[], amountChanges: bigint[], inNullifiers: string[][], outCommitments: string[][], tokenIdsPositive: number) => number;
22
+ export declare const calcStealthAddressStructure: (extraRandomization: bigint, privateKey: string) => StealthAddressStructure;
@@ -0,0 +1,151 @@
1
+ export declare const PROOF_GENERATION_EC2_URL = "https://enclave-server.hinkal.pro";
2
+ export declare const prodVerifiers: (chainId: number) => {
3
+ swapperM1x2x1Zkey: string;
4
+ swapperM1x2x1Wasm: string;
5
+ swapperM1x6x1Zkey: string;
6
+ swapperM1x6x1Wasm: string;
7
+ swapperME1x2x1Zkey: string;
8
+ swapperME1x2x1Wasm: string;
9
+ swapperM2x2x1Zkey: string;
10
+ swapperM2x2x1Wasm: string;
11
+ swapperM2x6x1Zkey: string;
12
+ swapperM2x6x1Wasm: string;
13
+ swapperMO2x2x1Zkey: string;
14
+ swapperMO2x2x1Wasm: string;
15
+ swapperMO2x6x1Zkey: string;
16
+ swapperMO2x6x1Wasm: string;
17
+ swapperToken2x2x1Zkey: string;
18
+ swapperToken2x2x1Wasm: string;
19
+ swapperToken2x6x1Zkey: string;
20
+ swapperToken2x6x1Wasm: string;
21
+ swapperM3x2x1Zkey: string;
22
+ swapperM3x2x1Wasm: string;
23
+ swapperM3x6x1Zkey: string;
24
+ swapperM3x6x1Wasm: string;
25
+ swapperMO3x2x1Zkey: string;
26
+ swapperMO3x2x1Wasm: string;
27
+ swapperMO3x6x1Zkey: string;
28
+ swapperMO3x6x1Wasm: string;
29
+ swapperM4x2x1Zkey: string;
30
+ swapperM4x2x1Wasm: string;
31
+ swapperM4x6x1Zkey: string;
32
+ swapperM4x6x1Wasm: string;
33
+ swapperMO4x2x1Zkey: string;
34
+ swapperMO4x2x1Wasm: string;
35
+ swapperMO4x6x1Zkey: string;
36
+ swapperMO4x6x1Wasm: string;
37
+ swapperM5x2x1Zkey: string;
38
+ swapperM5x2x1Wasm: string;
39
+ swapperM5x6x1Zkey: string;
40
+ swapperM5x6x1Wasm: string;
41
+ swapperMO5x2x1Zkey: string;
42
+ swapperMO5x2x1Wasm: string;
43
+ swapperMO5x6x1Zkey: string;
44
+ swapperMO5x6x1Wasm: string;
45
+ swapperMTS2x2x1Zkey: string;
46
+ swapperMTS2x2x1Wasm: string;
47
+ transactionsProverZkey: string;
48
+ transactionsProverWasm: string;
49
+ stakeProverZkey: string;
50
+ stakeProverWasm: string;
51
+ stakeProverPermissionlessZkey: string;
52
+ stakeProverPermissionlessWasm: string;
53
+ swapperMW1x2Wasm: string;
54
+ swapperMW1x2Zkey: string;
55
+ swapperMW1x6Wasm: string;
56
+ swapperMW1x6Zkey: string;
57
+ swapperMW2x2Wasm: string;
58
+ swapperMW2x2Zkey: string;
59
+ swapperMW2x6Wasm: string;
60
+ swapperMW2x6Zkey: string;
61
+ swapperMW3x2Wasm: string;
62
+ swapperMW3x2Zkey: string;
63
+ swapperMW3x6Wasm: string;
64
+ swapperMW3x6Zkey: string;
65
+ swapperMW4x2Wasm: string;
66
+ swapperMW4x2Zkey: string;
67
+ swapperMW4x6Wasm: string;
68
+ swapperMW4x6Zkey: string;
69
+ swapperMW5x2Wasm: string;
70
+ swapperMW5x2Zkey: string;
71
+ swapperMW5x6Wasm: string;
72
+ swapperMW5x6Zkey: string;
73
+ };
74
+ export declare const localVerifiers: {
75
+ swapperM1x2x1Zkey: string;
76
+ swapperM1x2x1Wasm: string;
77
+ swapperM1x6x1Zkey: string;
78
+ swapperM1x6x1Wasm: string;
79
+ swapperMO1x2x1Zkey: string;
80
+ swapperMO1x2x1Wasm: string;
81
+ swapperMO1x6x1Zkey: string;
82
+ swapperMO1x6x1Wasm: string;
83
+ swapperME1x2x1Zkey: string;
84
+ swapperME1x2x1Wasm: string;
85
+ swapperM2x2x1Zkey: string;
86
+ swapperM2x2x1Wasm: string;
87
+ swapperM2x6x1Zkey: string;
88
+ swapperM2x6x1Wasm: string;
89
+ swapperMO2x2x1Zkey: string;
90
+ swapperMO2x2x1Wasm: string;
91
+ swapperMO2x6x1Zkey: string;
92
+ swapperMO2x6x1Wasm: string;
93
+ swapperToken2x2x1Zkey: string;
94
+ swapperToken2x2x1Wasm: string;
95
+ swapperToken2x6x1Zkey: string;
96
+ swapperToken2x6x1Wasm: string;
97
+ swapperM3x2x1Zkey: string;
98
+ swapperM3x2x1Wasm: string;
99
+ swapperM3x6x1Zkey: string;
100
+ swapperM3x6x1Wasm: string;
101
+ swapperMO3x2x1Zkey: string;
102
+ swapperMO3x2x1Wasm: string;
103
+ swapperMO3x6x1Zkey: string;
104
+ swapperMO3x6x1Wasm: string;
105
+ swapperM4x2x1Zkey: string;
106
+ swapperM4x2x1Wasm: string;
107
+ swapperM4x6x1Zkey: string;
108
+ swapperM4x6x1Wasm: string;
109
+ swapperMO4x2x1Zkey: string;
110
+ swapperMO4x2x1Wasm: string;
111
+ swapperMO4x6x1Zkey: string;
112
+ swapperMO4x6x1Wasm: string;
113
+ swapperM5x2x1Zkey: string;
114
+ swapperM5x2x1Wasm: string;
115
+ swapperM5x6x1Zkey: string;
116
+ swapperM5x6x1Wasm: string;
117
+ swapperMO5x2x1Zkey: string;
118
+ swapperMO5x2x1Wasm: string;
119
+ swapperMO5x6x1Zkey: string;
120
+ swapperMO5x6x1Wasm: string;
121
+ swapperMTS2x2x1Zkey: string;
122
+ swapperMTS2x2x1Wasm: string;
123
+ transactionsProverZkey: string;
124
+ transactionsProverWasm: string;
125
+ stakeProverZkey: string;
126
+ stakeProverWasm: string;
127
+ stakeProverPermissionlessZkey: string;
128
+ stakeProverPermissionlessWasm: string;
129
+ receiverZkey: string;
130
+ receiverWasm: string;
131
+ swapperMW1x2Wasm: string;
132
+ swapperMW1x2Zkey: string;
133
+ swapperMW1x6Wasm: string;
134
+ swapperMW1x6Zkey: string;
135
+ swapperMW2x2Wasm: string;
136
+ swapperMW2x2Zkey: string;
137
+ swapperMW2x6Wasm: string;
138
+ swapperMW2x6Zkey: string;
139
+ swapperMW3x2Wasm: string;
140
+ swapperMW3x2Zkey: string;
141
+ swapperMW3x6Wasm: string;
142
+ swapperMW3x6Zkey: string;
143
+ swapperMW4x2Wasm: string;
144
+ swapperMW4x2Zkey: string;
145
+ swapperMW4x6Wasm: string;
146
+ swapperMW4x6Zkey: string;
147
+ swapperMW5x2Wasm: string;
148
+ swapperMW5x2Zkey: string;
149
+ swapperMW5x6Wasm: string;
150
+ swapperMW5x6Zkey: string;
151
+ };
@@ -0,0 +1,10 @@
1
+ import { MerkleTree } from '../../data-structures/merkle-tree';
2
+ import { Utxo } from '../../data-structures/utxo/Utxo';
3
+ import { UserKeys } from '../../data-structures/crypto-keys/keys';
4
+ import { CircomDataType, DimDataType } from '../../types/circom-data.types';
5
+ export declare const constructEmporiumProof: (merkleTree: MerkleTree<bigint>, merkleTreeAccessToken: MerkleTree<bigint>, inputUtxos: Utxo[][], outputUtxos: Utxo[][], userKeys: UserKeys, tokenCount: number, inputCount: number, emporiumAddress: string, operations: string[], generateProofRemotely: boolean, relay?: string, chainId?: number, onChainCreation?: boolean[], flatFees?: bigint[], walletNonce?: bigint, volatileAmounts?: bigint[], volatileAction?: string) => Promise<{
6
+ zkCallData: import('../../index.ts').NewZkCallDataType;
7
+ circomData: CircomDataType;
8
+ dimData: DimDataType;
9
+ encryptedOutputs: string[][];
10
+ }>;
@@ -0,0 +1,12 @@
1
+ import { MerkleTree } from '../../data-structures/merkle-tree';
2
+ import { UserKeys } from '../../data-structures/crypto-keys/keys';
3
+ import { Utxo } from '../../data-structures/utxo/Utxo';
4
+ import { CircomDataType, DimDataType, HookDataType } from '../../types/circom-data.types';
5
+ import { ExternalActionId } from '../../types/external-action.types';
6
+ import { StakeArgs } from '../../types/hinkal.stake.types';
7
+ export declare const constructZkProof: (merkleTree: MerkleTree<bigint>, merkleTreeAccessToken: MerkleTree<bigint>, inputUtxos: Utxo[][], outputUtxos: Utxo[][], userKeys: UserKeys, verifierName: string, externalActionId: ExternalActionId | 0n, externalAddress: string | undefined, externalActionMetadata: string, generateProofRemotely: boolean, relay?: string, chainId?: number, onChainCreation?: boolean[], flatFees?: bigint[], hookData?: HookDataType | undefined, stakeArgs?: StakeArgs, hasAccessToken?: boolean) => Promise<{
8
+ zkCallData: import('../../index.ts').NewZkCallDataType;
9
+ circomData: CircomDataType;
10
+ dimData: DimDataType;
11
+ encryptedOutputs: string[][];
12
+ }>;
@@ -0,0 +1,4 @@
1
+ import { Utxo } from '../../data-structures/utxo/Utxo';
2
+ import { CircomDataType, HookDataType, StealthAddressStructure } from '../../types/circom-data.types';
3
+ import { ExternalActionId } from '../../types/external-action.types';
4
+ export declare const generateCircomData: (rootHashHinkal: bigint | undefined, rootHashAccessToken: bigint | undefined, inputUtxos: Utxo[][], outputUtxos: Utxo[][], encryptedOutputs: string[][], flatFees: bigint[], publicSignalCount: number, externalActionId: ExternalActionId | bigint, externalAddress: string | undefined, externalActionMetadata: string, relay: string, calldataHash: bigint, tokenIds: number[], stealthAddressStructure: StealthAddressStructure, onChainCreation: boolean[], hookData: HookDataType | undefined) => Promise<CircomDataType>;
@@ -0,0 +1,5 @@
1
+ import { NewZkCallDataType } from '../../types';
2
+ export declare const generateZkProof: (chainId: number, verifierName: string, input: any, remotely?: boolean) => Promise<{
3
+ zkCallData: NewZkCallDataType;
4
+ publicSignals: string[];
5
+ }>;
@@ -0,0 +1,5 @@
1
+ import { NewZkCallDataType } from '../../types/snark.types';
2
+ export declare const generateZkProofEnclave: (chainId: number, verifierName: string, input: any) => Promise<{
3
+ zkCallData: NewZkCallDataType;
4
+ publicSignals: string[];
5
+ }>;
@@ -0,0 +1,5 @@
1
+ import { NewZkCallDataType } from '../../types';
2
+ export declare const generateZkProofSelf: (chainId: number, verifierName: string, input: any) => Promise<{
3
+ zkCallData: NewZkCallDataType;
4
+ publicSignals: string[];
5
+ }>;
@@ -0,0 +1,2 @@
1
+ export declare const getWASMFile: (filename: string, chainId: number) => string;
2
+ export declare const getZKeyFile: (filename: string, chainId: number) => string;
@@ -0,0 +1,4 @@
1
+ export * from './constructGeneralZkProof';
2
+ export * from './constructEmporiumProof';
3
+ export * from './common.snarkjs';
4
+ export * from './generateZkProof';
@@ -0,0 +1,11 @@
1
+ import { UserKeys } from '../../data-structures/crypto-keys/keys';
2
+ interface StakeDecryptOutput {
3
+ stakeBlinding: bigint;
4
+ stakedTokenRecipient: string;
5
+ }
6
+ export declare const encryptStake: (stakeBlinding: bigint, stakedTokenRecipient: string, encryptionKey: string) => string;
7
+ export declare const decryptStake: (encryptedStakeCommitmentContent: string, minterKeys: UserKeys) => StakeDecryptOutput | undefined;
8
+ export declare const createStakeCommitment: (isStake: boolean, stakedTokenRecipient: string, stakeBlinding: bigint, tokenAddress: string, amountChange: bigint, timeStamp: bigint) => bigint;
9
+ export declare const calculateStakeNullifier: (stakeCommitment: bigint, blinding: bigint) => string;
10
+ export declare const encodeHStakeMetadata: (action: 1 | 0, stakeCommitment: bigint, depositorAddress: string, encryptedContent: string, encryptedContentAlt: string) => string;
11
+ export {};
@@ -0,0 +1,21 @@
1
+ import { BigIntable } from '../../types/big-intable.types';
2
+ export declare const calculateSum: (arr: number[]) => number;
3
+ export declare const beepsToPercentage: (beeps: number) => number;
4
+ export declare const calculateAmountUsingBeeps: (beep: bigint, amount: bigint) => bigint;
5
+ export declare function toBigInt(value: BigIntable): bigint;
6
+ /** Converts the value to a BigInt or returns undefined if can't */
7
+ export declare const toBigIntOrUndefined: (value: any) => bigint | undefined;
8
+ /** Converts the value to a number or returns undefined if can't */
9
+ export declare const toNumberOrUndefined: (value: any) => number | undefined;
10
+ export declare const toInt: (param: string | undefined, defaultValue: number) => number;
11
+ export declare function bigintApplySugar(): void;
12
+ export declare function bigintMax(...values: bigint[]): bigint;
13
+ export declare function fixDecimalsAmount(n: number): number | "< 0.000001";
14
+ export declare const getValueFirstNDigit: (num: number, numberOfDigits: number) => string;
15
+ export declare const trimLeadingZeros: (numberString: string) => string;
16
+ export declare const toCommaSeparatedNumberString: (numberString: string) => string;
17
+ export declare const truncateTo18DecimalPlaces: (numStr: string) => string;
18
+ /** Return absolute value of BigInt */
19
+ export declare const absBigInt: (n: bigint) => bigint;
20
+ /** Return the smallest values of the 2 or 3 values provided */
21
+ export declare const minBigInt: (a: bigint, b: bigint, c?: bigint) => bigint;
@@ -0,0 +1,2 @@
1
+ import { AxelarMigrationInfo, AxelarNetworkSelection } from '../../types';
2
+ export declare const getAxelarMigrationInfo: (networkSelection: AxelarNetworkSelection) => AxelarMigrationInfo | undefined;
@@ -0,0 +1,3 @@
1
+ import { type HinkalConfig } from '../../types/hinkal.types';
2
+ import { FileCacheDevice, LocalStorageCacheDevice } from '../../data-structures/cacheDevices';
3
+ export declare const createCacheDevice: (hinkalConfig?: HinkalConfig) => FileCacheDevice | LocalStorageCacheDevice;
@@ -0,0 +1,17 @@
1
+ import { type IHinkal } from '../../data-structures/Hinkal/IHinkal';
2
+ import { type DecodedTx } from '../../types/transactions.types';
3
+ import { type EncryptedOutputWithSign } from '../../types/commitments.types';
4
+ interface HinkalCacheInterface {
5
+ encryptedOutputs: EncryptedOutputWithSign[];
6
+ lastOutput: string;
7
+ }
8
+ export declare const getFilePath: (chainId: number, shortPublicKey: string, shortHinkalAddress: string) => string;
9
+ export declare const getHinkalCache: (hinkal: IHinkal) => HinkalCacheInterface;
10
+ export declare const setHinkalCache: (hinkalCache: HinkalCacheInterface, hinkal: IHinkal) => void;
11
+ export declare const resetCache: (hinkal: IHinkal) => void;
12
+ export declare const saveTxsCache: (txs: DecodedTx[], chainId: number, shieldedPublicKey: string, hinkalAddress: string, lastHash: string) => Promise<void>;
13
+ export declare const loadTxsCache: (chainId: number, shieldedPublicKey: string, hinkalAddress: string) => Promise<{
14
+ decodedTxs: import("../../types/transactions.types").DecodedTxWithUtxos<bigint, import("ethers").BigNumber>[];
15
+ lastHash: string | undefined;
16
+ }>;
17
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare const caseInsensitiveEqual: (a?: string, b?: string) => boolean;
2
+ export declare const lowerCaseIncludes: (array: string[], address?: string) => boolean;
3
+ export declare const lowerCaseStartsWith: (array: string[], s: string) => boolean;
@@ -0,0 +1,2 @@
1
+ import { ExternalActionId, IntegrationProvider } from '../../types';
2
+ export declare const convertIntegrationProviderToExternalActionId: (integrationProvider: IntegrationProvider) => ExternalActionId | undefined;
@@ -0,0 +1,2 @@
1
+ import { ethers } from 'ethers';
2
+ export declare const createProvider: (rpcUrl: string) => ethers.providers.JsonRpcProvider;
@@ -0,0 +1,9 @@
1
+ /** Verifies that the value is in the enumType specified */
2
+ export declare function isInEnum<T>(enumType: T, value: any): value is T[keyof T];
3
+ /** Converts a string value to an Enum member
4
+ * If a value can't be matched to a valid option in the enum, returns undefined (or throws if throwIfInvalid = true) */
5
+ export declare function toEnumValue<T>(e: T, value: any, throwIfInvalid?: boolean): T[keyof T] | undefined;
6
+ /** returns first item in an enum that is included somewhere in the target string
7
+ * e.g. enumInString(ErrorCode, '001-badpassword: error') => ErrorCode.BadPassword
8
+ */
9
+ export declare function enumInString<T extends Record<string, string>>(enumType: T, searchString: any): T[keyof T] | undefined;
@@ -0,0 +1,4 @@
1
+ import { ERC20Token } from '../../types/token.types';
2
+ export declare const getERC20Token: (address: string, chainId: number) => ERC20Token | undefined;
3
+ export declare const getERC20TokenBySymbol: (symbol: string, chainId: number) => ERC20Token | undefined;
4
+ export declare const getHToken: (token: ERC20Token, chainId: number) => ERC20Token | undefined;
@@ -0,0 +1,4 @@
1
+ import { EthereumNetworkType } from '../../constants';
2
+ import { EthereumNetwork } from '../../types';
3
+ export declare const getNetworkObject: (chainId: number) => EthereumNetwork;
4
+ export declare const getNetworkType: (network: EthereumNetwork) => EthereumNetworkType;
@@ -0,0 +1,8 @@
1
+ import { ethers } from 'ethers';
2
+ import { ExternalActionId } from '../../types/external-action.types';
3
+ import { CircomDataJsonType } from '../../types/circom-data.types';
4
+ export declare const getExternalActionIdHash: (externalActionId: ExternalActionId | 0n) => bigint;
5
+ export declare const getExternalActionIdFromNumber: (externalActionIdNumber: string | bigint) => ExternalActionId | undefined;
6
+ export declare const getActionFromMetadata: (externalActionId: ExternalActionId, circomDataDeserialized: Partial<CircomDataJsonType>) => number | undefined;
7
+ export declare const decodeMetadata: (externalActionId: ExternalActionId, externalActionMetadata: string) => ethers.utils.Result;
8
+ export declare const getExternalMetadataHash: (externalMetadataBuffer: string) => bigint;
@@ -0,0 +1,45 @@
1
+ import { BigNumber, utils } from 'ethers';
2
+ import { DecodedTx, DecodedTxWithUtxos } from '../../types';
3
+ export declare const decodeTxInput: (iface: utils.Interface, input: string) => {
4
+ erc20TokenAddresses: string[];
5
+ amountChanges: BigNumber[];
6
+ flatFees: BigNumber[];
7
+ externalActionId: BigNumber;
8
+ externalActionMetadata: string;
9
+ encryptedOutputs: string[];
10
+ hookData: import('../../types/circom-data.types').HookDataType;
11
+ stealthAddressStructure: import('../../types/circom-data.types').StealthAddressStructure<bigint>;
12
+ };
13
+ export declare const decodeTxLogs: (chainId: number, transactions: DecodedTx[]) => DecodedTxWithUtxos<bigint, BigNumber>[];
14
+ export declare const deserializeDecodedTxs: (decodedTx: DecodedTxWithUtxos<string, string>) => DecodedTxWithUtxos;
15
+ export declare const serializeDecodedTxs: (decodedTxs: DecodedTx[]) => {
16
+ input: string;
17
+ decodedInput: {
18
+ amountChanges: string[];
19
+ flatFees: string[];
20
+ externalActionId: string;
21
+ stealthAddressStructure: {
22
+ extraRandomization: string;
23
+ stealthAddress: string;
24
+ H0: string;
25
+ H1: string;
26
+ };
27
+ erc20TokenAddresses: string[];
28
+ externalActionMetadata: string;
29
+ encryptedOutputs: string[];
30
+ hookData: import('../../types/circom-data.types').HookDataType;
31
+ };
32
+ status: string;
33
+ blockNumber: number;
34
+ timeStamp: number;
35
+ isError: string;
36
+ methodId: string;
37
+ logs: {
38
+ topics: string[];
39
+ data: string;
40
+ }[];
41
+ hash: string;
42
+ gas: number;
43
+ gasPrice: number;
44
+ contract?: string | undefined;
45
+ }[];