sbc-sdk
v0.2.0
Published
<p align="center"> <a href="https://www.secureblockchains.com/"><img src="https://github.com/SecureBlockChains/Assets/blob/master/Anchor.png" title="SBC" alt="SBC"></a> </p>
Downloads
3
Readme
SBC-SDK
A Node.js Library for Multiple Ledgers
Install
Insure you have your SSH keys added to your github account before installing
npm install -S SecureBlockChains/SBC-SDK
Examples
Ledgers
const sdk = require('sbc-sdk')
sdk.ledgers;
/*
{
RCL:"rcl",
ETH:"eth",
BTC:"btc",
EOS:"eos"
}
* /
Address Creation
const sdk = require('sbc-sdk')
var newWallet = sdk.newAddress(ledger)
var oldWallet = sdk.importAddress(ledger, secret)
Account Info
const sdk = require('sbc-sdk')
sdk.accountInfo(ledger, address, callback)
Payments
const sdk = require('sbc-sdk')
//memo is only used for xrp exclude for other ledgers
sdk.send(ledger, value, destination, secret, callback, memo)
Transaction
const sdk = require('sbc-sdk')
sdk.transaction(ledger, hash, callback)
history
const sdk = require('sbc-sdk')
sdk.history(ledger, address,callback)
Full History
//this is only used for btc this method will return the same value as the history method for all other ledgers
const sdk = require('sbc-sdk')
sdk.fullHistory(ledger, address,callback)
utility
const RCL = require('sbc-rcl')
const ETH = require('sbc-eth')
const BTC = require('sbc-btc')
var eth = ETH.util.fromWei(1000000000000000000)
var wei = ETH.util.toWei(1)
var drops = RCL.util.toDrops("1.0")
var xrp = RCL.util.fromDrops("1000000")
var btc = BTC.util.fromSatoshi(100000000)
var satoshi = BTC.util.toSatoshi(1)