Skip to content

Latest commit

 

History

History
687 lines (555 loc) · 19.5 KB

api.md

File metadata and controls

687 lines (555 loc) · 19.5 KB

Objects

eos : object

Typedefs

bytes : Buffer | hex
getCodeResult : object
getAbiResult : object
getRawCodeAndAbiResult : object
abiJsonToBinResult : object
abiBinToJsonResult : object
getTableRowsResult : object
getCurrencyStatsResult : object
getProducersResult : object
getProducerScheduleResult : object
getScheduledTransactionsResult : object
pushBlockResult : object
pushTransactionResult : object
getActionsResult : object
getTransactionResult : object
getKeyAccountsResult : object
getControlledAccountsResult : object

eos : object

Kind: global namespace

eos.getInfo() ⇒ string

Return general network information.

Kind: static method of eos
Example

url_path: `/v1/chain/get_info`

Example

eos.getInfo({})

eos.getAccount(accountName) ⇒ string

Fetch a blockchain account

Kind: static method of eos

Param Type
accountName name

Example

url_path: `/v1/chain/get_account`

Example

eos.getAccount(accountName)

eos.getCode(accountName, [codeAsWasm]) ⇒ getCodeResult

Fetch smart contract code

Kind: static method of eos

Param Type Default
accountName name
[codeAsWasm] bool false

Example

url_path: `/v1/chain/get_code`

Example

eos.getCode(accountName, codeAsWasm)

eos.getAbi(accountName) ⇒ getAbiResult

Kind: static method of eos

Param Type
accountName name

Example

url_path: `/v1/chain/get_abi`

Example

eos.getAbi(accountName)

eos.getRawCodeAndAbi(accountName) ⇒ getRawCodeAndAbiResult

Kind: static method of eos

Param Type
accountName name

Example

url_path: `/v1/chain/get_raw_code_and_abi`

Example

eos.getRawCodeAndAbi(accountName)

eos.abiJsonToBin(code, action, args) ⇒ abiJsonToBinResult

Manually serialize json into binary hex. The binayargs is usually stored in Action.data.

Kind: static method of eos

Param Type
code name
action name
args bytes

Example

url_path: `/v1/chain/abi_json_to_bin`

Example

eos.abiJsonToBin(code, action, args)

eos.abiBinToJson(code, action, binargs) ⇒ abiBinToJsonResult

Convert bin hex back into Abi json definition.

Kind: static method of eos

Param Type
code name
action name
binargs bytes

Example

url_path: `/v1/chain/abi_bin_to_json`

Example

eos.abiBinToJson(code, action, binargs)

eos.getRequiredKeys(transaction, availableKeys) ⇒ Set.<public_key>

Kind: static method of eos

Param Type
transaction transaction
availableKeys set.<public_key>

Example

url_path: `/v1/chain/get_required_keys`

Example

eos.getRequiredKeys(transaction, availableKeys)

eos.getBlock(blockNumOrId) ⇒ variant

Fetch a block from the blockchain.

Kind: static method of eos

Param Type
blockNumOrId string

Example

url_path: `/v1/chain/get_block`

Example

eos.getBlock(blockNumOrId)

eos.getBlockHeaderState(blockNumOrId) ⇒ string

Fetch the minimum state necessary to validate transaction headers.

Kind: static method of eos

Param Type
blockNumOrId string

Example

url_path: `/v1/chain/get_block_header_state`

Example

eos.getBlockHeaderState(blockNumOrId)

eos.getTableRows([json], code, scope, table, tableKey, [lowerBound], [upperBound], [limit], keyType, indexPosition) ⇒ getTableRowsResult

Fetch smart contract data from an account.

Kind: static method of eos

Param Type Default Description
[json] bool false
code name
scope string
table name
tableKey string
[lowerBound] string 0
[upperBound] string -1
[limit] uint32 10
keyType string The key type of --index, primary only supports (i64), all others support (i64, i128, i256, float64, float128). Special type 'name' indicates an account name.
indexPosition string 1 - primary (first), 2 - secondary index (in order defined by multi_index), 3 - third index, etc

Example

url_path: `/v1/chain/get_table_rows`

Example

eos.getTableRows(json, code, scope, table, tableKey, lowerBound, upperBound, limit, keyType, indexPosition)

eos.getCurrencyBalance(code, account, symbol) ⇒ Array.<asset>

Kind: static method of eos

Param Type
code name
account name
symbol optional.<string>

Example

url_path: `/v1/chain/get_currency_balance`

Example

eos.getCurrencyBalance(code, account, symbol)

eos.getCurrencyStats(code, symbol) ⇒ getCurrencyStatsResult

Kind: static method of eos

Param Type
code name
symbol string

Example

url_path: `/v1/chain/get_currency_stats`

Example

eos.getCurrencyStats(code, symbol)

eos.getProducers([json], lowerBound, [limit]) ⇒ getProducersResult

Fetch smart contract data from producer.

Kind: static method of eos

Param Type Default
[json] bool false
lowerBound string
[limit] uint32 50

