Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions rpc/getAccountInfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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}
Expand Down
3 changes: 3 additions & 0 deletions rpc/getMultipleAccounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
3 changes: 3 additions & 0 deletions rpc/getProgramAccounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ func (cl *Client) GetProgramAccountsWithOpts(
"length": opts.DataSlice.Length,
}
}
if opts.ChangedSinceSlot != nil {
obj["changedSinceSlot"] = *opts.ChangedSinceSlot
}
}

params := []any{publicKey, obj}
Expand Down
3 changes: 3 additions & 0 deletions rpc/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading