Documentation ¶
Index ¶
- type AllowedManaPledgeResponse
- type AllowedPledge
- type AttachmentsResponse
- type Balance
- type GetTransactionByIDResponse
- type InclusionState
- type Input
- type Metadata
- type Output
- type OutputID
- type SendTransactionByJSONRequest
- type SendTransactionByJSONResponse
- type SendTransactionRequest
- type SendTransactionResponse
- type Transaction
- type TransactionMetadata
- type UnlockBlock
- type UnspentOutput
- type UnspentOutputsRequest
- type UnspentOutputsResponse
- type ValueObject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 AttachmentsResponse ¶
type AttachmentsResponse struct { Attachments []ValueObject `json:"attachments,omitempty"` Error string `json:"error,omitempty"` }
AttachmentsResponse is the HTTP response from retrieving value objects.
type GetTransactionByIDResponse ¶
type GetTransactionByIDResponse struct { TransactionMetadata TransactionMetadata `json:"transactionMetadata"` Transaction Transaction `json:"transaction"` InclusionState InclusionState `json:"inclusion_state"` Error string `json:"error,omitempty"` }
GetTransactionByIDResponse is the HTTP response from retrieving transaction.
type InclusionState ¶
type InclusionState struct { Solid bool `json:"solid,omitempty"` Confirmed bool `json:"confirmed,omitempty"` Rejected bool `json:"rejected,omitempty"` Liked bool `json:"liked,omitempty"` Conflicting bool `json:"conflicting,omitempty"` Finalized bool `json:"finalized,omitempty"` Preferred bool `json:"preferred,omitempty"` }
InclusionState represents the different states of an OutputID
type Input ¶
type Input struct {
ConsumedOutputID string `json:"consumedOutputID"`
}
Input holds the consumedOutputID
type Output ¶
type Output struct { Type ledgerstate.OutputType `json:"type"` Address string `json:"address"` Balances []Balance `json:"balances"` }
Output consists an address and balances
type OutputID ¶
type OutputID struct { ID string `json:"id"` Balances []Balance `json:"balances"` InclusionState InclusionState `json:"inclusion_state"` Metadata Metadata `json:"output_metadata"` }
OutputID holds the output id and its inclusion state
type SendTransactionByJSONRequest ¶
type SendTransactionByJSONRequest struct { Inputs []string `json:"inputs"` Outputs []Output `json:"outputs"` AManaPledgeID string `json:"a_mana_pledg"` CManaPledgeID string `json:"c_mana_pledg"` Signatures []UnlockBlock `json:"signatures"` Payload []byte `json:"payload"` }
SendTransactionByJSONRequest holds the transaction object(json) to send. e.g.,
{ "inputs": string[], "a_mana_pledge": string, "c_mana_pledg": string, "outputs": { "type": number, "address": string, "balances": { "value": number, "color": string }[]; }[], "signature": []string }
type SendTransactionByJSONResponse ¶
type SendTransactionByJSONResponse struct { TransactionID string `json:"transaction_id,omitempty"` Error string `json:"error,omitempty"` }
SendTransactionByJSONResponse is the HTTP response from sending transaction.
type SendTransactionRequest ¶
type SendTransactionRequest struct {
TransactionBytes []byte `json:"txn_bytes"`
}
SendTransactionRequest holds the transaction object(bytes) to send.
type SendTransactionResponse ¶
type SendTransactionResponse struct { TransactionID string `json:"transaction_id,omitempty"` Error string `json:"error,omitempty"` }
SendTransactionResponse is the HTTP response from sending transaction.
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 holds the information of a transaction.
func ParseTransaction ¶
func ParseTransaction(tx *ledgerstate.Transaction) (txn Transaction)
ParseTransaction handle transaction json object.
type TransactionMetadata ¶
type TransactionMetadata struct { BranchID string `json:"branchID"` Solid bool `json:"solid"` SolidificationTime int64 `json:"solidificationTime"` Finalized bool `json:"finalized"` LazyBooked bool `json:"lazyBooked"` }
TransactionMetadata holds the information of a transaction metadata.
type UnlockBlock ¶
type UnlockBlock struct { Type ledgerstate.UnlockBlockType `json:"type"` ReferencedIndex uint16 `json:"referencedIndex,omitempty"` SignatureType ledgerstate.SignatureType `json:"signatureType,omitempty"` PublicKey string `json:"publicKey,omitempty"` Signature string `json:"signature,omitempty"` }
UnlockBlock defines the struct of a signature.
type UnspentOutput ¶
type UnspentOutput struct { Address string `json:"address"` OutputIDs []OutputID `json:"output_ids"` }
UnspentOutput holds the address and the corresponding unspent output ids
type UnspentOutputsRequest ¶
type UnspentOutputsRequest struct { Addresses []string `json:"addresses,omitempty"` Error string `json:"error,omitempty"` }
UnspentOutputsRequest holds the addresses to query.
type UnspentOutputsResponse ¶
type UnspentOutputsResponse struct { UnspentOutputs []UnspentOutput `json:"unspent_outputs,omitempty"` Error string `json:"error,omitempty"` }
UnspentOutputsResponse is the HTTP response from retrieving value objects.
type ValueObject ¶
type ValueObject struct { ID string `json:"id"` Parents []string `json:"parents"` Transaction Transaction `json:"transaction"` }
ValueObject holds the information of a value object.