keytoken_txsigner

package
v1.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	KTOPrefix = "Kto"
)
View Source
const Lenthaddr = 47

Variables

This section is empty.

Functions

func AddrTopub

func AddrTopub(addr string) []byte

func AddressToPublicKey

func AddressToPublicKey(address string) []byte

func Decode

func Decode(data []byte, v interface{}) error

func Encode

func Encode(v interface{}) ([]byte, error)

Types

type Address

type Address [Lenthaddr]byte

func BytesToAddress

func BytesToAddress(from []byte) Address

func (*Address) AddrToPub

func (a *Address) AddrToPub() []byte

func (*Address) AddressToByte

func (a *Address) AddressToByte() []byte

type Transaction

type Transaction struct {
	Nonce     uint64  `json:"nonce"`
	Amount    uint64  `json:"amount"`
	From      Address `json:"from"`
	To        Address `json:"to"`
	Hash      []byte  `json:"hash"`
	Signature []byte  `json:"signature"`
	Time      int64   `json:"time"`
}

func NewTransaction

func NewTransaction(nonce, amount uint64, from, to string) *Transaction

func (*Transaction) HashTransaction

func (tx *Transaction) HashTransaction()

func (*Transaction) Sgin

func (tx *Transaction) Sgin(privateKey []byte)

func (*Transaction) TrimmedCopy

func (tx *Transaction) TrimmedCopy() *Transaction

func (*Transaction) Verify

func (tx *Transaction) Verify() bool

Jump to

Keyboard shortcuts

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