wallet

package
v0.0.0-...-10d6790 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultFee uint64 = 100000
)
View Source
const (
	GrothInBEAM uint64 = 100000000
)

Variables

This section is empty.

Functions

func GROTH2Beam

func GROTH2Beam(groth uint64) float64

Types

type API

type API struct {
	Address string
}

func New

func New(address string) *API

func (*API) CreateAddress

func (api *API) CreateAddress(comment string, expiration Expiration) (addr string, err error)

func (*API) DeleteTransaction

func (api *API) DeleteTransaction(txid string) error

func (*API) GetTransactions

func (api *API) GetTransactions() (txs []Transaction, err error)

func (*API) OwnAddrList

func (api *API) OwnAddrList() (list AddrList, err error)

func (*API) SendBEAM

func (api *API) SendBEAM(to string, from string, amount uint64, fee uint64) (txid string, err error)

func (*API) Status

func (api *API) Status() (status Status, err error)

type AddrList

type AddrList []Address

type Address

type Address struct {
	Address  string `json:"address"`
	Comment  string `json:"comment"`
	Expired  bool   `json:"expired"`
	Duration uint64 `json:"duration"`
}

type Expiration

type Expiration string
const (
	ExpNever Expiration = "never"
	Exp24h   Expiration = "24h"
)

type JsonParams

type JsonParams map[string]interface{}

type Status

type Status struct {
	Available uint64 `json:"available"`
	Receiving uint64 `json:"receiving"`
}

type Transaction

type Transaction struct {
	TxId     string   `json:"txId"`
	Status   TxStatus `json:"status"`
	Value    uint64   `json:"value"`
	Receiver string   `json:"receiver"`
	Height   uint64   `json:"height"`
	Income   bool     `json:"income"`
	Fee      uint64   `json:"fee"`
}

type TxStatus

type TxStatus uint32
const (
	TxPending TxStatus = iota
	TxInProgress
	TxCancelled
	TxCompleted
	TxFailed
	TxRegistering
)

Jump to

Keyboard shortcuts

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