tx

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChainId added in v0.2.0

func ChainId(t types.Tx) uint8

func MarshalJSON added in v0.0.3

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

func NewTx

func NewTx(val TypedTx) (types.Tx, error)

Get a raw Tx from val.

func TxData added in v0.2.0

func TxData(t types.Tx) []byte

func Version added in v0.2.0

func Version(t types.Tx) uint8

Types

type Register

type Register struct {
	DOID      string        `json:"DOID"`
	Owner     types.Address `json:"owner"`
	Signature types.Hash    `json:"signature"`
}

func (*Register) Type

func (r *Register) Type() Type

type Reserve added in v0.1.0

type Reserve struct {
	DOID      string        `json:"DOID"`
	Owner     types.Address `json:"owner"`
	Admin     types.Address `json:"admin"`
	Signature types.Hash    `json:"signature"`
}

func (*Reserve) Type added in v0.1.0

func (r *Reserve) Type() Type

type Type added in v0.0.3

type Type uint8

Type of transaction.

A uint8 for rlp serializing, but marshalled as string in JSON.

const (
	TypeRegister Type = iota
	TypeReserve  Type = 1
	TypeUpdate   Type = 2
)

Transaction types, append only.

func TxType added in v0.2.0

func TxType(t types.Tx) Type

func (Type) MarshalText added in v0.0.3

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

MarshalText implements encoding.TextMarshaler.

func (Type) String added in v0.0.3

func (t Type) String() string

String returns the type string.

func (*Type) UnmarshalJSON added in v0.0.3

func (t *Type) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*Type) UnmarshalText added in v0.0.3

func (t *Type) UnmarshalText(input []byte) error

UnmarshalText implements encoding.TextUnmarshaler

type TypedTx added in v0.0.3

type TypedTx interface {
	Type() Type // return type of transaction
}

TypedTx is the interface of all kinds of transactions

func Decode

func Decode(b types.Tx) (TypedTx, error)

func NewTypedTx added in v0.0.3

func NewTypedTx(t Type) TypedTx

func UnmarshalJSON added in v0.0.3

func UnmarshalJSON(data []byte) (TypedTx, error)

type Update added in v0.1.0

type Update struct {
	DOID      string        `json:"DOID"`
	Owner     types.Address `json:"owner"`
	Signature types.Hash    `json:"signature"`
}

update doidname from exist owner to input owner

func (*Update) Type added in v0.1.0

func (u *Update) Type() Type

Jump to

Keyboard shortcuts

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