import { MsgProtoAppStake, MsgProtoAppTransfer, MsgProtoAppUnstake, MsgProtoNodeStakeTx, MsgProtoNodeUnjail, MsgProtoNodeUnstake, MsgProtoSend } from './models/msgs'; import { AbstractProvider } from '@pokt-foundation/pocketjs-abstract-provider'; import { AbstractSigner } from '@pokt-foundation/pocketjs-signer'; import { RawTxRequest, TransactionResponse } from '@pokt-foundation/pocketjs-types'; import { DAOAction, GovParameter, TxMsg } from './models/'; import { AbstractBuilder } from './abstract-tx-builder'; import { MsgProtoGovDAOTransfer } from './models/msgs/msg-proto-gov-dao-transfer'; import { MsgProtoGovChangeParam } from './models/msgs/msg-proto-gov-change-param'; import { MsgProtoGovUpgrade } from './models/msgs/msg-proto-gov-upgrade'; export declare type ChainID = 'mainnet' | 'testnet' | 'localnet'; export declare const DEFAULT_BASE_FEE = "10000"; /** * A Transaction builder lets you create transaction messages, sign them, and send them over the network. * Requires a properly initialized Provider and Signer to work. */ export declare class TransactionBuilder implements AbstractBuilder { private provider; private signer; private chainID; constructor({ provider, signer, chainID, }: { provider: AbstractProvider; signer: AbstractSigner; chainID: ChainID; }); /** * Gets the current chain ID this Transaction Builder has been initialized for. * @returns {ChainID} - 'mainnet', 'localnet', or 'testnet'. */ getChainID(): ChainID; /** * Sets the chainID to one of the supported networks. */ setChainID(id: ChainID): void; /** * Signs and creates a transaction object that can be submitted to the network given the parameters and called upon Msgs. * Will empty the msg list after succesful creation * @param {string} fee - The amount to pay as a fee for executing this transaction, in uPOKT (1 POKT = 1*10^6 uPOKT). * @param {string} memo - The memo field for this account * @returns {Promise} - A Raw transaction Request which can be sent over the network. */ createTransaction({ fee, memo, txMsg, }: { fee?: string | bigint; memo?: string; txMsg: TxMsg; }): Promise; /** * Submit receives a valid transaction message, creates a Raw Transaction Request and sends it over the network. * @param {string} fee - The amount to pay as a fee for executing this transaction, in uPOKT (1 POKT = 1*10^6 uPOKT). * @param {string} memo - The memo field for this account * @param {TxMsg} txMsg - The transaction message to use for creating the RawTxRequest that will be sent over the network. * @returns {Promise} - The Transaction Response from the network, containing the transaction hash. */ submit({ fee, memo, txMsg, }: { fee?: string | bigint; memo?: string; txMsg: TxMsg; }): Promise; /** * Submit receives an already made Raw Transaction Request and sends it over the network. * @param {RawTxRequest} tx - The Raw Transaction Request use for creating the RawTxRequest that will be sent over the network. * @returns {Promise} - The Transaction Response from the network, containing the transaction hash. */ submitRawTransaction(tx: RawTxRequest): Promise; /** * Adds a MsgSend TxMsg for this transaction * @param {string} fromAddress - Origin address * @param {string} toAddress - Destination address * @param {string} amount - Amount to be sent, needs to be a valid number greater than 1 uPOKT. * @returns {MsgProtoSend} - The unsigned Send message. */ send({ fromAddress, toAddress, amount, }: { fromAddress?: string; toAddress: string; amount: string; }): MsgProtoSend; /** * Adds a MsgAppStake TxMsg for this transaction * @param {string} appPubKey - Application Public Key * @param {string[]} chains - Network identifier list to be requested by this app * @param {string} amount - the amount to stake, must be greater than or equal to 1 POKT * @returns {MsgProtoAppStake} - The unsigned App Stake message. */ appStake({ appPubKey, chains, amount, }: { appPubKey: string; chains: string[]; amount: string; }): MsgProtoAppStake; /** * Builds a transaction message to transfer the slot of a staked app. * Signer must be an existing staked app to transfer the slot from. * @param {string} appPubKey - Application public key to be transferred to * @returns {MsgProtoAppTransfer} - The unsigned AppTransfer message */ appTransfer({ appPubKey, }: { appPubKey: string; }): MsgProtoAppTransfer; /** * Adds a MsgBeginAppUnstake TxMsg for this transaction * @param {string} address - Address of the Application to unstake for * @returns {MsgProtoAppUnstake} - The unsigned App Unstake message. */ appUnstake(address: string): MsgProtoAppUnstake; /** * Adds a NodeStake TxMsg for this transaction * @param {Object} params * @param {string} params.nodePubKey - Node Public key * @param {string} params.outputAddress - The address that the coins will be sent to when the node is unstaked * @param {string[]} params.chains - Network identifier list to be serviced by this node * @param {string} params.amount - the amount to stake, must be greater than or equal to 1 POKT * @param {URL} params.serviceURL - Node service url * @param {Object.} params.rewardDelegators - Reward delegators. * If undefined or another falsey value is specified, the msg removes the * current delegators. * @returns {MsgProtoNodeStakeTx} - The unsigned Node Stake message. */ nodeStake({ nodePubKey, outputAddress, chains, amount, serviceURL, rewardDelegators, }: { nodePubKey?: string; outputAddress?: string; chains: string[]; amount: string; serviceURL: URL; rewardDelegators?: { [key: string]: number; }; }): MsgProtoNodeStakeTx; /** * Adds a MsgBeginUnstake TxMsg for this transaction * @param {string} nodeAddress - Address of the Node to unstake for * @param {string} signerAddress - The address that the coins will be sent to when the node is unstaked. Must be the same address entered when the node was staked * @returns {MsgProtoNodeUnstake} - The unsigned Node Unstake message. */ nodeUnstake({ nodeAddress, signerAddress, }: { nodeAddress?: string; signerAddress?: string; }): MsgProtoNodeUnstake; /** * Adds a MsgUnjail TxMsg for this transaction * @param {string} nodeAddress - Address of the Node to unjail * @param {string} signerAddress - The address of where the coins will be sent to when the node is unstaked (if it is ever). Necessary to unjail the node * @returns {MsgProtoNodeUnjail} - The unsigned Node Unjail message. */ nodeUnjail({ nodeAddress, signerAddress, }: { nodeAddress?: string; signerAddress?: string; }): MsgProtoNodeUnjail; /** * Adds a MsgDAOTransfer TxMsg for this transaction * @param {string} fromAddress - Address of the sender of the dao transfer * @param {string} toAddress - The receiver of the dao transfer * @param {string} - Amount to be used, needs to be a valid number greater than 1 uPOKT. * @param {DAOAction} - the action to perform using the specified amount (i.e burn or transfer) */ govDAOTransfer({ fromAddress, toAddress, amount, action, }: { fromAddress?: string; toAddress?: string; amount: string; action: DAOAction; }): MsgProtoGovDAOTransfer; /** * Adds a MsgChangeParam TxMsg for this transaction * @param {string} fromAddress - Address of the signer, must be on the ACL * @param {string} paramKey - the governance parameter key * @param {string} paramValue - the governance parameter's new value in human-readable format (utf8). */ govChangeParam({ fromAddress, paramKey, paramValue, overrideGovParamsWhitelistValidation, }: { fromAddress?: string; paramKey: GovParameter | string; paramValue: string; overrideGovParamsWhitelistValidation?: boolean; }): MsgProtoGovChangeParam; govUpgrade({ fromAddress, upgrade, }: { fromAddress?: string; upgrade: { height: number; features: string[]; version: string; }; }): MsgProtoGovUpgrade; /** * Adds a MsgUpgrade TxMsg for this transaction * @param {string} fromAddress - Address of the signer * @param {Upgrade} upgrade - the upgrade object such as the new upgrade height and new values. */ govUpgradeVersion({ fromAddress, upgrade, }: { fromAddress?: string; upgrade: { height: number; version: string; }; }): MsgProtoGovUpgrade; govUpgradeFeatures({ fromAddress, upgrade, }: { fromAddress?: string; upgrade: { features: string[]; }; }): MsgProtoGovUpgrade; } //# sourceMappingURL=tx-builder.d.ts.map