@vafanassieff/bitcoin-cli-ts
Version:
Auto-generated Bitcoin client library for bitcoind JSON-RPC API
23 lines (19 loc) • 570 B
text/typescript
// Auto synced from github actions. Don't change this file
import { Bitcoind } from '../../types.js'
import request from '../../rpc-request.js'
type SetMockTimeParams = {
bitcoind: Bitcoind
/* UNIX epoch time
Pass 0 to go back to using the system time. */
timestamp: number
}
/**
* setmocktime timestamp
*
* Set the local time to given timestamp (-regtest only)
*
*/
export function setMockTime(params: SetMockTimeParams) {
const { bitcoind, ...methodParams } = params
return request({ method: 'setmocktime', params: methodParams }, bitcoind)
}