UNPKG

@muirglacier/testcontainers

Version:

A collection of TypeScript + JavaScript tools and libraries for DeFi Blockchain developers to build decentralized finance for Bitcoin

153 lines 6.03 kB
import { MasterNodeKey } from '@muirglacier/jellyfish-network'; import { DockerOptions } from 'dockerode'; import { StartOptions } from '../DeFiDContainer'; import { RegTestContainer } from './index'; /** * RegTest with MasterNode preconfigured */ export declare class MasterNodeRegTestContainer extends RegTestContainer { private readonly masternodeKey; /** * @param {string} [masternodeKey=RegTestFoundationKeys[0]] pair to use for minting * @param {string} [image=DeFiDContainer.image] docker image name * @param {DockerOptions} [options] */ constructor(masternodeKey?: MasterNodeKey, image?: string, options?: DockerOptions); /** * Additional debug options turned on for traceability. */ protected getCmd(opts: StartOptions): string[]; /** * @param {number} nblocks to generate * @param {string} address to generate to * @param {number} maxTries */ generate(nblocks: number, address?: string, maxTries?: number): Promise<void>; /** * @param {number} nblocks to generate * @param {number} timeout * @param {string} address */ waitForGenerate(nblocks: number, timeout?: number, address?: string): Promise<void>; /** * This will automatically import the necessary private key for master to mint tokens */ start(startOptions?: StartOptions): Promise<void>; /** * Wait for block height by minting towards the target * * @param {number} height to wait for * @param {number} [timeout=90000] in ms */ waitForBlockHeight(height: number, timeout?: number): Promise<void>; /** * Wait for master node wallet coin to be mature for spending. * * A coinbase transaction must be 100 blocks deep before you can spend its outputs. This is a * safeguard to prevent outputs that originate from the coinbase transaction from becoming * un-spendable (in the event the mined block moves out of the active chain due to a fork). * * @param {number} [timeout=180000] in ms */ waitForWalletCoinbaseMaturity(timeout?: number): Promise<void>; /** * Wait for in wallet balance to be greater than an amount. * This allow test that require fund to wait for fund to be filled up before running the tests. * This method will trigger block generate to get to the required balance faster. * Set `timeout` to higher accordingly when large balance required. * * @param {number} balance to wait for in wallet to be greater than or equal * @param {number} [timeout=300000] in ms * @see waitForWalletCoinbaseMaturity */ waitForWalletBalanceGTE(balance: number, timeout?: number): Promise<void>; /** * Wait for anchor teams * * @param {number} nodesLength * @param {number} [timeout=30000] in ms * @return {Promise<void>} */ waitForAnchorTeams(nodesLength: number, timeout?: number): Promise<void>; /** * Wait for anchor auths * * @param {number} nodesLength * @param {number} [timeout=30000] in ms * @return {Promise<void>} */ waitForAnchorAuths(nodesLength: number, timeout?: number): Promise<void>; /** * Wait for anchor reward confirms * * @param {number} [timeout=30000] in ms * @return {Promise<void>} */ waitForAnchorRewardConfirms(timeout?: number): Promise<void>; /** * Wait for price become valid * * @param {string} fixedIntervalPriceId * @param {number} [timeout=30000] in ms * @return {Promise<void>} */ waitForPriceValid(fixedIntervalPriceId: string, timeout?: number): Promise<void>; /** * Wait for price become invalid * * @param {string} fixedIntervalPriceId * @param {number} [timeout=30000] in ms * @return {Promise<void>} */ waitForPriceInvalid(fixedIntervalPriceId: string, timeout?: number): Promise<void>; waitForVaultState(vaultId: string, state: string, timeout?: number): Promise<void>; /** * Wait for active price * * @param {string} fixedIntervalPriceId * @param {string} activePrice * @param {number} [timeout=30000] in ms * @return {Promise<void>} */ waitForActivePrice(fixedIntervalPriceId: string, activePrice: string, timeout?: number): Promise<void>; /** * Wait for next price * * @param {string} fixedIntervalPriceId * @param {string} nextPrice * @param {number} [timeout=30000] in ms * @return {Promise<void>} */ waitForNextPrice(fixedIntervalPriceId: string, nextPrice: string, timeout?: number): Promise<void>; /** * Fund an address with an amount and wait for 1 confirmation. * Funded address don't have to be tracked within the node wallet. * This allows for light wallet implementation testing. * * @param {string} address to fund * @param {number} amount to fund an address, take note of number precision issues, BigNumber not included in pkg. * @return {Promise<{txid: string, vout: number}>} txid and index of the transaction * @see waitForWalletCoinbaseMaturity * @see waitForWalletBalanceGTE */ fundAddress(address: string, amount: number): Promise<{ txid: string; vout: number; }>; /** * Create a new bech32 address and get the associated priv key for it. * The address is created in the wallet and the priv key is dumped out. * This is to facilitate raw tx feature testing, if you need an address that is not associated with the wallet, * use jellyfish-crypto instead. * * This is not a deterministic feature, each time you run this, you get a different set of address and keys. * * @return {Promise<{ address: string, privKey: string, pubKey: string }>} a new address and it's associated privKey */ newAddressKeys(): Promise<{ address: string; privKey: string; pubKey: string; }>; } //# sourceMappingURL=Masternode.d.ts.map