-
Notifications
You must be signed in to change notification settings - Fork 111
/
Copy pathget_multiple_accounts.go
29 lines (22 loc) · 1.27 KB
/
get_multiple_accounts.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package rpc
import (
"context"
)
type GetMultipleAccountsResponse JsonRpcResponse[GetMultipleAccounts]
type GetMultipleAccounts ValueWithContext[[]AccountInfo]
// GetMultipleAccountsConfigEncoding is account's data encode format
type GetMultipleAccountsConfigEncoding string
// GetMultipleAccountsConfig is an option config for `getAccountInfo`
type GetMultipleAccountsConfig struct {
Commitment Commitment `json:"commitment,omitempty"`
Encoding AccountEncoding `json:"encoding,omitempty"`
DataSlice *DataSlice `json:"dataSlice,omitempty"`
}
// GetMultipleAccounts returns all information associated with the account of provided Pubkey
func (c *RpcClient) GetMultipleAccounts(ctx context.Context, base58Addrs []string) (JsonRpcResponse[ValueWithContext[[]AccountInfo]], error) {
return call[JsonRpcResponse[ValueWithContext[[]AccountInfo]]](c, ctx, "getMultipleAccounts", base58Addrs)
}
// GetMultipleAccounts returns all information associated with the account of provided Pubkey
func (c *RpcClient) GetMultipleAccountsWithConfig(ctx context.Context, base58Addrs []string, cfg GetMultipleAccountsConfig) (JsonRpcResponse[ValueWithContext[[]AccountInfo]], error) {
return call[JsonRpcResponse[ValueWithContext[[]AccountInfo]]](c, ctx, "getMultipleAccounts", base58Addrs, cfg)
}