solana icon indicating copy to clipboard operation
solana copied to clipboard

Add transaction signature to getSignatureStatuses response in JSON RPC API

Open Antonji-py opened this issue 1 year ago • 1 comments

Problem

Currently when you use the getSignatureStatuses method on JSON RPC API statuses are in the same order as passed to the function and that is all you know. It will be very useful to also have a transaction signature for which this status is in a separate field. Small change but makes it easier to manage those statuses.

Proposed Solution

Add transaction signature to response from getSignatureStatuses. Example:

{
   "jsonrpc":"2.0",
   "result":{
      "context":{
         "apiVersion":"1.10.26",
         "slot":139706152
      },
      "value":[
         {
            "signature":"3xFCbyfYKvGqZnyDotB86NKsUaUiAwZDYh7tLY6NWGHBQdawykkdSwgftsr5eq6ThxAg19kxrFqgTPacKsBrkCTL",
            "confirmationStatus":"confirmed",
            "confirmations":6,
            "err":"None",
            "slot":139706145,
            "status":{
               "Ok":"None"
            }
         },
         {
            "signature":"3VQoXNrjUEaMp7QmUeKLoJkXgHYeoTY77dUcWFGdNBenSnaQpZqAWx7C48UQm3MCpKt6KPDXE6ru5SxMLQ2pniiW",
            "confirmationStatus":"confirmed",
            "confirmations":6,
            "err":"None",
            "slot":139706145,
            "status":{
               "Ok":"None"
            }
         }
      ]
   },
   "id":3
}

Antonji-py avatar Jun 30 '22 23:06 Antonji-py

+1 But now we can consider that the order may not be respected though.

timaiv avatar Aug 09 '22 09:08 timaiv

I'm disinclined to send 100+ more bytes per status over the wire. Given that the order will always be respected, it should be straightforward to build objects like your example from the list of signatures and the response. Closing this as not planned for now.

CriesofCarrots avatar Nov 03 '22 04:11 CriesofCarrots