client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	API_URL = "https://mempool.space/api/v1/"
)

Variables

This section is empty.

Functions

func Get added in v0.0.4

func Get(ctx context.Context, path string, v interface{}) error

Types

type Block

type Block struct {
	ID        string    `json:"id"`
	Height    int       `json:"height"`
	TxCount   int       `json:"tx_count"`
	Size      int       `json:"size"`
	Time      int       `json:"timestamp"`
	Weight    int       `json:"weight"`
	FeeRange  []float64 `json:"fee_range"`
	MedianFee float64   `json:"medianFee"`
}

type Client

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

func New

func New() (*Client, error)

func (*Client) Read

func (c *Client) Read() (*Response, error)

func (*Client) Track added in v0.0.5

func (c *Client) Track(txId string) error

func (*Client) Want added in v0.0.5

func (c *Client) Want() error

type Fees added in v0.0.4

type Fees []struct {
	FPV float64 `json:"fpv"`
}

func GetBlockFee added in v0.0.4

func GetBlockFee(ctx context.Context, n int) (Fees, error)

func GetMempoolFee added in v0.1.0

func GetMempoolFee(ctx context.Context, n int) (Fees, error)

func (Fees) Len added in v0.0.4

func (f Fees) Len() int

func (Fees) Less added in v0.0.4

func (f Fees) Less(i, j int) bool

func (Fees) Swap added in v0.0.4

func (f Fees) Swap(i, j int)

type MempoolBlock added in v0.1.0

type MempoolBlock struct {
	BlockSize    int       `json:"blockSize"`
	BlockWeight  float64   `json:"blockVSize"`
	NTx          int       `json:"nTx"`
	MinWeigthFee float64   `json:"minWeigthFee"`
	MaxWeigthFee float64   `json:"maxWeigthFee"`
	MedianFee    float64   `json:"medianFee"`
	FeeRange     []float64 `json:"feeRange"`
	HasMyTx      bool      `json:"hasMytx"`
}

type MempoolInfo

type MempoolInfo struct {
	Size  int `json:"size"`
	Bytes int `json:"bytes"`
}

type Response

type Response struct {
	MempoolInfo *MempoolInfo `json:"mempoolInfo"`

	Block  *Block  `json:"block"`
	Blocks []Block `json:"blocks"`

	MempoolBlocks []MempoolBlock `json:"mempool-blocks"`
	TrackTx       TrackTx        `json:"track-tx"`

	TxPerSecond     float64 `json:"txPerSecond"`
	VBytesPerSecond int     `json:"vBytesPerSecond"`
	Conversions     struct {
		BTC float64 `json:"BTC"`
		USD float64 `json:"USD"`
	} `json:"conversions"`
}

type TrackTx added in v0.0.5

type TrackTx struct {
	Tracking    bool   `json:"tracking"`
	BlockHeight int    `json:"blockHeight"`
	Message     string `json:"message"`
	TX          struct {
		Status struct {
			Confirmed bool
		}
	} `json:"tx"`
}

Jump to

Keyboard shortcuts

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