coin

package
v4.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address interface {
	Coin() Coin
	EncodeForMachines() []byte
	EncodeForHumans() string
}

Address models a blockchain address to which coins can be sent.

type Coin

type Coin interface {

	// Name returns the written-out name of the coin.
	Name() string

	// Unit is the unit code of the string for formatting amounts.
	Unit() string

	// FormatAmount formats the given amount as a number followed by the currency code in a suitable
	// denomination.
	FormatAmount(int64) string

	// FormatAmountAsJSON formats the given amount as a JSON object with the number as a string and
	// the currency code in a suitable denomination.
	FormatAmountAsJSON(int64) FormattedAmount
}

Coin models the currency of a blockchain.

type ConfirmedTransaction

type ConfirmedTransaction interface {
	PendingTransaction
	ConfirmationTime() time.Time
}

ConfirmedTransaction models a confirmed transaction of the given coin.

type FormattedAmount

type FormattedAmount struct {
	Amount      string            `json:"amount"`
	Unit        string            `json:"unit"`
	Conversions map[string]string `json:"conversions"`
}

FormattedAmount with unit and conversions.

type PendingTransaction

type PendingTransaction interface {
	ProposedTransaction
	BroadcastTime() time.Time
}

PendingTransaction models a broadcasted but not yet confirmed transaction of the given coin.

type ProposedTransaction

type ProposedTransaction interface {
}

ProposedTransaction models a proposed but not yet fully signed transaction of the given coin.

type RatesUpdater

type RatesUpdater interface {
	observable.Interface
	Last() map[string]map[string]float64
}

RatesUpdater updates the exchange rates continuously.

type SignedTransaction

type SignedTransaction interface {
	ProposedTransaction
	Valid() bool
	Broadcast() error // TODO: Not desirable here (because also present in types below)?
}

SignedTransaction models a signed but not yet broadcasted transaction of the given coin.

type WalletAddress

type WalletAddress interface {
	Address
	Configuration() *signing.Configuration
}

WalletAddress models an address in an own wallet at the keypath given by the configuration.

Jump to

Keyboard shortcuts

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