@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
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "../../constants/pay.constants.mjs";
|
|
2
|
+
import { storeRecipientInfosViaEnclave as e } from "../../API/enclaveRecipientInfoCalls.mjs";
|
|
3
|
+
import { makeEnclaveHandshakeAndEncryptUint8Array as t } from "./encryptInputForEnclave.mjs";
|
|
4
|
+
//#region libs/shared/common/src/functions/utils/enclave-recipient-info-storage.ts
|
|
5
|
+
var n = async (n, r, i, a) => {
|
|
6
|
+
let o = n.userKeys.getSignature(), { keyCiphertext: s, inputCiphertext: c } = await t(new TextEncoder().encode(o));
|
|
7
|
+
await e({
|
|
8
|
+
ethAddress: r,
|
|
9
|
+
encryptedSignature: c,
|
|
10
|
+
key: s,
|
|
11
|
+
targetCount: 20,
|
|
12
|
+
isSolanaLedger: i,
|
|
13
|
+
txMessageForSolanaLedger: a
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { n as ensureRecipientInfoPool };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(
|
|
1
|
+
const e=require(`./encryptInputForEnclave.cjs`),t=require(`../../API/enclaveSignatureCalls.cjs`);var n=async(n,r,i,a)=>{let{keyCiphertext:o,inputCiphertext:s}=await e.makeEnclaveHandshakeAndEncryptInput(r),{signature:c}=await t.storeAndGetSignatureEnclaveCall(n,s,o,i,a);return c};exports.storeAndGetSignatureFromEnclave=n;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const getSignatureFromEnclave: (ethAddress: string, authSignature: string) => Promise<string | undefined>;
|
|
1
|
+
export declare const storeAndGetSignatureFromEnclave: (ethAddress: string, authSignature: string, isSolanaLedger: boolean, txMessageForSolanaLedger?: string) => Promise<string>;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { makeEnclaveHandshakeAndEncryptInput as e } from "./encryptInputForEnclave.mjs";
|
|
2
|
+
import { storeAndGetSignatureEnclaveCall as t } from "../../API/enclaveSignatureCalls.mjs";
|
|
3
3
|
//#region libs/shared/common/src/functions/utils/enclave-signature-storage.ts
|
|
4
|
-
var
|
|
5
|
-
let { keyCiphertext:
|
|
6
|
-
|
|
7
|
-
}, i = async (t, r) => {
|
|
8
|
-
let { keyCiphertext: i, inputCiphertext: a } = await n(r), { found: o, signature: s } = await e(t, a, i);
|
|
9
|
-
return o ? s : void 0;
|
|
4
|
+
var n = async (n, r, i, a) => {
|
|
5
|
+
let { keyCiphertext: o, inputCiphertext: s } = await e(r), { signature: c } = await t(n, s, o, i, a);
|
|
6
|
+
return c;
|
|
10
7
|
};
|
|
11
8
|
//#endregion
|
|
12
|
-
export {
|
|
9
|
+
export { n as storeAndGetSignatureFromEnclave };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../API/enclaveUtxoCalls.cjs`),t=require(`../../data-structures/utxo/Utxo.cjs`),n=require(`./encryptInputForEnclave.cjs`),r=require(`./serialize-utxos.utils.cjs`);var
|
|
1
|
+
const e=require(`../../API/enclaveUtxoCalls.cjs`),t=require(`../../data-structures/utxo/Utxo.cjs`),n=require(`./encryptInputForEnclave.cjs`),r=require(`../../error-handling/logger.cjs`),i=require(`./serialize-utxos.utils.cjs`);var a=e=>{let n=new Set,r=[];for(let a of e){let e=new t.Utxo(i.deserializeUtxoConstructorParams(a)).getCommitment();n.has(e)||(n.add(e),r.push(a))}return r},o=async(t,r,a,o,s)=>{let{keyCiphertext:c,inputCiphertext:l}=await n.makeEnclaveHandshakeAndEncryptInput({...i.serializeUtxoConstructorParams(a.getConstructableParams()),senderAddress:t,...s?{claimableSignature:s}:{}});await e.storeUtxoEnclaveCall(r,l,c,o)},s=async(t,i,o,s,c)=>{try{let{keyCiphertext:r,inputCiphertext:l}=await n.makeEnclaveHandshakeAndEncryptInput(i),{utxos:u}=await e.getUtxosEnclaveCall(t,l,r,o,s,c);return a(u)}catch{return r.Logger.log(`failed to fetch utxos from gcp`),[]}};exports.getUtxosFromEnclave=s,exports.storeUtxoInEnclave=o;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IUtxoConstructor, Utxo } from '../../data-structures/utxo/Utxo';
|
|
2
2
|
export type UtxoConstructorParamsWithSenderAddress = IUtxoConstructor<string> & {
|
|
3
3
|
senderAddress: string;
|
|
4
|
+
claimableSignature?: string;
|
|
4
5
|
};
|
|
5
|
-
export declare const storeUtxoInEnclave: (senderAddress: string, recipientEthAddress: string, utxo: Utxo, chainId: number) => Promise<void>;
|
|
6
|
-
export declare const getUtxosFromEnclave: (ethAddress: string, signature: string, chainId: number) => Promise<UtxoConstructorParamsWithSenderAddress[]>;
|
|
6
|
+
export declare const storeUtxoInEnclave: (senderAddress: string, recipientEthAddress: string, utxo: Utxo, chainId: number, claimableSignature?: string) => Promise<void>;
|
|
7
|
+
export declare const getUtxosFromEnclave: (ethAddress: string, signature: string, chainId: number, isSolanaLedger: boolean, txMessageForSolanaLedger?: string) => Promise<UtxoConstructorParamsWithSenderAddress[]>;
|
|
@@ -1,33 +1,30 @@
|
|
|
1
1
|
import { getUtxosEnclaveCall as e, storeUtxoEnclaveCall as t } from "../../API/enclaveUtxoCalls.mjs";
|
|
2
2
|
import { Utxo as n } from "../../data-structures/utxo/Utxo.mjs";
|
|
3
3
|
import { makeEnclaveHandshakeAndEncryptInput as r } from "./encryptInputForEnclave.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { Logger as i } from "../../error-handling/logger.mjs";
|
|
5
|
+
import { deserializeUtxoConstructorParams as a, serializeUtxoConstructorParams as o } from "./serialize-utxos.utils.mjs";
|
|
5
6
|
//#region libs/shared/common/src/functions/utils/enclave-utxo-storage.ts
|
|
6
|
-
var
|
|
7
|
+
var s = (e) => {
|
|
7
8
|
let t = /* @__PURE__ */ new Set(), r = [];
|
|
8
9
|
for (let i of e) {
|
|
9
|
-
let e = new n(
|
|
10
|
-
amount: BigInt(i.amount),
|
|
11
|
-
erc20TokenAddress: i.erc20TokenAddress,
|
|
12
|
-
mintAddress: i.mintAddress,
|
|
13
|
-
stealthAddress: i.stealthAddress,
|
|
14
|
-
timeStamp: i.timeStamp,
|
|
15
|
-
tokenId: i.tokenId,
|
|
16
|
-
randomization: i.randomization ? BigInt(i.randomization) : void 0,
|
|
17
|
-
shieldedPrivateKey: i.shieldedPrivateKey
|
|
18
|
-
}).getCommitment();
|
|
10
|
+
let e = new n(a(i)).getCommitment();
|
|
19
11
|
t.has(e) || (t.add(e), r.push(i));
|
|
20
12
|
}
|
|
21
13
|
return r;
|
|
22
|
-
},
|
|
23
|
-
let { keyCiphertext:
|
|
24
|
-
...i
|
|
25
|
-
senderAddress: e
|
|
14
|
+
}, c = async (e, n, i, a, s) => {
|
|
15
|
+
let { keyCiphertext: c, inputCiphertext: l } = await r({
|
|
16
|
+
...o(i.getConstructableParams()),
|
|
17
|
+
senderAddress: e,
|
|
18
|
+
...s ? { claimableSignature: s } : {}
|
|
26
19
|
});
|
|
27
|
-
await t(n,
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
await t(n, l, c, a);
|
|
21
|
+
}, l = async (t, n, a, o, c) => {
|
|
22
|
+
try {
|
|
23
|
+
let { keyCiphertext: i, inputCiphertext: l } = await r(n), { utxos: u } = await e(t, l, i, a, o, c);
|
|
24
|
+
return s(u);
|
|
25
|
+
} catch {
|
|
26
|
+
return i.log("failed to fetch utxos from gcp"), [];
|
|
27
|
+
}
|
|
31
28
|
};
|
|
32
29
|
//#endregion
|
|
33
|
-
export {
|
|
30
|
+
export { l as getUtxosFromEnclave, c as storeUtxoInEnclave };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../constants/chains.constants.cjs`);var t=(t,n)=>{let r=`${n.erc20TokenAddress}
|
|
1
|
+
const e=require(`../../constants/chains.constants.cjs`);var t=(t,n)=>{let r=`${n.erc20TokenAddress}-0`;return e.isSolanaLike(t)?r:r.toLowerCase()};exports.encodeTokenWithId=t;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isSolanaLike as e } from "../../constants/chains.constants.mjs";
|
|
2
2
|
//#region libs/shared/common/src/functions/utils/encodeTokenWithId.ts
|
|
3
3
|
var t = (t, n) => {
|
|
4
|
-
let r = `${n.erc20TokenAddress}
|
|
4
|
+
let r = `${n.erc20TokenAddress}-0`;
|
|
5
5
|
return e(t) ? r : r.toLowerCase();
|
|
6
6
|
};
|
|
7
7
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`./serialize.utils.cjs`),n=require(`../../data-structures/http/HttpClient.cjs`);require(`../../data-structures/http/index.cjs`);const r=require(`../snarkjs/constant.cjs`);let i=require(`ethers`),a=require(`libsodium-wrappers`);a=e.__toESM(a);let o=require(`node-forge`);o=e.__toESM(o);var s=
|
|
1
|
+
const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`./serialize.utils.cjs`),n=require(`../../data-structures/http/HttpClient.cjs`);require(`../../data-structures/http/index.cjs`);const r=require(`../snarkjs/constant.cjs`);let i=require(`ethers`),a=require(`libsodium-wrappers`);a=e.__toESM(a);let o=require(`node-forge`);o=e.__toESM(o);var s=async()=>(await n.httpClient.get(`${r.ENCLAVE_URL}/handshake`)).public_key,c=e=>typeof e==`bigint`||typeof e==`number`?e.toString():e,l=e=>o.util.hexToBytes(e.replace(`0x`,``)),u=e=>{let t=structuredClone(e);return Object.entries(t).forEach(([e,n])=>{t[e]=c(n),Array.isArray(n)&&(Array.isArray(n[0])?t[e]=n.map(e=>e.map(c)):t[e]=n.map(c))}),t},d=(e,t)=>{let n=o.util.decode64(e),r=o.asn1.fromDer(o.util.createBuffer(n)),i=o.pki.publicKeyFromAsn1(r),a=o.util.binary.raw.encode(t),s=i.encrypt(a,`RSA-OAEP`,{md:o.md.sha1.create(),mgf1:{md:o.md.sha1.create()}});return o.util.encode64(s)},f=(e,t)=>{let n=a.default.randombytes_buf(a.default.crypto_secretbox_NONCEBYTES),r=a.default.crypto_secretbox_easy(t,n,e),s=l(i.ethers.hexlify(n)+i.ethers.hexlify(r).slice(2));return o.util.encode64(s)},p=(e,t)=>{let n=a.default.randombytes_buf(a.default.crypto_secretbox_KEYBYTES);return{keyCiphertext:d(t,n),inputCiphertext:f(n,e)}},m=(e,n)=>{let r=typeof e==`string`?e:t.safeJsonStringify(u(e));return p(new TextEncoder().encode(r),n)},h=async e=>m(e,await s()),g=async e=>p(e,await s());exports.makeEnclaveHandshakeAndEncryptInput=h,exports.makeEnclaveHandshakeAndEncryptUint8Array=g;
|
|
@@ -1,40 +1,34 @@
|
|
|
1
1
|
import { safeJsonStringify as e } from "./serialize.utils.mjs";
|
|
2
2
|
import { httpClient as t } from "../../data-structures/http/HttpClient.mjs";
|
|
3
3
|
import "../../data-structures/http/index.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { ENCLAVE_URL as n } from "../snarkjs/constant.mjs";
|
|
5
5
|
import { ethers as r } from "ethers";
|
|
6
6
|
import i from "libsodium-wrappers";
|
|
7
7
|
import * as a from "node-forge";
|
|
8
8
|
//#region libs/shared/common/src/functions/utils/encryptInputForEnclave.ts
|
|
9
|
-
var o =
|
|
10
|
-
let e = (await t.get(`${n}/handshake`)).public_key, r = a.util.decode64(e), i = a.asn1.fromDer(r);
|
|
11
|
-
return a.pki.publicKeyFromAsn1(i);
|
|
12
|
-
}, c = (e) => typeof e == "bigint" || typeof e == "number" ? e.toString() : e, l = (e) => a.util.hexToBytes(e.replace("0x", "")), u = (e) => {
|
|
9
|
+
var o = async () => (await t.get(`${n}/handshake`)).public_key, s = (e) => typeof e == "bigint" || typeof e == "number" ? e.toString() : e, c = (e) => a.util.hexToBytes(e.replace("0x", "")), l = (e) => {
|
|
13
10
|
let t = structuredClone(e);
|
|
14
11
|
return Object.entries(t).forEach(([e, n]) => {
|
|
15
|
-
t[e] =
|
|
12
|
+
t[e] = s(n), Array.isArray(n) && (Array.isArray(n[0]) ? t[e] = n.map((e) => e.map(s)) : t[e] = n.map(s));
|
|
16
13
|
}), t;
|
|
17
|
-
},
|
|
18
|
-
let n =
|
|
19
|
-
if (n.length > o) throw Error("too many bytes passed to assymetric_encrypt");
|
|
20
|
-
let i = e.encrypt(n, "RSA-OAEP", {
|
|
14
|
+
}, u = (e, t) => {
|
|
15
|
+
let n = a.util.decode64(e), r = a.asn1.fromDer(a.util.createBuffer(n)), i = a.pki.publicKeyFromAsn1(r), o = a.util.binary.raw.encode(t), s = i.encrypt(o, "RSA-OAEP", {
|
|
21
16
|
md: a.md.sha1.create(),
|
|
22
|
-
mgf1: { md: a.md.sha1.create() }
|
|
23
|
-
label: null
|
|
17
|
+
mgf1: { md: a.md.sha1.create() }
|
|
24
18
|
});
|
|
25
|
-
return a.util.encode64(i);
|
|
26
|
-
}, f = (e, t) => {
|
|
27
|
-
let n = i.randombytes_buf(i.crypto_secretbox_NONCEBYTES), o = i.crypto_secretbox_easy(t, n, e), s = l(r.hexlify(n) + r.hexlify(o).slice(2));
|
|
28
19
|
return a.util.encode64(s);
|
|
29
|
-
},
|
|
20
|
+
}, d = (e, t) => {
|
|
21
|
+
let n = i.randombytes_buf(i.crypto_secretbox_NONCEBYTES), o = i.crypto_secretbox_easy(t, n, e), s = c(r.hexlify(n) + r.hexlify(o).slice(2));
|
|
22
|
+
return a.util.encode64(s);
|
|
23
|
+
}, f = (e, t) => {
|
|
30
24
|
let n = i.randombytes_buf(i.crypto_secretbox_KEYBYTES);
|
|
31
25
|
return {
|
|
32
|
-
keyCiphertext:
|
|
33
|
-
inputCiphertext:
|
|
26
|
+
keyCiphertext: u(t, n),
|
|
27
|
+
inputCiphertext: d(n, e)
|
|
34
28
|
};
|
|
35
|
-
},
|
|
36
|
-
let r = typeof t == "string" ? t : e(
|
|
37
|
-
return
|
|
38
|
-
},
|
|
29
|
+
}, p = (t, n) => {
|
|
30
|
+
let r = typeof t == "string" ? t : e(l(t));
|
|
31
|
+
return f(new TextEncoder().encode(r), n);
|
|
32
|
+
}, m = async (e) => p(e, await o()), h = async (e) => f(e, await o());
|
|
39
33
|
//#endregion
|
|
40
|
-
export {
|
|
34
|
+
export { m as makeEnclaveHandshakeAndEncryptInput, h as makeEnclaveHandshakeAndEncryptUint8Array };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./serialize.utils.cjs`);function t(e,t){return Object.values(e).includes(t)}function n(n,r,i=!1){if(t(n,r))return r;let a=`Value ${e.safeJsonStringify(r)} is not a valid member of enum ${e.safeJsonStringify(n)}.`;if(i)throw Error(a)}exports.toEnumValue=n;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { safeJsonStringify as e } from "./serialize.utils.mjs";
|
|
2
|
+
//#region libs/shared/common/src/functions/utils/enum.utils.ts
|
|
3
|
+
function t(e, t) {
|
|
4
|
+
return Object.values(e).includes(t);
|
|
5
|
+
}
|
|
6
|
+
function n(n, r, i = !1) {
|
|
7
|
+
if (t(n, r)) return r;
|
|
8
|
+
let a = `Value ${e(r)} is not a valid member of enum ${e(n)}.`;
|
|
9
|
+
if (i) throw Error(a);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { n as toEnumValue };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../constants/token-data/ERC20Registry.cjs`);require(`../../constants/token-data/index.cjs`);const
|
|
1
|
+
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`./caseInsensitive.utils.cjs`),r=require(`../../constants/token-data/ERC20Registry.cjs`);require(`../../constants/token-data/index.cjs`);const i=require(`../web3/etherFunctions.cjs`),a=require(`../../data-structures/custom-token-registry/CustomTokenRegistry.cjs`),o=require(`./amounts.utils.cjs`),s=require(`../../constants/tokens.constants.cjs`);var c=e=>{let t=r.getERC20Registry(e),n=a.customTokenRegistry.getCustomTokens(e);return[...t,...n]},l=(e,t,n)=>(n??c(t))?.find(t=>e===void 0?!1:t.erc20TokenAddress.toLowerCase()===e.toLowerCase()),u=(e,t)=>{let n=l(e.erc20TokenAddress,t);return n?{...e,name:n.name,symbol:n.symbol,logoURI:n.logoURI,decimals:n.decimals}:e},d=(e,t)=>c(t)?.find(t=>e===void 0?!1:t.symbol.toLowerCase()===e.toLowerCase()),f=e=>{let t=e.reduce((e,{amount:t,token:n,nftIds:r})=>{let i=n.erc20TokenAddress.toLowerCase();return e[i]?e[i].amount+=t:e[i]={amount:t,token:n,nftIds:r},e},{});return Object.values(t)},p=e=>f(e).map(({amount:e,token:t,nftIds:n})=>{if(e===0n)return;let r=e>0n?`+`:`-`,a=Number(i.getAmountInToken(t,e));return{token:t,amount:`${r}${o.fixDecimalsAmount(a>0?a:-a)}`,nftIds:n}}).filter(e=>!!e),m=e=>e.nftTokenType===t.TokenType.ERC721||e.nftTokenType===t.TokenType.ERC1155||e.nftTokenType===t.TokenType.MetaplexNFT||e.nftTokenType===t.TokenType.Token2022NFT||e.nftTokenType===t.TokenType.CompressedNFT,h=n=>n.chainId===e.chainIds.arcTestnet&&n.erc20TokenAddress===t.zeroAddress,g=(e,t)=>{let n=t.toLowerCase();return e.symbol.toLowerCase().includes(n)||e.name.toLowerCase().includes(n)||e.erc20TokenAddress.toLowerCase().startsWith(n)},_=e=>s.chainNativeTokenSymbol[e.chainId]===e.symbol,v=e=>{let t=e.filter(_),n=e.filter(e=>!_(e)&&s.PopularTokenSymbols.some(t=>t===e.symbol)),r=e.filter(e=>!_(e)&&!s.PopularTokenSymbols.some(t=>t===e.symbol)),i=n.sort((e,t)=>e.symbol.localeCompare(t.symbol,`en-US`)),a=r.sort((e,t)=>e.symbol.localeCompare(t.symbol,`en-US`));return[...t,...i,...a]},y=(e,t)=>e.find(e=>n.caseInsensitiveEqual(e.symbol,t));exports.aggregateTokenChanges=f,exports.findTokenBySymbolFromTokenList=y,exports.formatTokenChangesList=p,exports.getERC20Token=l,exports.getERC20TokenBySymbol=d,exports.getErc20TokensForChain=c,exports.isArcNativeToken=h,exports.isNFTToken=m,exports.overlayTokenWithRegistryData=u,exports.searchCompareFunction=g,exports.sortTokens=v;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ERC20Token, TokenChanges } from '../../types/token.types';
|
|
2
2
|
export declare const getErc20TokensForChain: (chainId: number) => ERC20Token[];
|
|
3
3
|
export declare const getERC20Token: (address: string, chainId: number, fromList?: ERC20Token[]) => ERC20Token | undefined;
|
|
4
|
+
export declare const overlayTokenWithRegistryData: (token: ERC20Token, chainId: number) => ERC20Token;
|
|
4
5
|
export declare const getERC20TokenBySymbol: (symbol: string, chainId: number) => ERC20Token | undefined;
|
|
5
6
|
export declare const aggregateTokenChanges: (tokenChanges: TokenChanges<bigint>[]) => TokenChanges<bigint>[];
|
|
6
7
|
export declare const formatTokenChangesList: (tokenChanges: TokenChanges<bigint>[]) => {
|
|
@@ -12,3 +13,4 @@ export declare const isNFTToken: (token: ERC20Token) => boolean;
|
|
|
12
13
|
export declare const isArcNativeToken: (token: ERC20Token) => boolean;
|
|
13
14
|
export declare const searchCompareFunction: (token: ERC20Token, searchString: string) => boolean;
|
|
14
15
|
export declare const sortTokens: (tokens: ERC20Token[]) => ERC20Token[];
|
|
16
|
+
export declare const findTokenBySymbolFromTokenList: (tokens: ERC20Token[], symbol: string) => ERC20Token | undefined;
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
import { chainIds as e } from "../../constants/chains.constants.mjs";
|
|
2
2
|
import { TokenType as t, zeroAddress as n } from "../../constants/protocol.constants.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { caseInsensitiveEqual as r } from "./caseInsensitive.utils.mjs";
|
|
4
|
+
import { getERC20Registry as i } from "../../constants/token-data/ERC20Registry.mjs";
|
|
4
5
|
import "../../constants/token-data/index.mjs";
|
|
5
|
-
import { getAmountInToken as
|
|
6
|
-
import { customTokenRegistry as
|
|
7
|
-
import { fixDecimalsAmount as
|
|
8
|
-
import { PopularTokenSymbols as
|
|
6
|
+
import { getAmountInToken as a } from "../web3/etherFunctions.mjs";
|
|
7
|
+
import { customTokenRegistry as o } from "../../data-structures/custom-token-registry/CustomTokenRegistry.mjs";
|
|
8
|
+
import { fixDecimalsAmount as s } from "./amounts.utils.mjs";
|
|
9
|
+
import { PopularTokenSymbols as c, chainNativeTokenSymbol as l } from "../../constants/tokens.constants.mjs";
|
|
9
10
|
//#region libs/shared/common/src/functions/utils/erc20tokenFunctions.ts
|
|
10
|
-
var
|
|
11
|
-
let t =
|
|
11
|
+
var u = (e) => {
|
|
12
|
+
let t = i(e), n = o.getCustomTokens(e);
|
|
12
13
|
return [...t, ...n];
|
|
13
|
-
},
|
|
14
|
+
}, d = (e, t, n) => (n ?? u(t))?.find((t) => e === void 0 ? !1 : t.erc20TokenAddress.toLowerCase() === e.toLowerCase()), f = (e, t) => {
|
|
15
|
+
let n = d(e.erc20TokenAddress, t);
|
|
16
|
+
return n ? {
|
|
17
|
+
...e,
|
|
18
|
+
name: n.name,
|
|
19
|
+
symbol: n.symbol,
|
|
20
|
+
logoURI: n.logoURI,
|
|
21
|
+
decimals: n.decimals
|
|
22
|
+
} : e;
|
|
23
|
+
}, p = (e, t) => u(t)?.find((t) => e === void 0 ? !1 : t.symbol.toLowerCase() === e.toLowerCase()), m = (e) => {
|
|
14
24
|
let t = e.reduce((e, { amount: t, token: n, nftIds: r }) => {
|
|
15
25
|
let i = n.erc20TokenAddress.toLowerCase();
|
|
16
26
|
return e[i] ? e[i].amount += t : e[i] = {
|
|
@@ -20,24 +30,24 @@ var l = (e) => {
|
|
|
20
30
|
}, e;
|
|
21
31
|
}, {});
|
|
22
32
|
return Object.values(t);
|
|
23
|
-
},
|
|
33
|
+
}, h = (e) => m(e).map(({ amount: e, token: t, nftIds: n }) => {
|
|
24
34
|
if (e === 0n) return;
|
|
25
|
-
let r = e > 0n ? "+" : "-",
|
|
35
|
+
let r = e > 0n ? "+" : "-", i = Number(a(t, e));
|
|
26
36
|
return {
|
|
27
37
|
token: t,
|
|
28
|
-
amount: `${r}${
|
|
38
|
+
amount: `${r}${s(i > 0 ? i : -i)}`,
|
|
29
39
|
nftIds: n
|
|
30
40
|
};
|
|
31
|
-
}).filter((e) => !!e),
|
|
41
|
+
}).filter((e) => !!e), g = (e) => e.nftTokenType === t.ERC721 || e.nftTokenType === t.ERC1155 || e.nftTokenType === t.MetaplexNFT || e.nftTokenType === t.Token2022NFT || e.nftTokenType === t.CompressedNFT, _ = (t) => t.chainId === e.arcTestnet && t.erc20TokenAddress === n, v = (e, t) => {
|
|
32
42
|
let n = t.toLowerCase();
|
|
33
43
|
return e.symbol.toLowerCase().includes(n) || e.name.toLowerCase().includes(n) || e.erc20TokenAddress.toLowerCase().startsWith(n);
|
|
34
|
-
},
|
|
35
|
-
let t = e.filter(
|
|
44
|
+
}, y = (e) => l[e.chainId] === e.symbol, b = (e) => {
|
|
45
|
+
let t = e.filter(y), n = e.filter((e) => !y(e) && c.some((t) => t === e.symbol)), r = e.filter((e) => !y(e) && !c.some((t) => t === e.symbol)), i = n.sort((e, t) => e.symbol.localeCompare(t.symbol, "en-US")), a = r.sort((e, t) => e.symbol.localeCompare(t.symbol, "en-US"));
|
|
36
46
|
return [
|
|
37
47
|
...t,
|
|
38
48
|
...i,
|
|
39
49
|
...a
|
|
40
50
|
];
|
|
41
|
-
};
|
|
51
|
+
}, x = (e, t) => e.find((e) => r(e.symbol, t));
|
|
42
52
|
//#endregion
|
|
43
|
-
export {
|
|
53
|
+
export { m as aggregateTokenChanges, x as findTokenBySymbolFromTokenList, h as formatTokenChangesList, d as getERC20Token, p as getERC20TokenBySymbol, u as getErc20TokensForChain, _ as isArcNativeToken, g as isNFTToken, f as overlayTokenWithRegistryData, v as searchCompareFunction, b as sortTokens };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { EthereumNetworkType } from '../../
|
|
2
|
-
import { EthereumNetwork } from '../../types';
|
|
1
|
+
import { EthereumNetwork, EthereumNetworkType } from '../../types';
|
|
3
2
|
export declare const getNetworkObject: (chainId: number) => EthereumNetwork;
|
|
4
3
|
export declare const getNetworkType: (network: EthereumNetwork) => EthereumNetworkType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../constants/fees.constants.cjs`),r=require(`../../
|
|
1
|
+
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../constants/fees.constants.cjs`),r=require(`../../API/getTokenPrice.cjs`),i=require(`./caseInsensitive.utils.cjs`),a=require(`../web3/etherFunctions.cjs`),o=require(`./erc20tokenFunctions.cjs`),s=require(`../../error-handling/logger.cjs`);var c=r=>{if(!r)return n.EXTENDED_NON_NATIVE_GAS_COST_TOKEN_SYMBOL_OPTIONS;let i=t.zeroAddress;e.isSolanaLike(r)&&(i=t.solanaNativeAddress);let a=o.getERC20Token(i,r)?.symbol;return e.isSolanaLike(r)&&a?[a]:a&&!n.NON_NATIVE_GAS_COST_TOKEN_SYMBOL_OPTIONS(r).includes(a)?[a,...n.NON_NATIVE_GAS_COST_TOKEN_SYMBOL_OPTIONS(r)]:n.NON_NATIVE_GAS_COST_TOKEN_SYMBOL_OPTIONS(r)},l=(e,t)=>{let r=e*t.variableRate/n.BPS_DENOMINATOR;return t.flatFee+r},u=async(e,t,c,u)=>{let d=o.getERC20Token(u.feeToken,e),f;if(!d||i.caseInsensitiveEqual(u.feeToken,t.erc20TokenAddress)||u.variableRate===0n)f=l(c,u);else{let i=0n;try{let{prices:o}=await r.getTokenPrices(e,[t.erc20TokenAddress,d.erc20TokenAddress]),[s,l]=o;if(!s||!l)throw Error(`failed to get token prices`);i=a.getAmountInWei(d,(Number(a.getAmountInToken(t,c))*s*Number(u.variableRate)/Number(n.BPS_DENOMINATOR)/l).toFixed(d.decimals))}catch(e){s.Logger.error(`calculateModifiedFeeStructure: failed to price cross-token variable fee, charging gas fee only`,e)}f=u.flatFee+i}return{feeToken:u.feeToken,flatFee:f,variableRate:0n}},d=(e,t)=>{let r=-e;return t.variableRate===0n?r-t.flatFee:(r-t.flatFee)*n.BPS_DENOMINATOR/(n.BPS_DENOMINATOR+t.variableRate)};exports.calculateModifiedFeeStructure=u,exports.calculateTotalFee=l,exports.calculateWithdrawalAmount=d,exports.getGasTokenSymbols=c;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FeeStructure } from '../../types/hinkal.types';
|
|
2
|
-
|
|
2
|
+
import { ERC20Token } from '../../types/token.types';
|
|
3
3
|
export declare const getGasTokenSymbols: (chainId: number | undefined) => string[];
|
|
4
4
|
export declare const calculateTotalFee: (amount: bigint, feeStructure: FeeStructure) => bigint;
|
|
5
|
+
export declare const calculateModifiedFeeStructure: (chainId: number, amountToken: ERC20Token, amount: bigint, feeStructure: FeeStructure) => Promise<FeeStructure>;
|
|
5
6
|
export declare const calculateWithdrawalAmount: (amountWithFee: bigint, feeStructure: FeeStructure) => bigint;
|
|
@@ -1,29 +1,43 @@
|
|
|
1
1
|
import { isSolanaLike as e } from "../../constants/chains.constants.mjs";
|
|
2
2
|
import { solanaNativeAddress as t, zeroAddress as n } from "../../constants/protocol.constants.mjs";
|
|
3
3
|
import { BPS_DENOMINATOR as r, EXTENDED_NON_NATIVE_GAS_COST_TOKEN_SYMBOL_OPTIONS as i, NON_NATIVE_GAS_COST_TOKEN_SYMBOL_OPTIONS as a } from "../../constants/fees.constants.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { getTokenPrices as o } from "../../API/getTokenPrice.mjs";
|
|
5
|
+
import { caseInsensitiveEqual as s } from "./caseInsensitive.utils.mjs";
|
|
6
|
+
import { getAmountInToken as c, getAmountInWei as l } from "../web3/etherFunctions.mjs";
|
|
7
|
+
import { getERC20Token as u } from "./erc20tokenFunctions.mjs";
|
|
8
|
+
import { Logger as d } from "../../error-handling/logger.mjs";
|
|
6
9
|
//#region libs/shared/common/src/functions/utils/fees.utils.ts
|
|
7
|
-
var
|
|
8
|
-
if (e.length !== t.length) throw Error("length mismatch");
|
|
9
|
-
let n = e.findIndex((e) => e !== 0n);
|
|
10
|
-
return n === -1 ? o : {
|
|
11
|
-
feeToken: t[n],
|
|
12
|
-
flatFee: e[n],
|
|
13
|
-
variableRate: 0n
|
|
14
|
-
};
|
|
15
|
-
}, l = (r) => {
|
|
10
|
+
var f = (r) => {
|
|
16
11
|
if (!r) return i;
|
|
17
12
|
let o = n;
|
|
18
13
|
e(r) && (o = t);
|
|
19
|
-
let
|
|
20
|
-
return e(r) &&
|
|
21
|
-
},
|
|
14
|
+
let s = u(o, r)?.symbol;
|
|
15
|
+
return e(r) && s ? [s] : s && !a(r).includes(s) ? [s, ...a(r)] : a(r);
|
|
16
|
+
}, p = (e, t) => {
|
|
22
17
|
let n = e * t.variableRate / r;
|
|
23
18
|
return t.flatFee + n;
|
|
24
|
-
},
|
|
19
|
+
}, m = async (e, t, n, i) => {
|
|
20
|
+
let a = u(i.feeToken, e), f;
|
|
21
|
+
if (!a || s(i.feeToken, t.erc20TokenAddress) || i.variableRate === 0n) f = p(n, i);
|
|
22
|
+
else {
|
|
23
|
+
let s = 0n;
|
|
24
|
+
try {
|
|
25
|
+
let { prices: u } = await o(e, [t.erc20TokenAddress, a.erc20TokenAddress]), [d, f] = u;
|
|
26
|
+
if (!d || !f) throw Error("failed to get token prices");
|
|
27
|
+
s = l(a, (Number(c(t, n)) * d * Number(i.variableRate) / Number(r) / f).toFixed(a.decimals));
|
|
28
|
+
} catch (e) {
|
|
29
|
+
d.error("calculateModifiedFeeStructure: failed to price cross-token variable fee, charging gas fee only", e);
|
|
30
|
+
}
|
|
31
|
+
f = i.flatFee + s;
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
feeToken: i.feeToken,
|
|
35
|
+
flatFee: f,
|
|
36
|
+
variableRate: 0n
|
|
37
|
+
};
|
|
38
|
+
}, h = (e, t) => {
|
|
25
39
|
let n = -e;
|
|
26
40
|
return t.variableRate === 0n ? n - t.flatFee : (n - t.flatFee) * r / (r + t.variableRate);
|
|
27
41
|
};
|
|
28
42
|
//#endregion
|
|
29
|
-
export {
|
|
43
|
+
export { m as calculateModifiedFeeStructure, p as calculateTotalFee, h as calculateWithdrawalAmount, f as getGasTokenSymbols };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../error-handling/logger.cjs`);require(`../../error-handling/index.cjs`);var t=t=>{try{return t==null||Number.isNaN(t)||!Number.isFinite(t)?`0`:(Math.floor(t*100)/100).toLocaleString(`en-us`,{minimumFractionDigits:2,maximumFractionDigits:2})}catch(t){return e.Logger.error(`Error formatting USD number:`,t),`0`}};exports.formatUSDNumber=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatUSDNumber: (amount: number | null | undefined) => string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Logger as e } from "../../error-handling/logger.mjs";
|
|
2
|
+
import "../../error-handling/index.mjs";
|
|
3
|
+
//#region libs/shared/common/src/functions/utils/formatter.ts
|
|
4
|
+
var t = (t) => {
|
|
5
|
+
try {
|
|
6
|
+
return t == null || Number.isNaN(t) || !Number.isFinite(t) ? "0" : (Math.floor(t * 100) / 100).toLocaleString("en-us", {
|
|
7
|
+
minimumFractionDigits: 2,
|
|
8
|
+
maximumFractionDigits: 2
|
|
9
|
+
});
|
|
10
|
+
} catch (t) {
|
|
11
|
+
return e.error("Error formatting USD number:", t), "0";
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { t as formatUSDNumber };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/mediaUrls.constants.cjs`);var n=n=>n===e.chainIds.polygon?t.mediaUrls.POLY_SCAN:n===e.chainIds.arbMainnet?t.mediaUrls.ARB_SCAN:n===e.chainIds.ethMainnet?t.mediaUrls.ETH_SCAN:n===e.chainIds.
|
|
1
|
+
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/mediaUrls.constants.cjs`);var n=n=>n===e.chainIds.polygon?t.mediaUrls.POLY_SCAN:n===e.chainIds.arbMainnet?t.mediaUrls.ARB_SCAN:n===e.chainIds.ethMainnet?t.mediaUrls.ETH_SCAN:n===e.chainIds.bnbMainnet?t.mediaUrls.BSC_SCAN:n===e.chainIds.base?t.mediaUrls.BASE_SCAN:n===e.chainIds.optimism||n===e.chainIds.optimismTest?t.mediaUrls.OPTIMISM_SCAN:n===e.chainIds.arcTestnet?t.mediaUrls.ARC_TESTNET_EXPLORER:n===e.chainIds.sepoliaTestnet?t.mediaUrls.SEPOLIA_TESTNET_EXPLORER:n===e.chainIds.tempo?t.mediaUrls.TEMPO_EXPLORER:n===e.chainIds.tronNile?t.mediaUrls.TRON_NILE_EXPLORER:n===e.chainIds.tronMainnet?t.mediaUrls.TRON_MAINNET_EXPLORER:e.isSolanaLike(n)?t.mediaUrls.SOL_SCAN:t.mediaUrls.ETH_SCAN;exports.getBlockExplorerUrl=n;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { chainIds as e, isSolanaLike as t } from "../../constants/chains.constants.mjs";
|
|
2
2
|
import { mediaUrls as n } from "../../constants/mediaUrls.constants.mjs";
|
|
3
3
|
//#region libs/shared/common/src/functions/utils/getBlockExplorerUrl.ts
|
|
4
|
-
var r = (r) => r === e.polygon ? n.POLY_SCAN : r === e.arbMainnet ? n.ARB_SCAN : r === e.ethMainnet ? n.ETH_SCAN : r === e.
|
|
4
|
+
var r = (r) => r === e.polygon ? n.POLY_SCAN : r === e.arbMainnet ? n.ARB_SCAN : r === e.ethMainnet ? n.ETH_SCAN : r === e.bnbMainnet ? n.BSC_SCAN : r === e.base ? n.BASE_SCAN : r === e.optimism || r === e.optimismTest ? n.OPTIMISM_SCAN : r === e.arcTestnet ? n.ARC_TESTNET_EXPLORER : r === e.sepoliaTestnet ? n.SEPOLIA_TESTNET_EXPLORER : r === e.tempo ? n.TEMPO_EXPLORER : r === e.tronNile ? n.TRON_NILE_EXPLORER : r === e.tronMainnet ? n.TRON_MAINNET_EXPLORER : t(r) ? n.SOL_SCAN : n.ETH_SCAN;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { r as getBlockExplorerUrl };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../constants/protocol.constants.cjs`),t=require(`../../data-structures/crypto-keys/keys.cjs`),
|
|
1
|
+
const e=require(`../../constants/protocol.constants.cjs`),t=require(`./addresses.cjs`),n=require(`../../data-structures/crypto-keys/keys.cjs`),r=require(`../../data-structures/utxo/Utxo.cjs`);require(`../../data-structures/crypto-keys/index.cjs`);var i=t=>{let i=t.getShieldedPrivateKey(),a=n.UserKeys.getEncryptionKeyPair(i).publicKey,o=new r.Utxo({amount:0n,erc20TokenAddress:e.zeroAddress,nullifyingKey:i,spendingPublicKey:t.getSpendingKeyPair().pubSpendingBJJPoint,isNewStyle:!0}),{H0:s}=o;if(!s)throw Error(`H0 is not set`);let c=o.getStealthAddress(),l=n.UserKeys.getH1FromH0(s,i);return`${c},${s[0]},${s[1]},${l[1]},${a}`},a=e=>t.constructStealthAddressStructure(i(e));exports.getRecipientInfoFromUserKeys=i,exports.getStealthAddressStructureFromUserKeys=a;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { UserKeys } from '../../data-structures/crypto-keys';
|
|
2
|
+
import { StealthAddressStructure } from '../../types/circom-data.types';
|
|
2
3
|
export declare const getRecipientInfoFromUserKeys: (userKeys: UserKeys) => string;
|
|
4
|
+
export declare const getStealthAddressStructureFromUserKeys: (userKeys: UserKeys) => StealthAddressStructure;
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { zeroAddress as e } from "../../constants/protocol.constants.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { constructStealthAddressStructure as t } from "./addresses.mjs";
|
|
3
|
+
import { UserKeys as n } from "../../data-structures/crypto-keys/keys.mjs";
|
|
4
|
+
import { Utxo as r } from "../../data-structures/utxo/Utxo.mjs";
|
|
4
5
|
import "../../data-structures/crypto-keys/index.mjs";
|
|
5
6
|
//#region libs/shared/common/src/functions/utils/getRecipientInfoFromUserKeys.ts
|
|
6
|
-
var
|
|
7
|
-
let i =
|
|
7
|
+
var i = (t) => {
|
|
8
|
+
let i = t.getShieldedPrivateKey(), a = n.getEncryptionKeyPair(i).publicKey, o = new r({
|
|
8
9
|
amount: 0n,
|
|
9
10
|
erc20TokenAddress: e,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
11
|
+
nullifyingKey: i,
|
|
12
|
+
spendingPublicKey: t.getSpendingKeyPair().pubSpendingBJJPoint,
|
|
13
|
+
isNewStyle: !0
|
|
14
|
+
}), { H0: s } = o;
|
|
15
|
+
if (!s) throw Error("H0 is not set");
|
|
16
|
+
let c = o.getStealthAddress(), l = n.getH1FromH0(s, i);
|
|
17
|
+
return `${c},${s[0]},${s[1]},${l[1]},${a}`;
|
|
18
|
+
}, a = (e) => t(i(e));
|
|
14
19
|
//#endregion
|
|
15
|
-
export {
|
|
20
|
+
export { i as getRecipientInfoFromUserKeys, a as getStealthAddressStructureFromUserKeys };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../types/ethereum-network.types.cjs`);require(`../../types/index.cjs`);const
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../types/ethereum-network.types.cjs`),t=require(`../../constants/chains.constants.cjs`);require(`../../types/index.cjs`);const n=require(`./caseInsensitive.utils.cjs`),r=require(`./amounts.utils.cjs`),i=require(`../../data-structures/crypto-keys/keys.cjs`),a=require(`../../data-structures/crypto-keys/decodeUTXO.cjs`),o=require(`../../data-structures/crypto-keys/encryptDecryptUtxo.cjs`),s=require(`./getContractAddress.cjs`);let c=require(`ethers`);var l=(t,i,o,c)=>{let l=i.getContractWithFetcher(o,e.ContractType.HinkalContract),u=l.interface,d=i.userKeys.getShieldedPrivateKey(),f=s.getContractAddress(l);return t.logs.filter(e=>n.caseInsensitiveEqual(e.address,f)).map(e=>{try{let t=u.parseLog(e);if(t?.name===`NewCommitment`){let{encryptedOutput:e,index:i}=t.args;if(r.toBigInt(i)<0n){let t=a.decodeUtxo(e,d,o);if(n.caseInsensitiveEqual(t.erc20TokenAddress,c))return t}}}catch{return null}return null}).filter(e=>e!==null)},u=(t,a,l,u,d)=>{let f=a.getContractWithFetcher(l,e.ContractType.HinkalContract),p=f.interface;return t.logs.filter(e=>n.caseInsensitiveEqual(e.address,s.getContractAddress(f))).map(e=>{try{let t=p.parseLog(e);if(t?.name===`NewCommitment`){let{encryptedOutput:e,index:a}=t.args;if(r.toBigInt(a)>=0n){let t=new i.UserKeys(void 0,d);try{let r=o.decryptUtxo(c.ethers.getBytes(e),t);if(n.caseInsensitiveEqual(r.erc20TokenAddress,u))return r}catch{return null}}}return null}catch{return null}}).filter(e=>e!==null)},d=(e,i)=>{if(i.status!==1)throw Error(`Transaction failed: ${i.hash}`);let{contractData:a}=t.networkRegistry[e],{hinkalAddress:o,hinkalABI:s}=a;if(!o||!s)throw Error(`Hinkal contract data not found for chainId ${e}`);let l=new c.ethers.Interface(s);return i.logs.filter(e=>n.caseInsensitiveEqual(e.address,o)).map(e=>{try{let t=l.parseLog(e);if(t?.name!==`NewCommitment`)return null;let n=t.args.commitment;return n?r.toBigInt(n).toString():null}catch{return null}}).filter(e=>e!==null)};exports.getOnChainUtxosFromReceipt=l,exports.getOutputCommitmentsFromEvmReceipt=d,exports.getUtxosFromReceipt=u;
|
|
@@ -3,3 +3,4 @@ import { Utxo } from '../../data-structures/utxo/Utxo';
|
|
|
3
3
|
import { IHinkal } from '../../data-structures/Hinkal/IHinkal';
|
|
4
4
|
export declare const getOnChainUtxosFromReceipt: (receipt: ethers.TransactionReceipt, hinkal: IHinkal, chainId: number, tokenAddress: string) => Utxo[];
|
|
5
5
|
export declare const getUtxosFromReceipt: (receipt: ethers.TransactionReceipt, hinkal: IHinkal, chainId: number, tokenAddress: string, shieldedPrivateKey: string) => Utxo[];
|
|
6
|
+
export declare const getOutputCommitmentsFromEvmReceipt: (chainId: number, receipt: ethers.TransactionReceipt) => string[];
|