transfer

package
v1.0.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2019 License: GPL-3.0 Imports: 7 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 blockchain.BlockchainName) (string, error)
	Transfer(password string, token blockchain.Token, to string, amount *big.Int) (string, error)
	Lookup(token blockchain.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  blockchain.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    blockchain.Token
	To       string
	Amount   *big.Int
	TxCost   blockchain.Cost
}

func NewTransferRequest

func NewTransferRequest(password string, token blockchain.Token, to string, amount *big.Int, txCost blockchain.Cost) 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