Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/api/transactionWatch_unstable_submitAndWatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ The string returned by this function is opaque and its meaning can't be interpre

Once this function has been called, the server will try to propagate this transaction over the peer-to-peer network and/or include it onto the chain even if `transactionWatch_unstable_unwatch` is called or that the JSON-RPC client disconnects. In other words, it is not possible to cancel submitting a transaction.

The JSON-RPC server must accept at least 4 `transactionWatch_unstable_submitAndWatch` subscriptions per JSON-RPC client.
Trying to open more might lead to a JSON-RPC error when calling `transactionWatch_unstable_submitAndWatch`.

## Notifications format

This function will later generate one or more notifications in the following format:
Expand Down Expand Up @@ -127,7 +124,7 @@ No more event will be generated about this transaction.

The `invalid` event indicates that the runtime has marked the transaction as invalid.

This can happen for a variety of reasons specific to the chain, such as a bad signature, bad nonce, not enough balance for fees, invalid decoded transaction bytes etc.
This can happen for a variety of reasons specific to the chain, such as a bad signature, bad nonce, not enough balance for fees, etc.
Comment on lines -130 to +127
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wanted to double check this with you:

  • in the error section we mention "no error is produced if the bytes of the transaction, once decoded, are invalid. Instead, an invalid notification will be generated"

If my understanding is correct, wrong inputs (non-hex strings) should lead to an error. Failing to decode the transaction bytes to the shape of what the chain expects should return an Invalid event. Thanks 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence is not about non-hex string. If for example you send 0xaabbccdd for the transaction, you'll get an invalid event rather than a JSON-RPC error.


`error` is a human-readable error message indicating why the transaction is invalid. This string isn't meant to be shown to end users, but is for developers to understand the problem.

Expand Down Expand Up @@ -168,5 +165,4 @@ JSON-RPC servers are allowed to skip sending events as long as it properly keeps

## Possible errors

- A JSON-RPC error with error code `-32800` can be generated if the JSON-RPC client has already opened 4 or more `transactionWatch_unstable_submitAndWatch` subscriptions.
- A JSON-RPC error with error code `-32602` is generated if the `transaction` parameter is not a valid hex string. Note that no error is produced if the bytes of the `transaction`, once decoded, are invalid. Instead, an `invalid` notification will be generated.
A JSON-RPC error is generated if the `transaction` parameter has an invalid format, but no error is produced if the bytes of the `transaction`, once decoded, are invalid. Instead, an `invalid` notification will be generated.