wallet

package
v0.0.0-...-27a570a Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2017 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base58Encoding

func Base58Encoding(bin []byte) string

func BytesToAddress

func BytesToAddress(data []byte) string

Types

type Transaction

type Transaction struct {
	Sender    []byte `bson:"s"`
	Recipient string `bson:"r"`

	Amount      int       `bson:"a"`
	Gas         int       `bson:"g"`
	SenderNonce int       `bson:"n"`
	Timestamp   int64     `bson:"t"`
	SenderSig   [2][]byte `bson:"rs"`
}

type Wallet

type Wallet struct {
	PrivKey *ecdsa.PrivateKey
	Nonce   int
	Balance int
}

func GenerateWallet

func GenerateWallet() *Wallet

func ImportWallet

func ImportWallet(filePath string) *Wallet

func (*Wallet) ExportWallet

func (w *Wallet) ExportWallet(filePath string)

func (*Wallet) GetWallet

func (w *Wallet) GetWallet() string

func (*Wallet) NewTransaction

func (w *Wallet) NewTransaction(recipient string, amount, gas int) (Transaction, error)

func (*Wallet) Sign

func (w *Wallet) Sign(data []byte) (r, s *big.Int)

type WalletFile

type WalletFile struct {
	// content to be converted in json
	PrivKeyString string
	Address       string
	Nonce         int
	Balance       int
}

Jump to

Keyboard shortcuts

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