README
soter-sdk-js
BTFS Soter is a charging service gateway based on the TRON Network and BTFS cluster
A set of utilities to help identify BTFS resources
Install
In Node.js through npm
$ npm install soter-sdk
Browser: Browserify, Webpack, other bundlers
The code published to npm that gets loaded on require is in fact an ES5 transpiled version with the right shims added. This means that you can require it and use with your favorite bundler without having to adjust asset management process.
var Soter = require('soter-sdk')
<script>
tag
In the Browser through Loading this module through a script tag will make the Soter
obj available in the global namespace.
<script src="/dist/Soter.js"></script>
<script src="./tronWeb.js"></script>
Usage
const Soter = require('soter-sdk')
const tronWeb = new TronWeb({
fullHost: 'https://api.shasta.trongrid.io',
privateKey: 'your private key'
})
var soter = new Soter(tronWeb)
soter.query.userBalance() // {code: 0, data: {balance: 0}}
API
The target audience for BTFS Soter are developers familiar with HTTP APIs and network development.
examples
Queryawait soter.query.userBalance()
await soter.query.userSignBalanceRawData()
await soter.query.userSignBalance()
await soter.query.depositHistory()
await soter.query.signDepositHistoryRawData()
await soter.query.signDepositHistory()
await soter.query.userOrderList()
await soter.query.userSignOrderListRawData()
await soter.query.userSignOrderList()
await soter.query.userUploaded()
await soter.query.userSignUploadedRawData()
await soter.query.userSignUploaded()
examples
Setawait soter.set.setAutopay()
await soter.set.setSignAutopayRawData()
await soter.set.setSignAutopay()
examples
Updateawait soter.update.userInformation(path)
await soter.update.userSignInformationRawData()
await soter.update.userSignInformation()
examples
Addfilesawait soter.add.addFile()
await soter.add.signAddFileRawData()
await soter.add.signAddFile()
await soter.addStream.addStreamFile()
License
MIT