@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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../../constants/protocol.constants.cjs"),p=require("./approveToken.cjs"),T=async(t,s,c,a,o)=>{for(let e=0;e<o.length;e+=1){const n=o[e],r=a[e];n>0n&&r.erc20TokenAddress!==i.zeroAddress&&await p.approveTokenToHinkal(t,s,c,n,r)}};exports.approveTokensToHinkal=T;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ethers } from 'ethers';
|
|
2
2
|
import { IHinkal } from '../../../data-structures/Hinkal/IHinkal';
|
|
3
3
|
import { ERC20Token } from '../../../types/token.types';
|
|
4
|
-
export declare const approveTokensToHinkal: (hinkal: IHinkal, contractForApproval: ethers.Contract, tokensToApprove: ERC20Token[], amounts: bigint[]) => Promise<void>;
|
|
4
|
+
export declare const approveTokensToHinkal: (hinkal: IHinkal, chainId: number, contractForApproval: ethers.Contract, tokensToApprove: ERC20Token[], amounts: bigint[]) => Promise<void>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { zeroAddress as
|
|
2
|
-
import { approveTokenToHinkal as
|
|
3
|
-
const
|
|
1
|
+
import { zeroAddress as p } from "../../../constants/protocol.constants.mjs";
|
|
2
|
+
import { approveTokenToHinkal as a } from "./approveToken.mjs";
|
|
3
|
+
const d = async (t, s, c, i, r) => {
|
|
4
4
|
for (let o = 0; o < r.length; o += 1) {
|
|
5
|
-
const e = r[o], n =
|
|
6
|
-
e > 0n && n.erc20TokenAddress !==
|
|
5
|
+
const e = r[o], n = i[o];
|
|
6
|
+
e > 0n && n.erc20TokenAddress !== p && await a(t, s, c, e, n);
|
|
7
7
|
}
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
|
-
|
|
10
|
+
d as approveTokensToHinkal
|
|
11
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("ethers-v6h"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("ethers-v6h"),p=require("../../private-wallet/emporium.helpers.cjs"),i=require("../../../constants/chains.constants.cjs"),d=async(r,t,c,s,o)=>{const{hinkalAddress:h,hinkalABI:u}=i.networkRegistry[r].contractData,l=new a.ethers.JsonRpcProvider(i.networkRegistry[r].fetchRpcUrl),y=new a.ethers.Contract(h,u,l),m="transact";let e={from:s.relay};if(o){const n=p.recoverAuthorizationData(o);n&&(e={...e,authorizationList:[n],type:4})}return await y[m].estimateGas(t[0],t[1],t[2],c,s,e)};exports.estimateGasRelayer=d;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { IHinkal } from '../../../data-structures/Hinkal/IHinkal';
|
|
2
1
|
import { CircomDataBaseType, DimDataType } from '../../../types/circom-data.types';
|
|
3
2
|
import { NewZkCallDataType } from '../../../types/snark.types';
|
|
4
3
|
import { type AuthorizationData } from '../../../types/hinkal.types';
|
|
5
|
-
export declare const estimateGasRelayer: (
|
|
4
|
+
export declare const estimateGasRelayer: (chainId: number, newZkCallData: NewZkCallDataType, dimData: DimDataType, circomData: CircomDataBaseType, authorizationData?: AuthorizationData) => Promise<bigint>;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { ethers as
|
|
2
|
-
import { recoverAuthorizationData as
|
|
1
|
+
import { ethers as n } from "ethers-v6h";
|
|
2
|
+
import { recoverAuthorizationData as y } from "../../private-wallet/emporium.helpers.mjs";
|
|
3
3
|
import { networkRegistry as i } from "../../../constants/chains.constants.mjs";
|
|
4
|
-
const
|
|
5
|
-
const { hinkalAddress: m, hinkalABI:
|
|
6
|
-
let r = { from:
|
|
4
|
+
const g = async (o, t, c, e, s) => {
|
|
5
|
+
const { hinkalAddress: m, hinkalABI: p } = i[o].contractData, f = new n.JsonRpcProvider(i[o].fetchRpcUrl), h = new n.Contract(m, p, f), l = "transact";
|
|
6
|
+
let r = { from: e.relay };
|
|
7
7
|
if (s) {
|
|
8
|
-
const
|
|
9
|
-
|
|
8
|
+
const a = y(s);
|
|
9
|
+
a && (r = { ...r, authorizationList: [a], type: 4 });
|
|
10
10
|
}
|
|
11
|
-
return await
|
|
11
|
+
return await h[l].estimateGas(
|
|
12
12
|
t[0],
|
|
13
13
|
t[1],
|
|
14
14
|
t[2],
|
|
15
15
|
c,
|
|
16
|
-
|
|
16
|
+
e,
|
|
17
17
|
r
|
|
18
18
|
);
|
|
19
19
|
};
|
|
20
20
|
export {
|
|
21
|
-
|
|
21
|
+
g as estimateGasRelayer
|
|
22
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("../../../constants/protocol.constants.cjs"),F=require("../../../types/ethereum-network.types.cjs"),S=require("../../utils/time.utils.cjs"),_=require("./approveTokensToHinkal.cjs"),z=require("./constructBatchCall.cjs"),G=require("./recoverTransactionFromError.cjs"),L=async(o,r,i,d,s,v,A,q,B)=>{const n=Array.isArray(i)?i:[i],e=Array.isArray(d)?d:[d];if(n.length!==e.length)throw new Error("token and amount length mismatch");const g=o.getContractWithSigner(r,F.ContractType.HinkalContract),b=await o.getEthereumAddressByChain(r),T=q??g,a=B??g,y="transact",C=e.findIndex(({erc20TokenAddress:t})=>t===x.zeroAddress),H=e.some(({erc20TokenAddress:t})=>t!==x.zeroAddress),l=C===-1?0n:n[C],u=o.getProviderAdapter(r);if(H&&await u.supportsBatchCall?.(r)&&u.sendBatchCallsTransaction){const t=e.map(E=>E.erc20TokenAddress),h=z.buildApproveAndTransactCalls(t,n,T.address,a,s,A,v,l);return await u.sendBatchCallsTransaction(r,h)}await _.approveTokensToHinkal(o,r,T,e,n);const w={value:l>0n?BigInt(l).toString():void 0};let c;const f=[s[0],s[1],s[2],A,v,{...w,from:b}];try{c=(await a.estimateGas[y](...f)).toNumber()}catch(t){console.log("hinkalDeposit: gas estimation error",{err:t})}const k=c&&c>=0?Math.ceil(c*12/10):void 0;w.gasLimit=k,await S.waitLittle();let p;try{p=await a[y](...f)}catch(t){if(!t?.transactionHash)throw t;const{provider:h}=a,m=await G.recoverTransactionFromError(h,t.transactionHash);if(!m)throw t;p=m}return p};exports.transactCallDirect=L;
|
|
@@ -3,4 +3,4 @@ import { IHinkal } from '../../../data-structures/Hinkal/IHinkal';
|
|
|
3
3
|
import { CircomDataBaseType, DimDataType } from '../../../types/circom-data.types';
|
|
4
4
|
import { ERC20Token } from '../../../types/token.types';
|
|
5
5
|
import { NewZkCallDataType } from '../../../types/snark.types';
|
|
6
|
-
export declare const transactCallDirect: (hinkal: IHinkal, amount: bigint | bigint[], tokenToApprove: ERC20Token | ERC20Token[], newZkCallData: NewZkCallDataType, circomData: CircomDataBaseType, dimData: DimDataType, contractApproval?: ethers.Contract, contractTransaction?: ethers.Contract) => Promise<any>;
|
|
6
|
+
export declare const transactCallDirect: (hinkal: IHinkal, chainId: number, amount: bigint | bigint[], tokenToApprove: ERC20Token | ERC20Token[], newZkCallData: NewZkCallDataType, circomData: CircomDataBaseType, dimData: DimDataType, contractApproval?: ethers.Contract, contractTransaction?: ethers.Contract) => Promise<any>;
|
|
@@ -1,64 +1,60 @@
|
|
|
1
1
|
import { zeroAddress as x } from "../../../constants/protocol.constants.mjs";
|
|
2
|
-
import { ContractType as
|
|
3
|
-
import { waitLittle as
|
|
4
|
-
import { approveTokensToHinkal as
|
|
5
|
-
import { buildApproveAndTransactCalls as
|
|
6
|
-
import { recoverTransactionFromError as
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
if (
|
|
2
|
+
import { ContractType as L } from "../../../types/ethereum-network.types.mjs";
|
|
3
|
+
import { waitLittle as S } from "../../utils/time.utils.mjs";
|
|
4
|
+
import { approveTokensToHinkal as k } from "./approveTokensToHinkal.mjs";
|
|
5
|
+
import { buildApproveAndTransactCalls as z } from "./constructBatchCall.mjs";
|
|
6
|
+
import { recoverTransactionFromError as M } from "./recoverTransactionFromError.mjs";
|
|
7
|
+
const K = async (s, r, i, d, e, g, v, B, H) => {
|
|
8
|
+
const a = Array.isArray(i) ? i : [i], o = Array.isArray(d) ? d : [d];
|
|
9
|
+
if (a.length !== o.length)
|
|
10
10
|
throw new Error("token and amount length mismatch");
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
13
|
-
const t =
|
|
11
|
+
const f = s.getContractWithSigner(r, L.HinkalContract), b = await s.getEthereumAddressByChain(r), w = B ?? f, n = H ?? f, C = "transact", u = o.findIndex(({ erc20TokenAddress: t }) => t === x), E = o.some(({ erc20TokenAddress: t }) => t !== x), m = u === -1 ? 0n : a[u], l = s.getProviderAdapter(r);
|
|
12
|
+
if (E && await l.supportsBatchCall?.(r) && l.sendBatchCallsTransaction) {
|
|
13
|
+
const t = o.map((G) => G.erc20TokenAddress), h = z(
|
|
14
14
|
t,
|
|
15
|
-
n,
|
|
16
|
-
w.address,
|
|
17
|
-
r,
|
|
18
15
|
a,
|
|
19
|
-
|
|
16
|
+
w.address,
|
|
17
|
+
n,
|
|
18
|
+
e,
|
|
19
|
+
v,
|
|
20
20
|
g,
|
|
21
|
-
|
|
21
|
+
m
|
|
22
22
|
);
|
|
23
|
-
return await l.sendBatchCallsTransaction(h);
|
|
23
|
+
return await l.sendBatchCallsTransaction(r, h);
|
|
24
24
|
}
|
|
25
|
-
await
|
|
26
|
-
const
|
|
27
|
-
value:
|
|
25
|
+
await k(s, r, w, o, a);
|
|
26
|
+
const y = {
|
|
27
|
+
value: m > 0n ? BigInt(m).toString() : void 0
|
|
28
28
|
};
|
|
29
|
-
let
|
|
29
|
+
let c;
|
|
30
30
|
const T = [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
e[0],
|
|
32
|
+
e[1],
|
|
33
|
+
e[2],
|
|
34
|
+
v,
|
|
35
35
|
g,
|
|
36
|
-
{ ...
|
|
36
|
+
{ ...y, from: b }
|
|
37
37
|
];
|
|
38
38
|
try {
|
|
39
|
-
|
|
40
|
-
signerAddress: await r.signer.getAddress(),
|
|
41
|
-
chainIdHinkal: o.getCurrentChainId(),
|
|
42
|
-
ethersNetwork: await r.provider.getNetwork()
|
|
43
|
-
});
|
|
39
|
+
c = (await n.estimateGas[C](...T)).toNumber();
|
|
44
40
|
} catch (t) {
|
|
45
41
|
console.log("hinkalDeposit: gas estimation error", { err: t });
|
|
46
42
|
}
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
let
|
|
43
|
+
const F = c && c >= 0 ? Math.ceil(c * 12 / 10) : void 0;
|
|
44
|
+
y.gasLimit = F, await S();
|
|
45
|
+
let p;
|
|
50
46
|
try {
|
|
51
|
-
|
|
47
|
+
p = await n[C](...T);
|
|
52
48
|
} catch (t) {
|
|
53
49
|
if (!t?.transactionHash)
|
|
54
50
|
throw t;
|
|
55
|
-
const { provider: h } =
|
|
56
|
-
if (!
|
|
51
|
+
const { provider: h } = n, A = await M(h, t.transactionHash);
|
|
52
|
+
if (!A)
|
|
57
53
|
throw t;
|
|
58
|
-
|
|
54
|
+
p = A;
|
|
59
55
|
}
|
|
60
|
-
return
|
|
56
|
+
return p;
|
|
61
57
|
};
|
|
62
58
|
export {
|
|
63
|
-
|
|
59
|
+
K as transactCallDirect
|
|
64
60
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../../error-handling/error-codes.constants.cjs");require("ethers");const y=require("../../../error-handling/customErrors/ErrorWithTx.cjs");require("../../../types/circom-data.types.cjs");require("../../../types/transactions.types.cjs");require("../../../types/activities.types.cjs");
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../../error-handling/error-codes.constants.cjs");require("ethers");const y=require("../../../error-handling/customErrors/ErrorWithTx.cjs");require("../../../types/circom-data.types.cjs");require("../../../types/transactions.types.cjs");require("../../../types/activities.types.cjs");require("../../../constants/vite.constants.cjs");const u=require("../../../API/callRelayer.cjs");require("../../../constants/chains.constants.cjs");require("circomlibjs-hinkal-fork");require("../../../data-structures/crypto-keys/keys.cjs");const l=require("../../snarkjs/common.snarkjs.cjs");require("node-forge");require("libsodium-wrappers");const R=require("../../../data-structures/http/HttpClient.cjs");require("axios");require("../../../constants/token-data/index.cjs");require("idb-keyval");require("@solana/web3.js");require("../../utils/convertIntegrationProviderToExternalActionId.cjs");const C=require("../../../constants/server.constants.cjs"),w=require("../../../API/getServerURL.cjs");require("@coral-xyz/anchor");require("@solana/spl-token");require("ethers-v6h");require("tweetnacl");require("bs58");require("buffer");require("../../../constants/contracts.constants.cjs");require("../../../constants/kyc.constants.cjs");require("../../../constants/coingecko.constants.cjs");require("../../../constants/reorg-depths.constants.cjs");require("../../../constants/addresses.constants.cjs");require("../../../constants/token.limits.constants.cjs");require("../../../constants/presale.constants.cjs");require("../../../constants/activity.constants.cjs");require("../../../constants/tasks.constants.cjs");require("../../../constants/events.constants.cjs");require("../../utils/userAgent.cjs");require("multiformats");require("../../../API/enclaveCalls.cjs");require("async-mutex");require("process");require("../../../providers/EthersProviderAdapter.cjs");const q=r=>{if(r.status==="success")return r.message;throw r.message&&r.error?new y.ErrorWithRelayerTransaction(r.error,r.message):new Error(r.error)},D=async(r,a,t,i,c,s,o,e)=>{const n=l.serializeCircomData(i),h=await u.callRelayerTransactAPI({chainId:r,a:a[0],b:a[1],c:a[2],dimData:t,circomData:n,withPrivateMempool:c,withUniswapWorkAround:s,authorizationData:o,adminData:e});return q(h)},T=async r=>{const a=await R.httpClient.post(`${w.RELAYER_URL}${C.RELAYER_CONFIG.SOLANA_TRANSACT}`,r);return q(a)},m=r=>{if(r.status==="success")return r.message.scheduleId;throw new Error(r.error||"Batch transaction failed")},d=async(r,a,t,i)=>{const c=a.map(e=>l.serializeCircomData(e.circomData)),s={chainId:r,transactions:a.map((e,n)=>({chainId:r,a:e.zkCallData[0],b:e.zkCallData[1],c:e.zkCallData[2],dimData:e.dimData,circomData:c[n],withPrivateMempool:e.withPrivateMempool,withUniswapWorkAround:e.withUniswapWorkAround,authorizationData:e.authorizationData,adminData:e.adminData})),txCompletionTime:i,hashedEthereumAddress:t},o=await u.callRelayerTransactBatchAPI(s);return m(o)},A=async(r,a,t,i)=>{const c={chainId:r,transactions:a,hashedEthereumAddress:t,txCompletionTime:i},s=await u.callRelayerSolanaTransactBatchAPI(c);return m(s)};exports.solanaTransactCallRelayer=T;exports.solanaTransactCallRelayerBatch=A;exports.transactCallRelayer=D;exports.transactCallRelayerBatch=d;
|
|
@@ -6,7 +6,7 @@ export interface RelayerResponseInterface {
|
|
|
6
6
|
error?: string;
|
|
7
7
|
}
|
|
8
8
|
export declare const transactCallRelayer: (chainId: number, newZkCallData: NewZkCallDataType, dimData: DimDataType, circomData: CircomDataBaseType, withPrivateMempool?: boolean, withUniswapWorkAround?: boolean, authorizationData?: AuthorizationData, adminData?: AdminDataType) => Promise<RelayerTransaction>;
|
|
9
|
-
export declare const solanaTransactCallRelayer: (
|
|
9
|
+
export declare const solanaTransactCallRelayer: (body: SolanaTransactionBody) => Promise<RelayerTransaction>;
|
|
10
10
|
export interface RelayerBatchResponseInterface {
|
|
11
11
|
status: string;
|
|
12
12
|
message: {
|
|
@@ -1,36 +1,35 @@
|
|
|
1
1
|
import "../../../error-handling/error-codes.constants.mjs";
|
|
2
2
|
import "ethers";
|
|
3
|
-
import { ErrorWithRelayerTransaction as
|
|
3
|
+
import { ErrorWithRelayerTransaction as h } from "../../../error-handling/customErrors/ErrorWithTx.mjs";
|
|
4
4
|
import "../../../types/circom-data.types.mjs";
|
|
5
5
|
import "../../../types/transactions.types.mjs";
|
|
6
6
|
import "../../../types/activities.types.mjs";
|
|
7
|
-
import
|
|
8
|
-
import "../../../API/
|
|
9
|
-
import { httpClient as D } from "../../../data-structures/http/HttpClient.mjs";
|
|
10
|
-
import "axios";
|
|
7
|
+
import "../../../constants/vite.constants.mjs";
|
|
8
|
+
import { callRelayerTransactAPI as w, callRelayerTransactBatchAPI as D, callRelayerSolanaTransactBatchAPI as A } from "../../../API/callRelayer.mjs";
|
|
11
9
|
import "../../../constants/chains.constants.mjs";
|
|
12
10
|
import "circomlibjs-hinkal-fork";
|
|
13
|
-
import "libsodium-wrappers";
|
|
14
|
-
import "process";
|
|
15
|
-
import "buffer";
|
|
16
|
-
import "../../../constants/vite.constants.mjs";
|
|
17
|
-
import "../../../constants/save-depths.mjs";
|
|
18
|
-
import "../../../constants/reorg-depths.constants.mjs";
|
|
19
|
-
import "../../utils/mutexes.utils.mjs";
|
|
20
|
-
import "@coral-xyz/anchor";
|
|
21
|
-
import "@solana/web3.js";
|
|
22
11
|
import "../../../data-structures/crypto-keys/keys.mjs";
|
|
23
|
-
import { callRelayerTransactAPI as d, callRelayerTransactBatchAPI as y, callRelayerSolanaTransactBatchAPI as A } from "../../../API/callRelayer.mjs";
|
|
24
12
|
import { serializeCircomData as n } from "../../snarkjs/common.snarkjs.mjs";
|
|
25
13
|
import "node-forge";
|
|
14
|
+
import "libsodium-wrappers";
|
|
15
|
+
import { httpClient as d } from "../../../data-structures/http/HttpClient.mjs";
|
|
16
|
+
import "axios";
|
|
26
17
|
import "../../../constants/token-data/index.mjs";
|
|
27
18
|
import "idb-keyval";
|
|
19
|
+
import "@solana/web3.js";
|
|
28
20
|
import "../../utils/convertIntegrationProviderToExternalActionId.mjs";
|
|
29
|
-
import {
|
|
21
|
+
import { RELAYER_CONFIG as y } from "../../../constants/server.constants.mjs";
|
|
22
|
+
import { RELAYER_URL as R } from "../../../API/getServerURL.mjs";
|
|
23
|
+
import "@coral-xyz/anchor";
|
|
30
24
|
import "@solana/spl-token";
|
|
25
|
+
import "ethers-v6h";
|
|
26
|
+
import "tweetnacl";
|
|
27
|
+
import "bs58";
|
|
28
|
+
import "buffer";
|
|
31
29
|
import "../../../constants/contracts.constants.mjs";
|
|
32
30
|
import "../../../constants/kyc.constants.mjs";
|
|
33
31
|
import "../../../constants/coingecko.constants.mjs";
|
|
32
|
+
import "../../../constants/reorg-depths.constants.mjs";
|
|
34
33
|
import "../../../constants/addresses.constants.mjs";
|
|
35
34
|
import "../../../constants/token.limits.constants.mjs";
|
|
36
35
|
import "../../../constants/presale.constants.mjs";
|
|
@@ -39,14 +38,17 @@ import "../../../constants/tasks.constants.mjs";
|
|
|
39
38
|
import "../../../constants/events.constants.mjs";
|
|
40
39
|
import "../../utils/userAgent.mjs";
|
|
41
40
|
import "multiformats";
|
|
42
|
-
import "../../../API/
|
|
43
|
-
import "
|
|
41
|
+
import "../../../API/enclaveCalls.mjs";
|
|
42
|
+
import "async-mutex";
|
|
43
|
+
import "process";
|
|
44
|
+
import "../../../providers/EthersProviderAdapter.mjs";
|
|
44
45
|
const e = (t) => {
|
|
45
46
|
if (t.status === "success")
|
|
46
47
|
return t.message;
|
|
47
|
-
throw t.message && t.error ? new
|
|
48
|
-
},
|
|
49
|
-
const p = n(i),
|
|
48
|
+
throw t.message && t.error ? new h(t.error, t.message) : new Error(t.error);
|
|
49
|
+
}, et = async (t, a, o, i, c, m, s, r) => {
|
|
50
|
+
const p = n(i), u = await w({
|
|
51
|
+
chainId: t,
|
|
50
52
|
a: a[0],
|
|
51
53
|
b: a[1],
|
|
52
54
|
c: a[2],
|
|
@@ -57,22 +59,21 @@ const e = (t) => {
|
|
|
57
59
|
authorizationData: s,
|
|
58
60
|
adminData: r
|
|
59
61
|
});
|
|
60
|
-
return e(
|
|
61
|
-
},
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
a
|
|
65
|
-
);
|
|
66
|
-
return e(o);
|
|
62
|
+
return e(u);
|
|
63
|
+
}, lt = async (t) => {
|
|
64
|
+
const a = await d.post(`${R}${y.SOLANA_TRANSACT}`, t);
|
|
65
|
+
return e(a);
|
|
67
66
|
}, l = (t) => {
|
|
68
67
|
if (t.status === "success")
|
|
69
68
|
return t.message.scheduleId;
|
|
70
69
|
throw new Error(t.error || "Batch transaction failed");
|
|
71
|
-
},
|
|
70
|
+
}, ut = async (t, a, o, i) => {
|
|
72
71
|
const c = a.map(
|
|
73
72
|
(r) => n(r.circomData)
|
|
74
73
|
), m = {
|
|
74
|
+
chainId: t,
|
|
75
75
|
transactions: a.map((r, p) => ({
|
|
76
|
+
chainId: t,
|
|
76
77
|
a: r.zkCallData[0],
|
|
77
78
|
b: r.zkCallData[1],
|
|
78
79
|
c: r.zkCallData[2],
|
|
@@ -85,10 +86,11 @@ const e = (t) => {
|
|
|
85
86
|
})),
|
|
86
87
|
txCompletionTime: i,
|
|
87
88
|
hashedEthereumAddress: o
|
|
88
|
-
}, s = await
|
|
89
|
+
}, s = await D(m);
|
|
89
90
|
return l(s);
|
|
90
91
|
}, ht = async (t, a, o, i) => {
|
|
91
|
-
const m = await A(
|
|
92
|
+
const m = await A({
|
|
93
|
+
chainId: t,
|
|
92
94
|
transactions: a,
|
|
93
95
|
hashedEthereumAddress: o,
|
|
94
96
|
txCompletionTime: i
|
|
@@ -96,8 +98,8 @@ const e = (t) => {
|
|
|
96
98
|
return l(m);
|
|
97
99
|
};
|
|
98
100
|
export {
|
|
99
|
-
|
|
101
|
+
lt as solanaTransactCallRelayer,
|
|
100
102
|
ht as solanaTransactCallRelayerBatch,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
+
et as transactCallRelayer,
|
|
104
|
+
ut as transactCallRelayerBatch
|
|
103
105
|
};
|
|
@@ -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("../../constants/contracts.constants.cjs"),i=require("../../constants/chains.constants.cjs"),d=require("../../error-handling/error-codes.constants.cjs"),u=require("ethers"),g=require("../utils/create-provider.cjs"),a=(t,o)=>{const r=i.networkRegistry[o];if(!r)throw new Error(d.transactionErrorCodes.UNSUPPORTED_NETWORK);const e=s.contractMetadataMapping[t];if(!e)throw new Error(`Unsupported contractType: ${t}`);return e(r.contractData)},c=(t,o,r)=>{const e=a(t,o);if(!e.abi)throw new Error(`No ABI configured for contractType: ${t}`);if(e.address&&r)throw new Error(`Overriding address is not supported for contractType: ${t}`);const n=e.address??r;if(!n)throw new Error(`No contractAddress configured for contractType: ${t}`);return new u.ethers.Contract(n,e.abi)},C=(t,o,r=void 0)=>c(o,t,r).connect(g.createCustomRpcProvider(t));exports.getContract=c;exports.getContractMetadata=a;exports.getContractWithFetcherByChainId=C;
|
|
@@ -1,34 +1,29 @@
|
|
|
1
|
-
import { contractMetadataMapping as
|
|
2
|
-
import { networkRegistry as
|
|
3
|
-
import { transactionErrorCodes as
|
|
4
|
-
import { ethers as
|
|
1
|
+
import { contractMetadataMapping as a } from "../../constants/contracts.constants.mjs";
|
|
2
|
+
import { networkRegistry as c } from "../../constants/chains.constants.mjs";
|
|
3
|
+
import { transactionErrorCodes as s } from "../../error-handling/error-codes.constants.mjs";
|
|
4
|
+
import { ethers as i } from "ethers";
|
|
5
5
|
import { createCustomRpcProvider as d } from "../utils/create-provider.mjs";
|
|
6
6
|
const f = (r, e) => {
|
|
7
|
-
const
|
|
8
|
-
if (!o)
|
|
9
|
-
throw new Error(i.UNSUPPORTED_NETWORK);
|
|
10
|
-
const t = c[r];
|
|
7
|
+
const t = c[e];
|
|
11
8
|
if (!t)
|
|
9
|
+
throw new Error(s.UNSUPPORTED_NETWORK);
|
|
10
|
+
const o = a[r];
|
|
11
|
+
if (!o)
|
|
12
12
|
throw new Error(`Unsupported contractType: ${r}`);
|
|
13
|
-
return t
|
|
14
|
-
}, p = (r, e,
|
|
15
|
-
const
|
|
16
|
-
if (!
|
|
13
|
+
return o(t.contractData);
|
|
14
|
+
}, p = (r, e, t) => {
|
|
15
|
+
const o = f(r, e);
|
|
16
|
+
if (!o.abi)
|
|
17
17
|
throw new Error(`No ABI configured for contractType: ${r}`);
|
|
18
|
-
if (
|
|
18
|
+
if (o.address && t)
|
|
19
19
|
throw new Error(`Overriding address is not supported for contractType: ${r}`);
|
|
20
|
-
const n =
|
|
20
|
+
const n = o.address ?? t;
|
|
21
21
|
if (!n)
|
|
22
22
|
throw new Error(`No contractAddress configured for contractType: ${r}`);
|
|
23
|
-
return new
|
|
24
|
-
},
|
|
25
|
-
const { fetchRpcUrl: t } = a[r];
|
|
26
|
-
if (!t)
|
|
27
|
-
throw new Error("RPC URL not found for the specified chain ID");
|
|
28
|
-
return p(e, r, o).connect(d(t));
|
|
29
|
-
};
|
|
23
|
+
return new i.Contract(n, o.abi);
|
|
24
|
+
}, h = (r, e, t = void 0) => p(e, r, t).connect(d(r));
|
|
30
25
|
export {
|
|
31
26
|
p as getContract,
|
|
32
27
|
f as getContractMetadata,
|
|
33
|
-
|
|
28
|
+
h as getContractWithFetcherByChainId
|
|
34
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../constants/protocol.constants.cjs"),c=require("../../types/ethereum-network.types.cjs"),i=async(n,o,t,e)=>{const r=n.getContractWithFetcher(o,c.ContractType.ERC20Contract,t);return t===a.zeroAddress?(await r.provider.getBalance(e)).toBigInt():(await r.balanceOf(e)).toBigInt()};exports.getPublicAddressBalance=i;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type IHinkal } from '../../data-structures/Hinkal/IHinkal';
|
|
2
|
-
export declare const getPublicAddressBalance: (hinkal: IHinkal, tokenAddress: string, ethereumAddress: string) => Promise<bigint>;
|
|
2
|
+
export declare const getPublicAddressBalance: (hinkal: IHinkal, chainId: number, tokenAddress: string, ethereumAddress: string) => Promise<bigint>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { zeroAddress as
|
|
2
|
-
import { ContractType as
|
|
3
|
-
const
|
|
4
|
-
const a = o.getContractWithFetcher(
|
|
5
|
-
return t ===
|
|
1
|
+
import { zeroAddress as c } from "../../constants/protocol.constants.mjs";
|
|
2
|
+
import { ContractType as e } from "../../types/ethereum-network.types.mjs";
|
|
3
|
+
const p = async (o, n, t, r) => {
|
|
4
|
+
const a = o.getContractWithFetcher(n, e.ERC20Contract, t);
|
|
5
|
+
return t === c ? (await a.provider.getBalance(r)).toBigInt() : (await a.balanceOf(r)).toBigInt();
|
|
6
6
|
};
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
p as getPublicAddressBalance
|
|
9
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("ethers"),o=require("../../constants/chains.constants.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("ethers"),o=require("../../constants/chains.constants.cjs"),d=require("../../externalABIs/index.cjs"),s=require("../../data-structures/http/HttpClient.cjs");require("axios");require("idb-keyval");const p=require("../utils/create-provider.cjs");require("../../constants/token-data/index.cjs");require("../../error-handling/error-codes.constants.cjs");require("../utils/convertIntegrationProviderToExternalActionId.cjs");require("../../types/circom-data.types.cjs");require("../../types/transactions.types.cjs");require("../../types/activities.types.cjs");require("circomlibjs-hinkal-fork");require("../../data-structures/crypto-keys/keys.cjs");require("../../constants/server.constants.cjs");require("../../API/getServerURL.cjs");require("../../constants/vite.constants.cjs");require("@solana/web3.js");require("@coral-xyz/anchor");require("@solana/spl-token");require("ethers-v6h");require("tweetnacl");require("bs58");require("buffer");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");require("../../constants/coingecko.constants.cjs");require("../../constants/reorg-depths.constants.cjs");require("../../constants/addresses.constants.cjs");require("../../constants/token.limits.constants.cjs");require("../../constants/presale.constants.cjs");require("../../constants/activity.constants.cjs");require("../../constants/tasks.constants.cjs");require("../../constants/events.constants.cjs");require("../utils/userAgent.cjs");require("libsodium-wrappers");require("multiformats");require("../../API/enclaveCalls.cjs");require("async-mutex");require("process");require("../../providers/EthersProviderAdapter.cjs");const a={[o.chainIds.base]:"base",[o.chainIds.optimism]:"optimism",[o.chainIds.arbMainnet]:"arbitrum",[o.chainIds.polygon]:"polygon",[o.chainIds.ethMainnet]:"eth"},h=async(e,r)=>{const i=`https://${a[e]}.blockscout.com/api?module=token&action=getTokenHolders&contractaddress=${r}&page=0&offset=10`,{result:c}=await s.httpClient.get(i),q=p.createCustomRpcProvider(e),l=new u.ethers.Contract(r,d.ERC20ABI,q);for(const{address:n}of c)if((await l.balanceOf(n)).toBigInt()!==0n)return n},k=async(e,r)=>{const t=`https://api.routescan.io/v2/network/mainnet/evm/${e}/etherscan/api?module=token&action=tokenholderlist&contractaddress=${r}&page=1&offset=10&apikey=YourApiKeyToken`,{result:i}=await s.httpClient.get(t);return i.at(0)?.TokenHolderAddress},m=async(e,r)=>{try{if(!(e in a))throw new Error("Chain is not supported by blockscout");const t=await h(e,r);if(!t||!u.ethers.utils.isAddress(t))throw new Error("Token holder not found in blockscout");return t}catch{return await k(e,r)}};exports.getTokenHolder=m;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ethers as m } from "ethers";
|
|
2
|
-
import { chainIds as i
|
|
3
|
-
import { ERC20ABI as
|
|
4
|
-
import { httpClient as
|
|
2
|
+
import { chainIds as i } from "../../constants/chains.constants.mjs";
|
|
3
|
+
import { ERC20ABI as u } from "../../externalABIs/index.mjs";
|
|
4
|
+
import { httpClient as p } from "../../data-structures/http/HttpClient.mjs";
|
|
5
5
|
import "axios";
|
|
6
6
|
import "idb-keyval";
|
|
7
|
-
import { createCustomRpcProvider as
|
|
7
|
+
import { createCustomRpcProvider as d } from "../utils/create-provider.mjs";
|
|
8
8
|
import "../../constants/token-data/index.mjs";
|
|
9
9
|
import "../../error-handling/error-codes.constants.mjs";
|
|
10
10
|
import "../utils/convertIntegrationProviderToExternalActionId.mjs";
|
|
@@ -14,20 +14,19 @@ import "../../types/activities.types.mjs";
|
|
|
14
14
|
import "circomlibjs-hinkal-fork";
|
|
15
15
|
import "../../data-structures/crypto-keys/keys.mjs";
|
|
16
16
|
import "../../constants/server.constants.mjs";
|
|
17
|
-
import "../../constants/vite.constants.mjs";
|
|
18
17
|
import "../../API/getServerURL.mjs";
|
|
19
|
-
import "
|
|
20
|
-
import "process";
|
|
21
|
-
import "buffer";
|
|
22
|
-
import "../../constants/save-depths.mjs";
|
|
23
|
-
import "../../constants/reorg-depths.constants.mjs";
|
|
24
|
-
import "../utils/mutexes.utils.mjs";
|
|
25
|
-
import "@coral-xyz/anchor";
|
|
18
|
+
import "../../constants/vite.constants.mjs";
|
|
26
19
|
import "@solana/web3.js";
|
|
20
|
+
import "@coral-xyz/anchor";
|
|
27
21
|
import "@solana/spl-token";
|
|
22
|
+
import "ethers-v6h";
|
|
23
|
+
import "tweetnacl";
|
|
24
|
+
import "bs58";
|
|
25
|
+
import "buffer";
|
|
28
26
|
import "../../constants/contracts.constants.mjs";
|
|
29
27
|
import "../../constants/kyc.constants.mjs";
|
|
30
28
|
import "../../constants/coingecko.constants.mjs";
|
|
29
|
+
import "../../constants/reorg-depths.constants.mjs";
|
|
31
30
|
import "../../constants/addresses.constants.mjs";
|
|
32
31
|
import "../../constants/token.limits.constants.mjs";
|
|
33
32
|
import "../../constants/presale.constants.mjs";
|
|
@@ -35,39 +34,40 @@ import "../../constants/activity.constants.mjs";
|
|
|
35
34
|
import "../../constants/tasks.constants.mjs";
|
|
36
35
|
import "../../constants/events.constants.mjs";
|
|
37
36
|
import "../utils/userAgent.mjs";
|
|
37
|
+
import "libsodium-wrappers";
|
|
38
38
|
import "multiformats";
|
|
39
|
-
import "../../API/
|
|
40
|
-
|
|
39
|
+
import "../../API/enclaveCalls.mjs";
|
|
40
|
+
import "async-mutex";
|
|
41
|
+
import "process";
|
|
42
|
+
import "../../providers/EthersProviderAdapter.mjs";
|
|
43
|
+
const a = {
|
|
41
44
|
[i.base]: "base",
|
|
42
45
|
[i.optimism]: "optimism",
|
|
43
46
|
[i.arbMainnet]: "arbitrum",
|
|
44
47
|
[i.polygon]: "polygon",
|
|
45
48
|
[i.ethMainnet]: "eth"
|
|
46
49
|
}, k = async (o, t) => {
|
|
47
|
-
const e = `https://${
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return p;
|
|
54
|
-
}, w = async (o, t) => {
|
|
55
|
-
const r = `https://api.routescan.io/v2/network/mainnet/evm/${o}/etherscan/api?module=token&action=tokenholderlist&contractaddress=${t}&page=1&offset=10&apikey=YourApiKeyToken`, { result: e } = await a.get(
|
|
50
|
+
const e = `https://${a[o]}.blockscout.com/api?module=token&action=getTokenHolders&contractaddress=${t}&page=0&offset=10`, { result: s } = await p.get(e), c = d(o), l = new m.Contract(t, u, c);
|
|
51
|
+
for (const { address: n } of s)
|
|
52
|
+
if ((await l.balanceOf(n)).toBigInt() !== 0n)
|
|
53
|
+
return n;
|
|
54
|
+
}, f = async (o, t) => {
|
|
55
|
+
const r = `https://api.routescan.io/v2/network/mainnet/evm/${o}/etherscan/api?module=token&action=tokenholderlist&contractaddress=${t}&page=1&offset=10&apikey=YourApiKeyToken`, { result: e } = await p.get(
|
|
56
56
|
r
|
|
57
57
|
);
|
|
58
58
|
return e.at(0)?.TokenHolderAddress;
|
|
59
|
-
},
|
|
59
|
+
}, no = async (o, t) => {
|
|
60
60
|
try {
|
|
61
|
-
if (!(o in
|
|
61
|
+
if (!(o in a))
|
|
62
62
|
throw new Error("Chain is not supported by blockscout");
|
|
63
63
|
const r = await k(o, t);
|
|
64
64
|
if (!r || !m.utils.isAddress(r))
|
|
65
65
|
throw new Error("Token holder not found in blockscout");
|
|
66
66
|
return r;
|
|
67
67
|
} catch {
|
|
68
|
-
return await
|
|
68
|
+
return await f(o, t);
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
71
|
export {
|
|
72
|
-
|
|
72
|
+
no as getTokenHolder
|
|
73
73
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../../error-handling/error-codes.constants.cjs"),l=require("../../API/callLifiAPI.cjs"),d=require("./etherFunctions.cjs"),f=require("../../constants/protocol.constants.cjs"),m=async(e,o,i,s,a,n)=>{try{const r=d.getAmountInWei(e,i),c={fromChain:e.chainId,toChain:o.chainId,fromToken:e.erc20TokenAddress,toToken:o.erc20TokenAddress,fromAddress:a,fromAmount:r.toString(),order:"FASTEST",slippage:s,...n&&{toAddress:n}},{lifiResponse:t}=await l.callLifiAPI(c);return{lifiDataValue:t.transactionRequest.data,outSwapAmountValue:BigInt(t.estimate.toAmount),extraNativeTokenFee:e.erc20TokenAddress===f.zeroAddress?BigInt(t.transactionRequest.value)-r:BigInt(t.transactionRequest.value)}}catch{throw Error(u.transactionErrorCodes.NO_LIFI_PRICE)}};exports.getLifiPrice=m;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ERC20Token } from '../../types/token.types';
|
|
2
|
-
export declare const getLifiPrice: (
|
|
2
|
+
export declare const getLifiPrice: (inSwapToken: ERC20Token, outSwapToken: ERC20Token, inSwapAmount: string, bridgingSlippage: number, fromAddress: string, toAddress?: string) => Promise<{
|
|
3
3
|
lifiDataValue: string;
|
|
4
4
|
outSwapAmountValue: bigint;
|
|
5
5
|
extraNativeTokenFee: bigint;
|