transfer

package
v1.0.1-stable-dd60dab Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cap int, bc Blockchain, storage Storage) tau.Task

Types

type Blockchain

type Blockchain interface {
	GetAddress(password string, blockchainName tokens.BlockchainName) (string, error)
	Transfer(password string, token tokens.Token, to string, amount *big.Int, speed blockchain.TxExecutionSpeed, sendAll bool) (string, blockchain.Cost, error)
	Lookup(token tokens.Token, txHash string) (UpdateReceipt, error)
}

type Storage

type Storage interface {
	PutTransfer(receipt TransferReceipt) error
	Transfers() ([]TransferReceipt, error)
}

type TokenDetails

type TokenDetails struct {
	To     string              `json:"to"`
	From   string              `json:"from"`
	Token  tokens.Token        `json:"token"`
	Amount string              `json:"value"`
	TxCost blockchain.CostBlob `json:"txCost"`
	TxHash string              `json:"txHash"`
}

type TransferReceipt

type TransferReceipt struct {
	Confirmations int64  `json:"confirmations"`
	Timestamp     int64  `json:"timestamp"`
	PasswordHash  string `json:"passwordHash,omitempty"`
	TokenDetails
}

type TransferReceiptMap

type TransferReceiptMap map[string]TransferReceipt

type TransferRequest

type TransferRequest struct {
	Password string
	Token    tokens.Token
	To       string
	Amount   *big.Int
	Speed    blockchain.TxExecutionSpeed
	SendAll  bool
}

func NewTransferRequest

func NewTransferRequest(password string, token tokens.Token, to string, amount *big.Int, speed blockchain.TxExecutionSpeed, sendAll bool) TransferRequest

func (TransferRequest) IsMessage

func (request TransferRequest) IsMessage()

type UpdateReceipt

type UpdateReceipt struct {
	TxHash string
	Update func(*TransferReceipt)
}

func NewUpdateReceipt

func NewUpdateReceipt(txHash string, update func(*TransferReceipt)) UpdateReceipt

Jump to

Keyboard shortcuts

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