-
Notifications
You must be signed in to change notification settings - Fork 111
/
Copy pathget_account_info.go
26 lines (20 loc) · 1.08 KB
/
get_account_info.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
package rpc
import (
"context"
)
type GetAccountResponse JsonRpcResponse[GetAccountInfo]
type GetAccountInfo ValueWithContext[AccountInfo]
// GetAccountInfoConfig is an option config for `getAccountInfo`
type GetAccountInfoConfig struct {
Commitment Commitment `json:"commitment,omitempty"`
Encoding AccountEncoding `json:"encoding,omitempty"`
DataSlice *DataSlice `json:"dataSlice,omitempty"`
}
// GetAccountInfo returns all information associated with the account of provided Pubkey
func (c *RpcClient) GetAccountInfo(ctx context.Context, base58Addr string) (JsonRpcResponse[ValueWithContext[AccountInfo]], error) {
return call[JsonRpcResponse[ValueWithContext[AccountInfo]]](c, ctx, "getAccountInfo", base58Addr)
}
// GetAccountInfo returns all information associated with the account of provided Pubkey
func (c *RpcClient) GetAccountInfoWithConfig(ctx context.Context, base58Addr string, cfg GetAccountInfoConfig) (JsonRpcResponse[ValueWithContext[AccountInfo]], error) {
return call[JsonRpcResponse[ValueWithContext[AccountInfo]]](c, ctx, "getAccountInfo", base58Addr, cfg)
}