Example

url_path: `/v1/chain/get_producers`

Example

eos.getProducers(json, lowerBound, limit)

eos.getProducerSchedule() ⇒ getProducerScheduleResult

Kind: static method of eos
Example

url_path: `/v1/chain/get_producer_schedule`

Example

eos.getProducerSchedule()

eos.getScheduledTransactions([json], lowerBound, [limit]) ⇒ getScheduledTransactionsResult

Kind: static method of eos

Param Type Default Description
[json] bool false
lowerBound string timestamp OR transaction ID
[limit] uint32 50

Example

url_path: `/v1/chain/get_scheduled_transactions`

Example

eos.getScheduledTransactions(json, lowerBound, limit)

eos.pushBlock(block)

Append a block to the chain database.

Kind: static method of eos

Param Type
block signed_block

Example

url_path: `/v1/chain/push_block`

Example

eos.pushBlock(block)

eos.pushTransaction(signedTransaction) ⇒ pushTransactionResult

Attempts to push the transaction into the pending queue.

Kind: static method of eos

Param Type
signedTransaction signed_transaction

Example

url_path: `/v1/chain/push_transaction`

Example

eos.pushTransaction(signedTransaction)

eos.pushTransactions(signedTransaction) ⇒ vector.<push_transaction.results>

Attempts to push transactions into the pending queue.

Kind: static method of eos

Param Type
signedTransaction signed_transaction

Example

url_path: `/v1/chain/push_transactions`

Example

eos.pushTransactions(signedTransaction)

eos.getActions(accountName, [pos], [offset]) ⇒ getActionsResult

Kind: static method of eos

Param Type Description
accountName account_name
[pos] int32 An absolute sequence positon -1 is the end/last action
[offset] int32 The number of actions relative to pos, negative numbers return [pos-offset,pos), positive numbers return [pos,pos+offset)

Example

url_path: `/v1/history/get_actions`

Example

eos.getActions(accountName, pos, offset)

eos.getTransaction(id, [blockNumHint]) ⇒ getTransactionResult

Retrieve a transaction from the blockchain.

Kind: static method of eos

Param Type
id transaction_id_type
[blockNumHint] uint32

Example

url_path: `/v1/history/get_transaction`

Example

eos.getTransaction(id, blockNumHint)

eos.getKeyAccounts(publicKey) ⇒ getKeyAccountsResult

Kind: static method of eos

Param Type
publicKey public_key_type

Example

url_path: `/v1/history/get_key_accounts`

Example

eos.getKeyAccounts(publicKey)

eos.getControlledAccounts(controllingAccount) ⇒ getControlledAccountsResult

Kind: static method of eos

Param Type
controllingAccount account_name

Example

url_path: `/v1/history/get_controlled_accounts`

Example

eos.getControlledAccounts(controllingAccount)

bytes : Buffer | hex

Kind: global typedef

getCodeResult : object

Kind: global typedef
Properties

Name Type
accountName name
wast string
wasm string
codeHash sha256
abi optional.<abi_def>

getAbiResult : object

Kind: global typedef
Properties

Name Type
accountName name
[abi] abi_def

getRawCodeAndAbiResult : object

Kind: global typedef
Properties

Name Type
accountName name
wasm bytes
[abi] abi_def

abiJsonToBinResult : object

Kind: global typedef
Properties

Name Type
binargs bytes

abiBinToJsonResult : object

Kind: global typedef
Properties

Name Type
args bytes

getTableRowsResult : object

Kind: global typedef
Properties

Name Type Description
rows vector One row per item, either encoded as hex String or JSON object
more bool True if last element in data is not the end and sizeof data() < limit

getCurrencyStatsResult : object

Kind: global typedef
Properties

Name Type
supply asset
maxSupply asset
issuer account_name

getProducersResult : object

Kind: global typedef
Properties

Name Type Description
rows vector one row per item, either encoded as hex String or JSON object
totalProducerVoteWeight double total vote
more string fill lower_bound with this value to fetch more rows

getProducerScheduleResult : object

Kind: global typedef
Properties

Name Type
vector proposed

getScheduledTransactionsResult : object

Kind: global typedef
Properties

Name Type Description
vector transactions
more string fill lower_bound with this to fetch next set of transactions

pushBlockResult : object

Kind: global typedef

pushTransactionResult : object

Kind: global typedef
Properties

Name Type
transactionId fixed_bytes32
processed bytes

getActionsResult : object

Kind: global typedef
Properties

Name Type
actions Array.<ordered_action_result>
lastIrreversibleBlock uint32
[timeLimitExceededError] bool

getTransactionResult : object

Kind: global typedef
Properties

Name Type
id transaction_id_type
trx variant
blockTime block_timestamp_type
blockNum uint32
lastIrreversibleBlock uint32
traces Array.<variant>

getKeyAccountsResult : object

Kind: global typedef
Properties

Name Type
accountNames Array.<account_name>

getControlledAccountsResult : object

Kind: global typedef
Properties

Name Type
controlledAccounts Array.<account_name>