Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

bch.js - Bitcoin Cash JavaScript API

License

NotificationsYou must be signed in to change notification settings

panda-suite/bchjs

Repository files navigation

bch.js is a lightweight wrapper around a Bitcoin Cash Node RPC. This allows you to easily create tooling around any Bitcoin Cash Node functionality. It uses anHttpProvider API similar to the one used by Ethereum'sweb3.js, so any developer familiar with Ethereum will feel right at home.

Installation

npm install bchjs

Usage

const{BCH, HttpProvider}=require('bchjs');consthttpBlockchainProvider=newHttpProvider('http://localhost:48332','regtest','regtest');consthttpWalletProvider=newHttpProvider('http://localhost:48332','regtest','regtest');constbch=newBCH(httpBlockchainProvider,httpWalletProvider);awaitbch.rpc.getblockchaininfo();

Pandacash and bchjs

bch.js can be added to your application or tests. It can be configured to connect to any node. You can usepandacash-core local blockchain for local development and testing.

constpanda=require("pandacash-core");const{BCH, HttpProvider}=require('bchjs');constserver=awaitpanda.server().listen({port:48332,walletPort:48333});constbch=newBCH(newHttpProvider('http://localhost:48332'),newHttpProvider('http://localhost:48333'));awaitbch.rpc.getblockchaininfo();

Supported RPC calls

All rpc methods have been added.


[8]ページ先頭

©2009-2025 Movatter.jp