Documentation
¶
Index ¶
- Variables
- type BTCClient
- type BitcoinConnector
- type Block
- func (*Block) Descriptor() ([]byte, []int)deprecated
- func (x *Block) GetBits() string
- func (x *Block) GetConfirmations() int64
- func (x *Block) GetDifficulty() float64
- func (x *Block) GetHash() string
- func (x *Block) GetHeight() int64
- func (x *Block) GetMerkleRoot() string
- func (x *Block) GetNextHash() string
- func (x *Block) GetNonce() uint32
- func (x *Block) GetPreviousHash() string
- func (x *Block) GetSize() int32
- func (x *Block) GetStrippedSize() int32
- func (x *Block) GetTs() *timestamppb.Timestamp
- func (x *Block) GetVersion() int32
- func (x *Block) GetVersionHex() string
- func (x *Block) GetWeight() int32
- func (*Block) ProtoMessage()
- func (x *Block) ProtoReflect() protoreflect.Message
- func (x *Block) Reset()
- func (x *Block) String() string
- func (b *Block) UnmarshalBTCBlock(in *btcjson.GetBlockVerboseResult)
- type Transaction
- func (*Transaction) Descriptor() ([]byte, []int)deprecated
- func (x *Transaction) GetBlockHash() string
- func (x *Transaction) GetBlocktime() int64
- func (x *Transaction) GetConfirmations() uint64
- func (x *Transaction) GetHash() string
- func (x *Transaction) GetHex() string
- func (x *Transaction) GetLockTime() uint32
- func (x *Transaction) GetSize() int32
- func (x *Transaction) GetTs() *timestamppb.Timestamp
- func (x *Transaction) GetTxid() string
- func (x *Transaction) GetVersion() uint32
- func (x *Transaction) GetVin() []*Vin
- func (x *Transaction) GetVout() []*Vout
- func (x *Transaction) GetVsize() int32
- func (x *Transaction) GetWeight() int32
- func (*Transaction) ProtoMessage()
- func (x *Transaction) ProtoReflect() protoreflect.Message
- func (x *Transaction) Reset()
- func (x *Transaction) String() string
- func (tx *Transaction) UnmarshalBTCTransaction(in *btcjson.TxRawResult)
- type Vin
- func (*Vin) Descriptor() ([]byte, []int)deprecated
- func (x *Vin) GetAsm() string
- func (x *Vin) GetCoinbase() string
- func (x *Vin) GetHex() string
- func (x *Vin) GetSequence() uint32
- func (x *Vin) GetTxid() string
- func (x *Vin) GetVout() uint32
- func (x *Vin) GetWitness() []string
- func (*Vin) ProtoMessage()
- func (x *Vin) ProtoReflect() protoreflect.Message
- func (x *Vin) Reset()
- func (x *Vin) String() string
- type Vout
- func (*Vout) Descriptor() ([]byte, []int)deprecated
- func (x *Vout) GetAddresses() []string
- func (x *Vout) GetAsm() string
- func (x *Vout) GetHex() string
- func (x *Vout) GetN() uint32
- func (x *Vout) GetReqSigs() int32
- func (x *Vout) GetType() string
- func (x *Vout) GetValue() float64
- func (*Vout) ProtoMessage()
- func (x *Vout) ProtoReflect() protoreflect.Message
- func (x *Vout) Reset()
- func (x *Vout) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var File_connectors_source_bitcoin_bitcoin_proto protoreflect.FileDescriptor
View Source
var TopicTypes = map[string]proto.Message{ "nakji.bitcoin.0_0_0.chain_block": &Block{}, "nakji.bitcoin.0_0_0.chain_tx": &Transaction{}, }
Functions ¶
This section is empty.
Types ¶
type BTCClient ¶
type BTCClient interface { GetBlock(*chainhash.Hash) (*wire.MsgBlock, error) GetBlockVerbose(*chainhash.Hash) (*btcjson.GetBlockVerboseResult, error) GetRawTransactionVerbose(*chainhash.Hash) (*btcjson.TxRawResult, error) Shutdown() WaitForShutdown() NotifyBlocks() error GetBlockCount() (int64, error) }
type BitcoinConnector ¶
type BitcoinConnector struct { *connector.Connector // embed Nakji connector.Connector into your custom connector to get access to all its methods // contains filtered or unexported fields }
func NewConnector ¶
func NewConnector(callback func()) *BitcoinConnector
NewConnector creates new BitcoinConnector and connects to the bitcoin RPC
func (*BitcoinConnector) Start ¶
func (c *BitcoinConnector) Start(ctx context.Context)
type Block ¶
type Block struct { Ts *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=ts,proto3" json:"ts,omitempty"` MerkleRoot string `protobuf:"bytes,2,opt,name=merkle_root,json=merkleRoot,proto3" json:"merkle_root,omitempty"` Bits string `protobuf:"bytes,3,opt,name=bits,proto3" json:"bits,omitempty"` Hash string `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` Difficulty float64 `protobuf:"fixed64,5,opt,name=difficulty,proto3" json:"difficulty,omitempty"` Nonce uint32 `protobuf:"varint,6,opt,name=nonce,proto3" json:"nonce,omitempty"` PreviousHash string `protobuf:"bytes,7,opt,name=previous_hash,json=previousHash,proto3" json:"previous_hash,omitempty"` NextHash string `protobuf:"bytes,8,opt,name=next_hash,json=nextHash,proto3" json:"next_hash,omitempty"` Version int32 `protobuf:"varint,9,opt,name=version,proto3" json:"version,omitempty"` VersionHex string `protobuf:"bytes,10,opt,name=version_hex,json=versionHex,proto3" json:"version_hex,omitempty"` Height int64 `protobuf:"varint,11,opt,name=height,proto3" json:"height,omitempty"` Weight int32 `protobuf:"varint,12,opt,name=weight,proto3" json:"weight,omitempty"` Size int32 `protobuf:"varint,13,opt,name=size,proto3" json:"size,omitempty"` StrippedSize int32 `protobuf:"varint,14,opt,name=stripped_size,json=strippedSize,proto3" json:"stripped_size,omitempty"` Confirmations int64 `protobuf:"varint,15,opt,name=confirmations,proto3" json:"confirmations,omitempty"` // contains filtered or unexported fields }
https://pkg.go.dev/github.com/btcsuite/btcd@v0.21.0-beta/btcjson#GetBlockVerboseTxResult
func (*Block) Descriptor
deprecated
func (*Block) GetConfirmations ¶
func (*Block) GetDifficulty ¶
func (*Block) GetMerkleRoot ¶
func (*Block) GetNextHash ¶
func (*Block) GetPreviousHash ¶
func (*Block) GetStrippedSize ¶
func (*Block) GetTs ¶
func (x *Block) GetTs() *timestamppb.Timestamp
func (*Block) GetVersion ¶
func (*Block) GetVersionHex ¶
func (*Block) ProtoMessage ¶
func (*Block) ProtoMessage()
func (*Block) ProtoReflect ¶
func (x *Block) ProtoReflect() protoreflect.Message
func (*Block) UnmarshalBTCBlock ¶
func (b *Block) UnmarshalBTCBlock(in *btcjson.GetBlockVerboseResult)
Convert from btcd MsgBlock to Blep's Bitcoin Block
type Transaction ¶
type Transaction struct { Ts *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=ts,proto3" json:"ts,omitempty"` Hex string `protobuf:"bytes,2,opt,name=hex,proto3" json:"hex,omitempty"` Txid string `protobuf:"bytes,3,opt,name=txid,proto3" json:"txid,omitempty"` Hash string `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` Size int32 `protobuf:"varint,5,opt,name=size,proto3" json:"size,omitempty"` Vsize int32 `protobuf:"varint,6,opt,name=vsize,proto3" json:"vsize,omitempty"` Weight int32 `protobuf:"varint,7,opt,name=weight,proto3" json:"weight,omitempty"` Version uint32 `protobuf:"varint,8,opt,name=version,proto3" json:"version,omitempty"` LockTime uint32 `protobuf:"varint,9,opt,name=lock_time,json=lockTime,proto3" json:"lock_time,omitempty"` BlockHash string `protobuf:"bytes,10,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` Confirmations uint64 `protobuf:"varint,11,opt,name=confirmations,proto3" json:"confirmations,omitempty"` Blocktime int64 `protobuf:"varint,12,opt,name=blocktime,proto3" json:"blocktime,omitempty"` Vin []*Vin `protobuf:"bytes,13,rep,name=vin,proto3" json:"vin,omitempty"` Vout []*Vout `protobuf:"bytes,14,rep,name=vout,proto3" json:"vout,omitempty"` // contains filtered or unexported fields }
https://pkg.go.dev/github.com/btcsuite/btcd@v0.21.0-beta/btcjson#TxRawResult
func (*Transaction) Descriptor
deprecated
func (*Transaction) Descriptor() ([]byte, []int)
Deprecated: Use Transaction.ProtoReflect.Descriptor instead.
func (*Transaction) GetBlockHash ¶
func (x *Transaction) GetBlockHash() string
func (*Transaction) GetBlocktime ¶
func (x *Transaction) GetBlocktime() int64
func (*Transaction) GetConfirmations ¶
func (x *Transaction) GetConfirmations() uint64
func (*Transaction) GetHash ¶
func (x *Transaction) GetHash() string
func (*Transaction) GetHex ¶
func (x *Transaction) GetHex() string
func (*Transaction) GetLockTime ¶
func (x *Transaction) GetLockTime() uint32
func (*Transaction) GetSize ¶
func (x *Transaction) GetSize() int32
func (*Transaction) GetTs ¶
func (x *Transaction) GetTs() *timestamppb.Timestamp
func (*Transaction) GetTxid ¶
func (x *Transaction) GetTxid() string
func (*Transaction) GetVersion ¶
func (x *Transaction) GetVersion() uint32
func (*Transaction) GetVin ¶
func (x *Transaction) GetVin() []*Vin
func (*Transaction) GetVout ¶
func (x *Transaction) GetVout() []*Vout
func (*Transaction) GetVsize ¶
func (x *Transaction) GetVsize() int32
func (*Transaction) GetWeight ¶
func (x *Transaction) GetWeight() int32
func (*Transaction) ProtoMessage ¶
func (*Transaction) ProtoMessage()
func (*Transaction) ProtoReflect ¶
func (x *Transaction) ProtoReflect() protoreflect.Message
func (*Transaction) Reset ¶
func (x *Transaction) Reset()
func (*Transaction) String ¶
func (x *Transaction) String() string
func (*Transaction) UnmarshalBTCTransaction ¶
func (tx *Transaction) UnmarshalBTCTransaction(in *btcjson.TxRawResult)
type Vin ¶
type Vin struct { Coinbase string `protobuf:"bytes,1,opt,name=coinbase,proto3" json:"coinbase,omitempty"` Txid string `protobuf:"bytes,2,opt,name=txid,proto3" json:"txid,omitempty"` Vout uint32 `protobuf:"varint,3,opt,name=vout,proto3" json:"vout,omitempty"` Asm string `protobuf:"bytes,4,opt,name=asm,proto3" json:"asm,omitempty"` Hex string `protobuf:"bytes,5,opt,name=hex,proto3" json:"hex,omitempty"` Sequence uint32 `protobuf:"varint,6,opt,name=sequence,proto3" json:"sequence,omitempty"` Witness []string `protobuf:"bytes,7,rep,name=witness,proto3" json:"witness,omitempty"` // contains filtered or unexported fields }
https://pkg.go.dev/github.com/btcsuite/btcd@v0.21.0-beta/btcjson#Vin
func (*Vin) Descriptor
deprecated
func (*Vin) GetCoinbase ¶
func (*Vin) GetSequence ¶
func (*Vin) GetWitness ¶
func (*Vin) ProtoMessage ¶
func (*Vin) ProtoMessage()
func (*Vin) ProtoReflect ¶
func (x *Vin) ProtoReflect() protoreflect.Message
type Vout ¶
type Vout struct { Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` N uint32 `protobuf:"varint,2,opt,name=n,proto3" json:"n,omitempty"` Asm string `protobuf:"bytes,3,opt,name=asm,proto3" json:"asm,omitempty"` Hex string `protobuf:"bytes,4,opt,name=hex,proto3" json:"hex,omitempty"` ReqSigs int32 `protobuf:"varint,5,opt,name=req_sigs,json=reqSigs,proto3" json:"req_sigs,omitempty"` Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` Addresses []string `protobuf:"bytes,7,rep,name=addresses,proto3" json:"addresses,omitempty"` // contains filtered or unexported fields }
https://pkg.go.dev/github.com/btcsuite/btcd@v0.21.0-beta/btcjson#Vout
func (*Vout) Descriptor
deprecated
func (*Vout) GetAddresses ¶
func (*Vout) GetReqSigs ¶
func (*Vout) ProtoMessage ¶
func (*Vout) ProtoMessage()
func (*Vout) ProtoReflect ¶
func (x *Vout) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.