extension

package
v3.0.0-alpha.0...-e5a6d49 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: GPL-3.0 Imports: 17 Imported by: 7

Documentation

Index

Constants

View Source
const MaxOperators = 10

Variables

View Source
var (
	CreateContractAccountFactHint = hint.MustNewHint("mitum-currency-create-contract-account-operation-fact-v0.0.1")
	CreateContractAccountHint     = hint.MustNewHint("mitum-currency-create-contract-account-operation-v0.0.1")
)
View Source
var (
	UpdateOperatorFactHint = hint.MustNewHint("mitum-currency-contract-account-update-operator-operation-fact-v0.0.1")
	UpdateOperatorHint     = hint.MustNewHint("mitum-currency-contract-account-update-operator-operation-v0.0.1")
)
View Source
var (
	WithdrawFactHint = hint.MustNewHint("mitum-currency-contract-account-withdraw-operation-fact-v0.0.1")
	WithdrawHint     = hint.MustNewHint("mitum-currency-contract-account-withdraw-operation-v0.0.1")
)
View Source
var (
	CreateContractAccountItemMultiAmountsHint = hint.MustNewHint("mitum-currency-create-contract-account-multiple-amounts-v0.0.1")
)
View Source
var (
	CreateContractAccountItemSingleAmountHint = hint.MustNewHint("mitum-currency-create-contract-account-single-amount-v0.0.1")
)
View Source
var MaxCreateContractAccountItems uint = 5000
View Source
var MaxWithdrawItems uint = 10
View Source
var UpdateOperatorProcessorPool = sync.Pool{
	New: func() interface{} {
		return new(UpdateOperatorProcessor)
	},
}
View Source
var (
	WithdrawItemMultiAmountsHint = hint.MustNewHint("mitum-currency-contract-account-withdraw-multi-amounts-v0.0.1")
)
View Source
var (
	WithdrawItemSingleAmountHint = hint.MustNewHint("mitum-currency-contract-account-withdraw-single-amount-v0.0.1")
)

Functions

func NewCreateContractAccountProcessor

func NewCreateContractAccountProcessor() types.GetNewProcessor

func NewUpdateOperatorProcessor

func NewUpdateOperatorProcessor() types.GetNewProcessor

func NewWithdrawProcessor

func NewWithdrawProcessor() types.GetNewProcessor

Types

type BaseCreateContractAccountItem

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

func NewBaseCreateContractAccountItem

func NewBaseCreateContractAccountItem(ht hint.Hint, keys types.AccountKeys, amounts []types.Amount, addrType hint.Type) BaseCreateContractAccountItem

func (BaseCreateContractAccountItem) Address

func (BaseCreateContractAccountItem) AddressType

func (it BaseCreateContractAccountItem) AddressType() hint.Type

func (BaseCreateContractAccountItem) Amounts

func (BaseCreateContractAccountItem) Bytes

func (it BaseCreateContractAccountItem) Bytes() []byte

func (*BaseCreateContractAccountItem) DecodeBSON

func (it *BaseCreateContractAccountItem) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*BaseCreateContractAccountItem) DecodeJSON

func (it *BaseCreateContractAccountItem) DecodeJSON(b []byte, enc encoder.Encoder) error

func (BaseCreateContractAccountItem) IsValid

func (BaseCreateContractAccountItem) Keys

func (BaseCreateContractAccountItem) MarshalBSON

func (it BaseCreateContractAccountItem) MarshalBSON() ([]byte, error)

func (BaseCreateContractAccountItem) MarshalJSON

func (it BaseCreateContractAccountItem) MarshalJSON() ([]byte, error)

func (BaseCreateContractAccountItem) Rebuild

type BaseWithdrawItem

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

func NewBaseWithdrawItem

func NewBaseWithdrawItem(ht hint.Hint, target base.Address, amounts []types.Amount) BaseWithdrawItem

func (BaseWithdrawItem) Amounts

func (it BaseWithdrawItem) Amounts() []types.Amount

func (BaseWithdrawItem) Bytes

func (it BaseWithdrawItem) Bytes() []byte

func (*BaseWithdrawItem) DecodeBSON

func (it *BaseWithdrawItem) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*BaseWithdrawItem) DecodeJSON

