Documentation
¶
Overview ¶
other gRPC client methods
Index ¶
- Constants
- func EstimateGasCostCallSC(account *wallet.Account, password string, targetAddr string, callerAddr string, ...) (uint64, error)
- func EstimateGasCostExecuteSC(account *wallet.Account, password string, callerAddress string, ...) (uint64, error)
- func GetVersionDigits(status *State) (string, error)
- func NextSlot(c *Client) (uint64, error)
- func ReadOnlyResultToBytes(r *ReadOnlyResult) ([]byte, error)
- func SerializeDatastore(datastore []ContractDatastoreEntry) ([]byte, error)
- type Address
- type Balance
- type BitVecHeadInfo
- type ChangeSet
- type Client
- type ClientConfig
- type Config
- type ConsensusStats
- type ContractDatastore
- type ContractDatastoreEntry
- type DatastoreEntryData
- type DatastoreEntryResponse
- func ContractDatastoreEntries(client *Client, address string, keys [][]byte) ([]DatastoreEntryResponse, error)
- func FetchDatastoreEntries(client *Client, entries []DatastoreEntryData) ([]DatastoreEntryResponse, error)
- func FetchDatastoreEntry(client *Client, address string, key []byte) (*DatastoreEntryResponse, error)
- type DeferredCreditsInfo
- type Event
- type EventContext
- type EventSearchCriteria
- type JSONableSlice
- type LedgerEntryChange
- type LedgerUpdate
- type MassaClient
- func (c *MassaClient) BuyRolls(ctx context.Context, nickname string, password string, rollCount uint64, ...) (string, error)
- func (c *MassaClient) CallSC(ctx context.Context, nickname string, password string, targetAddress string, ...) (string, error)
- func (c *MassaClient) Close() error
- func (c *MassaClient) ExecuteSC(ctx context.Context, nickname string, password string, bytecode []byte, ...) (string, error)
- func (c *MassaClient) GetContext() (context.Context, context.CancelFunc)
- func (c *MassaClient) GetContextWithTimeout(timeout time.Duration) (context.Context, context.CancelFunc)
- func (c *MassaClient) GetDatastoreEntries(ctx context.Context, address string, keys [][]byte) ([]*model.DatastoreEntry, error)
- func (c *MassaClient) NewBlocksServerStream(ctx context.Context, req *pb.NewBlocksServerRequest, ...) error
- func (c *MassaClient) NewBlocksStream(ctx context.Context) (grpc.BidiStreamingClient[pb.NewBlocksRequest, pb.NewBlocksResponse], error)
- func (c *MassaClient) NewEndorsementsServerStream(ctx context.Context, req *pb.NewEndorsementsServerRequest, ...) error
- func (c *MassaClient) NewEndorsementsStream(ctx context.Context) (...)
- func (c *MassaClient) NewFilledBlocksServerStream(ctx context.Context, req *pb.NewFilledBlocksServerRequest, ...) error
- func (c *MassaClient) NewFilledBlocksStream(ctx context.Context) (...)
- func (c *MassaClient) NewOperationsServerStream(ctx context.Context, req *pb.NewOperationsServerRequest, ...) error
- func (c *MassaClient) NewOperationsStream(ctx context.Context) (grpc.BidiStreamingClient[pb.NewOperationsRequest, pb.NewOperationsResponse], ...)
- func (c *MassaClient) NewSlotABICallStacksStream(ctx context.Context) (...)
- func (c *MassaClient) NewSlotExecutionOutputsServerStream(ctx context.Context, req *pb.NewSlotExecutionOutputsServerRequest, ...) error
- func (c *MassaClient) NewSlotExecutionOutputsStream(ctx context.Context) (...)
- func (c *MassaClient) NewSlotTransfersStream(ctx context.Context) (...)
- func (c *MassaClient) NewTransfersInfoServerStream(ctx context.Context, req *pb.NewTransfersInfoServerRequest, ...) error
- func (c *MassaClient) ReadOnlyCallSC(ctx context.Context, targetAddress string, targetFunction string, ...) (*model.ReadOnlyExecutionOutput, error)
- func (c *MassaClient) SellRolls(ctx context.Context, nickname string, password string, rollCount uint64, ...) (string, error)
- func (c *MassaClient) SendBlocksStream(ctx context.Context) (grpc.BidiStreamingClient[pb.SendBlocksRequest, pb.SendBlocksResponse], error)
- func (c *MassaClient) SendEndorsementsStream(ctx context.Context) (...)
- func (c *MassaClient) SendOperation(ctx context.Context, nickname string, password string, ...) (string, error)
- func (c *MassaClient) SendOperationsStream(ctx context.Context) (grpc.BidiStreamingClient[pb.SendOperationsRequest, pb.SendOperationsResponse], ...)
- func (c *MassaClient) SendTransaction(ctx context.Context, nickname string, password string, recipientAddress string, ...) (string, error)
- func (c *MassaClient) TransactionsThroughputServerStream(ctx context.Context, req *pb.TransactionsThroughputServerRequest, ...) error
- func (c *MassaClient) TransactionsThroughputStream(ctx context.Context) (...)
- type NetworkStats
- type PosChanges
- type ReadOnlyCallParams
- type ReadOnlyExecuteParams
- type ReadOnlyResult
- type Result
- type SeedBitsInfo
- type Slot
- type State
- type StateChange
- type StreamHandler
- type Timestamp
Constants ¶
const ( ConfigFile = "config.yaml" MainnetURL = "https://mainnet.massa.net/api/v2" MainnetChainID = 77658377 BuildnetURL = "https://buildnet.massa.net/api/v2" BuildnetChainID = 77658366 // Public API ports DEFAULT_GRPC_PORT = "33037" DEFAULT_JSON_RPC_PORT = "33035" DEFAULT_PERIOD_OFFSET uint64 = 5 DEFAULT_READ_ONLY_CALL_FEE uint64 = 0.01 * 1e9 MANTISSA_SCALE uint32 = 9 DEFAULT_TARGET_NUM_GRPC_AVAILABLE uint32 = 3 DEFAULT_GET_PROVIDER_MAX_RETRIES uint32 = 3 DEFAULT_GET_PROVIDER_RETRY_INTERVAL time.Duration = 5 * time.Second DEFAULT_KDF_ITER = 600_000 DEFAULT_KDF_KEY_LEN = 32 SECRET_KEY_PREFIX = "S" PUBLIC_KEY_PREFIX = "P" ADDRESS_USER_PREFIX = "AU" ADDRESS_CONTRACT_PREFIX = "AS" OPERATION_ID_PREFIX = "O" ADDRESS_PREIX_LENGTH uint64 = 2 KEYS_VERSION_NUMBER uint64 = 0 MAX_BLOCK_GAS = 4_294_967_295 DEFAULT_MAINNET_JSON_RPC = "https://mainnet.massa.net/api/v2" )
const (
PercentageGasLimit = 10
)
Variables ¶
This section is empty.
Functions ¶
func EstimateGasCostCallSC ¶
func GetVersionDigits ¶
GetVersionDigits extracts the version digits from the node version string. Example: "DEVN.1.2" -> "1.2" Example: "MAIN.6.6" -> "6.6"
func ReadOnlyResultToBytes ¶
func ReadOnlyResultToBytes(r *ReadOnlyResult) ([]byte, error)
ReadOnlyResultToBytes extracts the returned payload bytes from a ReadOnlyResult. It supports several JSON shapes returned by the node's `Ok` field: - top-level numeric array: Ok: [14,0,0,0] - nested numeric array: Ok: [[14,0,0,0]] - base64-encoded string: Ok: ["<base64>"] - raw string: Ok: ["raw"] - []byte when already decoded Returns an error if no payload is present or the shape is unsupported.
func SerializeDatastore ¶
func SerializeDatastore(datastore []ContractDatastoreEntry) ([]byte, error)
SerializeDatastore serializes the datastore into a []byte array.
Types ¶
type Address ¶
type Address struct {
Address string `json:"address"`
BlockDraws []string `json:"block_draws"`
BlocksCreated []string `json:"blocks_created"`
CandidateBalance string `json:"candidate_balance"`
CandidateDatastoreKeys [][]byte `json:"candidate_datastore_keys"`
FinalBalance string `json:"final_balance"`
FinalDatastoreKeys [][]byte `json:"final_datastore_keys"`
}
type BitVecHeadInfo ¶
type ChangeSet ¶
type ChangeSet struct {
Set interface{} `json:"Set"` // Set can be of different types, using `interface{}`
}
type ClientConfig ¶
type ClientConfig struct {
Address string
UseTLS bool
TLSConfig *tls.Config
DefaultTimeout time.Duration
DialOptions []grpc.DialOption
ChainID utils.NetworkType
Account *wallet.Account
}
ClientConfig holds configuration for the gRPC client
type Config ¶
type Config struct {
BlockReward *string `json:"block_reward"`
DeltaF0 *uint `json:"delta_f0"`
EndTimeStamp *uint `json:"end_timestamp"`
GenesisTimestamp *uint `json:"genesis_timestamp"`
OperationValidityParios *uint `json:"operation_validity_periods"`
PeriodsPerCycle *uint `json:"periods_per_cycle"`
PosLockCycles *uint `json:"pos_lock_cycles"`
PosLookbackCycle *uint `json:"pos_lookback_cycles"`
RollPrice *string `json:"roll_price"`
T0 *uint `json:"t0"`
ThreadCount *uint `json:"thread_count"`
}
type ConsensusStats ¶
type ConsensusStats struct {
CliqueCount *uint `json:"clique_count"`
EndTimespan *uint `json:"end_timespan"`
FinalBlockCount *uint `json:"final_block_count"`
FinalOperationCount *uint `json:"final_operation_count"`
StakerCount *uint `json:"staker_count"`
StaleBlockCount *uint `json:"stale_block_count"`
StartTimespan *uint `json:"start_timespan"`
}
type ContractDatastore ¶
func DatastoreToDeployedContract ¶
func DatastoreToDeployedContract(datastore []ContractDatastoreEntry) ( contractDatastore ContractDatastore, isDeployDatastore bool, )
DatastoreToDeployedContract If the datastore is a valid datastore for a deployed contract, it will return the contract's bytecode, args and coins If the datastore is not a valid datastore for a deployed contract, it will return an empty ContractDatastore and isDeployDatastore = false.
type ContractDatastoreEntry ¶
func DeserializeDatastore ¶
func DeserializeDatastore(datastore []byte) ([]ContractDatastoreEntry, error)
type DatastoreEntryData ¶
type DatastoreEntryData struct {
Address string `json:"address"`
Key JSONableSlice `json:"key"`
}
func NewDatastoreEntry ¶
func NewDatastoreEntry(address string, key []byte) DatastoreEntryData
type DatastoreEntryResponse ¶
type DatastoreEntryResponse struct {
CandidateValue []byte `json:"candidate_value"`
FinalValue []byte `json:"final_value"`
}
func ContractDatastoreEntries ¶
func ContractDatastoreEntries(client *Client, address string, keys [][]byte) ([]DatastoreEntryResponse, error)
func FetchDatastoreEntries ¶
func FetchDatastoreEntries(client *Client, entries []DatastoreEntryData) ([]DatastoreEntryResponse, error)
func FetchDatastoreEntry ¶
func FetchDatastoreEntry(client *Client, address string, key []byte) (*DatastoreEntryResponse, error)
type DeferredCreditsInfo ¶
type DeferredCreditsInfo struct {
Credits map[string]interface{} `json:"credits"` // Empty in provided JSON, assumed to be a map
}
type Event ¶
type Event struct {
Context EventContext `json:"context"`
Data string `json:"data"`
}
func Events ¶
func Events(client *Client, start *Slot, end *Slot, emitter *string, originalCaller *string, operationID *string, ) ([]Event, error)
*
- Filters events based on given arguments. *
- Research criterion are
- - by slots:
- * after => start
- * before => end
- - callstack address:
- * last address in the callstack => emitter
- * first address in the callstack => originaCaller
- - operation id. *
- All these criterion are optional.
type EventContext ¶
type EventContext struct {
Slot Timestamp `json:"slot"`
Block interface{} `json:"block"` // Assuming `null` can be represented as an `interface{}`
ReadOnly bool `json:"read_only"`
IndexInSlot int `json:"index_in_slot"`
CallStack []string `json:"call_stack"`
OriginOperationID interface{} `json:"origin_operation_id"` // Assuming `null` can be represented as an `interface{}`
IsFinal bool `json:"is_final"`
IsError bool `json:"is_error"`
}
type EventSearchCriteria ¶
type JSONableSlice ¶
type JSONableSlice []byte
func (JSONableSlice) MarshalJSON ¶
func (u JSONableSlice) MarshalJSON() ([]byte, error)
type LedgerEntryChange ¶
type LedgerEntryChange struct {
Update LedgerUpdate `json:"Update"`
}
type LedgerUpdate ¶
type LedgerUpdate struct {
Balance ChangeSet `json:"balance"`
Bytecode interface{} `json:"bytecode"`
Datastore []interface{} `json:"datastore"`
}
type MassaClient ¶
type MassaClient struct {
PublicClient pb.PublicServiceClient
PrivateClient pb.PrivateServiceClient
ChainID utils.NetworkType
Account *wallet.Account
// contains filtered or unexported fields
}
MassaClient provides high-level methods for signing and sending operations using wallet accounts (automatic signing)
func NewMassaClient ¶
func NewMassaClient(cfg *ClientConfig) (*MassaClient, error)
NewMassaClient creates a new wallet-integrated operation sender
func (*MassaClient) BuyRolls ¶
func (c *MassaClient) BuyRolls( ctx context.Context, nickname string, password string, rollCount uint64, fee float64, ) (string, error)
BuyRolls is a convenience method for buying rolls using wallet
func (*MassaClient) CallSC ¶
func (c *MassaClient) CallSC( ctx context.Context, nickname string, password string, targetAddress string, targetFunction string, parameters []byte, maxGas float64, coins float64, fee float64, ) (string, error)
CallSC is a convenience method for calling smart contracts using wallet
func (*MassaClient) Close ¶
func (c *MassaClient) Close() error
func (*MassaClient) ExecuteSC ¶
func (c *MassaClient) ExecuteSC( ctx context.Context, nickname string, password string, bytecode []byte, maxGas float64, maxCoins float64, datastore []byte, fee float64, ) (string, error)
SendExecuteSCWithWallet is a convenience method for deploying smart contracts using wallet
func (*MassaClient) GetContext ¶
func (c *MassaClient) GetContext() (context.Context, context.CancelFunc)
GetContext returns a context with the default timeout
func (*MassaClient) GetContextWithTimeout ¶
func (c *MassaClient) GetContextWithTimeout(timeout time.Duration) (context.Context, context.CancelFunc)
GetContextWithTimeout returns a context with a custom timeout
func (*MassaClient) GetDatastoreEntries ¶
func (c *MassaClient) GetDatastoreEntries(ctx context.Context, address string, keys [][]byte) ([]*model.DatastoreEntry, error)
GetDatastoreEntries fetches datastore entries for a given contract address and a list of keys. It returns the protobuf model DatastoreEntry objects (which contain candidate and final values).
func (*MassaClient) NewBlocksServerStream ¶
func (c *MassaClient) NewBlocksServerStream(ctx context.Context, req *pb.NewBlocksServerRequest, handler StreamHandler[pb.NewBlocksServerResponse]) error
NewBlocksServerStream creates a server streaming connection for new blocks
func (*MassaClient) NewBlocksStream ¶
func (c *MassaClient) NewBlocksStream(ctx context.Context) (grpc.BidiStreamingClient[pb.NewBlocksRequest, pb.NewBlocksResponse], error)
NewBlocksStream creates a bidirectional stream for new blocks
func (*MassaClient) NewEndorsementsServerStream ¶
func (c *MassaClient) NewEndorsementsServerStream(ctx context.Context, req *pb.NewEndorsementsServerRequest, handler StreamHandler[pb.NewEndorsementsServerResponse]) error
NewEndorsementsServerStream creates a server streaming connection for new endorsements
func (*MassaClient) NewEndorsementsStream ¶
func (c *MassaClient) NewEndorsementsStream(ctx context.Context) (grpc.BidiStreamingClient[pb.NewEndorsementsRequest, pb.NewEndorsementsResponse], error)
NewEndorsementsStream creates a bidirectional stream for new endorsements
func (*MassaClient) NewFilledBlocksServerStream ¶
func (c *MassaClient) NewFilledBlocksServerStream(ctx context.Context, req *pb.NewFilledBlocksServerRequest, handler StreamHandler[pb.NewFilledBlocksServerResponse]) error
NewFilledBlocksServerStream creates a server streaming connection for new filled blocks
func (*MassaClient) NewFilledBlocksStream ¶
func (c *MassaClient) NewFilledBlocksStream(ctx context.Context) (grpc.BidiStreamingClient[pb.NewFilledBlocksRequest, pb.NewFilledBlocksResponse], error)
NewFilledBlocksStream creates a bidirectional stream for new filled blocks
func (*MassaClient) NewOperationsServerStream ¶
func (c *MassaClient) NewOperationsServerStream(ctx context.Context, req *pb.NewOperationsServerRequest, handler StreamHandler[pb.NewOperationsServerResponse]) error
NewOperationsServerStream creates a server streaming connection for new operations
func (*MassaClient) NewOperationsStream ¶
func (c *MassaClient) NewOperationsStream(ctx context.Context) (grpc.BidiStreamingClient[pb.NewOperationsRequest, pb.NewOperationsResponse], error)
NewOperationsStream creates a bidirectional stream for new operations
func (*MassaClient) NewSlotABICallStacksStream ¶
func (c *MassaClient) NewSlotABICallStacksStream(ctx context.Context) (grpc.BidiStreamingClient[pb.NewSlotABICallStacksRequest, pb.NewSlotABICallStacksResponse], error)
NewSlotABICallStacksStream creates a bidirectional stream for slot ABI call stacks
func (*MassaClient) NewSlotExecutionOutputsServerStream ¶
func (c *MassaClient) NewSlotExecutionOutputsServerStream(ctx context.Context, req *pb.NewSlotExecutionOutputsServerRequest, handler StreamHandler[pb.NewSlotExecutionOutputsServerResponse]) error
NewSlotExecutionOutputsServerStream creates a server streaming connection for slot execution outputs
func (*MassaClient) NewSlotExecutionOutputsStream ¶
func (c *MassaClient) NewSlotExecutionOutputsStream(ctx context.Context) (grpc.BidiStreamingClient[pb.NewSlotExecutionOutputsRequest, pb.NewSlotExecutionOutputsResponse], error)
NewSlotExecutionOutputsStream creates a bidirectional stream for slot execution outputs
func (*MassaClient) NewSlotTransfersStream ¶
func (c *MassaClient) NewSlotTransfersStream(ctx context.Context) (grpc.BidiStreamingClient[pb.NewSlotTransfersRequest, pb.NewSlotTransfersResponse], error)
NewSlotTransfersStream creates a bidirectional stream for slot transfers
func (*MassaClient) NewTransfersInfoServerStream ¶
func (c *MassaClient) NewTransfersInfoServerStream(ctx context.Context, req *pb.NewTransfersInfoServerRequest, handler StreamHandler[pb.NewTransfersInfoServerResponse]) error
NewTransfersInfoServerStream creates a server streaming connection for transfers info
func (*MassaClient) ReadOnlyCallSC ¶
func (c *MassaClient) ReadOnlyCallSC( ctx context.Context, targetAddress string, targetFunction string, parameters []byte, coins float64, fee float64, callerAddress string, ) (*model.ReadOnlyExecutionOutput, error)
ReadOnlyCallSC performs a read-only smart contract call (no signature required) It uses the node JSON-RPC "execute_read_only_call" under the hood and returns the result. If callerAddress is empty and the MassaClient was created with a wallet account, the caller address will be taken from the wallet account.
func (*MassaClient) SellRolls ¶
func (c *MassaClient) SellRolls( ctx context.Context, nickname string, password string, rollCount uint64, fee float64) (string, error)
SellRolls is a conven`ience method for selling rolls using wallet
func (*MassaClient) SendBlocksStream ¶
func (c *MassaClient) SendBlocksStream(ctx context.Context) (grpc.BidiStreamingClient[pb.SendBlocksRequest, pb.SendBlocksResponse], error)
SendBlocksStream creates a bidirectional stream for sending blocks
func (*MassaClient) SendEndorsementsStream ¶
func (c *MassaClient) SendEndorsementsStream(ctx context.Context) (grpc.BidiStreamingClient[pb.SendEndorsementsRequest, pb.SendEndorsementsResponse], error)
SendEndorsementsStream creates a bidirectional stream for sending endorsements
func (*MassaClient) SendOperation ¶
func (c *MassaClient) SendOperation( ctx context.Context, nickname string, password string, op sendoperation.Operation, fee uint64, ) (string, error)
SendOperationWithWallet signs and sends a single operation using a wallet account Parameters:
- ctx: Context for the request
- nickname: Account nickname in the wallet
- password: Account password
- op: The operation to send
- fee: Fee amount in NanoMassa
- expirePeriod: Period after which the operation expires
Returns:
- operationID: The ID of the sent operation
- error: Any error that occurred
func (*MassaClient) SendOperationsStream ¶
func (c *MassaClient) SendOperationsStream(ctx context.Context) (grpc.BidiStreamingClient[pb.SendOperationsRequest, pb.SendOperationsResponse], error)
SendOperationsStream creates a bidirectional stream for sending operations
func (*MassaClient) SendTransaction ¶
func (c *MassaClient) SendTransaction( ctx context.Context, nickname string, password string, recipientAddress string, amount float64, fee float64, ) (string, error)
SendTransaction is a convenience method for sending a transaction using wallet
func (*MassaClient) TransactionsThroughputServerStream ¶
func (c *MassaClient) TransactionsThroughputServerStream(ctx context.Context, req *pb.TransactionsThroughputServerRequest, handler StreamHandler[pb.TransactionsThroughputServerResponse]) error
TransactionsThroughputServerStream creates a server streaming connection for transactions throughput
func (*MassaClient) TransactionsThroughputStream ¶
func (c *MassaClient) TransactionsThroughputStream(ctx context.Context) (grpc.BidiStreamingClient[pb.TransactionsThroughputRequest, pb.TransactionsThroughputResponse], error)
TransactionsThroughputStream creates a bidirectional stream for transactions throughput
type NetworkStats ¶
type PosChanges ¶
type PosChanges struct {
SeedBits SeedBitsInfo `json:"seed_bits"`
RollChanges map[string]interface{} `json:"roll_changes"` // Empty in provided JSON, assumed to be a map
ProductionStats map[string]interface{} `json:"production_stats"` // Empty in provided JSON, assumed to be a map
DeferredCredits DeferredCreditsInfo `json:"deferred_credits"`
}
type ReadOnlyCallParams ¶
type ReadOnlyCallParams struct {
MaxGas int `json:"max_gas"`
Coins string `json:"coins"`
Fee string `json:"fee"`
TargetAddress string `json:"target_address"`
TargetFunction string `json:"target_function"`
Parameter JSONableSlice `json:"parameter"`
CallerAddress string `json:"caller_address"`
}
ReadOnlyCallParams is the struct used to send a read only callSC to the node.
type ReadOnlyExecuteParams ¶
type ReadOnlyExecuteParams struct {
MaxGas int `json:"max_gas"`
Coins string `json:"coins"`
Fee string `json:"fee"`
Address string `json:"address"`
Bytecode JSONableSlice `json:"bytecode"`
OperationDatastore JSONableSlice `json:"operation_datastore"`
}
ReadOnlyExecuteParams is the struct used to send a read only executeSC to the node.
type ReadOnlyResult ¶
type ReadOnlyResult struct {
ExecutedAt Timestamp `json:"executed_at"`
Result Result `json:"result"`
OutputEvents []Event `json:"output_events"`
GasCost int `json:"gas_cost"`
StateChanges StateChange `json:"state_changes"`
}
func ReadOnlyCallSC ¶
func ReadOnlyCallSC( targetAddr string, function string, parameter []byte, coins string, fee string, callerAddr string, c *Client, ) (*ReadOnlyResult, error)
ReadOnlyCallSC calls execute_read_only_call jsonrpc method. coins and fee must be in MAS.
func ReadOnlyExecuteSC ¶
func ReadOnlyExecuteSC( contract []byte, datastore []byte, coins string, fee string, callerAddr string, client *Client, ) (*ReadOnlyResult, error)
ReadOnlyExecuteSC calls execute_read_only_bytecode jsonrpc method. coins and fee must be in MAS.
type Result ¶
type Result struct {
Ok []interface{} `json:"Ok,omitempty"`
Error string `json:"Error,omitempty"`
}
Result is a struct that can hold both 'Ok' and 'Error' fields.
func (*Result) UnmarshalJSON ¶
Custom UnmarshalJSON to handle both cases for the Result field.
type SeedBitsInfo ¶
type SeedBitsInfo struct {
Order string `json:"order"`
Head BitVecHeadInfo `json:"head"`
Bits int `json:"bits"`
Data []interface{} `json:"data"` // Empty array in provided JSON
}
type State ¶
type State struct {
Config *Config `json:"config"`
ConsensusStats *ConsensusStats `json:"consensus_stats"`
CurrentCycle *uint `json:"current_cycle"`
CurrentTime *uint `json:"current_time"`
LastSlot *Slot `json:"last_slot"`
NetworkStats *NetworkStats `json:"network_stats"`
NextSlot *Slot `json:"next_slot"`
NodeID *string `json:"node_id"`
NodeIP *string `json:"node_ip"`
PoolStats *[]uint `json:"pool_stats"`
Version *string `json:"version"`
ChainID *uint `json:"chain_id"`
MinimalFees *string `json:"minimal_fees"`
}
type StateChange ¶
type StateChange struct {
LedgerChanges map[string]LedgerEntryChange `json:"ledger_changes"`
AsyncPoolChanges []interface{} `json:"async_pool_changes"` // Empty in provided JSON, assumed to be a map
PosChanges PosChanges `json:"pos_changes"`
ExecutedOpsChanges map[string]interface{} `json:"executed_ops_changes"`
ExecutedDenunciationsChanges []interface{} `json:"executed_denunciations_changes"` // Empty array in provided JSON
ExecutionTrailHashChange interface{} `json:"execution_trail_hash_change"`
}
type StreamHandler ¶
StreamHandler is a generic handler for processing stream responses