RESTful API service making use of the nodeos RPC API wrapper `eosjs` to obtain data from nodeos
npm install @eosio-toppings/api-rpceosjs to obtain data from nodeos.tsc (TypeScript Compiler) globally with
yarn global add typescript
`Compile and Watch
Compile the source into js and watch for changes into ./dist with the following command:
`
rm -rf dist && tsc -w
`Currently Available API Functions
The following API functions all accept a single parameter, a query which is basically an object containing several keys composed of the necessary values to make the RPC API call.
$3
Given a connected
endpoint with private_key, actor, permission, quantity details, buys ram for the account actor.*
endpoint - string
* private_key - string
* actor - string
* permission - string
* quantity - number $3
Given a connected
endpoint with private_key, actor, permission credentials, make an account consisting of new_account_name with the public new_account_owner_key and public new_account_active_key.
If you want to stake cpu, stake net and buy ram, pass the required parameters.*
endpoint - string
* private_key - string
* actor - string
* permission - string
* new_account_name - string
* new_account_owner_key - string
* new_account_active_key - string
* delagate - boolean (If the delagate is true then buy ram, stake cpu, and stake net actions are executed)
* ram_bytes_buy_quantity - number (default to 8192)
* stake_net_quantity - string (default to '1.0000 SYS')
* stake_cpu_quantity - string (default to '1.0000 SYS')$3
Given a connected
endpoint with private_key, account_name, permission, payload details, deploys contract to the account_name *
endpoint - string
* private_key - string
* account_name - string
* permission - string
* payload - {
abi: '',
wasm: ''
}$3
Given a connected
endpoint, try to get the abi details of account_name directly from the RPC API*
endpoint - string
* account_name - string$3
Given a connected
endpoint, try to get the account details of account_name directly with the RPC API*
endpoint - string
* account_name - string$3
Given a connected
endpoint, try to get the block details of id_or_num directly from the RPC API*
endpoint - string
* id_or_num - string (it can accept either block ID or block number)$3
Given a connected
endpoint, try to get basic information about the blockchain at endpoint*
endpoint - string$3
Given a connected
endpoint, try to get producer schedule in the blockchain at endpoint*
endpoint - string$3
Given a connected
endpoint, try to get producers details in the blockchain at endpoint*
endpoint - string$3
Given a connected
endpoint, try to get the rows of multi-index table table_name of contract_name, if present*
endpoint - string
* contract_name - string
* table_name - string$3
Given a connected
endpoint with private_key, actor, permission credentials, push an action of action_name of the account_name smart contract with parameters contained in payload*
endpoint - string
* account_name - string
* private_key - string
* actor - string
* permission - string
* action_name - string
* payload - object$3
Given a connected
endpoint with private_key, actor, permission, quantity details, sell ram from the account actor.*
endpoint - string
* private_key - string
* actor - string
* permission - string
* quantity - number $3
Given a connected
endpoint with private_key, actor, permission, quantity details, stake cpu for the account actor.*
endpoint - string
* private_key - string
* actor - string
* permission - string
* quantity - number $3
Given a connected
endpoint with private_key, actor, permission, quantity details, stake net for the account actor.*
endpoint - string
* private_key - string
* actor - string
* permission - string
* quantity - number $3
Given a connected
endpoint with private_key, actor, permission, quantity details, unstake cpu for the account actor.*
endpoint - string
* private_key - string
* actor - string
* permission - string
* quantity - number $3
Given a connected
endpoint with private_key, actor, permission, quantity details, unstake net for the account actor.*
endpoint - string
* private_key - string
* actor - string
* permission - string
* quantity - number $3
Given a connected
endpoint with private_key, account_name credentials, push one or two updateauth actions in a single transaction in order to update the public key(s) of account_name
The new_active_key and new_owner_key denote public keys, and can either be passed at the same time or passed one at a time.*
endpoint - string
* account_name - string
* private_key - string
* new_active_key - string
* new_owner_key` - string