UNPKG

bitcoincore-node

Version:

A comprehensive Node.js package for interacting with Bitcoin Core via RPC. Create, sign, and broadcast Bitcoin transactions, manage wallets, and access blockchain data through an easy-to-use API interface. Perfect for developers building cryptocurrency ap

55 lines (54 loc) 2.03 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ControlRPC = void 0; class ControlRPC { constructor(bitcoinCore) { this.bitcoinCore = bitcoinCore; } // getmemoryinfo getMemoryInfo() { return __awaiter(this, arguments, void 0, function* (mode = 'stats') { return this.bitcoinCore.callMethod('getmemoryinfo'); }); } // getrpcinfo getRpcInfo() { return __awaiter(this, void 0, void 0, function* () { return this.bitcoinCore.callMethod('getrpcinfo'); }); } // help help(command) { return __awaiter(this, void 0, void 0, function* () { return this.bitcoinCore.callMethod('help', [command]); }); } // logging logging() { return __awaiter(this, arguments, void 0, function* (include = [], exclude = []) { return this.bitcoinCore.callMethod('logging', [include, exclude]); }); } // stop stop() { return __awaiter(this, void 0, void 0, function* () { return this.bitcoinCore.callMethod('stop'); }); } // uptime uptime() { return __awaiter(this, void 0, void 0, function* () { return this.bitcoinCore.callMethod('uptime'); }); } } exports.ControlRPC = ControlRPC;