jsonmodels

package
v0.5.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2021 License: Apache-2.0, BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Type   string `json:"type"`
	Base58 string `json:"base58"`
}

Address represents the JSON model of a ledgerstate.Address.

func NewAddress

func NewAddress(address ledgerstate.Address) *Address

NewAddress returns an Address from the given ledgerstate.Address.

type Branch

type Branch struct {
	ID                 string   `json:"id"`
	Type               string   `json:"type"`
	Parents            []string `json:"parents"`
	ConflictIDs        []string `json:"conflictIDs,omitempty"`
	Liked              bool     `json:"liked"`
	MonotonicallyLiked bool     `json:"monotonicallyLiked"`
	Finalized          bool     `json:"finalized"`
	InclusionState     string   `json:"inclusionState"`
}

Branch represents the JSON model of a ledgerstate.Branch.

func NewBranch

func NewBranch(branch ledgerstate.Branch) Branch

NewBranch returns a Branch from the given ledgerstate.Branch.

type ChildBranch

type ChildBranch struct {
	BranchID   string `json:"branchID"`
	BranchType string `json:"type"`
}

ChildBranch represents the JSON model of a ledgerstate.ChildBranch.

func NewChildBranch

func NewChildBranch(childBranch *ledgerstate.ChildBranch) *ChildBranch

NewChildBranch returns a ChildBranch from the given ledgerstate.ChildBranch.

type CollectiveBeaconRequest added in v0.5.7

type CollectiveBeaconRequest struct {
	Payload []byte `json:"payload"`
}

CollectiveBeaconRequest is a request containing a collective beacon response.

type CollectiveBeaconResponse added in v0.5.7

type CollectiveBeaconResponse struct {
	ID    string `json:"id,omitempty"`
	Error string `json:"error,omitempty"`
}

CollectiveBeaconResponse is the HTTP response from broadcasting a collective beacon message.

type Committee added in v0.5.7

type Committee struct {
	InstanceID    uint32   `json:"instanceID,omitempty"`
	Threshold     uint8    `json:"threshold,omitempty"`
	Identities    []string `json:"identities,omitempty"`
	DistributedPK string   `json:"distributedPK,omitempty"`
}

Committee defines the information about a committee.

type CommitteeResponse added in v0.5.7

type CommitteeResponse struct {
	Committees []Committee `json:"committees,omitempty"`
	Error      string      `json:"error,omitempty"`
}

CommitteeResponse is the HTTP message containing the DRNG committee.

type Conflict

type Conflict struct {
	OutputID  *OutputID `json:"outputID"`
	BranchIDs []string  `json:"branchIDs"`
}

Conflict represents the JSON model of a ledgerstate.Conflict.

func NewConflict

func NewConflict(conflictID ledgerstate.ConflictID, branchIDs []ledgerstate.BranchID) *Conflict

NewConflict returns a Conflict from the given ledgerstate.ConflictID.

type Consumer

type Consumer struct {
	TransactionID string `json:"transactionID"`
	Valid         string `json:"valid"`
}

Consumer represents the JSON model of a ledgerstate.Consumer.

func NewConsumer

func NewConsumer(consumer *ledgerstate.Consumer) *Consumer

NewConsumer returns a Consumer from the given ledgerstate.Consumer.

type DataRequest added in v0.5.7

type DataRequest struct {
	Data []byte `json:"data"`
}

DataRequest contains the data of the message to send.

type DataResponse added in v0.5.7

type DataResponse struct {
	ID    string `json:"id,omitempty"`
	Error string `json:"error,omitempty"`
}

DataResponse contains the ID of the message 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 EventLogsJSON added in v0.5.7

type EventLogsJSON struct {
	Pledge []*mana.PledgedEventJSON `json:"pledge"`
	Revoke []*mana.RevokedEventJSON `json:"revoke"`
}

EventLogsJSON is a events log in JSON.

type FaucetRequest added in v0.5.7

type FaucetRequest struct {
	Address               string `json:"address"`
	AccessManaPledgeID    string `json:"accessManaPledgeID"`
	ConsensusManaPledgeID string `json:"consensusManaPledgeID"`
}

FaucetRequest contains the address to request funds from faucet.

type FaucetResponse added in v0.5.7

type FaucetResponse struct {
	ID    string `json:"id,omitempty"`
	Error string `json:"error,omitempty"`
}

FaucetResponse contains the ID of the message sent.

type GetAddressResponse

