-
Notifications
You must be signed in to change notification settings - Fork 1
/
common_req.go
146 lines (125 loc) · 6.04 KB
/
common_req.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
// Copyright 2024 The go-solana Authors
// This file is part of the go-solana library.
package types
import (
"github.com/cielu/go-solana/common"
)
// RpcCommitmentCfg rpc config of commitment
type RpcCommitmentCfg struct {
Commitment EnumRpcCommitment `json:"commitment,omitempty"`
}
// RpcCommitmentWithEncodingCfg rpc config of commitment
type RpcCommitmentWithEncodingCfg struct {
Commitment EnumRpcCommitment `json:"commitment,omitempty"`
Encoding EnumEncoding `json:"encoding,omitempty"`
}
// RpcCommitmentWithMinSlotCfg commitment & min slot
type RpcCommitmentWithMinSlotCfg struct {
Commitment EnumRpcCommitment `json:"commitment,omitempty"`
MinContextSlot *uint64 `json:"minContextSlot,omitempty"`
}
// RpcGetBlockContextCfg commitment & min slot
type RpcGetBlockContextCfg struct {
Commitment EnumRpcCommitment `json:"commitment,omitempty"`
Encoding EnumEncoding `json:"encoding,omitempty"`
TransactionDetails EnumTxDetailLevel `json:"transactionDetails,omitempty"`
MaxSupportedTxVersion uint8 `json:"maxSupportedTransactionVersion"`
Rewards *bool `json:"rewards,omitempty"`
}
type RpcCommitmentWithIdentity struct {
Commitment EnumRpcCommitment `json:"commitment,omitempty"`
Identity *common.Address `json:"identity,omitempty"`
}
// RpcGetBlockProduction getBlock production
type RpcGetBlockProduction struct {
Commitment EnumRpcCommitment `json:"commitment,omitempty"`
Identity *common.Address `json:"identity,omitempty"`
Range SlotRange `json:"range,omitempty"`
}
// RpcCommitmentWithFilter commitment with filter
type RpcCommitmentWithFilter struct {
Commitment EnumRpcCommitment `json:"commitment,omitempty"`
Filter EnumCirculateFilter `json:"filter,omitempty"`
}
// RpcAccountInfoCfg Get multiple data
type RpcAccountInfoCfg struct {
Encoding EnumEncoding `json:"encoding,omitempty"`
Commitment EnumRpcCommitment `json:"commitment,omitempty"`
MinContextSlot *uint64 `json:"minContextSlot,omitempty"`
DataSlice *DataSlice `json:"dataSlice,omitempty"`
}
type RpcCombinedCfg struct {
WithContext bool `json:"withContext,omitempty"`
Encoding EnumEncoding `json:"encoding,omitempty"`
Commitment EnumRpcCommitment `json:"commitment,omitempty"`
MinContextSlot *uint64 `json:"minContextSlot,omitempty"`
DataSlice *DataSlice `json:"dataSlice,omitempty"`
Filter []map[string]interface{} `json:"filter,omitempty"`
}
type RpcSearchTxHistoryCfg struct {
// if true - a Solana node will search its ledger cache for any signatures not found in the recent status cache
SearchTxHistory bool `json:"searchTransactionHistory,omitempty"`
}
type RpcSignaturesForAddressCfg struct {
Commitment EnumRpcCommitment `json:"commitment,omitempty"`
MinContextSlot *uint64 `json:"minContextSlot,omitempty"`
// Limit: maximum transaction signatures to return (between 1 and 1,000).
Limit *uint `json:"limit,omitempty"`
// start searching backwards from this transaction signature.
// If not provided the search starts from the top of the highest max confirmed block.
Before string `json:"before,omitempty"`
// search until this transaction signature, if found before limit reached
Util string `json:"util,omitempty"`
}
type RpcSupplyCfg struct {
Commitment EnumRpcCommitment `json:"commitment,omitempty"`
// exclude non circulating accounts list from response
ExcludeNonCirculatingAccountsList *bool `json:"excludeNonCirculatingAccountsList,omitempty"`
}
type RpcMintWithProgramID struct {
Mint *common.Address `json:"mint,omitempty"`
ProgramId *common.Address `json:"programId,omitempty"`
}
// RpcGetTransactionCfg commitment & min slot
type RpcGetTransactionCfg struct {
Commitment EnumRpcCommitment `json:"commitment,omitempty"`
Encoding EnumEncoding `json:"encoding,omitempty"`
// MaxSupportedTransactionVersion Set the max transaction version to return in responses.
// If the requested transaction is a higher version, an error will be returned.
// If this parameter is omitted, only legacy transactions will be returned, and any versioned transaction will prompt the error.
MaxSupportedTxVersion uint8 `json:"maxSupportedTransactionVersion,omitempty"`
}
type RpcVoteAccountCfg struct {
// commitment
Commitment EnumRpcCommitment `json:"commitment,omitempty"`
// Only return results for this validator vote address (base-58 encoded)
VotePubkey *common.Address `json:"votePubkey,omitempty"` // optional
// Do not filter out delinquent validators with no stake
KeepUnstakedDelinquents *bool `json:"keepUnstakedDelinquents,omitempty"` // optional
// Specify the number of slots behind the tip that a validator must fall to be considered delinquent. NOTE: For the sake of consistency between ecosystem products, it is not recommended that this argument be specified.
DelinquentSlotDistance *uint64 `json:"delinquentSlotDistance,omitempty"` // optional
}
// RpcSendTxCfg struct
type RpcSendTxCfg struct {
// Encoding used for the transaction data.
// Default: base58
// Values: base58 (slow, DEPRECATED), or base64.
Encoding EnumEncoding `json:"encoding,omitempty"`
// Default: false
// when true, skip the preflight transaction checks
SkipPreflight bool `json:"skipPreflight,omitempty"`
// Default: finalized
// Commitment level to use for preflight.
PreflightCommitment string `json:"preflightCommitment,omitempty"`
// Maximum number of times for the RPC node to retry sending the transaction to the leader.
// If this parameter not provided, the RPC node will retry the transaction until it is finalized or until the blockhash expires.
MaxRetries *uint64 `json:"maxRetries,omitempty"`
// set the minimum slot at which to perform preflight transaction checks
MinContextSlot *uint64 `json:"minContextSlot,omitempty"`
}
type MentionsAccountProgramCfg struct {
MentionsAccountOrProgram common.Address `json:"MentionsAccountOrProgram,omitempty"`
}
type MentionsCfg struct {
Mentions []common.Address `json:"mentions,omitempty"`
}