Type Definitions
-
AccessToken
-
Access tokens are
name:secret-token
pairs that are granted authorization for accessing Bytom Core features.Type:
- Object
Properties:
Name Type Description id
String User specified, unique identifier.
token
String Only returned in the response from AccessTokensApi~create.
created_at
String Timestamp of token creation, RFC3339 formatted.
-
Account
-
An account is an object in Bytom that tracks ownership of assets on a blockchain.
Type:
- Object
Properties:
Name Type Description id
String Unique account identifier in one Bytom node.
alias
String User specified, unique identifier in one Bytom node.
keys
Array.<Key> The list of keys used to create control programs under the account. Signatures from these keys are required for spending funds held in the account.
key_index
Number The index of keys.
quorum
Number The number of keys required to sign transactions for the account.
-
Asset
-
An asset is a type of value that can be issued on a blockchain. All units of a given asset are fungible. Units of an asset can be transacted directly between parties without the involvement of the issuer.
Type:
- Object
- the asset's issuance program
- the core's VM version
- the hash of asset definition
Properties:
Name Type Description id
String Globally unique identifier of the asset. Asset specifies the asset id as the hash of:
alias
String User specified, unique identifier in one Bytom node.
issuanceProgram
String keys
Array.<Key> The list of keys used to issue units of the asset.
quorum
Number The number of signatures required to issue new units of the asset.
defintion
Object User-specified, arbitrary/unstructured data visible across Bytom blockchain networks. assets specify the definition in their issuance programs, rendering the definition immutable.
-
Balance
-
Any balance on the blockchain is simply a summation of unspent outputs.
Type:
- Object
Properties:
Name Type Description amount
Number Sum of the unspent outputs.
account_alias
String Account alias.
account_id
String Account id.
asset_id
String Asset id.
asset_alias
String Asset alias.
asset_definition
Object Asset definition
-
BlockInfo
-
Type:
- Object
Properties:
Name Type Description hash
String hash of block.
size
Integer size of block.
version
Integer version of block.
height
Integer height of block.
previous_block_hash
String previous block hash.
timestamp
Integer timestamp of block.
nonce
Integer nonce value.
bits
Integer bits of difficulty.
difficulty
String difficulty value(String type).
transaction_merkle_root
String merkle root of transaction.
transaction_status_hash
String merkle root of transaction status.
transactions
Array.<Object> transaction object:
Properties
Name Type Description id
String transaction id, hash of the transaction.
version
Integer version of transaction.
size
Integer size of transaction.
time_range
Integer the unix timestamp for when the requst was responsed.
status_fail
Boolean whether the state of the request has failed.
mux_id
String the previous transaction mux id(source id of utxo).
inputs
Array.<Object> object of inputs for the transaction.
Properties
Name Type Description type
String the type of input action, available option include: 'spend', 'issue', 'coinbase'.
asset_id
String asset id.
asset_alias
String name of asset.
asset_definition
Object definition of asset(json object).
amount
Integer amount of asset.
issuance_program
Object issuance program, it only exist when type is 'issue'.
control_program
Object control program of account, it only exist when type is 'spend'.
address
String address of account, it only exist when type is 'spend'.
spent_output_id
String the front of outputID to be spent in this input, it only exist when type is 'spend'.
account_id
String account id.
account_alias
String name of account.
arbitrary
Object arbitrary infomation can be set by miner, it only exist when type is 'coinbase'.
input_id
String hash of input action.
witness_arguments
Array.<String> witness arguments.
outputs
Array.<Object> object of outputs for the transaction.
Properties
Name Type Description type
String the type of output action, available option include: 'retire', 'control'.
id
String outputid related to utxo.
position
Integer position of outputs.
asset_id
String asset id.
asset_alias
String name of asset.
asset_definition
Object definition of asset(json object).
amount
Integer amount of asset.
account_id
String account id.
account_alias
String name of account.
control_program
Object control program of account.
address
String address of account.
-
CoreInfo
-
Basic information about the configuration of Bytom Core, as well as any errors encountered when updating the local state of the blockchain
More info: {}
Type:
- Object
Properties:
Name Type Description listening
Boolean whether the node is listening.
syncing
Boolean whether the node is syncing.
mining
Boolean whether the node is mining.
peer_count
Integer current count of connected peers.
current_block
Integer current block height in the node's blockchain.
highest_block
Integer current highest block of the connected peers.
network_id
String network id.
version_info
Object bytomd version information:
version
String current version of the running bytomd.
update
uint16 whether there exists an update. 0: no update; 1: small update; 2: significant update.
new_version
String the newest version of bytomd if there is one.
-
Key
-
Cryptographic private keys are the primary authorization mechanism on a blockchain.
Type:
- Object
Properties:
Name Type Description alias
String User specified, unique identifier of the key.
xpub
String Hex-encoded string representation of the key.
-
Receiver
-
A receiver is an object that wraps an account control program with the corresponding address.
Type:
- Object
Properties:
Name Type Description control_program
String The underlying control program that will be used in transactions paying to the address.
address
String The target address one transaction can pay UTXO to.
-
Transaction
-
A blockchain consists of an immutable set of cryptographically linked transactions. Each transaction contains one or more actions.
Type:
- Object
Properties:
Name Type Description tx_id
String Unique transaction identifier.
block_time
String Time of transaction.
inputs
Array.<TransactionInput> List of specified inputs for a transaction.
outputs
Array.<TransactionOutput> List of specified outputs for a transaction.
-
TransactionInput
-
Type:
- Object
Properties:
Name Type Description type
String The type of the input. Possible values are "issue", "spend".
asset_id
String The id of the asset being issued or spent.
asset_alias
String The alias of the asset being issued or spent (possibly null).
asset_definition
Hash The definition of the asset being issued or spent (possibly null).
amount
Integer The number of units of the asset being issued or spent.
spentOutputId
String The id of the output consumed by this input. ID is nil if this is an issuance input.
account_id
String The id of the account transferring the asset (possibly null if the input is an issuance or an unspent output is specified).
account_alias
String The alias of the account transferring the asset (possibly null if the input is an issuance or an unspent output is specified).
issuance_program
String A program specifying a predicate for issuing an asset (possibly null if input is not an issuance).
control_program
String A UTXO control program.
address
String The UTXO address.
-
TransactionOutput
-
Each new transaction in the blockchain consumes some unspent outputs and creates others. An output is considered unspent when it has not yet been used as an input to a new transaction. All asset units on a blockchain exist in the unspent output set.
Type:
- Object
Properties:
Name Type Description id
String The id of the output.
type
String The type of the output. Possible values are "control" and "retire".
transaction_id
String Id of the transaction.
position
Number The output's position in a transaction's list of outputs.
asset_id
String The id of the asset being issued or spent.
asset_alias
String The alias of the asset being issued or spent (possibly null).
asset_definition
Hash The definition of the asset being issued or spent (possibly null).
amount
Integer The number of units of the asset being issued or spent.
account_id
String The id of the account transferring the asset (possibly null).
account_alias
String The alias of the account transferring the asset (possibly null).
control_program
String The control program which must be satisfied to transfer this output.
-
UnspentOutput
-
Each new transaction in the blockchain consumes some unspent outputs and creates others. An output is considered unspent when it has not yet been used as an input to a new transaction. All asset units on a blockchain exist in the unspent output set.
Type:
- Object
Properties:
Name Type Description account_alias
String The alias of the account transferring the asset (possibly null).
account_id
String The id of the account transferring the asset (possibly null).
address
String The output address.
id
String Unique transaction identifier.
amount
Number The number of units of the asset being issued or spent.
asset_alias
String The alias of the asset being issued or spent (possibly null).
asset_id
String The id of the asset being issued or spent.
source_pos
Number The output's position in a transaction's list of outputs.
change
Boolean Whether this output is asset change of one spend.
control_program_index
Number Control program index.
program
String The control program which must be satisfied to transfer this output.
source_id
String The source unspent output id.
valid_height
Number It means coinbase utxo if valid_height > 0.