tx

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2023 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const (
	CodeOk int32 = 0
)
View Source
const Source int64 = 0

Variables

View Source
var Cdc = amino.NewCodec()

cdc global variable

Functions

func RegisterAmino added in v0.0.4

func RegisterAmino(cdc *amino.Codec)

RegisterAmino registers all crypto related types in the given (amino) codec.

func RegisterCodec

func RegisterCodec(cdc *amino.Codec)

func StdSignBytes

func StdSignBytes(chainID string, accnum int64, sequence int64, msgs []msg.Msg, memo string, source int64, data []byte) []byte

StdSignBytes returns the bytes to sign for a transaction.

Types

type Option

type Option func(*StdSignMsg) *StdSignMsg

func WithAcNumAndSequence

func WithAcNumAndSequence(accountNum, seq int64) Option

func WithChainID

func WithChainID(id string) Option

func WithMemo

func WithMemo(memo string) Option

func WithSource

func WithSource(source int64) Option

type StdSignDoc

type StdSignDoc struct {
	ChainID       string            `json:"chain_id"`
	AccountNumber int64             `json:"account_number"`
	Sequence      int64             `json:"sequence"`
	Memo          string            `json:"memo"`
	Source        int64             `json:"source"`
	Msgs          []json.RawMessage `json:"msgs"`
	Data          []byte            `json:"data"`
}

StdSignDoc def

type StdSignMsg

type StdSignMsg struct {
	ChainID       string    `json:"chain_id"`
	AccountNumber int64     `json:"account_number"`
	Sequence      int64     `json:"sequence"`
	Msgs          []msg.Msg `json:"msgs"`
	Memo          string    `json:"memo"`
	Source        int64     `json:"source"`
	Data          []byte    `json:"data"`
}

StdSignMsg def

func (StdSignMsg) Bytes

func (msg StdSignMsg) Bytes() []byte

Bytes gets message bytes

type StdSignature

type StdSignature struct {
	crypto.PubKey `json:"pub_key"` // optional
	Signature     []byte           `json:"signature"`
	AccountNumber int64            `json:"account_number"`
	Sequence      int64            `json:"sequence"`
}

StdSignature Signature

type StdTx

type StdTx struct {
	Msgs       []msg.Msg      `json:"msg"`
	Signatures []StdSignature `json:"signatures"`
	Memo       string         `json:"memo"`
	Source     int64          `json:"source"`
	Data       []byte         `json:"data"`
}

StdTx def

func NewStdTx

func NewStdTx(msgs []msg.Msg, sigs []StdSignature, memo string, source int64, data []byte) StdTx

NewStdTx to instantiate an instance

func (StdTx) GetMsgs

func (tx StdTx) GetMsgs() []msg.Msg

GetMsgs def

type Tx

type Tx interface {

	// Gets the Msg.
	GetMsgs() []msg.Msg
}

type TxCommitResult

type TxCommitResult struct {
	Ok   bool   `json:"ok"`
	Log  string `json:"log"`
	Hash string `json:"hash"`
	Code int32  `json:"code"`
	Data string `json:"data"`
}

TxCommitResult for POST tx results

type TxResult

type TxResult struct {
	Hash string `json:"hash"`
	Log  string `json:"log"`
	Data string `json:"data"`
	Code int32  `json:"code"`
}

TxResult def

Jump to

Keyboard shortcuts

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