Skip to content

Commit 889b6bc

Browse files
committed
Add changedSinceSlot arg for gAI/gMA
1 parent eac694b commit 889b6bc

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

rpc/getAccountInfo.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ type GetAccountInfoOpts struct {
8585
// The minimum slot that the request can be evaluated at.
8686
// This parameter is optional.
8787
MinContextSlot *uint64
88+
89+
// Return only if the account(s) have changed since this slot
90+
ChangedSinceSlot *uint64 `json:"changedSinceSlot,omitempty"`
8891
}
8992

9093
// GetAccountInfoWithOpts returns all information associated with the account of provided publicKey.
@@ -135,6 +138,9 @@ func (cl *Client) getAccountInfoWithOpts(
135138
if opts.MinContextSlot != nil {
136139
obj["minContextSlot"] = *opts.MinContextSlot
137140
}
141+
if opts.ChangedSinceSlot != nil {
142+
obj["changedSinceSlot"] = *opts.ChangedSinceSlot
143+
}
138144
}
139145

140146
params := []any{account}

rpc/getMultipleAccounts.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ func (cl *Client) GetMultipleAccountsWithOpts(
6868
if opts.MinContextSlot != nil {
6969
obj["minContextSlot"] = *opts.MinContextSlot
7070
}
71+
if opts.ChangedSinceSlot != nil {
72+
obj["changedSinceSlot"] = *opts.ChangedSinceSlot
73+
}
7174
if len(obj) > 0 {
7275
params = append(params, obj)
7376
}

0 commit comments

Comments
 (0)