bitcoin

package
v1.1.11 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	Chain  string `json:"chain"`
	Blocks int64  `json:"blocks"`
}

type BlockchainStatus

type BlockchainStatus struct {
	Backend Backend `json:"backend"`
}

type Client

type Client struct {
	blockatlas.Request
}

func (*Client) GetAddressesFromXpub

func (c *Client) GetAddressesFromXpub(xpub string) (tokens []Token, err error)

func (*Client) GetBlockNumber

func (c *Client) GetBlockNumber() (status BlockchainStatus, err error)

func (*Client) GetTransactions

func (c *Client) GetTransactions(address string) (transactions TransactionsList, err error)

func (*Client) GetTransactionsByBlock

func (c *Client) GetTransactionsByBlock(number int64, page int64) (block TransactionsList, err error)

func (*Client) GetTransactionsByXpub

func (c *Client) GetTransactionsByXpub(xpub string) (transactions TransactionsList, err error)

type Output

type Output struct {
	TxId         string       `json:"txid,omitempty"`
	Value        string       `json:"value,omitempty"`
	Addresses    []string     `json:"addresses,omitempty"`
	ScriptPubKey ScriptPubKey `json:"scriptPubKey,omitempty"`
}

func (Output) OutputAddress

func (o Output) OutputAddress() []string

type Platform

type Platform struct {
	CoinIndex uint
	// contains filtered or unexported fields
}

func Init added in v1.1.0

func Init(coin uint, api string) *Platform

func (*Platform) Coin

func (p *Platform) Coin() coin.Coin

func (*Platform) CurrentBlockNumber

func (p *Platform) CurrentBlockNumber() (int64, error)

func (*Platform) GetAddressesFromXpub

func (p *Platform) GetAddressesFromXpub(xpub string) ([]string, error)

func (*Platform) GetAllBlockPages

func (p *Platform) GetAllBlockPages(total, num int64) []Transaction

func (*Platform) GetBlockByNumber

func (p *Platform) GetBlockByNumber(num int64) (*blockatlas.Block, error)

func (*Platform) GetTxsByAddress added in v1.1.0

func (p *Platform) GetTxsByAddress(address string) (blockatlas.TxPage, error)

func (*Platform) GetTxsByXpub added in v1.1.0

func (p *Platform) GetTxsByXpub(xpub string) (blockatlas.TxPage, error)

type ScriptPubKey

type ScriptPubKey struct {
	Addresses []string `json:"addresses,omitempty"`
}

type Token

type Token struct {
	Type      string `json:"type"`
	Name      string `json:"name"`
	Path      string `json:"path"`
	Transfers int    `json:"transfers"`
	Balance   string `json:"balance"`
}

type Transaction

type Transaction struct {
	ID            string   `json:"txid"`
	Version       uint64   `json:"version"`
	Vin           []Output `json:"vin"`
	Vout          []Output `json:"vout"`
	BlockHash     string   `json:"blockHash"`
	BlockHeight   int64    `json:"blockHeight"`
	Confirmations uint64   `json:"confirmations"`
	BlockTime     uint64   `json:"blockTime"`
	Value         string   `json:"value"`
	ValueOut      string   `json:"valueOut"`
	Fees          string   `json:"fees"`
}

func (Transaction) Amount

func (transaction Transaction) Amount() string

func (Transaction) GetBlockHeight

func (transaction Transaction) GetBlockHeight() uint64

type TransactionsList

type TransactionsList struct {
	Page         int64         `json:"page"`
	TotalPages   int64         `json:"totalPages"`
	ItemsOnPage  int64         `json:"itemsOnPage"`
	Transactions []Transaction `json:"transactions,omitempty"`
	Txs          interface{}   `json:"txs,omitempty"`
	Tokens       []Token       `json:"tokens,omitempty"`
	TxCount      int64         `json:"txCount,omitempty"`
	Hash         string        `json:"hash,omitempty"`
}

func (*TransactionsList) TransactionList

func (tl *TransactionsList) TransactionList() []Transaction

type Tx

type Tx struct {
	ID string `json:"id"`
}

Jump to

Keyboard shortcuts

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