Versions in this module Expand all Collapse all v0 v0.0.10 Mar 17, 2021 Changes in this version + const Blockchain + const CoinbaseOpType + const Decimals + const InputOpType + const InputSize + const MainnetNetwork + const MinFeeRate + const NullData + const OutputOpType + const OutputOverhead + const P2PKHScriptPubkeySize + const SatoshisInDFI + const SkippedStatus + const SuccessStatus + const TestnetNetwork + const TransactionHashLength + const TransactionOverhead + var ErrBlockNotFound = errors.New("unable to find block") + var ErrJSONRPCError = errors.New("JSON-RPC error") + var MainnetCurrency = &types.Currency + var MainnetGenesisBlockIdentifier = &types.BlockIdentifier + var MainnetParams = &chaincfg.MainNetParams + var OperationStatuses = []*types.OperationStatus + var OperationTypes = []string + var TestnetCurrency = &types.Currency + var TestnetGenesisBlockIdentifier = &types.BlockIdentifier + var TestnetParams = &chaincfg.TestNet3Params + func CoinIdentifier(hash string, vout int64) string + func LocalhostURL(rpcPort int) string + func ParseCoinIdentifier(coinIdentifier *types.CoinIdentifier) (*chainhash.Hash, uint32, error) + func ParseSingleAddress(chainParams *chaincfg.Params, script []byte) (txscript.ScriptClass, btcutil.Address, error) + func StartDefid(ctx context.Context, configPath string, g *errgroup.Group) error + func TransactionHash(identifier string) string + type Block struct + Bits string + Difficulty float64 + Hash string + Height int64 + MedianTime int64 + MerkleRoot string + Nonce int64 + PreviousBlockHash string + Size int64 + Time int64 + Txs []*Transaction + Version int32 + Weight int64 + func (b Block) Metadata() (map[string]interface{}, error) + type BlockMetadata struct + Bits string + Difficulty float64 + MedianTime int64 + MerkleRoot string + Nonce int64 + Size int64 + Version int32 + Weight int64 + type BlockchainInfo struct + BestBlockHash string + Blocks int64 + Chain string + type Client struct + func NewClient(baseURL string, genesisBlockIdentifier *types.BlockIdentifier, ...) *Client + func (b *Client) GetPeers(ctx context.Context) ([]*types.Peer, error) + func (b *Client) GetRawBlock(ctx context.Context, identifier *types.PartialBlockIdentifier) (_ *Block, coins []string, _ error) + func (b *Client) GetRawTransaction(ctx context.Context, txid, blockhash string) (*Transaction, error) + func (b *Client) GetTransaction(ctx context.Context, txid string) ([]byte, error) + func (b *Client) NetworkStatus(ctx context.Context) (*types.NetworkStatusResponse, error) + func (b *Client) ParseBlock(ctx context.Context, block *Block, coins map[string]*types.AccountCoin) (*types.Block, error) + func (b *Client) PruneBlockchain(ctx context.Context, height int64) (int64, error) + func (b *Client) RawMempool(ctx context.Context) ([]string, error) + func (b *Client) SendRawTransaction(ctx context.Context, serializedTx string) (string, error) + func (b *Client) SuggestedFeeRate(ctx context.Context, confTarget int64) (float64, error) + type Input struct + Coinbase string + ScriptSig *ScriptSig + Sequence int64 + TxHash string + TxInWitness []string + Vout int64 + func (i Input) Metadata() (map[string]interface{}, error) + type OperationMetadata struct + Coinbase string + ScriptPubKey *ScriptPubKey + ScriptSig *ScriptSig + Sequence int64 + TxInWitness []string + type Output struct + Index int64 + ScriptPubKey *ScriptPubKey + Value float64 + func (o Output) Metadata() (map[string]interface{}, error) + type PeerInfo struct + Addr string + BanScore int64 + LastRecv int64 + LastSend int64 + RelayTxes bool + StartingHeight int64 + SubVer string + SyncedBlocks int64 + SyncedHeaders int64 + Version int64 + type ScriptPubKey struct + ASM string + Addresses []string + Hex string + RequiredSigs int64 + Type string + type ScriptSig struct + ASM string + Hex string + type Transaction struct + Hash string + Hex string + Inputs []*Input + Locktime int64 + Outputs []*Output + Size int64 + Version int32 + Vsize int64 + Weight int64 + func (t Transaction) Metadata() (map[string]interface{}, error) + type TransactionMetadata struct + Locktime int64 + Size int64 + Version int32 + Vsize int64 + Weight int64