type GetAddressResponse struct {
	Address *Address  `json:"address"`
	Outputs []*Output `json:"outputs"`
}

GetAddressResponse represents the JSON model of a response from the GetAddress endpoint.

func NewGetAddressResponse

func NewGetAddressResponse(address ledgerstate.Address, outputs ledgerstate.Outputs) *GetAddressResponse

NewGetAddressResponse returns a GetAddressResponse from the given details.

type GetAllManaResponse added in v0.5.7

type GetAllManaResponse struct {
	Access             []mana.NodeStr `json:"access"`
	AccessTimestamp    int64          `json:"accessTimestamp"`
	Consensus          []mana.NodeStr `json:"consensus"`
	ConsensusTimestamp int64          `json:"consensusTimestamp"`
	Error              string         `json:"error,omitempty"`
}

GetAllManaResponse is the request to a getAllManaHandler request.

type GetBranchChildrenResponse

type GetBranchChildrenResponse struct {
	BranchID      string         `json:"branchID"`
	ChildBranches []*ChildBranch `json:"childBranches"`
}

GetBranchChildrenResponse represents the JSON model of a response from the GetBranchChildren endpoint.

func NewGetBranchChildrenResponse

func NewGetBranchChildrenResponse(branchID ledgerstate.BranchID, childBranches []*ledgerstate.ChildBranch) *GetBranchChildrenResponse

NewGetBranchChildrenResponse returns a GetBranchChildrenResponse from the given details.

type GetBranchConflictsResponse

type GetBranchConflictsResponse struct {
	BranchID  string      `json:"branchID"`
	Conflicts []*Conflict `json:"conflicts"`
}

GetBranchConflictsResponse represents the JSON model of a response from the GetBranchConflicts endpoint.

func NewGetBranchConflictsResponse

func NewGetBranchConflictsResponse(branchID ledgerstate.BranchID, branchIDsPerConflictID map[ledgerstate.ConflictID][]ledgerstate.BranchID) *GetBranchConflictsResponse

NewGetBranchConflictsResponse returns a GetBranchConflictsResponse from the given details.

type GetEventLogsRequest added in v0.5.7

type GetEventLogsRequest struct {
	NodeIDs   []string `json:"nodeIDs"`
	StartTime int64    `json:"startTime"`
	EndTime   int64    `json:"endTime"`
}

GetEventLogsRequest is the request.

type GetEventLogsResponse added in v0.5.7

type GetEventLogsResponse struct {
	Logs      map[string]*EventLogsJSON `json:"logs"`
	Error     string                    `json:"error,omitempty"`
	StartTime int64                     `json:"startTime"`
	EndTime   int64                     `json:"endTime"`
}

GetEventLogsResponse is the response.

type GetManaRequest added in v0.5.7

type GetManaRequest struct {
	NodeID string `json:"nodeID"`
}

GetManaRequest is the request for get mana.

type GetManaResponse added in v0.5.7

type GetManaResponse struct {
	Error              string  `json:"error,omitempty"`
	ShortNodeID        string  `json:"shortNodeID"`
	NodeID             string  `json:"nodeID"`
	Access             float64 `json:"access"`
	AccessTimestamp    int64   `json:"accessTimestamp"`
	Consensus          float64 `json:"consensus"`
	ConsensusTimestamp int64   `json:"consensusTimestamp"`
}

GetManaResponse defines the response for get mana.

type GetNHighestResponse added in v0.5.7

type GetNHighestResponse struct {
	Error     string         `json:"error,omitempty"`
	Nodes     []mana.NodeStr `json:"nodes,omitempty"`
	Timestamp int64          `json:"timestamp"`
}

GetNHighestResponse holds info about nodes and their mana values.

type GetNeighborsResponse added in v0.5.7

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 added in v0.5.7

