UNPKG

@vafanassieff/bitcoin-cli-ts

Version:

Auto-generated Bitcoin client library for bitcoind JSON-RPC API

25 lines (21 loc) 702 B
// Auto synced from github actions. Don't change this file import { Bitcoind } from '../../types.js' import request from '../../rpc-request.js' type WaitForBlockParams = { bitcoind: Bitcoind /* Block hash to wait for. */ blockhash: string /* Time in milliseconds to wait for a response. 0 indicates no timeout. */ timeout?: number } /** * waitforblock "blockhash" ( timeout ) * * Waits for a specific new block and returns useful info about it. * Returns the current block on timeout or exit. * */ export function waitForBlock(params: WaitForBlockParams) { const { bitcoind, ...methodParams } = params return request({ method: 'waitforblock', params: methodParams }, bitcoind) }