-
Notifications
You must be signed in to change notification settings - Fork 111
/
Copy pathget_signature_statuses.go
33 lines (25 loc) · 1.29 KB
/
get_signature_statuses.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
30
31
32
33
package rpc
import (
"context"
)
type GetSignatureStatusesResponse JsonRpcResponse[GetSignatureStatuses]
type GetSignatureStatuses ValueWithContext[SignatureStatuses]
type SignatureStatus struct {
Slot uint64 `json:"slot"`
Confirmations *uint64 `json:"confirmations"`
ConfirmationStatus *Commitment `json:"confirmationStatus"`
Err any `json:"err"`
}
type SignatureStatuses []*SignatureStatus
// GetSignatureStatusesConfig is a option config for `getSignatureStatuses`
type GetSignatureStatusesConfig struct {
SearchTransactionHistory bool `json:"searchTransactionHistory,omitempty"`
}
// GetSignatureStatuses returns the SOL balance
func (c *RpcClient) GetSignatureStatuses(ctx context.Context, signatures []string) (JsonRpcResponse[ValueWithContext[SignatureStatuses]], error) {
return call[JsonRpcResponse[ValueWithContext[SignatureStatuses]]](c, ctx, "getSignatureStatuses", signatures)
}
// GetSignatureStatusesWithConfig returns the SOL balance
func (c *RpcClient) GetSignatureStatusesWithConfig(ctx context.Context, signatures []string, cfg GetSignatureStatusesConfig) (JsonRpcResponse[ValueWithContext[SignatureStatuses]], error) {
return call[JsonRpcResponse[ValueWithContext[SignatureStatuses]]](c, ctx, "getSignatureStatuses", signatures, cfg)
}