Documentation ¶
Index ¶
- Constants
- type ConnectFunc
- type ErrorFunc
- type Message
- type Params
- type ReconnectFunc
- type Result
- type Stream
- type StreamOption
- func Account(accountID, secretHash string) StreamOption
- func Backoff(b *backoff.Backoff) StreamOption
- func Cert(cert tls.Certificate) StreamOption
- func CertDir(dir string) StreamOption
- func Chan(ch chan *Transaction) StreamOption
- func Insecure() StreamOption
- func OnConnect(f ConnectFunc) StreamOption
- func OnError(f ErrorFunc) StreamOption
- func OnReconnect(f ReconnectFunc) StreamOption
- func URL(url string) StreamOption
- type Transaction
Constants ¶
const ( CloudWS = "wss://api.blxrbdn.com/ws" EnterpriseCloudWS = "wss://eth.feed.blxrbdn.com:28333" DefaultQueueSize = 100 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectFunc ¶
type ConnectFunc func()
type Message ¶
type Message struct { Version string `json:"jsonrpc"` Method string `json:"method"` Params *Params `json:"params"` }
{"jsonrpc": "2.0", "id": null, "method": "subscribe", "params": {"subscription": "c294f047-ec21-43f2-b9da-13e867365f42", "result": {"txContents": {"from": "0x50d6bdfc451314fb162d7d3322bfb4a005cf192f", "gas": "0x7a120", "gasPrice": "0x17bfac7c00", "hash": "0xeef70455ea7118ff6d99883b855d85c045b7f471eab454ea45728b8c4d8b227c", "input": "0x202ee0ed000000000000000000000000000000000000000000000000000000000000211d0000000000000000000000000000000000000000000000000000000002662c5d", "nonce": "0xd0e2", "value": "0x0", "v": "0x25", "r": "0x33b2a65126d2731d700472ee9794b363f14e38bfb1e518229fd7182cbb46371d", "s": "0x262851284702d8756e5036879a1a4808e1bf3954929d1bca1b93c65254f734d6", "to": "0xd286af227b7b0695387e279b9956540818b1dc2a"}}}}
type ReconnectFunc ¶
type ReconnectFunc func()
type Result ¶
type Result struct {
TX *Transaction `json:"txContents"`
}
type Stream ¶
func NewStream ¶
func NewStream(opts ...StreamOption) (*Stream, error)
func (*Stream) Start ¶
func (s *Stream) Start() (chan *Transaction, error)
type StreamOption ¶
func Account ¶
func Account(accountID, secretHash string) StreamOption
func Backoff ¶
func Backoff(b *backoff.Backoff) StreamOption
func Cert ¶
func Cert(cert tls.Certificate) StreamOption
func CertDir ¶
func CertDir(dir string) StreamOption
func Chan ¶
func Chan(ch chan *Transaction) StreamOption
func Insecure ¶
func Insecure() StreamOption
func OnConnect ¶
func OnConnect(f ConnectFunc) StreamOption
func OnError ¶
func OnError(f ErrorFunc) StreamOption
func OnReconnect ¶
func OnReconnect(f ReconnectFunc) StreamOption
func URL ¶
func URL(url string) StreamOption
type Transaction ¶
type Transaction struct { Hash string `json:"hash"` From string `json:"from"` To string `json:"to"` Gas string `json:"gas"` GasPrice string `json:"gasPrice"` Input string `json:"input"` Value string `json:"value"` Nonce string `json:"nonce"` }
func (*Transaction) Validate ¶
func (tx *Transaction) Validate() error