taiweb3js
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Web3tai.js - TaiYueChain Plus ver

This is the TaiYueChain JavaScript API developed based on the Ethereum version.

Installation

install

npm install taiWeb3js

or update

npm update taiWeb3js

Usage

var Web3tai = require('taiWeb3js');
 
// connect to TrueChain network
var web3tai = new Web3tai('http://localhost:8545', 'tai')
web3tai.eth.getBlockNumber().then(console.log)
// print: block number
 
console.log(web3tai.currentProvider.type)
// print: "tai"
 
// switch network type
// incorrect network correspondence can cause methods to fail!
web3tai.setProvider('http://localhost:8545', 'eth')
web3tai.eth.getBlockNumber().then(console.log)
// Returned error: The method eth_blockNumber does not exist/is not available
 
console.log(web3tai.currentProvider.type)
// print: "eth"

Documentation

The features for the TrueChain network can be seen in this document (Chinese) Ethereum-version documentation can be found at read the docs. Most methods are called in the same way.

Package Sidebar

Install

npm i taiweb3js

Weekly Downloads

3

Version

1.0.0

License

LGPL-3.0

Unpacked Size

654 kB

Total Files

66

Last publish

Collaborators

  • yojiajia