Documentation ¶
Index ¶
Constants ¶
View Source
const ( Identifier = "73424348" // ascii code for 'sBCH' Version = "00" ShaGateAddress = "14f8c7e99fd4e867c34cbd5968e35575fd5919a4" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BCHBlock ¶
type BCHBlock struct { Height int64 Timestamp int64 HashId [32]byte ParentBlk [32]byte Nominations []stakingtypes.Nomination CCTransferInfos []*cctypes.CCTransferInfo }
This struct contains the useful information of a BCH block
type BlockCountResp ¶
type BlockCountResp struct { Result int64 `json:"result"` Error *JsonRpcError `json:"error"` Id string `json:"id"` }
type BlockHashResp ¶
type BlockHashResp struct { Result string `json:"result"` Error *JsonRpcError `json:"error"` Id string `json:"id"` }
type BlockInfo ¶
type BlockInfo struct { Hash string `json:"hash"` Confirmations int `json:"confirmations"` Size int `json:"size"` Height int64 `json:"height"` Version int `json:"version"` VersionHex string `json:"versionHex"` Merkleroot string `json:"merkleroot"` Tx []TxInfo `json:"tx"` RawTx []TxInfo `json:"rawtx"` // BCHD Time int64 `json:"time"` MedianTime int64 `json:"mediantime"` Nonce int `json:"nonce"` Bits string `json:"bits"` Difficulty float64 `json:"difficulty"` Chainwork string `json:"chainwork"` NumTx int `json:"nTx"` PreviousBlockhash string `json:"previousblockhash"` }
type BlockInfoResp ¶
type BlockInfoResp struct { Result BlockInfo `json:"result"` Error *JsonRpcError `json:"error"` Id string `json:"id"` }
type CoinbaseVin ¶
type JsonRpcError ¶
**mainnet data structure
type RpcClient ¶
type RpcClient interface { GetLatestHeight(retry bool) int64 GetBlockByHeight(height int64, retry bool) *BCHBlock GetEpochs(start, end uint64) []*stakingtypes.Epoch GetCCEpochs(start, end uint64) []*cctypes.CCEpoch }
These functions must be provided by a client connecting to a Bitcoin Cash's fullnode
type TxInfo ¶
type TxInfo struct { TxID string `json:"txid"` Hash string `json:"hash"` Version int `json:"version"` Size int `json:"size"` Locktime int `json:"locktime"` VinList []map[string]interface{} `json:"vin"` VoutList []Vout `json:"vout"` Hex string `json:"hex"` Blockhash string `json:"blockhash"` Confirmations int `json:"confirmations"` Time int64 `json:"time"` BlockTime int64 `json:"blocktime"` }
func (TxInfo) GetCCTransferInfos ¶ added in v0.4.0
func (ti TxInfo) GetCCTransferInfos() (infos []*cctypes.CCTransferInfo)
func (TxInfo) GetValidatorPubKey ¶
type TxInfoResp ¶
type TxInfoResp struct { Result TxInfo `json:"result"` Error *JsonRpcError `json:"error"` Id string `json:"id"` }
Click to show internal directories.
Click to hide internal directories.