0.0.52 • Published 3 years ago

@streambird/web3-core v0.0.52

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Streambird RPC provider

Installation

Yarn

$ yarn add @streambird/rpc-provider

npm

$ npm install @streambird/rpc-provider

Initializing Provider

ES Modules/TypeScript

import { StreambirdRPCProvider } from '@streambird/rpc-provider'
import Web3 from 'web3'

const rpcProvider = new StreambirdRPCProvider({
  // Streambird server url
  endpoint: process.env.SECURED_STREAMBIRD_URL,
  // Node url e.g: https://rinkeby.infura.io/v3/<API_KEY>
  network: process.env.NODE_URL,
  privateKey: process.env.PRIVATE_KEY,
})

const web3 = new Web3(rpcProvider)

CommonJS

const { StreambirdRPCProvider } = require('@streambird/rpc-provider')
const Web3 = require('web3')

const rpcProvider = new StreambirdRPCProvider({
  // Streambird server url
  endpoint: process.env.SECURED_STREAMBIRD_URL,
  // Node url e.g: https://rinkeby.infura.io/v3/<API_KEY>
  network: process.env.NODE_URL,
  privateKey: process.env.PRIVATE_KEY,
})

const web3 = new Web3(rpcProvider)

Get User Info

const address = (await web3.eth.getAccounts())[0]
const balance = web3.utils.fromWei(await web3.eth.getBalance(address))
0.0.51

3 years ago

0.0.52

3 years ago

0.0.50

3 years ago

0.0.49

3 years ago

0.0.40

3 years ago

0.0.41

3 years ago

0.0.42

3 years ago

0.0.43

3 years ago

0.0.44

3 years ago

0.0.45

3 years ago

0.0.34

3 years ago

0.0.46

3 years ago

0.0.35

3 years ago

0.0.36

3 years ago

0.0.48

3 years ago

0.0.37

3 years ago

0.0.39

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago