Documentation
¶
Index ¶
- Constants
- func SetHeader(w http.ResponseWriter)
- func WriteErr(w http.ResponseWriter, errStr string)
- func WriteOk(w http.ResponseWriter)
- type Balance
- type BranchData
- type Bytecode
- type ChainOutput
- type ChainedOutputs
- type Chains
- type CheckTxIDInLRB
- type DelegationData
- type DelegationsBySequencer
- type DelegationsOnSequencer
- type Error
- type Input
- type KnownLatestMilestones
- type LatestReliableBranch
- type MainChain
- type MilestoneData
- type OutputData
- type OutputDataWithID
- type OutputList
- type ParsedOutput
- type ParsedOutputList
- type PeerInfo
- type PeersInfo
- type ScriptSource
- type SequencerData
- type SequencerSyncInfo
- type SequencerTxData
- type Sequencers
- type SnapshotID
- type SyncInfo
- type TransactionJSONAble
- type TxBytes
- type VertexDelete
- type VertexWithDependencies
Constants ¶
View Source
const ( PrefixAPIV1 = "/api/v1" PrefixTxAPIV1 = "/txapi/v1" PrefixWebSocketV1 = "/wsapi/v1" PathGetLedgerIDData = PrefixAPIV1 + "/get_ledger_id_data" PathGetAccountOutputs = PrefixAPIV1 + "/get_account_outputs" PathGetAccountParsedOutputs = PrefixAPIV1 + "/get_account_parsed_outputs" PathGetAccountSimpleSiglockedOutputs = PrefixAPIV1 + "/get_account_simple_siglocked" PathGetOutputsForAmount = PrefixAPIV1 + "/get_outputs_for_amount" PathGetNonChainBalance = PrefixAPIV1 + "/get_nonchain_balance" PathGetChainedOutputs = PrefixAPIV1 + "/get_chain_outputs" PathGetDelegationOutputs = PrefixAPIV1 + "/get_delegation_outputs" PathGetChainOutput = PrefixAPIV1 + "/get_chain_output" PathGetOutput = PrefixAPIV1 + "/get_output" PathSubmitTransaction = PrefixAPIV1 + "/submit_tx" PathGetSyncInfo = PrefixAPIV1 + "/sync_info" PathGetNodeInfo = PrefixAPIV1 + "/node_info" PathGetPeersInfo = PrefixAPIV1 + "/peers_info" PathGetLatestReliableBranch = PrefixAPIV1 + "/get_latest_reliable_branch" PathGetSnapshotBranchID = PrefixAPIV1 + "/get_snapshot_branch_id" PathCheckTxIDInLRB = PrefixAPIV1 + "/check_txid_in_lrb" PathGetLastKnownSequencerMilestones = PrefixAPIV1 + "/last_known_milestones" PathGetMainChain = PrefixAPIV1 + "/get_mainchain" PathGetAllChains = PrefixAPIV1 + "/get_all_chains" PathGetSequencers = PrefixAPIV1 + "/get_sequencers" // 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" // WebSocket API PathDAGVertexStream = PrefixWebSocketV1 + "/dag_vertex_stream" )
View Source
const ErrGetOutputNotFound = "output not found"
Variables ¶
This section is empty.
Functions ¶
func SetHeader ¶
func SetHeader(w http.ResponseWriter)
func WriteErr ¶
func WriteErr(w http.ResponseWriter, errStr string)
func WriteOk ¶
func WriteOk(w http.ResponseWriter)
Types ¶
type BranchData ¶
type BranchData struct {
ID string `json:"id"`
Data multistate.BranchDataJSONAble `json:"data"`
}
type ChainOutput ¶
type ChainOutput struct {
Error
OutputDataWithID
// latest reliable branch used to extract chain id
LRBID string `json:"lrbid"`
}
ChainOutput is returned by 'get_chain_output'
type ChainedOutputs ¶
type Chains ¶
type Chains struct {
Error
Chains map[string]OutputDataWithID `json:"chains"`
LRBID string `json:"lrbid"`
}
type CheckTxIDInLRB ¶
type DelegationData ¶
type DelegationsBySequencer ¶
type DelegationsBySequencer struct {
Error
LRBID string `json:"lrbid"`
Sequencers map[string]DelegationsOnSequencer `json:"sequencers"`
}
type DelegationsOnSequencer ¶
type DelegationsOnSequencer struct {
SequencerOutputID string `json:"seq_output_id"`
SequencerName string `json:"seq_name"`
Balance uint64 `json:"balance"`
Delegations map[string]DelegationData `json:"delegations"`
}
type Error ¶
type Error struct {
// empty string when no error
Error string `json:"error,omitempty"`
}
type KnownLatestMilestones ¶
type KnownLatestMilestones struct {
Error
Sequencers map[string]tippool.LatestSequencerTipDataJSONAble `json:"sequencers"`
}
type LatestReliableBranch ¶
type LatestReliableBranch struct {
Error
RootData multistate.RootRecordJSONAble `json:"root_record,omitempty"`
BranchID base.TransactionID `json:"branch_id,omitempty"`
}
LatestReliableBranch returned by get_latest_reliable_branch
type MainChain ¶
type MainChain struct {
Error
Branches []BranchData `json:"branches"`
}
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:"lrbid"`
}
OutputData is returned by 'get_output'
type OutputDataWithID ¶
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:"lrbid"`
}
OutputList is returned by 'get_account_outputs'
type ParsedOutput ¶
type ParsedOutput struct {
// raw hex-encoded output data
Data string `json:"data"`
// parsed constraints for display
Constraints []string `json:"constraints"`
// amount
Amount uint64 `json:"amount"`
// name of the lock constraint
LockName string `json:"lock_name"`
// Chain id for chain outputs
ChainID string `json:"chain_id,omitempty"`
}
type ParsedOutputList ¶
type ParsedOutputList struct {
Error
// key is hex-encoded outputID bytes
// value is hex-encoded raw output data
Outputs map[string]ParsedOutput `json:"outputs,omitempty"`
// latest reliable branch used to extract outputs
LRBID string `json:"lrbid"`
}
ParsedOutputList is returned by 'get_account_parsed_outputs'
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 ScriptSource ¶
type ScriptSource struct {
Source string `json:"source"`
}
type SequencerData ¶
type SequencerData struct {
OutputDataWithID
NumDelegations int `json:"num_delegations"`
}
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 Sequencers ¶
type Sequencers struct {
Error
LRBID string `json:"lrbid"`
OutputData map[string]SequencerData `json:"sequencers"`
}
type SnapshotID ¶
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 VertexDelete ¶
type VertexDelete struct {
ID string `json:"id"` // transaction ID in hex form
}
type VertexWithDependencies ¶
type VertexWithDependencies struct {
ID string `json:"id"` // transaction ID in hex form
TotalAmount uint64 `json:"a"` // total produced amount on transaction
TotalInflation uint64 `json:"i,omitempty"` // total inflation on transaction
SequencerID string `json:"seqid,omitempty"` // "" (omitted) for non-seq. Useful for coloring
SequencerInputTxIndex *byte `json:"seqidx,omitempty"` // sequencer predecessor tx index for sequencer predecessor tx in the Inputs list, otherwise nil
StemInputTxIndex *byte `json:"stemidx,omitempty"` // stem predecessor (branch) tx index for stem predecessor tx in the Inputs list, otherwise nil
Inputs []string `json:"in"` // list of input IDs (not empty)
Endorsements []string `json:"endorse,omitempty"` // list of endorsements (can be nil)
ExplicitBaseline string `json:"explicit_baseline,omitempty"` // explicit baseline ID, if available
}
VertexWithDependencies primary purpose is streaming vertices for DAG visualization
func VertexWithDependenciesFromTransaction ¶
func VertexWithDependenciesFromTransaction(tx *transaction.Transaction) *VertexWithDependencies
Click to show internal directories.
Click to hide internal directories.