polkadotTransaction

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2020 License: GPL-3.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Balannce_Transfer      = "0400"
	Balannce_Transfer_name = "transfer"
	Default_Period         = 50
	SigningBitV4           = byte(0x84)
	Compact_U32            = "Compact<u32>"
	AccounntIDFollow       = false
)

Variables

This section is empty.

Functions

func GetEra

func GetEra(height uint64) []byte

func SignTransaction

func SignTransaction(msgStr string, prikey []byte) ([]byte, error)

func VerifyAndCombineTransaction

func VerifyAndCombineTransaction(emptyTrans, signature string) (string, bool)

Types

type MethodTransfer

type MethodTransfer struct {
	DestPubkey []byte
	Amount     []byte
}

func NewMethodTransfer

func NewMethodTransfer(pubkey string, amount uint64) (*MethodTransfer, error)

func (MethodTransfer) ToBytes

func (mt MethodTransfer) ToBytes() ([]byte, error)

type TxPayLoad

type TxPayLoad struct {
	Method      []byte
	Era         []byte
	Nonce       []byte
	Fee         []byte
	SpecVersion []byte
	GenesisHash []byte
	BlockHash   []byte
}

func (TxPayLoad) ToBytesString

func (t TxPayLoad) ToBytesString() string

type TxStruct

type TxStruct struct {
	//MethodName string `json:"method_name"`
	//Version int `json:"version"`
	SenderPubkey    string `json:"sender_pubkey"`
	RecipientPubkey string `json:"recipient_pubkey"`
	Amount          uint64 `json:"amount"`
	Nonce           uint64 `json:"nonce"`
	Fee             uint64 `json:"fee"`
	BlockHeight     uint64 `json:"block_height"`
	BlockHash       string `json:"block_hash"`
	GenesisHash     string `json:"genesis_hash"`
	SpecVersion     uint32 `json:"spec_version"`
}

func NewTxStructFromJSON

func NewTxStructFromJSON(j string) (*TxStruct, error)

func (TxStruct) CreateEmptyTransactionAndMessage

func (ts TxStruct) CreateEmptyTransactionAndMessage() (string, string, error)

func (TxStruct) GetSignedTransaction

func (ts TxStruct) GetSignedTransaction(signature string) (string, error)

func (TxStruct) NewTxPayLoad

func (tx TxStruct) NewTxPayLoad() (*TxPayLoad, error)

func (TxStruct) ToJSONString

func (tx TxStruct) ToJSONString() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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