func (it *BaseWithdrawItem) DecodeJSON(b []byte, enc encoder.Encoder) error

func (BaseWithdrawItem) IsValid

func (it BaseWithdrawItem) IsValid([]byte) error

func (BaseWithdrawItem) MarshalBSON

func (it BaseWithdrawItem) MarshalBSON() ([]byte, error)

func (BaseWithdrawItem) MarshalJSON

func (it BaseWithdrawItem) MarshalJSON() ([]byte, error)

func (BaseWithdrawItem) Rebuild

func (it BaseWithdrawItem) Rebuild() WithdrawItem

func (BaseWithdrawItem) Target

func (it BaseWithdrawItem) Target() base.Address

type BaseWithdrawItemBSONUnmarshaler

type BaseWithdrawItemBSONUnmarshaler struct {
	Hint    string   `bson:"_hint"`
	Target  string   `bson:"target"`
	Amounts bson.Raw `bson:"amounts"`
}

type BaseWithdrawItemJSONMarshaler

type BaseWithdrawItemJSONMarshaler struct {
	hint.BaseHinter
	Target  base.Address   `json:"target"`
	Amounts []types.Amount `json:"amounts"`
}

type BaseWithdrawItemJSONUnmarshaler

type BaseWithdrawItemJSONUnmarshaler struct {
	Hint    hint.Hint       `json:"_hint"`
	Target  string          `json:"target"`
	Amounts json.RawMessage `json:"amounts"`
}

type CreateContractAccount

type CreateContractAccount struct {
	common.BaseOperation
}

func (*CreateContractAccount) DecodeBSON

func (op *CreateContractAccount) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*CreateContractAccount) DecodeJSON

func (op *CreateContractAccount) DecodeJSON(b []byte, enc encoder.Encoder) error

func (*CreateContractAccount) HashSign

func (op *CreateContractAccount) HashSign(priv base.Privatekey, networkID base.NetworkID) error

func (CreateContractAccount) MarshalBSON

func (op CreateContractAccount) MarshalBSON() ([]byte, error)

func (CreateContractAccount) MarshalJSON

func (op CreateContractAccount) MarshalJSON() ([]byte, error)

type CreateContractAccountFact

type CreateContractAccountFact struct {
	base.BaseFact
	// contains filtered or unexported fields
}

func NewCreateContractAccountFact

func NewCreateContractAccountFact(token []byte, sender base.Address, items []CreateContractAccountItem) CreateContractAccountFact

func (CreateContractAccountFact) Addresses

func (fact CreateContractAccountFact) Addresses() ([]base.Address, error)

func (CreateContractAccountFact) Bytes

func (fact CreateContractAccountFact) Bytes() []byte

func (*CreateContractAccountFact) DecodeBSON

func (fact *CreateContractAccountFact) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*CreateContractAccountFact) DecodeJSON

func (fact *CreateContractAccountFact) DecodeJSON(b []byte, enc encoder.Encoder) error

func (CreateContractAccountFact) GenerateHash

func (fact CreateContractAccountFact) GenerateHash() util.Hash

func (CreateContractAccountFact) Hash

func (fact CreateContractAccountFact) Hash() util.Hash

func (CreateContractAccountFact) IsValid

func (fact CreateContractAccountFact) IsValid(b []byte) error

func (CreateContractAccountFact) Items

func (CreateContractAccountFact) MarshalBSON

func (fact CreateContractAccountFact) MarshalBSON() ([]byte, error)

func (CreateContractAccountFact) MarshalJSON

func (fact CreateContractAccountFact) MarshalJSON() ([]byte, error)

func (CreateContractAccountFact) Rebuild

func (CreateContractAccountFact) Sender

func (fact CreateContractAccountFact) Sender() base.Address

func (CreateContractAccountFact) Targets

func (fact CreateContractAccountFact) Targets() ([]base.Address, error)

func (CreateContractAccountFact) Token

func (fact CreateContractAccountFact) Token() base.Token

type CreateContractAccountFactBSONUnmarshaler

type CreateContractAccountFactBSONUnmarshaler struct {
	Hint   string   `bson:"_hint"`
	Sender string   `bson:"sender"`
	Items  bson.Raw `bson:"items"`
}

