Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTxNotFound = fmt.Errorf("tx %w", errorx.ErrKeyNotFound)
ErrTxNotFound wraps the key not found error in a transaction not found
Functions ¶
func NewService ¶
NewService instantiates a new Service layer for customer
Types ¶
type Input ¶
type Input struct { TxID string `json:"txid,omitempty"` Vout uint32 `json:"vout"` IsCoinbase bool `json:"is_coinbase"` Scriptsig string `json:"scriptsig"` ScriptsigAsm string `json:"scriptsig_asm"` InnerRedeemscriptAsm string `json:"inner_redeemscript_asm"` InnerWitnessscriptAsm string `json:"inner_witnessscript_asm"` Sequence uint32 `json:"sequence"` Witness []string `json:"witness"` Prevout uint32 `json:"prevout"` }
Input model part of Tx
type Output ¶
type Output struct { Scriptpubkey string `json:"scriptpubkey"` ScriptpubkeyAsm string `json:"scriptpubkey_asm"` ScriptpubkeyType string `json:"scriptpubkey_type"` ScriptpubkeyAddress string `json:"scriptpubkey_address"` Value int64 `json:"value"` Index uint32 `json:"index"` // this shoudln't be here, useful for dgraph }
Output model part of Tx
type Service ¶
type Service interface { GetFromHash(hash string) (transaction Tx, err error) GetOutputsFromHash(hash string) (outputs []Output, err error) GetSpentOutputFromHash(hash string, vout uint32) (output Output, err error) GetSpendingFromHash(hash string, vout uint32) (transaction Tx, err error) IsSpent(tx string, index uint32) bool }
Service interface exports available methods for tx service
type Status ¶
type Status struct { Confirmed bool `json:"confirmed"` BlockHeight int32 `json:"block_height"` BlockHash string `json:"block_hash"` BlockTime time.Time `json:"block_time"` }
Status model part of Tx
type Tx ¶
type Tx struct { TxID string `json:"txid,omitempty"` Version int32 `json:"version"` Locktime uint32 `json:"locktime"` Size float32 `json:"size"` Weight float32 `json:"weight"` Fee float32 `json:"fee"` Vin []Input `json:"input,omitempty"` Vout []Output `json:"output,omitempty"` Status []Status `json:"status,omitempty"` // I don't get why this should be an array, dgraph set it to array by default }
Tx model defined by standard
Click to show internal directories.
Click to hide internal directories.