wallet

package
v1.0.0-beta.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Mainnet = Config{
	Bitcoin: BlockchainConfig{
		Network: Network{
			Name: "mainnet",
		},
	},
	Ethereum: BlockchainConfig{
		Network: Network{
			Name: "mainnet",
			URL:  "https://mainnet.infura.io",
		},
	},
}

Mainnet is the Swapperd's mainnet config object

View Source
var Testnet = Config{
	Bitcoin: BlockchainConfig{
		Network: Network{
			Name: "testnet",
		},
	},
	Ethereum: BlockchainConfig{
		Network: Network{
			Name: "kovan",
			URL:  "https://kovan.infura.io",
		},
	},
}

Testnet is the Swapperd's testnet config object

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"`
}

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, speed blockchain.TxExecutionSpeed, senAll bool) (string, blockchain.Cost, 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) (libeth.Account, error)
	BitcoinAccount(password string) (libbtc.Account, error)
	ECDSASigner(password string) (ECDSASigner, error)
}

func New

func New(config Config, logger logrus.FieldLogger) Wallet

Jump to

Keyboard shortcuts

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