Skip to content

TRON-US/soter-sdk-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

In the Browser through <script> tag

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.

Query examples

await 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()

await soter.set.setAutopay()

await soter.set.setSignAutopayRawData()

await soter.set.setSignAutopay()

Update examples

await soter.update.userInformation(path)

await soter.update.userSignInformationRawData()

await soter.update.userSignInformation()

Addfiles examples

await soter.add.addFile()

await soter.add.signAddFileRawData()

await soter.add.signAddFile()

await soter.addStream.addStreamFile()

License

MIT