type CreateContractAccountFactJSONMarshaler

type CreateContractAccountFactJSONMarshaler struct {
	base.BaseFactJSONMarshaler
	Owner base.Address                `json:"sender"`
	Items []CreateContractAccountItem `json:"items"`
}

type CreateContractAccountFactJSONUnMarshaler

type CreateContractAccountFactJSONUnMarshaler struct {
	base.BaseFactJSONUnmarshaler
	Owner string          `json:"sender"`
	Items json.RawMessage `json:"items"`
}

type CreateContractAccountItem

type CreateContractAccountItem interface {
	hint.Hinter
	util.IsValider
	currency.AmountsItem
	Bytes() []byte
	Keys() types.AccountKeys
	Address() (base.Address, error)
	Rebuild() CreateContractAccountItem
	AddressType() hint.Type
}

type CreateContractAccountItemBSONUnmarshaler

type CreateContractAccountItemBSONUnmarshaler struct {
	Hint     string   `bson:"_hint"`
	Keys     bson.Raw `bson:"keys"`
	Amounts  bson.Raw `bson:"amounts"`
	AddrType string   `bson:"addrtype"`
}

type CreateContractAccountItemJSONMarshaler

type CreateContractAccountItemJSONMarshaler struct {
	hint.BaseHinter
	Keys     types.AccountKeys `json:"keys"`
	Amounts  []types.Amount    `json:"amounts"`
	AddrType hint.Type         `json:"addrtype"`
}

type CreateContractAccountItemJSONUnMarshaler

type CreateContractAccountItemJSONUnMarshaler struct {
	Hint     hint.Hint       `json:"_hint"`
	Keys     json.RawMessage `json:"keys"`
	Amounts  json.RawMessage `json:"amounts"`
	AddrType string          `json:"addrtype"`
}

type CreateContractAccountItemMultiAmounts

type CreateContractAccountItemMultiAmounts struct {
	BaseCreateContractAccountItem
}

func NewCreateContractAccountItemMultiAmounts

func NewCreateContractAccountItemMultiAmounts(keys types.AccountKeys, amounts []types.Amount, addrType hint.Type) CreateContractAccountItemMultiAmounts

func (CreateContractAccountItemMultiAmounts) IsValid

func (CreateContractAccountItemMultiAmounts) Rebuild

type CreateContractAccountItemProcessor

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

func (*CreateContractAccountItemProcessor) Close

func (*CreateContractAccountItemProcessor) PreProcess

func (opp *CreateContractAccountItemProcessor) PreProcess(
	_ context.Context, _ base.Operation, getStateFunc base.GetStateFunc,
) error

func (*CreateContractAccountItemProcessor) Process

type CreateContractAccountItemSingleAmount

type CreateContractAccountItemSingleAmount struct {
	BaseCreateContractAccountItem
}

func NewCreateContractAccountItemSingleAmount

func NewCreateContractAccountItemSingleAmount(keys types.AccountKeys, amount types.Amount, addrType hint.Type) CreateContractAccountItemSingleAmount

func (CreateContractAccountItemSingleAmount) IsValid

func (CreateContractAccountItemSingleAmount) Rebuild

type CreateContractAccountProcessor

type CreateContractAccountProcessor struct {
	*base.BaseOperationProcessor
	// contains filtered or unexported fields
}

func (*CreateContractAccountProcessor) Close

func (*CreateContractAccountProcessor) PreProcess

func (*CreateContractAccountProcessor) Process

type UpdatOperatorFactJSONUnMarshaler

type UpdatOperatorFactJSONUnMarshaler struct {
	base.BaseFactJSONUnmarshaler
	Sender    string   `json:"sender"`
	Contract  string   `json:"contract"`
	Operators []string `json:"operators"`
	Currency  string   `json:"currency"`
}

type UpdateOperator

type UpdateOperator struct {
	common.BaseOperation
}

func NewUpdateOperator

func NewUpdateOperator(fact UpdateOperatorFact) (UpdateOperator, error)

func (*UpdateOperator) DecodeBSON

func (op *UpdateOperator) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*UpdateOperator) DecodeJSON

