@vafanassieff/bitcoin-cli-ts
Version:
Auto-generated Bitcoin client library for bitcoind JSON-RPC API
24 lines (20 loc) • 771 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 ImportWalletParams = {
bitcoind: Bitcoind
/* The wallet file */
filename: string
}
/**
* importwallet "filename"
*
* Imports keys from a wallet dump file (see dumpwallet). Requires a new wallet backup to include imported keys.
* Note: Blockchain and Mempool will be rescanned after a successful import. Use "getwalletinfo" to query the scanning progress.
* Note: This command is only compatible with legacy wallets.
*
*/
export function importWallet(params: ImportWalletParams) {
const { bitcoind, ...methodParams } = params
return request({ method: 'importwallet', params: methodParams }, bitcoind)
}