tx

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeUnknown = Type(0x00)
	// Account transactions
	TypeSend = Type(0x01)
	TypeCall = Type(0x02)

	// Validation transactions
	TypeBond      = Type(0x11)
	TypeUnbond    = Type(0x12)
	TypeSortition = Type(0x13)

	// Admin transactions
	TypePermissions = Type(0x21)
)

Types of Payload implementations

Variables

This section is empty.

Functions

func String

func String(tx Tx) string

Types

type BondTx

type BondTx struct {
	// contains filtered or unexported fields
}

func NewBondTx

func NewBondTx(from crypto.Address, to crypto.PublicKey, amount, sequence, fee uint64) (*BondTx, error)

func (*BondTx) Amount

func (tx *BondTx) Amount() uint64

func (*BondTx) EnsureValid

func (tx *BondTx) EnsureValid() error

func (*BondTx) Fee

func (tx *BondTx) Fee() uint64

func (*BondTx) From

func (tx *BondTx) From() TxInput

func (BondTx) MarshalAmino

func (tx BondTx) MarshalAmino() ([]byte, error)

func (BondTx) MarshalJSON

func (tx BondTx) MarshalJSON() ([]byte, error)

func (*BondTx) PublicKey

func (tx *BondTx) PublicKey() crypto.PublicKey

func (*BondTx) Signers

func (tx *BondTx) Signers() []TxInput

func (*BondTx) To

func (tx *BondTx) To() TxOutput

func (*BondTx) Type

func (tx *BondTx) Type() Type

func (*BondTx) UnmarshalAmino

func (tx *BondTx) UnmarshalAmino(bs []byte) error

func (*BondTx) UnmarshalJSON

func (tx *BondTx) UnmarshalJSON(bs []byte) error

type CallTx

type CallTx struct {
	// contains filtered or unexported fields
}

func NewCallTx

func NewCallTx(caller, callee crypto.Address, sequence uint64, data []byte, gasLimit, amount, fee uint64) (*CallTx, error)

func (*CallTx) Amount

func (tx *CallTx) Amount() uint64

func (*CallTx) Callee

func (tx *CallTx) Callee() TxOutput

func (*CallTx) Caller

func (tx *CallTx) Caller() TxInput

func (*CallTx) CreateContract

func (tx *CallTx) CreateContract() bool

func (*CallTx) Data

func (tx *CallTx) Data() []byte

func (*CallTx) EnsureValid

func (tx *CallTx) EnsureValid() error

func (*CallTx) Fee

func (tx *CallTx) Fee() uint64

func (*CallTx) GasLimit

func (tx *CallTx) GasLimit() uint64

func (CallTx) MarshalAmino

func (tx CallTx) MarshalAmino() ([]byte, error)

func (CallTx) MarshalJSON

func (tx CallTx) MarshalJSON() ([]byte, error)

func (*CallTx) Signers

func (tx *CallTx) Signers() []TxInput

func (*CallTx) Type

func (tx *CallTx) Type() Type

func (*CallTx) UnmarshalAmino

func (tx *CallTx) UnmarshalAmino(bs []byte) error

func (*CallTx) UnmarshalJSON

func (tx *CallTx) UnmarshalJSON(bs []byte) error

type PermissionsTx

type PermissionsTx struct {
	// contains filtered or unexported fields
}

func NewPermissionsTx

func NewPermissionsTx(modifier, modified crypto.Address, perm account.Permissions, set bool, seq, fee uint64) (*PermissionsTx, error)

func (*PermissionsTx) Amount

func (tx *PermissionsTx) Amount() uint64

func (*PermissionsTx) EnsureValid

func (tx *PermissionsTx) EnsureValid() error

func (*PermissionsTx) Fee

func (tx *PermissionsTx) Fee() uint64

func (PermissionsTx) MarshalAmino

func (tx PermissionsTx) MarshalAmino() ([]byte, error)

func (PermissionsTx) MarshalJSON

func (tx PermissionsTx) MarshalJSON() ([]byte, error)

func (*PermissionsTx) Modified

func (tx *PermissionsTx) Modified() TxOutput

func (*PermissionsTx) Modifier

func (tx *PermissionsTx) Modifier() TxInput

func (*PermissionsTx) Permissions

func (tx *PermissionsTx) Permissions() account.Permissions

func (*PermissionsTx) Set

func (tx *PermissionsTx) Set() bool

func (*PermissionsTx) Signers

func (tx *PermissionsTx) Signers() []TxInput

func (*PermissionsTx) Type

func (tx *PermissionsTx) Type() Type

func (*PermissionsTx) UnmarshalAmino

func (tx *PermissionsTx) UnmarshalAmino(bs []byte) error

func (*PermissionsTx) UnmarshalJSON

func (tx *PermissionsTx) UnmarshalJSON(bs []byte) error

type SendTx

type SendTx struct {
	// contains filtered or unexported fields
}

func EmptySendTx

func EmptySendTx() (*SendTx, error)

func NewSendTx