type GetOnlineResponse struct {
	Online    []OnlineNodeStr `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 ledgerstate.OutputID, consumers []*ledgerstate.Consumer) *GetOutputConsumersResponse

NewGetOutputConsumersResponse returns a GetOutputConsumersResponse from the given details.

type GetPercentileRequest added in v0.5.7

type GetPercentileRequest struct {
	NodeID string `json:"nodeID"`
}

GetPercentileRequest is the request object of mana/percentile.

type GetPercentileResponse added in v0.5.7

type GetPercentileResponse struct {
	Error              string  `json:"error,omitempty"`
	ShortNodeID        string  `json:"shortNodeID"`
	NodeID             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 GetTransactionAttachmentsResponse

type GetTransactionAttachmentsResponse struct {
	TransactionID string   `json:"transactionID"`
	MessageIDs    []string `json:"messageIDs"`
}

GetTransactionAttachmentsResponse represents the JSON model of a response from the GetTransactionAttachments endpoint.

func NewGetTransactionAttachmentsResponse

func NewGetTransactionAttachmentsResponse(transactionID ledgerstate.TransactionID, messageIDs tangle.MessageIDs) *GetTransactionAttachmentsResponse

NewGetTransactionAttachmentsResponse returns a GetTransactionAttachmentsResponse from the given details.

type InfoResponse added in v0.5.7

type InfoResponse struct {
	// version of GoShimmer
	Version string `json:"version,omitempty"`
	// Network Version of the autopeering
	NetworkVersion uint32 `json:"networkVersion,omitempty"`
	// TangleTime sync status
	TangleTime TangleTime `json:"tangleTime,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"`
	// MessageRequestQueueSize is the number of messages a node is trying to request from neighbors.
	MessageRequestQueueSize int `json:"messageRequestQueueSize,omitempty"`
	// SolidMessageCount is the number of solid messages in the node's database.
	SolidMessageCount int `json:"solidMessageCount,omitempty"`
	// TotalMessageCount is the number of messages in the node's database.
	TotalMessageCount int `json:"totalMessageCount,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"`
	// ManaDecay is the decay coefficient of bm2.
	ManaDecay float64 `json:"mana_decay"`
	// 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"`
}

Input represents the JSON model of a ledgerstate.Input.

func NewInput

func NewInput(input ledgerstate.Input) *Input

NewInput returns an Input from the given ledgerstate.Input.

type Mana added in v0.5.7

type Mana struct {
	Access             float64   `json:"access"`
	AccessTimestamp    time.Time `json:"accessTimestamp"`
	Consensus          float64   `json:"consensus"`
	ConsensusTimestamp time.Time `json:"consensusTimestamp"`
}

Mana contains the different mana values of the node.

type Markers

type Markers struct {
	Markers      map[markersPackage.SequenceID]markersPackage.Index `json:"markers"`
	HighestIndex markersPackage.Index                               `json:"highestIndex"`
	LowestIndex  markersPackage.Index                               `json:"lowestIndex"`
}

Markers represents the JSON model of the markers.Markers.

func NewMarkers

func NewMarkers(markers *markersPackage.Markers) *Markers

NewMarkers returns the Markers from the given markers.Markers.

type Message

type Message struct {
	ID              string   `json:"id"`
	StrongParents   []string `json:"strongParents"`
	WeakParents     []string `json:"weakParents"`
	StrongApprovers []string `json:"strongApprovers"`
	WeakApprovers   []string `json:"weakApprovers"`
	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"`
	Signature       string   `json:"signature"`
}

Message represents the JSON model of a tangle.Message.

func NewMessage

func NewMessage(message *tangle.Message) Message

NewMessage returns a Message from the given tangle.Message.

type MessageConsensusMetadata added in v0.5.7

type MessageConsensusMetadata struct {
	ID                      string `json:"id"`
	OpinionFormedTime       int64  `json:"opinionFormedTime"`
	PayloadOpinionFormed    bool   `json:"payloadOpinionFormed"`
	TimestampOpinionFormed  bool   `json:"timestampOpinionFormed"`
	MessageOpinionFormed    bool   `json:"messageOpinionFormed"`
	MessageOpinionTriggered bool   `json:"messageOpinionTriggered"`
	TimestampOpinion        string `json:"timestampOpinion"`
	TimestampLoK            string `json:"timestampLoK"`
}

MessageConsensusMetadata represents the JSON model of a tangle.Message's consensus metadata.

func NewMessageConsensusMetadata added in v0.5.7

func NewMessageConsensusMetadata(metadata *fcob.MessageMetadata, timestampOpinion *fcob.TimestampOpinion) MessageConsensusMetadata

NewMessageConsensusMetadata returns MessageConsensusMetadata from the given tangle.MessageMetadata.

type MessageMetadata

type MessageMetadata struct {
	ID                 string            `json:"id"`
	ReceivedTime       int64             `json:"receivedTime"`
	Solid              bool              `json:"solid"`
	SolidificationTime int64             `json:"solidificationTime"`
	StructureDetails   *StructureDetails `json:"structureDetails,omitempty"`
	BranchID           string            `json:"branchID"`
	Scheduled          bool              `json:"scheduled"`
	Booked             bool              `json:"booked"`
	Eligible           bool              `json:"eligible"`
	Invalid            bool              `json:"invalid"`
	Finalized          bool              `json:"finalized"`
	FinalizedTime      int64             `json:"finalizedTime"`
}

