wallet

package
v0.0.0-...-a8d3af8 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coin

type Coin *big.Float

Coin is the float value of a token (total value divided by 10 ^ 18)

type CoinValue

type CoinValue struct {
	Coin    string
	Balance *big.Float
}

type CoinValueString

type CoinValueString struct {
	Coin    string
	Balance string
}

func LimitDecimals

func LimitDecimals(cv []CoinValue, decimals int) []CoinValueString

type TokenData

type TokenData struct {
	Address string `json:"address"`
	Symbol  string `json:"symbol"`
	Decimal int    `json:"decimal"`
	Type    string `json:"type"`
}

type Tokens

type Tokens []TokenData

Tokens is a list with most ERC20 tokens and their addresses

func GetTokens

func GetTokens() *Tokens

func (*Tokens) GetSymbols

func (t *Tokens) GetSymbols() []string

type User

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

User is a container of eht client and the address of the wallet

func NewUser

func NewUser(infuraAPIKey string, address string) *User

NewUser constructs a User object to interact with the ethereum network

func (User) GetAllBalances

func (u User) GetAllBalances(t Tokens) []CoinValue

func (User) GetWeiBalance

func (u User) GetWeiBalance() *CoinValue

GetWeiBalance returns balance of Wei (ether) in the account

Jump to

Keyboard shortcuts

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