0.2.1-alpha.0 • Published 4 years ago

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

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

ptokens-pltc

Module for interacting only with pLTC.

 


 

Installation:

npm install ptokens-pltc

 


 

Usage:

const pLTC = require('ptokens-pltc')

const pltc = new pLTC({
  ethPrivateKey: 'Eth private key',
  ethProvider: 'Eth provider',
  ltcNetwork: 'testnet' //can be 'litecoin' or 'testnet'. default 'testnet'
})

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 pLTC = require('ptokens-pltc')

if (window.web3) {
  
  const pltc = new pLTC({
    ethProvider: window.web3.currentProvider,
    ltcNetwork: 'testnet'
  })
} else {
  console.log('No web3 detected')
}