Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ETHER = &Currency{Decimals: 18, Symbol: "ETH", Name: "Ether"}
ETHER represents ether.
Functions ¶
func FetchPairData ¶
FetchPairData fetches information about a pair and constructs a pair from the given two tokens.
Types ¶
type Currency ¶
Currency is any fungible financial instrument on Ethereum, including Ether and all ERC20 tokens.
func NewCurrency ¶
NewCurrency return a new currency. TODO: Is using uint8 type to represent decimals correct?
type Fetcher ¶
type Fetcher struct {
// contains filtered or unexported fields
}
Fetcher represents a fetcher.
func NewFetcher ¶
NewFetcher creates a new fetcher.
type Token ¶
Token represents an ERC20 token with a unique address and some metadata. TODO: To enforce read only, should Token be an interface instead?
func (*Token) Equals ¶
Equals return true if the two tokens are equivalent, i.e. have the same chainId and address.
func (*Token) SortsBefore ¶
SortsBefore return true if the address of t token sorts before the address of token.