stellar

package
v1.1.15 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: MIT Imports: 9 Imported by: 1

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 added in v1.0.0

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

Normalize converts a Stellar-based transaction into the generic model

Types

type Block added in v1.0.37

type Block struct {
	Ledger   Ledger
	Payments []Payment
}

type Client added in v1.0.0

type Client struct {
	client.Request
}

func (*Client) CurrentBlockNumber added in v1.0.37

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

func (*Client) GetBlockByNumber added in v1.0.37

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

func (*Client) GetTxsOfAddress added in v1.0.0

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

type Ledger added in v1.0.37

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

type LedgersPage added in v1.0.37

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

type Payment added in v1.0.0

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 added in v1.0.0

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

PaymentsPage of payments returned by Horizon

type Platform added in v1.0.0

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 added in v1.0.0

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

func (*Platform) CurrentBlockNumber added in v1.0.37

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

func (*Platform) GetBlockByNumber added in v1.0.37

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

func (*Platform) GetTxsByAddress added in v1.0.37

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

func (*Platform) NormalizeBlock added in v1.0.37

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

func (*Platform) NormalizePayments added in v1.0.37

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

type Transaction added in v1.1.0

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