Improve documentation of sendTransaction (#14770)

* Improve documentation of sendTransaction

* Apply suggestions from code review

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Word wrap and improve terminology

* Tweak

* Oops

* Apply suggestions from code review

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
This commit is contained in:
Ryo Onodera
2021-01-23 18:51:25 +09:00
committed by GitHub
parent 66fd187f16
commit 1d87091d51
2 changed files with 31 additions and 5 deletions

View File

@ -120,8 +120,8 @@ Requests can be sent in batches by sending an array of JSON-RPC request objects
- Hash: A SHA-256 hash of a chunk of data.
- Pubkey: The public key of a Ed25519 key-pair.
- Signature: An Ed25519 signature of a chunk of data.
- Transaction: A Solana instruction signed by a client key-pair.
- Transaction: A list of Solana instructions signed by a client keypair to authorize those actions.
- Signature: An Ed25519 signature of transaction's payload data including instructions. This can be used to identify transactions.
## Configuring State Commitment
@ -642,7 +642,7 @@ Transactions are quite different from those on other blockchains. Be sure to rev
The JSON structure of a transaction is defined as follows:
- `signatures: <array[string]>` - A list of base-58 encoded signatures applied to the transaction. The list is always of length `message.header.numRequiredSignatures`, and the signature at index `i` corresponds to the public key at index `i` in `message.account_keys`.
- `signatures: <array[string]>` - A list of base-58 encoded signatures applied to the transaction. The list is always of length `message.header.numRequiredSignatures` and not empty. The signature at index `i` corresponds to the public key at index `i` in `message.account_keys`. The first one is used as the [transaction id](../../terminology.md#transaction-id).
- `message: <object>` - Defines the content of the transaction.
- `accountKeys: <array[string]>` - List of base-58 encoded public keys used by the transaction, including by the instructions and for signatures. The first `message.header.numRequiredSignatures` public keys must sign the transaction.
- `header: <object>` - Details the account types and signatures required by the transaction.
@ -2795,6 +2795,20 @@ Result:
Submits a signed transaction to the cluster for processing.
This method does not alter the transaction in any way; it relays the
transaction created by clients to the node as-is.
If the node's rpc service receives the transaction, this method immediately
succeeds, without waiting for any confirmations. A successful response from
this method does not guarantee the transaction is processed or confirmed by the
cluster.
While the rpc service will reasonably retry to submit it, the transaction
could be rejected if transaction's `recent_blockhash` expires before it lands.
Use [`getSignatureStatuses`](jsonrpc-api.md#getsignaturestatuses) to ensure
a transaction is processed and confirmed.
Before submitting, the following preflight checks are performed:
1. The transaction signatures are verified
@ -2803,6 +2817,11 @@ Before submitting, the following preflight checks are performed:
disabled if desired. It is recommended to specify the same commitment and
preflight commitment to avoid confusing behavior.
The returned signature is the first signature in the transaction, which
is used to identify the transaction ([transaction id](../../terminology.md#transanction-id)).
This identifier can be easily extracted from the transaction data before
submission.
#### Parameters:
- `<string>` - fully-signed Transaction, as encoded string
@ -2813,7 +2832,7 @@ Before submitting, the following preflight checks are performed:
#### Results:
- `<string>` - Transaction Signature, as base-58 encoded string
- `<string>` - First Transaction Signature embedded in the transaction, as base-58 encoded string ([transaction id](../../terminology.md#transanction-id))
#### Example: