diff --git a/rpc/getAccountInfo.go b/rpc/getAccountInfo.go index 00784aa5..95c4fa5f 100644 --- a/rpc/getAccountInfo.go +++ b/rpc/getAccountInfo.go @@ -85,6 +85,9 @@ type GetAccountInfoOpts struct { // The minimum slot that the request can be evaluated at. // This parameter is optional. MinContextSlot *uint64 + + // Return only if the account(s) have changed since this slot + ChangedSinceSlot *uint64 `json:"changedSinceSlot,omitempty"` } // GetAccountInfoWithOpts returns all information associated with the account of provided publicKey. @@ -135,6 +138,9 @@ func (cl *Client) getAccountInfoWithOpts( if opts.MinContextSlot != nil { obj["minContextSlot"] = *opts.MinContextSlot } + if opts.ChangedSinceSlot != nil { + obj["changedSinceSlot"] = *opts.ChangedSinceSlot + } } params := []any{account} diff --git a/rpc/getMultipleAccounts.go b/rpc/getMultipleAccounts.go index 99f21157..01c8fe17 100644 --- a/rpc/getMultipleAccounts.go +++ b/rpc/getMultipleAccounts.go @@ -68,6 +68,9 @@ func (cl *Client) GetMultipleAccountsWithOpts( if opts.MinContextSlot != nil { obj["minContextSlot"] = *opts.MinContextSlot } + if opts.ChangedSinceSlot != nil { + obj["changedSinceSlot"] = *opts.ChangedSinceSlot + } if len(obj) > 0 { params = append(params, obj) } diff --git a/rpc/getProgramAccounts.go b/rpc/getProgramAccounts.go index 6451c768..c0f4a013 100644 --- a/rpc/getProgramAccounts.go +++ b/rpc/getProgramAccounts.go @@ -59,6 +59,9 @@ func (cl *Client) GetProgramAccountsWithOpts( "length": opts.DataSlice.Length, } } + if opts.ChangedSinceSlot != nil { + obj["changedSinceSlot"] = *opts.ChangedSinceSlot + } } params := []any{publicKey, obj} diff --git a/rpc/types.go b/rpc/types.go index d1c39647..d6dd8fc7 100644 --- a/rpc/types.go +++ b/rpc/types.go @@ -406,6 +406,9 @@ type GetProgramAccountsOpts struct { // Filter results using various filter objects; // account must meet all filter criteria to be included in results. Filters []RPCFilter `json:"filters,omitempty"` + + // Return only the accounts that have changed since this slot + ChangedSinceSlot *uint64 `json:"changedSinceSlot,omitempty"` } type GetProgramAccountsResult []*KeyedAccount