Documentation
¶
Index ¶
- func CommitmentFromSlotInfo(s *SlotInfo) (*commitment.Commitment, error)
- func MarshalOutput(output devnetvm.Output) []byte
- type Address
- type AliasOutput
- type AllowedManaPledgeResponse
- type AllowedPledge
- type Block
- type ChildConflict
- type Conflict
- type ConflictWeight
- type Consumer
- type DataRequest
- type DataResponse
- type ErrorResponse
- type ExtendedLockedOutput
- type FaucetAPIResponse
- type FaucetRequest
- type FaucetRequestResponse
- type GetAddressResponse
- type GetAllManaResponse
- type GetConflictChildrenResponse
- type GetConflictConflictsResponse
- type GetConflictVotersResponse
- type GetEventLogsRequest
- type GetEventLogsResponse
- type GetManaRequest
- type GetManaResponse
- type GetNHighestResponse
- type GetNeighborsResponse
- type GetOnlineResponse
- type GetOutputConsumersResponse
- type GetPercentileRequest
- type GetPercentileResponse
- type GetReferencesRequest
- type GetReferencesResponse
- type GetSnapshotRequest
- type GetTransactionAttachmentsResponse
- type GetUnspentOutputResponse
- type GlobalMetricsResponse
- type InfoResponse
- type Input
- type LatestConfirmedIndexResponse
- type Mana
- type Markers
- type MeshTime
- type MissingAvailableResponse
- type MissingResponse
- type Neighbor
- type NodeWeight
- type NodesMetricsResponse
- type OnlineIssuerStr
- type Output
- type OutputID
- type OutputMetadata
- type ParentBlockIDs
- type PastConsensusManaVectorResponse
- type PastconeRequest
- type PastconeResponse
- type PeerService
- type PeerToRemove
- type PostAddressesUnspentOutputsRequest
- type PostAddressesUnspentOutputsResponse
- type PostBlockRequest
- type PostBlockResponse
- type PostPayloadRequest
- type PostPayloadResponse
- type PostTransactionRequest
- type PostTransactionResponse
- type RateSetter
- type Scheduler
- type SendBlockRequest
- type SigLockedColoredOutput
- type SigLockedSingleOutput
- type SlotBlocksResponse
- type SlotInfo
- type SlotTransactionsResponse
- type SlotUTXOsResponse
- type SlotVotersWeightResponse
- type SlotsResponse
- type SpammerRequest
- type SpammerResponse
- type StructureDetails
- type TimeProvider
- type Transaction
- type TransactionMetadata
- type UnlockBlock
- type WalletOutput
- type WalletOutputMetadata
- type WalletOutputsOnAddress
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommitmentFromSlotInfo ¶
func CommitmentFromSlotInfo(s *SlotInfo) (*commitment.Commitment, error)
func MarshalOutput ¶
MarshalOutput uses the json marshaller to marshal a ledgerstate.Output into bytes.
Types ¶
type Address ¶
Address represents the JSON model of a ledgerstate.Address.
func NewAddress ¶
NewAddress returns an Address from the given ledgerstate.Address.
type AliasOutput ¶
type AliasOutput struct {
Balances map[string]uint64 `json:"balances"`
AliasAddress string `json:"aliasAddress"`
StateAddress string `json:"stateAddress"`
StateIndex uint32 `json:"stateIndex"`
IsGovernanceUpdate bool `json:"isGovernanceUpdate"`
IsOrigin bool `json:"isOrigin"`
IsDelegated bool `json:"isDelegated"`
// marshaled to base64
StateData []byte `json:"stateData,omitempty"`
GovernanceMetadata []byte `json:"governanceMetadata"`
ImmutableData []byte `json:"immutableData,omitempty"`
GoverningAddress string `json:"governingAddress,omitempty"`
DelegationTimelock int64 `json:"delegationTimelock,omitempty"`
}
AliasOutput is the JSON model of a ledgerstate.AliasOutput.
func AliasOutputFromLedgerstate ¶
func AliasOutputFromLedgerstate(output devnetvm.Output) (*AliasOutput, error)
AliasOutputFromLedgerstate creates a JSON compatible representation of a ledgerstate output.
func UnmarshalAliasOutputFromBytes ¶
func UnmarshalAliasOutputFromBytes(data []byte) (*AliasOutput, error)
UnmarshalAliasOutputFromBytes uses the json unmarshaler to unmarshal data into an AliasOutput.
func (*AliasOutput) ToLedgerStateOutput ¶
ToLedgerStateOutput builds a ledgerstate.Output from SigLockedSingleOutput with the given outputID.
type AllowedManaPledgeResponse ¶
type AllowedManaPledgeResponse struct {
Access AllowedPledge `json:"accessMana"`
Consensus AllowedPledge `json:"consensusMana"`
Error string `json:"error,omitempty"`
}
AllowedManaPledgeResponse is the http response.
type AllowedPledge ¶
type AllowedPledge struct {
IsFilterEnabled bool `json:"isFilterEnabled"`
Allowed []string `json:"allowed,omitempty"`
}
AllowedPledge represents the nodes that mana is allowed to be pledged to.
type Block ¶
type Block struct {
ID string `json:"id"`
StrongParents []string `json:"strongParents"`
WeakParents []string `json:"weakParents"`
ShallowLikeParents []string `json:"shallowLikeParents"`
StrongChildren []string `json:"strongChildren"`
WeakChildren []string `json:"weakChildren"`
LikedInsteadChildren []string `json:"likedInsteadChildren"`
IssuerPublicKey string `json:"issuerPublicKey"`
IssuingTime int64 `json:"issuingTime"`
SequenceNumber uint64 `json:"sequenceNumber"`
PayloadType string `json:"payloadType"`
TransactionID string `json:"transactionID,omitempty"`
Payload []byte `json:"payload"`
CommitmentID string `json:"commitmentID"`
SlotIndex uint64 `json:"slotIndex"`
CommitmentRootsID string `json:"commitmentRootsID"`
PrevCommitmentID string `json:"prevCommitmentID"`
Signature string `json:"signature"`
LatestConfirmedSlot uint64 `json:"latestConfirmedSlot"`
}
Block represents the JSON model of a meshold.Block.
type ChildConflict ¶
type ChildConflict struct {
ConflictID string `json:"conflictID"`
}
ChildConflict represents the JSON model of a ledger.ChildConflict.
func NewChildConflict ¶
func NewChildConflict(childConflict *conflictdag.Conflict[utxo.TransactionID, utxo.OutputID]) *ChildConflict
NewChildConflict returns a ChildConflict from the given ledger.ChildConflict.
type Conflict ¶
type Conflict struct {
OutputID *OutputID `json:"outputID"`
ConflictIDs []string `json:"conflictIDs"`
}
Conflict represents the JSON model of a ledger.Conflict.
func NewConflict ¶
func NewConflict(conflictID utxo.OutputID, conflictIDs []utxo.TransactionID) *Conflict
NewConflict returns a Conflict from the given ledger.ConflictID.
type ConflictWeight ¶
type ConflictWeight struct {
ID string `json:"id"`
Parents []string `json:"parents"`
ConflictIDs []string `json:"conflictIDs,omitempty"`
ConfirmationState confirmation.State `json:"confirmationState"`
ApprovalWeight int64 `json:"approvalWeight"`
}
ConflictWeight represents the JSON model of a ledger.Conflict.
func NewConflictWeight ¶
func NewConflictWeight(conflict *conflictdag.Conflict[utxo.TransactionID, utxo.OutputID], confirmationState confirmation.State, aw int64) ConflictWeight
NewConflictWeight returns a Conflict from the given ledger.Conflict.
type Consumer ¶
Consumer represents the JSON model of a mempool.Consumer.
func NewConsumer ¶
NewConsumer returns a Consumer from the given mempool.Consumer.
type DataRequest ¶
DataRequest contains the data of the block to send.
type DataResponse ¶
DataResponse contains the ID of the block sent.
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
}
ErrorResponse represents the JSON model of an error response from an API endpoint.
func NewErrorResponse ¶
func NewErrorResponse(err error) *ErrorResponse
NewErrorResponse returns am ErrorResponse from the given error.
type ExtendedLockedOutput ¶
type ExtendedLockedOutput struct {
Balances map[string]uint64 `json:"balances"`
Address string `json:"address"`
FallbackAddress string `json:"fallbackAddress,omitempty"`
FallbackDeadline int64 `json:"fallbackDeadline,omitempty"`
TimeLock int64 `json:"timelock,omitempty"`
Payload []byte `json:"payload,omitempty"`
}
ExtendedLockedOutput is the JSON model of a ledgerstate.ExtendedLockedOutput.
func ExtendedLockedOutputFromLedgerstate ¶
func ExtendedLockedOutputFromLedgerstate(output devnetvm.Output) (*ExtendedLockedOutput, error)
ExtendedLockedOutputFromLedgerstate creates a JSON compatible representation of a ledgerstate output.
func UnmarshalExtendedLockedOutputFromBytes ¶
func UnmarshalExtendedLockedOutputFromBytes(data []byte) (*ExtendedLockedOutput, error)
UnmarshalExtendedLockedOutputFromBytes uses the json unmarshaler to unmarshal data into an ExtendedLockedOutput.
func (*ExtendedLockedOutput) ToLedgerStateOutput ¶
ToLedgerStateOutput builds a ledgerstate.Output from ExtendedLockedOutput with the given outputID.
type FaucetAPIResponse ¶
type FaucetAPIResponse struct {
Success bool `json:"success"`
Error string `json:"error,omitempty"`
}
FaucetAPIResponse contains the status of facet request through web API.
type FaucetRequest ¶
type FaucetRequest struct {
Address string `json:"address"`
AccessManaPledgeID string `json:"accessManaPledgeID"`
ConsensusManaPledgeID string `json:"consensusManaPledgeID"`
Nonce uint64 `json:"nonce"`
}
FaucetRequest contains the address to request funds from faucet.
type FaucetRequestResponse ¶
type FaucetRequestResponse struct {
ID string `json:"id,omitempty"`
Error string `json:"error,omitempty"`
}
FaucetRequestResponse contains the ID of the block sent.
type GetAddressResponse ¶
type GetAddressResponse struct {
Address *Address `json:"address"`
SpentOutputs []*Output `json:"spentOutputs"`
UnspentOutputs []*Output `json:"unspentOutputs"`
}
GetAddressResponse represents the JSON model of a response from the GetAddress endpoint.
func NewGetAddressResponse ¶
func NewGetAddressResponse(address devnetvm.Address, spent, unspent devnetvm.Outputs) *GetAddressResponse
NewGetAddressResponse returns a GetAddressResponse from the given details.
type GetAllManaResponse ¶
type GetAllManaResponse struct {
Access []manamodels.IssuerStr `json:"access"`
AccessTimestamp int64 `json:"accessTimestamp"`
Consensus []manamodels.IssuerStr `json:"consensus"`
ConsensusTimestamp int64 `json:"consensusTimestamp"`
Error string `json:"error,omitempty"`
}
GetAllManaResponse is the request to a getAllManaHandler request.
type GetConflictChildrenResponse ¶
type GetConflictChildrenResponse struct {
ConflictID string `json:"conflictID"`
ChildConflicts []*ChildConflict `json:"childConflicts"`
}
GetConflictChildrenResponse represents the JSON model of a response from the GetConflictChildren endpoint.
func NewGetConflictChildrenResponse ¶
func NewGetConflictChildrenResponse(conflictID utxo.TransactionID, childConflicts *advancedset.AdvancedSet[*conflictdag.Conflict[utxo.TransactionID, utxo.OutputID]]) *GetConflictChildrenResponse
NewGetConflictChildrenResponse returns a GetConflictChildrenResponse from the given details.
type GetConflictConflictsResponse ¶
type GetConflictConflictsResponse struct {
ConflictID string `json:"conflictID"`
Conflicts []*Conflict `json:"conflicts"`
}
GetConflictConflictsResponse represents the JSON model of a response from the GetConflictConflicts endpoint.
func NewGetConflictConflictsResponse ¶
func NewGetConflictConflictsResponse(conflictID utxo.TransactionID, conflictIDsPerConflictID map[utxo.OutputID][]utxo.TransactionID) *GetConflictConflictsResponse
NewGetConflictConflictsResponse returns a GetConflictConflictsResponse from the given details.
type GetConflictVotersResponse ¶
type GetConflictVotersResponse struct {
ConflictID string `json:"conflictID"`
Voters []string `json:"voters"`
}
GetConflictVotersResponse represents the JSON model of a response from the GetConflictVoters endpoint.
func NewGetConflictVotersResponse ¶
func NewGetConflictVotersResponse(conflictID utxo.TransactionID, voters *sybilprotection.WeightedSet) *GetConflictVotersResponse
NewGetConflictVotersResponse returns a GetConflictVotersResponse from the given details.
type GetEventLogsRequest ¶
type GetEventLogsRequest struct {
IssuerIDs []string `json:"nodeIDs"`
StartTime int64 `json:"startTime"`
EndTime int64 `json:"endTime"`
}
GetEventLogsRequest is the request.
type GetEventLogsResponse ¶
type GetEventLogsResponse struct {
Error string `json:"error,omitempty"`
StartTime int64 `json:"startTime"`
EndTime int64 `json:"endTime"`
}
GetEventLogsResponse is the response.
type GetManaRequest ¶
type GetManaRequest struct {
IssuerID string `json:"nodeID"`
}
GetManaRequest is the request for get mana.
type GetManaResponse ¶
type GetManaResponse struct {
Error string `json:"error,omitempty"`
ShortIssuerID string `json:"shortNodeID"`
IssuerID string `json:"nodeID"`
Access int64 `json:"access"`
AccessTimestamp int64 `json:"accessTimestamp"`
Consensus int64 `json:"consensus"`
ConsensusTimestamp int64 `json:"consensusTimestamp"`
}
GetManaResponse defines the response for get mana.
type GetNHighestResponse ¶
type GetNHighestResponse struct {
Error string `json:"error,omitempty"`
Issuers []manamodels.IssuerStr `json:"nodes,omitempty"`
Timestamp int64 `json:"timestamp"`
}
GetNHighestResponse holds info about nodes and their mana values.
type GetNeighborsResponse ¶
type GetNeighborsResponse struct {
KnownPeers []Neighbor `json:"known,omitempty"`
Chosen []Neighbor `json:"chosen"`
Accepted []Neighbor `json:"accepted"`
Error string `json:"error,omitempty"`
}
GetNeighborsResponse contains information of the autopeering.
type GetOnlineResponse ¶
type GetOnlineResponse struct {
Online []*OnlineIssuerStr `json:"online"`
Error string `json:"error,omitempty"`
Timestamp int64 `json:"timestamp"`
}
GetOnlineResponse is the response to an online mana request.
type GetOutputConsumersResponse ¶
type GetOutputConsumersResponse struct {
OutputID *OutputID `json:"outputID"`
Consumers []*Consumer `json:"consumers"`
}
GetOutputConsumersResponse represents the JSON model of a response from the GetOutputConsumers endpoint.
func NewGetOutputConsumersResponse ¶
func NewGetOutputConsumersResponse(outputID utxo.OutputID, consumers []*mempool.Consumer) *GetOutputConsumersResponse
NewGetOutputConsumersResponse returns a GetOutputConsumersResponse from the given details.
type GetPercentileRequest ¶
type GetPercentileRequest struct {
IssuerID string `json:"nodeID"`
}
GetPercentileRequest is the request object of mana/percentile.
type GetPercentileResponse ¶
type GetPercentileResponse struct {
Error string `json:"error,omitempty"`
ShortIssuerID string `json:"shortNodeID"`
IssuerID string `json:"nodeID"`
Access float64 `json:"access"`
AccessTimestamp int64 `json:"accessTimestamp"`
Consensus float64 `json:"consensus"`
ConsensusTimestamp int64 `json:"consensusTimestamp"`
}
GetPercentileResponse holds info about the mana percentile(s) of a node.
type GetReferencesRequest ¶
type GetReferencesRequest struct {
PayloadBytes []byte `json:"payload_bytes"`
ParentsCount int `json:"parent_count"`
}
GetReferencesRequest is the HTTP request to get the references for a provided payload.
type GetReferencesResponse ¶
type GetReferencesResponse struct {
StrongReferences []string `json:"references"`
WeakReferences []string `json:"weak_references,omitempty"`
ShallowReferences []string `json:"shallow_references,omitempty"`
}
GetReferencesResponse is the HTTP response from getting the references for a provided payload.
func NewGetReferencesResponse ¶
func NewGetReferencesResponse(references models.ParentBlockIDs) (resp *GetReferencesResponse)
NewGetReferencesResponse creates a new GetReferencesResponse based on provided parents.
func (*GetReferencesResponse) References ¶
func (resp *GetReferencesResponse) References() models.ParentBlockIDs
type GetSnapshotRequest ¶
type GetSnapshotRequest struct {
SlotIndex uint64 `query:"index"`
}
GetSnapshotRequest represents the JSON model of a GetSnapshot request.
type GetTransactionAttachmentsResponse ¶
type GetTransactionAttachmentsResponse struct {
TransactionID string `json:"transactionID"`
BlockIDs []string `json:"blockIDs"`
}
GetTransactionAttachmentsResponse represents the JSON model of a response from the GetTransactionAttachments endpoint.
func NewGetTransactionAttachmentsResponse ¶
func NewGetTransactionAttachmentsResponse(transactionID utxo.TransactionID, blockIDs models.BlockIDs) *GetTransactionAttachmentsResponse
NewGetTransactionAttachmentsResponse returns a GetTransactionAttachmentsResponse from the given details.
type GetUnspentOutputResponse ¶
type GetUnspentOutputResponse struct {
Address *Address `json:"address"`
Outputs []*Output `json:"outputs"`
}
GetUnspentOutputResponse represents the JSON model of a response from the GetUnspentOutput endpoint.
type GlobalMetricsResponse ¶
type GlobalMetricsResponse struct {
BPS uint64 `json:"bps"`
BookedTransactions uint64 `json:"bookedTransactions"`
InclusionRate float64 `json:"inclusionRate"`
ConfirmationDelay string `json:"confirmationDelay"`
ActiveManaRatio float64 `json:"activeManaRatio"`
OnlineNodes int `json:"onlineNodes"`
ConflictsResolved uint64 `json:"conflictsResolved"`
TotalConflicts uint64 `json:"totalConflicts"`
}
GlobalMetricsResponse contains global metrics for explorer.
type InfoResponse ¶
type InfoResponse struct {
// version of ZIPP
Version string `json:"version,omitempty"`
// Network Version of the autopeering
NetworkVersion uint32 `json:"networkVersion,omitempty"`
// MeshTime sync status
MeshTime MeshTime `json:"meshTime,omitempty"`
// TimeProvider contain the details for the time provider.
TimeProvider TimeProvider `json:"timeProvider,omitempty"`
// identity ID of the node encoded in base58
IdentityID string `json:"identityID,omitempty"`
// identity ID of the node encoded in base58 and truncated to its first 8 bytes
IdentityIDShort string `json:"identityIDShort,omitempty"`
// public key of the node encoded in base58
PublicKey string `json:"publicKey,omitempty"`
// BlockRequestQueueSize is the number of blocks a node is trying to request from neighbors.
BlockRequestQueueSize int `json:"blockRequestQueueSize,omitempty"`
// SolidBlockCount is the number of solid blocks in the node's database.
SolidBlockCount int `json:"solidBlockCount,omitempty"`
// TotalBlockCount is the number of blocks in the node's database.
TotalBlockCount int `json:"totalBlockCount,omitempty"`
// list of enabled plugins
EnabledPlugins []string `json:"enabledPlugins,omitempty"`
// list if disabled plugins
DisabledPlugins []string `json:"disabledPlugins,omitempty"`
// Mana values
Mana Mana `json:"mana,omitempty"`
// Scheduler is the scheduler.
Scheduler Scheduler `json:"scheduler"`
// LastCommittedSlot contains information about the last committed slot.
LastCommittedSlot SlotInfo `json:"lastCommittedSlot"`
// RateSetter is the rate setter.
RateSetter RateSetter `json:"rateSetter"`
// error of the response
Error string `json:"error,omitempty"`
}
InfoResponse holds the response of the GET request.
type Input ¶
type Input struct {
Type string `json:"type"`
ReferencedOutputID *OutputID `json:"referencedOutputID,omitempty"`
// the referenced output object, omit if not specified
Output *Output `json:"output,omitempty"`
}
Input represents the JSON model of a ledgerstate.Input.
type Mana ¶
type Mana struct {
Access int64 `json:"access"`
AccessTimestamp time.Time `json:"accessTimestamp"`
Consensus int64 `json:"consensus"`
ConsensusTimestamp time.Time `json:"consensusTimestamp"`
}
Mana contains the different mana values of the node.
type Markers ¶
type Markers struct {
Markers map[markers.SequenceID]markers.Index `json:"markers"`
HighestIndex markers.Index `json:"highestIndex"`
LowestIndex markers.Index `json:"lowestIndex"`
}
Markers represents the JSON model of the markersold.Markers.
func NewMarkers ¶
NewMarkers returns the Markers from the given markersold.Markers.
type MeshTime ¶
type MeshTime struct {
AcceptedBlockID string `json:"blockID"`
ConfirmedBlockID string `json:"confirmedBlockID"`
ConfirmedSlot int64 `json:"confirmedSlot"`
ATT int64 `json:"ATT"`
RATT int64 `json:"RATT"`
CTT int64 `json:"CTT"`
RCTT int64 `json:"RCTT"`
Synced bool `json:"synced"`
Bootstrapped bool `json:"bootstrapped"`
}
MeshTime contains the MeshTime sync detailed status.
type MissingAvailableResponse ¶
type MissingAvailableResponse struct {
Availability map[string][]string `json:"blkavailability,omitempty"`
Count int `json:"count"`
}
MissingAvailableResponse is a map of blockIDs with the peers that have such block.
type MissingResponse ¶
type MissingResponse struct {
IDs []string `json:"ids,omitempty"`
Count int `json:"count,omitempty"`
}
MissingResponse is the HTTP response containing all the missing blocks and their count.
type Neighbor ¶
type Neighbor struct {
ID string `json:"id"` // comparable node identifier
PublicKey string `json:"publicKey"` // public key used to verify signatures
Services []PeerService `json:"services,omitempty"`
}
Neighbor contains information of a neighbor peer.
type NodeWeight ¶
type NodesMetricsResponse ¶
type NodesMetricsResponse struct {
Cmanas []manamodels.IssuerStr `json:"cmanas"`
ActiveManaRatio float64 `json:"activeManaRatio"`
OnlineNodes int `json:"onlineNodes"`
MaxBPS float64 `json:"maxBPS"`
BlockScheduled uint64 `json:"blockscheduled"`
}
NodesMetricsResponse contains metrics of all nodes in the network.
type OnlineIssuerStr ¶
type OnlineIssuerStr struct {
OnlineRank int `json:"rank"`
ShortID string `json:"shortNodeID"`
ID string `json:"nodeID"`
Mana int64 `json:"mana"`
}
OnlineIssuerStr holds information about online rank, nodeID and mana.
type Output ¶
type Output struct {
OutputID *OutputID `json:"outputID,omitempty"`
Type string `json:"type"`
Output json.RawMessage `json:"output"`
}
Output represents the JSON model of a ledgerstate.Output.
type OutputID ¶
type OutputID struct {
Base58 string `json:"base58"`
}
OutputID represents the JSON model of a ledgerstate.OutputID.
func NewOutputID ¶
NewOutputID returns an OutputID from the given ledgerstate.OutputID.
type OutputMetadata ¶
type OutputMetadata struct {
OutputID *OutputID `json:"outputID"`
ConflictIDs []string `json:"conflictIDs"`
FirstConsumer string `json:"firstCount"`
ConfirmedConsumer string `json:"confirmedConsumer,omitempty"`
ConfirmationState confirmation.State `json:"confirmationState"`
ConfirmationStateTime int64 `json:"confirmationStateTime"`
}
OutputMetadata represents the JSON model of the mempool.OutputMetadata.
func NewOutputMetadata ¶
func NewOutputMetadata(outputMetadata *mempool.OutputMetadata, confirmedConsumerID utxo.TransactionID) *OutputMetadata
NewOutputMetadata returns the OutputMetadata from the given mempool.OutputMetadata.
type ParentBlockIDs ¶
ParentBlockIDs is a json representation of meshold.ParentBlockIDs.
type PastConsensusManaVectorResponse ¶
type PastConsensusManaVectorResponse struct {
Consensus []manamodels.IssuerStr `json:"consensus"`
Error string `json:"error,omitempty"`
TimeStamp int64 `json:"timestamp"`
}
PastConsensusManaVectorResponse is the response.
type PastconeRequest ¶
type PastconeRequest struct {
ID string `json:"id"`
}
PastconeRequest holds the block id to query.
type PastconeResponse ¶
type PastconeResponse struct {
Exist bool `json:"exist,omitempty"`
PastConeSize int `json:"pastConeSize,omitempty"`
Error string `json:"error,omitempty"`
}
PastconeResponse is the HTTP response containing the number of blocks in the past cone and if all blocks of the past cone exist on the node.
type PeerService ¶
type PeerService struct {
ID string `json:"id"` // ID of the service
Address string `json:"address"` // network address of the service
}
PeerService contains information about a neighbor peer service.
type PeerToRemove ¶
PeerToRemove holds the data that uniquely identifies the peer to be removed, e.g. public key or ID. Only public key is supported for now.
type PostAddressesUnspentOutputsRequest ¶
type PostAddressesUnspentOutputsRequest struct {
Addresses []string `json:"addresses"`
}
PostAddressesUnspentOutputsRequest is a the request object for the /ledgerstate/addresses/unspentOutputs endpoint.
type PostAddressesUnspentOutputsResponse ¶
type PostAddressesUnspentOutputsResponse struct {
UnspentOutputs []*WalletOutputsOnAddress `json:"unspentOutputs"`
}
PostAddressesUnspentOutputsResponse is a the response object for the /ledgerstate/addresses/unspentOutputs endpoint.
type PostBlockRequest ¶
type PostBlockRequest struct {
BlockBytes []byte `json:"block_bytes"`
}
PostBlockRequest holds the block object(bytes) to send.
type PostBlockResponse ¶
type PostBlockResponse struct {
BlockID string `json:"block_id,omitempty"`
Error string `json:"error,omitempty"`
}
PostBlockResponse is the HTTP response from sending block.
func NewPostBlockResponse ¶
func NewPostBlockResponse(block *models.Block) *PostBlockResponse
type PostPayloadRequest ¶
type PostPayloadRequest struct {
Payload []byte `json:"payload"`
}
PostPayloadRequest represents the JSON model of a PostPayload request.
type PostPayloadResponse ¶
type PostPayloadResponse struct {
ID string `json:"id"`
}
PostPayloadResponse represents the JSON model of a PostPayload response.
func NewPostPayloadResponse ¶
func NewPostPayloadResponse(block *models.Block) *PostPayloadResponse
NewPostPayloadResponse returns a PostPayloadResponse from the given meshold.Block.
type PostTransactionRequest ¶
type PostTransactionRequest struct {
TransactionBytes []byte `json:"txBytes"`
}
PostTransactionRequest holds the transaction object(bytes) to send.
type PostTransactionResponse ¶
type PostTransactionResponse struct {
TransactionID string `json:"transactionID,omitempty"`
BlockID string `json:"blockID,omitempty"`
Error string `json:"error,omitempty"`
}
PostTransactionResponse is the HTTP response from sending transaction.
type RateSetter ¶
RateSetter is the rate setter details.
type Scheduler ¶
type Scheduler struct {
Running bool `json:"running"`
Rate string `json:"rate"`
MaxBufferSize int `json:"maxBufferSize"`
CurrentBufferSize int `json:"currentBufferSize"`
NodeQueueSizes map[string]int `json:"nodeQueueSizes"`
Deficit float64 `json:"deficit"`
}
Scheduler is the scheduler details.
type SendBlockRequest ¶
type SendBlockRequest struct {
Payload []byte `json:"payload"`
ParentBlockIDs []ParentBlockIDs `json:"parentBlockIDs"`
}
SendBlockRequest contains the data of send block endpoint.
type SigLockedColoredOutput ¶
type SigLockedColoredOutput struct {
Balances map[string]uint64 `json:"balances"`
Address string `json:"address"`
}
SigLockedColoredOutput is the JSON model of a ledgerstate.SigLockedColoredOutput.
func SigLockedColoredOutputFromLedgerstate ¶
func SigLockedColoredOutputFromLedgerstate(output devnetvm.Output) (*SigLockedColoredOutput, error)
SigLockedColoredOutputFromLedgerstate creates a JSON compatible representation of a ledgerstate output.
func UnmarshalSigLockedColoredOutputFromBytes ¶
func UnmarshalSigLockedColoredOutputFromBytes(data []byte) (*SigLockedColoredOutput, error)
UnmarshalSigLockedColoredOutputFromBytes uses the json unmarshaler to unmarshal data into a SigLockedColoredOutput.
func (*SigLockedColoredOutput) ToLedgerStateOutput ¶
ToLedgerStateOutput builds a ledgerstate.Output from SigLockedSingleOutput with the given outputID.
type SigLockedSingleOutput ¶
type SigLockedSingleOutput struct {
Balance uint64 `json:"balance"`
Address string `json:"address"`
}
SigLockedSingleOutput is the JSON model of a ledgerstate.SigLockedSingleOutput.
func SigLockedSingleOutputFromLedgerstate ¶
func SigLockedSingleOutputFromLedgerstate(output devnetvm.Output) (*SigLockedSingleOutput, error)
SigLockedSingleOutputFromLedgerstate creates a JSON compatible representation of a ledgerstate output.
func UnmarshalSigLockedSingleOutputFromBytes ¶
func UnmarshalSigLockedSingleOutputFromBytes(data []byte) (*SigLockedSingleOutput, error)
UnmarshalSigLockedSingleOutputFromBytes uses the json unmarshaler to unmarshal data into a SigLockedSingleOutput.
func (*SigLockedSingleOutput) ToLedgerStateOutput ¶
ToLedgerStateOutput builds a ledgerstate.Output from SigLockedSingleOutput with the given outputID.
type SlotBlocksResponse ¶
type SlotInfo ¶
type SlotInfo struct {
ID string `json:"id"`
Index uint64 `json:"index"`
RootsID string `json:"rootsID"`
PrevID string `json:"prevID"`
CumulativeWeight int64 `json:"cumulativeWeight"`
StartTimestamp time.Time `json:"startTimestamp"`
EndTimestamp time.Time `json:"endTimestamp"`
}
func SlotInfoFromRecord ¶
func SlotInfoFromRecord(c *commitment.Commitment, start, end time.Time) *SlotInfo
type SlotUTXOsResponse ¶
type SlotVotersWeightResponse ¶
type SlotVotersWeightResponse struct {
VotersWeight map[string]*NodeWeight `json:"voters"`
}
type SlotsResponse ¶
type SlotsResponse struct {
Slots []*SlotInfo `json:"slots"`
}
type SpammerRequest ¶
type SpammerRequest struct {
Cmd string `query:"cmd"`
IMIF string `query:"imif"`
Rate int `query:"rate"`
Unit string `query:"unit"`
PayloadSize uint64 `query:"payloadSize"`
}
SpammerRequest contains the parameters of a spammer request.
type SpammerResponse ¶
SpammerResponse is the HTTP response of a spammer request.
type StructureDetails ¶
type StructureDetails struct {
Rank uint64 `json:"rank"`
PastMarkerGap uint64 `json:"pastMarkerGap"`
IsPastMarker bool `json:"isPastMarker"`
PastMarkers *Markers `json:"pastMarkers"`
}
StructureDetails represents the JSON model of the markersold.StructureDetails.
func NewStructureDetails ¶
func NewStructureDetails(structureDetails *markers.StructureDetails) *StructureDetails
NewStructureDetails returns the StructureDetails from the given markersold.StructureDetails.
type TimeProvider ¶
type TimeProvider struct {
GenesisTime time.Time `json:"genesisTime"`
SlotDuration time.Duration `json:"slotDuration"`
}
TimeProvider contains the details for the time provider.
type Transaction ¶
type Transaction struct {
Version devnetvm.TransactionEssenceVersion `json:"version"`
Timestamp int64 `json:"timestamp"`
AccessPledgeID string `json:"accessPledgeID"`
ConsensusPledgeID string `json:"consensusPledgeID"`
Inputs []*Input `json:"inputs"`
Outputs []*Output `json:"outputs"`
UnlockBlocks []*UnlockBlock `json:"unlockBlocks"`
DataPayload []byte `json:"dataPayload"`
}
Transaction represents the JSON model of a ledgerstate.Transaction.
func NewTransaction ¶
func NewTransaction(transaction *devnetvm.Transaction) *Transaction
NewTransaction returns a Transaction from the given ledgerstate.Transaction.
type TransactionMetadata ¶
type TransactionMetadata struct {
TransactionID string `json:"transactionID"`
ConflictIDs []string `json:"conflictIDs"`
Booked bool `json:"booked"`
BookedTime int64 `json:"bookedTime"`
ConfirmationState confirmation.State `json:"confirmationState"`
ConfirmationStateTime int64 `json:"confirmationStateTime"`
}
TransactionMetadata represents the JSON model of the mempool.TransactionMetadata.
func NewTransactionMetadata ¶
func NewTransactionMetadata(transactionMetadata *mempool.TransactionMetadata) *TransactionMetadata
NewTransactionMetadata returns the TransactionMetadata from the given mempool.TransactionMetadata.
type UnlockBlock ¶
type UnlockBlock struct {
Type string `json:"type"`
ReferencedIndex uint16 `json:"referencedIndex,omitempty"`
SignatureType devnetvm.SignatureType `json:"signatureType,omitempty"`
PublicKey string `json:"publicKey,omitempty"`
Signature string `json:"signature,omitempty"`
}
UnlockBlock represents the JSON model of a ledgerstate.UnlockBlock.
func NewUnlockBlock ¶
func NewUnlockBlock(unlockBlock devnetvm.UnlockBlock) *UnlockBlock
NewUnlockBlock returns an UnlockBlock from the given ledgerstate.UnlockBlock.
type WalletOutput ¶
type WalletOutput struct {
Output Output `json:"output"`
Metadata WalletOutputMetadata `json:"metadata"`
ConfirmationState confirmation.State `json:"confirmationState"`
}
WalletOutput represents an output as expected by the wallet lib.
type WalletOutputMetadata ¶
WalletOutputMetadata holds metadata about the output.
type WalletOutputsOnAddress ¶
type WalletOutputsOnAddress struct {
Address Address `json:"address"`
Outputs []WalletOutput `json:"outputs"`
}
WalletOutputsOnAddress represents wallet outputs on an address.