@hinkal/common 0.2.30 → 0.2.32
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.
- package/API/API.cjs +1 -1
- package/API/API.d.ts +26 -11
- package/API/API.mjs +103 -88
- package/API/callMonitor.cjs +1 -1
- package/API/callMonitor.d.ts +8 -0
- package/API/callMonitor.mjs +2 -2
- package/API/callRelayer.d.ts +4 -1
- package/API/dashboardAccountCalls.cjs +1 -0
- package/API/dashboardAccountCalls.d.ts +24 -0
- package/API/dashboardAccountCalls.mjs +10 -0
- package/API/dashboardAccountMemberCalls.cjs +1 -0
- package/API/dashboardAccountMemberCalls.d.ts +34 -0
- package/API/dashboardAccountMemberCalls.mjs +16 -0
- package/API/dashboardBalanceCalls.cjs +1 -0
- package/API/dashboardBalanceCalls.d.ts +12 -0
- package/API/dashboardBalanceCalls.mjs +13 -0
- package/API/dashboardContactCalls.cjs +1 -0
- package/API/dashboardContactCalls.d.ts +9 -0
- package/API/dashboardContactCalls.mjs +13 -0
- package/API/dashboardPayoutCalls.cjs +1 -0
- package/API/dashboardPayoutCalls.d.ts +14 -0
- package/API/dashboardPayoutCalls.mjs +13 -0
- package/API/dashboardTransactionCalls.cjs +1 -0
- package/API/dashboardTransactionCalls.d.ts +3 -0
- package/API/dashboardTransactionCalls.mjs +10 -0
- package/API/enclaveRecipientInfoCalls.cjs +1 -0
- package/API/enclaveRecipientInfoCalls.d.ts +14 -0
- package/API/enclaveRecipientInfoCalls.mjs +7 -0
- package/API/enclaveSignatureCalls.cjs +1 -1
- package/API/enclaveSignatureCalls.d.ts +3 -8
- package/API/enclaveSignatureCalls.mjs +6 -8
- package/API/enclaveUtxoCalls.cjs +1 -1
- package/API/enclaveUtxoCalls.d.ts +8 -2
- package/API/enclaveUtxoCalls.mjs +5 -3
- package/API/fetchCommitmentsCache.cjs +1 -1
- package/API/fetchCommitmentsCache.d.ts +1 -19
- package/API/fetchCommitmentsCache.mjs +9 -22
- package/API/getAnyRecipientInfo.d.ts +1 -0
- package/API/getServerURL.cjs +1 -1
- package/API/getServerURL.d.ts +3 -0
- package/API/getServerURL.mjs +15 -32
- package/API/getWebsiteURL.cjs +1 -1
- package/API/getWebsiteURL.d.ts +3 -2
- package/API/getWebsiteURL.mjs +12 -5
- package/API/index.cjs +1 -1
- package/API/index.d.ts +2 -0
- package/API/index.mjs +2 -0
- package/API/kycCalls.cjs +1 -1
- package/API/kycCalls.d.ts +0 -5
- package/API/kycCalls.mjs +3 -10
- package/API/privateSendRecipientInfoCalls.cjs +1 -1
- package/API/privateSendRecipientInfoCalls.d.ts +0 -10
- package/API/privateSendRecipientInfoCalls.mjs +2 -2
- package/API/scheduled-transactions-calls.cjs +1 -1
- package/API/scheduled-transactions-calls.d.ts +8 -2
- package/API/scheduled-transactions-calls.mjs +5 -4
- package/API/tenderly.api.cjs +1 -1
- package/API/tenderly.api.d.ts +1 -1
- package/API/tenderly.api.mjs +1 -1
- package/constants/addresses.constants.cjs +1 -1
- package/constants/addresses.constants.d.ts +10 -7
- package/constants/addresses.constants.mjs +11 -8
- package/constants/assets.constants.cjs +1 -1
- package/constants/assets.constants.mjs +1 -1
- package/constants/auth.constants.cjs +1 -0
- package/constants/auth.constants.d.ts +2 -0
- package/constants/auth.constants.mjs +4 -0
- package/constants/backend.constants.cjs +1 -1
- package/constants/backend.constants.d.ts +0 -1
- package/constants/backend.constants.mjs +0 -1
- package/constants/bridging.constants.cjs +1 -1
- package/constants/bridging.constants.d.ts +2 -0
- package/constants/bridging.constants.mjs +7 -3
- package/constants/chains.constants.cjs +1 -1
- package/constants/chains.constants.d.ts +25 -8
- package/constants/chains.constants.mjs +168 -127
- package/constants/coingecko.constants.cjs +1 -1
- package/constants/coingecko.constants.d.ts +5 -3
- package/constants/coingecko.constants.mjs +8 -5
- package/constants/contracts.constants.cjs +1 -1
- package/constants/contracts.constants.mjs +0 -4
- package/constants/deploy-data/deploy-data-arbMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-arbMainnet.json.mjs +125 -850
- package/constants/deploy-data/deploy-data-arcTestnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-arcTestnet.json.mjs +97 -1013
- package/constants/deploy-data/deploy-data-base.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-base.json.mjs +132 -869
- package/constants/deploy-data/deploy-data-ethMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-ethMainnet.json.mjs +132 -871
- package/constants/deploy-data/deploy-data-localhost.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-localhost.json.mjs +6 -808
- package/constants/deploy-data/deploy-data-optimism.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-optimism.json.mjs +132 -869
- package/constants/deploy-data/deploy-data-optimismTest.json.cjs +1 -0
- package/constants/deploy-data/deploy-data-optimismTest.json.mjs +3565 -0
- package/constants/deploy-data/deploy-data-polygon.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-polygon.json.mjs +132 -869
- package/constants/deploy-data/deploy-data-sepoliaTestnet.json.cjs +1 -0
- package/constants/deploy-data/deploy-data-sepoliaTestnet.json.mjs +3561 -0
- package/constants/deploy-data/deploy-data-solana.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-solana.json.mjs +1 -1
- package/constants/deploy-data/deploy-data-tempo.json.cjs +1 -0
- package/constants/deploy-data/deploy-data-tempo.json.mjs +3563 -0
- package/constants/deploy-data/deploy-data-tronMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-tronMainnet.json.mjs +133 -870
- package/constants/deploy-data/deploy-data-tronNile.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-tronNile.json.mjs +133 -870
- package/constants/deploy-data/index.d.ts +4 -1
- package/constants/events.constants.cjs +1 -1
- package/constants/events.constants.mjs +4 -1
- package/constants/fees.constants.cjs +1 -1
- package/constants/fees.constants.d.ts +5 -1
- package/constants/fees.constants.mjs +9 -5
- package/constants/index.cjs +1 -1
- package/constants/index.d.ts +2 -1
- package/constants/index.mjs +6 -2
- package/constants/kyc.constants.cjs +1 -1
- package/constants/kyc.constants.d.ts +1 -1
- package/constants/kyc.constants.mjs +38 -37
- package/constants/lifi.constants.cjs +1 -1
- package/constants/lifi.constants.d.ts +2 -0
- package/constants/lifi.constants.mjs +7 -2
- package/constants/mediaUrls.constants.cjs +1 -1
- package/constants/mediaUrls.constants.d.ts +7 -1
- package/constants/mediaUrls.constants.mjs +9 -3
- package/constants/price-impact.constants.cjs +1 -0
- package/constants/price-impact.constants.d.ts +2 -0
- package/constants/price-impact.constants.mjs +4 -0
- package/constants/protocol.constants.cjs +1 -1
- package/constants/protocol.constants.d.ts +4 -1
- package/constants/protocol.constants.mjs +2 -2
- package/constants/reorg-depths.constants.cjs +1 -1
- package/constants/reorg-depths.constants.d.ts +3 -1
- package/constants/reorg-depths.constants.mjs +3 -1
- package/constants/save-depths.cjs +1 -1
- package/constants/save-depths.d.ts +3 -1
- package/constants/save-depths.mjs +3 -1
- package/constants/server.constants.cjs +1 -1
- package/constants/server.constants.d.ts +33 -8
- package/constants/server.constants.mjs +44 -24
- package/constants/token-data/ERC20Registry.cjs +1 -1
- package/constants/token-data/ERC20Registry.mjs +20 -9
- package/constants/token-data/arbMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/arbMainnetRegistry.json.mjs +24 -24
- package/constants/token-data/arbMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/arbMainnetRegistryFixed.json.mjs +24 -24
- package/constants/token-data/arcTestnetRegistry.json.cjs +1 -1
- package/constants/token-data/arcTestnetRegistry.json.mjs +3 -3
- package/constants/token-data/baseRegistry.json.cjs +1 -1
- package/constants/token-data/baseRegistry.json.mjs +20 -12
- package/constants/token-data/baseRegistryFixed.json.cjs +1 -1
- package/constants/token-data/baseRegistryFixed.json.mjs +18 -10
- package/constants/token-data/ethMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/ethMainnetRegistry.json.mjs +38 -38
- package/constants/token-data/ethMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/ethMainnetRegistryFixed.json.mjs +38 -38
- package/constants/token-data/localhostRegistry.json.cjs +1 -1
- package/constants/token-data/localhostRegistry.json.mjs +211 -211
- package/constants/token-data/optimismRegistry.json.cjs +1 -1
- package/constants/token-data/optimismRegistry.json.mjs +36 -28
- package/constants/token-data/optimismRegistryFixed.json.cjs +1 -1
- package/constants/token-data/optimismRegistryFixed.json.mjs +36 -28
- package/constants/token-data/polygonRegistry.json.cjs +1 -1
- package/constants/token-data/polygonRegistry.json.mjs +34 -26
- package/constants/token-data/polygonRegistryFixed.json.cjs +1 -1
- package/constants/token-data/polygonRegistryFixed.json.mjs +34 -26
- package/constants/token-data/sepoliaTestnetRegistry.json.cjs +1 -0
- package/constants/token-data/sepoliaTestnetRegistry.json.mjs +21 -0
- package/constants/token-data/solanaMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/solanaMainnetRegistry.json.mjs +1 -1
- package/constants/token-data/tempoRegistry.json.cjs +1 -0
- package/constants/token-data/tempoRegistry.json.mjs +37 -0
- package/constants/token-data/tronMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/tronMainnetRegistry.json.mjs +26 -15
- package/constants/token-data/tronNileRegistry.json.cjs +1 -1
- package/constants/token-data/tronNileRegistry.json.mjs +2 -2
- package/constants/tokens.constants.cjs +1 -1
- package/constants/tokens.constants.d.ts +1 -0
- package/constants/tokens.constants.mjs +10 -3
- package/constants/vite.constants.cjs +1 -1
- package/constants/vite.constants.mjs +23 -5
- package/constants/wallet.constants.cjs +1 -1
- package/constants/wallet.constants.d.ts +1 -1
- package/constants/wallet.constants.mjs +2 -18
- package/crypto/babyJub.d.ts +1 -1
- package/crypto/ecdh-dual-path.cjs +1 -0
- package/crypto/ecdh-dual-path.d.ts +13 -0
- package/crypto/ecdh-dual-path.mjs +39 -0
- package/crypto/ecdh-sealed-keys.cjs +1 -0
- package/crypto/ecdh-sealed-keys.d.ts +22 -0
- package/crypto/ecdh-sealed-keys.mjs +33 -0
- package/crypto/ecdh.cjs +1 -0
- package/crypto/ecdh.d.ts +2 -0
- package/crypto/ecdh.mjs +9 -0
- package/crypto/eddsa.cjs +1 -0
- package/crypto/eddsa.d.ts +8 -0
- package/crypto/eddsa.mjs +12 -0
- package/crypto/index.cjs +1 -1
- package/crypto/index.d.ts +4 -0
- package/crypto/index.mjs +4 -0
- package/crypto/preProcessing.cjs +1 -1
- package/crypto/preProcessing.d.ts +1 -1
- package/crypto/preProcessing.mjs +10 -8
- package/data-structures/AccountActions/AccountActions.cjs +1 -1
- package/data-structures/AccountActions/AccountActions.mjs +3 -2
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.cjs +1 -1
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.mjs +2 -3
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.d.ts +16 -21
- package/data-structures/Hinkal/Hinkal.mjs +144 -160
- package/data-structures/Hinkal/IHinkal.d.ts +13 -19
- package/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
- package/data-structures/Hinkal/handleAutoDepositBack.mjs +15 -15
- package/data-structures/Hinkal/hinkalClaimUtxo.cjs +1 -1
- package/data-structures/Hinkal/hinkalClaimUtxo.d.ts +1 -2
- package/data-structures/Hinkal/hinkalClaimUtxo.mjs +49 -47
- package/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalDeposit.d.ts +5 -3
- package/data-structures/Hinkal/hinkalDeposit.mjs +106 -50
- package/data-structures/Hinkal/hinkalDepositAndBridge.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositAndBridge.d.ts +1 -1
- package/data-structures/Hinkal/hinkalDepositAndBridge.mjs +94 -87
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.d.ts +3 -2
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +48 -48
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.mjs +41 -63
- package/data-structures/Hinkal/hinkalPalEvmDeposit.cjs +1 -0
- package/data-structures/Hinkal/hinkalPalEvmDeposit.d.ts +9 -0
- package/data-structures/Hinkal/hinkalPalEvmDeposit.mjs +19 -0
- package/data-structures/Hinkal/hinkalPalSolanaDepositPrepare.cjs +1 -0
- package/data-structures/Hinkal/hinkalPalSolanaDepositPrepare.d.ts +9 -0
- package/data-structures/Hinkal/hinkalPalSolanaDepositPrepare.mjs +18 -0
- package/data-structures/Hinkal/hinkalPalTronDepositPrepare.cjs +1 -0
- package/data-structures/Hinkal/hinkalPalTronDepositPrepare.d.ts +9 -0
- package/data-structures/Hinkal/hinkalPalTronDepositPrepare.mjs +17 -0
- package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
- package/data-structures/Hinkal/hinkalPrivateWallet.mjs +46 -50
- package/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalProoflessDeposit.d.ts +4 -1
- package/data-structures/Hinkal/hinkalProoflessDeposit.mjs +84 -128
- package/data-structures/Hinkal/hinkalProoflessDeposit.utils.cjs +1 -0
- package/data-structures/Hinkal/hinkalProoflessDeposit.utils.d.ts +7 -0
- package/data-structures/Hinkal/hinkalProoflessDeposit.utils.mjs +51 -0
- package/data-structures/Hinkal/hinkalProoflessDepositViaWrapper.cjs +1 -0
- package/data-structures/Hinkal/hinkalProoflessDepositViaWrapper.d.ts +6 -0
- package/data-structures/Hinkal/hinkalProoflessDepositViaWrapper.mjs +128 -0
- package/data-structures/Hinkal/hinkalSolanaClaimUtxo.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaClaimUtxo.d.ts +2 -2
- package/data-structures/Hinkal/hinkalSolanaClaimUtxo.mjs +68 -69
- package/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDeposit.d.ts +4 -3
- package/data-structures/Hinkal/hinkalSolanaDeposit.mjs +96 -57
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +20 -2
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +114 -122
- package/data-structures/Hinkal/hinkalSolanaProoflessDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProoflessDeposit.d.ts +1 -1
- package/data-structures/Hinkal/hinkalSolanaProoflessDeposit.mjs +12 -17
- package/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +38 -40
- package/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySwap.d.ts +4 -3
- package/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +68 -52
- package/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaSwap.d.ts +2 -2
- package/data-structures/Hinkal/hinkalSolanaSwap.mjs +67 -72
- package/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaTransfer.d.ts +2 -1
- package/data-structures/Hinkal/hinkalSolanaTransfer.mjs +56 -61
- package/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +38 -48
- package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSwap.mjs +32 -42
- package/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalTransfer.mjs +41 -54
- package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdraw.mjs +43 -56
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +87 -108
- package/data-structures/Hinkal/index.cjs +1 -1
- package/data-structures/Hinkal/index.d.ts +5 -0
- package/data-structures/Hinkal/index.mjs +5 -0
- package/data-structures/Hinkal/prepareDepositOnChainUtxosZkProof.cjs +1 -0
- package/data-structures/Hinkal/prepareDepositOnChainUtxosZkProof.d.ts +22 -0
- package/data-structures/Hinkal/prepareDepositOnChainUtxosZkProof.mjs +34 -0
- package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.mjs +33 -40
- package/data-structures/IndexedDB/activity-db.cjs +1 -1
- package/data-structures/IndexedDB/activity-db.mjs +25 -24
- package/data-structures/IndexedDB/contact-db.cjs +1 -1
- package/data-structures/IndexedDB/contact-db.d.ts +1 -0
- package/data-structures/IndexedDB/contact-db.mjs +30 -16
- package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.cjs +1 -1
- package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.d.ts +1 -1
- package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.mjs +4 -4
- package/data-structures/TokenDBs/AlchemyPublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/AlchemyPublicTokensDB.mjs +37 -34
- package/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/EventsPublicTokensDB.d.ts +2 -0
- package/data-structures/TokenDBs/EventsPublicTokensDB.mjs +65 -50
- package/data-structures/TokenDBs/PrivateTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/PrivateTokensDB.mjs +2 -1
- package/data-structures/WalletManager/WalletManager.cjs +1 -0
- package/data-structures/WalletManager/WalletManager.d.ts +51 -0
- package/data-structures/WalletManager/WalletManager.mjs +99 -0
- package/data-structures/WalletManager/index.cjs +1 -0
- package/data-structures/WalletManager/index.d.ts +1 -0
- package/data-structures/WalletManager/index.mjs +1 -0
- package/data-structures/crypto-keys/decodeUTXO.cjs +1 -1
- package/data-structures/crypto-keys/decodeUTXO.d.ts +5 -3
- package/data-structures/crypto-keys/decodeUTXO.mjs +49 -46
- package/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
- package/data-structures/crypto-keys/encryptDecryptUtxo.mjs +32 -40
- package/data-structures/crypto-keys/keys.cjs +1 -1
- package/data-structures/crypto-keys/keys.d.ts +51 -24
- package/data-structures/crypto-keys/keys.mjs +104 -43
- package/data-structures/custom-token-registry/CustomTokenRegistry.cjs +1 -1
- package/data-structures/custom-token-registry/CustomTokenRegistry.mjs +2 -2
- package/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/evm/BlockchainEventEmitter.d.ts +2 -2
- package/data-structures/event-service/evm/BlockchainEventEmitter.mjs +4 -4
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.mjs +1 -1
- package/data-structures/event-service/helpers/ClientEventHelper.cjs +1 -1
- package/data-structures/event-service/helpers/ClientEventHelper.mjs +3 -3
- package/data-structures/event-service/helpers/PollingEventHelper.cjs +1 -1
- package/data-structures/event-service/helpers/PollingEventHelper.d.ts +2 -0
- package/data-structures/event-service/helpers/PollingEventHelper.mjs +7 -3
- package/data-structures/event-service/index.cjs +1 -1
- package/data-structures/event-service/index.d.ts +0 -3
- package/data-structures/event-service/index.mjs +0 -3
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.mjs +1 -1
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.d.ts +2 -2
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.mjs +5 -5
- package/data-structures/index.cjs +1 -1
- package/data-structures/index.d.ts +1 -0
- package/data-structures/index.mjs +10 -10
- package/data-structures/merkle-tree/index.cjs +1 -1
- package/data-structures/merkle-tree/index.d.ts +0 -1
- package/data-structures/merkle-tree/index.mjs +0 -1
- package/data-structures/provider-adapter/IProviderAdapter.d.ts +6 -0
- package/data-structures/snapshot/SnapshotFetcherService.cjs +1 -1
- package/data-structures/snapshot/SnapshotFetcherService.d.ts +0 -2
- package/data-structures/snapshot/SnapshotFetcherService.mjs +0 -6
- package/data-structures/snapshot/index.cjs +1 -1
- package/data-structures/snapshot/index.d.ts +0 -3
- package/data-structures/snapshot/index.mjs +0 -3
- package/data-structures/utxo/Utxo.cjs +1 -1
- package/data-structures/utxo/Utxo.d.ts +16 -10
- package/data-structures/utxo/Utxo.mjs +40 -38
- package/error-handling/customErrors/HttpError.cjs +1 -0
- package/error-handling/customErrors/HttpError.d.ts +4 -0
- package/error-handling/customErrors/HttpError.mjs +8 -0
- package/error-handling/customErrors/index.cjs +1 -1
- package/error-handling/customErrors/index.d.ts +1 -0
- package/error-handling/customErrors/index.mjs +1 -0
- package/error-handling/error-codes.constants.cjs +1 -1
- package/error-handling/error-codes.constants.d.ts +11 -0
- package/error-handling/error-codes.constants.mjs +13 -2
- package/error-handling/index.cjs +1 -1
- package/error-handling/index.mjs +1 -0
- package/error-handling/retrySolanaError.cjs +1 -0
- package/error-handling/retrySolanaError.d.ts +1 -0
- package/error-handling/retrySolanaError.mjs +4 -0
- package/externalABIs/index.cjs +1 -1
- package/externalABIs/index.d.ts +1 -16
- package/externalABIs/index.mjs +4 -5
- package/functions/auto-deposit-back-helpers/get-gas-token-records.d.ts +1 -1
- package/functions/auto-deposit-back-helpers/get-tokens-to-deposit-back.d.ts +1 -1
- package/functions/index.cjs +1 -1
- package/functions/index.mjs +28 -19
- package/functions/kyc/checkTokenLimitsUSD.cjs +1 -1
- package/functions/kyc/checkTokenLimitsUSD.mjs +15 -15
- package/functions/kyc/index.cjs +1 -1
- package/functions/kyc/index.d.ts +0 -1
- package/functions/kyc/index.mjs +0 -1
- package/functions/pre-transaction/addressTableLookup.cjs +1 -1
- package/functions/pre-transaction/addressTableLookup.mjs +21 -18
- package/functions/pre-transaction/buildCommitmentValidationData.cjs +1 -0
- package/functions/pre-transaction/buildCommitmentValidationData.d.ts +4 -0
- package/functions/pre-transaction/buildCommitmentValidationData.mjs +58 -0
- package/functions/pre-transaction/calculateSolanaNullifierCount.cjs +1 -0
- package/functions/pre-transaction/calculateSolanaNullifierCount.d.ts +2 -0
- package/functions/pre-transaction/calculateSolanaNullifierCount.mjs +23 -0
- package/functions/pre-transaction/constructAdminData.cjs +1 -1
- package/functions/pre-transaction/constructAdminData.mjs +4 -4
- package/functions/pre-transaction/index.cjs +1 -1
- package/functions/pre-transaction/index.d.ts +2 -3
- package/functions/pre-transaction/index.mjs +3 -4
- package/functions/pre-transaction/outputUtxoProcessing.cjs +1 -1
- package/functions/pre-transaction/outputUtxoProcessing.d.ts +1 -1
- package/functions/pre-transaction/outputUtxoProcessing.mjs +22 -19
- package/functions/pre-transaction/recipientUtxoProcessing.cjs +1 -1
- package/functions/pre-transaction/recipientUtxoProcessing.mjs +11 -9
- package/functions/pre-transaction/sendInitNullifiersTransaction.cjs +1 -1
- package/functions/pre-transaction/sendInitNullifiersTransaction.mjs +9 -9
- package/functions/pre-transaction/sendV0Transaction.cjs +1 -1
- package/functions/pre-transaction/sendV0Transaction.mjs +45 -43
- package/functions/pre-transaction/solana-public-signals.cjs +1 -1
- package/functions/pre-transaction/solana-public-signals.d.ts +7 -6
- package/functions/pre-transaction/solana-public-signals.mjs +22 -19
- package/functions/pre-transaction/solana.cjs +1 -1
- package/functions/pre-transaction/solana.d.ts +0 -4
- package/functions/pre-transaction/solana.mjs +7 -27
- package/functions/pre-transaction/store-proof.cjs +1 -1
- package/functions/pre-transaction/store-proof.mjs +3 -3
- package/functions/private-wallet/emporium.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.helpers.d.ts +14 -4
- package/functions/private-wallet/emporium.helpers.mjs +84 -74
- package/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.swap.helpers.mjs +6 -6
- package/functions/snarkjs/common.snarkjs.cjs +1 -1
- package/functions/snarkjs/common.snarkjs.d.ts +8 -13
- package/functions/snarkjs/common.snarkjs.mjs +65 -74
- package/functions/snarkjs/constant.cjs +1 -1
- package/functions/snarkjs/constant.d.ts +146 -426
- package/functions/snarkjs/constant.mjs +149 -430
- package/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
- package/functions/snarkjs/constructGeneralZkProof.d.ts +2 -3
- package/functions/snarkjs/constructGeneralZkProof.mjs +74 -57
- package/functions/snarkjs/constructSolanaZkProof.cjs +1 -1
- package/functions/snarkjs/constructSolanaZkProof.d.ts +1 -2
- package/functions/snarkjs/constructSolanaZkProof.mjs +65 -37
- package/functions/snarkjs/fetchMerkleTreeSiblings.cjs +1 -1
- package/functions/snarkjs/fetchMerkleTreeSiblings.d.ts +1 -1
- package/functions/snarkjs/fetchMerkleTreeSiblings.mjs +6 -10
- package/functions/snarkjs/fetchOnChainRootHashes.cjs +1 -1
- package/functions/snarkjs/fetchOnChainRootHashes.d.ts +0 -1
- package/functions/snarkjs/fetchOnChainRootHashes.mjs +22 -7
- package/functions/snarkjs/generateCircomData.cjs +1 -1
- package/functions/snarkjs/generateCircomData.d.ts +2 -2
- package/functions/snarkjs/generateCircomData.mjs +29 -31
- package/functions/snarkjs/generateZkProof.cjs +1 -1
- package/functions/snarkjs/generateZkProof.mjs +20 -10
- package/functions/snarkjs/generateZkProofEnclave.cjs +1 -1
- package/functions/snarkjs/generateZkProofEnclave.mjs +15 -18
- package/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.cjs +1 -1
- package/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.d.ts +2 -9
- package/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.mjs +40 -94
- package/functions/snarkjs/getZKFiles.cjs +1 -1
- package/functions/snarkjs/getZKFiles.d.ts +1 -0
- package/functions/snarkjs/getZKFiles.mjs +2 -2
- package/functions/snarkjs/index.cjs +1 -1
- package/functions/snarkjs/index.d.ts +2 -1
- package/functions/snarkjs/index.mjs +2 -1
- package/functions/snarkjs/signedMessageHash.cjs +1 -0
- package/functions/snarkjs/signedMessageHash.d.ts +31 -0
- package/functions/snarkjs/signedMessageHash.mjs +49 -0
- package/functions/snarkjs/verifyCommitmentValidationData.cjs +1 -0
- package/functions/snarkjs/verifyCommitmentValidationData.d.ts +4 -0
- package/functions/snarkjs/verifyCommitmentValidationData.mjs +43 -0
- package/functions/utils/addresses.cjs +1 -1
- package/functions/utils/addresses.d.ts +2 -0
- package/functions/utils/addresses.mjs +12 -8
- package/functions/utils/aggregateTokenAmounts.cjs +1 -0
- package/functions/utils/aggregateTokenAmounts.d.ts +2 -0
- package/functions/utils/aggregateTokenAmounts.mjs +26 -0
- package/functions/utils/amounts.utils.cjs +1 -1
- package/functions/utils/amounts.utils.d.ts +0 -1
- package/functions/utils/amounts.utils.mjs +18 -18
- package/functions/utils/auth.utils.cjs +1 -0
- package/functions/utils/auth.utils.d.ts +5 -0
- package/functions/utils/auth.utils.mjs +7 -0
- package/functions/utils/bit.operations.cjs +1 -0
- package/functions/utils/bit.operations.d.ts +3 -0
- package/functions/utils/bit.operations.mjs +4 -0
- package/functions/utils/buildClaimableDepositPlan.cjs +1 -1
- package/functions/utils/buildClaimableDepositPlan.d.ts +3 -2
- package/functions/utils/buildClaimableDepositPlan.mjs +32 -24
- package/functions/utils/cacheFunctions.cjs +1 -1
- package/functions/utils/cacheFunctions.d.ts +0 -4
- package/functions/utils/cacheFunctions.mjs +33 -47
- package/functions/utils/create-provider.cjs +1 -1
- package/functions/utils/create-provider.d.ts +2 -3
- package/functions/utils/create-provider.mjs +9 -9
- package/functions/utils/customEnclaveFunctionsRegister.cjs +1 -0
- package/functions/utils/customEnclaveFunctionsRegister.d.ts +18 -0
- package/functions/utils/customEnclaveFunctionsRegister.mjs +8 -0
- package/functions/utils/deposit-claimable.utils.cjs +1 -0
- package/functions/utils/deposit-claimable.utils.d.ts +6 -0
- package/functions/utils/deposit-claimable.utils.mjs +106 -0
- package/functions/utils/dispatchBalanceRefreshes.cjs +1 -0
- package/functions/utils/dispatchBalanceRefreshes.d.ts +4 -0
- package/functions/utils/dispatchBalanceRefreshes.mjs +44 -0
- package/functions/utils/enclave-recipient-info-storage.cjs +1 -0
- package/functions/utils/enclave-recipient-info-storage.d.ts +2 -0
- package/functions/utils/enclave-recipient-info-storage.mjs +17 -0
- package/functions/utils/enclave-signature-storage.cjs +1 -1
- package/functions/utils/enclave-signature-storage.d.ts +1 -2
- package/functions/utils/enclave-signature-storage.mjs +6 -9
- package/functions/utils/enclave-utxo-storage.cjs +1 -1
- package/functions/utils/enclave-utxo-storage.d.ts +3 -2
- package/functions/utils/enclave-utxo-storage.mjs +18 -21
- package/functions/utils/encodeTokenWithId.cjs +1 -1
- package/functions/utils/encodeTokenWithId.mjs +1 -1
- package/functions/utils/encryptInputForEnclave.cjs +1 -1
- package/functions/utils/encryptInputForEnclave.mjs +17 -23
- package/functions/utils/enum.utils.cjs +1 -0
- package/functions/utils/enum.utils.mjs +12 -0
- package/functions/utils/erc20tokenFunctions.cjs +1 -1
- package/functions/utils/erc20tokenFunctions.d.ts +2 -0
- package/functions/utils/erc20tokenFunctions.mjs +26 -16
- package/functions/utils/evmNetworkFunctions.d.ts +1 -2
- package/functions/utils/fees.utils.cjs +1 -1
- package/functions/utils/fees.utils.d.ts +2 -1
- package/functions/utils/fees.utils.mjs +30 -16
- package/functions/utils/formatter.cjs +1 -0
- package/functions/utils/formatter.d.ts +1 -0
- package/functions/utils/formatter.mjs +15 -0
- package/functions/utils/getBlockExplorerUrl.cjs +1 -1
- package/functions/utils/getBlockExplorerUrl.mjs +1 -1
- package/functions/utils/getRecipientInfoFromUserKeys.cjs +1 -1
- package/functions/utils/getRecipientInfoFromUserKeys.d.ts +2 -0
- package/functions/utils/getRecipientInfoFromUserKeys.mjs +14 -9
- package/functions/utils/getUtxosFromReceipt.utils.cjs +1 -1
- package/functions/utils/getUtxosFromReceipt.utils.d.ts +1 -0
- package/functions/utils/getUtxosFromReceipt.utils.mjs +43 -27
- package/functions/utils/getUtxosFromReceiptSolana.cjs +1 -1
- package/functions/utils/getUtxosFromReceiptSolana.d.ts +1 -0
- package/functions/utils/getUtxosFromReceiptSolana.mjs +36 -21
- package/functions/utils/getWalletGroupKey.utils.cjs +1 -1
- package/functions/utils/getWalletGroupKey.utils.mjs +4 -1
- package/functions/utils/index.cjs +1 -1
- package/functions/utils/index.d.ts +14 -1
- package/functions/utils/index.mjs +21 -9
- package/functions/utils/lifi.utils.cjs +1 -0
- package/functions/utils/lifi.utils.d.ts +3 -0
- package/functions/utils/lifi.utils.mjs +30 -0
- package/functions/utils/mnemonics.cjs +1 -0
- package/functions/utils/mnemonics.d.ts +1 -0
- package/functions/utils/mnemonics.mjs +8 -0
- package/functions/utils/pay-routing.utils.cjs +1 -0
- package/functions/utils/pay-routing.utils.d.ts +4 -0
- package/functions/utils/pay-routing.utils.mjs +17 -0
- package/functions/utils/prepareHinkal.cjs +1 -1
- package/functions/utils/prepareHinkal.mjs +29 -29
- package/functions/utils/publicBalance.utils.cjs +1 -1
- package/functions/utils/publicBalance.utils.mjs +5 -5
- package/functions/utils/serialize-utxos.utils.cjs +1 -1
- package/functions/utils/serialize-utxos.utils.mjs +6 -2
- package/functions/utils/solana-memo.cjs +1 -0
- package/functions/utils/solana-memo.d.ts +3 -0
- package/functions/utils/solana-memo.mjs +15 -0
- package/functions/utils/solanaSendPreflight.utils.cjs +1 -0
- package/functions/utils/solanaSendPreflight.utils.d.ts +6 -0
- package/functions/utils/solanaSendPreflight.utils.mjs +21 -0
- package/functions/utils/string.utils.cjs +1 -1
- package/functions/utils/string.utils.mjs +1 -1
- package/functions/utils/time.utils.cjs +1 -1
- package/functions/utils/time.utils.d.ts +6 -0
- package/functions/utils/time.utils.mjs +23 -16
- package/functions/utils/token-check.utils.cjs +1 -1
- package/functions/utils/token-check.utils.d.ts +1 -0
- package/functions/utils/token-check.utils.mjs +9 -8
- package/functions/utils/transfer-claimable.utils.cjs +1 -0
- package/functions/utils/transfer-claimable.utils.d.ts +9 -0
- package/functions/utils/transfer-claimable.utils.mjs +93 -0
- package/functions/utils/tron.utils.cjs +1 -1
- package/functions/utils/tron.utils.d.ts +11 -1
- package/functions/utils/tron.utils.mjs +85 -40
- package/functions/utils/tx-confirmation.utils.cjs +1 -1
- package/functions/utils/tx-confirmation.utils.d.ts +1 -1
- package/functions/utils/tx-confirmation.utils.mjs +5 -5
- package/functions/utils/userAgent.cjs +1 -1
- package/functions/utils/userAgent.d.ts +1 -0
- package/functions/utils/userAgent.mjs +4 -1
- package/functions/web3/connectors.utils.cjs +1 -1
- package/functions/web3/connectors.utils.d.ts +1 -0
- package/functions/web3/connectors.utils.mjs +5 -2
- package/functions/web3/events/balanceChangedHandler.cjs +1 -1
- package/functions/web3/events/balanceChangedHandler.d.ts +2 -1
- package/functions/web3/events/balanceChangedHandler.mjs +3 -3
- package/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
- package/functions/web3/events/getInputUtxoAndBalance.d.ts +1 -1
- package/functions/web3/events/getInputUtxoAndBalance.mjs +21 -20
- package/functions/web3/events/getInputUtxosEnclave.cjs +1 -1
- package/functions/web3/events/getInputUtxosEnclave.d.ts +2 -1
- package/functions/web3/events/getInputUtxosEnclave.mjs +25 -18
- package/functions/web3/events/getShieldedBalance.cjs +1 -1
- package/functions/web3/events/getShieldedBalance.mjs +15 -17
- package/functions/web3/events/getTransactionLogEvents.cjs +1 -1
- package/functions/web3/events/getTransactionLogEvents.d.ts +8 -5
- package/functions/web3/events/getTransactionLogEvents.mjs +1 -1
- package/functions/web3/events/index.cjs +1 -1
- package/functions/web3/events/index.d.ts +0 -2
- package/functions/web3/events/index.mjs +0 -2
- package/functions/web3/functionCalls/constructBatchCall.cjs +1 -1
- package/functions/web3/functionCalls/constructBatchCall.d.ts +1 -0
- package/functions/web3/functionCalls/constructBatchCall.mjs +10 -2
- package/functions/web3/functionCalls/transactCallDirectTron.cjs +1 -1
- package/functions/web3/functionCalls/transactCallDirectTron.d.ts +4 -1
- package/functions/web3/functionCalls/transactCallDirectTron.mjs +89 -55
- package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.d.ts +5 -4
- package/functions/web3/functionCalls/transactCallRelayer.mjs +17 -13
- package/functions/web3/getContractMetadata.cjs +1 -1
- package/functions/web3/getContractMetadata.mjs +1 -1
- package/functions/web3/getTokenHolder.cjs +1 -1
- package/functions/web3/getTokenHolder.mjs +1 -1
- package/functions/web3/index.cjs +1 -1
- package/functions/web3/index.d.ts +0 -1
- package/functions/web3/index.mjs +0 -3
- package/functions/web3/lifiAPI.cjs +1 -1
- package/functions/web3/lifiAPI.mjs +28 -19
- package/functions/web3/oneInchAPI.cjs +1 -1
- package/functions/web3/oneInchAPI.mjs +1 -1
- package/index.cjs +1 -1
- package/index.mjs +331 -309
- package/package.json +5 -2
- package/providers/EthersProviderAdapter.cjs +1 -1
- package/providers/EthersProviderAdapter.mjs +1 -1
- package/providers/SolanaProviderAdapter.cjs +1 -1
- package/providers/SolanaProviderAdapter.d.ts +10 -1
- package/providers/SolanaProviderAdapter.mjs +38 -2
- package/providers/TronProviderAdapter.cjs +1 -1
- package/providers/TronProviderAdapter.mjs +2 -2
- package/providers/WagmiProviderAdapter.cjs +1 -1
- package/providers/WagmiProviderAdapter.d.ts +3 -1
- package/providers/WagmiProviderAdapter.mjs +62 -52
- package/providers/prepareSolanaHinkal.cjs +1 -1
- package/providers/prepareSolanaHinkal.mjs +3 -3
- package/types/admin.types.cjs +1 -1
- package/types/admin.types.d.ts +1 -8
- package/types/admin.types.mjs +1 -1
- package/types/cache.types.cjs +1 -1
- package/types/cache.types.d.ts +2 -1
- package/types/cache.types.mjs +1 -1
- package/types/chains.types.cjs +1 -0
- package/types/chains.types.d.ts +11 -0
- package/types/chains.types.mjs +8 -0
- package/types/circom-data.types.d.ts +13 -0
- package/types/commitments.types.d.ts +0 -6
- package/types/contacts.types.d.ts +1 -0
- package/types/dashboard-account.cjs +1 -0
- package/types/dashboard-account.d.ts +101 -0
- package/types/dashboard-account.mjs +8 -0
- package/types/dashboard-payout.types.cjs +1 -0
- package/types/dashboard-payout.types.d.ts +29 -0
- package/types/dashboard-payout.types.mjs +8 -0
- package/types/dashboard-transaction.types.d.ts +22 -0
- package/types/ethereum-network.types.cjs +1 -1
- package/types/ethereum-network.types.d.ts +15 -18
- package/types/ethereum-network.types.mjs +1 -1
- package/types/events.types.cjs +1 -1
- package/types/events.types.d.ts +2 -3
- package/types/events.types.mjs +1 -1
- package/types/external-action.types.cjs +1 -1
- package/types/external-action.types.d.ts +2 -1
- package/types/external-action.types.mjs +1 -1
- package/types/hinkal.types.cjs +1 -1
- package/types/hinkal.types.d.ts +6 -17
- package/types/hinkal.types.mjs +16 -18
- package/types/index.cjs +1 -1
- package/types/index.d.ts +6 -0
- package/types/index.mjs +3 -0
- package/types/pay-activities.types.d.ts +3 -0
- package/types/pay-routing.types.d.ts +9 -0
- package/types/scheduled-transactions.types.d.ts +7 -0
- package/types/solana.types.d.ts +5 -6
- package/types/token-prices.types.d.ts +4 -0
- package/types/transaction.types.d.ts +1 -3
- package/webworker/WorkerWrapper.cjs +1 -0
- package/webworker/WorkerWrapper.d.ts +9 -0
- package/webworker/WorkerWrapper.mjs +22 -0
- package/webworker/logError-fCJ4HXQz.js +22 -0
- package/webworker/package.json +112 -0
- package/webworker/performTaskWithWorker.cjs +1 -1
- package/webworker/performTaskWithWorker.mjs +4 -4
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.ts?worker&url.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.ts?worker&url.mjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.d.ts +0 -3
- package/webworker/snarkjsWorker/snarkjsWorkerNode.d.ts +0 -0
- package/webworker/snarkjsWorkerNode.cjs +3 -0
- package/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.mjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLogic.d.ts +0 -3
- package/webworker/utxoWorker/utxoWorkerNode.d.ts +0 -0
- package/webworker/utxoWorkerNode.cjs +1 -0
- package/webworker/viteWorkerURL.constant.cjs +4 -4
- package/webworker/viteWorkerURL.constant.mjs +4 -4
- package/webworker/worker.registry.cjs +1 -1
- package/webworker/worker.registry.mjs +6 -3
- package/webworker/workerFactory.cjs +1 -1
- package/webworker/workerFactory.d.ts +4 -1
- package/webworker/workerFactory.mjs +31 -17
- package/webworker/workerProxy-BNBqYien.js +130 -0
- package/webworker/workerProxy.d.ts +1 -1
- package/webworker/workerThreadsPatch.d.ts +1 -0
- package/webworker/zkProofWorker/zkProofWorker.types.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorker.types.d.ts +3 -13
- package/webworker/zkProofWorker/zkProofWorker.types.mjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.mjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLogic.d.ts +1 -5
- package/webworker/zkProofWorker/zkProofWorkerNode.d.ts +0 -0
- package/webworker/zkProofWorkerNode.cjs +1 -0
- package/API/solana-calls.cjs +0 -1
- package/API/solana-calls.d.ts +0 -38
- package/API/solana-calls.mjs +0 -8
- package/constants/non-circular-tokens.constants.cjs +0 -1
- package/constants/non-circular-tokens.constants.d.ts +0 -1
- package/constants/non-circular-tokens.constants.mjs +0 -4
- package/data-structures/Hinkal/hinkalCheckSolanaTokenRegistry.cjs +0 -1
- package/data-structures/Hinkal/hinkalCheckSolanaTokenRegistry.d.ts +0 -3
- package/data-structures/Hinkal/hinkalCheckSolanaTokenRegistry.mjs +0 -15
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.cjs +0 -1
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.d.ts +0 -4
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +0 -18
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.cjs +0 -1
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.d.ts +0 -35
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.mjs +0 -75
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.cjs +0 -1
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.d.ts +0 -30
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.mjs +0 -81
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.cjs +0 -1
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.d.ts +0 -35
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.mjs +0 -76
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.cjs +0 -1
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.d.ts +0 -2
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.mjs +0 -13
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.cjs +0 -1
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.d.ts +0 -8
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.mjs +0 -29
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.cjs +0 -1
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.d.ts +0 -8
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.mjs +0 -30
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.cjs +0 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.d.ts +0 -8
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.mjs +0 -26
- package/externalABIs/transactionsProver.json.cjs +0 -1
- package/externalABIs/transactionsProver.json.mjs +0 -43
- package/functions/pre-transaction/getKycAndSignatureData.cjs +0 -1
- package/functions/pre-transaction/getKycAndSignatureData.d.ts +0 -5
- package/functions/pre-transaction/getKycAndSignatureData.mjs +0 -12
- package/functions/pre-transaction/getSignatureDataForTransact.cjs +0 -1
- package/functions/pre-transaction/getSignatureDataForTransact.d.ts +0 -3
- package/functions/pre-transaction/getSignatureDataForTransact.mjs +0 -6
- package/functions/pre-transaction/initTokenLimitIfNeeded.cjs +0 -1
- package/functions/pre-transaction/initTokenLimitIfNeeded.d.ts +0 -3
- package/functions/pre-transaction/initTokenLimitIfNeeded.mjs +0 -17
- package/functions/pre-transaction/outputApprovalDataProcessing.cjs +0 -1
- package/functions/pre-transaction/outputApprovalDataProcessing.d.ts +0 -10
- package/functions/pre-transaction/outputApprovalDataProcessing.mjs +0 -22
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs +0 -1
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.d.ts +0 -6
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs +0 -11
- package/functions/snarkjs/constructEmporiumProof.cjs +0 -1
- package/functions/snarkjs/constructEmporiumProof.d.ts +0 -13
- package/functions/snarkjs/constructEmporiumProof.mjs +0 -74
- package/functions/utils/processUseApprovalUtxoData.cjs +0 -1
- package/functions/utils/processUseApprovalUtxoData.d.ts +0 -3
- package/functions/utils/processUseApprovalUtxoData.mjs +0 -13
- package/functions/web3/events/balanceChangedCustomHandler.cjs +0 -1
- package/functions/web3/events/balanceChangedCustomHandler.d.ts +0 -2
- package/functions/web3/events/balanceChangedCustomHandler.mjs +0 -9
- package/functions/web3/events/getApprovedBalance.cjs +0 -1
- package/functions/web3/events/getApprovedBalance.d.ts +0 -6
- package/functions/web3/events/getApprovedBalance.mjs +0 -37
- package/functions/web3/functionCalls/accessTokenCalls.cjs +0 -1
- package/functions/web3/functionCalls/accessTokenCalls.d.ts +0 -2
- package/functions/web3/functionCalls/accessTokenCalls.mjs +0 -19
- package/functions/web3/tron-wagmi-adapter.cjs +0 -1
- package/functions/web3/tron-wagmi-adapter.d.ts +0 -8
- package/functions/web3/tron-wagmi-adapter.mjs +0 -27
- package/providers/CustomEthersProvider.d.ts +0 -10
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.cjs +0 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.mjs +0 -30
- package/webworker/utxoWorker/utxoWorkerLogic.cjs +0 -1
- package/webworker/utxoWorker/utxoWorkerLogic.mjs +0 -69
- package/webworker/workerProxy.cjs +0 -1
- package/webworker/workerProxy.mjs +0 -33
- package/webworker/zkProofWorker/zkProofWorkerLogic.cjs +0 -1
- package/webworker/zkProofWorker/zkProofWorkerLogic.mjs +0 -45
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../
|
|
1
|
+
const e=require(`../../types/external-action.types.cjs`),t=require(`../../constants/chains.constants.cjs`),n=require(`../../constants/protocol.constants.cjs`),r=require(`../web3/etherFunctions.cjs`),ee=require(`../../crypto/poseidon.cjs`),te=require(`../../data-structures/crypto-keys/keys.cjs`),ne=require(`../utils/time.utils.cjs`),i=require(`../utils/bit.operations.cjs`),a=require(`../../error-handling/logger.cjs`),o=require(`./common.snarkjs.cjs`),s=require(`./signedMessageHash.cjs`),c=require(`./generateCircomData.cjs`),l=require(`./generateZkProof.cjs`),u=require(`../../data-structures/AccountActions/AccountActions.cjs`),d=require(`./getMerkleTreeSiblingsAndRootHashes.cjs`),f=require(`../private-wallet/emporium.helpers.cjs`);var p=async(p,m,h,g,_,v,y,b,x,S=n.zeroAddress,C=t.chainIds.localhost,w=m.map(()=>!1),T=void 0,E,D)=>{let O=o.getZkProofVerifierName(m,h),k=o.calcAmountChanges(m,h),A=m.map(e=>e[0].erc20TokenAddress),j=o.calcEncryptedOutputs(h),M=n.defaultSignatureData,N=g.getShieldedPrivateKey(),{pubSpendingBJJPoint:P}=g.getSpendingKeyPair(),F=o.calcStealthAddressStructure(te.UserKeys.findCorrectRandomization(r.randomBigInt(31),N),N,g.getSpendingKeyPair().pubSpendingBJJPoint),{inCommitmentSiblings:I,inCommitmentSiblingSides:re,rootHashHinkal:L,inNullifiers:R}=await d.getDataFromWorkers(C,p,m.map(e=>e.map(e=>e.getConstructableParams()))),z=o.buildOutCommitments(h),B=r.randomBigInt(31),V=ee.poseidonFunction(B),H=BigInt(h.length>0?h[0][0].timeStamp:ne.getCurrentTimeInSeconds()),U={rootHashHinkal:L,spendingPublicKey:P,nullifyingPrivateKey:N,erc20TokenAddresses:A,amountChanges:k,inAmounts:m.map(e=>e.map(e=>e.amount.toString())),inRandomizations:m.map(e=>e.map(e=>o.getUtxoCircuitInRandomization(e))),inH0Ax:m.map(e=>e.map(e=>o.getUtxoCircuitH0Coords(e)[0].toString())),inH0Ay:m.map(e=>e.map(e=>o.getUtxoCircuitH0Coords(e)[1].toString())),isNewStyle:m.map(e=>e.map(e=>!!e.isNewStyle)),inTimeStamps:m.map(e=>e.map(e=>e.timeStamp)),inNullifiers:R,inCommitmentSiblings:I,inCommitmentSiblingSides:re,outAmounts:h.map(e=>e.map(e=>e.amount.toString())),outTimeStamp:H,outPublicKeys:h.map(e=>e.map(e=>e.getStealthAddress())),outCommitments:z,calldataHash:0n,messageSeed:B,H0Ax:i.takeOffHighestBit(F.extraRandomization),H0Ay:F.H0},W=o.calcPublicSignalCount(O,U.erc20TokenAddresses,U.amountChanges,U.inNullifiers,U.outCommitments),G=o.calcAmountChanges(m,h,!0),K=o.getSlippageValues(G);a.Logger.log({publicSignalCount:W});let q=Array.isArray(y)?y:[y],J=t.getOnchainChainId(C),Y=D?u.AccountActions.getSignerAddressFromPrivateKey(J,D):void 0,X=_===e.ExternalActionId.Emporium?await f.encodeEmporiumMetadata(C,v??n.zeroAddress,D,q,V,Y):await f.encodeEmporiumMetadata(C,n.zeroAddress,void 0,_===0n?[]:q,V,n.zeroAddress);U.calldataHash=o.createCallDataHash(W,S,v,_,X,j,T,K,w,x,M,E);let Z=s.computeSignedMessageHashEvm({rootHashHinkal:L,erc20TokenAddresses:A,amountChanges:k,outTimeStamp:H,inNullifiers:R,outCommitments:z,calldataHash:U.calldataHash,message:V,outH1Ay:F.H1,H0Ax:U.H0Ax,H0Ay:F.H0}),{R8:Q,S:ie}=g.signEddsa(Z);U.eddsaSignature=[Q[0],Q[1],ie],U.signedMessageHash=Z;let $=O.startsWith(`mainEVMCircuitMin0`),ae={outTimeStamp:H,calldataHash:U.calldataHash,messageSeed:B},{zkCallData:oe}=await l.generateZkProof(C,O,$?ae:U,b);return{zkCallData:oe,circomData:c.generateCircomData(z,R,L,G,A,h,j,W,_,v,X,S,U.calldataHash,F,w,T,$?Number(H):void 0,K,x,M,E),dimData:{tokenNumber:m.length,nullifierAmount:m.length>0?m[0].length:0,outputAmount:h.length>0?h[0].length:0},encryptedOutputs:j}};exports.constructZkProof=p;
|
|
@@ -3,9 +3,8 @@ import { UserKeys } from '../../data-structures/crypto-keys/keys';
|
|
|
3
3
|
import { Utxo } from '../../data-structures/utxo/Utxo';
|
|
4
4
|
import { CircomDataType, DimDataType, HookDataType } from '../../types/circom-data.types';
|
|
5
5
|
import { ExternalActionId } from '../../types/external-action.types';
|
|
6
|
-
import { FeeStructure
|
|
7
|
-
|
|
8
|
-
export declare const constructZkProof: <T = CircomDataType>(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, patchAccessTokenMerkleTree?: boolean, hinkalLogicArgs?: HinkalLogicArgs | undefined, slippageValues?: bigint[], feeStructure?: FeeStructure | undefined, hinkalHelper?: ethers.Contract, signatureData?: import('../..').SignatureData, originalSender?: string) => Promise<{
|
|
6
|
+
import { FeeStructure } from '../../types/hinkal.types';
|
|
7
|
+
export declare const constructZkProof: <T = CircomDataType>(merkleTree: MerkleTree<bigint>, inputUtxos: Utxo[][], outputUtxos: Utxo[][], userKeys: UserKeys, externalActionId: ExternalActionId | 0n, externalAddress: string | undefined, externalActionMetadata: string | string[], generateProofRemotely: boolean, feeStructure: FeeStructure, relay?: string, chainId?: number, onChainCreation?: boolean[], hookData?: HookDataType | undefined, originalSender?: string, subAccountPrivateKey?: string) => Promise<{
|
|
9
8
|
zkCallData: import('../..').NewZkCallDataType;
|
|
10
9
|
circomData: T;
|
|
11
10
|
dimData: DimDataType;
|
|
@@ -1,64 +1,81 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { randomBigInt as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
1
|
+
import { ExternalActionId as e } from "../../types/external-action.types.mjs";
|
|
2
|
+
import { chainIds as t, getOnchainChainId as n } from "../../constants/chains.constants.mjs";
|
|
3
|
+
import { defaultSignatureData as r, zeroAddress as i } from "../../constants/protocol.constants.mjs";
|
|
4
|
+
import { randomBigInt as a } from "../web3/etherFunctions.mjs";
|
|
5
|
+
import { poseidonFunction as ee } from "../../crypto/poseidon.mjs";
|
|
6
|
+
import { UserKeys as te } from "../../data-structures/crypto-keys/keys.mjs";
|
|
7
|
+
import { getCurrentTimeInSeconds as ne } from "../utils/time.utils.mjs";
|
|
8
|
+
import { takeOffHighestBit as re } from "../utils/bit.operations.mjs";
|
|
9
|
+
import { Logger as ie } from "../../error-handling/logger.mjs";
|
|
10
|
+
import { buildOutCommitments as ae, calcAmountChanges as o, calcEncryptedOutputs as s, calcPublicSignalCount as c, calcStealthAddressStructure as l, createCallDataHash as u, getSlippageValues as d, getUtxoCircuitH0Coords as f, getUtxoCircuitInRandomization as oe, getZkProofVerifierName as se } from "./common.snarkjs.mjs";
|
|
11
|
+
import { computeSignedMessageHashEvm as ce } from "./signedMessageHash.mjs";
|
|
12
|
+
import { generateCircomData as le } from "./generateCircomData.mjs";
|
|
13
|
+
import { generateZkProof as ue } from "./generateZkProof.mjs";
|
|
14
|
+
import { AccountActions as de } from "../../data-structures/AccountActions/AccountActions.mjs";
|
|
15
|
+
import { getDataFromWorkers as p } from "./getMerkleTreeSiblingsAndRootHashes.mjs";
|
|
16
|
+
import { encodeEmporiumMetadata as m } from "../private-wallet/emporium.helpers.mjs";
|
|
13
17
|
//#region libs/shared/common/src/functions/snarkjs/constructGeneralZkProof.ts
|
|
14
|
-
var
|
|
15
|
-
let
|
|
16
|
-
rootHashHinkal:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
calldataHash: 0n
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
18
|
+
var h = async (h, g, _, v, y, b, x, fe, S, C = i, w = t.localhost, T = g.map(() => !1), E = void 0, D, O) => {
|
|
19
|
+
let k = se(g, _), A = o(g, _), j = g.map((e) => e[0].erc20TokenAddress), M = s(_), N = r, P = v.getShieldedPrivateKey(), { pubSpendingBJJPoint: F } = v.getSpendingKeyPair(), I = l(te.findCorrectRandomization(a(31), P), P, v.getSpendingKeyPair().pubSpendingBJJPoint), { inCommitmentSiblings: L, inCommitmentSiblingSides: R, rootHashHinkal: z, inNullifiers: B } = await p(w, h, g.map((e) => e.map((e) => e.getConstructableParams()))), V = ae(_), H = a(31), U = ee(H), W = BigInt(_.length > 0 ? _[0][0].timeStamp : ne()), G = {
|
|
20
|
+
rootHashHinkal: z,
|
|
21
|
+
spendingPublicKey: F,
|
|
22
|
+
nullifyingPrivateKey: P,
|
|
23
|
+
erc20TokenAddresses: j,
|
|
24
|
+
amountChanges: A,
|
|
25
|
+
inAmounts: g.map((e) => e.map((e) => e.amount.toString())),
|
|
26
|
+
inRandomizations: g.map((e) => e.map((e) => oe(e))),
|
|
27
|
+
inH0Ax: g.map((e) => e.map((e) => f(e)[0].toString())),
|
|
28
|
+
inH0Ay: g.map((e) => e.map((e) => f(e)[1].toString())),
|
|
29
|
+
isNewStyle: g.map((e) => e.map((e) => !!e.isNewStyle)),
|
|
30
|
+
inTimeStamps: g.map((e) => e.map((e) => e.timeStamp)),
|
|
31
|
+
inNullifiers: B,
|
|
32
|
+
inCommitmentSiblings: L,
|
|
33
|
+
inCommitmentSiblingSides: R,
|
|
34
|
+
outAmounts: _.map((e) => e.map((e) => e.amount.toString())),
|
|
35
|
+
outTimeStamp: W,
|
|
36
|
+
outPublicKeys: _.map((e) => e.map((e) => e.getStealthAddress())),
|
|
37
|
+
outCommitments: V,
|
|
38
|
+
calldataHash: 0n,
|
|
39
|
+
messageSeed: H,
|
|
40
|
+
H0Ax: re(I.extraRandomization),
|
|
41
|
+
H0Ay: I.H0
|
|
42
|
+
}, K = c(k, G.erc20TokenAddresses, G.amountChanges, G.inNullifiers, G.outCommitments), q = o(g, _, !0), J = d(q);
|
|
43
|
+
ie.log({ publicSignalCount: K });
|
|
44
|
+
let Y = Array.isArray(x) ? x : [x], pe = n(w), me = O ? de.getSignerAddressFromPrivateKey(pe, O) : void 0, X = y === e.Emporium ? await m(w, b ?? i, O, Y, U, me) : await m(w, i, void 0, y === 0n ? [] : Y, U, i);
|
|
45
|
+
G.calldataHash = u(K, C, b, y, X, M, E, J, T, S, N, D);
|
|
46
|
+
let Z = ce({
|
|
47
|
+
rootHashHinkal: z,
|
|
48
|
+
erc20TokenAddresses: j,
|
|
49
|
+
amountChanges: A,
|
|
50
|
+
outTimeStamp: W,
|
|
51
|
+
inNullifiers: B,
|
|
52
|
+
outCommitments: V,
|
|
53
|
+
calldataHash: G.calldataHash,
|
|
54
|
+
message: U,
|
|
55
|
+
outH1Ay: I.H1,
|
|
56
|
+
H0Ax: G.H0Ax,
|
|
57
|
+
H0Ay: I.H0
|
|
58
|
+
}), { R8: Q, S: he } = v.signEddsa(Z);
|
|
59
|
+
G.eddsaSignature = [
|
|
60
|
+
Q[0],
|
|
61
|
+
Q[1],
|
|
62
|
+
he
|
|
63
|
+
], G.signedMessageHash = Z;
|
|
64
|
+
let $ = k.startsWith("mainEVMCircuitMin0"), ge = {
|
|
65
|
+
outTimeStamp: W,
|
|
66
|
+
calldataHash: G.calldataHash,
|
|
67
|
+
messageSeed: H
|
|
68
|
+
}, { zkCallData: _e } = await ue(w, k, $ ? ge : G, fe);
|
|
52
69
|
return {
|
|
53
|
-
zkCallData:
|
|
54
|
-
circomData:
|
|
70
|
+
zkCallData: _e,
|
|
71
|
+
circomData: le(V, B, z, q, j, _, M, K, y, b, X, C, G.calldataHash, I, T, E, $ ? Number(W) : void 0, J, S, N, D),
|
|
55
72
|
dimData: {
|
|
56
|
-
tokenNumber:
|
|
57
|
-
nullifierAmount:
|
|
58
|
-
outputAmount:
|
|
73
|
+
tokenNumber: g.length,
|
|
74
|
+
nullifierAmount: g.length > 0 ? g[0].length : 0,
|
|
75
|
+
outputAmount: _.length > 0 ? _[0].length : 0
|
|
59
76
|
},
|
|
60
|
-
encryptedOutputs:
|
|
77
|
+
encryptedOutputs: M
|
|
61
78
|
};
|
|
62
79
|
};
|
|
63
80
|
//#endregion
|
|
64
|
-
export {
|
|
81
|
+
export { h as constructZkProof };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../web3/etherFunctions.cjs`),n=require(`../../crypto/poseidon.cjs`),r=require(`../utils/bit.operations.cjs`),i=require(`../utils/solanaMint.utils.cjs`),a=require(`./common.snarkjs.cjs`),o=require(`../pre-transaction/solana.cjs`),s=require(`./signedMessageHash.cjs`),c=require(`./generateZkProof.cjs`);require(`../pre-transaction/index.cjs`),require(`../utils/index.cjs`);const l=require(`./getMerkleTreeSiblingsAndRootHashes.cjs`),u=require(`../pre-transaction/getSolanaCalldataHash.cjs`);require(`../web3/index.cjs`);let d=require(`@solana/web3.js`);var f=async(f,p,m,h,g,_,v,y,b,x,S,C,w,T=e.chainIds.solanaLocalnet,E=[],D=[],O=0n)=>{let k=new d.PublicKey(x),A=new d.PublicKey(S),j=m.getShieldedPrivateKey(),{pubSpendingBJJPoint:M}=m.getSpendingKeyPair(),N=a.calcStealthAddressStructure(v,j,m.getSpendingKeyPair().pubSpendingBJJPoint),P=t.randomBigInt(31),F=n.poseidonFunction(P),I=n.poseidonFunction(O),L=h.map(e=>i.formatMintAddress(e)),R=L.map(e=>e.mintAccountPart1),z=L.map(e=>e.mintAccountPart2),B=u.getSolanaCalldataHash(C,k,A,w,y,b,E,D),V=`${C.tokenNumber}x${C.nullifierAmount}x${C.outputAmount}`,H=a.calcAmountChanges(g,_),{inCommitmentSiblings:U,inCommitmentSiblingSides:W,rootHashHinkal:G,inNullifiers:K}=await l.getDataFromWorkers(T,p,g.map(e=>e.map(e=>e.getConstructableParams()))),q=a.buildOutCommitments(_),J=r.takeOffHighestBit(N.extraRandomization),Y=N.H0,X=s.computeSignedMessageHashSolana({rootHashHinkal:G,mintAccountPart1:R,mintAccountPart2:z,amountChanges:H,outTimeStamp:BigInt(_[0][0].timeStamp),inNullifiers:K,outCommitments:q,calldataHash:B,message:F,swapperAccountAdditionalSeed:I,outH1Ay:N.H1,H0Ax:J,H0Ay:Y}),{R8:Z,S:Q}=m.signEddsa(X),$={rootHashHinkal:G,spendingPublicKey:M,eddsaSignature:[Z[0],Z[1],Q],signedMessageHash:X,nullifyingPrivateKey:j,mintAccountPart1:R,mintAccountPart2:z,amountChanges:H,inAmounts:g.map(e=>e.map(e=>e.amount.toString())),inRandomizations:g.map(e=>e.map(e=>a.getUtxoCircuitInRandomization(e))),inH0Ax:g.map(e=>e.map(e=>a.getUtxoCircuitH0Coords(e)[0].toString())),inH0Ay:g.map(e=>e.map(e=>a.getUtxoCircuitH0Coords(e)[1].toString())),isNewStyle:g.map(e=>e.map(e=>!!e.isNewStyle)),inTimeStamps:g.map(e=>e.map(e=>e.timeStamp)),inNullifiers:K,inCommitmentSiblings:U,inCommitmentSiblingSides:W,outAmounts:_.map(e=>e.map(e=>e.amount.toString())),outTimeStamp:BigInt(_[0][0].timeStamp),outPublicKeys:_.map(e=>e.map(e=>e.getStealthAddress())),outCommitments:q,calldataHash:B,messageSeed:P,swapperAccountSalt:O,H0Ax:J,H0Ay:Y},{publicSignals:ee,zkCallData:te}=await c.generateZkProof(T,`mainSolanaCircuit${V}`,$,f),[ne,re,ie]=te;return{proofAArr:ne.map(BigInt).map(o.encodeToByte32Array).flat(),proofBArr:re.flat().map(BigInt).map(o.encodeToByte32Array).flat(),proofCArr:ie.map(BigInt).map(o.encodeToByte32Array).flat(),publicInputsArr:ee.map(BigInt).map(o.encodeToByte32Array)}};exports.constructSolanaZkProof=f;
|
|
@@ -4,8 +4,7 @@ import { AccountMeta } from '@solana/web3.js';
|
|
|
4
4
|
import { DimDataType } from '../../types/circom-data.types';
|
|
5
5
|
import { MerkleTree } from '../../data-structures/merkle-tree';
|
|
6
6
|
import { UserKeys } from '../../data-structures/crypto-keys/keys';
|
|
7
|
-
|
|
8
|
-
export declare const constructSolanaZkProof: (generateProofRemotely: boolean, originalDeployer: string, merkleTreeHinkal: MerkleTree<bigint>, merkleTreeAccessToken: MerkleTree<bigint>, userKeys: UserKeys, hinkalProgram: Program, mintAddresses: string[], inputUtxosArray: Utxo[][], outputUtxosArray: Utxo[][], extraRandomization: bigint, relayerFee: bigint, variableRate: bigint, recipientAddress: string, signerAddress: string, dimensions: DimDataType, encryptedOutputs: number[][], chainId?: number, patchAccessTokenMerkleTree?: boolean, swapperAccountSalt?: bigint, instructions?: HinkalInstruction[], remainingAccounts?: AccountMeta[]) => Promise<{
|
|
7
|
+
export declare const constructSolanaZkProof: (generateProofRemotely: boolean, merkleTreeHinkal: MerkleTree<bigint>, userKeys: UserKeys, mintAddresses: string[], inputUtxosArray: Utxo[][], outputUtxosArray: Utxo[][], extraRandomization: bigint, relayerFee: bigint, variableRate: bigint, recipientAddress: string, signerAddress: string, dimensions: DimDataType, encryptedOutputs: number[][], chainId?: number, instructions?: HinkalInstruction[], remainingAccounts?: AccountMeta[], swapperAccountSalt?: bigint) => Promise<{
|
|
9
8
|
proofAArr: number[];
|
|
10
9
|
proofBArr: number[];
|
|
11
10
|
proofCArr: number[];
|
|
@@ -1,44 +1,72 @@
|
|
|
1
1
|
import { chainIds as e } from "../../constants/chains.constants.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { randomBigInt as t } from "../web3/etherFunctions.mjs";
|
|
3
|
+
import { poseidonFunction as n } from "../../crypto/poseidon.mjs";
|
|
4
|
+
import { takeOffHighestBit as r } from "../utils/bit.operations.mjs";
|
|
5
|
+
import { formatMintAddress as i } from "../utils/solanaMint.utils.mjs";
|
|
6
|
+
import { buildOutCommitments as a, calcAmountChanges as ee, calcStealthAddressStructure as o, getUtxoCircuitH0Coords as s, getUtxoCircuitInRandomization as c } from "./common.snarkjs.mjs";
|
|
7
|
+
import { encodeToByte32Array as l } from "../pre-transaction/solana.mjs";
|
|
8
|
+
import { computeSignedMessageHashSolana as u } from "./signedMessageHash.mjs";
|
|
9
|
+
import { generateZkProof as d } from "./generateZkProof.mjs";
|
|
7
10
|
import "../pre-transaction/index.mjs";
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
+
import "../utils/index.mjs";
|
|
12
|
+
import { getDataFromWorkers as f } from "./getMerkleTreeSiblingsAndRootHashes.mjs";
|
|
13
|
+
import { getSolanaCalldataHash as p } from "../pre-transaction/getSolanaCalldataHash.mjs";
|
|
14
|
+
import "../web3/index.mjs";
|
|
15
|
+
import { PublicKey as m } from "@solana/web3.js";
|
|
11
16
|
//#region libs/shared/common/src/functions/snarkjs/constructSolanaZkProof.ts
|
|
12
|
-
var
|
|
13
|
-
let
|
|
14
|
-
rootHashHinkal:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
17
|
+
var h = async (h, g, _, te, v, y, b, x, S, C, w, T, E, D = e.solanaLocalnet, O = [], k = [], A = 0n) => {
|
|
18
|
+
let j = new m(C), M = new m(w), N = _.getShieldedPrivateKey(), { pubSpendingBJJPoint: P } = _.getSpendingKeyPair(), F = o(b, N, _.getSpendingKeyPair().pubSpendingBJJPoint), I = t(31), L = n(I), R = n(A), z = te.map((e) => i(e)), B = z.map((e) => e.mintAccountPart1), V = z.map((e) => e.mintAccountPart2), H = p(T, j, M, E, x, S, O, k), U = `${T.tokenNumber}x${T.nullifierAmount}x${T.outputAmount}`, W = ee(v, y), { inCommitmentSiblings: G, inCommitmentSiblingSides: K, rootHashHinkal: q, inNullifiers: J } = await f(D, g, v.map((e) => e.map((e) => e.getConstructableParams()))), Y = a(y), X = r(F.extraRandomization), Z = F.H0, Q = u({
|
|
19
|
+
rootHashHinkal: q,
|
|
20
|
+
mintAccountPart1: B,
|
|
21
|
+
mintAccountPart2: V,
|
|
22
|
+
amountChanges: W,
|
|
23
|
+
outTimeStamp: BigInt(y[0][0].timeStamp),
|
|
24
|
+
inNullifiers: J,
|
|
25
|
+
outCommitments: Y,
|
|
26
|
+
calldataHash: H,
|
|
27
|
+
message: L,
|
|
28
|
+
swapperAccountAdditionalSeed: R,
|
|
29
|
+
outH1Ay: F.H1,
|
|
30
|
+
H0Ax: X,
|
|
31
|
+
H0Ay: Z
|
|
32
|
+
}), { R8: $, S: ne } = _.signEddsa(Q), re = {
|
|
33
|
+
rootHashHinkal: q,
|
|
34
|
+
spendingPublicKey: P,
|
|
35
|
+
eddsaSignature: [
|
|
36
|
+
$[0],
|
|
37
|
+
$[1],
|
|
38
|
+
ne
|
|
39
|
+
],
|
|
40
|
+
signedMessageHash: Q,
|
|
41
|
+
nullifyingPrivateKey: N,
|
|
42
|
+
mintAccountPart1: B,
|
|
43
|
+
mintAccountPart2: V,
|
|
44
|
+
amountChanges: W,
|
|
45
|
+
inAmounts: v.map((e) => e.map((e) => e.amount.toString())),
|
|
46
|
+
inRandomizations: v.map((e) => e.map((e) => c(e))),
|
|
47
|
+
inH0Ax: v.map((e) => e.map((e) => s(e)[0].toString())),
|
|
48
|
+
inH0Ay: v.map((e) => e.map((e) => s(e)[1].toString())),
|
|
49
|
+
isNewStyle: v.map((e) => e.map((e) => !!e.isNewStyle)),
|
|
50
|
+
inTimeStamps: v.map((e) => e.map((e) => e.timeStamp)),
|
|
51
|
+
inNullifiers: J,
|
|
52
|
+
inCommitmentSiblings: G,
|
|
53
|
+
inCommitmentSiblingSides: K,
|
|
54
|
+
outAmounts: y.map((e) => e.map((e) => e.amount.toString())),
|
|
55
|
+
outTimeStamp: BigInt(y[0][0].timeStamp),
|
|
56
|
+
outPublicKeys: y.map((e) => e.map((e) => e.getStealthAddress())),
|
|
57
|
+
outCommitments: Y,
|
|
58
|
+
calldataHash: H,
|
|
59
|
+
messageSeed: I,
|
|
60
|
+
swapperAccountSalt: A,
|
|
61
|
+
H0Ax: X,
|
|
62
|
+
H0Ay: Z
|
|
63
|
+
}, { publicSignals: ie, zkCallData: ae } = await d(D, `mainSolanaCircuit${U}`, re, h), [oe, se, ce] = ae;
|
|
36
64
|
return {
|
|
37
|
-
proofAArr:
|
|
38
|
-
proofBArr:
|
|
39
|
-
proofCArr:
|
|
40
|
-
publicInputsArr:
|
|
65
|
+
proofAArr: oe.map(BigInt).map(l).flat(),
|
|
66
|
+
proofBArr: se.flat().map(BigInt).map(l).flat(),
|
|
67
|
+
proofCArr: ce.map(BigInt).map(l).flat(),
|
|
68
|
+
publicInputsArr: ie.map(BigInt).map(l)
|
|
41
69
|
};
|
|
42
70
|
};
|
|
43
71
|
//#endregion
|
|
44
|
-
export {
|
|
72
|
+
export { h as constructSolanaZkProof };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../constants/server.constants.cjs`),t=require(`../../API/getServerURL.cjs`),n=require(`../../data-structures/http/HttpClient.cjs`);var
|
|
1
|
+
const e=require(`../../constants/server.constants.cjs`),t=require(`../../API/getServerURL.cjs`),n=require(`../../data-structures/http/HttpClient.cjs`),r=require(`../utils/serialize-utxos.utils.cjs`);var i=async(i,a)=>{let o=a.map(e=>e.map(e=>r.serializeUtxoConstructorParams(e))),s=`${t.SNAPSHOT_SERVER_URL}${e.API_CONFIG.ROUTES.getMerkleTreeSiblings}`;return await n.httpClient.post(s,{inputUtxosSerialized:o,chainId:i})};exports.fetchMerkleTreeSiblings=i;
|
|
@@ -7,5 +7,5 @@ interface MerkleTreeSiblingsResponse {
|
|
|
7
7
|
rootHashHinkal: string;
|
|
8
8
|
rootHashAccessToken: string;
|
|
9
9
|
}
|
|
10
|
-
export declare const fetchMerkleTreeSiblings: (chainId: number, inputUtxosSerialized: IUtxoConstructor[][]
|
|
10
|
+
export declare const fetchMerkleTreeSiblings: (chainId: number, inputUtxosSerialized: IUtxoConstructor[][]) => Promise<MerkleTreeSiblingsResponse>;
|
|
11
11
|
export {};
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import { API_CONFIG as e } from "../../constants/server.constants.mjs";
|
|
2
2
|
import { SNAPSHOT_SERVER_URL as t } from "../../API/getServerURL.mjs";
|
|
3
3
|
import { httpClient as n } from "../../data-structures/http/HttpClient.mjs";
|
|
4
|
+
import { serializeUtxoConstructorParams as r } from "../utils/serialize-utxos.utils.mjs";
|
|
4
5
|
//#region libs/shared/common/src/functions/snarkjs/fetchMerkleTreeSiblings.ts
|
|
5
|
-
var
|
|
6
|
-
let o =
|
|
7
|
-
|
|
8
|
-
amount: e.amount.toString(),
|
|
9
|
-
randomization: e.randomization?.toString()
|
|
10
|
-
})));
|
|
11
|
-
return await n.post(`${t}${e.ROUTES.getMerkleTreeSiblings}`, {
|
|
6
|
+
var i = async (i, a) => {
|
|
7
|
+
let o = a.map((e) => e.map((e) => r(e))), s = `${t}${e.ROUTES.getMerkleTreeSiblings}`;
|
|
8
|
+
return await n.post(s, {
|
|
12
9
|
inputUtxosSerialized: o,
|
|
13
|
-
|
|
14
|
-
chainId: r
|
|
10
|
+
chainId: i
|
|
15
11
|
});
|
|
16
12
|
};
|
|
17
13
|
//#endregion
|
|
18
|
-
export {
|
|
14
|
+
export { i as fetchMerkleTreeSiblings };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../types/ethereum-network.types.cjs`),t=require(`../web3/getContractMetadata.cjs`);var
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../types/ethereum-network.types.cjs`),t=require(`../../constants/chains.constants.cjs`),n=require(`../pre-transaction/solana.cjs`),r=require(`../utils/create-provider.cjs`),i=require(`../web3/getContractMetadata.cjs`),a=require(`../web3/fetchSolanaMerkleTreeRootHash.cjs`);let o=require(`@solana/web3.js`),s=require(`@coral-xyz/anchor`);var c=()=>{let e=o.Keypair.generate();return{publicKey:e.publicKey,payer:e,signTransaction:async e=>e,signAllTransactions:async e=>e}},l=async t=>({hinkalRootHash:await i.getContractWithFetcherByChainId(t,e.ContractType.HinkalContract).getRootHash()}),u=async e=>{let{contractData:i,fetchRpcUrl:l}=t.networkRegistry[e],{hinkalIdl:u,hinkalAddress:d,originalDeployer:f}=i;if(!u||!d||!f||!l)throw Error(`Missing Solana configuration for chain ${e}`);return{hinkalRootHash:await a.fetchSolanaMerkleTreeRootHash(new s.Program(u,new s.AnchorProvider(r.createCustomSolanaConnection(l),c(),{preflightCommitment:`confirmed`,commitment:`confirmed`})),n.getMerkleAccountPublicKey(new o.PublicKey(d),new o.PublicKey(f)))}},d=async e=>t.isSolanaLike(e)?u(e):l(e);exports.fetchOnChainRootHashes=d;
|
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
import { ContractType as e } from "../../types/ethereum-network.types.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { isSolanaLike as t, networkRegistry as n } from "../../constants/chains.constants.mjs";
|
|
3
|
+
import { getMerkleAccountPublicKey as r } from "../pre-transaction/solana.mjs";
|
|
4
|
+
import { createCustomSolanaConnection as i } from "../utils/create-provider.mjs";
|
|
5
|
+
import { getContractWithFetcherByChainId as a } from "../web3/getContractMetadata.mjs";
|
|
6
|
+
import { fetchSolanaMerkleTreeRootHash as o } from "../web3/fetchSolanaMerkleTreeRootHash.mjs";
|
|
7
|
+
import { Keypair as s, PublicKey as c } from "@solana/web3.js";
|
|
8
|
+
import { AnchorProvider as l, Program as u } from "@coral-xyz/anchor";
|
|
3
9
|
//#region libs/shared/common/src/functions/snarkjs/fetchOnChainRootHashes.ts
|
|
4
|
-
var
|
|
5
|
-
let
|
|
10
|
+
var d = () => {
|
|
11
|
+
let e = s.generate();
|
|
6
12
|
return {
|
|
7
|
-
|
|
8
|
-
|
|
13
|
+
publicKey: e.publicKey,
|
|
14
|
+
payer: e,
|
|
15
|
+
signTransaction: async (e) => e,
|
|
16
|
+
signAllTransactions: async (e) => e
|
|
9
17
|
};
|
|
10
|
-
}
|
|
18
|
+
}, f = async (t) => ({ hinkalRootHash: await a(t, e.HinkalContract).getRootHash() }), p = async (e) => {
|
|
19
|
+
let { contractData: t, fetchRpcUrl: a } = n[e], { hinkalIdl: s, hinkalAddress: f, originalDeployer: p } = t;
|
|
20
|
+
if (!s || !f || !p || !a) throw Error(`Missing Solana configuration for chain ${e}`);
|
|
21
|
+
return { hinkalRootHash: await o(new u(s, new l(i(a), d(), {
|
|
22
|
+
preflightCommitment: "confirmed",
|
|
23
|
+
commitment: "confirmed"
|
|
24
|
+
})), r(new c(f), new c(p))) };
|
|
25
|
+
}, m = async (e) => t(e) ? p(e) : f(e);
|
|
11
26
|
//#endregion
|
|
12
|
-
export {
|
|
27
|
+
export { m as fetchOnChainRootHashes };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../types/circom-data.types.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../utils/external-action.utils.cjs`),
|
|
1
|
+
const e=require(`../../types/circom-data.types.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../types/hinkal.types.cjs`),r=require(`../utils/external-action.utils.cjs`),i=require(`./getOriginalSender.cjs`);var a=(a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w=t.defaultSignatureData,T)=>({rootHashHinkal:s,erc20TokenAddresses:l,tokenIds:l.map(()=>`0`),amountChanges:c,inputNullifiers:o,outCommitments:a,encryptedOutputs:d,timeStamp:u.length>0?u[0][0].timeStamp:String(x??``),stealthAddressStructure:v,rootHashAccessToken:0n,relay:g,externalAddress:m===void 0?t.zeroAddress:m,externalActionMetadata:h,externalActionId:typeof p==`bigint`?0n:r.getExternalActionIdHash(p),hookData:b||e.defaultHookData,publicSignalCount:f,calldataHash:_,onChainCreation:y,slippageValues:S,hinkalLogicArgs:n.defaultHinkalLogicArgs(l.length),feeStructure:{...C},signatureData:w,originalSender:T??i.getOriginalSender(m??t.zeroAddress,g)});exports.generateCircomData=a;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FeeStructure
|
|
1
|
+
import { FeeStructure } from '../../types/hinkal.types';
|
|
2
2
|
import { Utxo } from '../../data-structures/utxo/Utxo';
|
|
3
3
|
import { CircomDataType, HookDataType, StealthAddressStructure } from '../../types/circom-data.types';
|
|
4
4
|
import { ExternalActionId } from '../../types/external-action.types';
|
|
5
|
-
export declare const generateCircomData: (outCommitments: string[][], inputNullifiers: string[][], rootHashHinkal: bigint | undefined,
|
|
5
|
+
export declare const generateCircomData: (outCommitments: string[][], inputNullifiers: string[][], rootHashHinkal: bigint | undefined, amountChanges: bigint[], erc20TokenAddresses: string[], outputUtxos: Utxo[][], encryptedOutputs: string[][], publicSignalCount: number, externalActionId: ExternalActionId | bigint, externalAddress: string | undefined, externalActionMetadata: string, relay: string, calldataHash: bigint, stealthAddressStructure: StealthAddressStructure, onChainCreation: boolean[], hookData: HookDataType | undefined, timeStampFallback: number | undefined, slippageValues: bigint[], feeStructure: FeeStructure, signatureData?: import('../..').SignatureData, originalSender?: string) => CircomDataType;
|
|
@@ -1,35 +1,33 @@
|
|
|
1
1
|
import { defaultHookData as e } from "../../types/circom-data.types.mjs";
|
|
2
2
|
import { defaultSignatureData as t, zeroAddress as n } from "../../constants/protocol.constants.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { defaultHinkalLogicArgs as r } from "../../types/hinkal.types.mjs";
|
|
4
|
+
import { getExternalActionIdHash as i } from "../utils/external-action.utils.mjs";
|
|
5
|
+
import { getOriginalSender as a } from "./getOriginalSender.mjs";
|
|
5
6
|
//#region libs/shared/common/src/functions/snarkjs/generateCircomData.ts
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
originalSender: O ?? i(h ?? n, _)
|
|
32
|
-
};
|
|
33
|
-
};
|
|
7
|
+
var o = (o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x, S, C, w, T = t, E) => ({
|
|
8
|
+
rootHashHinkal: c,
|
|
9
|
+
erc20TokenAddresses: u,
|
|
10
|
+
tokenIds: u.map(() => "0"),
|
|
11
|
+
amountChanges: l,
|
|
12
|
+
inputNullifiers: s,
|
|
13
|
+
outCommitments: o,
|
|
14
|
+
encryptedOutputs: f,
|
|
15
|
+
timeStamp: d.length > 0 ? d[0][0].timeStamp : String(S ?? ""),
|
|
16
|
+
stealthAddressStructure: y,
|
|
17
|
+
rootHashAccessToken: 0n,
|
|
18
|
+
relay: _,
|
|
19
|
+
externalAddress: h === void 0 ? n : h,
|
|
20
|
+
externalActionMetadata: g,
|
|
21
|
+
externalActionId: typeof m == "bigint" ? 0n : i(m),
|
|
22
|
+
hookData: x || e,
|
|
23
|
+
publicSignalCount: p,
|
|
24
|
+
calldataHash: v,
|
|
25
|
+
onChainCreation: b,
|
|
26
|
+
slippageValues: C,
|
|
27
|
+
hinkalLogicArgs: r(u.length),
|
|
28
|
+
feeStructure: { ...w },
|
|
29
|
+
signatureData: T,
|
|
30
|
+
originalSender: E ?? a(h ?? n, _)
|
|
31
|
+
});
|
|
34
32
|
//#endregion
|
|
35
|
-
export {
|
|
33
|
+
export { o as generateCircomData };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../error-handling/logger.cjs`),
|
|
1
|
+
const e=require(`../utils/customEnclaveFunctionsRegister.cjs`),t=require(`../../error-handling/logger.cjs`),n=require(`./getZKFiles.cjs`),r=require(`./generateZkProofEnclave.cjs`),i=require(`./generateZkProofSelf.cjs`);var a=async(a,o,s,c)=>{if(c)try{let t=e.getCustomProofGenerator();if(t){let{zkCallData:e,publicSignals:r}=await t(s,n.getWASMFile(o,a),n.getZKeyFile(o,a));return{zkCallData:e,publicSignals:r}}return await r.generateZkProofEnclave(a,o,s)}catch(e){t.Logger.error(`enclave proof error`,e)}return i.generateZkProofSelf(a,o,s)};exports.generateZkProof=a;
|
|
@@ -1,14 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { getCustomProofGenerator as e } from "../utils/customEnclaveFunctionsRegister.mjs";
|
|
2
|
+
import { Logger as t } from "../../error-handling/logger.mjs";
|
|
3
|
+
import { getWASMFile as n, getZKeyFile as r } from "./getZKFiles.mjs";
|
|
4
|
+
import { generateZkProofEnclave as i } from "./generateZkProofEnclave.mjs";
|
|
5
|
+
import { generateZkProofSelf as a } from "./generateZkProofSelf.mjs";
|
|
4
6
|
//#region libs/shared/common/src/functions/snarkjs/generateZkProof.ts
|
|
5
|
-
var
|
|
6
|
-
if (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
var o = async (o, s, c, l) => {
|
|
8
|
+
if (l) try {
|
|
9
|
+
let t = e();
|
|
10
|
+
if (t) {
|
|
11
|
+
let { zkCallData: e, publicSignals: i } = await t(c, n(s, o), r(s, o));
|
|
12
|
+
return {
|
|
13
|
+
zkCallData: e,
|
|
14
|
+
publicSignals: i
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
return await i(o, s, c);
|
|
18
|
+
} catch (e) {
|
|
19
|
+
t.error("enclave proof error", e);
|
|
10
20
|
}
|
|
11
|
-
return
|
|
21
|
+
return a(o, s, c);
|
|
12
22
|
};
|
|
13
23
|
//#endregion
|
|
14
|
-
export {
|
|
24
|
+
export { o as generateZkProof };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../
|
|
1
|
+
const e=require(`../../data-structures/http/HttpClient.cjs`);require(`../../data-structures/http/index.cjs`);const t=require(`./constant.cjs`),n=require(`../utils/encryptInputForEnclave.cjs`),r=require(`./getZKFiles.cjs`);var i=e=>{if(e.startsWith(`http`)){let t=e.split(`/`).at(-1);if(!t)throw Error(`invalid verifierName`);return t}return e},a=async(a,o,s)=>{let c=i(r.getWASMFile(o,a)),l=i(r.getZKeyFile(o,a)),{keyCiphertext:u,inputCiphertext:d}=await n.makeEnclaveHandshakeAndEncryptInput(s),f={circuit_wasm:c,circuit_zkey:l,input:d,key:u},{public_signals:p,zk_calldata:m}=await e.httpClient.post(`${t.ENCLAVE_URL}/generate`,f);return{zkCallData:m,publicSignals:p}};exports.generateZkProofEnclave=a;
|