stream

package module
v0.0.0-...-db7d37a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CloudWS           = "wss://api.blxrbdn.com/ws"
	EnterpriseCloudWS = "wss://eth.feed.blxrbdn.com:28333"
	DefaultQueueSize  = 100
)
View Source
const (
	BackoffMin    = 0 * time.Second
	BackoffMax    = 5 * time.Second
	BackoffFactor = 2
	BackoffJitter = true
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectFunc

type ConnectFunc func()

type ErrorFunc

type ErrorFunc func(error)

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 Params

type Params struct {
	Subscription string  `json:"subscription"`
	Result       *Result `json:"result"`
}

type ReconnectFunc

type ReconnectFunc func()

type Result

type Result struct {
	TX *Transaction `json:"txContents"`
}

type Stream

type Stream struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewStream

func NewStream(opts ...StreamOption) (*Stream, error)

func (*Stream) Start

func (s *Stream) Start() (chan *Transaction, error)

func (*Stream) With

func (s *Stream) With(opts ...StreamOption) (*Stream, error)

type StreamOption

type StreamOption func(*Stream) error

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL