@hinkal/common 0.2.18 → 0.2.20
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 +14 -14
- package/API/API.mjs +92 -93
- package/API/admin-calls.cjs +1 -1
- package/API/admin-calls.d.ts +1 -1
- package/API/admin-calls.mjs +4 -4
- 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 +6 -3
- 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/enclaveCalls.cjs +1 -1
- package/API/enclaveCalls.mjs +5 -4
- package/API/fetchCommitmentsCache.cjs +1 -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/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/index.d.ts +1 -3
- package/API/is-tx-stateless.cjs +1 -1
- package/API/is-tx-stateless.d.ts +1 -1
- package/API/is-tx-stateless.mjs +10 -12
- 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/proxyAccountsCalls.cjs +1 -1
- package/API/proxyAccountsCalls.d.ts +7 -2
- package/API/proxyAccountsCalls.mjs +27 -21
- package/API/relayCalls.cjs +1 -1
- package/API/relayCalls.mjs +4 -4
- package/API/scheduled-transactions-calls.cjs +1 -1
- package/API/scheduled-transactions-calls.d.ts +1 -1
- package/API/scheduled-transactions-calls.mjs +4 -4
- 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/solana-calls.cjs +1 -1
- package/API/solana-calls.d.ts +6 -3
- package/API/solana-calls.mjs +15 -15
- package/API/temporaryWalletCalls.cjs +1 -0
- package/API/temporaryWalletCalls.d.ts +13 -0
- package/API/temporaryWalletCalls.mjs +20 -0
- package/API/token-calls.cjs +1 -1
- package/API/token-calls.mjs +6 -5
- package/API/unspent-utxos-calls.cjs +1 -1
- package/API/unspent-utxos-calls.d.ts +2 -2
- package/API/unspent-utxos-calls.mjs +17 -18
- package/README.md +239 -64
- package/constants/addresses.constants.cjs +1 -1
- package/constants/addresses.constants.d.ts +0 -1
- package/constants/addresses.constants.mjs +7 -8
- package/constants/chains.constants.cjs +1 -1
- package/constants/chains.constants.d.ts +1 -6
- package/constants/chains.constants.mjs +63 -50
- package/constants/coingecko.constants.cjs +1 -1
- package/constants/coingecko.constants.d.ts +1 -0
- package/constants/coingecko.constants.mjs +11 -10
- package/constants/contracts.constants.cjs +1 -1
- package/constants/contracts.constants.mjs +34 -41
- package/constants/deploy-data/deploy-data-solana.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-solana.json.mjs +28 -2
- 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/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 +1 -0
- package/constants/mediaUrls.constants.mjs +2 -1
- package/constants/mystery-boxes.constants.d.ts +0 -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/server.constants.cjs +1 -1
- package/constants/server.constants.d.ts +20 -123
- package/constants/server.constants.mjs +39 -142
- package/constants/token-data/ethMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/ethMainnetRegistry.json.mjs +0 -24
- package/constants/token-data/ethMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/ethMainnetRegistryFixed.json.mjs +0 -24
- package/constants/token-data/index.d.ts +32 -88
- package/constants/token-data/localhostRegistry.json.cjs +1 -1
- package/constants/token-data/localhostRegistry.json.mjs +0 -26
- package/constants/token-data/polygonRegistry.json.cjs +1 -1
- package/constants/token-data/polygonRegistry.json.mjs +4 -4
- package/constants/token-data/polygonRegistryFixed.json.cjs +1 -1
- package/constants/token-data/polygonRegistryFixed.json.mjs +4 -4
- package/constants/token-data/popularTokens.constants.cjs +1 -1
- package/constants/token-data/popularTokens.constants.mjs +0 -1
- package/data-structures/AccountActions/AccountActions.cjs +1 -0
- package/data-structures/AccountActions/AccountActions.d.ts +18 -0
- package/data-structures/AccountActions/AccountActions.mjs +78 -0
- package/data-structures/AccountActions/index.d.ts +1 -0
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.cjs +1 -1
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.mjs +68 -71
- package/data-structures/BlockchainEvent/BlockchainEvent.cjs +1 -0
- package/data-structures/BlockchainEvent/BlockchainEvent.d.ts +14 -0
- package/data-structures/BlockchainEvent/BlockchainEvent.mjs +41 -0
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.d.ts +45 -54
- package/data-structures/Hinkal/Hinkal.mjs +314 -341
- package/data-structures/Hinkal/IHinkal.d.ts +40 -52
- package/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
- package/data-structures/Hinkal/handleAutoDepositBack.d.ts +1 -1
- package/data-structures/Hinkal/handleAutoDepositBack.mjs +49 -50
- package/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionReceive.mjs +29 -24
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.cjs +1 -1
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +20 -20
- package/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalDeposit.mjs +87 -85
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +78 -169
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.cjs +1 -0
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.d.ts +4 -0
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.mjs +103 -0
- package/data-structures/Hinkal/hinkalDepostAndBridge.cjs +1 -0
- package/data-structures/Hinkal/hinkalDepostAndBridge.d.ts +4 -0
- package/data-structures/Hinkal/hinkalDepostAndBridge.mjs +214 -0
- package/data-structures/Hinkal/hinkalGetZkMeProvider.cjs +1 -1
- package/data-structures/Hinkal/hinkalGetZkMeProvider.mjs +4 -5
- package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
- package/data-structures/Hinkal/hinkalPrivateWallet.d.ts +2 -2
- package/data-structures/Hinkal/hinkalPrivateWallet.mjs +113 -117
- package/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalProoflessDeposit.mjs +36 -34
- package/data-structures/Hinkal/hinkalProxySwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalProxySwap.mjs +40 -36
- package/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -1
- package/data-structures/Hinkal/hinkalProxyToPrivate.mjs +37 -32
- 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/hinkalSolanaDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDeposit.d.ts +4 -3
- package/data-structures/Hinkal/hinkalSolanaDeposit.mjs +84 -95
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +2 -1
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +157 -155
- package/data-structures/Hinkal/hinkalSolanaProxySend.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySend.d.ts +2 -3
- package/data-structures/Hinkal/hinkalSolanaProxySend.mjs +43 -40
- package/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +71 -67
- package/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySwap.d.ts +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +63 -59
- package/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaSwap.d.ts +1 -1
- package/data-structures/Hinkal/hinkalSolanaSwap.mjs +81 -77
- package/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaTransfer.mjs +49 -48
- package/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaWithdraw.d.ts +2 -1
- package/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +71 -68
- package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSwap.mjs +71 -79
- package/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalTransfer.mjs +72 -71
- package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdraw.mjs +81 -79
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +108 -108
- package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.d.ts +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.mjs +107 -53
- package/data-structures/IndexedDB/activity-db.cjs +1 -1
- package/data-structures/IndexedDB/activity-db.d.ts +1 -0
- package/data-structures/IndexedDB/activity-db.mjs +92 -76
- package/data-structures/IndexedDB/balances-db.cjs +1 -1
- package/data-structures/IndexedDB/balances-db.mjs +40 -37
- package/data-structures/IndexedDB/contact-db.cjs +1 -1
- package/data-structures/IndexedDB/contact-db.mjs +18 -15
- package/data-structures/IndexedDB/signatures-db.cjs +1 -1
- package/data-structures/IndexedDB/signatures-db.mjs +25 -40
- package/data-structures/PublicBalance/PublicBalanceWatcher.cjs +1 -0
- package/data-structures/PublicBalance/PublicBalanceWatcher.d.ts +20 -0
- package/data-structures/PublicBalance/PublicBalanceWatcher.mjs +124 -0
- package/data-structures/PublicBalance/SolanaPublicBalancerWatcher.cjs +1 -0
- package/data-structures/PublicBalance/SolanaPublicBalancerWatcher.d.ts +15 -0
- package/data-structures/PublicBalance/SolanaPublicBalancerWatcher.mjs +64 -0
- package/data-structures/PublicBalance/index.d.ts +2 -0
- package/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/EventsPublicTokensDB.mjs +83 -85
- 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/encryptDecryptUtxo.cjs +1 -1
- package/data-structures/crypto-keys/encryptDecryptUtxo.d.ts +1 -1
- package/data-structures/crypto-keys/encryptDecryptUtxo.mjs +14 -14
- package/data-structures/crypto-keys/keys.cjs +1 -1
- package/data-structures/crypto-keys/keys.d.ts +0 -11
- package/data-structures/crypto-keys/keys.mjs +47 -107
- 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 +3 -2
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.mjs +6 -6
- 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 +19 -19
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.d.ts +3 -3
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.mjs +6 -5
- package/data-structures/event-service/evm/AbstractSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractSnapshotService.d.ts +1 -2
- package/data-structures/event-service/evm/AbstractSnapshotService.mjs +3 -4
- package/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/evm/BlockchainEventEmitter.d.ts +10 -5
- package/data-structures/event-service/evm/BlockchainEventEmitter.mjs +39 -35
- 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 +21 -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 +11 -0
- package/data-structures/event-service/helpers/ClientEventHelper.mjs +26 -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 +4 -3
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.mjs +8 -8
- package/data-structures/event-service/solana/AbstractSolanaEventService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaEventService.d.ts +4 -10
- package/data-structures/event-service/solana/AbstractSolanaEventService.mjs +10 -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 +1 -1
- 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 +22 -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 +11 -16
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.mjs +64 -66
- package/data-structures/index.d.ts +3 -0
- package/data-structures/provider-adapter/IProviderAdapter.d.ts +8 -13
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.mjs +6 -4
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.mjs +6 -4
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.mjs +6 -4
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.mjs +6 -4
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.mjs +6 -4
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.mjs +5 -4
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.mjs +6 -4
- package/data-structures/utxo/Utxo.cjs +1 -1
- package/data-structures/utxo/Utxo.d.ts +2 -7
- package/data-structures/utxo/Utxo.mjs +40 -36
- package/error-handling/error-codes.constants.cjs +1 -1
- package/error-handling/error-codes.constants.d.ts +1 -0
- package/error-handling/error-codes.constants.mjs +4 -3
- package/error-handling/get-error.message.cjs +1 -1
- package/error-handling/get-error.message.mjs +21 -27
- package/error-handling/index.d.ts +0 -1
- package/functions/index.d.ts +0 -1
- package/functions/kyc/zkMeHelper.cjs +1 -1
- package/functions/kyc/zkMeHelper.mjs +18 -17
- 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/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/getFlatFees.cjs +1 -1
- package/functions/pre-transaction/getFlatFees.mjs +22 -30
- package/functions/pre-transaction/getSolanaCalldataHash.cjs +1 -1
- package/functions/pre-transaction/getSolanaCalldataHash.mjs +22 -22
- package/functions/pre-transaction/getVolatileTransferAmount.cjs +1 -1
- package/functions/pre-transaction/getVolatileTransferAmount.mjs +21 -36
- 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.mjs +53 -50
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs +1 -1
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.d.ts +1 -1
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs +4 -4
- package/functions/pre-transaction/solana-public-signals.cjs +1 -1
- package/functions/pre-transaction/solana-public-signals.d.ts +1 -0
- package/functions/pre-transaction/solana-public-signals.mjs +29 -26
- package/functions/pre-transaction/solana.cjs +1 -1
- package/functions/pre-transaction/solana.d.ts +2 -1
- package/functions/pre-transaction/solana.mjs +89 -80
- package/functions/private-wallet/emporium.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.helpers.d.ts +4 -5
- package/functions/private-wallet/emporium.helpers.mjs +94 -109
- 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 +100 -102
- package/functions/snarkjs/common.snarkjs.cjs +1 -1
- package/functions/snarkjs/common.snarkjs.d.ts +1 -1
- package/functions/snarkjs/common.snarkjs.mjs +64 -64
- package/functions/snarkjs/constructEmporiumProof.cjs +1 -1
- package/functions/snarkjs/constructEmporiumProof.d.ts +1 -2
- package/functions/snarkjs/constructEmporiumProof.mjs +89 -89
- package/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
- package/functions/snarkjs/constructGeneralZkProof.d.ts +1 -2
- package/functions/snarkjs/constructGeneralZkProof.mjs +117 -121
- package/functions/snarkjs/constructSolanaZkProof.cjs +1 -1
- package/functions/snarkjs/constructSolanaZkProof.d.ts +1 -1
- package/functions/snarkjs/constructSolanaZkProof.mjs +58 -59
- package/functions/snarkjs/fetchMerkleTreeSiblings.cjs +1 -1
- package/functions/snarkjs/fetchMerkleTreeSiblings.mjs +11 -10
- package/functions/utils/addresses.cjs +1 -1
- package/functions/utils/addresses.d.ts +1 -0
- package/functions/utils/addresses.mjs +13 -12
- package/functions/utils/bytes32.utils.cjs +1 -1
- package/functions/utils/bytes32.utils.mjs +8 -7
- 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 +13 -9
- package/functions/utils/erc20tokenFunctions.cjs +1 -1
- package/functions/utils/erc20tokenFunctions.d.ts +0 -1
- package/functions/utils/erc20tokenFunctions.mjs +22 -29
- package/functions/utils/getUtxosFromReceipt.utils.cjs +1 -1
- package/functions/utils/getUtxosFromReceipt.utils.d.ts +1 -1
- package/functions/utils/getUtxosFromReceipt.utils.mjs +11 -11
- package/functions/utils/index.d.ts +0 -1
- 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/nftTokenFunctions.cjs +1 -1
- package/functions/utils/nftTokenFunctions.mjs +8 -23
- package/functions/utils/prepareHinkal.cjs +1 -1
- package/functions/utils/prepareHinkal.d.ts +6 -13
- package/functions/utils/prepareHinkal.mjs +45 -72
- package/functions/utils/publicBalance.utils.cjs +1 -1
- package/functions/utils/publicBalance.utils.mjs +49 -54
- package/functions/utils/socket.utils.cjs +1 -0
- package/functions/utils/socket.utils.d.ts +1 -0
- package/functions/utils/socket.utils.mjs +12 -0
- package/functions/utils/string.utils.cjs +1 -1
- package/functions/utils/string.utils.d.ts +1 -0
- package/functions/utils/string.utils.mjs +18 -14
- 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/upToDateState.cjs +1 -1
- package/functions/utils/upToDateState.d.ts +1 -1
- package/functions/utils/upToDateState.mjs +4 -4
- 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/crypto.cjs +1 -0
- package/functions/web3/crypto.d.ts +1 -0
- package/functions/web3/crypto.mjs +7 -0
- 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 +107 -112
- package/functions/web3/events/getShieldedBalance.cjs +2 -2
- package/functions/web3/events/getShieldedBalance.d.ts +1 -1
- package/functions/web3/events/getShieldedBalance.mjs +71 -70
- package/functions/web3/events/getTransactionLogEvents.cjs +1 -1
- package/functions/web3/events/getTransactionLogEvents.mjs +38 -38
- package/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -1
- package/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +13 -10
- package/functions/web3/functionCalls/accessTokenCalls.cjs +1 -1
- package/functions/web3/functionCalls/accessTokenCalls.d.ts +1 -6
- package/functions/web3/functionCalls/accessTokenCalls.mjs +12 -21
- package/functions/web3/functionCalls/approveToken.cjs +1 -1
- package/functions/web3/functionCalls/approveToken.d.ts +1 -1
- package/functions/web3/functionCalls/approveToken.mjs +50 -46
- 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/estimateGasRelayer.cjs +1 -1
- package/functions/web3/functionCalls/estimateGasRelayer.d.ts +1 -2
- package/functions/web3/functionCalls/estimateGasRelayer.mjs +10 -10
- package/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
- package/functions/web3/functionCalls/transactCallDirect.d.ts +1 -1
- package/functions/web3/functionCalls/transactCallDirect.mjs +36 -40
- package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.d.ts +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.mjs +36 -34
- package/functions/web3/getContractMetadata.cjs +1 -1
- package/functions/web3/getContractMetadata.mjs +17 -22
- package/functions/web3/getPublicAddressBalance.cjs +1 -1
- package/functions/web3/getPublicAddressBalance.d.ts +1 -1
- package/functions/web3/getPublicAddressBalance.mjs +6 -6
- package/functions/web3/getTokenHolder.cjs +1 -1
- package/functions/web3/getTokenHolder.mjs +27 -27
- package/functions/web3/index.d.ts +1 -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 +6 -19
- package/functions/web3/okxAPI.cjs +1 -1
- package/functions/web3/okxAPI.mjs +22 -22
- package/functions/web3/oneInchAPI.cjs +1 -1
- package/functions/web3/oneInchAPI.mjs +7 -20
- package/functions/web3/runContractFunction.cjs +1 -1
- package/functions/web3/runContractFunction.mjs +38 -56
- package/functions/web3/uniswapAPI.cjs +1 -1
- package/functions/web3/uniswapAPI.mjs +22 -34
- package/index.cjs +1 -1
- package/index.mjs +941 -949
- package/package.json +3 -2
- package/providers/EthersProviderAdapter.cjs +1 -1
- package/providers/EthersProviderAdapter.d.ts +10 -17
- package/providers/EthersProviderAdapter.mjs +45 -76
- package/providers/SolanaProviderAdapter.cjs +1 -1
- package/providers/SolanaProviderAdapter.d.ts +7 -11
- package/providers/SolanaProviderAdapter.mjs +16 -31
- package/providers/WagmiProviderAdapter.cjs +1 -1
- package/providers/WagmiProviderAdapter.d.ts +11 -17
- package/providers/WagmiProviderAdapter.mjs +86 -117
- package/providers/prepareEthersHinkal.cjs +1 -1
- package/providers/prepareEthersHinkal.mjs +15 -9
- package/providers/prepareWagmiHinkal.cjs +1 -1
- package/providers/prepareWagmiHinkal.mjs +16 -9
- package/types/TransactionSimulator.types.d.ts +2 -9
- package/types/activities.types.d.ts +2 -0
- package/types/admin.types.cjs +1 -1
- package/types/admin.types.d.ts +0 -6
- package/types/admin.types.mjs +2 -2
- package/types/balances.types.d.ts +0 -1
- package/types/bridging-tx.types.d.ts +17 -0
- package/types/cache.types.cjs +1 -1
- package/types/cache.types.d.ts +6 -3
- package/types/cache.types.mjs +1 -1
- package/types/coingecko.types.d.ts +5 -0
- package/types/ethereum-network.types.cjs +1 -1
- package/types/ethereum-network.types.d.ts +2 -8
- package/types/ethereum-network.types.mjs +1 -1
- package/types/events.types.cjs +1 -0
- package/types/events.types.d.ts +9 -0
- package/types/events.types.mjs +5 -0
- package/types/external-action.types.cjs +1 -1
- package/types/external-action.types.d.ts +0 -1
- package/types/external-action.types.mjs +1 -1
- package/types/hinkal.types.cjs +1 -1
- package/types/hinkal.types.d.ts +1 -7
- package/types/hinkal.types.mjs +22 -23
- package/types/index.d.ts +3 -3
- package/types/onramp.types.cjs +1 -0
- package/types/onramp.types.d.ts +58 -0
- package/types/onramp.types.mjs +4 -0
- package/types/proxy.types.d.ts +11 -3
- package/types/sandbox.types.cjs +1 -1
- package/types/sandbox.types.d.ts +10 -39
- package/types/sandbox.types.mjs +2 -2
- package/types/session.types.d.ts +2 -0
- package/types/solana.types.d.ts +9 -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/token.types.d.ts +5 -0
- package/types/transactions.types.cjs +1 -1
- package/types/transactions.types.d.ts +2 -4
- package/types/transactions.types.mjs +3 -3
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.mjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLauncher.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLauncher.mjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.mjs +2 -2
- 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/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/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/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/hinkalActionStake.d.ts +0 -3
- package/data-structures/Hinkal/hinkalApprove.cjs +0 -1
- package/data-structures/Hinkal/hinkalApprove.d.ts +0 -3
- package/data-structures/Hinkal/hinkalApprove.mjs +0 -115
- package/data-structures/Hinkal/hinkalInsideTransact.cjs +0 -1
- package/data-structures/Hinkal/hinkalInsideTransact.d.ts +0 -4
- package/data-structures/Hinkal/hinkalInsideTransact.mjs +0 -121
- 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/staking/index.cjs +0 -1
- package/functions/staking/index.d.ts +0 -11
- package/functions/staking/index.mjs +0 -42
- 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/inHinkalApprovalCalls.cjs +0 -1
- package/functions/web3/functionCalls/inHinkalApprovalCalls.d.ts +0 -5
- package/functions/web3/functionCalls/inHinkalApprovalCalls.mjs +0 -32
- package/types/bridging.types.d.ts +0 -29
- package/types/duneAPI.types.d.ts +0 -9
- package/types/hinkal.stake.types.cjs +0 -1
- package/types/hinkal.stake.types.d.ts +0 -11
- package/types/hinkal.stake.types.mjs +0 -4
|
@@ -1,40 +1,25 @@
|
|
|
1
|
-
import { NFT_TRANSACTION_TYPES as
|
|
1
|
+
import { NFT_TRANSACTION_TYPES as c } from "../../constants/protocol.constants.mjs";
|
|
2
2
|
import "../../error-handling/error-codes.constants.mjs";
|
|
3
3
|
import "ethers";
|
|
4
4
|
import "../../types/circom-data.types.mjs";
|
|
5
5
|
import "../../types/transactions.types.mjs";
|
|
6
6
|
import "../../types/activities.types.mjs";
|
|
7
|
-
import "../../constants/server.constants.mjs";
|
|
8
|
-
import "../../API/getServerURL.mjs";
|
|
9
|
-
import "../../data-structures/http/HttpClient.mjs";
|
|
10
|
-
import "axios";
|
|
11
|
-
import "../../constants/chains.constants.mjs";
|
|
12
|
-
import "circomlibjs-hinkal-fork";
|
|
13
|
-
import "libsodium-wrappers";
|
|
14
|
-
import "process";
|
|
15
|
-
import "buffer";
|
|
16
7
|
import "../../constants/vite.constants.mjs";
|
|
17
|
-
import "../../
|
|
18
|
-
|
|
19
|
-
import "./mutexes.utils.mjs";
|
|
20
|
-
import "@coral-xyz/anchor";
|
|
21
|
-
import { Logger as e } from "../../error-handling/logger.mjs";
|
|
22
|
-
import "@solana/web3.js";
|
|
23
|
-
import "../../data-structures/crypto-keys/keys.mjs";
|
|
24
|
-
const y = (m) => {
|
|
8
|
+
import { Logger as n } from "../../error-handling/logger.mjs";
|
|
9
|
+
const g = (s) => {
|
|
25
10
|
const t = {};
|
|
26
|
-
return
|
|
27
|
-
if (
|
|
11
|
+
return s.forEach(({ assetInfo: o, id: e }) => {
|
|
12
|
+
if (c.includes(o.standard) && e)
|
|
28
13
|
try {
|
|
29
14
|
if (o?.contractAddress) {
|
|
30
15
|
const r = o.contractAddress.toLowerCase();
|
|
31
|
-
t[r] || (t[r] = []), t[r].push(BigInt(
|
|
16
|
+
t[r] || (t[r] = []), t[r].push(BigInt(e).toString());
|
|
32
17
|
}
|
|
33
18
|
} catch (r) {
|
|
34
|
-
|
|
19
|
+
n.error(`Failed to parse tokenId: ${e}`, r);
|
|
35
20
|
}
|
|
36
21
|
}), t;
|
|
37
22
|
};
|
|
38
23
|
export {
|
|
39
|
-
|
|
24
|
+
g as extractTokenIdsFromAssetChanges
|
|
40
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("ethers"),v=require("@solana/web3.js"),s=require("../../crypto/preProcessing.cjs"),l=require("../../providers/EthersProviderAdapter.cjs"),n=require("../../constants/chains.constants.cjs"),i=require("./create-provider.cjs"),S=require("../../providers/SolanaProviderAdapter.cjs"),y=e=>{const r=i.createCustomRpcProvider(n.chainIds.ethMainnet);return new p.ethers.Wallet(e,r)},u=e=>{const r=i.createCustomRpcProvider(n.chainIds.ethMainnet);return new p.ethers.VoidSigner(e,r)},h=async(e,r)=>{await s.preProcessing();const t=l.default();t.initSigner?.(r),await e.initProviderAdapter(void 0,t),await e.initUserKeys()},o=async(e,r)=>{const t=l.default(),a=u(r);t.initSigner?.(a),await e.initProviderAdapter(void 0,t)},w=e=>{const r=e.userKeys.getDerivedSolanaPublicKey();return{publicKey:new v.PublicKey(r),signTransaction:()=>{throw new Error("Void wallet cannot sign transactions")},signAllTransactions:()=>{throw new Error("Void wallet cannot sign transactions")},signMessage:()=>{throw new Error("Void wallet cannot sign messages")}}},c=async(e,r)=>{const t=n.chainIds.solanaMainnet,a=n.networkRegistry[t].fetchRpcUrl;if(!a)throw new Error("RPC URL not found for the specified chain ID");const g=i.createCustomSolanaConnection(a),d=w(e),P=new S.SolanaProviderAdapter(g,t,d,r);await e.initProviderAdapter(d,P)},A=async(e,r,t)=>{await s.preProcessing(),await e.initUserKeysWithPassword(t);const a=e.userKeys.getDerivedSolanaPublicKey();await c(e,a),await o(e,r)},K=async(e,r)=>{await s.preProcessing(),await e.initUserKeysFromSeedPhrases(r);const t=e.userKeys.getDerivedSolanaPublicKey();await c(e,t);const a=e.userKeys.getDerivedEthereumAddress();await o(e,a)};exports.createSigner=y;exports.createVoidSigner=u;exports.createVoidSolanaWallet=w;exports.prepareEthersProviderAdapter=o;exports.prepareHinkal=h;exports.prepareHinkalFromSeedPhrases=K;exports.prepareHinkalWithSignature=A;exports.prepareSolanaProviderAdapter=c;
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
import { ethers } from 'ethers';
|
|
2
2
|
import { IHinkal } from '../../data-structures/Hinkal/IHinkal';
|
|
3
|
-
import { UserKeys } from '../../data-structures/crypto-keys/keys';
|
|
4
3
|
import { SolanaWallet } from '../../types/solana.types';
|
|
5
|
-
export declare const createSigner: (privateKey: string
|
|
6
|
-
export declare const createVoidSigner: (address: string
|
|
4
|
+
export declare const createSigner: (privateKey: string) => ethers.Wallet;
|
|
5
|
+
export declare const createVoidSigner: (address: string) => ethers.VoidSigner;
|
|
7
6
|
export declare const prepareHinkal: (hinkal: IHinkal, signer: ethers.Wallet) => Promise<void>;
|
|
8
|
-
export declare const prepareEthersProviderAdapter: (hinkal: IHinkal,
|
|
9
|
-
export declare const prepareHinkalWithSignature: (hinkal: IHinkal, address: string, chainId: number, signature: string) => Promise<void>;
|
|
10
|
-
export declare const prepareToAccessNewWallet: (hinkal: IHinkal, privateKey: string) => Promise<{
|
|
11
|
-
userKeys: UserKeys;
|
|
12
|
-
signer: ethers.Wallet;
|
|
13
|
-
}>;
|
|
14
|
-
export declare const prepareToAccessNewWalletWithSignature: (hinkal: IHinkal, address: string, signature: string) => Promise<UserKeys>;
|
|
7
|
+
export declare const prepareEthersProviderAdapter: (hinkal: IHinkal, ethereumAddress: string) => Promise<void>;
|
|
15
8
|
export declare const createVoidSolanaWallet: (hinkal: IHinkal) => SolanaWallet;
|
|
16
|
-
export declare const prepareSolanaProviderAdapter: (hinkal: IHinkal,
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const
|
|
9
|
+
export declare const prepareSolanaProviderAdapter: (hinkal: IHinkal, ethereumAddress: string) => Promise<void>;
|
|
10
|
+
export declare const prepareHinkalWithSignature: (hinkal: IHinkal, ethereumAddress: string, signature: string) => Promise<void>;
|
|
11
|
+
export declare const prepareHinkalFromSeedPhrases: (hinkal: IHinkal, seedPhrases: string[]) => Promise<void>;
|
|
@@ -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
|
|
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 n } from "../../crypto/preProcessing.mjs";
|
|
4
|
+
import c from "../../providers/EthersProviderAdapter.mjs";
|
|
5
|
+
import { chainIds as a, networkRegistry as v } from "../../constants/chains.constants.mjs";
|
|
6
|
+
import { createCustomRpcProvider as d, createCustomSolanaConnection as u } 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 n();
|
|
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(), o = P(r);
|
|
20
|
+
t.initSigner?.(o), 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
|
|
62
|
-
if (!
|
|
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;
|
|
69
|
-
if (!n)
|
|
35
|
+
}, w = async (e, r) => {
|
|
36
|
+
const t = a.solanaMainnet, o = v[t].fetchRpcUrl;
|
|
37
|
+
if (!o)
|
|
70
38
|
throw new Error("RPC URL not found for the specified chain ID");
|
|
71
|
-
const
|
|
72
|
-
await
|
|
73
|
-
},
|
|
74
|
-
await
|
|
39
|
+
const l = u(o), i = A(e), g = new y(l, t, i, r);
|
|
40
|
+
await e.initProviderAdapter(i, g);
|
|
41
|
+
}, R = async (e, r, t) => {
|
|
42
|
+
await n(), await e.initUserKeysWithPassword(t);
|
|
43
|
+
const o = e.userKeys.getDerivedSolanaPublicKey();
|
|
44
|
+
await w(e, o), await p(e, r);
|
|
45
|
+
}, W = async (e, r) => {
|
|
46
|
+
await n(), await e.initUserKeysFromSeedPhrases(r);
|
|
47
|
+
const t = e.userKeys.getDerivedSolanaPublicKey();
|
|
48
|
+
await w(e, t);
|
|
49
|
+
const o = e.userKeys.getDerivedEthereumAddress();
|
|
50
|
+
await p(e, o);
|
|
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
|
+
w 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 p=require("ethers"),I=require("../../constants/chains.constants.cjs"),g=require("../../constants/protocol.constants.cjs"),B=require("./erc20tokenFunctions.cjs"),P=require("../../externalABIs/swapAbi.cjs"),m=require("../../error-handling/logger.cjs"),T=require("../../externalABIs/index.cjs"),y=require("./ipfs.cjs"),f=require("./create-provider.cjs"),h=require("../../data-structures/http/HttpClient.cjs");require("axios");const d=require("@solana/web3.js"),b=require("@solana/spl-token"),w=async(r,e,t)=>{try{const s=t.erc20TokenAddress;let a;const o=new p.ethers.Contract(t.erc20TokenAddress,P.ERC20ABI,r);s!==g.zeroAddress?a=await o?.balanceOf(e):a=await o.provider.getBalance(e);const c=a.toBigInt();return c<=0n?null:{token:t,balance:c}}catch{return null}},q=async(r,e)=>{const t=e.nftTokenType===g.TokenType.ERC721,s=new p.ethers.Contract(e.erc20TokenAddress,t?T.ERC721ABI:T.ERC1155ABI,r),{tokenIds:a}=e;if(!a?.length)return null;const o=await Promise.all(a.map(async c=>{try{const n=await s[t?"tokenURI":"uri"](c),l=n.startsWith("ipfs://")?y.getFormattedIpfsUrl(n,!1):n,u=t?l:l.replace("{id}",c);if(u){const i=await h.httpClient.get(u);return i?.image?.startsWith("ipfs://")&&(i.image=y.getFormattedIpfsUrl(i.image,!1)),{image:i.image,tokenId:Number(c),name:i.name}}return{tokenId:Number(c)}}catch{return{tokenId:Number(c)}}}));return{token:e,balance:a?.length?BigInt(a.length):0n,nfts:o}},k=async(r,e,t)=>{const s=t??B.getErc20TokensForChain(r),a=f.createCustomRpcProvider(r);return(await Promise.all(s.map(async c=>B.isNFTToken(c)?q(a,c):w(a,e,c)))).filter(c=>c!==null)},v=async(r,e,t)=>{try{const s=f.createCustomRpcProvider(r),a=new p.ethers.Contract(t,P.ERC20ABI,s);let o;return t!==g.zeroAddress?o=await a?.balanceOf(e):o=await s.getBalance(e),o.toBigInt()}catch{return m.Logger.error(`Failed to fetch public balance for address ${e}`),null}},E=async(r,e)=>{try{return await f.createCustomRpcProvider(r).getTransactionCount(e)}catch(t){return m.Logger.error(`Failed to fetch transaction count for address ${e} on chain ${r}`,t),null}},F=async(r,e,t)=>{const a=I.networkRegistry[r].fetchRpcUrl??"",o=f.createCustomSolanaConnection(a);return(await Promise.all(t.map(async n=>{if(B.isNFTToken(n))return{token:n,balance:1n,nfts:[{image:n.logoURI,tokenId:0,name:n.symbol}]};if(n.erc20TokenAddress===g.solanaNativeAddress){const A=BigInt(await o.getBalance(new d.PublicKey(e)));return{token:n,balance:A}}const l=new d.PublicKey(n.erc20TokenAddress),u=new d.PublicKey(e),i=await b.getAssociatedTokenAddress(l,u,!0,n.is2022Program?b.TOKEN_2022_PROGRAM_ID:b.TOKEN_PROGRAM_ID);if(!await o.getAccountInfo(i))return{token:n,balance:0n};const C=await o.getTokenAccountBalance(i),R=BigInt(C.value.amount);return{token:n,balance:R}}))).filter(n=>n.balance>0n)};exports.getPublicBalance=w;exports.getPublicBalanceByTokenAddress=v;exports.getPublicBalancesOfTokens=k;exports.getPublicTransactionCount=E;exports.getSolanaPublicBalances=F;
|
|
@@ -1,105 +1,100 @@
|
|
|
1
1
|
import { ethers as m } from "ethers";
|
|
2
|
-
import { networkRegistry as
|
|
3
|
-
import { zeroAddress as
|
|
4
|
-
import { getErc20TokensForChain as
|
|
2
|
+
import { networkRegistry as I } from "../../constants/chains.constants.mjs";
|
|
3
|
+
import { zeroAddress as d, solanaNativeAddress as R, TokenType as P } from "../../constants/protocol.constants.mjs";
|
|
4
|
+
import { getErc20TokensForChain as A, isNFTToken as b } from "./erc20tokenFunctions.mjs";
|
|
5
5
|
import { ERC20ABI as B } from "../../externalABIs/swapAbi.mjs";
|
|
6
|
-
import { Logger as
|
|
7
|
-
import { ERC721ABI as
|
|
6
|
+
import { Logger as w } from "../../error-handling/logger.mjs";
|
|
7
|
+
import { ERC721ABI as h, ERC1155ABI as v } 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 E } from "./create-provider.mjs";
|
|
10
|
+
import { httpClient as N } from "../../data-structures/http/HttpClient.mjs";
|
|
11
11
|
import "axios";
|
|
12
12
|
import { PublicKey as u } from "@solana/web3.js";
|
|
13
|
-
import { getAssociatedTokenAddress as k, TOKEN_2022_PROGRAM_ID as O, TOKEN_PROGRAM_ID as
|
|
14
|
-
const
|
|
15
|
-
const { fetchRpcUrl: t } = d[e];
|
|
16
|
-
if (!t)
|
|
17
|
-
throw new Error(`No RPC URL configured for chain ${e}`);
|
|
18
|
-
return N(t);
|
|
19
|
-
}, _ = async (e, t, n) => {
|
|
13
|
+
import { getAssociatedTokenAddress as k, TOKEN_2022_PROGRAM_ID as O, TOKEN_PROGRAM_ID as U } from "@solana/spl-token";
|
|
14
|
+
const F = async (c, t, n) => {
|
|
20
15
|
try {
|
|
21
16
|
const s = n.erc20TokenAddress;
|
|
22
|
-
let
|
|
23
|
-
const o = new m.Contract(n.erc20TokenAddress, B,
|
|
24
|
-
s !==
|
|
25
|
-
const
|
|
26
|
-
return
|
|
17
|
+
let e;
|
|
18
|
+
const o = new m.Contract(n.erc20TokenAddress, B, c);
|
|
19
|
+
s !== d ? e = await o?.balanceOf(t) : e = await o.provider.getBalance(t);
|
|
20
|
+
const r = e.toBigInt();
|
|
21
|
+
return r <= 0n ? null : { token: n, balance: r };
|
|
27
22
|
} catch {
|
|
28
23
|
return null;
|
|
29
24
|
}
|
|
30
|
-
},
|
|
31
|
-
const n = t.nftTokenType ===
|
|
32
|
-
if (!
|
|
25
|
+
}, _ = async (c, t) => {
|
|
26
|
+
const n = t.nftTokenType === P.ERC721, s = new m.Contract(t.erc20TokenAddress, n ? h : v, c), { tokenIds: e } = t;
|
|
27
|
+
if (!e?.length)
|
|
33
28
|
return null;
|
|
34
29
|
const o = await Promise.all(
|
|
35
|
-
|
|
30
|
+
e.map(async (r) => {
|
|
36
31
|
try {
|
|
37
|
-
const a = await s[n ? "tokenURI" : "uri"](
|
|
32
|
+
const a = await s[n ? "tokenURI" : "uri"](r), l = a.startsWith("ipfs://") ? p(a, !1) : a, f = n ? l : l.replace("{id}", r);
|
|
38
33
|
if (f) {
|
|
39
|
-
const i = await
|
|
40
|
-
return i?.image?.startsWith("ipfs://") && (i.image = p(i.image, !1)), { image: i.image, tokenId: Number(
|
|
34
|
+
const i = await N.get(f);
|
|
35
|
+
return i?.image?.startsWith("ipfs://") && (i.image = p(i.image, !1)), { image: i.image, tokenId: Number(r), name: i.name };
|
|
41
36
|
}
|
|
42
|
-
return { tokenId: Number(
|
|
37
|
+
return { tokenId: Number(r) };
|
|
43
38
|
} catch {
|
|
44
|
-
return { tokenId: Number(
|
|
39
|
+
return { tokenId: Number(r) };
|
|
45
40
|
}
|
|
46
41
|
})
|
|
47
42
|
);
|
|
48
43
|
return {
|
|
49
44
|
token: t,
|
|
50
|
-
balance:
|
|
45
|
+
balance: e?.length ? BigInt(e.length) : 0n,
|
|
51
46
|
nfts: o
|
|
52
47
|
};
|
|
53
|
-
},
|
|
54
|
-
const s = n ??
|
|
48
|
+
}, Q = async (c, t, n) => {
|
|
49
|
+
const s = n ?? A(c), e = g(c);
|
|
55
50
|
return (await Promise.all(
|
|
56
|
-
s.map(async (
|
|
57
|
-
)).filter((
|
|
58
|
-
},
|
|
51
|
+
s.map(async (r) => b(r) ? _(e, r) : F(e, t, r))
|
|
52
|
+
)).filter((r) => r !== null);
|
|
53
|
+
}, V = async (c, t, n) => {
|
|
59
54
|
try {
|
|
60
|
-
const s = g(
|
|
55
|
+
const s = g(c), e = new m.Contract(n, B, s);
|
|
61
56
|
let o;
|
|
62
|
-
return n !==
|
|
57
|
+
return n !== d ? o = await e?.balanceOf(t) : o = await s.getBalance(t), o.toBigInt();
|
|
63
58
|
} catch {
|
|
64
|
-
return
|
|
59
|
+
return w.error(`Failed to fetch public balance for address ${t}`), null;
|
|
65
60
|
}
|
|
66
|
-
},
|
|
61
|
+
}, X = async (c, t) => {
|
|
67
62
|
try {
|
|
68
|
-
return await g(
|
|
63
|
+
return await g(c).getTransactionCount(t);
|
|
69
64
|
} catch (n) {
|
|
70
|
-
return
|
|
65
|
+
return w.error(`Failed to fetch transaction count for address ${t} on chain ${c}`, n), null;
|
|
71
66
|
}
|
|
72
|
-
},
|
|
73
|
-
const
|
|
67
|
+
}, Y = async (c, t, n) => {
|
|
68
|
+
const e = I[c].fetchRpcUrl ?? "", o = E(e);
|
|
74
69
|
return (await Promise.all(
|
|
75
70
|
n.map(async (a) => {
|
|
76
|
-
if (
|
|
71
|
+
if (b(a))
|
|
77
72
|
return {
|
|
78
73
|
token: a,
|
|
79
74
|
balance: 1n,
|
|
80
75
|
nfts: [{ image: a.logoURI, tokenId: 0, name: a.symbol }]
|
|
81
76
|
};
|
|
82
|
-
if (a.erc20TokenAddress ===
|
|
83
|
-
const
|
|
84
|
-
return { token: a, balance:
|
|
77
|
+
if (a.erc20TokenAddress === R) {
|
|
78
|
+
const C = BigInt(await o.getBalance(new u(t)));
|
|
79
|
+
return { token: a, balance: C };
|
|
85
80
|
}
|
|
86
81
|
const l = new u(a.erc20TokenAddress), f = new u(t), i = await k(
|
|
87
82
|
l,
|
|
88
83
|
f,
|
|
89
84
|
!0,
|
|
90
|
-
a.is2022Program ? O :
|
|
85
|
+
a.is2022Program ? O : U
|
|
91
86
|
);
|
|
92
87
|
if (!await o.getAccountInfo(i))
|
|
93
88
|
return { token: a, balance: 0n };
|
|
94
|
-
const
|
|
95
|
-
return { token: a, balance:
|
|
89
|
+
const T = await o.getTokenAccountBalance(i), y = BigInt(T.value.amount);
|
|
90
|
+
return { token: a, balance: y };
|
|
96
91
|
})
|
|
97
92
|
)).filter((a) => a.balance > 0n);
|
|
98
93
|
};
|
|
99
94
|
export {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
95
|
+
F as getPublicBalance,
|
|
96
|
+
V as getPublicBalanceByTokenAddress,
|
|
97
|
+
Q as getPublicBalancesOfTokens,
|
|
98
|
+
X as getPublicTransactionCount,
|
|
99
|
+
Y as getSolanaPublicBalances
|
|
105
100
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../constants/server.constants.cjs"),r=require("../../API/getServerURL.cjs"),n=require("socket.io-client"),S=t=>{const o=`${r.SNAPSHOT_SERVER_URL.replace(e.SNAPSHOT_SERVER_URL_ENDPOINT,"")}${t}`;return n.io(o,{path:`${e.SNAPSHOT_SERVER_URL_ENDPOINT}/socket.io`})};exports.createSnapshotServerClientSocket=S;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const createSnapshotServerClientSocket: (namespace: string) => import("socket.io-client").Socket<import("@socket.io/component-emitter").DefaultEventsMap, import("@socket.io/component-emitter").DefaultEventsMap>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SNAPSHOT_SERVER_URL_ENDPOINT as o } from "../../constants/server.constants.mjs";
|
|
2
|
+
import { SNAPSHOT_SERVER_URL as e } from "../../API/getServerURL.mjs";
|
|
3
|
+
import { io as n } from "socket.io-client";
|
|
4
|
+
const s = (t) => {
|
|
5
|
+
const r = `${e.replace(o, "")}${t}`;
|
|
6
|
+
return n(r, {
|
|
7
|
+
path: `${o}/socket.io`
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
s as createSnapshotServerClientSocket
|
|
12
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../constants/chains.constants.cjs");function i(t){return t?.toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.substring(1)).join(" ")}function o(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 r=0;r<t.length;r+=2){const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../constants/chains.constants.cjs");function i(t){return t?.toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.substring(1)).join(" ")}function o(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 r=0;r<t.length;r+=2){const n=parseInt(t.slice(r,r+2),16);e.push(n)}return new TextDecoder("utf-8").decode(new Uint8Array(e))},u=(t,e,s=!1)=>{const r=`${t}-${e}`;if(s){const{hinkalAddress:n}=a.networkRegistry[e].contractData;return`${r}-${n}`.toLowerCase()}return r.toLowerCase()},p=t=>{const[,e]=t.split("-");return Number(e)},f=t=>{const[e]=t.split("-");return e},d=(t,e,s)=>{if(!e||!s)throw Error("oldPart and newPart must be provided");return t.toLowerCase().split(e.toLowerCase()).join(s.toLowerCase())},g=t=>!t||t.trim().length===0?null:t.toLowerCase().replace(/\b\w/g,e=>e.toUpperCase()),y=t=>t?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t):!1;exports.capitalizeFirstLetter=o;exports.capitalizeName=g;exports.getAddressFromStateKey=f;exports.getChainIdFromStateKey=p;exports.getStateKey=u;exports.hexToUtf8=l;exports.isNullOrEmpty=c;exports.replaceAllInstances=d;exports.toTitleCase=i;exports.validateEmail=y;
|
|
@@ -9,6 +9,7 @@ export declare function isNullOrEmpty(obj: unknown): boolean;
|
|
|
9
9
|
export declare const hexToUtf8: (hex: string) => string;
|
|
10
10
|
export declare const getStateKey: (address: string, chainId: number, withHinkalContractAddress?: boolean) => string;
|
|
11
11
|
export declare const getChainIdFromStateKey: (stateKey: string) => number;
|
|
12
|
+
export declare const getAddressFromStateKey: (stateKey: string) => string;
|
|
12
13
|
export declare const replaceAllInstances: (text: string, oldPart: string, newPart: string) => string;
|
|
13
14
|
export declare const capitalizeName: (name: string | undefined | null) => string | null;
|
|
14
15
|
export declare const validateEmail: (email: string | undefined | null) => boolean;
|
|
@@ -12,33 +12,37 @@ const l = (t) => {
|
|
|
12
12
|
t.startsWith("0x") && (t = t.slice(2));
|
|
13
13
|
const e = [];
|
|
14
14
|
for (let r = 0; r < t.length; r += 2) {
|
|
15
|
-
const
|
|
16
|
-
e.push(
|
|
15
|
+
const n = parseInt(t.slice(r, r + 2), 16);
|
|
16
|
+
e.push(n);
|
|
17
17
|
}
|
|
18
18
|
return new TextDecoder("utf-8").decode(new Uint8Array(e));
|
|
19
|
-
},
|
|
19
|
+
}, p = (t, e, s = !1) => {
|
|
20
20
|
const r = `${t}-${e}`;
|
|
21
|
-
if (
|
|
22
|
-
const { hinkalAddress:
|
|
23
|
-
return `${r}-${
|
|
21
|
+
if (s) {
|
|
22
|
+
const { hinkalAddress: n } = o[e].contractData;
|
|
23
|
+
return `${r}-${n}`.toLowerCase();
|
|
24
24
|
}
|
|
25
25
|
return r.toLowerCase();
|
|
26
|
-
},
|
|
26
|
+
}, f = (t) => {
|
|
27
27
|
const [, e] = t.split("-");
|
|
28
28
|
return Number(e);
|
|
29
|
-
},
|
|
30
|
-
|
|
29
|
+
}, d = (t) => {
|
|
30
|
+
const [e] = t.split("-");
|
|
31
|
+
return e;
|
|
32
|
+
}, g = (t, e, s) => {
|
|
33
|
+
if (!e || !s)
|
|
31
34
|
throw Error("oldPart and newPart must be provided");
|
|
32
|
-
return t.toLowerCase().split(e.toLowerCase()).join(
|
|
33
|
-
}, w = (t) => !t || t.trim().length === 0 ? null : t.toLowerCase().replace(/\b\w/g, (e) => e.toUpperCase()),
|
|
35
|
+
return t.toLowerCase().split(e.toLowerCase()).join(s.toLowerCase());
|
|
36
|
+
}, w = (t) => !t || t.trim().length === 0 ? null : t.toLowerCase().replace(/\b\w/g, (e) => e.toUpperCase()), y = (t) => t ? /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t) : !1;
|
|
34
37
|
export {
|
|
35
38
|
c as capitalizeFirstLetter,
|
|
36
39
|
w as capitalizeName,
|
|
37
|
-
|
|
38
|
-
f as
|
|
40
|
+
d as getAddressFromStateKey,
|
|
41
|
+
f as getChainIdFromStateKey,
|
|
42
|
+
p as getStateKey,
|
|
39
43
|
l as hexToUtf8,
|
|
40
44
|
u as isNullOrEmpty,
|
|
41
45
|
g as replaceAllInstances,
|
|
42
46
|
a as toTitleCase,
|
|
43
|
-
|
|
47
|
+
y as validateEmail
|
|
44
48
|
};
|
|
@@ -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
|
};
|
|
@@ -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("../../error-handling/error-codes.constants.cjs"),o=require("./caseInsensitive.utils.cjs"),n=async(e,t)=>{const r=await e.getEthereumAddress();if(!o.caseInsensitiveEqual(r,t))throw Error(s.transactionErrorCodes.ERROR_MESSAGE_CHAIN_ADDRESS_CHANGED);return!0};exports.checkAddressNotUpdated=n;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { IHinkal } from '../../data-structures/Hinkal/IHinkal';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const checkAddressNotUpdated: (hinkal: IHinkal, oldEthAddress: string) => Promise<boolean>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { transactionErrorCodes as s } from "../../error-handling/error-codes.constants.mjs";
|
|
2
2
|
import { caseInsensitiveEqual as o } from "./caseInsensitive.utils.mjs";
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
if (
|
|
3
|
+
const n = async (r, t) => {
|
|
4
|
+
const e = await r.getEthereumAddress();
|
|
5
|
+
if (!o(e, t))
|
|
6
6
|
throw Error(s.ERROR_MESSAGE_CHAIN_ADDRESS_CHANGED);
|
|
7
7
|
return !0;
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
|
-
|
|
10
|
+
n as checkAddressNotUpdated
|
|
11
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../web3/etherFunctions.cjs"),i=(r,t,e,c,u)=>{try{return!e||!r?!0:c?u?+r*u<=+t:!0:n.getAmountInWei(e,r)<=n.getAmountInWei(e,t)}catch{return!0}};exports.hasEnoughBalance=i;
|
|
@@ -1,17 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { SubAccount } from '../../types/proxy.types';
|
|
4
|
-
export declare const getNecessaryAssetsForFundingFromBalance: (tokenChanges: TokenChanges<bigint>[], subAccountBalances: TokenBalance[]) => {
|
|
5
|
-
fundAmounts: bigint[];
|
|
6
|
-
tokensToFund: ERC20Token[];
|
|
7
|
-
};
|
|
8
|
-
export declare const getNecessaryAssetsForFunding: (hinkal: IHinkal, subAccount: SubAccount, tokenChanges: TokenChanges<bigint>[]) => Promise<{
|
|
9
|
-
fundAmounts: bigint[];
|
|
10
|
-
tokensToFund: ERC20Token[];
|
|
11
|
-
approveTokenAddresses: string[];
|
|
12
|
-
approvedTokenAmounts: bigint[];
|
|
13
|
-
}>;
|
|
14
|
-
export declare const getNecessaryApprovalChangesData: (hinkal: IHinkal, tokenChanges: TokenChanges<bigint>[], to: string) => {
|
|
15
|
-
approvalChanges: bigint[];
|
|
16
|
-
};
|
|
17
|
-
export declare function hasEnoughBalance(tokenAmount: string, maxPossibleAmount: string, token?: ERC20Token, isDollarMode?: boolean, tokenPriceDollar?: number): boolean;
|
|
1
|
+
import { ERC20Token } from '../../types/token.types';
|
|
2
|
+
export declare const hasEnoughBalance: (tokenAmount: string, maxPossibleAmount: string, token: ERC20Token | undefined, isDollarMode: boolean, tokenPriceDollar: number | undefined) => boolean;
|