func (op *UpdateOperator) DecodeJSON(b []byte, enc encoder.Encoder) error

func (*UpdateOperator) HashSign

func (op *UpdateOperator) HashSign(priv base.Privatekey, networkID base.NetworkID) error

func (UpdateOperator) MarshalBSON

func (op UpdateOperator) MarshalBSON() ([]byte, error)

func (UpdateOperator) MarshalJSON

func (op UpdateOperator) MarshalJSON() ([]byte, error)

type UpdateOperatorFact

type UpdateOperatorFact struct {
	base.BaseFact
	// contains filtered or unexported fields
}

func NewUpdateOperatorFact

func NewUpdateOperatorFact(
	token []byte,
	sender,
	contract base.Address,
	operators []base.Address,
	currency types.CurrencyID,
) UpdateOperatorFact

func (UpdateOperatorFact) Addresses

func (fact UpdateOperatorFact) Addresses() ([]base.Address, error)

func (UpdateOperatorFact) Bytes

func (fact UpdateOperatorFact) Bytes() []byte

func (UpdateOperatorFact) Contract

func (fact UpdateOperatorFact) Contract() base.Address

func (UpdateOperatorFact) Currency

func (fact UpdateOperatorFact) Currency() types.CurrencyID

func (*UpdateOperatorFact) DecodeBSON

func (fact *UpdateOperatorFact) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*UpdateOperatorFact) DecodeJSON

func (fact *UpdateOperatorFact) DecodeJSON(b []byte, enc encoder.Encoder) error

func (UpdateOperatorFact) GenerateHash

func (fact UpdateOperatorFact) GenerateHash() util.Hash

func (UpdateOperatorFact) Hash

func (fact UpdateOperatorFact) Hash() util.Hash

func (UpdateOperatorFact) IsValid

func (fact UpdateOperatorFact) IsValid(b []byte) error

func (UpdateOperatorFact) MarshalBSON

func (fact UpdateOperatorFact) MarshalBSON() ([]byte, error)

func (UpdateOperatorFact) MarshalJSON

func (fact UpdateOperatorFact) MarshalJSON() ([]byte, error)

func (UpdateOperatorFact) Operators

func (fact UpdateOperatorFact) Operators() []base.Address

func (UpdateOperatorFact) Sender

func (fact UpdateOperatorFact) Sender() base.Address

func (UpdateOperatorFact) Token

func (fact UpdateOperatorFact) Token() base.Token

type UpdateOperatorFactBSONUnmarshaler

type UpdateOperatorFactBSONUnmarshaler struct {
	Hint      string   `bson:"_hint"`
	Sender    string   `bson:"sender"`
	Contract  string   `bson:"contract"`
	Operators []string `bson:"operators"`
	Currency  string   `bson:"currency"`
}

type UpdateOperatorFactJSONMarshaler

type UpdateOperatorFactJSONMarshaler struct {
	base.BaseFactJSONMarshaler
	Sender    base.Address     `json:"sender"`
	Contract  base.Address     `json:"contract"`
	Operators []base.Address   `json:"operators"`
	Currency  types.CurrencyID `json:"currency"`
}

type UpdateOperatorProcessor

type UpdateOperatorProcessor struct {
	*base.BaseOperationProcessor
	// contains filtered or unexported fields
}

func (*UpdateOperatorProcessor) Close

func (opp *UpdateOperatorProcessor) Close() error

func (*UpdateOperatorProcessor) PreProcess

func (*UpdateOperatorProcessor) Process

type Withdraw

type Withdraw struct {
	common.BaseOperation
}

func NewWithdraw

func NewWithdraw(fact WithdrawFact) (Withdraw, error)

func (*Withdraw) DecodeBSON

func (op *Withdraw) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*Withdraw) DecodeJSON

func (op *Withdraw) DecodeJSON(b []byte, enc encoder.Encoder) error

func (*Withdraw) HashSign

func (op *Withdraw) HashSign(priv base.Privatekey, networkID base.NetworkID) error

func (Withdraw) MarshalBSON

func (op Withdraw) MarshalBSON() ([]byte, error)

func (Withdraw) MarshalJSON

func (op Withdraw) MarshalJSON() ([]byte, error)

