virtualbox-js
v0.0.5
Published
SDK For Interacting With VirtualCoin In NodeJS
Downloads
1
Readme
virtualbox-nodejs
SDK For Interacting With VirtualCoin In NodeJS
Installation
npm install virtualbox-js
Initialization
const vc = require("virtualbox-js")
let virtualbox = new vc.VirtualBox()
//Initializing With Current Address
virtualbox.init("virtualcoin.glitch.me")
Checking Balance
virtualbox.Balance("address")
.then(balance => console.log(balance))
.catch(err => console.log(err))
//Outputs In Number
Getting A Transaction By Id
virtualbox.GetTxById(id)
.then(tx => console.log(tx))
.catch(err => console.log(err))
//Outputs A Valid Transaction If Exists As An Object
//Outputs A Blank Transaction If It Doesn't Exist As An Object
Getting A List Of Received Txs
virtualbox.ReceivedTx("address")
.then(txs => console.log(txs))
.catch(err => console.log(err))
//Outputs null If No Transactions Were Made Before
//Outputs An Array With A List Of Transactions
Getting A List Of Sent Txs
virtualbox.SentTx("address")
.then(txs => console.log(txs))
.catch(err => console.log(err))
//Outputs null If No Transactions Were Made Before
//Outputs An Array With A List Of Transactions
Creating A Wallet
virtualbox.CreateWallet()
.then(wallet => console.log(wallet))
.catch(err => console.log(err))
//Outputs An Object With Mnemonic, Privatekey and Publickey (address)
Checking If A Transaction Is An Contract
virtualbox.IsContract(id)
.then(iscontract => console.log(iscontract))
.catch(err => console.log(err))
//Outputs True If It Is An Contract, Else False
Sending A Transaction