@hinkal/common 0.2.27 → 0.2.28
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 +35 -17
- package/API/API.mjs +100 -80
- package/API/admin-calls.cjs +1 -1
- package/API/admin-calls.d.ts +8 -1
- package/API/admin-calls.mjs +6 -5
- package/API/callLifiAPI.cjs +1 -1
- package/API/callLifiAPI.d.ts +1 -1
- package/API/callLifiAPI.mjs +5 -5
- package/API/callMonitor.cjs +1 -1
- package/API/callMonitor.d.ts +1 -1
- package/API/callMonitor.mjs +7 -7
- package/API/callOdosAPI.cjs +1 -1
- package/API/callOdosAPI.mjs +11 -11
- package/API/callOkxAPI.cjs +1 -1
- package/API/callOkxAPI.d.ts +1 -1
- package/API/callOkxAPI.mjs +5 -5
- package/API/callOneInchAPI.cjs +1 -1
- package/API/callOneInchAPI.mjs +10 -11
- package/API/callRelayer.cjs +1 -1
- package/API/callRelayer.d.ts +14 -6
- package/API/callRelayer.mjs +11 -11
- package/API/checkRisk.cjs +1 -1
- package/API/checkRisk.d.ts +1 -1
- package/API/checkRisk.mjs +4 -4
- package/API/deposit-and-withdraw-status-calls.cjs +1 -1
- package/API/deposit-and-withdraw-status-calls.d.ts +3 -2
- package/API/deposit-and-withdraw-status-calls.mjs +8 -8
- package/API/enclaveSignatureCalls.cjs +1 -0
- package/API/enclaveSignatureCalls.d.ts +10 -0
- package/API/enclaveSignatureCalls.mjs +16 -0
- package/API/enclaveUtxoCalls.cjs +1 -0
- package/API/enclaveUtxoCalls.d.ts +40 -0
- package/API/enclaveUtxoCalls.mjs +24 -0
- package/API/fetchCommitmentsCache.cjs +1 -1
- package/API/fetchCommitmentsCache.d.ts +2 -1
- package/API/fetchCommitmentsCache.mjs +9 -9
- package/API/get-token-data.cjs +1 -1
- package/API/get-token-data.d.ts +1 -1
- package/API/get-token-data.mjs +5 -5
- package/API/get-token-price-chart-data.cjs +1 -0
- package/API/get-token-price-chart-data.d.ts +16 -0
- package/API/get-token-price-chart-data.mjs +13 -0
- package/API/getCoingeckoPrice.cjs +1 -1
- package/API/getCoingeckoPrice.d.ts +0 -1
- package/API/getCoingeckoPrice.mjs +15 -16
- package/API/getGasEstimates.cjs +1 -1
- package/API/getGasEstimates.mjs +9 -9
- package/API/getServerURL.cjs +1 -1
- package/API/getServerURL.d.ts +3 -3
- package/API/getServerURL.mjs +51 -67
- package/API/getTokenPrice.cjs +1 -1
- package/API/getTokenPrice.d.ts +5 -0
- package/API/getTokenPrice.mjs +14 -7
- package/API/getWebsiteURL.cjs +1 -1
- package/API/getWebsiteURL.d.ts +1 -0
- package/API/getWebsiteURL.mjs +25 -10
- package/API/index.d.ts +3 -3
- package/API/kycCalls.cjs +1 -1
- package/API/kycCalls.d.ts +4 -8
- package/API/kycCalls.mjs +23 -26
- package/API/onrampCalls.cjs +1 -0
- package/API/onrampCalls.d.ts +20 -0
- package/API/onrampCalls.mjs +15 -0
- package/API/privacy-score-calls.cjs +1 -0
- package/API/privacy-score-calls.d.ts +17 -0
- package/API/privacy-score-calls.mjs +29 -0
- package/API/privateSendEmailNotificationsCalls.cjs +1 -0
- package/API/privateSendEmailNotificationsCalls.d.ts +8 -0
- package/API/privateSendEmailNotificationsCalls.mjs +11 -0
- package/API/privateSendNonceCalls.cjs +1 -0
- package/API/privateSendNonceCalls.d.ts +13 -0
- package/API/privateSendNonceCalls.mjs +15 -0
- package/API/privateSendRecipientInfoCalls.cjs +1 -0
- package/API/privateSendRecipientInfoCalls.d.ts +21 -0
- package/API/privateSendRecipientInfoCalls.mjs +15 -0
- package/API/proxyAccountsCalls.cjs +1 -1
- package/API/proxyAccountsCalls.d.ts +4 -2
- package/API/proxyAccountsCalls.mjs +18 -20
- package/API/relayCalls.cjs +1 -1
- package/API/relayCalls.mjs +4 -4
- package/API/rewardsUserCalls.cjs +1 -1
- package/API/rewardsUserCalls.d.ts +9 -0
- package/API/rewardsUserCalls.mjs +28 -22
- package/API/scheduled-transactions-calls.cjs +1 -1
- package/API/scheduled-transactions-calls.d.ts +2 -2
- package/API/scheduled-transactions-calls.mjs +9 -8
- package/API/simulate-batch-tx.cjs +1 -1
- package/API/simulate-batch-tx.d.ts +2 -2
- package/API/simulate-batch-tx.mjs +7 -6
- package/API/simulate-transaction.cjs +1 -0
- package/API/{is-tx-stateless.d.ts → simulate-transaction.d.ts} +1 -1
- package/API/simulate-transaction.mjs +18 -0
- package/API/snapshot-event-calls.cjs +1 -0
- package/API/snapshot-event-calls.d.ts +7 -0
- package/API/snapshot-event-calls.mjs +13 -0
- package/API/solana-calls.cjs +1 -1
- package/API/solana-calls.d.ts +8 -4
- package/API/solana-calls.mjs +15 -15
- package/API/temporaryWalletCalls.cjs +1 -1
- package/API/temporaryWalletCalls.mjs +13 -19
- package/API/token-calls.cjs +1 -1
- package/API/token-calls.mjs +6 -5
- package/API/tronSubsidyCalls.cjs +1 -0
- package/API/tronSubsidyCalls.d.ts +13 -0
- package/API/tronSubsidyCalls.mjs +11 -0
- package/README.md +27 -25
- package/constants/activity.constants.cjs +1 -1
- package/constants/activity.constants.mjs +4 -2
- package/constants/addresses.constants.cjs +1 -1
- package/constants/addresses.constants.mjs +1 -1
- package/constants/bridging.constants.cjs +1 -1
- package/constants/bridging.constants.d.ts +4 -0
- package/constants/bridging.constants.mjs +6 -2
- package/constants/chains.constants.cjs +1 -1
- package/constants/chains.constants.d.ts +6 -6
- package/constants/chains.constants.mjs +112 -69
- package/constants/coingecko.constants.cjs +1 -1
- package/constants/coingecko.constants.d.ts +2 -1
- package/constants/coingecko.constants.mjs +49 -38
- package/constants/deploy-data/deploy-data-solana.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-solana.json.mjs +390 -9
- package/constants/deploy-data/deploy-data-tronMainnet.json.cjs +1 -0
- package/constants/deploy-data/deploy-data-tronMainnet.json.mjs +4638 -0
- package/constants/deploy-data/deploy-data-tronNile.json.cjs +1 -0
- package/constants/deploy-data/deploy-data-tronNile.json.mjs +4638 -0
- package/constants/deploy-data/index.d.ts +3 -1
- package/constants/fees.constants.cjs +1 -1
- package/constants/fees.constants.d.ts +4 -1
- package/constants/fees.constants.mjs +8 -4
- package/constants/function-signatures.constants.cjs +1 -1
- package/constants/function-signatures.constants.d.ts +0 -1
- package/constants/function-signatures.constants.mjs +3 -4
- package/constants/images.constants.cjs +1 -0
- package/constants/images.constants.d.ts +1 -0
- package/constants/images.constants.mjs +4 -0
- package/constants/index.d.ts +6 -0
- package/constants/kyc.constants.cjs +1 -1
- package/constants/kyc.constants.mjs +39 -40
- package/constants/mediaUrls.constants.cjs +1 -1
- package/constants/mediaUrls.constants.d.ts +5 -1
- package/constants/mediaUrls.constants.mjs +6 -2
- package/constants/non-circular-tokens.constants.cjs +1 -0
- package/constants/non-circular-tokens.constants.d.ts +1 -0
- package/constants/non-circular-tokens.constants.mjs +4 -0
- package/constants/pay.constants.cjs +1 -0
- package/constants/pay.constants.d.ts +1 -0
- package/constants/pay.constants.mjs +4 -0
- package/constants/permit2.constants.cjs +1 -1
- package/constants/permit2.constants.d.ts +0 -1
- package/constants/permit2.constants.mjs +10 -11
- package/constants/protocol.constants.cjs +1 -1
- package/constants/protocol.constants.d.ts +6 -1
- package/constants/protocol.constants.mjs +38 -33
- package/constants/reorg-depths.constants.cjs +1 -1
- package/constants/reorg-depths.constants.mjs +3 -0
- package/constants/save-depths.cjs +1 -1
- package/constants/save-depths.mjs +6 -3
- package/constants/schedule.constants.cjs +1 -0
- package/constants/schedule.constants.d.ts +2 -0
- package/constants/schedule.constants.mjs +14 -0
- package/constants/server.constants.cjs +1 -1
- package/constants/server.constants.d.ts +31 -123
- package/constants/server.constants.mjs +65 -156
- package/constants/tasks.constants.cjs +1 -1
- package/constants/tasks.constants.mjs +5 -4
- package/constants/token-data/ERC20Registry.cjs +1 -1
- package/constants/token-data/ERC20Registry.mjs +48 -34
- package/constants/token-data/arbMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/arbMainnetRegistry.json.mjs +1 -1
- package/constants/token-data/arbMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/arbMainnetRegistryFixed.json.mjs +1 -1
- package/constants/token-data/arcTestnetRegistry.json.cjs +1 -1
- package/constants/token-data/arcTestnetRegistry.json.mjs +2 -2
- package/constants/token-data/avalancheRegistry.json.cjs +1 -1
- package/constants/token-data/avalancheRegistry.json.mjs +1 -1
- package/constants/token-data/avalancheRegistryFixed.json.cjs +1 -1
- package/constants/token-data/avalancheRegistryFixed.json.mjs +1 -1
- package/constants/token-data/baseRegistry.json.cjs +1 -1
- package/constants/token-data/baseRegistry.json.mjs +3 -3
- package/constants/token-data/baseRegistryFixed.json.cjs +1 -1
- package/constants/token-data/baseRegistryFixed.json.mjs +1 -1
- package/constants/token-data/bnbMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/bnbMainnetRegistry.json.mjs +2 -2
- package/constants/token-data/bnbMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/bnbMainnetRegistryFixed.json.mjs +2 -2
- package/constants/token-data/ethMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/ethMainnetRegistry.json.mjs +1 -1
- package/constants/token-data/ethMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/ethMainnetRegistryFixed.json.mjs +1 -1
- package/constants/token-data/index.d.ts +2 -2
- package/constants/token-data/solanaMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/solanaMainnetRegistry.json.mjs +143 -74
- package/constants/token-data/tronMainnetRegistry.json.cjs +1 -0
- package/constants/token-data/tronMainnetRegistry.json.mjs +24 -0
- package/constants/token-data/tronNileRegistry.json.cjs +1 -0
- package/constants/token-data/tronNileRegistry.json.mjs +24 -0
- package/constants/tokens.constants.cjs +1 -0
- package/constants/tokens.constants.d.ts +3 -0
- package/constants/tokens.constants.mjs +15 -0
- package/constants/tx-confirmation.constants.cjs +1 -0
- package/constants/tx-confirmation.constants.d.ts +4 -0
- package/constants/tx-confirmation.constants.mjs +7 -0
- package/constants/wallet.constants.cjs +1 -1
- package/constants/wallet.constants.d.ts +1 -7
- package/constants/wallet.constants.mjs +18 -8
- package/crypto/poseidon.cjs +1 -1
- package/crypto/poseidon.mjs +5 -5
- package/data-structures/AccountActions/AccountActions.cjs +1 -0
- package/data-structures/AccountActions/AccountActions.d.ts +17 -0
- package/data-structures/AccountActions/AccountActions.mjs +67 -0
- package/data-structures/AccountActions/index.d.ts +1 -0
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.cjs +1 -1
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.mjs +106 -109
- package/data-structures/BlockchainEvent/BlockchainEvent.cjs +1 -0
- package/data-structures/BlockchainEvent/BlockchainEvent.d.ts +14 -0
- package/data-structures/BlockchainEvent/BlockchainEvent.mjs +45 -0
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.d.ts +66 -74
- package/data-structures/Hinkal/Hinkal.mjs +366 -392
- package/data-structures/Hinkal/IHinkal.d.ts +61 -71
- package/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
- package/data-structures/Hinkal/handleAutoDepositBack.d.ts +2 -4
- package/data-structures/Hinkal/handleAutoDepositBack.mjs +146 -79
- package/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionReceive.d.ts +1 -2
- package/data-structures/Hinkal/hinkalActionReceive.mjs +26 -22
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.cjs +1 -1
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.d.ts +1 -0
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +34 -22
- package/data-structures/Hinkal/hinkalClaimUtxo.cjs +1 -0
- package/data-structures/Hinkal/hinkalClaimUtxo.d.ts +6 -0
- package/data-structures/Hinkal/hinkalClaimUtxo.mjs +119 -0
- package/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalDeposit.d.ts +2 -2
- package/data-structures/Hinkal/hinkalDeposit.mjs +101 -94
- package/data-structures/Hinkal/hinkalDepositAndBridge.cjs +1 -0
- package/data-structures/Hinkal/{hinkalDepostAndBridge.d.ts → hinkalDepositAndBridge.d.ts} +2 -2
- package/data-structures/Hinkal/hinkalDepositAndBridge.mjs +259 -0
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.d.ts +2 -2
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +159 -102
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.d.ts +1 -1
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.mjs +131 -92
- package/data-structures/Hinkal/hinkalGetZkMeProvider.cjs +1 -1
- package/data-structures/Hinkal/hinkalGetZkMeProvider.mjs +4 -5
- package/data-structures/Hinkal/hinkalMultiSend.cjs +1 -1
- package/data-structures/Hinkal/hinkalMultiSend.d.ts +1 -1
- package/data-structures/Hinkal/hinkalMultiSend.mjs +4 -4
- package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
- package/data-structures/Hinkal/hinkalPrivateWallet.d.ts +2 -2
- package/data-structures/Hinkal/hinkalPrivateWallet.mjs +121 -125
- package/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalProoflessDeposit.d.ts +2 -1
- package/data-structures/Hinkal/hinkalProoflessDeposit.mjs +188 -38
- package/data-structures/Hinkal/hinkalProxySwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalProxySwap.d.ts +1 -2
- package/data-structures/Hinkal/hinkalProxySwap.mjs +34 -31
- package/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -1
- package/data-structures/Hinkal/hinkalProxyToPrivate.d.ts +1 -1
- package/data-structures/Hinkal/hinkalProxyToPrivate.mjs +32 -28
- package/data-structures/Hinkal/hinkalSignSubAccount.cjs +1 -1
- package/data-structures/Hinkal/hinkalSignSubAccount.d.ts +1 -2
- package/data-structures/Hinkal/hinkalSignSubAccount.mjs +17 -15
- package/data-structures/Hinkal/hinkalSolanaClaimUtxo.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaClaimUtxo.d.ts +5 -0
- package/data-structures/Hinkal/hinkalSolanaClaimUtxo.mjs +130 -0
- package/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDeposit.d.ts +6 -3
- package/data-structures/Hinkal/hinkalSolanaDeposit.mjs +98 -110
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +3 -1
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +228 -197
- package/data-structures/Hinkal/hinkalSolanaProoflessDeposit.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaProoflessDeposit.d.ts +5 -0
- package/data-structures/Hinkal/hinkalSolanaProoflessDeposit.mjs +28 -0
- package/data-structures/Hinkal/hinkalSolanaProxySend.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySend.d.ts +4 -4
- package/data-structures/Hinkal/hinkalSolanaProxySend.mjs +44 -43
- package/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxyShield.d.ts +2 -2
- package/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +73 -71
- package/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySwap.d.ts +3 -3
- package/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +79 -64
- package/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaSwap.d.ts +1 -1
- package/data-structures/Hinkal/hinkalSolanaSwap.mjs +122 -100
- package/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaTransfer.d.ts +29 -2
- package/data-structures/Hinkal/hinkalSolanaTransfer.mjs +132 -70
- package/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaWithdraw.d.ts +3 -2
- package/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +113 -75
- package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSwap.d.ts +1 -1
- package/data-structures/Hinkal/hinkalSwap.mjs +71 -103
- package/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalTransfer.d.ts +1 -1
- package/data-structures/Hinkal/hinkalTransfer.mjs +96 -96
- package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdraw.d.ts +2 -1
- package/data-structures/Hinkal/hinkalWithdraw.mjs +97 -99
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.d.ts +1 -2
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +204 -113
- package/data-structures/Hinkal/index.d.ts +4 -0
- package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.d.ts +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.mjs +109 -54
- package/data-structures/IndexedDB/activity-db.cjs +1 -1
- package/data-structures/IndexedDB/activity-db.d.ts +4 -5
- package/data-structures/IndexedDB/activity-db.mjs +124 -131
- package/data-structures/IndexedDB/balances-db.cjs +1 -1
- package/data-structures/IndexedDB/balances-db.mjs +45 -38
- package/data-structures/IndexedDB/contact-db.cjs +1 -1
- package/data-structures/IndexedDB/contact-db.mjs +43 -36
- package/data-structures/IndexedDB/index.d.ts +1 -0
- package/data-structures/IndexedDB/pay-activity-db.cjs +1 -0
- package/data-structures/IndexedDB/pay-activity-db.d.ts +9 -0
- package/data-structures/IndexedDB/pay-activity-db.mjs +26 -0
- package/data-structures/IndexedDB/prices-db.cjs +1 -1
- package/data-structures/IndexedDB/prices-db.mjs +1 -1
- package/data-structures/IndexedDB/signatures-db.cjs +1 -1
- package/data-structures/IndexedDB/signatures-db.mjs +26 -40
- package/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/EventsPublicTokensDB.mjs +82 -79
- package/data-structures/TokenDBs/token-visibility-db.cjs +1 -1
- package/data-structures/TokenDBs/token-visibility-db.mjs +22 -36
- package/data-structures/crypto-keys/decodeUTXO.cjs +1 -1
- package/data-structures/crypto-keys/decodeUTXO.mjs +1 -1
- package/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
- package/data-structures/crypto-keys/encryptDecryptUtxo.mjs +29 -30
- package/data-structures/crypto-keys/keys.cjs +1 -1
- package/data-structures/crypto-keys/keys.d.ts +9 -11
- package/data-structures/crypto-keys/keys.mjs +65 -110
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.d.ts +3 -2
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.mjs +9 -9
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.d.ts +3 -2
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.mjs +5 -5
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.d.ts +9 -4
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.mjs +65 -48
- package/data-structures/event-service/evm/AbstractEventService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractEventService.d.ts +4 -2
- package/data-structures/event-service/evm/AbstractEventService.mjs +13 -13
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.d.ts +3 -2
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.mjs +5 -5
- package/data-structures/event-service/evm/AbstractSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractSnapshotService.d.ts +2 -2
- package/data-structures/event-service/evm/AbstractSnapshotService.mjs +5 -6
- package/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/evm/BlockchainEventEmitter.d.ts +18 -7
- package/data-structures/event-service/evm/BlockchainEventEmitter.mjs +75 -49
- package/data-structures/event-service/evm/ClientBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/evm/ClientBlockchainEventEmitter.d.ts +11 -0
- package/data-structures/event-service/evm/ClientBlockchainEventEmitter.mjs +25 -0
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.d.ts +6 -0
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.mjs +16 -0
- package/data-structures/event-service/helpers/ClientEventHelper.cjs +1 -0
- package/data-structures/event-service/helpers/ClientEventHelper.d.ts +10 -0
- package/data-structures/event-service/helpers/ClientEventHelper.mjs +38 -0
- package/data-structures/event-service/helpers/PollingEventHelper.cjs +1 -0
- package/data-structures/event-service/helpers/PollingEventHelper.d.ts +5 -0
- package/data-structures/event-service/helpers/PollingEventHelper.mjs +14 -0
- package/data-structures/event-service/index.d.ts +4 -0
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.d.ts +3 -2
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.mjs +6 -6
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.d.ts +9 -4
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.mjs +65 -48
- package/data-structures/event-service/solana/AbstractSolanaEventService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaEventService.d.ts +5 -10
- package/data-structures/event-service/solana/AbstractSolanaEventService.mjs +13 -7
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.d.ts +3 -2
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.mjs +4 -4
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.d.ts +1 -2
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.mjs +1 -2
- package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.d.ts +11 -0
- package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.mjs +26 -0
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.d.ts +6 -0
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.mjs +16 -0
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.d.ts +20 -19
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.mjs +126 -76
- package/data-structures/index.d.ts +2 -0
- package/data-structures/merkle-tree/MerkleTree.cjs +1 -1
- package/data-structures/merkle-tree/MerkleTree.d.ts +3 -2
- package/data-structures/merkle-tree/MerkleTree.mjs +27 -17
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.cjs +1 -1
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.d.ts +1 -2
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.mjs +6 -6
- package/data-structures/presale/PresaleContractWrapper.d.ts +1 -1
- package/data-structures/provider-adapter/IProviderAdapter.d.ts +9 -13
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.mjs +23 -18
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.mjs +12 -7
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.mjs +11 -5
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.mjs +9 -4
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.mjs +9 -4
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.mjs +12 -6
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.mjs +10 -5
- package/error-handling/customErrors/ErrorWithIndex.cjs +1 -0
- package/error-handling/customErrors/ErrorWithIndex.d.ts +4 -0
- package/error-handling/customErrors/ErrorWithIndex.mjs +9 -0
- package/error-handling/customErrors/ErrorWithTx.cjs +1 -1
- package/error-handling/customErrors/ErrorWithTx.d.ts +2 -3
- package/error-handling/customErrors/ErrorWithTx.mjs +5 -5
- package/error-handling/customErrors/index.d.ts +1 -0
- package/error-handling/error-codes.constants.cjs +2 -2
- package/error-handling/error-codes.constants.d.ts +29 -0
- package/error-handling/error-codes.constants.mjs +51 -22
- package/error-handling/get-error.message.cjs +1 -1
- package/error-handling/get-error.message.mjs +46 -47
- package/error-handling/index.d.ts +0 -1
- package/error-handling/isInsufficientFundsError.cjs +1 -0
- package/error-handling/isInsufficientFundsError.d.ts +1 -0
- package/error-handling/isInsufficientFundsError.mjs +19 -0
- package/functions/auto-deposit-back-helpers/get-gas-token-records.cjs +1 -0
- package/functions/auto-deposit-back-helpers/get-gas-token-records.d.ts +9 -0
- package/functions/auto-deposit-back-helpers/get-gas-token-records.mjs +74 -0
- package/functions/auto-deposit-back-helpers/get-tokens-to-deposit-back.cjs +1 -0
- package/functions/auto-deposit-back-helpers/get-tokens-to-deposit-back.d.ts +3 -0
- package/functions/auto-deposit-back-helpers/get-tokens-to-deposit-back.mjs +61 -0
- package/functions/auto-deposit-back-helpers/index.d.ts +4 -0
- package/functions/auto-deposit-back-helpers/select-gas-token.cjs +1 -0
- package/functions/auto-deposit-back-helpers/select-gas-token.d.ts +13 -0
- package/functions/auto-deposit-back-helpers/select-gas-token.mjs +79 -0
- package/functions/auto-deposit-back-helpers/update-hinkal.cjs +1 -0
- package/functions/auto-deposit-back-helpers/update-hinkal.d.ts +3 -0
- package/functions/auto-deposit-back-helpers/update-hinkal.mjs +18 -0
- package/functions/connectors.types.d.ts +11 -3
- package/functions/index.d.ts +1 -0
- package/functions/kyc/zkMeHelper.cjs +1 -1
- package/functions/kyc/zkMeHelper.mjs +17 -16
- package/functions/pre-transaction/addressTableLookup.cjs +1 -1
- package/functions/pre-transaction/addressTableLookup.mjs +1 -1
- package/functions/pre-transaction/constructAdminData.cjs +1 -1
- package/functions/pre-transaction/constructAdminData.d.ts +2 -2
- package/functions/pre-transaction/constructAdminData.mjs +12 -18
- package/functions/pre-transaction/convert-okx-instructions.cjs +1 -1
- package/functions/pre-transaction/convert-okx-instructions.mjs +20 -16
- package/functions/pre-transaction/ensureAmountChanges.cjs +1 -0
- package/functions/pre-transaction/ensureAmountChanges.d.ts +2 -0
- package/functions/pre-transaction/ensureAmountChanges.mjs +11 -0
- package/functions/pre-transaction/getExternalSwapAddress.cjs +1 -1
- package/functions/pre-transaction/getExternalSwapAddress.d.ts +1 -2
- package/functions/pre-transaction/getExternalSwapAddress.mjs +8 -8
- package/functions/pre-transaction/getFeeStructure.cjs +1 -1
- package/functions/pre-transaction/getFeeStructure.d.ts +2 -1
- package/functions/pre-transaction/getFeeStructure.mjs +13 -12
- package/functions/pre-transaction/getKycAndSignatureData.cjs +1 -0
- package/functions/pre-transaction/getKycAndSignatureData.d.ts +5 -0
- package/functions/pre-transaction/getKycAndSignatureData.mjs +20 -0
- package/functions/pre-transaction/getVolatileTransferAmount.cjs +1 -1
- package/functions/pre-transaction/getVolatileTransferAmount.mjs +22 -36
- package/functions/pre-transaction/index.d.ts +4 -0
- package/functions/pre-transaction/merge-with-fee-structure-emporium.cjs +1 -1
- package/functions/pre-transaction/merge-with-fee-structure-emporium.d.ts +1 -1
- package/functions/pre-transaction/merge-with-fee-structure-emporium.mjs +17 -17
- package/functions/pre-transaction/outputApprovalDataProcessing.cjs +1 -1
- package/functions/pre-transaction/outputApprovalDataProcessing.d.ts +1 -9
- package/functions/pre-transaction/outputApprovalDataProcessing.mjs +19 -34
- package/functions/pre-transaction/sendV0Transaction.cjs +1 -1
- package/functions/pre-transaction/sendV0Transaction.d.ts +4 -8
- package/functions/pre-transaction/sendV0Transaction.mjs +150 -86
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs +1 -1
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.d.ts +1 -1
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs +7 -4
- package/functions/pre-transaction/store-instructions.cjs +1 -1
- package/functions/pre-transaction/store-instructions.mjs +11 -6
- package/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.cjs +1 -0
- package/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.d.ts +3 -0
- package/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.mjs +33 -0
- package/functions/private-wallet/emporium.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.helpers.d.ts +12 -7
- package/functions/private-wallet/emporium.helpers.mjs +105 -131
- package/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.swap.helpers.d.ts +1 -4
- package/functions/private-wallet/emporium.swap.helpers.mjs +98 -100
- package/functions/snarkjs/common.snarkjs.cjs +1 -1
- package/functions/snarkjs/common.snarkjs.d.ts +4 -5
- package/functions/snarkjs/common.snarkjs.mjs +113 -111
- package/functions/snarkjs/constant.cjs +1 -1
- package/functions/snarkjs/constant.mjs +7 -1
- package/functions/snarkjs/constructEmporiumProof.cjs +1 -1
- package/functions/snarkjs/constructEmporiumProof.d.ts +4 -4
- package/functions/snarkjs/constructEmporiumProof.mjs +111 -121
- package/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
- package/functions/snarkjs/constructGeneralZkProof.d.ts +2 -2
- package/functions/snarkjs/constructGeneralZkProof.mjs +104 -124
- package/functions/snarkjs/constructSolanaZkProof.cjs +1 -1
- package/functions/snarkjs/constructSolanaZkProof.d.ts +1 -1
- package/functions/snarkjs/constructSolanaZkProof.mjs +58 -64
- package/functions/snarkjs/fetchMerkleTreeSiblings.cjs +1 -1
- package/functions/snarkjs/fetchMerkleTreeSiblings.mjs +11 -10
- package/functions/snarkjs/fetchOnChainRootHashes.cjs +1 -0
- package/functions/snarkjs/fetchOnChainRootHashes.d.ts +4 -0
- package/functions/snarkjs/fetchOnChainRootHashes.mjs +15 -0
- package/functions/snarkjs/generateCircomData.cjs +1 -1
- package/functions/snarkjs/generateCircomData.d.ts +3 -3
- package/functions/snarkjs/generateCircomData.mjs +29 -31
- package/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.cjs +1 -1
- package/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.d.ts +12 -1
- package/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.mjs +161 -65
- package/functions/snarkjs/getZKFiles.cjs +1 -1
- package/functions/snarkjs/getZKFiles.mjs +7 -7
- package/functions/snarkjs/index.d.ts +1 -0
- package/functions/utils/addresses.cjs +1 -1
- package/functions/utils/addresses.d.ts +3 -0
- package/functions/utils/addresses.mjs +32 -17
- package/functions/utils/amounts.utils.cjs +1 -1
- package/functions/utils/amounts.utils.d.ts +1 -1
- package/functions/utils/amounts.utils.mjs +2 -2
- package/functions/utils/buildClaimableDepositPlan.cjs +1 -0
- package/functions/utils/buildClaimableDepositPlan.d.ts +15 -0
- package/functions/utils/buildClaimableDepositPlan.mjs +40 -0
- package/functions/utils/cacheDevice.utils.cjs +1 -1
- package/functions/utils/cacheDevice.utils.mjs +8 -6
- package/functions/utils/cacheFunctions.cjs +1 -1
- package/functions/utils/cacheFunctions.mjs +2 -2
- package/functions/utils/create-provider.cjs +1 -1
- package/functions/utils/create-provider.d.ts +1 -1
- package/functions/utils/create-provider.mjs +11 -7
- package/functions/utils/enclave-signature-storage.cjs +1 -0
- package/functions/utils/enclave-signature-storage.d.ts +2 -0
- package/functions/utils/enclave-signature-storage.mjs +13 -0
- package/functions/utils/enclave-utxo-storage.cjs +1 -0
- package/functions/utils/enclave-utxo-storage.d.ts +6 -0
- package/functions/utils/enclave-utxo-storage.mjs +34 -0
- package/functions/utils/encryptInputForEnclave.cjs +1 -1
- package/functions/utils/encryptInputForEnclave.mjs +21 -21
- package/functions/utils/erc20tokenFunctions.cjs +1 -1
- package/functions/utils/erc20tokenFunctions.mjs +35 -35
- package/functions/utils/evmNetworkFunctions.cjs +1 -1
- package/functions/utils/evmNetworkFunctions.mjs +5 -3
- package/functions/utils/fees.utils.cjs +1 -1
- package/functions/utils/fees.utils.mjs +31 -29
- package/functions/utils/getBlockExplorerUrl.cjs +1 -1
- package/functions/utils/getBlockExplorerUrl.mjs +3 -3
- package/functions/utils/getDataFromTransaction.d.ts +1 -1
- package/functions/utils/getRecipientInfoFromUserKeys.cjs +1 -1
- package/functions/utils/getRecipientInfoFromUserKeys.mjs +1 -1
- package/functions/utils/getUtxosFromReceipt.utils.cjs +1 -1
- package/functions/utils/getUtxosFromReceipt.utils.d.ts +2 -1
- package/functions/utils/getUtxosFromReceipt.utils.mjs +44 -15
- package/functions/utils/getUtxosFromReceiptSolana.cjs +1 -1
- package/functions/utils/getUtxosFromReceiptSolana.d.ts +2 -1
- package/functions/utils/getUtxosFromReceiptSolana.mjs +27 -16
- package/functions/utils/index.d.ts +12 -2
- package/functions/utils/involves-permit2-op.cjs +1 -1
- package/functions/utils/involves-permit2-op.d.ts +0 -1
- package/functions/utils/involves-permit2-op.mjs +4 -6
- package/functions/utils/mutexes.utils.cjs +1 -1
- package/functions/utils/mutexes.utils.d.ts +1 -1
- package/functions/utils/mutexes.utils.mjs +3 -3
- package/functions/utils/networks.utils.cjs +1 -1
- package/functions/utils/networks.utils.mjs +4 -2
- package/functions/utils/nftTokenFunctions.cjs +1 -1
- package/functions/utils/nftTokenFunctions.mjs +9 -23
- package/functions/utils/prepareHinkal.cjs +1 -1
- package/functions/utils/prepareHinkal.d.ts +6 -13
- package/functions/utils/prepareHinkal.mjs +44 -71
- package/functions/utils/process.utils.cjs +1 -1
- package/functions/utils/process.utils.d.ts +6 -0
- package/functions/utils/process.utils.mjs +22 -10
- package/functions/utils/proxyAvatar.utils.cjs +1 -0
- package/functions/utils/proxyAvatar.utils.d.ts +2 -0
- package/functions/utils/proxyAvatar.utils.mjs +5 -0
- package/functions/utils/publicBalance.utils.cjs +1 -1
- package/functions/utils/publicBalance.utils.d.ts +1 -1
- package/functions/utils/publicBalance.utils.mjs +55 -53
- package/functions/utils/serialize-utxos.utils.cjs +1 -0
- package/functions/utils/serialize-utxos.utils.d.ts +3 -0
- package/functions/utils/serialize-utxos.utils.mjs +13 -0
- package/functions/utils/string.utils.cjs +1 -1
- package/functions/utils/string.utils.d.ts +2 -0
- package/functions/utils/string.utils.mjs +35 -27
- package/functions/utils/time.utils.cjs +1 -1
- package/functions/utils/time.utils.mjs +1 -1
- package/functions/utils/token-check.utils.cjs +1 -1
- package/functions/utils/token-check.utils.d.ts +3 -0
- package/functions/utils/token-check.utils.mjs +18 -7
- package/functions/utils/tron.utils.cjs +1 -0
- package/functions/utils/tron.utils.d.ts +25 -0
- package/functions/utils/tron.utils.mjs +128 -0
- package/functions/utils/tronSimulation.utils.cjs +1 -0
- package/functions/utils/tronSimulation.utils.d.ts +1 -0
- package/functions/utils/tronSimulation.utils.mjs +30 -0
- package/functions/utils/tx-confirmation.utils.cjs +1 -0
- package/functions/utils/tx-confirmation.utils.d.ts +10 -0
- package/functions/utils/tx-confirmation.utils.mjs +50 -0
- package/functions/utils/upToDateState.cjs +1 -1
- package/functions/utils/upToDateState.d.ts +1 -1
- package/functions/utils/upToDateState.mjs +4 -4
- package/functions/utils/userAgent.cjs +1 -1
- package/functions/utils/userAgent.d.ts +0 -2
- package/functions/utils/userAgent.mjs +4 -23
- package/functions/utils/validateUsername.cjs +1 -0
- package/functions/utils/validateUsername.d.ts +5 -0
- package/functions/utils/validateUsername.mjs +16 -0
- package/functions/utils/walletBalances.utils.cjs +1 -1
- package/functions/utils/walletBalances.utils.d.ts +2 -17
- package/functions/utils/walletBalances.utils.mjs +5 -36
- package/functions/web3/connectors.utils.cjs +1 -1
- package/functions/web3/connectors.utils.d.ts +1 -0
- package/functions/web3/connectors.utils.mjs +14 -12
- package/functions/web3/crypto.cjs +1 -0
- package/functions/web3/crypto.d.ts +1 -0
- package/functions/web3/crypto.mjs +7 -0
- package/functions/web3/etherFunctions.cjs +1 -1
- package/functions/web3/etherFunctions.d.ts +1 -1
- package/functions/web3/etherFunctions.mjs +12 -15
- package/functions/web3/events/getApprovedBalance.cjs +1 -1
- package/functions/web3/events/getApprovedBalance.d.ts +3 -4
- package/functions/web3/events/getApprovedBalance.mjs +39 -44
- package/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
- package/functions/web3/events/getInputUtxoAndBalance.d.ts +1 -1
- package/functions/web3/events/getInputUtxoAndBalance.mjs +127 -132
- package/functions/web3/events/getShieldedBalance.cjs +1 -2
- package/functions/web3/events/getShieldedBalance.d.ts +1 -1
- package/functions/web3/events/getShieldedBalance.mjs +72 -69
- package/functions/web3/events/getTransactionLogEvents.cjs +1 -1
- package/functions/web3/events/getTransactionLogEvents.mjs +40 -36
- package/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -1
- package/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +17 -10
- package/functions/web3/functionCalls/accessTokenCalls.cjs +1 -1
- package/functions/web3/functionCalls/accessTokenCalls.d.ts +1 -6
- package/functions/web3/functionCalls/accessTokenCalls.mjs +19 -25
- package/functions/web3/functionCalls/approveToken.cjs +1 -1
- package/functions/web3/functionCalls/approveToken.d.ts +1 -1
- package/functions/web3/functionCalls/approveToken.mjs +68 -63
- package/functions/web3/functionCalls/approveTokensToHinkal.cjs +1 -1
- package/functions/web3/functionCalls/approveTokensToHinkal.d.ts +1 -1
- package/functions/web3/functionCalls/approveTokensToHinkal.mjs +6 -6
- package/functions/web3/functionCalls/constructBatchCall.cjs +1 -1
- package/functions/web3/functionCalls/constructBatchCall.d.ts +3 -2
- package/functions/web3/functionCalls/constructBatchCall.mjs +53 -16
- package/functions/web3/functionCalls/estimateGasRelayer.d.ts +2 -3
- package/functions/web3/functionCalls/recoverTransactionFromError.cjs +1 -1
- package/functions/web3/functionCalls/recoverTransactionFromError.mjs +8 -7
- package/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
- package/functions/web3/functionCalls/transactCallDirect.d.ts +2 -2
- package/functions/web3/functionCalls/transactCallDirect.mjs +56 -47
- package/functions/web3/functionCalls/transactCallDirectTron.cjs +1 -0
- package/functions/web3/functionCalls/transactCallDirectTron.d.ts +6 -0
- package/functions/web3/functionCalls/transactCallDirectTron.mjs +63 -0
- package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.d.ts +15 -6
- package/functions/web3/functionCalls/transactCallRelayer.mjs +72 -67
- package/functions/web3/functionCalls/waitForErc20Approvals.cjs +1 -0
- package/functions/web3/functionCalls/waitForErc20Approvals.d.ts +9 -0
- package/functions/web3/functionCalls/waitForErc20Approvals.mjs +54 -0
- package/functions/web3/getContractMetadata.cjs +1 -1
- package/functions/web3/getContractMetadata.mjs +14 -18
- package/functions/web3/getPublicAddressBalance.cjs +1 -1
- package/functions/web3/getPublicAddressBalance.d.ts +1 -1
- package/functions/web3/getPublicAddressBalance.mjs +7 -7
- package/functions/web3/getSolanaPriorityFee.cjs +1 -0
- package/functions/web3/getSolanaPriorityFee.d.ts +3 -0
- package/functions/web3/getSolanaPriorityFee.mjs +32 -0
- package/functions/web3/getTokenHolder.cjs +1 -1
- package/functions/web3/getTokenHolder.mjs +35 -31
- package/functions/web3/index.d.ts +3 -0
- package/functions/web3/lifiAPI.cjs +1 -1
- package/functions/web3/lifiAPI.d.ts +1 -1
- package/functions/web3/lifiAPI.mjs +12 -12
- package/functions/web3/odosAPI.cjs +1 -1
- package/functions/web3/odosAPI.mjs +4 -15
- package/functions/web3/okxAPI.cjs +1 -1
- package/functions/web3/okxAPI.mjs +13 -13
- package/functions/web3/oneInchAPI.cjs +1 -1
- package/functions/web3/oneInchAPI.mjs +9 -20
- package/functions/web3/runContractFunction.cjs +1 -1
- package/functions/web3/runContractFunction.mjs +38 -50
- package/functions/web3/tron-wagmi-adapter.cjs +1 -0
- package/functions/web3/tron-wagmi-adapter.d.ts +8 -0
- package/functions/web3/tron-wagmi-adapter.mjs +31 -0
- package/functions/web3/uniswapAPI.cjs +1 -1
- package/functions/web3/uniswapAPI.mjs +24 -34
- package/index.cjs +1 -1
- package/index.mjs +1079 -958
- package/package.json +4 -2
- package/providers/EthersProviderAdapter.cjs +1 -1
- package/providers/EthersProviderAdapter.d.ts +11 -17
- package/providers/EthersProviderAdapter.mjs +53 -82
- package/providers/SolanaProviderAdapter.cjs +1 -1
- package/providers/SolanaProviderAdapter.d.ts +8 -11
- package/providers/SolanaProviderAdapter.mjs +20 -32
- package/providers/TronProviderAdapter.cjs +1 -0
- package/providers/TronProviderAdapter.d.ts +37 -0
- package/providers/TronProviderAdapter.mjs +145 -0
- package/providers/WagmiProviderAdapter.cjs +1 -1
- package/providers/WagmiProviderAdapter.d.ts +14 -19
- package/providers/WagmiProviderAdapter.mjs +104 -130
- package/providers/prepareEthersHinkal.cjs +1 -1
- package/providers/prepareEthersHinkal.d.ts +2 -2
- package/providers/prepareEthersHinkal.mjs +17 -10
- package/providers/prepareWagmiHinkal.cjs +1 -1
- package/providers/prepareWagmiHinkal.mjs +21 -13
- package/types/TransactionSimulator.types.d.ts +2 -9
- package/types/activities.types.cjs +1 -1
- package/types/activities.types.d.ts +13 -7
- package/types/activities.types.mjs +18 -18
- package/types/admin.types.cjs +1 -1
- package/types/admin.types.d.ts +11 -8
- package/types/admin.types.mjs +2 -2
- package/types/balances.types.d.ts +1 -1
- package/types/cache.types.cjs +1 -1
- package/types/cache.types.d.ts +12 -4
- package/types/cache.types.mjs +2 -2
- package/types/circom-data.types.d.ts +6 -14
- package/types/coingecko.types.d.ts +5 -0
- package/types/commitments.types.d.ts +4 -0
- package/types/connector.types.d.ts +1 -0
- package/types/ethereum-network.types.d.ts +1 -1
- package/types/events.types.cjs +1 -0
- package/types/events.types.d.ts +6 -0
- package/types/events.types.mjs +4 -0
- package/types/fee.types.cjs +1 -0
- package/types/fee.types.d.ts +4 -0
- package/types/fee.types.mjs +4 -0
- package/types/hinkal.types.cjs +1 -1
- package/types/hinkal.types.d.ts +5 -1
- package/types/hinkal.types.mjs +14 -13
- package/types/index.d.ts +5 -4
- package/types/onramp.types.cjs +1 -0
- package/types/onramp.types.d.ts +58 -0
- package/types/onramp.types.mjs +4 -0
- package/types/pay-activities.types.cjs +1 -0
- package/types/pay-activities.types.d.ts +29 -0
- package/types/pay-activities.types.mjs +6 -0
- package/types/proxy.types.d.ts +7 -3
- package/types/rewards.types.d.ts +1 -1
- package/types/sandbox.types.cjs +1 -1
- package/types/sandbox.types.d.ts +12 -72
- package/types/sandbox.types.mjs +2 -2
- package/types/schedule.types.cjs +1 -0
- package/types/schedule.types.d.ts +7 -0
- package/types/schedule.types.mjs +4 -0
- package/types/scheduled-transactions.types.d.ts +14 -0
- package/types/session.types.d.ts +2 -0
- package/types/solana.types.d.ts +10 -0
- package/types/token-prices.types.cjs +1 -1
- package/types/token-prices.types.d.ts +7 -0
- package/types/token-prices.types.mjs +4 -2
- package/types/transactions.types.d.ts +2 -2
- package/types/tron.types.d.ts +10 -0
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.mjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.mjs +31 -27
- package/webworker/utxoWorker/utxoWorkerLauncher.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLauncher.mjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLogic.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLogic.mjs +1 -1
- package/webworker/viteWorkerURL.constant.cjs +3 -3
- package/webworker/viteWorkerURL.constant.mjs +3 -3
- package/webworker/zkProofWorker/zkProofWorker.types.d.ts +1 -2
- package/webworker/zkProofWorker/zkProofWorkerLauncher.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.mjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLogic.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLogic.mjs +27 -28
- package/API/ai-calls.cjs +0 -1
- package/API/ai-calls.d.ts +0 -17
- package/API/ai-calls.mjs +0 -21
- package/API/duneAPI.cjs +0 -1
- package/API/duneAPI.d.ts +0 -11
- package/API/duneAPI.mjs +0 -25
- package/API/enclaveCalls.cjs +0 -1
- package/API/enclaveCalls.d.ts +0 -9
- package/API/enclaveCalls.mjs +0 -11
- package/API/getBridgeProtocols.cjs +0 -1
- package/API/getBridgeProtocols.d.ts +0 -7
- package/API/getBridgeProtocols.mjs +0 -8
- package/API/getLifiStatus.cjs +0 -1
- package/API/getLifiStatus.d.ts +0 -24
- package/API/getLifiStatus.mjs +0 -15
- package/API/getRelayerURL.cjs +0 -1
- package/API/getRelayerURL.d.ts +0 -1
- package/API/getRelayerURL.mjs +0 -10
- package/API/is-tx-stateless.cjs +0 -1
- package/API/is-tx-stateless.mjs +0 -20
- package/API/passwordCalls.cjs +0 -1
- package/API/passwordCalls.d.ts +0 -9
- package/API/passwordCalls.mjs +0 -13
- package/API/restoreSnapshots.cjs +0 -1
- package/API/restoreSnapshots.d.ts +0 -1
- package/API/restoreSnapshots.mjs +0 -10
- package/constants/token-data/popularTokens.constants.cjs +0 -1
- package/constants/token-data/popularTokens.constants.d.ts +0 -3
- package/constants/token-data/popularTokens.constants.mjs +0 -13
- package/constants/token-data/tokenPricing.consts.d.ts +0 -2
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.cjs +0 -1
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.d.ts +0 -7
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.mjs +0 -42
- package/data-structures/Hinkal/hinkalApprove.cjs +0 -1
- package/data-structures/Hinkal/hinkalApprove.d.ts +0 -3
- package/data-structures/Hinkal/hinkalApprove.mjs +0 -114
- package/data-structures/Hinkal/hinkalDepostAndBridge.cjs +0 -1
- package/data-structures/Hinkal/hinkalDepostAndBridge.mjs +0 -230
- package/data-structures/Hinkal/hinkalInsideTransact.cjs +0 -1
- package/data-structures/Hinkal/hinkalInsideTransact.d.ts +0 -4
- package/data-structures/Hinkal/hinkalInsideTransact.mjs +0 -120
- package/error-handling/handleErrorRestore.cjs +0 -1
- package/error-handling/handleErrorRestore.d.ts +0 -2
- package/error-handling/handleErrorRestore.mjs +0 -11
- package/functions/kyc/authentoHelper.cjs +0 -1
- package/functions/kyc/authentoHelper.d.ts +0 -12
- package/functions/kyc/authentoHelper.mjs +0 -30
- package/functions/utils/ethers-formatter.utils.cjs +0 -1
- package/functions/utils/ethers-formatter.utils.d.ts +0 -5
- package/functions/utils/ethers-formatter.utils.mjs +0 -59
- package/functions/utils/get-hinkal-approvals.cjs +0 -1
- package/functions/utils/get-hinkal-approvals.d.ts +0 -3
- package/functions/utils/get-hinkal-approvals.mjs +0 -38
- package/functions/utils/replaceAddressInCalldata.cjs +0 -1
- package/functions/utils/replaceAddressInCalldata.d.ts +0 -1
- package/functions/utils/replaceAddressInCalldata.mjs +0 -7
- package/functions/web3/functionCalls/estimateGasRelayer.cjs +0 -1
- package/functions/web3/functionCalls/estimateGasRelayer.mjs +0 -22
- package/functions/web3/functionCalls/inHinkalApprovalCalls.cjs +0 -1
- package/functions/web3/functionCalls/inHinkalApprovalCalls.d.ts +0 -5
- package/functions/web3/functionCalls/inHinkalApprovalCalls.mjs +0 -29
- package/types/bridging.types.d.ts +0 -29
- package/types/duneAPI.types.d.ts +0 -9
- package/types/relayer.types.d.ts +0 -25
- package/types/routing.types.cjs +0 -1
- package/types/routing.types.d.ts +0 -7
- package/types/routing.types.mjs +0 -4
|
@@ -1,52 +1,27 @@
|
|
|
1
|
-
import { ethers as
|
|
2
|
-
import { PublicKey as
|
|
3
|
-
import { preProcessing as
|
|
4
|
-
import
|
|
5
|
-
import { networkRegistry as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const n =
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
const e = s();
|
|
24
|
-
e.initSigner?.(t), await r.initProviderAdapter(void 0, e), await r.initUserKeys();
|
|
25
|
-
}, y = async (r, t, e) => {
|
|
26
|
-
const n = s(), o = h(e, t);
|
|
27
|
-
n.initSigner?.(o), await r.initProviderAdapter(void 0, n);
|
|
28
|
-
}, V = async (r, t, e, n) => {
|
|
29
|
-
await a(), await y(r, e, t), await r.initUserKeysWithPassword(n);
|
|
30
|
-
}, D = async (r, t) => {
|
|
31
|
-
await a();
|
|
32
|
-
const e = r.getSelectedNetwork()?.chainId;
|
|
33
|
-
if (!e)
|
|
34
|
-
throw Error("chainId is undefined");
|
|
35
|
-
const n = v(t, e), o = s();
|
|
36
|
-
return o.initSigner?.(n), { userKeys: new w(await o.signMessage(r.signingMessage)), signer: n };
|
|
37
|
-
}, b = async (r, t, e) => {
|
|
38
|
-
await a();
|
|
39
|
-
const n = r.getSelectedNetwork()?.chainId;
|
|
40
|
-
if (!n)
|
|
41
|
-
throw Error("chainId is undefined");
|
|
42
|
-
const o = h(t, n);
|
|
43
|
-
s().initSigner?.(o);
|
|
44
|
-
const d = new w(e);
|
|
45
|
-
return await r.switchAccount(o), d;
|
|
46
|
-
}, A = (r) => {
|
|
47
|
-
const t = r.userKeys.getDerivedSolanaPublicKey();
|
|
1
|
+
import { ethers as s } from "ethers";
|
|
2
|
+
import { PublicKey as m } from "@solana/web3.js";
|
|
3
|
+
import { preProcessing as o } from "../../crypto/preProcessing.mjs";
|
|
4
|
+
import c from "../../providers/EthersProviderAdapter.mjs";
|
|
5
|
+
import { chainIds as a, networkRegistry as u } from "../../constants/chains.constants.mjs";
|
|
6
|
+
import { createCustomRpcProvider as d, createCustomSolanaConnection as v } from "./create-provider.mjs";
|
|
7
|
+
import { SolanaProviderAdapter as y } from "../../providers/SolanaProviderAdapter.mjs";
|
|
8
|
+
const V = (e) => {
|
|
9
|
+
const r = d(a.ethMainnet);
|
|
10
|
+
return new s.Wallet(e, r);
|
|
11
|
+
}, P = (e) => {
|
|
12
|
+
const r = d(a.ethMainnet);
|
|
13
|
+
return new s.VoidSigner(e, r);
|
|
14
|
+
}, D = async (e, r) => {
|
|
15
|
+
await o();
|
|
16
|
+
const t = c();
|
|
17
|
+
t.initSigner?.(r), await e.initProviderAdapter(void 0, t), await e.initUserKeys();
|
|
18
|
+
}, p = async (e, r) => {
|
|
19
|
+
const t = c(), n = P(r);
|
|
20
|
+
t.initSigner?.(n), await e.initProviderAdapter(void 0, t);
|
|
21
|
+
}, A = (e) => {
|
|
22
|
+
const r = e.userKeys.getDerivedSolanaPublicKey();
|
|
48
23
|
return {
|
|
49
|
-
publicKey: new
|
|
24
|
+
publicKey: new m(r),
|
|
50
25
|
signTransaction: () => {
|
|
51
26
|
throw new Error("Void wallet cannot sign transactions");
|
|
52
27
|
},
|
|
@@ -57,32 +32,30 @@ const v = (r, t) => {
|
|
|
57
32
|
throw new Error("Void wallet cannot sign messages");
|
|
58
33
|
}
|
|
59
34
|
};
|
|
60
|
-
},
|
|
61
|
-
const n =
|
|
62
|
-
if (!n)
|
|
63
|
-
throw new Error("RPC URL not found for the specified chain ID");
|
|
64
|
-
const o = f(n), i = A(r), d = new g(o, t, i, e);
|
|
65
|
-
await r.initProviderAdapter(i, d);
|
|
66
|
-
}, H = async (r, t, e) => {
|
|
67
|
-
await a();
|
|
68
|
-
const n = c[t].fetchRpcUrl;
|
|
35
|
+
}, l = async (e, r) => {
|
|
36
|
+
const t = a.solanaMainnet, n = u[t].fetchRpcUrl;
|
|
69
37
|
if (!n)
|
|
70
38
|
throw new Error("RPC URL not found for the specified chain ID");
|
|
71
|
-
const
|
|
72
|
-
await
|
|
73
|
-
},
|
|
74
|
-
await
|
|
39
|
+
const w = v(n), i = A(e), g = new y(w, t, i, r);
|
|
40
|
+
await e.initProviderAdapter(i, g);
|
|
41
|
+
}, R = async (e, r, t) => {
|
|
42
|
+
await o(), e.initUserKeysWithSignature(t);
|
|
43
|
+
const n = e.userKeys.getDerivedSolanaPublicKey();
|
|
44
|
+
await l(e, n), await p(e, r);
|
|
45
|
+
}, W = async (e, r) => {
|
|
46
|
+
await o(), await e.initUserKeysFromSeedPhrases(r);
|
|
47
|
+
const t = e.userKeys.getDerivedSolanaPublicKey();
|
|
48
|
+
await l(e, t);
|
|
49
|
+
const n = e.userKeys.getDerivedEthereumAddress();
|
|
50
|
+
await p(e, n);
|
|
75
51
|
};
|
|
76
52
|
export {
|
|
77
|
-
|
|
78
|
-
|
|
53
|
+
V as createSigner,
|
|
54
|
+
P as createVoidSigner,
|
|
79
55
|
A as createVoidSolanaWallet,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
P as prepareSolanaProviderAdapter,
|
|
86
|
-
D as prepareToAccessNewWallet,
|
|
87
|
-
b as prepareToAccessNewWalletWithSignature
|
|
56
|
+
p as prepareEthersProviderAdapter,
|
|
57
|
+
D as prepareHinkal,
|
|
58
|
+
W as prepareHinkalFromSeedPhrases,
|
|
59
|
+
R as prepareHinkalWithSignature,
|
|
60
|
+
l as prepareSolanaProviderAdapter
|
|
88
61
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=o=>new Promise(t=>{setTimeout(t,o)}),c=async(o,t={})=>{const e=t.intervalMs??5e3,a=t.timeoutMs??6e4,i=Math.floor(a/e)+1;for(let n=0;n<i;n+=1){try{const u=await o();if(u!=null)return u}catch{}n<i-1&&await r(e)}};function l(o,t){let e;return function(...i){const n=()=>{clearTimeout(e),o(...i)};clearTimeout(e),e=setTimeout(n,t)}}exports.debounce=l;exports.pollForValue=c;exports.wait=r;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
/** pause execution for a number of miliseconds */
|
|
2
2
|
export declare const wait: (miliseconds: number) => Promise<unknown>;
|
|
3
|
+
type PollForValueOptions = {
|
|
4
|
+
intervalMs?: number;
|
|
5
|
+
timeoutMs?: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const pollForValue: <T>(fetcher: () => Promise<T | null | undefined>, options?: PollForValueOptions) => Promise<T | undefined>;
|
|
3
8
|
/** only call function once with a given number of milliseconds
|
|
4
9
|
* Ex: let debounceMyFunc = debounce(myFunc, 1000);
|
|
5
10
|
* debounceMyFunc(); debounceMyFunc();
|
|
6
11
|
*/
|
|
7
12
|
export declare function debounce(func: (...args: any[]) => void, debounceForMs: number): (...args: any[]) => void;
|
|
13
|
+
export {};
|
|
@@ -1,16 +1,28 @@
|
|
|
1
|
-
const c = (
|
|
2
|
-
setTimeout(t,
|
|
3
|
-
})
|
|
4
|
-
|
|
5
|
-
let
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
const c = (o) => new Promise((t) => {
|
|
2
|
+
setTimeout(t, o);
|
|
3
|
+
}), r = async (o, t = {}) => {
|
|
4
|
+
const e = t.intervalMs ?? 5e3, a = t.timeoutMs ?? 6e4, i = Math.floor(a / e) + 1;
|
|
5
|
+
for (let n = 0; n < i; n += 1) {
|
|
6
|
+
try {
|
|
7
|
+
const u = await o();
|
|
8
|
+
if (u != null)
|
|
9
|
+
return u;
|
|
10
|
+
} catch {
|
|
11
|
+
}
|
|
12
|
+
n < i - 1 && await c(e);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
function s(o, t) {
|
|
16
|
+
let e;
|
|
17
|
+
return function(...i) {
|
|
18
|
+
const n = () => {
|
|
19
|
+
clearTimeout(e), o(...i);
|
|
9
20
|
};
|
|
10
|
-
clearTimeout(
|
|
21
|
+
clearTimeout(e), e = setTimeout(n, t);
|
|
11
22
|
};
|
|
12
23
|
}
|
|
13
24
|
export {
|
|
14
|
-
|
|
25
|
+
s as debounce,
|
|
26
|
+
r as pollForValue,
|
|
15
27
|
c as wait
|
|
16
28
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=353,o=()=>Math.floor(Math.random()*t);exports.PROXY_AVATAR_INDEX_COUNT=t;exports.getRandomProxyAvatarIndex=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("ethers"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("ethers"),y=require("../../constants/chains.constants.cjs"),f=require("../../constants/protocol.constants.cjs"),P=require("./erc20tokenFunctions.cjs"),m=require("../../externalABIs/swapAbi.cjs"),C=require("../../error-handling/logger.cjs"),p=require("../../externalABIs/index.cjs"),w=require("./ipfs.cjs"),b=require("./create-provider.cjs"),q=require("../../data-structures/http/HttpClient.cjs");require("axios");const l=require("@solana/web3.js"),d=require("@solana/spl-token"),B=require("./addresses.cjs"),R=async(a,e,n)=>{try{const o=n.erc20TokenAddress;let c;const s=new T.ethers.Contract(n.erc20TokenAddress,m.ERC20ABI,a);o!==f.zeroAddress?c=await s?.balanceOf(e):c=await a.getBalance(e);const r=c;return r<=0n?null:{token:n,balance:r}}catch{return null}},I=async(a,e)=>{const n=e.nftTokenType===f.TokenType.ERC721,o=new T.ethers.Contract(e.erc20TokenAddress,n?p.ERC721ABI:p.ERC1155ABI,a),{tokenIds:c}=e;if(!c?.length)return null;const s=await Promise.all(c.map(async r=>{try{const t=await o[n?"tokenURI":"uri"](r),u=t.startsWith("ipfs://")?w.getFormattedIpfsUrl(t,!1):t,g=n?u:u.replace("{id}",r);if(g){const i=await q.httpClient.get(g);return i?.image?.startsWith("ipfs://")&&(i.image=w.getFormattedIpfsUrl(i.image,!1)),{image:i.image,tokenId:Number(r),name:i.name}}return{tokenId:Number(r)}}catch{return{tokenId:Number(r)}}}));return{token:e,balance:c?.length?BigInt(c.length):0n,nfts:s}},v=async(a,e,n)=>{const o=n??P.getErc20TokensForChain(a),c=b.createCustomRpcProvider(a);return(await Promise.all(o.map(async r=>P.isNFTToken(r)?I(c,r):R(c,e,r)))).filter(r=>r!==null)},F=async(a,e,n)=>{try{const o=b.createCustomRpcProvider(a),c=new T.ethers.Contract(n,m.ERC20ABI,o);let s;return n!==f.zeroAddress?s=await c?.balanceOf(e):s=await o.getBalance(e),s}catch{return C.Logger.error(`Failed to fetch public balance for address ${e}`),null}},E=async(a,e)=>{try{if(y.isSolanaLike(a)){if(!B.isValidSolanaPublicKey(e))return 0;const{fetchRpcUrl:o}=y.networkRegistry[a];return o?(await new l.Connection(o).getSignaturesForAddress(new l.PublicKey(e))).length:0}return B.isValidSolanaPublicKey(e)?0:await b.createCustomRpcProvider(a).getTransactionCount(e)}catch(n){return C.Logger.error(`Failed to fetch transaction count for address ${e} on chain ${a}`,n),0}},N=async(a,e,n)=>{const c=y.networkRegistry[a].fetchRpcUrl??"",s=b.createCustomSolanaConnection(c);return(await Promise.all(n.map(async t=>{if(P.isNFTToken(t))return{token:t,balance:1n,nfts:[{image:t.logoURI,tokenId:0,name:t.symbol}]};if(t.erc20TokenAddress===f.solanaNativeAddress){const k=BigInt(await s.getBalance(new l.PublicKey(e)));return{token:t,balance:k}}const u=new l.PublicKey(t.erc20TokenAddress),g=new l.PublicKey(e),i=await d.getAssociatedTokenAddress(u,g,!0,t.is2022Program?d.TOKEN_2022_PROGRAM_ID:d.TOKEN_PROGRAM_ID);if(!await s.getAccountInfo(i))return{token:t,balance:0n};const A=await s.getTokenAccountBalance(i),h=BigInt(A.value.amount);return{token:t,balance:h}}))).filter(t=>t.balance>0n)};exports.getPublicBalance=R;exports.getPublicBalanceByTokenAddress=F;exports.getPublicBalancesOfTokens=v;exports.getPublicTransactionCount=E;exports.getSolanaPublicBalances=N;
|
|
@@ -3,5 +3,5 @@ import { ERC20Token, TokenBalance } from '../../types/token.types';
|
|
|
3
3
|
export declare const getPublicBalance: (provider: ethers.JsonRpcProvider, ethereumAddress: string, token: ERC20Token) => Promise<TokenBalance | null>;
|
|
4
4
|
export declare const getPublicBalancesOfTokens: (chainId: number, ethereumAddress: string, tokens?: ERC20Token[]) => Promise<TokenBalance[]>;
|
|
5
5
|
export declare const getPublicBalanceByTokenAddress: (chainId: number, ethereumAddress: string, tokenAddress: string) => Promise<bigint | null>;
|
|
6
|
-
export declare const getPublicTransactionCount: (chainId: number,
|
|
6
|
+
export declare const getPublicTransactionCount: (chainId: number, address: string) => Promise<number>;
|
|
7
7
|
export declare const getSolanaPublicBalances: (chainId: number, ethereumAddress: string, tokensToUpdate: ERC20Token[]) => Promise<TokenBalance[]>;
|
|
@@ -1,42 +1,38 @@
|
|
|
1
1
|
import { ethers as m } from "ethers";
|
|
2
|
-
import { networkRegistry as
|
|
3
|
-
import { zeroAddress as
|
|
4
|
-
import { getErc20TokensForChain as
|
|
5
|
-
import { ERC20ABI as
|
|
6
|
-
import { Logger as
|
|
7
|
-
import { ERC721ABI as
|
|
2
|
+
import { isSolanaLike as P, networkRegistry as w } from "../../constants/chains.constants.mjs";
|
|
3
|
+
import { zeroAddress as y, solanaNativeAddress as h, TokenType as I } from "../../constants/protocol.constants.mjs";
|
|
4
|
+
import { getErc20TokensForChain as k, isNFTToken as B } from "./erc20tokenFunctions.mjs";
|
|
5
|
+
import { ERC20ABI as T } from "../../externalABIs/swapAbi.mjs";
|
|
6
|
+
import { Logger as d } from "../../error-handling/logger.mjs";
|
|
7
|
+
import { ERC721ABI as E, ERC1155ABI as N } from "../../externalABIs/index.mjs";
|
|
8
8
|
import { getFormattedIpfsUrl as p } from "./ipfs.mjs";
|
|
9
|
-
import {
|
|
10
|
-
import { httpClient as
|
|
9
|
+
import { createCustomRpcProvider as g, createCustomSolanaConnection as U } from "./create-provider.mjs";
|
|
10
|
+
import { httpClient as F } from "../../data-structures/http/HttpClient.mjs";
|
|
11
11
|
import "axios";
|
|
12
|
-
import { PublicKey as
|
|
13
|
-
import { getAssociatedTokenAddress as v, TOKEN_2022_PROGRAM_ID as
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (!t)
|
|
17
|
-
throw new Error(`No RPC URL configured for chain ${n}`);
|
|
18
|
-
return U(t);
|
|
19
|
-
}, _ = async (n, t, a) => {
|
|
12
|
+
import { Connection as O, PublicKey as f } from "@solana/web3.js";
|
|
13
|
+
import { getAssociatedTokenAddress as v, TOKEN_2022_PROGRAM_ID as S, TOKEN_PROGRAM_ID as _ } from "@solana/spl-token";
|
|
14
|
+
import { isValidSolanaPublicKey as b } from "./addresses.mjs";
|
|
15
|
+
const K = async (a, t, n) => {
|
|
20
16
|
try {
|
|
21
|
-
const s =
|
|
17
|
+
const s = n.erc20TokenAddress;
|
|
22
18
|
let r;
|
|
23
|
-
const o = new m.Contract(
|
|
24
|
-
s !==
|
|
19
|
+
const o = new m.Contract(n.erc20TokenAddress, T, a);
|
|
20
|
+
s !== y ? r = await o?.balanceOf(t) : r = await a.getBalance(t);
|
|
25
21
|
const c = r;
|
|
26
|
-
return c <= 0n ? null : { token:
|
|
22
|
+
return c <= 0n ? null : { token: n, balance: c };
|
|
27
23
|
} catch {
|
|
28
24
|
return null;
|
|
29
25
|
}
|
|
30
|
-
},
|
|
31
|
-
const
|
|
26
|
+
}, D = async (a, t) => {
|
|
27
|
+
const n = t.nftTokenType === I.ERC721, s = new m.Contract(t.erc20TokenAddress, n ? E : N, a), { tokenIds: r } = t;
|
|
32
28
|
if (!r?.length)
|
|
33
29
|
return null;
|
|
34
30
|
const o = await Promise.all(
|
|
35
31
|
r.map(async (c) => {
|
|
36
32
|
try {
|
|
37
|
-
const e = await s[
|
|
38
|
-
if (
|
|
39
|
-
const i = await
|
|
33
|
+
const e = await s[n ? "tokenURI" : "uri"](c), l = e.startsWith("ipfs://") ? p(e, !1) : e, u = n ? l : l.replace("{id}", c);
|
|
34
|
+
if (u) {
|
|
35
|
+
const i = await F.get(u);
|
|
40
36
|
return i?.image?.startsWith("ipfs://") && (i.image = p(i.image, !1)), { image: i.image, tokenId: Number(c), name: i.name };
|
|
41
37
|
}
|
|
42
38
|
return { tokenId: Number(c) };
|
|
@@ -50,56 +46,62 @@ const g = (n) => {
|
|
|
50
46
|
balance: r?.length ? BigInt(r.length) : 0n,
|
|
51
47
|
nfts: o
|
|
52
48
|
};
|
|
53
|
-
},
|
|
54
|
-
const s =
|
|
49
|
+
}, Z = async (a, t, n) => {
|
|
50
|
+
const s = n ?? k(a), r = g(a);
|
|
55
51
|
return (await Promise.all(
|
|
56
|
-
s.map(async (c) =>
|
|
52
|
+
s.map(async (c) => B(c) ? D(r, c) : K(r, t, c))
|
|
57
53
|
)).filter((c) => c !== null);
|
|
58
|
-
},
|
|
54
|
+
}, tt = async (a, t, n) => {
|
|
59
55
|
try {
|
|
60
|
-
const s = g(
|
|
56
|
+
const s = g(a), r = new m.Contract(n, T, s);
|
|
61
57
|
let o;
|
|
62
|
-
return
|
|
58
|
+
return n !== y ? o = await r?.balanceOf(t) : o = await s.getBalance(t), o;
|
|
63
59
|
} catch {
|
|
64
|
-
return
|
|
60
|
+
return d.error(`Failed to fetch public balance for address ${t}`), null;
|
|
65
61
|
}
|
|
66
|
-
},
|
|
62
|
+
}, nt = async (a, t) => {
|
|
67
63
|
try {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
64
|
+
if (P(a)) {
|
|
65
|
+
if (!b(t))
|
|
66
|
+
return 0;
|
|
67
|
+
const { fetchRpcUrl: s } = w[a];
|
|
68
|
+
return s ? (await new O(s).getSignaturesForAddress(new f(t))).length : 0;
|
|
69
|
+
}
|
|
70
|
+
return b(t) ? 0 : await g(a).getTransactionCount(t);
|
|
71
|
+
} catch (n) {
|
|
72
|
+
return d.error(`Failed to fetch transaction count for address ${t} on chain ${a}`, n), 0;
|
|
71
73
|
}
|
|
72
|
-
},
|
|
73
|
-
const r =
|
|
74
|
+
}, et = async (a, t, n) => {
|
|
75
|
+
const r = w[a].fetchRpcUrl ?? "", o = U(r);
|
|
74
76
|
return (await Promise.all(
|
|
75
|
-
|
|
76
|
-
if (
|
|
77
|
+
n.map(async (e) => {
|
|
78
|
+
if (B(e))
|
|
77
79
|
return {
|
|
78
80
|
token: e,
|
|
79
81
|
balance: 1n,
|
|
80
82
|
nfts: [{ image: e.logoURI, tokenId: 0, name: e.symbol }]
|
|
81
83
|
};
|
|
82
|
-
if (e.erc20TokenAddress ===
|
|
83
|
-
const
|
|
84
|
-
return { token: e, balance:
|
|
84
|
+
if (e.erc20TokenAddress === h) {
|
|
85
|
+
const A = BigInt(await o.getBalance(new f(t)));
|
|
86
|
+
return { token: e, balance: A };
|
|
85
87
|
}
|
|
86
|
-
const l = new
|
|
88
|
+
const l = new f(e.erc20TokenAddress), u = new f(t), i = await v(
|
|
87
89
|
l,
|
|
88
|
-
|
|
90
|
+
u,
|
|
89
91
|
!0,
|
|
90
|
-
e.is2022Program ?
|
|
92
|
+
e.is2022Program ? S : _
|
|
91
93
|
);
|
|
92
94
|
if (!await o.getAccountInfo(i))
|
|
93
95
|
return { token: e, balance: 0n };
|
|
94
|
-
const
|
|
95
|
-
return { token: e, balance:
|
|
96
|
+
const C = await o.getTokenAccountBalance(i), R = BigInt(C.value.amount);
|
|
97
|
+
return { token: e, balance: R };
|
|
96
98
|
})
|
|
97
99
|
)).filter((e) => e.balance > 0n);
|
|
98
100
|
};
|
|
99
101
|
export {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
K as getPublicBalance,
|
|
103
|
+
tt as getPublicBalanceByTokenAddress,
|
|
104
|
+
Z as getPublicBalancesOfTokens,
|
|
105
|
+
nt as getPublicTransactionCount,
|
|
106
|
+
et as getSolanaPublicBalances
|
|
105
107
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=t=>({...t,amount:t.amount.toString(),randomization:t.randomization?.toString()}),n=t=>({...t,amount:BigInt(t.amount),randomization:t.randomization?BigInt(t.randomization):void 0});exports.deserializeUtxoConstructorParams=n;exports.serializeUtxoConstructorParams=o;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { IUtxoConstructor } from '../../data-structures/utxo/Utxo';
|
|
2
|
+
export declare const serializeUtxoConstructorParams: (params: IUtxoConstructor<bigint>) => IUtxoConstructor<string>;
|
|
3
|
+
export declare const deserializeUtxoConstructorParams: (params: IUtxoConstructor<string>) => IUtxoConstructor<bigint>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const t = (o) => ({
|
|
2
|
+
...o,
|
|
3
|
+
amount: o.amount.toString(),
|
|
4
|
+
randomization: o.randomization?.toString()
|
|
5
|
+
}), n = (o) => ({
|
|
6
|
+
...o,
|
|
7
|
+
amount: BigInt(o.amount),
|
|
8
|
+
randomization: o.randomization ? BigInt(o.randomization) : void 0
|
|
9
|
+
});
|
|
10
|
+
export {
|
|
11
|
+
n as deserializeUtxoConstructorParams,
|
|
12
|
+
t as serializeUtxoConstructorParams
|
|
13
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../constants/chains.constants.cjs");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../constants/chains.constants.cjs");function o(t){return t?.toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.substring(1)).join(" ")}function i(t){return t.charAt(0).toUpperCase()+t.slice(1)}function c(t){return!t||t===null||Array.isArray(t)&&t.length===0?!0:Object.keys(t).length===0&&t.constructor===Object}const l=t=>{t.startsWith("0x")&&(t=t.slice(2));const e=[];for(let s=0;s<t.length;s+=2){const n=parseInt(t.slice(s,s+2),16);e.push(n)}return new TextDecoder("utf-8").decode(new Uint8Array(e))},u=(t,e)=>{const r=`${t}-${e}`;return a.isSolanaLike(e)||a.isTronLike(e)?r:r.toLowerCase()},p=(t,e,r=!1)=>{const s=`${t}-${e}`;if(r){const{hinkalAddress:n}=a.networkRegistry[e].contractData;return`${s}-${n}`.toLowerCase()}return s.toLowerCase()},f=t=>{const[,e]=t.split("-");return Number(e)},g=t=>{const[e]=t.split("-");return e},y=(t,e,r)=>{if(!e||!r)throw Error("oldPart and newPart must be provided");return t.toLowerCase().split(e.toLowerCase()).join(r.toLowerCase())},d=t=>!t||t.trim().length===0?null:t.toLowerCase().replace(/\b\w/g,e=>e.toUpperCase()),C=t=>t?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t):!1;exports.capitalizeFirstLetter=i;exports.capitalizeName=d;exports.getAddressFromStateKey=g;exports.getChainIdFromStateKey=f;exports.getStateKey=p;exports.getTokenStateKey=u;exports.hexToUtf8=l;exports.isNullOrEmpty=c;exports.replaceAllInstances=y;exports.toTitleCase=o;exports.validateEmail=C;
|
|
@@ -7,8 +7,10 @@ export declare function capitalizeFirstLetter(str: string): string;
|
|
|
7
7
|
/** Returns true if a value is null, undefined, or an empty object, array (length 0), or string (e.g. '') */
|
|
8
8
|
export declare function isNullOrEmpty(obj: unknown): boolean;
|
|
9
9
|
export declare const hexToUtf8: (hex: string) => string;
|
|
10
|
+
export declare const getTokenStateKey: (address: string, chainId: number) => string;
|
|
10
11
|
export declare const getStateKey: (address: string, chainId: number, withHinkalContractAddress?: boolean) => string;
|
|
11
12
|
export declare const getChainIdFromStateKey: (stateKey: string) => number;
|
|
13
|
+
export declare const getAddressFromStateKey: (stateKey: string) => string;
|
|
12
14
|
export declare const replaceAllInstances: (text: string, oldPart: string, newPart: string) => string;
|
|
13
15
|
export declare const capitalizeName: (name: string | undefined | null) => string | null;
|
|
14
16
|
export declare const validateEmail: (email: string | undefined | null) => boolean;
|
|
@@ -1,44 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function
|
|
1
|
+
import { isSolanaLike as o, isTronLike as i, networkRegistry as a } from "../../constants/chains.constants.mjs";
|
|
2
|
+
function u(t) {
|
|
3
3
|
return t?.toLowerCase().split(" ").map((e) => e.charAt(0).toUpperCase() + e.substring(1)).join(" ");
|
|
4
4
|
}
|
|
5
|
-
function
|
|
5
|
+
function l(t) {
|
|
6
6
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function f(t) {
|
|
9
9
|
return !t || t === null || Array.isArray(t) && t.length === 0 ? !0 : Object.keys(t).length === 0 && t.constructor === Object;
|
|
10
10
|
}
|
|
11
|
-
const
|
|
11
|
+
const p = (t) => {
|
|
12
12
|
t.startsWith("0x") && (t = t.slice(2));
|
|
13
13
|
const e = [];
|
|
14
|
-
for (let
|
|
15
|
-
const
|
|
16
|
-
e.push(
|
|
14
|
+
for (let s = 0; s < t.length; s += 2) {
|
|
15
|
+
const n = parseInt(t.slice(s, s + 2), 16);
|
|
16
|
+
e.push(n);
|
|
17
17
|
}
|
|
18
18
|
return new TextDecoder("utf-8").decode(new Uint8Array(e));
|
|
19
|
-
},
|
|
19
|
+
}, g = (t, e) => {
|
|
20
20
|
const r = `${t}-${e}`;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
return o(e) || i(e) ? r : r.toLowerCase();
|
|
22
|
+
}, y = (t, e, r = !1) => {
|
|
23
|
+
const s = `${t}-${e}`;
|
|
24
|
+
if (r) {
|
|
25
|
+
const { hinkalAddress: n } = a[e].contractData;
|
|
26
|
+
return `${s}-${n}`.toLowerCase();
|
|
24
27
|
}
|
|
25
|
-
return
|
|
26
|
-
},
|
|
28
|
+
return s.toLowerCase();
|
|
29
|
+
}, w = (t) => {
|
|
27
30
|
const [, e] = t.split("-");
|
|
28
31
|
return Number(e);
|
|
29
|
-
},
|
|
30
|
-
|
|
32
|
+
}, C = (t) => {
|
|
33
|
+
const [e] = t.split("-");
|
|
34
|
+
return e;
|
|
35
|
+
}, d = (t, e, r) => {
|
|
36
|
+
if (!e || !r)
|
|
31
37
|
throw Error("oldPart and newPart must be provided");
|
|
32
|
-
return t.toLowerCase().split(e.toLowerCase()).join(
|
|
33
|
-
},
|
|
38
|
+
return t.toLowerCase().split(e.toLowerCase()).join(r.toLowerCase());
|
|
39
|
+
}, L = (t) => !t || t.trim().length === 0 ? null : t.toLowerCase().replace(/\b\w/g, (e) => e.toUpperCase()), m = (t) => t ? /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t) : !1;
|
|
34
40
|
export {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
l as capitalizeFirstLetter,
|
|
42
|
+
L as capitalizeName,
|
|
43
|
+
C as getAddressFromStateKey,
|
|
44
|
+
w as getChainIdFromStateKey,
|
|
45
|
+
y as getStateKey,
|
|
46
|
+
g as getTokenStateKey,
|
|
47
|
+
p as hexToUtf8,
|
|
48
|
+
f as isNullOrEmpty,
|
|
49
|
+
d as replaceAllInstances,
|
|
50
|
+
u as toTitleCase,
|
|
51
|
+
m as validateEmail
|
|
44
52
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=(e=1e3)=>new Promise(t=>{setTimeout(()=>{t(void 0)},e)}),i=()=>Math.floor(Date.now()/1e3),T=e=>new Date(e).toISOString(),o=()=>{const e=new Date,t=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),6,0,0,0));return e<t?new Date(t.setUTCDate(t.getUTCDate()-1)):t},u=()=>{const e=o(),t=new Date(e);return t.setUTCDate(t.getUTCDate()-6),t},r=()=>{const e=o(),a=(e.getUTCDay()+6)%7,n=new Date(e);return n.setUTCDate(e.getUTCDate()-a),n.setUTCHours(6,0,0,0),n},U=()=>{const e=r();return e.setUTCDate(e.getUTCDate()-7),e},C=()=>{const e=new Date,t=new Date(e);return t.setUTCHours(6,0,0,0),t<=e&&t.setUTCDate(t.getUTCDate()+1),t.getTime()-e.getTime()},m=()=>{const e=new Date,t=new Date(e);return t.setUTCHours(8,0,0,0),t<=e&&t.setUTCDate(t.getUTCDate()+1),t.getTime()-e.getTime()},y=()=>{const e=new Date,t=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),6,0,0,0));return e<t&&t.setUTCDate(t.getUTCDate()-1),t},S=()=>{const e=new Date,t=new Date(e);return t.setUTCHours(6,0,0,0),t<=e&&t.setUTCDate(t.getUTCDate()+1),t.toISOString()},f=e=>{const n=new Date().getFullYear()===e.getFullYear()?{month:"long",day:"numeric"}:{month:"long",day:"numeric",year:"numeric"};return e.toLocaleDateString(void 0,n)},w=e=>{try{const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const a=t.getDate(),n=t.getFullYear(),s=t.toLocaleString("en-US",{month:"short"}),c=String(t.getHours()).padStart(2,"0"),g=String(t.getMinutes()).padStart(2,"0");return`${
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=(e=1e3)=>new Promise(t=>{setTimeout(()=>{t(void 0)},e)}),i=()=>Math.floor(Date.now()/1e3),T=e=>new Date(e).toISOString(),o=()=>{const e=new Date,t=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),6,0,0,0));return e<t?new Date(t.setUTCDate(t.getUTCDate()-1)):t},u=()=>{const e=o(),t=new Date(e);return t.setUTCDate(t.getUTCDate()-6),t},r=()=>{const e=o(),a=(e.getUTCDay()+6)%7,n=new Date(e);return n.setUTCDate(e.getUTCDate()-a),n.setUTCHours(6,0,0,0),n},U=()=>{const e=r();return e.setUTCDate(e.getUTCDate()-7),e},C=()=>{const e=new Date,t=new Date(e);return t.setUTCHours(6,0,0,0),t<=e&&t.setUTCDate(t.getUTCDate()+1),t.getTime()-e.getTime()},m=()=>{const e=new Date,t=new Date(e);return t.setUTCHours(8,0,0,0),t<=e&&t.setUTCDate(t.getUTCDate()+1),t.getTime()-e.getTime()},y=()=>{const e=new Date,t=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),6,0,0,0));return e<t&&t.setUTCDate(t.getUTCDate()-1),t},S=()=>{const e=new Date,t=new Date(e);return t.setUTCHours(6,0,0,0),t<=e&&t.setUTCDate(t.getUTCDate()+1),t.toISOString()},f=e=>{const n=new Date().getFullYear()===e.getFullYear()?{month:"long",day:"numeric"}:{month:"long",day:"numeric",year:"numeric"};return e.toLocaleDateString(void 0,n)},w=e=>{try{const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const a=t.getDate(),n=t.getFullYear(),s=t.toLocaleString("en-US",{month:"short"}),c=String(t.getHours()).padStart(2,"0"),g=String(t.getMinutes()).padStart(2,"0");return`${s} ${a}, ${n}, ${c}:${g}`}catch{return""}};exports.formatDate=f;exports.formatTxTimestamp=w;exports.getCurrentDayStart=y;exports.getCurrentTimeInSeconds=i;exports.getCurrentWeekStart=r;exports.getDelayUntilUtc8=m;exports.getEffectiveSevenDaysAgo=u;exports.getEffectiveToday=o;exports.getNextDayDelay=C;exports.getNextDayISO=S;exports.getPreviousWeekStart=U;exports.msToISOString=T;exports.waitLittle=D;
|
|
@@ -35,7 +35,7 @@ const g = (e = 1e3) => new Promise((t) => {
|
|
|
35
35
|
if (Number.isNaN(t.getTime()))
|
|
36
36
|
return "";
|
|
37
37
|
const o = t.getDate(), n = t.getFullYear(), s = t.toLocaleString("en-US", { month: "short" }), r = String(t.getHours()).padStart(2, "0"), c = String(t.getMinutes()).padStart(2, "0");
|
|
38
|
-
return `${
|
|
38
|
+
return `${s} ${o}, ${n}, ${r}:${c}`;
|
|
39
39
|
} catch {
|
|
40
40
|
return "";
|
|
41
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../API/API.cjs"),i=require("../../error-handling/error-codes.constants.cjs"),c=require("./caseInsensitive.utils.cjs"),l=async(n,e)=>{const t=await s.API.tokensInfoCall(n,e),a=[];return t.forEach((r,o)=>{(!r||!r.balanceStorageOffset||!r.allowanceStorageOffset)&&a.push(e[o])}),a},d=n=>{if(n.length===0)throw new Error("Token array cannot be empty");const e=n.map(r=>r.chainId),t=e[0];if(!e.every(r=>r===t))throw new Error(i.transactionErrorCodes.TOKENS_DO_NOT_BELONG_SAME_CHAIN);return t},h=(n,e)=>!n||!e?!1:c.caseInsensitiveEqual(n.erc20TokenAddress,e.erc20TokenAddress)&&n.chainId===e.chainId;exports.checkTokensForShielding=l;exports.isSameERC20Token=h;exports.validateAndGetChainId=d;
|
|
@@ -1 +1,4 @@
|
|
|
1
|
+
import { ERC20Token } from '../../types/token.types';
|
|
1
2
|
export declare const checkTokensForShielding: (chainId: number, erc20Addresses: string[]) => Promise<string[]>;
|
|
3
|
+
export declare const validateAndGetChainId: (tokens: ERC20Token[]) => number;
|
|
4
|
+
export declare const isSameERC20Token: (a?: ERC20Token, b?: ERC20Token) => boolean;
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
import { API as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { API as i } from "../../API/API.mjs";
|
|
2
|
+
import { transactionErrorCodes as s } from "../../error-handling/error-codes.constants.mjs";
|
|
3
|
+
import { caseInsensitiveEqual as c } from "./caseInsensitive.utils.mjs";
|
|
4
|
+
const d = async (e, n) => {
|
|
5
|
+
const o = await i.tokensInfoCall(e, n), a = [];
|
|
6
|
+
return o.forEach((r, t) => {
|
|
7
|
+
(!r || !r.balanceStorageOffset || !r.allowanceStorageOffset) && a.push(n[t]);
|
|
6
8
|
}), a;
|
|
7
|
-
}
|
|
9
|
+
}, m = (e) => {
|
|
10
|
+
if (e.length === 0)
|
|
11
|
+
throw new Error("Token array cannot be empty");
|
|
12
|
+
const n = e.map((r) => r.chainId), o = n[0];
|
|
13
|
+
if (!n.every((r) => r === o))
|
|
14
|
+
throw new Error(s.TOKENS_DO_NOT_BELONG_SAME_CHAIN);
|
|
15
|
+
return o;
|
|
16
|
+
}, E = (e, n) => !e || !n ? !1 : c(e.erc20TokenAddress, n.erc20TokenAddress) && e.chainId === n.chainId;
|
|
8
17
|
export {
|
|
9
|
-
|
|
18
|
+
d as checkTokensForShielding,
|
|
19
|
+
E as isSameERC20Token,
|
|
20
|
+
m as validateAndGetChainId
|
|
10
21
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("ethers"),I=require("../snarkjs/constant.cjs"),v=require("../../data-structures/http/HttpClient.cjs"),h=require("../../constants/chains.constants.cjs"),a=require("tronweb"),C=["https://nile.trongrid.io","https://api.shasta.trongrid.io"],W=e=>{const t=e.toLowerCase();return C.some(r=>t.includes(r))?h.chainIds.tronNile:h.chainIds.tronMainnet},w=(e,t)=>{const n=h.networkRegistry[e].fetchRpcUrl,r=t?new a.TronWeb({fullHost:n,privateKey:t}):new a.TronWeb({fullHost:n});return t||r.setAddress("T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb"),r},y=e=>e?.startsWith("T")?e:a.TronWeb.address.fromHex(e),A=e=>{if(e.startsWith("0x"))return e;if(e.startsWith("41"))return e.replace("41","0x");if(e.startsWith("T"))return A(a.TronWeb.address.toHex(e));throw new Error("Failed to convert address to hex format")},S=e=>{const t=e[0].map(BigInt),n=e[1][0].map(BigInt),r=e[1][1].map(BigInt),s=e[2].map(BigInt),o=e[3].map(BigInt),i=[[n[1],n[0]],[r[1],r[0]]];return{a:t,b:i,c:s,publicSignals:o}},T=(e,t)=>{const n=p.ethers.AbiCoder.defaultAbiCoder().encode(["uint16","uint16","uint16","uint256"],[e.tokenNumber,e.nullifierAmount,e.outputAmount,t]);return BigInt(p.ethers.keccak256(n))},f=async(e,t,n,r,s,o)=>{const i=T(s,o),d=e.map(String),g=n.map(String),u=r.map(String),l=[t[0].map(String),t[1].map(String)],b={a:d,b:l,c:g,inputs:u,verifier_id:String(i)},H=await v.httpClient.post(`${I.ENCLAVE_EC2_URL}/sign-proof`,b),{v:c,r:k,s:x}=p.ethers.Signature.from(H.signature.trim());return{v:c,r:k,s:x}},B=e=>[e.rootHashHinkal,e.erc20TokenAddresses,e.tokenIds,e.amountChanges,e.onChainCreation,e.slippageValues,e.inputNullifiers,e.outCommitments,e.encryptedOutputs,[e.feeStructure.feeToken,e.feeStructure.flatFee,e.feeStructure.variableRate],e.timeStamp,[e.stealthAddressStructure.extraRandomization,e.stealthAddressStructure.stealthAddress,e.stealthAddressStructure.H0,e.stealthAddressStructure.H1],e.rootHashAccessToken,e.calldataHash,e.publicSignalCount,e.relay,e.externalAddress,e.externalActionId,e.externalActionMetadata,[e.hinkalLogicArgs.hinkalLogicAction,e.hinkalLogicArgs.inHinkalAddress,e.hinkalLogicArgs.executeApprovalChanges,e.hinkalLogicArgs.doPreTxApproval,e.hinkalLogicArgs.useApprovalUtxoData.map(t=>[t.approvalChanges,t.externalApprovalAddresses,t.conversionInHinkalAddress])],[e.hookData.preHookContract,e.hookData.hookContract,e.hookData.preHookMetadata,e.hookData.postHookMetadata],[e.signatureData.v,e.signatureData.r,e.signatureData.s,e.signatureData.accessKey,e.signatureData.nonce,e.signatureData.ethereumAddress],e.originalSender],L=async(e,t,n,r,s=!0)=>{if(e){const{a:o,b:i,c:d,publicSignals:g}=S(t),u=await f(o,i,d,g,n,BigInt(r.externalActionId)),l={v:u.v,r:u.r,s:u.s};return s&&(t[1]=[[t[1][0][1],t[1][0][0]],[t[1][1][1],t[1][1][0]]]),l}};exports.addressToHexFormat=A;exports.circomDataToArray=B;exports.createTronWeb=w;exports.detectTronChainIdFromHost=W;exports.evmHexToTronBase58Address=y;exports.generateProofSignatureRemotely=f;exports.getVerifierId=T;exports.parseZkCalldata=S;exports.reorderZkCallData=L;
|