types

package
v0.0.0-...-b43498b Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MinLengthTokenSymbol = 3
	MaxLengthTokenSymbol = 10
	ReValidTokenSymbol   = regexp.MustCompile(`^[A-Z0-9][A-Z0-9_\.\!\$\*\@]*[A-Z0-9]$`)
	ReSpcecialChar       = regexp.MustCompile(`^[^\s:/?#\[\]@]*$`)
)
View Source
var ApproveBoxHint = hint.MustNewHint("mitum-token-approve-box-v0.0.1")
View Source
var ApproveInfoHint = hint.MustNewHint("mitum-token-approve-info-v0.0.1")
View Source
var DesignHint = hint.MustNewHint("mitum-token-design-v0.0.1")
View Source
var PolicyHint = hint.MustNewHint("mitum-token-policy-v0.0.1")

Functions

This section is empty.

Types

type ApproveBox

type ApproveBox struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewApproveBox

func NewApproveBox(account base.Address, approved []ApproveInfo) ApproveBox

func (ApproveBox) Account

func (a ApproveBox) Account() base.Address

func (ApproveBox) Approved

func (a ApproveBox) Approved() []ApproveInfo

func (ApproveBox) Bytes

func (a ApproveBox) Bytes() []byte

func (*ApproveBox) DecodeBSON

func (a *ApproveBox) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*ApproveBox) DecodeJSON

func (a *ApproveBox) DecodeJSON(b []byte, enc encoder.Encoder) error

func (ApproveBox) GetApproveInfo

func (a ApproveBox) GetApproveInfo(ad base.Address) *ApproveInfo

func (ApproveBox) IsValid

func (a ApproveBox) IsValid([]byte) error

func (ApproveBox) MarshalBSON

func (a ApproveBox) MarshalBSON() ([]byte, error)

func (ApproveBox) MarshalJSON

func (a ApproveBox) MarshalJSON() ([]byte, error)

func (*ApproveBox) RemoveApproveInfo

func (a *ApproveBox) RemoveApproveInfo(ad base.Address) error

func (*ApproveBox) SetApproveInfo

func (a *ApproveBox) SetApproveInfo(ap ApproveInfo)

type ApproveBoxBSONUnmarshaler

type ApproveBoxBSONUnmarshaler struct {
	Hint     string   `bson:"_hint"`
	Account  string   `bson:"account"`
	Approved bson.Raw `bson:"approved"`
}

type ApproveBoxJSONMarshaler

type ApproveBoxJSONMarshaler struct {
	hint.BaseHinter
	Account  base.Address  `json:"account"`
	Approved []ApproveInfo `json:"approved"`
}

type ApproveBoxJSONUnmarshaler

type ApproveBoxJSONUnmarshaler struct {
	Hint     hint.Hint       `json:"_hint"`
	Account  string          `json:"account"`
	Approved json.RawMessage `json:"approved"`
}

type ApproveInfo

type ApproveInfo struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewApproveInfo

func NewApproveInfo(account base.Address, amount common.Big) ApproveInfo

func (ApproveInfo) Account

func (a ApproveInfo) Account() base.Address

func (ApproveInfo) Amount

func (a ApproveInfo) Amount() common.Big

func (ApproveInfo) Bytes

func (a ApproveInfo) Bytes() []byte

func (*ApproveInfo) DecodeBSON

func (a *ApproveInfo) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*ApproveInfo) DecodeJSON

func (a *ApproveInfo) DecodeJSON(b []byte, enc encoder.Encoder) error

func (ApproveInfo) IsValid

func (a ApproveInfo) IsValid([]byte) error

func (ApproveInfo) MarshalBSON

func (a ApproveInfo) MarshalBSON() ([]byte, error)

func (ApproveInfo) MarshalJSON

func (a ApproveInfo) MarshalJSON() ([]byte, error)

type ApproveInfoBSONUnmarshaler

type ApproveInfoBSONUnmarshaler struct {
	Hint    string `bson:"_hint"`
	Account string `bson:"account"`
	Amount  string `bson:"amount"`
}

type ApproveInfoJSONMarshaler

type ApproveInfoJSONMarshaler struct {
	hint.BaseHinter
	Account base.Address `json:"account"`
	Amount  string       `json:"amount"`
}

