schema

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	BundleTxVersionV1 = "v1"
	TxActionBundle    = "bundle"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundle

type Bundle struct {
	Items      []BundleItem `json:"items"`
	Expiration int64        `json:"expiration"` // second
	Salt       string       `json:"salt"`       // uuid
	Version    string       `json:"version"`
}

func (*Bundle) Hash

func (s *Bundle) Hash() []byte

func (*Bundle) HashHex

func (s *Bundle) HashHex() string

func (*Bundle) String

func (s *Bundle) String() string

type BundleData

type BundleData struct {
	Bundle BundleWithSigs `json:"bundle"`
}

type BundleItem

type BundleItem struct {
	Tag     string `json:"tag"` // token tag
	ChainID string `json:"chainID"`
	From    string `json:"from"`
	To      string `json:"to"`
	Amount  string `json:"amount"`
}

type BundleWithSigs

type BundleWithSigs struct {
	Bundle
	Sigs map[string]string `json:"sigs"` // accid -> sig
}

type InternalErr

type InternalErr struct {
	Index int    `json:"index"`
	Msg   string `json:"msg"`
}

func NewInternalErr

func NewInternalErr(idx int, msg string) *InternalErr

NewInternalErr if less than 0 (like -1), means not items error

func (InternalErr) Error

func (e InternalErr) Error() string

type Transaction

type Transaction struct {
	TokenSymbol  string `json:"tokenSymbol"`
	Action       string `json:"action"`
	From         string `json:"from"`
	To           string `json:"to"`
	Amount       string `json:"amount"`
	Fee          string `json:"fee"`
	FeeRecipient string `json:"feeRecipient"`
	Nonce        string `json:"nonce"`
	TokenID      string `json:"tokenID"`
	ChainType    string `json:"chainType"`
	ChainID      string `json:"chainID"`
	Data         string `json:"data"`
	Version      string `json:"version"`
	Sig          string `json:"sig"`

	ArOwner     string `json:"-"`
	ArTxID      string `json:"-"`
	ArTimestamp int64  `json:"-"`
}

func (*Transaction) Hash

func (t *Transaction) Hash() []byte

func (*Transaction) HexHash

func (t *Transaction) HexHash() string

func (*Transaction) String

func (t *Transaction) String() string

func (*Transaction) Tag

func (t *Transaction) Tag() string

Tag is the unique identifier of token

Jump to

Keyboard shortcuts

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