Skip to content

yzkun001/web3-provider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Web3 Provider -- yzkun

How to use

const { HttpProvider, WebsocketProvider } = require('y-web3-provider')

// or

import { HttpProvider, WebsocketProvider} from 'y-web3-provider'


// web3


const web3 = new Web3(new HttpProvider('rpc', 'privateKey'))

v1.1.3

  • 初始化providerKey参数改为可选,可以在使用中再导入账户

  • demo

import { HttpProvider, WebsocketProvider} from 'y-web3-provider'

const web3 = new Web3(new HttpProvider(rpc))

// import account
//private
web3.currentProvider.addWalletFromPrivateKey(privateKey);
// keystote
web3.currentProvider.addWalletFromKeyStore(keyStore, passwd);


// remobe account

web3.currentProvider.removeWallet(address);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published