0.2.1-alpha.0 • Published 4 years ago

tsoposki-ptokens-peos v0.2.1-alpha.0

Weekly downloads
1
License
ISC
Repository
-
Last release
4 years ago

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')
}