type ApproveInfoJSONUnmarshaler

type ApproveInfoJSONUnmarshaler struct {
	Hint    hint.Hint `json:"_hint"`
	Account string    `json:"account"`
	Amount  string    `json:"amount"`
}

type Design

type Design struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewDesign

func NewDesign(symbol TokenSymbol, name string, decimal common.Big, policy Policy) Design

func (Design) Bytes

func (d Design) Bytes() []byte

func (Design) Decimal

func (d Design) Decimal() common.Big

func (*Design) DecodeBSON

func (d *Design) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*Design) DecodeJSON

func (d *Design) DecodeJSON(b []byte, enc encoder.Encoder) error

func (Design) IsValid

func (d Design) IsValid([]byte) error

func (Design) MarshalBSON

func (d Design) MarshalBSON() ([]byte, error)

func (Design) MarshalJSON

func (d Design) MarshalJSON() ([]byte, error)

func (Design) Name

func (d Design) Name() string

func (Design) Policy

func (d Design) Policy() Policy

func (Design) Symbol

func (d Design) Symbol() TokenSymbol

type DesignBSONUnmarshaler

type DesignBSONUnmarshaler struct {
	Hint    string   `bson:"_hint"`
	Symbol  string   `bson:"symbol"`
	Name    string   `bson:"name"`
	Decimal string   `bson:"decimal"`
	Policy  bson.Raw `bson:"policy"`
}

type DesignJSONMarshaler

type DesignJSONMarshaler struct {
	hint.BaseHinter
	Symbol  TokenSymbol `json:"symbol"`
	Name    string      `json:"name"`
	Decimal string      `json:"decimal"`
	Policy  Policy      `json:"policy"`
}

type DesignJSONUnmarshaler

type DesignJSONUnmarshaler struct {
	Hint    hint.Hint       `json:"_hint"`
	Symbol  string          `json:"symbol"`
	Name    string          `json:"name"`
	Decimal string          `json:"decimal"`
	Policy  json.RawMessage `json:"policy"`
}

type Policy

type Policy struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewPolicy

func NewPolicy(totalSupply common.Big, approveList []ApproveBox) Policy

func (Policy) ApproveList

func (p Policy) ApproveList() []ApproveBox

func (Policy) Bytes

func (p Policy) Bytes() []byte

func (*Policy) DecodeBSON

func (p *Policy) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*Policy) DecodeJSON

func (p *Policy) DecodeJSON(b []byte, enc encoder.Encoder) error

func (Policy) GetApproveBox

func (p Policy) GetApproveBox(acc base.Address) *ApproveBox

func (Policy) IsValid

func (p Policy) IsValid([]byte) error

func (Policy) MarshalBSON

func (p Policy) MarshalBSON() ([]byte, error)

func (Policy) MarshalJSON

func (p Policy) MarshalJSON() ([]byte, error)

func (*Policy) MergeApproveBox

func (p *Policy) MergeApproveBox(napb ApproveBox)

func (*Policy) RemoveApproveBox

func (p *Policy) RemoveApproveBox(acc base.Address)

func (Policy) TotalSupply

func (p Policy) TotalSupply() common.Big

type PolicyBSONUnmarshaler

type PolicyBSONUnmarshaler struct {
	Hint        string   `bson:"_hint"`
	TotalSupply string   `bson:"total_supply"`
	ApproveList bson.Raw `bson:"approve_list"`
}

type PolicyJSONMarshaler

type PolicyJSONMarshaler struct {
	hint.BaseHinter
	TotalSupply common.Big   `json:"total_supply"`
	ApproveList []ApproveBox `json:"approve_list"`
}

type PolicyJSONUnmarshaler

type PolicyJSONUnmarshaler struct {
	Hint        hint.Hint       `json:"_hint"`
	TotalSupply string          `json:"total_supply"`
	ApproveList json.RawMessage `json:"approve_list"`
}

type TokenSymbol

type TokenSymbol string

func (TokenSymbol) Bytes

func (ts TokenSymbol) Bytes() []byte

func (TokenSymbol) IsValid

func (ts TokenSymbol) IsValid([]byte) error

func (TokenSymbol) String

func (ts TokenSymbol) String() string

Jump to

Keyboard shortcuts

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