MessageMetadata represents the JSON model of the tangle.MessageMetadata.

func NewMessageMetadata

func NewMessageMetadata(metadata *tangle.MessageMetadata) MessageMetadata

NewMessageMetadata returns MessageMetadata from the given tangle.MessageMetadata.

type MissingResponse added in v0.5.7

type MissingResponse struct {
	IDs   []string `json:"ids,omitempty"`
	Count int      `json:"count,omitempty"`
}

MissingResponse is the HTTP response containing all the missing messages and their count.

type Neighbor added in v0.5.7

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 Object added in v0.5.7

type Object struct {
	Parents        []string `json:"parent,omitempty"`
	ID             string   `json:"id"`
	Tip            bool     `json:"tip,omitempty"`
	InclusionState string   `json:"inclusionState"`
	Solid          bool     `json:"solid"`
	Finalized      bool     `json:"finalize"`
	Rejected       bool     `json:"rejected"`
	BranchID       string   `json:"branch_id"`
	TransactionID  string   `json:"transaction_id"`
}

Object holds the info of a value object

type ObjectsResponse added in v0.5.7

type ObjectsResponse struct {
	ValueObjects []Object `json:"value_objects,omitempty"`
	Error        string   `json:"error,omitempty"`
}

ObjectsResponse is the HTTP response from retrieving value objects.

type OnlineNodeStr added in v0.5.7

type OnlineNodeStr struct {
	OnlineRank int     `json:"rank"`
	ShortID    string  `json:"shortNodeID"`
	ID         string  `json:"nodeID"`
	Mana       float64 `json:"mana"`
}

OnlineNodeStr holds information about online rank, nodeID and mana,

type Output

type Output struct {
	OutputID *OutputID         `json:"outputID,omitempty"`
	Type     string            `json:"type"`
	Balances map[string]uint64 `json:"balances"`
	Address  string            `json:"address"`
}

Output represents the JSON model of a ledgerstate.Output.

func NewOutput

func NewOutput(output ledgerstate.Output) *Output

NewOutput returns an Output from the given ledgerstate.Output.

type OutputID

type OutputID struct {
	Base58        string `json:"base58"`
	TransactionID string `json:"transactionID"`
	OutputIndex   uint16 `json:"outputIndex"`
}

OutputID represents the JSON model of a ledgerstate.OutputID.

func NewOutputID

func NewOutputID(outputID ledgerstate.OutputID) *OutputID

NewOutputID returns an OutputID from the given ledgerstate.OutputID.

type OutputMetadata

type OutputMetadata struct {
	OutputID           *OutputID `json:"outputID"`
	BranchID           string    `json:"branchID"`
	Solid              bool      `json:"solid"`
	SolidificationTime int64     `json:"solidificationTime"`
	ConsumerCount      int       `json:"consumerCount"`
	FirstConsumer      string    `json:"firstConsumer"`
	Finalized          bool      `json:"finalized"`
}

OutputMetadata represents the JSON model of the ledgerstate.OutputMetadata.

func NewOutputMetadata

func NewOutputMetadata(outputMetadata *ledgerstate.OutputMetadata) *OutputMetadata

NewOutputMetadata returns the OutputMetadata from the given ledgerstate.OutputMetadata.

type PastConsensusManaVectorRequest added in v0.5.7

type PastConsensusManaVectorRequest struct {
	Timestamp int64 `json:"timestamp"`
}

PastConsensusManaVectorRequest is the request.

type PastConsensusManaVectorResponse added in v0.5.7

type PastConsensusManaVectorResponse struct {
	Consensus []mana.NodeStr `json:"consensus"`
	Error     string         `json:"error,omitempty"`
	TimeStamp int64          `json:"timestamp"`
}

PastConsensusManaVectorResponse is the response.

type PastConsensusVectorMetadataResponse added in v0.5.7

type PastConsensusVectorMetadataResponse struct {
	Metadata *mana.ConsensusBasePastManaVectorMetadata `json:"metadata,omitempty"`
	Error    string                                    `json:"error,omitempty"`
}

PastConsensusVectorMetadataResponse is the response.

type PastconeRequest added in v0.5.7

type PastconeRequest struct {
	ID string `json:"id"`
}

