polkadotTransaction

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: 3

Documentation

Index

Constants

View Source
const (
	KSM_Balannce_Transfer  = "040000"
	DOT_Balannce_Transfer  = "050000"
	Balannce_Transfer_name = "transfer"
	Default_Period         = 50
	SigningBitV4           = byte(0x84)
	Compact_U32            = "Compact<u32>"
	AccounntIDFollow       = false
)

Variables

This section is empty.

Functions

func BytesToCompactBytes added in v1.2.15

func BytesToCompactBytes(bytes []byte) (res []byte)

func CompactLength added in v1.2.15

func CompactLength(data uint32) int

func Encode added in v1.2.15

func Encode(data uint64) string

func ExtendLEBytes added in v1.2.15

func ExtendLEBytes(input []byte, length int) []byte

func GetEra

func GetEra(height uint64) []byte

func SignTransaction

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

func VerifyAndCombineTransaction

func VerifyAndCombineTransaction(transferCode, 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(transferCode string) ([]byte, error)

type TxPayLoad

type TxPayLoad struct {
	Method      []byte
	Era         []byte
	Nonce       []byte
	Fee         []byte
	SpecVersion []byte
	GenesisHash []byte
	BlockHash   []byte
	TxVersion   []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"`
	TxVersion       uint32 `json:"txVersion"`
}

func NewTxStructFromJSON

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

func (TxStruct) CreateEmptyTransactionAndMessage

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

func (TxStruct) GetSignedTransaction

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

func (TxStruct) NewTxPayLoad

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

func (TxStruct) ToJSONString

func (tx TxStruct) ToJSONString() string

Jump to

Keyboard shortcuts

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