@bywise/web3
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Bywise Web3

Bywise Web3

Contributors Welcome!

Hello, this is a relatively simple library that connects websites with the Bywise blockchain. If you have some basic working JS/TS knowledge, please head over to the open bugs/enhancements and help clear the backlog. Thanks in advance! 🤠

Please don't forget to join our discord community.


Installation

npm install @bywise/web3

Usage

Require in javascript as

const Web3 = require('@bywise/web3');

For typescript, use

import Web3 from '@bywise/web3';

Operations

New instance

const chain = 'testnet';
  
const web3 = new Web3({
    initialNodes: ['https://testnet-node1.bywise.org'],
});

Create simple transaction

const chain = 'testnet';
  
const web3 = new Web3({
    initialNodes: ['https://testnet-node1.bywise.org'],
});
  
const wallet = web3.wallets.createWallet();

await web3.network.tryConnection();
console.log('connected web3');

if (!(await web3.network.testConnections())) {
    throw new Error('connection failed');
}

const receiveAddress = 'BWS1MUf9c74C61328A289B74EC5eD6F8dC994e90449e9c0ca';

const tx = await web3.transactions.buildSimpleTx(wallet, chain, receiveAddress, '100');

await web3.transactions.sendTransactionSync(tx);

Readme

Keywords

Package Sidebar

Install

npm i @bywise/web3

Weekly Downloads

20

Version

1.0.4

License

MIT

Unpacked Size

123 kB

Total Files

49

Last publish

Collaborators

  • felipemarts
  • felipemarts93