PastconeRequest holds the message id to query.

type PastconeResponse added in v0.5.7

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 messages in the past cone and if all messages of the past cone exist on the node.

type PeerService added in v0.5.7

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 PendingRequest added in v0.5.7

type PendingRequest struct {
	OutputID string `json:"outputID"`
}

PendingRequest is the pending mana request.

type PendingResponse added in v0.5.7

type PendingResponse struct {
	Mana      float64 `json:"mana"`
	OutputID  string  `json:"outputID"`
	Error     string  `json:"error,omitempty"`
	Timestamp int64   `json:"timestamp"`
}

PendingResponse is the pending mana response.

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(message *tangle.Message) *PostPayloadResponse

NewPostPayloadResponse returns a PostPayloadResponse from the given tangle.Message.

type Randomness added in v0.5.7

type Randomness struct {
	InstanceID uint32    `json:"instanceID,omitempty"`
	Round      uint64    `json:"round,omitempty"`
	Timestamp  time.Time `json:"timestamp,omitempty"`
	Randomness []byte    `json:"randomness,omitempty"`
}

Randomness defines the content of new randomness.

type RandomnessResponse added in v0.5.7

type RandomnessResponse struct {
	Randomness []Randomness `json:"randomness,omitempty"`
	Error      string       `json:"error,omitempty"`
}

RandomnessResponse is the HTTP message containing the current DRNG randomness.

type SpammerRequest added in v0.5.7

type SpammerRequest struct {
	Cmd  string `json:"cmd"`
	IMIF string `json:"imif"`
	MPM  int    `json:"mpm"`
}

SpammerRequest contains the parameters of a spammer request.

type SpammerResponse added in v0.5.7

type SpammerResponse struct {
	Message string `json:"message"`
	Error   string `json:"error"`
}

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"`
	FutureMarkers *Markers `json:"futureMarkers"`
}

StructureDetails represents the JSON model of the markers.StructureDetails.

func NewStructureDetails

func NewStructureDetails(structureDetails *markersPackage.StructureDetails) *StructureDetails

NewStructureDetails returns the StructureDetails from the given markers.StructureDetails.

type TangleTime added in v0.5.9

type TangleTime struct {
	MessageID string `json:"messageID"`
	Time      int64  `json:"time"`
	Synced    bool   `json:"synced"`
}

TangleTime contains the TangleTime sync detailed status.

type Transaction

type Transaction struct {
	Version           ledgerstate.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 *ledgerstate.Transaction) *Transaction

NewTransaction returns a Transaction from the given ledgerstate.Transaction.

type TransactionConsensusMetadata added in v0.5.7

type TransactionConsensusMetadata struct {
	TransactionID string `json:"transactionID"`
	Timestamp     int64  `json:"timestamp"`
	Liked         bool   `json:"liked"`
	LoK           string `json:"lok"`
	FCOBTime1     int64  `json:"fcobTime1"`
	FCOBTime2     int64  `json:"fcobTime2"`
}

TransactionConsensusMetadata represents the JSON model of the transaction's consensus metadata.

func NewTransactionConsensusMetadata added in v0.5.7

func NewTransactionConsensusMetadata(transactionID ledgerstate.TransactionID, opinion *fcob.Opinion) *TransactionConsensusMetadata

NewTransactionConsensusMetadata returns the TransactionConsensusMetadata from the given transaction ID.

type TransactionMetadata

type TransactionMetadata struct {
	TransactionID      string `json:"transactionID"`
	BranchID           string `json:"branchID"`
	Solid              bool   `json:"solid"`
	SolidificationTime int64  `json:"solidificationTime"`
	Finalized          bool   `json:"finalized"`
	LazyBooked         bool   `json:"lazyBooked"`
}

TransactionMetadata represents the JSON model of the ledgerstate.TransactionMetadata.

func NewTransactionMetadata

func NewTransactionMetadata(transactionMetadata *ledgerstate.TransactionMetadata) *TransactionMetadata

NewTransactionMetadata returns the TransactionMetadata from the given ledgerstate.TransactionMetadata.

type UnlockBlock

type UnlockBlock struct {
	Type            string                    `json:"type"`
	ReferencedIndex uint16                    `json:"referencedIndex,omitempty"`
	SignatureType   ledgerstate.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 ledgerstate.UnlockBlock) *UnlockBlock

NewUnlockBlock returns an UnlockBlock from the given ledgerstate.UnlockBlock.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL