Documentation ¶
Index ¶
- Constants
- type Bytecode
- type ChainOutput
- type CheckRxIDInLRB
- type Error
- type Input
- type InputDependency
- type LatestReliableBranch
- type LedgerID
- type MilestoneData
- type OutputData
- type OutputList
- type ParsedOutput
- type PeerInfo
- type PeersInfo
- type QueryTxInclusionScore
- type QueryTxStatus
- type ScriptSource
- type SequencerSyncInfo
- type SequencerTxData
- type SyncInfo
- type TransactionJSONAble
- type TxBytes
- type TxInclusionScore
- type VertexWithDependencies
Constants ¶
View Source
const ( PrefixAPIV1 = "/api/v1" PrefixTxAPIV1 = "/txapi/v1" PathGetLedgerID = PrefixAPIV1 + "/get_ledger_id" PathGetAccountOutputs = PrefixAPIV1 + "/get_account_outputs" PathGetChainOutput = PrefixAPIV1 + "/get_chain_output" PathGetOutput = PrefixAPIV1 + "/get_output" PathQueryTxStatus = PrefixAPIV1 + "/query_tx_status" PathQueryInclusionScore = PrefixAPIV1 + "/query_inclusion_score" PathSubmitTransaction = PrefixAPIV1 + "/submit_tx" PathGetSyncInfo = PrefixAPIV1 + "/sync_info" PathGetNodeInfo = PrefixAPIV1 + "/node_info" PathGetPeersInfo = PrefixAPIV1 + "/peers_info" PathGetLatestReliableBranch = PrefixAPIV1 + "/get_latest_reliable_branch" PathCheckTxIDInLRB = PrefixAPIV1 + "/check_txid_in_lrb" // PathGetDashboard returns dashboard PathGetDashboard = "/dashboard" PathCompileScript = PrefixTxAPIV1 + "/compile_script" PathDecompileBytecode = PrefixTxAPIV1 + "/decompile_bytecode" PathParseOutputData = PrefixTxAPIV1 + "/parse_output_data" PathParseOutput = PrefixTxAPIV1 + "/parse_output" PathGetTxBytes = PrefixTxAPIV1 + "/get_txbytes" PathGetParsedTransaction = PrefixTxAPIV1 + "/get_parsed_transaction" PathGetVertexWithDependencies = PrefixTxAPIV1 + "/get_vertex_dep" )
View Source
const ErrGetOutputNotFound = "output not found"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainOutput ¶
type ChainOutput struct { Error // hex-encoded outputID OutputID string `json:"output_id,omitempty"` // hex-encoded output data OutputData string `json:"output_data,omitempty"` // latest reliable branch used to extract chain ID LRBID string `json:"lrb_id"` }
ChainOutput is returned by 'get_chain_output'
type CheckRxIDInLRB ¶
type Error ¶
type Error struct { // empty string when no error Error string `json:"error,omitempty"` }
type InputDependency ¶
type LatestReliableBranch ¶
type LatestReliableBranch struct { Error RootData multistate.RootRecordJSONAble `json:"root_record,omitempty"` BranchID ledger.TransactionID `json:"branch_id,omitempty"` }
LatestReliableBranch returned by get_latest_reliable_branch
type MilestoneData ¶
type OutputData ¶
type OutputData struct { Error // hex-encoded output data OutputData string `json:"output_data,omitempty"` // latest reliable branch used to extract output LRBID string `json:"lrb_id"` }
OutputData is returned by 'get_output'
type OutputList ¶
type OutputList struct { Error // key is hex-encoded outputID bytes // value is hex-encoded raw output data Outputs map[string]string `json:"outputs,omitempty"` // latest reliable branch used to extract outputs LRBID string `json:"lrb_id"` }
OutputList is returned by 'get_account_outputs'
type ParsedOutput ¶
type PeerInfo ¶
type PeerInfo struct { // The libp2p identifier of the peer. ID string `json:"id"` // The libp2p multi addresses of the peer. MultiAddresses []string `json:"multiAddresses,omitempty"` IsStatic bool `json:"is_static"` RespondsToPull bool `json:"responds_to_pull"` IsAlive bool `json:"is_alive"` WhenAdded int64 `json:"when_added"` LastHeartbeatReceived int64 `json:"last_heartbeat_received"` ClockDifferencesQuartiles [3]int64 `json:"clock_differences_quartiles"` HBMsgDifferencesQuartiles [3]int64 `json:"hb_differences_quartiles"` NumIncomingHB int `json:"num_incoming_hb"` NumIncomingPull int `json:"num_incoming_pull"` NumIncomingTx int `json:"num_incoming_tx"` }
type QueryTxInclusionScore ¶
type QueryTxInclusionScore struct { Error TxInclusionScore }
type QueryTxStatus ¶
type QueryTxStatus struct { Error TxIDStatus vertex.TxIDStatusJSONAble `json:"txid_status"` Inclusion *multistate.TxInclusionJSONAble `json:"inclusion,omitempty"` }
type ScriptSource ¶
type ScriptSource struct {
Source string `json:"source"`
}
type SequencerSyncInfo ¶
type SequencerTxData ¶
type SequencerTxData struct { SequencerID string `json:"sequencer_id"` SequencerOutputIndex byte `json:"sequencer_output_index"` StemOutputIndex *byte `json:"stem_output_index,omitempty"` // nil for non-branch transaction *MilestoneData `json:"milestone_data,omitempty"` }
type TransactionJSONAble ¶
type TransactionJSONAble struct { // hex-encoded transaction ID ID string `json:"id"` TotalAmount uint64 `json:"total_amount"` TotalInflation uint64 `json:"total_inflation"` IsBranch bool `json:"is_branch"` *SequencerTxData `json:"sequencer_tx_data,omitempty"` Sender string `json:"sender"` Signature string `json:"signature"` Inputs []Input `json:"inputs"` Outputs []ParsedOutput `json:"outputs"` Endorsements []string `json:"endorsements,omitempty"` TxMetadata *txmetadata.TransactionMetadataJSONAble `json:"tx_metadata,omitempty"` }
TransactionJSONAble is more or less human-readable form of the transaction. Intended mostly for display It is not a canonical form. The canonical form is binary blob. It cannot be reproduced from the TransactionJSONAble
func JSONAbleFromTransaction ¶
func JSONAbleFromTransaction(tx *transaction.Transaction) *TransactionJSONAble
type TxBytes ¶
type TxBytes struct { TxBytes string `json:"tx_bytes"` TxMetadata *txmetadata.TransactionMetadataJSONAble `json:"tx_metadata,omitempty"` }
type TxInclusionScore ¶
type TxInclusionScore struct { ThresholdNumerator int `json:"threshold_numerator"` ThresholdDenominator int `json:"threshold_denominator"` LatestSlot int `json:"latest_slot"` EarliestSlot int `json:"earliest_slot"` StrongScore int `json:"strong_score"` WeakScore int `json:"weak_score"` LRBID string `json:"lrb_id"` IncludedInLRB bool `json:"included_in_lrb"` }
func CalcTxInclusionScore ¶
func CalcTxInclusionScore(inclusion *multistate.TxInclusion, thresholdNumerator, thresholdDenominator int) TxInclusionScore
type VertexWithDependencies ¶
type VertexWithDependencies struct { ID string `json:"id"` TotalAmount uint64 `json:"total_amount"` TotalInflation uint64 `json:"total_inflation"` IsSequencerTx bool `json:"is_sequencer_tx"` IsBranch bool `json:"is_branch"` SequencerID string `json:"sequencer_id,omitempty"` SequencerInputIndex *byte `json:"sequencer_input_index,omitempty"` StemInputIndex *byte `json:"stem_input_index,omitempty"` InputDependencies []string `json:"input_dependencies"` Endorsements []string `json:"endorsements,omitempty"` }
func VertexWithDependenciesFromTransaction ¶
func VertexWithDependenciesFromTransaction(tx *transaction.Transaction) *VertexWithDependencies
Click to show internal directories.
Click to hide internal directories.