Methods

buyRam (bytes, ?payer)

Buy ram for this account

Defaults/Optionals:

  • payer - current account

const eoslime = require('eoslime').init();
// Existing accounts on local network
let payer = eoslime.Account.load('myAcc1', 'myPrivateKey1');
let account2 = eoslime.Account.load('myAcc2', 'myPrivateKey2');

// Payer will buy ram for account2
await account2.buyRam(1000,  payer);

buyBandwidth (cpu, net, ?payer)

Buy cpu and network for this account

Defaults/Optionals:

  • payer - current account

const eoslime = require('eoslime').init();
// Existing accounts on local network
let payer = eoslime.Account.load('myAcc1', 'myPrivateKey1');
let account2 = eoslime.Account.load('myAcc2', 'myPrivateKey2');

// Payer will buy cpu and network for account2 for 100 EOS 
await account2.buyBandwidth('100.0000 EOS', '100.0000 EOS', payer);

send (receiver, amount, symbol)

Send tokens to another account

Defaults/Optionals:

  • symbol - EOS

addAuthority (authorityName, ?threshold)

Creates a new authority and add current account public key in it

Defaults/Optionals:

  • threshold - 1

setAuthorityAbilities(authority, abilities)

Once you add a sub authority, it can not process whatever transaction. You should define what actions of which contracts the authority has permissions to execute.

Parameters

  1. authority - The name of the authority the abilities will be applied to

  2. abilities - Array of the following objects

increaseThreshold(threshold)

Increase the authority threshold.

It is useful when you have multiple keys or accounts operating from an authority. This method will allow you to prepare a multisignature account.

addPermission (permission, ?weight)

Add permission to authority such as eosio.code

Defaults/Optionals:

  • weight - 1

Adding eosio.code permission would result in

addOnBehalfAccount(accountName, authority, ?weight)

Allow another account to act from your authority

addOnBehalfKey(publicKey, ?weight)

Add more keys to your authority

setWeight(weight)

Set weight on account public key. This applies to current account authority.

If you have loaded your account with active authority and public key pub_key this will result in

getAuthorityInfo()

Returns information for loaded authority

getBalance (?symbol, ?code)

Returns the account balance

Defaults/Optionals:

  • symbol - EOS

  • code - eosio.token

Last updated

Was this helpful?