From 818b323931633949479bd9041b813869bd544be0 Mon Sep 17 00:00:00 2001 From: Quentin <66253985+D-Quentin@users.noreply.github.com> Date: Thu, 28 Mar 2024 21:01:38 +0100 Subject: [PATCH] add maxSupportedTransactionVersion to blockSubscribe (#181) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Quentin Davillé --- rpc/ws/blockSubscribe.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rpc/ws/blockSubscribe.go b/rpc/ws/blockSubscribe.go index 9fdbfba9..e1530f11 100644 --- a/rpc/ws/blockSubscribe.go +++ b/rpc/ws/blockSubscribe.go @@ -67,6 +67,10 @@ type BlockSubscribeOpts struct { // Whether to populate the rewards array. If parameter not provided, the default includes rewards. Rewards *bool + + // 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 } // NOTE: Unstable, disabled by default @@ -114,6 +118,9 @@ func (cl *Client) BlockSubscribe( if opts.Rewards != nil { obj["rewards"] = opts.Rewards } + if opts.MaxSupportedTransactionVersion != nil { + obj["maxSupportedTransactionVersion"] = *opts.MaxSupportedTransactionVersion + } if len(obj) > 0 { params = append(params, obj) }