UNPKG

nimiq-rpc-client-ts

Version:
637 lines (633 loc) 30.2 kB
'use strict'; const client = require('./client.cjs'); let _idCounter = 0; function base64Encode(input) { if (globalThis.Buffer) return Buffer.from(input).toString("base64"); return globalThis.btoa(input); } async function rpcCall(method, params = [], options = {}) { const url = options.url ? new URL(options.url.toString()) : await client.__getBaseUrl(); const auth = options.auth ?? await client.__getAuth(); const headers = { "Content-Type": "application/json" }; if (auth?.username && auth.password) { headers.Authorization = `Basic ${base64Encode(`${auth.username}:${auth.password}`)}`; } const id = _idCounter++; const abortController = options.abortController || new AbortController(); let timeoutId; if (abortController && options.timeout) { timeoutId = setTimeout(() => abortController.abort(), options.timeout); } const body = { jsonrpc: "2.0", method, params: params.map((p) => p ?? null), id }; const request = { url: url.href, method: "POST", headers, body, timestamp: Date.now(), abortController, ...options.request }; let res; try { res = await fetch(request.url, { method: request.method, headers: request.headers, body: JSON.stringify(request.body), signal: request.abortController?.signal }); } catch (e) { clearTimeout(timeoutId); const error = JSON.stringify(e); return [false, error, void 0, { request }]; } clearTimeout(timeoutId); if (!res.ok) { const error = `HTTP error ${res.status}: ${res.statusText}`; return [false, error, void 0, { request }]; } const json = await res.json().catch(() => null); if (!json) return [false, "Invalid JSON response", void 0, { request }]; if ("error" in json) return [false, JSON.stringify(json.error), void 0, { request }]; if ("result" in json) return [true, void 0, json.result.data, { request, metadata: json.result.metadata }]; return [false, "Unexpected RPC format", void 0, { request }]; } function getBlockNumber(opts) { return rpcCall("getBlockNumber", [], opts); } function getBatchNumber(opts) { return rpcCall("getBatchNumber", [], opts); } function getEpochNumber(opts) { return rpcCall("getEpochNumber", [], opts); } function getBlockByHash({ hash, includeBody }, opts) { return rpcCall("getBlockByHash", [hash, includeBody || false], opts); } function getBlockByNumber({ blockNumber, includeBody }, opts) { return rpcCall("getBlockByNumber", [blockNumber, includeBody || false], opts); } function getLatestBlock({ includeBody } = {}, opts) { return rpcCall("getLatestBlock", [includeBody || false], opts); } function getSlotAt({ blockNumber, offsetOpt }, opts) { return rpcCall("getSlotAt", [blockNumber, offsetOpt], opts); } function getTransactionByHash({ hash }, opts) { return rpcCall("getTransactionByHash", [hash], opts); } function getTransactionsByBlockNumber({ blockNumber }, opts) { return rpcCall("getTransactionsByBlockNumber", [blockNumber], opts); } function getTransactionsByBatchNumber({ batchIndex }, opts) { return rpcCall("getTransactionsByBatchNumber", [batchIndex], opts); } function getTransactionsByAddress({ address, max, startAt }, opts) { return rpcCall("getTransactionsByAddress", [address, max, startAt], opts); } function getTransactionHashesByAddress({ address, max, startAt }, opts) { return rpcCall("getTransactionHashesByAddress", [address, max, startAt], opts); } function getInherentsByBlockNumber({ blockNumber }, opts) { return rpcCall("getInherentsByBlockNumber", [blockNumber], opts); } function getInherentsByBatchNumber({ batchIndex }, opts) { return rpcCall("getInherentsByBatchNumber", [batchIndex], opts); } function getAccountByAddress({ address }, opts) { return rpcCall("getAccountByAddress", [address], opts); } function getAccounts(opts) { return rpcCall("getAccounts", [], opts); } function getActiveValidators(opts) { return rpcCall("getActiveValidators", [], opts); } function getCurrentPenalizedSlots(opts) { return rpcCall("getCurrentPenalizedSlots", [], opts); } function getPreviousPenalizedSlots(opts) { return rpcCall("getPreviousPenalizedSlots", [], opts); } function getValidatorByAddress({ address }, opts) { return rpcCall("getValidatorByAddress", [address], opts); } function getValidators(opts) { return rpcCall("getValidators", [], opts); } function getStakersByValidatorAddress({ address }, opts) { return rpcCall("getStakersByValidatorAddress", [address], opts); } function getStakerByAddress({ address }, opts) { return rpcCall("getStakerByAddress", [address], opts); } function getValidityStartHeight(p) { return "relativeValidityStartHeight" in p ? `+${p.relativeValidityStartHeight}` : `${p.absoluteValidityStartHeight}`; } function isConsensusEstablished(opts) { return rpcCall("isConsensusEstablished", [], opts); } function getRawTransactionInfo({ rawTransaction }, opts) { return rpcCall("getRawTransactionInfo", [rawTransaction], opts); } function sendRawTransaction({ rawTransaction }, opts) { return rpcCall("sendRawTransaction", [rawTransaction], opts); } function createTransaction(params, opts) { const { wallet, recipient, value, fee, data } = params; const validity = getValidityStartHeight(params); const method = data ? "createBasicTransactionWithData" : "createBasicTransaction"; const rpcParams = data ? [wallet, recipient, data, value, fee, validity] : [wallet, recipient, value, fee, validity]; return rpcCall(method, rpcParams, opts); } function sendTransaction(params, opts) { const { wallet, recipient, value, fee, data } = params; const validity = getValidityStartHeight(params); const method = data ? "sendBasicTransactionWithData" : "sendBasicTransaction"; const rpcParams = data ? [wallet, recipient, data, value, fee, validity] : [wallet, recipient, value, fee, validity]; return rpcCall(method, rpcParams, opts); } function createNewVestingTransaction(params, opts) { const validity = getValidityStartHeight(params); const { wallet, owner, startTime, timeStep, numSteps, value, fee } = params; return rpcCall("createNewVestingTransaction", [wallet, owner, startTime, timeStep, numSteps, value, fee, validity], opts); } function sendNewVestingTransaction(params, opts) { const validity = getValidityStartHeight(params); const { wallet, owner, startTime, timeStep, numSteps, value, fee } = params; return rpcCall("sendNewVestingTransaction", [wallet, owner, startTime, timeStep, numSteps, value, fee, validity], opts); } function createRedeemVestingTransaction(params, opts) { const validity = getValidityStartHeight(params); const { wallet, contractAddress, recipient, value, fee } = params; return rpcCall("createRedeemVestingTransaction", [wallet, contractAddress, recipient, value, fee, validity], opts); } function sendRedeemVestingTransaction(params, opts) { const validity = getValidityStartHeight(params); const { wallet, contractAddress, recipient, value, fee } = params; return rpcCall("sendRedeemVestingTransaction", [wallet, contractAddress, recipient, value, fee, validity], opts); } function createNewHtlcTransaction(params, opts) { const validity = getValidityStartHeight(params); const { wallet, htlcSender, htlcRecipient, hashRoot, hashCount, timeout, value, fee } = params; return rpcCall("createNewHtlcTransaction", [wallet, htlcSender, htlcRecipient, hashRoot, hashCount, timeout, value, fee, validity], opts); } function sendNewHtlcTransaction(params, opts) { const validity = getValidityStartHeight(params); const { wallet, htlcSender, htlcRecipient, hashRoot, hashCount, timeout, value, fee } = params; return rpcCall("sendNewHtlcTransaction", [wallet, htlcSender, htlcRecipient, hashRoot, hashCount, timeout, value, fee, validity], opts); } function createRedeemRegularHtlcTransaction(params, opts) { const validity = getValidityStartHeight(params); const { wallet, contractAddress, recipient, preImage, hashRoot, hashCount, value, fee } = params; return rpcCall("createRedeemRegularHtlcTransaction", [wallet, contractAddress, recipient, preImage, hashRoot, hashCount, value, fee, validity], opts); } function sendRedeemRegularHtlcTransaction(params, opts) { const validity = getValidityStartHeight(params); const { wallet, contractAddress, recipient, preImage, hashRoot, hashCount, value, fee } = params; return rpcCall("sendRedeemRegularHtlcTransaction", [wallet, contractAddress, recipient, preImage, hashRoot, hashCount, value, fee, validity], opts); } function createRedeemTimeoutHtlcTransaction(params, opts) { const validity = getValidityStartHeight(params); const { wallet, contractAddress, recipient, value, fee } = params; return rpcCall("createRedeemTimeoutHtlcTransaction", [wallet, contractAddress, recipient, value, fee, validity], opts); } function sendRedeemTimeoutHtlcTransaction(params, opts) { const validity = getValidityStartHeight(params); const { wallet, contractAddress, recipient, value, fee } = params; return rpcCall("sendRedeemTimeoutHtlcTransaction", [wallet, contractAddress, recipient, value, fee, validity], opts); } function createRedeemEarlyHtlcTransaction(params, opts) { const validity = getValidityStartHeight(params); const { contractAddress, recipient, htlcSenderSignature, htlcRecipientSignature, value, fee } = params; return rpcCall("createRedeemEarlyHtlcTransaction", [contractAddress, recipient, htlcSenderSignature, htlcRecipientSignature, value, fee, validity], opts); } function sendRedeemEarlyHtlcTransaction(params, opts) { const validity = getValidityStartHeight(params); const { contractAddress, recipient, htlcSenderSignature, htlcRecipientSignature, value, fee } = params; return rpcCall("sendRedeemEarlyHtlcTransaction", [contractAddress, recipient, htlcSenderSignature, htlcRecipientSignature, value, fee, validity], opts); } function signRedeemEarlyHtlcTransaction(params, opts) { const validity = getValidityStartHeight(params); const { contractAddress, recipient, htlcSenderSignature, htlcRecipientSignature, value, fee } = params; return rpcCall("signRedeemEarlyHtlcTransaction", [contractAddress, recipient, htlcSenderSignature, htlcRecipientSignature, value, fee, validity], opts); } function createNewStakerTransaction(params, opts) { const validity = getValidityStartHeight(params); const { senderWallet, stakerWallet, delegation, value, fee } = params; return rpcCall("createNewStakerTransaction", [senderWallet, stakerWallet, delegation, value, fee, validity], opts); } function sendNewStakerTransaction(params, opts) { const validity = getValidityStartHeight(params); const { senderWallet, stakerWallet, delegation, value, fee } = params; return rpcCall("sendNewStakerTransaction", [senderWallet, stakerWallet, delegation, value, fee, validity], opts); } function createStakeTransaction(params, opts) { const validity = getValidityStartHeight(params); const { senderWallet, stakerWallet, value, fee } = params; return rpcCall("createStakeTransaction", [senderWallet, stakerWallet, value, fee, validity], opts); } function sendStakeTransaction(params, opts) { const validity = getValidityStartHeight(params); const { senderWallet, stakerWallet, value, fee } = params; return rpcCall("sendStakeTransaction", [senderWallet, stakerWallet, value, fee, validity], opts); } function createUpdateStakerTransaction(params, opts) { const validity = getValidityStartHeight(params); const { senderWallet, stakerWallet, newDelegation, newInactiveBalance, fee } = params; return rpcCall("createUpdateStakerTransaction", [senderWallet, stakerWallet, newDelegation, newInactiveBalance, fee, validity], opts); } function sendUpdateStakerTransaction(params, opts) { const validity = getValidityStartHeight(params); const { senderWallet, stakerWallet, newDelegation, newInactiveBalance, fee } = params; return rpcCall("sendUpdateStakerTransaction", [senderWallet, stakerWallet, newDelegation, newInactiveBalance, fee, validity], opts); } function createSetActiveStakeTransaction(params, opts) { const validity = getValidityStartHeight(params); const { senderWallet, stakerWallet, newActiveBalance, fee } = params; return rpcCall("createSetActiveStakeTransaction", [senderWallet, stakerWallet, newActiveBalance, fee, validity], opts); } function sendSetActiveStakeTransaction(params, opts) { const validity = getValidityStartHeight(params); const { senderWallet, stakerWallet, newActiveBalance, fee } = params; return rpcCall("sendSetActiveStakeTransaction", [senderWallet, stakerWallet, newActiveBalance, fee, validity], opts); } function createRetireStakeTransaction(params, opts) { const validity = getValidityStartHeight(params); const { senderWallet, stakerWallet, retireStake, fee } = params; return rpcCall("createRetireStakeTransaction", [senderWallet, stakerWallet, retireStake, fee, validity], opts); } function sendRetireStakeTransaction(params, opts) { const validity = getValidityStartHeight(params); const { senderWallet, stakerWallet, retireStake, fee } = params; return rpcCall("sendRetireStakeTransaction", [senderWallet, stakerWallet, retireStake, fee, validity], opts); } function createRemoveStakeTransaction(params, opts) { const validity = getValidityStartHeight(params); const { stakerWallet, recipient, value, fee } = params; return rpcCall("createRemoveStakeTransaction", [stakerWallet, recipient, value, fee, validity], opts); } function sendRemoveStakeTransaction(params, opts) { const validity = getValidityStartHeight(params); const { stakerWallet, recipient, value, fee } = params; return rpcCall("sendRemoveStakeTransaction", [stakerWallet, recipient, value, fee, validity], opts); } function createNewValidatorTransaction(params, opts) { const validity = getValidityStartHeight(params); const { senderWallet, validator, signingSecretKey, votingSecretKey, rewardAddress, signalData, fee } = params; return rpcCall("createNewValidatorTransaction", [senderWallet, validator, signingSecretKey, votingSecretKey, rewardAddress, signalData, fee, validity], opts); } function sendNewValidatorTransaction(params, opts) { const validity = getValidityStartHeight(params); const { senderWallet, validator, signingSecretKey, votingSecretKey, rewardAddress, signalData, fee } = params; return rpcCall("sendNewValidatorTransaction", [senderWallet, validator, signingSecretKey, votingSecretKey, rewardAddress, signalData, fee, validity], opts); } function createUpdateValidatorTransaction(params, opts) { const validity = getValidityStartHeight(params); const { senderWallet, validator, newSigningSecretKey, newVotingSecretKey, newRewardAddress, newSignalData, fee } = params; return rpcCall("createUpdateValidatorTransaction", [senderWallet, validator, newSigningSecretKey, newVotingSecretKey, newRewardAddress, newSignalData, fee, validity], opts); } function sendUpdateValidatorTransaction(params, opts) { const validity = getValidityStartHeight(params); const { senderWallet, validator, newSigningSecretKey, newVotingSecretKey, newRewardAddress, newSignalData, fee } = params; return rpcCall("sendUpdateValidatorTransaction", [senderWallet, validator, newSigningSecretKey, newVotingSecretKey, newRewardAddress, newSignalData, fee, validity], opts); } function createDeactivateValidatorTransaction(params, opts) { const validity = getValidityStartHeight(params); const { senderWallet, validator, signingSecretKey, fee } = params; return rpcCall("createDeactivateValidatorTransaction", [senderWallet, validator, signingSecretKey, fee, validity], opts); } function sendDeactivateValidatorTransaction(params, opts) { const validity = getValidityStartHeight(params); const { senderWallet, validator, signingSecretKey, fee } = params; return rpcCall("sendDeactivateValidatorTransaction", [senderWallet, validator, signingSecretKey, fee, validity], opts); } function createReactivateValidatorTransaction(params, opts) { const validity = getValidityStartHeight(params); const { senderWallet, validator, signingSecretKey, fee } = params; return rpcCall("createReactivateValidatorTransaction", [senderWallet, validator, signingSecretKey, fee, validity], opts); } function sendReactivateValidatorTransaction(params, opts) { const validity = getValidityStartHeight(params); const { senderWallet, validator, signingSecretKey, fee } = params; return rpcCall("sendReactivateValidatorTransaction", [senderWallet, validator, signingSecretKey, fee, validity], opts); } function createRetireValidatorTransaction(params, opts) { const validity = getValidityStartHeight(params); const { senderWallet, validator, fee } = params; return rpcCall("createRetireValidatorTransaction", [senderWallet, validator, fee, validity], opts); } function sendRetireValidatorTransaction(params, opts) { const validity = getValidityStartHeight(params); const { senderWallet, validator, fee } = params; return rpcCall("sendRetireValidatorTransaction", [senderWallet, validator, fee, validity], opts); } function createDeleteValidatorTransaction(params, opts) { const validity = getValidityStartHeight(params); const { validator, recipient, fee, value } = params; return rpcCall("createDeleteValidatorTransaction", [validator, recipient, fee, value, validity], opts); } function sendDeleteValidatorTransaction(params, opts) { const validity = getValidityStartHeight(params); const { validator, recipient, fee, value } = params; return rpcCall("sendDeleteValidatorTransaction", [validator, recipient, fee, value, validity], opts); } async function pushTransaction({ transaction, withHighPriority }, opts) { const method = withHighPriority || false ? "pushHighPriorityTransaction" : "pushTransaction"; return rpcCall(method, [transaction], opts); } async function mempoolContent({ includeTransactions }, opts) { return rpcCall("mempoolContent", [includeTransactions || false], opts); } async function mempool(opts) { return rpcCall("mempool", [], opts); } async function getMinFeePerByte(opts) { return rpcCall("getMinFeePerByte", [], opts); } async function getTransactionFromMempool({ hash }, opts) { return rpcCall("getTransactionFromMempool", [hash], opts); } function getPeerId(opts) { return rpcCall("getPeerId", [], opts); } function getPeerCount(opts) { return rpcCall("getPeerCount", [], opts); } function getPeerList(opts) { return rpcCall("getPeerList", [], opts); } function getPolicyConstants(opts) { return rpcCall("getPolicyConstants", [], opts); } function getEpochAt({ blockNumber }, opts) { return rpcCall("getEpochAt", [blockNumber], opts); } function getEpochIndexAt({ blockNumber }, opts) { return rpcCall("getEpochIndexAt", [blockNumber], opts); } function getBatchAt({ blockNumber }, opts) { return rpcCall("getBatchAt", [blockNumber], opts); } function getBatchIndexAt({ blockNumber }, opts) { return rpcCall("getBatchIndexAt", [blockNumber], opts); } function getElectionBlockAfter({ blockNumber }, opts) { return rpcCall("getElectionBlockAfter", [blockNumber], opts); } function getElectionBlockBefore({ blockNumber }, opts) { return rpcCall("getElectionBlockBefore", [blockNumber], opts); } function getLastElectionBlock({ blockNumber }, opts) { return rpcCall("getLastElectionBlock", [blockNumber], opts); } function isElectionBlockAt({ blockNumber }, opts) { return rpcCall("isElectionBlockAt", [blockNumber], opts); } function getMacroBlockAfter({ blockNumber }, opts) { return rpcCall("getMacroBlockAfter", [blockNumber], opts); } function getMacroBlockBefore({ blockNumber }, opts) { return rpcCall("getMacroBlockBefore", [blockNumber], opts); } function getLastMacroBlock({ blockNumber }, opts) { return rpcCall("getLastMacroBlock", [blockNumber], opts); } function isMacroBlockAt({ blockNumber }, opts) { return rpcCall("isMacroBlockAt", [blockNumber], opts); } function isMicroBlockAt({ blockNumber }, opts) { return rpcCall("isMicroBlockAt", [blockNumber], opts); } function getFirstBlockOfEpoch({ epochIndex }, opts) { return rpcCall("getFirstBlockOfEpoch", [epochIndex], opts); } function getBlockAfterReportingWindow({ blockNumber }, opts) { return rpcCall("getBlockAfterReportingWindow", [blockNumber], opts); } function getBlockAfterJail({ blockNumber }, opts) { return rpcCall("getBlockAfterJail", [blockNumber], opts); } function getFirstBlockOfBatch({ batchIndex }, opts) { return rpcCall("getFirstBlockOfBatch", [batchIndex], opts); } function getElectionBlockOfEpoch({ epochIndex }, opts) { return rpcCall("getElectionBlockOf", [epochIndex], opts); } function getMacroBlockOfBatch({ batchIndex }, opts) { return rpcCall("getMacroBlockOf", [batchIndex], opts); } function getFirstBatchOfEpoch({ epochIndex }, opts) { return rpcCall("getFirstBatchOfEpoch", [epochIndex], opts); } function getBlockchainState(opts) { return rpcCall("getBlockchainState", [], opts); } function getSupplyAt({ blockNumber }, opts) { return rpcCall("getSupplyAt", [blockNumber], opts); } async function getZkpState(opts) { const result = await rpcCall("getZkpState", [], opts); if (!result[0]) return result; return [true, void 0, { latestHeaderNumber: result[2]["latest-header-number"], latestBlockNumber: result[2]["latest-block-number"], latestProof: result[2]["latest-proof"] }, result[3]]; } function importRawKey({ keyData, passphrase }, opts) { return rpcCall("importRawKey", [keyData, passphrase], opts); } function isAccountImported({ address }, opts) { return rpcCall("isAccountImported", [address], opts); } function listAccounts(opts) { return rpcCall("listAccounts", [], opts); } function addVotingKey({ secretKey }, opts) { return rpcCall("addVotingKey", [secretKey], opts); } function createAccount({ passphrase }, opts) { return rpcCall("createAccount", [passphrase], opts); } function getAddress(opts) { return rpcCall("getAddress", [], opts); } function getSigningKey(opts) { return rpcCall("getSigningKey", [], opts); } function getVotingKey(opts) { return rpcCall("getVotingKey", [], opts); } function getVotingKeys(opts) { return rpcCall("getVotingKeys", [], opts); } function isAccountUnlocked({ address }, opts) { return rpcCall("isAccountUnlocked", [address], opts); } function lockAccount({ address }, opts) { return rpcCall("lockAccount", [address], opts); } function removeAccount({ address }, opts) { return rpcCall("removeAccount", [address], opts); } function isValidatorElected(opts) { return rpcCall("isValidatorElected", [], opts); } function isValidatorSynced(opts) { return rpcCall("isValidatorSynced", [], opts); } function pushHighPriorityTransaction(rawTx, opts) { return rpcCall("pushHighPriorityTransaction", [rawTx], opts); } function setAutomaticReactivation({ automaticReactivate }, opts) { return rpcCall("setAutomaticReactivation", [automaticReactivate], opts); } function sign({ message, address, passphrase, isHex }, opts) { return rpcCall("sign", [message, address, passphrase, isHex], opts); } function verifySignature({ message, publicKey, signature, isHex }, opts) { return rpcCall("verifySignature", [message, publicKey, signature, isHex], opts); } function unlockAccount({ address, passphrase, duration }, opts) { return rpcCall("unlockAccount", [address, passphrase, duration], opts); } function getElectionBlockOf({ epochIndex }, opts) { return rpcCall("getElectionBlockOf", [epochIndex], opts); } function getFirstBlockOf({ epochIndex }, opts) { return rpcCall("getFirstBlockOf", [epochIndex], opts); } function getMacroBlockOf({ batchNumber }, opts) { return rpcCall("getMacroBlockOf", [batchNumber], opts); } exports.addVotingKey = addVotingKey; exports.createAccount = createAccount; exports.createDeactivateValidatorTransaction = createDeactivateValidatorTransaction; exports.createDeleteValidatorTransaction = createDeleteValidatorTransaction; exports.createNewHtlcTransaction = createNewHtlcTransaction; exports.createNewStakerTransaction = createNewStakerTransaction; exports.createNewValidatorTransaction = createNewValidatorTransaction; exports.createNewVestingTransaction = createNewVestingTransaction; exports.createReactivateValidatorTransaction = createReactivateValidatorTransaction; exports.createRedeemEarlyHtlcTransaction = createRedeemEarlyHtlcTransaction; exports.createRedeemRegularHtlcTransaction = createRedeemRegularHtlcTransaction; exports.createRedeemTimeoutHtlcTransaction = createRedeemTimeoutHtlcTransaction; exports.createRedeemVestingTransaction = createRedeemVestingTransaction; exports.createRemoveStakeTransaction = createRemoveStakeTransaction; exports.createRetireStakeTransaction = createRetireStakeTransaction; exports.createRetireValidatorTransaction = createRetireValidatorTransaction; exports.createSetActiveStakeTransaction = createSetActiveStakeTransaction; exports.createStakeTransaction = createStakeTransaction; exports.createTransaction = createTransaction; exports.createUpdateStakerTransaction = createUpdateStakerTransaction; exports.createUpdateValidatorTransaction = createUpdateValidatorTransaction; exports.getAccountByAddress = getAccountByAddress; exports.getAccounts = getAccounts; exports.getActiveValidators = getActiveValidators; exports.getAddress = getAddress; exports.getBatchAt = getBatchAt; exports.getBatchIndexAt = getBatchIndexAt; exports.getBatchNumber = getBatchNumber; exports.getBlockAfterJail = getBlockAfterJail; exports.getBlockAfterReportingWindow = getBlockAfterReportingWindow; exports.getBlockByHash = getBlockByHash; exports.getBlockByNumber = getBlockByNumber; exports.getBlockNumber = getBlockNumber; exports.getBlockchainState = getBlockchainState; exports.getCurrentPenalizedSlots = getCurrentPenalizedSlots; exports.getElectionBlockAfter = getElectionBlockAfter; exports.getElectionBlockBefore = getElectionBlockBefore; exports.getElectionBlockOf = getElectionBlockOf; exports.getElectionBlockOfEpoch = getElectionBlockOfEpoch; exports.getEpochAt = getEpochAt; exports.getEpochIndexAt = getEpochIndexAt; exports.getEpochNumber = getEpochNumber; exports.getFirstBatchOfEpoch = getFirstBatchOfEpoch; exports.getFirstBlockOf = getFirstBlockOf; exports.getFirstBlockOfBatch = getFirstBlockOfBatch; exports.getFirstBlockOfEpoch = getFirstBlockOfEpoch; exports.getInherentsByBatchNumber = getInherentsByBatchNumber; exports.getInherentsByBlockNumber = getInherentsByBlockNumber; exports.getLastElectionBlock = getLastElectionBlock; exports.getLastMacroBlock = getLastMacroBlock; exports.getLatestBlock = getLatestBlock; exports.getMacroBlockAfter = getMacroBlockAfter; exports.getMacroBlockBefore = getMacroBlockBefore; exports.getMacroBlockOf = getMacroBlockOf; exports.getMacroBlockOfBatch = getMacroBlockOfBatch; exports.getMinFeePerByte = getMinFeePerByte; exports.getPeerCount = getPeerCount; exports.getPeerId = getPeerId; exports.getPeerList = getPeerList; exports.getPolicyConstants = getPolicyConstants; exports.getPreviousPenalizedSlots = getPreviousPenalizedSlots; exports.getRawTransactionInfo = getRawTransactionInfo; exports.getSigningKey = getSigningKey; exports.getSlotAt = getSlotAt; exports.getStakerByAddress = getStakerByAddress; exports.getStakersByValidatorAddress = getStakersByValidatorAddress; exports.getSupplyAt = getSupplyAt; exports.getTransactionByHash = getTransactionByHash; exports.getTransactionFromMempool = getTransactionFromMempool; exports.getTransactionHashesByAddress = getTransactionHashesByAddress; exports.getTransactionsByAddress = getTransactionsByAddress; exports.getTransactionsByBatchNumber = getTransactionsByBatchNumber; exports.getTransactionsByBlockNumber = getTransactionsByBlockNumber; exports.getValidatorByAddress = getValidatorByAddress; exports.getValidators = getValidators; exports.getVotingKey = getVotingKey; exports.getVotingKeys = getVotingKeys; exports.getZkpState = getZkpState; exports.importRawKey = importRawKey; exports.isAccountImported = isAccountImported; exports.isAccountUnlocked = isAccountUnlocked; exports.isConsensusEstablished = isConsensusEstablished; exports.isElectionBlockAt = isElectionBlockAt; exports.isMacroBlockAt = isMacroBlockAt; exports.isMicroBlockAt = isMicroBlockAt; exports.isValidatorElected = isValidatorElected; exports.isValidatorSynced = isValidatorSynced; exports.listAccounts = listAccounts; exports.lockAccount = lockAccount; exports.mempool = mempool; exports.mempoolContent = mempoolContent; exports.pushHighPriorityTransaction = pushHighPriorityTransaction; exports.pushTransaction = pushTransaction; exports.removeAccount = removeAccount; exports.rpcCall = rpcCall; exports.sendDeactivateValidatorTransaction = sendDeactivateValidatorTransaction; exports.sendDeleteValidatorTransaction = sendDeleteValidatorTransaction; exports.sendNewHtlcTransaction = sendNewHtlcTransaction; exports.sendNewStakerTransaction = sendNewStakerTransaction; exports.sendNewValidatorTransaction = sendNewValidatorTransaction; exports.sendNewVestingTransaction = sendNewVestingTransaction; exports.sendRawTransaction = sendRawTransaction; exports.sendReactivateValidatorTransaction = sendReactivateValidatorTransaction; exports.sendRedeemEarlyHtlcTransaction = sendRedeemEarlyHtlcTransaction; exports.sendRedeemRegularHtlcTransaction = sendRedeemRegularHtlcTransaction; exports.sendRedeemTimeoutHtlcTransaction = sendRedeemTimeoutHtlcTransaction; exports.sendRedeemVestingTransaction = sendRedeemVestingTransaction; exports.sendRemoveStakeTransaction = sendRemoveStakeTransaction; exports.sendRetireStakeTransaction = sendRetireStakeTransaction; exports.sendRetireValidatorTransaction = sendRetireValidatorTransaction; exports.sendSetActiveStakeTransaction = sendSetActiveStakeTransaction; exports.sendStakeTransaction = sendStakeTransaction; exports.sendTransaction = sendTransaction; exports.sendUpdateStakerTransaction = sendUpdateStakerTransaction; exports.sendUpdateValidatorTransaction = sendUpdateValidatorTransaction; exports.setAutomaticReactivation = setAutomaticReactivation; exports.sign = sign; exports.signRedeemEarlyHtlcTransaction = signRedeemEarlyHtlcTransaction; exports.unlockAccount = unlockAccount; exports.verifySignature = verifySignature;