Websocket
Websocket Interfaces
The websocket interface of Zetrix handles various defined message types.
Message Type
Notification Message Registration
Function
The client registers the message with the blockchain through the interface, that is, the type of the message that needs to be received (currently the function is unavailable). The version information of the blockchain can only be obtained through this interface.
Request Message Type
CHAIN_HELLO
Request Data Object
Request Parameter
Reponse Message Type
CHAIN_HELLO
Reponse Data Object
Reponse Result
Submit Transaction
Function
The transaction that will need to be executed is sent to the blockchain execution through the message type. Please refer to Transaction structure for details of the transaction structure.
Request Message Type
CHAIN_SUBMITTRANSACTION
Request Message Object
Request Parameter
Reponse Message Type
CHAIN_TX_STATUS
:Returns the result of the transaction submission (the successful submission of the transaction does not mean that the transaction was executed successfully).CHAIN_TX_ENV_STORE
:Returns the result of the transaction execution.
CHAIN_TX_STATUS
ObjectChainTxStatus
MemberCHAIN_TX_ENV_STORE
ObjectTransactionEnvStore
Member
Message Subscription
Function
This interface implements transaction notifications that only specify the account address of the interface.
Request Message Type
CHAIN_SUBSCRIBE_TX
Request Data Object
Request Parameter
Reponse Message Type
ChainResponse
Reponse Data Object
Reponse Result
Transaction structure
In protobuf format
Keywords in protobuf
Operations structure
The corresponding operations
in the protobuf structure of the transaction can contain one or more operations.
In protobuf format
Keyword in protobuf
Operation Codes
Creating Accounts
The source account creates a new account on the blockchain. Creating Accounts are divided into Creating Normal Accounts and Creating Contract Accounts.
Protobuf format as follow:
Creating Normal Accounts
Note: Both
master_weight
andtx_threshold
must be 1 in the current operation. And only the following keywords are allowed to be initialized.
Keyword in protobuf
Query
The account information is queried through the getAccount interface in HTTP.
Creating Contract Accounts
Note: In the current operation,
master_weight
must be 0 andtx_threshold
must be 1. And only the following keywords are allowed to be initialized
Keyword in protobuf
Query
The account information is queried through the getAccount interface in HTTP.
Query with the getTransactionHistory interface in HTTP, and the result is as follows:
Issuing Assets
Function
The source account of this operation issues a digital asset, and this asset appears in the asset balance of the source account after successful execution.
In protobuf format
Keyword in protobuf
Transferring Assets
Note: If the target account is a contract account, the current operation triggers the contract execution of the target account.
Function
The source account of this operation transfers an asset to the target account.
In protobuf format
Keyword in protobuf
Setting Metadata
Function
The source account of this operation modifies or adds metadata to the metadata table.
In protobuf format
Keyword in protobuf
Setting Privileges
Function
Set the weights that the signer has and set the thresholds required for each operation. For details, see Assignment of Control Rights in HTTP.
In protobuf format
Keywords in protobuf
Transferring Gas Assets
Note: If the target account is a contract account, the current operation triggers the contract execution of the target account.
Function
Two functions:
The source account of this operation transfers a Gas asset to the target account.
The source account of this operation creates a new account on the blockchain.
In protobuf format
protobufKeyword
Recording Logs
Function
The source account of this operation writes the log to the blockchain.
In protobuf format
protobufKeyword
Error Codes
The error code is composed of two parts:
error_code : Error code, approximate error classification
error_desc : Error Description, which can accurately find the error specific information from the error description
The error list is as follows:
Last updated