System Contract
newaccount
Create Contract Account
Parameters
| name | type | description |
|---|---|---|
| creator | string | creator account |
| name | string | The name of the account created |
| owner | string | The public key of the owner permission of the account created |
| active | string | Is the public key of the creator active permission |
Example
fibos.js Runtime:
1 |
|
Browser Runtime:
1 | const FIBOS = require('fibos.js'); |
setcode
deploy JS contract
Parameters
| name | type | description |
|---|---|---|
| account | string | contract account |
| vmtype | uint8 | Contract engine type |
| vmversion | uint8 | Contract engine version |
| code | string | contract code |
Example
fibos.js Runtime:
1 | const FIBOS = require('fibos.js'); |
Browser Runtime:
1 | const FIBOS = require('fibos.js'); |
setabi
deploy abi file
Parameters
| name | type | description |
|---|---|---|
| account | string | Contract account |
| abi | json | abi file code |
Example
fibos.js Runtime:
1 |
|
Browser Runtime:
1 | const FIBOS = require('fibos.js'); |
updateauth
add or edit user permission
Parameters
| name | type | description |
|---|---|---|
| account | string | account name |
| permission | string | An existing permission or a new permission name |
| parent | string | Creates the parent permission of theis permission |
| auth | json | The composition of this permission |
Example
fibos.js Runtime:
1 |
|
Browser Runtime:
1 | const FIBOS = require('fibos.js'); |
deleteauth
delete permission
Parameters
| name | type | description |
|---|---|---|
| account | string | account name |
| permission | string | permission requires to be deleted |
Example
fibos.js Runtime:
1 | const FIBOS = require('fibos.js'); |
Browser Runtime:
1 | const FIBOS = require('fibos.js'); |
linkauth
Specify action for permissions
Parameters
| name | type | description |
|---|---|---|
| account | string | account name |
| code | string | contract name |
| type | string | action name |
| requirement | string | permission name |
Example
fibos.js Runtime:
1 |
|
Browser Runtime:
1 | const FIBOS = require('fibos.js'); |
unlinkauth
actions that permissions can execute
Parameters
| name | type | description |
|---|---|---|
| account | string | account name |
| code | string | contract name |
| type | string | action name |
Example
fibos.js Runtime:
1 | const FIBOS = require('fibos.js'); |
Browser Runtime:
1 | const FIBOS = require('fibos.js'); |
canceldelay
cancel one delay transction
Parameters
| name | type | description |
|---|---|---|
| canceling_auth | String | permission type |
| trx_id | String | transction hash |
Example
fibos.js Runtime:
1 |
|
Browser Runtime:
1 | const FIBOS = require('fibos.js'); |
buyrambytes
payer call this function to storage new account info for receiver.
Parameters
| name | type | description |
|---|---|---|
| payer | string | payer account name |
| receiver | string | receiver account name |
| bytes | uint32 | size of purchased ram |
Example
fibos.js Runtime:
1 |
|
Browser Runtime:
1 | const FIBOS = require('fibos.js'); |
buyram
Buy storage resources, difference is whether buy A specific amount of token or size of content.
Parameters
| name | type | description |
|---|---|---|
| payer | string | buy storage account |
| receiver | string | receiving storage account |
| quant | string | requiring token amount of buying resources |
Example
fibos.js Runtime:
1 |
|
Browser Runtime:
1 | const FIBOS = require('fibos.js'); |
sellram
Sell unnecessary resources
Parameters
| name | type | description |
|---|---|---|
| account | string | Accept account for selling resource token |
| bytes | uint64 | How much space to sell for storage resources |
Example
fibos.js Runtime:
1 |
|
Browser Runtime:
1 | const FIBOS = require('fibos.js'); |
delegatebw
Mortgage token to get cpu and bandwidth resources
Parameters
| name | type | description |
|---|---|---|
| from | string | The account name of the resource mortgagor |
| receiver | string | The account name of the resource recipient |
| stake_net_quantity | string | The mortgagor mortgages FO to obtain NET for the recipient |
| stake_cpu_quantity | string | The mortgagor mortgages FO for the recipient to obtain CPU |
| transfer | bool | Represents whether the mortgage resources are transferred to the recipient at the same time |
Example
fibos.js Runtime:
1 | const FIBOS = require('fibos.js'); |
Browser Runtime:
1 | const FIBOS = require('fibos.js'); |
undelegatebw
Unlock mortgage, release resources, return tokens.
Parameters
| name | type | description |
|---|---|---|
| from | string | Remove the token mortgaged by which account |
| receiver | string | Remove the token on which the account is used as collateral |
| unstake_net_quantity | string | Uncount the number of tokens used to obtain bandwidth resources |
| unstake_cpu_quantity | string | Uncount the number of tokens used to get the calculated resource |
Example
fibos.js Runtime:
1 |
|
Browser Runtime:
1 | const FIBOS = require('fibos.js'); |
refund
call after undelegatebw fuction mortgage unlocked, in order to refund tokens back to account.
Parameters
| name | type | description |
|---|---|---|
| owner | string | return account name |
Example
fibos.js Runtime:
1 |
|
Browser Runtime:
1 | const FIBOS = require('fibos.js'); |
regproducer
register as a block producer
Parameters
| name | type | description |
|---|---|---|
| producer | string | blcok producer account name |
| producer_key | string | block producer public key |
| url | string | block producer website |
| location | uint16 | block producer server location code |
Example
fibos.js Runtime:
1 | const FIBOS = require('fibos.js'); |
Browser Runtime:
1 | const FIBOS = require('fibos.js'); |
unregprod
unregister as a block producer.
Parameters
| name | type | description |
|---|---|---|
| producer | string | account name |
Example
fibos.js Runtime:
1 | const FIBOS = require('fibos.js'); |
Browser Runtime:
1 | const FIBOS = require('fibos.js'); |
regproxy
Register as an agent, allow vote proxy from other users.
Parameters
| name | type | description |
|---|---|---|
| proxy | string | registed account name |
| isproxy | bool | if voter proxy is allowed |
Example
fibos.js Runtime:
1 | const FIBOS = require('fibos.js'); |
Browser Runtime:
1 | const FIBOS = require('fibos.js'); |
voteproducer
vote for producer
Parameters
| name | type | description |
|---|---|---|
| voter | string | voter |
| proxy | string | voter proxy |
| producers | array of strings | producers list |
Example
fibos.js Runtime:
1 |
|
Browser Runtime:
1 | const FIBOS = require('fibos.js'); |
Note: Node vote list requires developers to sort alphabetically, up to 30 BP vote maximum is allowed per time.
claimrewards
block producer claiming rewoards
Parameters
| name | type | description |
|---|---|---|
| owner | string | name of block producer |
Example
fibos.js Runtime:
1 | const FIBOS = require('fibos.js'); |
Browser Runtime:
1 | const FIBOS = require('fibos.js'); |
