npm.io
0.2.1-alpha.0 • Published 6 years ago

tsoposki-ptokens-peos

Licence
ISC
Version
0.2.1-alpha.0
Deps
8
Size
174 kB
Vulns
0
Weekly
0

ptokens-peos

Module for interacting only with pEOS.

 


 

Installation:

npm install ptokens-peos

 


 

Usage:

const pEOS = require('ptokens-peos')

const peos = new pEOS({
  ethPrivateKey: 'Eth private key',
  ethProvider: 'Eth provider',
  eosPrivateKey: 'EOS private key',
  eosRpc: 'EOS RPC Address'
  eosSignatureProvider: 'An EOS Signature Provider'  //if the private key is not passed
})

It is possible to pass a standard Ethereum Provider as the ethProvider value, such as the one injected into the content script of each web page by Metamask(window.web3.currentProvider).

const pEOS = require('ptokens-peos')

if (window.web3) {
  
  const peos = new pEOS({
    ethProvider: window.web3.currentProvider,
  })
} else {
  console.log('No web3 detected')
}