btfs-soter
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

API Documentation

Soter(options: SoterOptions)

Options may contain a tronweb property with a TronWeb instance (defaults to window.tronWeb) as well as an isTest property (defaults to false);

// Mainnet Soter instance using window.tronWeb
const soter = new Soter()

// Testnet Soter instance using window.tronWeb 
// If you use TronLink, make sure to switch to Shasta Testnet
const testSoter = new Soter({isTest: true});

// Soter instance using a custom TronWeb instance
const tronweb = new TronWeb({
                    fullHost: 'https://api.trongrid.io',
                    privateKey: 'your private key'
                });

const options = {
    tronweb,
    isTest: false
}

const soter = new Soter(options);

inquiry

inquiry(file_size: number): Promise<SoterInquiryResponse>

Check whether your currently logged in account has sufficient BTT balance in Soter to upload a file with the given file_size (in Bytes).

add

add(file: File): Promise <SoterAddResponse>

Upload a given File to BTFS via Soter.

recharge

recharge(amount: number): Promise<any>

Recharge BTT balance with the given amount(e.g. amount 1 will recharge 0.000001 BTT, amount 1000000 will recharge 1 BTT) in Soter

Package Sidebar

Install

npm i btfs-soter

Weekly Downloads

1

Version

1.0.5

License

MIT

Unpacked Size

12.9 kB

Total Files

11

Last publish

Collaborators

  • robmarti