moacchainTransaction

package
v1.2.27 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2022 License: GPL-3.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	SmallTag       byte = 0xC0
	LargeTag       byte = 0xF7
	ChainIDMainnet byte = 99
	ChainIDTestnet byte = 101
)

Variables

This section is empty.

Functions

func CreateEmptyRawTransactionAndHash

func CreateEmptyRawTransactionAndHash(to string, nonce uint64, amount, gasLimit, gasPrice *big.Int, isTestNet bool) (string, string, error)

func SignRawTransaction

func SignRawTransaction(hash string, privateKey []byte) ([]byte, error)

func VerifyAndCombineRawTransaction

func VerifyAndCombineRawTransaction(emptyTrans, signature, publicKey string, isTestNet bool) (bool, string)

Types

type TxStruct

type TxStruct struct {
	Head           []byte
	Nonce          []byte
	SystemContract []byte
	GasPrice       []byte
	GasLimit       []byte
	Recipient      []byte
	Amount         []byte
	Payload        []byte
	ShardingFlag   []byte
	Via            []byte
	ChainID        []byte
	R              []byte
	S              []byte
}

func NewTxStruct

func NewTxStruct(to string, nonce uint64, amount, gasLimit, gasPrice *big.Int, signature []byte, isTestNet bool) (*TxStruct, error)

func (*TxStruct) ToBytes

func (tx *TxStruct) ToBytes() []byte

Jump to

Keyboard shortcuts

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