type WithdrawFact

type WithdrawFact struct {
	base.BaseFact
	// contains filtered or unexported fields
}

func NewWithdrawFact

func NewWithdrawFact(token []byte, sender base.Address, items []WithdrawItem) WithdrawFact

func (WithdrawFact) Addresses

func (fact WithdrawFact) Addresses() ([]base.Address, error)

func (WithdrawFact) Bytes

func (fact WithdrawFact) Bytes() []byte

func (*WithdrawFact) DecodeBSON

func (fact *WithdrawFact) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*WithdrawFact) DecodeJSON

func (fact *WithdrawFact) DecodeJSON(b []byte, enc encoder.Encoder) error

func (WithdrawFact) GenerateHash

func (fact WithdrawFact) GenerateHash() util.Hash

func (WithdrawFact) Hash

func (fact WithdrawFact) Hash() util.Hash

func (WithdrawFact) IsValid

func (fact WithdrawFact) IsValid(b []byte) error

func (WithdrawFact) Items

func (fact WithdrawFact) Items() []WithdrawItem

func (WithdrawFact) MarshalBSON

func (fact WithdrawFact) MarshalBSON() ([]byte, error)

func (WithdrawFact) MarshalJSON

func (fact WithdrawFact) MarshalJSON() ([]byte, error)

func (WithdrawFact) Rebuild

func (fact WithdrawFact) Rebuild() WithdrawFact

func (WithdrawFact) Sender

func (fact WithdrawFact) Sender() base.Address

func (WithdrawFact) Token

func (fact WithdrawFact) Token() base.Token

type WithdrawFactBSONUnmarshaler

type WithdrawFactBSONUnmarshaler struct {
	Hint   string   `bson:"_hint"`
	Sender string   `bson:"sender"`
	Items  bson.Raw `bson:"items"`
}

type WithdrawFactJSONMarshaler

type WithdrawFactJSONMarshaler struct {
	base.BaseFactJSONMarshaler
	Sender base.Address   `json:"sender"`
	Items  []WithdrawItem `json:"items"`
}

type WithdrawFactJSONUnmarshaler

type WithdrawFactJSONUnmarshaler struct {
	base.BaseFactJSONUnmarshaler
	Sender string          `json:"sender"`
	Items  json.RawMessage `json:"items"`
}

type WithdrawItem

type WithdrawItem interface {
	hint.Hinter
	util.IsValider
	currency.AmountsItem
	Bytes() []byte
	Target() base.Address
	Rebuild() WithdrawItem
}

type WithdrawItemMultiAmounts

type WithdrawItemMultiAmounts struct {
	BaseWithdrawItem
}

func NewWithdrawItemMultiAmounts

func NewWithdrawItemMultiAmounts(target base.Address, amounts []types.Amount) WithdrawItemMultiAmounts

func (WithdrawItemMultiAmounts) IsValid

func (it WithdrawItemMultiAmounts) IsValid([]byte) error

func (WithdrawItemMultiAmounts) Rebuild

type WithdrawItemProcessor

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

func (*WithdrawItemProcessor) Close

func (opp *WithdrawItemProcessor) Close()

func (*WithdrawItemProcessor) PreProcess

func (opp *WithdrawItemProcessor) PreProcess(
	_ context.Context, _ base.Operation, getStateFunc base.GetStateFunc,
) error

func (*WithdrawItemProcessor) Process

type WithdrawItemSingleAmount

type WithdrawItemSingleAmount struct {
	BaseWithdrawItem
}

func NewWithdrawItemSingleAmount

func NewWithdrawItemSingleAmount(target base.Address, amount types.Amount) WithdrawItemSingleAmount

func (WithdrawItemSingleAmount) IsValid

func (it WithdrawItemSingleAmount) IsValid([]byte) error

func (WithdrawItemSingleAmount) Rebuild

type WithdrawProcessor

type WithdrawProcessor struct {
	*base.BaseOperationProcessor
	// contains filtered or unexported fields
}

func (*WithdrawProcessor) Close

func (opp *WithdrawProcessor) Close() error

func (*WithdrawProcessor) PreProcess

func (*WithdrawProcessor) Process

Jump to

Keyboard shortcuts

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