func NewSendTx(from, to crypto.Address, seq, amt, fee uint64) (*SendTx, error)

func (*SendTx) AddReceiver

func (tx *SendTx) AddReceiver(addr crypto.Address, amt uint64)

func (*SendTx) AddSender

func (tx *SendTx) AddSender(addr crypto.Address, seq, amt uint64)

func (*SendTx) Amount

func (tx *SendTx) Amount() uint64

func (*SendTx) EnsureValid

func (tx *SendTx) EnsureValid() error

func (*SendTx) Fee

func (tx *SendTx) Fee() uint64

func (SendTx) MarshalAmino

func (tx SendTx) MarshalAmino() ([]byte, error)

func (SendTx) MarshalJSON

func (tx SendTx) MarshalJSON() ([]byte, error)

func (*SendTx) Receivers

func (tx *SendTx) Receivers() []TxOutput

func (*SendTx) Senders

func (tx *SendTx) Senders() []TxInput

func (*SendTx) Signers

func (tx *SendTx) Signers() []TxInput

func (*SendTx) Type

func (tx *SendTx) Type() Type

func (*SendTx) UnmarshalAmino

func (tx *SendTx) UnmarshalAmino(bs []byte) error

func (*SendTx) UnmarshalJSON

func (tx *SendTx) UnmarshalJSON(bs []byte) error

type SortitionTx

type SortitionTx struct {
	// contains filtered or unexported fields
}

func NewSortitionTx

func NewSortitionTx(validator crypto.Address, height, seq, fee, index uint64, proof []byte) (*SortitionTx, error)

func (*SortitionTx) Amount

func (tx *SortitionTx) Amount() uint64

func (*SortitionTx) EnsureValid

func (tx *SortitionTx) EnsureValid() error

func (*SortitionTx) Fee

func (tx *SortitionTx) Fee() uint64

func (*SortitionTx) Height

func (tx *SortitionTx) Height() uint64

func (*SortitionTx) Index

func (tx *SortitionTx) Index() uint64

func (SortitionTx) MarshalAmino

func (tx SortitionTx) MarshalAmino() ([]byte, error)

func (SortitionTx) MarshalJSON

func (tx SortitionTx) MarshalJSON() ([]byte, error)

func (*SortitionTx) Proof

func (tx *SortitionTx) Proof() []byte

func (*SortitionTx) Signers

func (tx *SortitionTx) Signers() []TxInput

func (*SortitionTx) Type

func (tx *SortitionTx) Type() Type

func (*SortitionTx) UnmarshalAmino

func (tx *SortitionTx) UnmarshalAmino(bs []byte) error

func (*SortitionTx) UnmarshalJSON

func (tx *SortitionTx) UnmarshalJSON(bs []byte) error

func (*SortitionTx) Validator

func (tx *SortitionTx) Validator() TxInput

type Tx

type Tx interface {
	Signers() []TxInput
	Type() Type
	Amount() uint64
	Fee() uint64
	EnsureValid() error
}

func New

func New(txType Type) Tx

type TxInput

type TxInput struct {
	Address  crypto.Address `json:"address"`
	Amount   uint64         `json:"amount"`
	Sequence uint64         `json:"sequence"`
}

type TxOutput

type TxOutput struct {
	Address crypto.Address `json:"address"`
	Amount  uint64         `json:"amount"`
}

type Type

type Type int8

func TxTypeFromString

func TxTypeFromString(name string) Type

func (Type) MarshalText

func (typ Type) MarshalText() ([]byte, error)

func (Type) String

func (typ Type) String() string

func (*Type) UnmarshalText

func (typ *Type) UnmarshalText(data []byte) error

type UnbondTx

type UnbondTx struct {
	// contains filtered or unexported fields
}

func NewUnbondTx

func NewUnbondTx(from, to crypto.Address, amount, sequence, fee uint64) (*UnbondTx, error)

func (*UnbondTx) Amount

func (tx *UnbondTx) Amount() uint64

func (*UnbondTx) EnsureValid

func (tx *UnbondTx) EnsureValid() error

func (*UnbondTx) Fee

func (tx *UnbondTx) Fee() uint64

func (*UnbondTx) From

func (tx *UnbondTx) From() TxInput

func (UnbondTx) MarshalAmino

func (tx UnbondTx) MarshalAmino() ([]byte, error)

func (UnbondTx) MarshalJSON

func (tx UnbondTx) MarshalJSON() ([]byte, error)

func (*UnbondTx) Signers

func (tx *UnbondTx) Signers() []TxInput

func (*UnbondTx) To

func (tx *UnbondTx) To() TxOutput

func (*UnbondTx) Type

func (tx *UnbondTx) Type() Type

func (*UnbondTx) UnmarshalAmino

func (tx *UnbondTx) UnmarshalAmino(bs []byte) error

func (*UnbondTx) UnmarshalJSON

func (tx *UnbondTx) UnmarshalJSON(bs []byte) error

Jump to

Keyboard shortcuts

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