stellar

package
v1.1.16-0...-5f6d184 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PaymentType   = "payment"
	CreateAccount = "create_account"
)

Payment types https://www.stellar.org/developers/horizon/reference/endpoints/payments-for-account.html

View Source
const FixedFee = "100" // Fixed at 100 stroops https://stellar.org/developers/guides/concepts/fees.html
View Source
const (
	Native = "native"
)

Assets types

Variables

This section is empty.

Functions

func Normalize

func Normalize(payment *Payment, nativeCoinIndex uint) (tx types.Tx, ok bool)

Normalize converts a Stellar-based transaction into the generic model

Types

type Block

type Block struct {
	Ledger   Ledger
	Payments []Payment
}

type Client

type Client struct {
	client.Request
}

func (*Client) CurrentBlockNumber

func (c *Client) CurrentBlockNumber() (int64, error)

func (*Client) GetBlockByNumber

func (c *Client) GetBlockByNumber(num int64) (*Block, error)

func (*Client) GetTxsOfAddress

func (c *Client) GetTxsOfAddress(address string) ([]Payment, error)

type Ledger

type Ledger struct {
	Sequence int64  `json:"sequence"`
	Id       string `json:"id"`
}

type LedgersPage

type LedgersPage struct {
	Embedded struct {
		Records []Ledger
	} `json:"_embedded"`
}

type Payment

type Payment struct {
	ID              string      `json:"id"`
	Type            string      `json:"type"`
	SourceAccount   string      `json:"source_account"`
	CreatedAt       string      `json:"created_at"`
	Account         string      `json:"account"`
	Funder          string      `json:"funder"`
	StartingBalance string      `json:"starting_balance"`
	Into            string      `json:"into"`
	From            string      `json:"from"`
	To              string      `json:"to"`
	AssetType       string      `json:"asset_type"`
	Amount          string      `json:"amount"`
	TransactionHash string      `json:"transaction_hash"`
	Transaction     Transaction `json:"transaction"`
}

Payment model returned by Horizon

type PaymentsPage

type PaymentsPage struct {
	Embedded struct {
		Records []Payment
	} `json:"_embedded"`
}

PaymentsPage of payments returned by Horizon

type Platform

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

func Init

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) GetBlockByNumber

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

func (*Platform) GetTxsByAddress

func (p *Platform) GetTxsByAddress(address string) (types.Txs, error)

func (*Platform) NormalizeBlock

func (p *Platform) NormalizeBlock(block *Block) types.Block

func (*Platform) NormalizePayments

func (p *Platform) NormalizePayments(payments []Payment) types.Txs

type Transaction

type Transaction struct {
	Memo   string `json:"memo"`
	Ledger uint64 `json:"ledger"`
}

Jump to

Keyboard shortcuts

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