client

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ZeroAddress = common.HexToAddress("0x0000000000000000000000000000000000000000")

Functions

This section is empty.

Types

type BloXrouteClient

type BloXrouteClient struct {
	// contains filtered or unexported fields
}

A typesafe websocket client for bloXroute in Go.

func NewBloXrouteClientToCloud

func NewBloXrouteClientToCloud(network string, certFile string, keyFile string, stopCh <-chan struct{}) (*BloXrouteClient, error)

Create a bloXroute websocket client connected to bloXroute cloud.

`network`, available values: Mainnet, BSC-Mainnet

func NewBloXrouteClientToGateway

func NewBloXrouteClientToGateway(url string, authorizationHeader string, stopCh <-chan struct{}) (*BloXrouteClient, error)

Create a bloXroute websocket client connected to a local gateway.

func (*BloXrouteClient) Ping added in v0.4.8

func (c *BloXrouteClient) Ping() (time.Time, error)

Ping() sends a ping message to websocket server. See https://docs.bloxroute.com/apis/ping

func (*BloXrouteClient) SendTransaction added in v0.4.9

func (client *BloXrouteClient) SendTransaction(transaction []byte, nonceMonitoring bool, blockchainNetwork string) (common.Hash, error)

Send a transaction via BDN.

func (*BloXrouteClient) SubscribeBdnBlocks

func (c *BloXrouteClient) SubscribeBdnBlocks(include []string, outCh chan<- *types.Block) (string, error)

Subscribe to the `bdnBlocks` stream. See https://docs.bloxroute.com/streams/bdnblocks

func (*BloXrouteClient) SubscribeEthOnBlock

func (c *BloXrouteClient) SubscribeEthOnBlock(include []string, callParams []map[string]string, outCh chan<- *types.EthOnBlockResponse) (string, error)

Subscribe to the `ethOnBlock` stream. See https://docs.bloxroute.com/streams/onblock-event-stream

func (*BloXrouteClient) SubscribeNewBlocks

func (c *BloXrouteClient) SubscribeNewBlocks(include []string, outCh chan<- *types.Block) (string, error)

Subscribe to the `newBlocks` stream. See https://docs.bloxroute.com/streams/newblock-stream

func (*BloXrouteClient) SubscribeNewTxs

func (c *BloXrouteClient) SubscribeNewTxs(include []string, filters string, outCh chan<- *types.Transaction) (string, error)

Subscribe to the `newTxs` stream. See https://docs.bloxroute.com/streams/newtxs-and-pendingtxs

func (*BloXrouteClient) SubscribePendingTxs

func (c *BloXrouteClient) SubscribePendingTxs(include []string, filters string, outCh chan<- *types.Transaction) (string, error)

Subscribe to the `pendingTxs` stream. See https://docs.bloxroute.com/streams/newtxs-and-pendingtxs

func (*BloXrouteClient) SubscribeRaw added in v0.3.0

func (c *BloXrouteClient) SubscribeRaw(subRequest string, outCh chan<- string) (string, error)

SubscribeRaw() send a raw subscription request to the server. This is a low-level API and should be used only if you know what you are doing. The first element of params must be the name of the stream.

func (*BloXrouteClient) SubscribeTxReceipts

func (c *BloXrouteClient) SubscribeTxReceipts(include []string, outCh chan<- *types.TxReceipt) (string, error)

Subscribe to the `txReceipts` stream. See https://docs.bloxroute.com/streams/txreceipts

func (*BloXrouteClient) Unsubscribe

func (c *BloXrouteClient) Unsubscribe(subscriptionID string) error

type BloXrouteClientExtended added in v0.4.8

type BloXrouteClientExtended struct {
	// contains filtered or unexported fields
}

All high-level APIs are implemented in this client.

func NewBloXrouteClientExtended added in v0.4.8

func NewBloXrouteClientExtended(client *BloXrouteClient, stopCh <-chan struct{}) *BloXrouteClientExtended

func (*BloXrouteClientExtended) SubscribeBalance added in v0.4.8

func (clientExt *BloXrouteClientExtended) SubscribeBalance(users []common.Address, tokens []common.Address) (<-chan *types.TokenBalance, error)

Monitor tokens' balance of specified users.

Multiple calls of this function will return the same channel.

func (*BloXrouteClientExtended) SubscribePairReserves added in v0.4.8

func (clientExt *BloXrouteClientExtended) SubscribePairReserves(pairs []common.Address, outCh chan<- *types.PairReserves) error

func (*BloXrouteClientExtended) SubscribePairReservesDeprecated added in v0.5.4

func (clientExt *BloXrouteClientExtended) SubscribePairReservesDeprecated(pairs []common.Address, outCh chan<- *types.PairReserves) error

Monitor the reserves of of given trading pairs on PancakeSwap/Uniswap.

Please put as many addresses as possible to the pairs parameter and call this function in batch.

func (*BloXrouteClientExtended) SubscribePairReservesForBenchmark added in v0.6.1

func (clientExt *BloXrouteClientExtended) SubscribePairReservesForBenchmark(pairs []common.Address, outCh chan<- *types.PairReserves) error

type CloudApiClient added in v0.4.7

type CloudApiClient struct {
	// contains filtered or unexported fields
}

All cloud APIs available on wss://api.blxrbdn.com/ws are implemented here.

func NewCloudApiClient added in v0.4.7

func NewCloudApiClient(authorizationHeader string, stopCh <-chan struct{}, url string) (*CloudApiClient, error)

Constructor.

You can pass an optional url to connect to a specific IP address, it defaults to wss://api.blxrbdn.com/ws if empty.

Availabel IP addresses are here https://docs.bloxroute.com/introduction/cloud-api-ips

func (*CloudApiClient) Ping added in v0.4.7

func (c *CloudApiClient) Ping() (time.Time, error)

Ping() sends a ping message to websocket server. See https://docs.bloxroute.com/apis/ping

func (*CloudApiClient) SendTransaction added in v0.4.7

func (client *CloudApiClient) SendTransaction(transaction []byte, nonceMonitoring bool, blockchainNetwork string) (common.Hash, error)

Send a transaction via BDN.

type TransactionStatusClient added in v0.4.0

type TransactionStatusClient struct {
	// contains filtered or unexported fields
}

A client to subscribe to the `transactionStatus` stream. See https://docs.bloxroute.com/streams/txstatus

func NewTransactionStatusClient added in v0.4.0

func NewTransactionStatusClient(authorizationHeader string, stopCh <-chan struct{}, outCh chan<- *types.TxStatus, url string) (*TransactionStatusClient, error)

Constructor.

You can pass an optional url to connect to a specific IP address, it defaults to wss://api.blxrbdn.com/ws if empty.

Availabel IP addresses are here https://docs.bloxroute.com/introduction/cloud-api-ips

func (*TransactionStatusClient) Ping added in v0.4.8

func (c *TransactionStatusClient) Ping() (time.Time, error)

Ping() sends a ping message to websocket server. See https://docs.bloxroute.com/apis/ping

func (*TransactionStatusClient) StartMonitorTransaction added in v0.4.0

func (client *TransactionStatusClient) StartMonitorTransaction(transactions [][]byte, monitorSpeedup bool) error

Monitor given transactions. transactions is a list of raw transactions.

func (*TransactionStatusClient) StopMonitorTransaction added in v0.4.0

func (client *TransactionStatusClient) StopMonitorTransaction(txHash common.Hash) error

Stop monitoring a transaction.

Jump to

Keyboard shortcuts

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