cosmos

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2019 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const Handle = "cosmos"

Variables

This section is empty.

Functions

func Normalize

func Normalize(srcTx *Tx) (tx blockatlas.Tx)

Normalize converts an Cosmos transaction into the generic model

Types

type Amount

type Amount struct {
	Denom    string `json:"denom"`
	Quantity string `json:"amount"`
}

Amount - the asset & quantity. Always seems to be enclosed in an array/list for some reason. Perhaps used for multiple tokens transferred in a single sender/reciever transfer?

type Client

type Client struct {
	HTTPClient *http.Client
	BaseURL    string
}

Client - the HTTP client

func (*Client) GetAddrTxes

func (c *Client) GetAddrTxes(address string, inOrOut string) (txs []Tx, err error)

GetAddrTxes - get all ATOM transactions for a given address

type Contents

type Contents struct {
	Message []Message `json:"msg"`
	Fee     Fee       `json:"fee"`
	Memo    string    `json:"memo"`
}

Contents - amount, fee, and memo

type Data

type Data struct {
	Contents Contents `json:"value"`
}

Data - "tx" sub object

type Fee

type Fee struct {
	FeeAmount []Amount `json:"amount"`
}

Fee - also references the "amount" struct

type Message

type Message struct {
	Particulars Particulars `json:"value"`
}

Message - an array that holds multiple 'particulars' entries. Possibly used for multiple transfers in one transaction?

type Particulars

type Particulars struct {
	FromAddr string   `json:"from_address"`
	ToAddr   string   `json:"to_address"`
	Amount   []Amount `json:"amount"`
}

Particulars - from, to, and amount

type Platform

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

func (*Platform) Coin

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

func (*Platform) GetTxsByAddress

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

func (*Platform) Handle

func (p *Platform) Handle() string

func (*Platform) Init

func (p *Platform) Init() error

type Tx

type Tx struct {
	Block string `json:"height"`
	Date  string `json:"timestamp"`
	ID    string `json:"txhash"`
	Data  Data   `json:"tx"`
}

Tx - Base transaction object. Always returned as part of an array

Jump to

Keyboard shortcuts

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