Hedera
The following JSON-RPC methods offer native integration into Hedera utilizing the Hedera APIs and the Hedera SDKs.
Hedera documentation can be found at docs.hedera.com.
The following resources provide specific information referenced in the methods below.
- The Hedera network structure is summarized by Mainnet Nodes
- The full list of Hedera functionality is described by the protobuf definitions: Hedera Functionality
- Further details about these methods can be found in the accompanying Hedera Improvement Proposal: HIP-820
- The
signerAccountId
utilized in the methods below is specified by HIP-30 - A Hedera Transaction ID is composed of the account id that pays for a transaction and the valid start timestamp in nanoseconds: Hedera Transaction ID
- There are pre-processing validation response codes returned by the network: ResponseCodeEnum
Hedera has a separate open-source project implementing parts of the Ethereum JSON-RPC standard which is not covered in this documentation.
Methods
hedera_signAndExecuteTransaction
hedera_signTransaction
hedera_executeTransaction
hedera_signAndExecuteQuery
hedera_signMessage
hedera_getNodeAddresses
hedera_signAndExecuteTransaction
The hedera_signAndExecuteTransaction
method is a generic method for executing a transaction on the Hedera network. A dApp can begin by constructing a transaction with one of the Hedera SDKs or by constructing the raw protobuf messages and may select one or more consensus nodes that are authorized to execute the transaction.
The dApp then constructs a list of valid transaction bytes that differ only in the node account id and serializes the list, for example by using the toBytes()
method of an SDK. Finally, the dApp base64 encodes the resulting bytes. This final base64 encoded string of bytes is sent as a method param titled transactionList
to the wallet.
Wallets and SDKs must take special care to deserialize the list of transactions and validate that each transaction in the list differs only in the node authorized to receive the transaction and does NOT differ in intent before submitting to an end user for approval and ultimately signing.
Parameters
Object
- signAndExecuteTransaction parameters 1.1.signerAccountId
:String
- Hedera account id in the format<network>:<shard>.<realm>.<num><-optional-checksum>
1.2.transactionList
:String
- Base64 encoded string of TransactionList bytes
Returns
Object
- Result of transaction submission to Hedera network 1.1.nodeId
:String
- The Hedera node the transaction was submitted to 1.2.transactionHash
:String
- The hash of the transaction 1.3.transactionId
:String
- Transaction ID, which includes the payer account id and the valid start timestamp
Error
In certain conditions, the Hedera network will return a response that signifies a pre-processing validation error, for example, when the transaction has expired. In these cases, wallets will return an error with the following format:
Object
- Result of transaction submission to Hedera network 1.1.code
: 9000 - The reserved WalletConnect error code for unknown errors or errors not related to the WalletConnect protocol 1.2.message
:String
- A human readable string describing the nature of the failure 1.3.data
:Number
- An integer representing the ResponseCodeEnum value returned from the Hedera Node, which indicates the reason for the failure