wallet

package
v1.0.0-beta Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2019 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Balance

type Balance struct {
	Address string
	Amount  *big.Int
}

type BlockchainConfig

type BlockchainConfig struct {
	Network Network  `json:"network"`
	Tokens  []string `json:"tokens"`
}

type Config

type Config struct {
	Mnemonic string           `json:"mnemonic"`
	Ethereum BlockchainConfig `json:"ethereum"`
	Bitcoin  BlockchainConfig `json:"bitcoin"`
}

type ECDSASigner

type ECDSASigner interface {
	PublicKey() ecdsa.PublicKey
	Sign(hash []byte) ([]byte, error)
}

type Network

type Network struct {
	Name string `json:"name"`
	URL  string `json:"url"`
}

type Wallet

type Wallet interface {
	ID(password, idType string) (string, error)
	SupportedTokens() []blockchain.Token
	Balances(password string) (map[blockchain.TokenName]blockchain.Balance, error)
	Balance(password string, token blockchain.Token) (blockchain.Balance, error)
	Lookup(token blockchain.Token, txHash string) (transfer.UpdateReceipt, error)
	Transfer(password string, token blockchain.Token, to string, amount *big.Int) (string, error)
	GetAddress(password string, blockchainName blockchain.BlockchainName) (string, error)
	Addresses(password string) (map[blockchain.TokenName]string, error)
	VerifyAddress(blockchain blockchain.BlockchainName, address string) error
	VerifyBalance(password string, token blockchain.Token, balance *big.Int) error

	EthereumAccount(password string) (beth.Account, error)
	BitcoinAccount(password string) (libbtc.Account, error)
	ECDSASigner(password string) (ECDSASigner, error)
}

func New

func New(config Config) Wallet

Jump to

Keyboard shortcuts

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