ubiquityws

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockIdentifier

type BlockIdentifier struct {
	*ubiquity.BlockIdentifier
	Revert bool
}

type Client

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

Client implements Ubiquity Websocket API - https://app.blockdaemon.com/docs/ubiquity#ubiquity-web-sockets-api

func NewClient

func NewClient(conf *Config) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

Close closes WS client and releases the resources

func (*Client) SubscribeBlockIDs

func (c *Client) SubscribeBlockIDs() (string, <-chan *BlockIdentifier, error)

SubscribeBlockIDs subscribes a channel "ubiquity.block_identifiers". It returns a notification channel with subID or error.

func (*Client) SubscribeTxs

func (c *Client) SubscribeTxs(filter *TxsFilter) (string, <-chan *Tx, error)

SubscribeTxs subscribes a channel "ubiquity.txs" with optionally provided filtering over assets and addresses. It returns a notification channel with subID or error.

func (*Client) UnsubscribeBlockIDs

func (c *Client) UnsubscribeBlockIDs(subID string) error

UnsubscribeBlockIDs unsubscribes a channel "ubiquity.block_identifiers".

func (*Client) UnsubscribeTxs

func (c *Client) UnsubscribeTxs(subID string) error

UnsubscribeTxs unsubscribes a channel "ubiquity.txs"

type Config

type Config struct {
	// You should specify Platform (one of ubiquitypl.*) or WebsocketURL along with APIKey
	Platform           string
	Network            string // mainnet by default
	WebsocketURL       string // You can use one of the constants ubiquityws.Endpoint*
	APIKey             string
	PublishTimeoutSec  int64
	ResponseTimeoutSec int64
	ShowDebug          bool
}

type Tx

type Tx struct {
	*ubiquity.Tx
	Revert bool
}

type TxsFilter

type TxsFilter struct {
	Assets    []string
	Addresses []string
}

Jump to

Keyboard shortcuts

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