@vafanassieff/bitcoin-cli-ts
Version:
Auto-generated Bitcoin client library for bitcoind JSON-RPC API
24 lines (20 loc) • 656 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 DumpPrivkeyParams = {
bitcoind: Bitcoind
/* The bitcoin address for the private key */
address: string
}
/**
* dumpprivkey "address"
*
* Reveals the private key corresponding to 'address'.
* Then the importprivkey can be used with this output
* Note: This command is only compatible with legacy wallets.
*
*/
export function dumpPrivkey(params: DumpPrivkeyParams) {
const { bitcoind, ...methodParams } = params
return request({ method: 'dumpprivkey', params: methodParams }, bitcoind)
}