import { StartedNativeChainContainer } from './NativeChainContainer'; import { DeFiDContainer, MasterNodeRegTestContainer } from '../index'; export declare class NativeChainRpc { private readonly sncc; private readonly rpcUrl; private assumedSpvHeight; static SPV_EXPIRATION: number; constructor(sncc: StartedNativeChainContainer | DeFiDContainer | MasterNodeRegTestContainer, cachedRpcUrl?: string); static generateRpcUrl(sncc: StartedNativeChainContainer): string; /** * For convenience sake, utility rpc for the current node. * JSON 'result' is parsed and returned * @throws NativeChainRpcError is raised for RPC errors */ call(method: string, params?: any): Promise; /** * For convenience’s sake, HTTP POST to the RPC URL for the current node. * Not error checked, returns the raw JSON as string. */ post(body: string): Promise; /** * @param {number} nblocks to generate * @param {string} address to generate to * @param {number} maxTries */ generate(nblocks: number, address?: string | undefined, maxTries?: number): Promise; /** * Convenience method to getmininginfo, typing mapping is non-exhaustive */ getMiningInfo(): Promise<{ blocks: number; chain: string; }>; /** * Convenience method to getblockcount, typing mapping is non exhaustive */ getBlockCount(): Promise; /** * Convenience method to getbestblockhash, typing mapping is non-exhaustive */ getBestBlockHash(): Promise; /** * Connect another node * @param {string} ip * @return {Promise} */ addNode(ip: string): Promise; getNewAddress(label?: string, addressType?: 'legacy' | 'p2sh-segwit' | 'bech32' | 'eth' | string): Promise; /** * Get next price block before the given target block * * @param {string} fixedIntervalPriceId * @param {number} [targetBlock] * @return {Promise} */ getImmediatePriceBlockBeforeBlock(fixedIntervalPriceId: string, targetBlock: number): Promise; /** * 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; }>; /** ---- SPV FUNCTIONS ---- */ /** * Funds a Bitcoin address with 1 BTC(for test purposes only) * * @param {number} address A bitcoin address * @return {string} txid */ spvFundAddress(address: string): Promise; /** * Set last processed block height. * * @param {number} height BTC chain height */ spvSetLastHeight(height: number): Promise; increaseSpvHeight(height?: number): Promise; } /** * RPC error from container */ export declare class NativeChainRpcError extends Error { constructor(error: { code: number; message: string; }); } //# sourceMappingURL=NativeChainRpc.d.ts.map