Skip to content

Commit

Permalink
feat: add maxSupportedTransactionVersion to getParsedTransaction opt (#…
Browse files Browse the repository at this point in the history
…143)

Co-authored-by: Mitchel Kelonye <vbstreetz@gmail.com>
  • Loading branch information
kelonye and Mitchel Kelonye committed Oct 4, 2023
1 parent 834605a commit 4493616
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rpc/getParsedTransaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ import (
)

type GetParsedTransactionOpts struct {
// Desired commitment. "processed" is not supported. If parameter not provided, the default is "finalized".
Commitment CommitmentType `json:"commitment,omitempty"`

// Max transaction version to return in responses.
// If the requested block contains a transaction with a higher version, an error will be returned.
MaxSupportedTransactionVersion *uint64
}

type GetParsedTransactionResult struct {
Expand All @@ -30,6 +35,9 @@ func (cl *Client) GetParsedTransaction(
if opts.Commitment != "" {
obj["commitment"] = opts.Commitment
}
if opts.MaxSupportedTransactionVersion != nil {
obj["maxSupportedTransactionVersion"] = *opts.MaxSupportedTransactionVersion
}
}
obj["encoding"] = solana.EncodingJSONParsed
params = append(params, obj)
Expand Down

0 comments on commit 4493616

Please sign in to comment.