currency

package
v2.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FeeerNil   = "nil"
	FeeerFixed = "fixed"
	FeeerRatio = "ratio"
)

Variables

View Source
var (
	MinLengthContractID = 3
	MaxLengthContractID = 10
	ReValidContractID   = regexp.MustCompile(`^[A-Z0-9][A-Z0-9-_\.\!\$\*\@]*[A-Z0-9]$`)
)
View Source
var (
	CreateContractAccountsFactHint = hint.MustNewHint("mitum-currency-create-contract-accounts-operation-fact-v0.0.1")
	CreateContractAccountsHint     = hint.MustNewHint("mitum-currency-create-contract-accounts-operation-v0.0.1")
)
View Source
var (
	CurrencyPolicyUpdaterFactHint = hint.MustNewHint("mitum-currency-currency-policy-updater-operation-fact-v0.0.1")
	CurrencyPolicyUpdaterHint     = hint.MustNewHint("mitum-currency-currency-policy-updater-operation-v0.0.1")
)
View Source
var (
	CurrencyRegisterFactHint = hint.MustNewHint("mitum-currency-currency-register-operation-fact-v0.0.1")
	CurrencyRegisterHint     = hint.MustNewHint("mitum-currency-currency-register-operation-v0.0.1")
)
View Source
var (
	NilFeeerHint   = hint.MustNewHint("mitum-currency-nil-feeer-v0.0.1")
	FixedFeeerHint = hint.MustNewHint("mitum-currency-fixed-feeer-v0.0.1")
	RatioFeeerHint = hint.MustNewHint("mitum-currency-ratio-feeer-v0.0.1")
)
View Source
var (
	GenesisCurrenciesFactHint = hint.MustNewHint("mitum-currency-genesis-currencies-operation-fact-v0.0.1")
	GenesisCurrenciesHint     = hint.MustNewHint("mitum-currency-genesis-currencies-operation-v0.0.1")
)
View Source
var (
	WithdrawsFactHint = hint.MustNewHint("mitum-currency-contract-account-withdraws-operation-fact-v0.0.1")
	WithdrawsHint     = hint.MustNewHint("mitum-currency-contract-account-withdraws-operation-v0.0.1")
)
View Source
var ContractAccountHint = hint.MustNewHint("mitum-currency-contract-account-status-v0.0.1")
View Source
var ContractAccountKeysHint = hint.MustNewHint("mitum-currency-contract-account-keys-v0.0.1")
View Source
var ContractAccountStateValueHint = hint.MustNewHint("contract-account-state-value-v0.0.1")
View Source
var (
	CreateContractAccountsItemMultiAmountsHint = hint.MustNewHint("mitum-currency-create-contract-accounts-multiple-amounts-v0.0.1")
)
View Source
var (
	CreateContractAccountsItemSingleAmountHint = hint.MustNewHint("mitum-currency-create-contract-accounts-single-amount-v0.0.1")
)
View Source
var (
	CurrencyDesignHint = hint.MustNewHint("mitum-currency-currency-design-v0.0.1")
)
View Source
var CurrencyDesignStateValueHint = hint.MustNewHint("currency-design-state-value-v0.0.1")
View Source
var (
	CurrencyPolicyHint = hint.MustNewHint("mitum-currency-currency-policy-v0.0.1")
)
View Source
var MaxCreateContractAccountsItems uint = 10
View Source
var MaxWithdrawsItems uint = 10
View Source
var StateKeyContractAccountSuffix = ":contractaccount"
View Source
var StateKeyCurrencyDesignPrefix = "currencydesign:"
View Source
var UnlimitedMaxFeeAmount = currency.NewBig(-1)
View Source
var (
	WithdrawsItemMultiAmountsHint = hint.MustNewHint("mitum-currency-contract-account-withdraws-multi-amounts-v0.0.1")
)
View Source
var (
	WithdrawsItemSingleAmountHint = hint.MustNewHint("mitum-currency-contract-account-withdraws-single-amount-v0.0.1")
)

Functions

func CalculateItemsFee

func CalculateItemsFee(getStateFunc base.GetStateFunc, items []currency.AmountsItem) (map[currency.CurrencyID][2]currency.Big, error)

func CheckEnoughBalance

func CheckEnoughBalance(
	holder base.Address,
	required map[currency.CurrencyID][2]currency.Big,
	getStateFunc base.GetStateFunc,
) (map[currency.CurrencyID]base.StateMergeValue, error)

func IsStateContractAccountKey

func IsStateContractAccountKey(key string) bool

func IsStateCurrencyDesignKey

func IsStateCurrencyDesignKey(key string) bool

func NewContractAccountStateMergeValue

func NewContractAccountStateMergeValue(key string, stv base.StateValue) base.StateMergeValue

func NewCurrencyDesignStateMergeValue

func NewCurrencyDesignStateMergeValue(key string, stv base.StateValue) base.StateMergeValue

func NewFeeToken

func NewFeeToken(feeer Feeer, height base.Height) []byte

func StateKeyContractAccount

func StateKeyContractAccount(a base.Address) string

func StateKeyCurrencyDesign

func StateKeyCurrencyDesign(cid currency.CurrencyID) string

Types

type BaseCreateContractAccountsItem

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

func NewBaseCreateContractAccountsItem

func NewBaseCreateContractAccountsItem(ht hint.Hint, keys currency.AccountKeys, amounts []currency.Amount) BaseCreateContractAccountsItem

func (BaseCreateContractAccountsItem) Address

func (BaseCreateContractAccountsItem) Amounts

func (BaseCreateContractAccountsItem) Bytes

func (it BaseCreateContractAccountsItem) Bytes() []byte

func (*BaseCreateContractAccountsItem) DecodeBSON

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

func (*BaseCreateContractAccountsItem) DecodeJSON

func (it *BaseCreateContractAccountsItem) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (BaseCreateContractAccountsItem) IsValid

func (BaseCreateContractAccountsItem) Keys

func (BaseCreateContractAccountsItem) MarshalBSON

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

func (BaseCreateContractAccountsItem) MarshalJSON

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

func (BaseCreateContractAccountsItem) Rebuild

type BaseWithdrawsItem

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

func NewBaseWithdrawsItem

func NewBaseWithdrawsItem(ht hint.Hint, target base.Address, amounts []currency.Amount) BaseWithdrawsItem

func (BaseWithdrawsItem) Amounts

func (it BaseWithdrawsItem) Amounts() []currency.Amount

func (BaseWithdrawsItem) Bytes

func (it BaseWithdrawsItem) Bytes() []byte

func (*BaseWithdrawsItem) DecodeBSON

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

func (*BaseWithdrawsItem) DecodeJSON

func (it *BaseWithdrawsItem) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (BaseWithdrawsItem) IsValid

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

func (BaseWithdrawsItem) MarshalBSON

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

func (BaseWithdrawsItem) MarshalJSON

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

func (BaseWithdrawsItem) Rebuild

func (it BaseWithdrawsItem) Rebuild() WithdrawsItem

func (BaseWithdrawsItem) Target

func (it BaseWithdrawsItem) Target() base.Address

type BaseWithdrawsItemJSONUnpacker

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

type ContractAccount

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

func NewContractAccount

func NewContractAccount(owner base.Address, isActive bool) ContractAccount

func StateContractAccountValue

func StateContractAccountValue(st base.State) (ContractAccount, error)

func (ContractAccount) Bytes

func (cs ContractAccount) Bytes() []byte

func (*ContractAccount) DecodeBSON

func (cs *ContractAccount) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*ContractAccount) DecodeJSON

func (ca *ContractAccount) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (ContractAccount) Equal

func (cs ContractAccount) Equal(b ContractAccount) bool

func (ContractAccount) GenerateHash

func (cs ContractAccount) GenerateHash() util.Hash

func (ContractAccount) Hash

func (cs ContractAccount) Hash() util.Hash

func (ContractAccount) IsActive

func (cs ContractAccount) IsActive() bool

func (ContractAccount) IsValid

func (cs ContractAccount) IsValid([]byte) error

func (ContractAccount) MarshalBSON

func (cs ContractAccount) MarshalBSON() ([]byte, error)

func (ContractAccount) MarshalJSON

func (cs ContractAccount) MarshalJSON() ([]byte, error)

func (ContractAccount) Owner

func (cs ContractAccount) Owner() base.Address

func (ContractAccount) SetIsActive

func (cs ContractAccount) SetIsActive(b bool) ContractAccount

func (ContractAccount) SetOwner

func (cs ContractAccount) SetOwner(a base.Address) (ContractAccount, error)

type ContractAccountBSONUnmarshaler

type ContractAccountBSONUnmarshaler struct {
	Hint     string `json:"_hint"`
	IsActive bool   `bson:"isactive"`
	Owner    string `bson:"owner"`
}

type ContractAccountJSONMarshaler

type ContractAccountJSONMarshaler struct {
	hint.BaseHinter
	IsActive bool         `json:"isactive"`
	Owner    base.Address `json:"owner"`
}

type ContractAccountJSONUnmarshaler

type ContractAccountJSONUnmarshaler struct {
	Hint     hint.Hint `json:"_hint"`
	IsActive bool      `json:"isactive"`
	Owner    string    `json:"owner"`
}

type ContractAccountKeys

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

func EmptyBaseAccountKeys

func EmptyBaseAccountKeys() ContractAccountKeys

func NewContractAccountKeys

func NewContractAccountKeys() (ContractAccountKeys, error)

func (ContractAccountKeys) Bytes

func (ks ContractAccountKeys) Bytes() []byte

func (ContractAccountKeys) Equal

func (ContractAccountKeys) GenerateHash

func (ks ContractAccountKeys) GenerateHash() (util.Hash, error)

func (ContractAccountKeys) Hash

func (ks ContractAccountKeys) Hash() util.Hash

func (ContractAccountKeys) IsValid

func (ks ContractAccountKeys) IsValid([]byte) error

func (ContractAccountKeys) Key

func (ContractAccountKeys) Keys

func (ContractAccountKeys) Threshold

func (ks ContractAccountKeys) Threshold() uint

type ContractAccountStateValue

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

func NewContractAccountStateValue

func NewContractAccountStateValue(account ContractAccount) ContractAccountStateValue

func (*ContractAccountStateValue) DecodeBSON

func (s *ContractAccountStateValue) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*ContractAccountStateValue) DecodeJSON

func (s *ContractAccountStateValue) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (ContractAccountStateValue) HashBytes

func (c ContractAccountStateValue) HashBytes() []byte

func (ContractAccountStateValue) Hint

func (ContractAccountStateValue) IsValid

func (c ContractAccountStateValue) IsValid([]byte) error

func (ContractAccountStateValue) MarshalBSON

func (s ContractAccountStateValue) MarshalBSON() ([]byte, error)

func (ContractAccountStateValue) MarshalJSON

func (s ContractAccountStateValue) MarshalJSON() ([]byte, error)

type ContractAccountStateValueBSONUnmarshaler

type ContractAccountStateValueBSONUnmarshaler struct {
	Hint            string   `bson:"_hint"`
	ContractAccount bson.Raw `bson:"contractaccount"`
}

type ContractAccountStateValueJSONMarshaler

type ContractAccountStateValueJSONMarshaler struct {
	hint.BaseHinter
	ContractAccount ContractAccount `json:"contractaccount"`
}

type ContractAccountStateValueJSONUnmarshaler

type ContractAccountStateValueJSONUnmarshaler struct {
	Hint            hint.Hint       `json:"_hint"`
	ContractAccount json.RawMessage `json:"contractaccount"`
}

type ContractAccountStateValueMerger

type ContractAccountStateValueMerger struct {
	*base.BaseStateValueMerger
}

func NewContractAccountStateValueMerger

func NewContractAccountStateValueMerger(height base.Height, key string, st base.State) *ContractAccountStateValueMerger

type ContractID

type ContractID string

func (ContractID) Bytes

func (cid ContractID) Bytes() []byte

func (ContractID) IsValid

func (cid ContractID) IsValid([]byte) error

func (ContractID) String

func (cid ContractID) String() string

type CreateAccountsItemProcessor

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

func (*CreateAccountsItemProcessor) Close

func (opp *CreateAccountsItemProcessor) Close() error

func (*CreateAccountsItemProcessor) PreProcess

func (opp *CreateAccountsItemProcessor) PreProcess(
	ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc,
) error

func (*CreateAccountsItemProcessor) Process

type CreateAccountsProcessor

type CreateAccountsProcessor struct {
	*base.BaseOperationProcessor
}

func (*CreateAccountsProcessor) Close

func (opp *CreateAccountsProcessor) Close() error

func (*CreateAccountsProcessor) PreProcess

func (*CreateAccountsProcessor) Process

type CreateContractAccounts

type CreateContractAccounts struct {
	currency.BaseOperation
}

func (*CreateContractAccounts) DecodeBSON

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

func (*CreateContractAccounts) DecodeJSON

func (op *CreateContractAccounts) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (*CreateContractAccounts) HashSign

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

func (CreateContractAccounts) MarshalBSON

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

func (CreateContractAccounts) MarshalJSON

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

func (CreateContractAccounts) Process

type CreateContractAccountsFact

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

func NewCreateContractAccountsFact

func NewCreateContractAccountsFact(token []byte, sender base.Address, items []CreateContractAccountsItem) CreateContractAccountsFact

func (CreateContractAccountsFact) Addresses

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

func (CreateContractAccountsFact) Bytes

func (fact CreateContractAccountsFact) Bytes() []byte

func (*CreateContractAccountsFact) DecodeBSON

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

func (*CreateContractAccountsFact) DecodeJSON

func (fact *CreateContractAccountsFact) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (CreateContractAccountsFact) GenerateHash

func (fact CreateContractAccountsFact) GenerateHash() util.Hash

func (CreateContractAccountsFact) Hash

func (fact CreateContractAccountsFact) Hash() util.Hash

func (CreateContractAccountsFact) IsValid

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

func (CreateContractAccountsFact) Items

func (CreateContractAccountsFact) MarshalBSON

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

func (CreateContractAccountsFact) MarshalJSON

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

func (CreateContractAccountsFact) Rebuild

func (CreateContractAccountsFact) Sender

func (fact CreateContractAccountsFact) Sender() base.Address

func (CreateContractAccountsFact) Targets

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

func (CreateContractAccountsFact) Token

func (fact CreateContractAccountsFact) Token() base.Token

type CreateContractAccountsFactBSONUnmarshaler

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

type CreateContractAccountsFactJSONMarshaler

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

type CreateContractAccountsFactJSONUnMarshaler

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

type CreateContractAccountsItem

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

type CreateContractAccountsItemBSONUnmarshaler

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

type CreateContractAccountsItemJSONMarshaler

type CreateContractAccountsItemJSONMarshaler struct {
	hint.BaseHinter
	Keys    currency.AccountKeys `json:"keys"`
	Amounts []currency.Amount    `json:"amounts"`
}

type CreateContractAccountsItemJSONUnMarshaler

type CreateContractAccountsItemJSONUnMarshaler struct {
	Hint    hint.Hint       `json:"_hint"`
	Keys    json.RawMessage `json:"keys"`
	Amounts json.RawMessage `json:"amounts"`
}

type CreateContractAccountsItemMultiAmounts

type CreateContractAccountsItemMultiAmounts struct {
	BaseCreateContractAccountsItem
}

func NewCreateContractAccountsItemMultiAmounts

func NewCreateContractAccountsItemMultiAmounts(keys currency.AccountKeys, amounts []currency.Amount) CreateContractAccountsItemMultiAmounts

func (CreateContractAccountsItemMultiAmounts) IsValid

func (CreateContractAccountsItemMultiAmounts) Rebuild

type CreateContractAccountsItemProcessor

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

func (*CreateContractAccountsItemProcessor) Close

func (*CreateContractAccountsItemProcessor) PreProcess

func (opp *CreateContractAccountsItemProcessor) PreProcess(
	ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc,
) error

func (*CreateContractAccountsItemProcessor) Process

type CreateContractAccountsItemSingleAmount

type CreateContractAccountsItemSingleAmount struct {
	BaseCreateContractAccountsItem
}

func (CreateContractAccountsItemSingleAmount) IsValid

func (CreateContractAccountsItemSingleAmount) Rebuild

type CreateContractAccountsProcessor

type CreateContractAccountsProcessor struct {
	*base.BaseOperationProcessor
}

func (*CreateContractAccountsProcessor) Close

func (*CreateContractAccountsProcessor) PreProcess

func (*CreateContractAccountsProcessor) Process

type CurrencyDesign

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

func NewCurrencyDesign

func NewCurrencyDesign(amount currency.Amount, genesisAccount base.Address, po CurrencyPolicy) CurrencyDesign

func StateCurrencyDesignValue

func StateCurrencyDesignValue(st base.State) (CurrencyDesign, error)

func (CurrencyDesign) AddAggregate

func (de CurrencyDesign) AddAggregate(b currency.Big) (CurrencyDesign, error)

func (CurrencyDesign) Aggregate

func (de CurrencyDesign) Aggregate() currency.Big

func (CurrencyDesign) Amount

func (de CurrencyDesign) Amount() currency.Amount

func (CurrencyDesign) Bytes

func (de CurrencyDesign) Bytes() []byte

func (CurrencyDesign) Currency

func (de CurrencyDesign) Currency() currency.CurrencyID

func (*CurrencyDesign) DecodeBSON

func (de *CurrencyDesign) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*CurrencyDesign) DecodeJSON

func (de *CurrencyDesign) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (CurrencyDesign) GenesisAccount

func (de CurrencyDesign) GenesisAccount() base.Address

func (CurrencyDesign) IsValid

func (de CurrencyDesign) IsValid([]byte) error

func (CurrencyDesign) MarshalBSON

func (de CurrencyDesign) MarshalBSON() ([]byte, error)

func (CurrencyDesign) MarshalJSON

func (de CurrencyDesign) MarshalJSON() ([]byte, error)

func (CurrencyDesign) Policy

func (de CurrencyDesign) Policy() CurrencyPolicy

func (CurrencyDesign) SetPolicy

func (de CurrencyDesign) SetPolicy(po CurrencyPolicy) CurrencyDesign

type CurrencyDesignBSONUnmarshaler

type CurrencyDesignBSONUnmarshaler struct {
	Hint           string   `bson:"_hint"`
	Amount         bson.Raw `bson:"amount"`
	GenesisAccount string   `bson:"genesis_account"`
	Policy         bson.Raw `bson:"policy"`
	Aggregate      string   `bson:"aggregate"`
}

type CurrencyDesignJSONMarshaler

type CurrencyDesignJSONMarshaler struct {
	hint.BaseHinter
	Amount         currency.Amount `json:"amount"`
	GenesisAccount base.Address    `json:"genesis_account"`
	Policy         CurrencyPolicy  `json:"policy"`
	Aggregate      string          `json:"aggregate"`
}

type CurrencyDesignJSONUnmarshaler

type CurrencyDesignJSONUnmarshaler struct {
	Hint           hint.Hint       `json:"_hint"`
	Amount         json.RawMessage `json:"amount"`
	GenesisAccount string          `json:"genesis_account"`
	Policy         json.RawMessage `json:"policy"`
	Aggregate      string          `json:"aggregate"`
}

type CurrencyDesignStateValue

type CurrencyDesignStateValue struct {
	hint.BaseHinter
	CurrencyDesign CurrencyDesign
}

func NewCurrencyDesignStateValue

func NewCurrencyDesignStateValue(currencyDesign CurrencyDesign) CurrencyDesignStateValue

func (*CurrencyDesignStateValue) DecodeBSON

func (s *CurrencyDesignStateValue) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*CurrencyDesignStateValue) DecodeJSON

func (s *CurrencyDesignStateValue) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (CurrencyDesignStateValue) HashBytes

func (c CurrencyDesignStateValue) HashBytes() []byte

func (CurrencyDesignStateValue) Hint

func (CurrencyDesignStateValue) IsValid

func (c CurrencyDesignStateValue) IsValid([]byte) error

func (CurrencyDesignStateValue) MarshalBSON

func (s CurrencyDesignStateValue) MarshalBSON() ([]byte, error)

func (CurrencyDesignStateValue) MarshalJSON

func (s CurrencyDesignStateValue) MarshalJSON() ([]byte, error)

type CurrencyDesignStateValueBSONUnmarshaler

type CurrencyDesignStateValueBSONUnmarshaler struct {
	Hint           string   `bson:"_hint"`
	CurrencyDesign bson.Raw `bson:"currencydesign"`
}

type CurrencyDesignStateValueJSONMarshaler

type CurrencyDesignStateValueJSONMarshaler struct {
	hint.BaseHinter
	CurrencyDesign CurrencyDesign `json:"currencydesign"`
}

type CurrencyDesignStateValueJSONUnmarshaler

type CurrencyDesignStateValueJSONUnmarshaler struct {
	Hint           hint.Hint       `json:"_hint"`
	CurrencyDesign json.RawMessage `json:"currencydesign"`
}

type CurrencyDesignStateValueMerger

type CurrencyDesignStateValueMerger struct {
	*base.BaseStateValueMerger
}

func NewCurrencyDesignStateValueMerger

func NewCurrencyDesignStateValueMerger(height base.Height, key string, st base.State) *CurrencyDesignStateValueMerger

type CurrencyPolicy

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

func NewCurrencyPolicy

func NewCurrencyPolicy(newAccountMinBalance currency.Big, feeer Feeer) CurrencyPolicy

func (CurrencyPolicy) Bytes

func (po CurrencyPolicy) Bytes() []byte

func (*CurrencyPolicy) DecodeBSON

func (po *CurrencyPolicy) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*CurrencyPolicy) DecodeJSON

func (po *CurrencyPolicy) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (CurrencyPolicy) Feeer

func (po CurrencyPolicy) Feeer() Feeer

func (CurrencyPolicy) IsValid

func (po CurrencyPolicy) IsValid([]byte) error

func (CurrencyPolicy) MarshalBSON

func (po CurrencyPolicy) MarshalBSON() ([]byte, error)

func (CurrencyPolicy) MarshalJSON

func (po CurrencyPolicy) MarshalJSON() ([]byte, error)

func (CurrencyPolicy) NewAccountMinBalance

func (po CurrencyPolicy) NewAccountMinBalance() currency.Big

func (CurrencyPolicy) Process

type CurrencyPolicyBSONUnmarshaler

type CurrencyPolicyBSONUnmarshaler struct {
	Hint       string   `bson:"_hint"`
	MinBalance string   `bson:"new_account_min_balance"`
	Feeer      bson.Raw `bson:"feeer"`
}

type CurrencyPolicyJSONMarshaler

type CurrencyPolicyJSONMarshaler struct {
	hint.BaseHinter
	MinBalance string `json:"new_account_min_balance"`
	Feeer      Feeer  `json:"feeer"`
}

type CurrencyPolicyJSONUnmarshaler

type CurrencyPolicyJSONUnmarshaler struct {
	Hint       hint.Hint       `json:"_hint"`
	MinBalance string          `json:"new_account_min_balance"`
	Feeer      json.RawMessage `json:"feeer"`
}

type CurrencyPolicyUpdater

type CurrencyPolicyUpdater struct {
	currency.BaseNodeOperation
}

func (*CurrencyPolicyUpdater) DecodeBSON

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

func (*CurrencyPolicyUpdater) DecodeJSON

func (op *CurrencyPolicyUpdater) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (CurrencyPolicyUpdater) MarshalBSON

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

func (CurrencyPolicyUpdater) MarshalJSON

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

type CurrencyPolicyUpdaterFact

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

func NewCurrencyPolicyUpdaterFact

func NewCurrencyPolicyUpdaterFact(token []byte, currency currency.CurrencyID, policy CurrencyPolicy) CurrencyPolicyUpdaterFact

func (CurrencyPolicyUpdaterFact) Bytes

func (fact CurrencyPolicyUpdaterFact) Bytes() []byte

func (CurrencyPolicyUpdaterFact) Currency

func (*CurrencyPolicyUpdaterFact) DecodeBSON

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

func (*CurrencyPolicyUpdaterFact) DecodeJSON

func (fact *CurrencyPolicyUpdaterFact) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (CurrencyPolicyUpdaterFact) GenerateHash

func (fact CurrencyPolicyUpdaterFact) GenerateHash() util.Hash

func (CurrencyPolicyUpdaterFact) Hash

func (fact CurrencyPolicyUpdaterFact) Hash() util.Hash

func (CurrencyPolicyUpdaterFact) IsValid

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

func (CurrencyPolicyUpdaterFact) MarshalBSON

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

func (CurrencyPolicyUpdaterFact) MarshalJSON

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

func (CurrencyPolicyUpdaterFact) Policy

func (CurrencyPolicyUpdaterFact) Token

func (fact CurrencyPolicyUpdaterFact) Token() base.Token

type CurrencyPolicyUpdaterFactBSONUnmarshaler

type CurrencyPolicyUpdaterFactBSONUnmarshaler struct {
	Hint     string   `bson:"_hint"`
	Currency string   `bson:"currency"`
	Policy   bson.Raw `bson:"policy"`
}

type CurrencyPolicyUpdaterFactJSONMarshaler

type CurrencyPolicyUpdaterFactJSONMarshaler struct {
	base.BaseFactJSONMarshaler
	Currency currency.CurrencyID `json:"currency"`
	Policy   CurrencyPolicy      `json:"policy"`
}

type CurrencyPolicyUpdaterFactJSONUnMarshaler

type CurrencyPolicyUpdaterFactJSONUnMarshaler struct {
	base.BaseFactJSONUnmarshaler
	Currency string          `json:"currency"`
	Policy   json.RawMessage `json:"policy"`
}

type CurrencyPolicyUpdaterProcessor

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

func (*CurrencyPolicyUpdaterProcessor) Close

func (*CurrencyPolicyUpdaterProcessor) PreProcess

func (*CurrencyPolicyUpdaterProcessor) Process

type CurrencyRegister

type CurrencyRegister struct {
	currency.BaseNodeOperation
}

func NewCurrencyRegister

func NewCurrencyRegister(fact CurrencyRegisterFact) (CurrencyRegister, error)

func (*CurrencyRegister) DecodeBSON

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

func (*CurrencyRegister) DecodeJSON

func (op *CurrencyRegister) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (CurrencyRegister) MarshalBSON

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

func (CurrencyRegister) MarshalJSON

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

func (CurrencyRegister) Process

type CurrencyRegisterFact

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

func NewCurrencyRegisterFact

func NewCurrencyRegisterFact(token []byte, de CurrencyDesign) CurrencyRegisterFact

func (CurrencyRegisterFact) Bytes

func (fact CurrencyRegisterFact) Bytes() []byte

func (CurrencyRegisterFact) Currency

func (fact CurrencyRegisterFact) Currency() CurrencyDesign

func (*CurrencyRegisterFact) DecodeBSON

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

func (*CurrencyRegisterFact) DecodeJSON

func (fact *CurrencyRegisterFact) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (CurrencyRegisterFact) GenerateHash

func (fact CurrencyRegisterFact) GenerateHash() util.Hash

func (CurrencyRegisterFact) Hash

func (fact CurrencyRegisterFact) Hash() util.Hash

func (CurrencyRegisterFact) IsValid

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

func (CurrencyRegisterFact) MarshalBSON

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

func (CurrencyRegisterFact) MarshalJSON

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

func (CurrencyRegisterFact) Token

func (fact CurrencyRegisterFact) Token() base.Token

type CurrencyRegisterFactBSONUnmarshaler

type CurrencyRegisterFactBSONUnmarshaler struct {
	Hint     string   `bson:"_hint"`
	Currency bson.Raw `bson:"currency"`
}

type CurrencyRegisterFactJSONMarshaler

type CurrencyRegisterFactJSONMarshaler struct {
	base.BaseFactJSONMarshaler
	Currency CurrencyDesign `json:"currency"`
}

type CurrencyRegisterFactJSONUnMarshaler

type CurrencyRegisterFactJSONUnMarshaler struct {
	base.BaseFactJSONUnmarshaler
	Currency json.RawMessage `json:"currency"`
}

type CurrencyRegisterProcessor

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

func (*CurrencyRegisterProcessor) Close

func (opp *CurrencyRegisterProcessor) Close() error

func (*CurrencyRegisterProcessor) PreProcess

func (*CurrencyRegisterProcessor) Process

type DuplicationType

type DuplicationType string
const (
	DuplicationTypeSender   DuplicationType = "sender"
	DuplicationTypeCurrency DuplicationType = "currency"
)

type Feeer

type Feeer interface {
	util.IsValider
	hint.Hinter
	Type() string
	Bytes() []byte
	Receiver() base.Address
	Min() currency.Big
	ExchangeMin() currency.Big
	Fee(currency.Big) (currency.Big, error)
}

type FixedFeeer

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

func NewFixedFeeer

func NewFixedFeeer(receiver base.Address, amount currency.Big, exchangeMin currency.Big) FixedFeeer

func (FixedFeeer) Bytes

func (fa FixedFeeer) Bytes() []byte

func (*FixedFeeer) DecodeBSON

func (fa *FixedFeeer) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*FixedFeeer) DecodeJSON

func (fa *FixedFeeer) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (FixedFeeer) ExchangeMin

func (fa FixedFeeer) ExchangeMin() currency.Big

func (FixedFeeer) Fee

func (fa FixedFeeer) Fee(currency.Big) (currency.Big, error)

func (FixedFeeer) IsValid

func (fa FixedFeeer) IsValid([]byte) error

func (FixedFeeer) MarshalBSON

func (fa FixedFeeer) MarshalBSON() ([]byte, error)

func (FixedFeeer) MarshalJSON

func (fa FixedFeeer) MarshalJSON() ([]byte, error)

func (FixedFeeer) Min

func (fa FixedFeeer) Min() currency.Big

func (FixedFeeer) Receiver

func (fa FixedFeeer) Receiver() base.Address

func (FixedFeeer) Type

func (FixedFeeer) Type() string

type FixedFeeerBSONUnpacker

type FixedFeeerBSONUnpacker struct {
	Hint              string `bson:"_hint"`
	Receiver          string `bson:"receiver"`
	Amount            string `bson:"amount"`
	ExchangeMinAmount string `bson:"exchange_min_amount"`
}

type FixedFeeerJSONMarshaler

type FixedFeeerJSONMarshaler struct {
	hint.BaseHinter
	Receiver          base.Address `json:"receiver"`
	Amount            string       `json:"amount"`
	ExchangeMinAmount string       `json:"exchange_min_amount"`
}

type FixedFeeerJSONUnmarshaler

type FixedFeeerJSONUnmarshaler struct {
	Hint              hint.Hint `json:"_hint"`
	Receiver          string    `json:"receiver"`
	Amount            string    `json:"amount"`
	ExchangeMinAmount string    `json:"exchange_min_amount"`
}

type GenesisCurrencies

type GenesisCurrencies struct {
	currency.BaseOperation
}

func NewGenesisCurrencies

func NewGenesisCurrencies(fact GenesisCurrenciesFact) GenesisCurrencies

func (*GenesisCurrencies) DecodeBSON

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

func (*GenesisCurrencies) DecodeJSON

func (op *GenesisCurrencies) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (GenesisCurrencies) IsValid

func (op GenesisCurrencies) IsValid(networkID []byte) error

func (GenesisCurrencies) MarshalBSON

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

func (GenesisCurrencies) MarshalJSON

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

func (GenesisCurrencies) PreProcess

func (GenesisCurrencies) Process

type GenesisCurrenciesFact

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

func NewGenesisCurrenciesFact

func NewGenesisCurrenciesFact(
	token []byte,
	genesisNodeKey base.Publickey,
	keys currency.AccountKeys,
	cs []CurrencyDesign,
) GenesisCurrenciesFact

func (GenesisCurrenciesFact) Address

func (fact GenesisCurrenciesFact) Address() (base.Address, error)

func (GenesisCurrenciesFact) Bytes

func (fact GenesisCurrenciesFact) Bytes() []byte

func (GenesisCurrenciesFact) Currencies

func (fact GenesisCurrenciesFact) Currencies() []CurrencyDesign

func (*GenesisCurrenciesFact) DecodeBSON

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

func (*GenesisCurrenciesFact) DecodeJSON

func (fact *GenesisCurrenciesFact) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (GenesisCurrenciesFact) GenerateHash

func (fact GenesisCurrenciesFact) GenerateHash() util.Hash

func (GenesisCurrenciesFact) GenesisNodeKey

func (fact GenesisCurrenciesFact) GenesisNodeKey() base.Publickey

func (GenesisCurrenciesFact) Hash

func (fact GenesisCurrenciesFact) Hash() util.Hash

func (GenesisCurrenciesFact) IsValid

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

func (GenesisCurrenciesFact) Keys

func (GenesisCurrenciesFact) MarshalBSON

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

func (GenesisCurrenciesFact) MarshalJSON

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

func (GenesisCurrenciesFact) Token

func (fact GenesisCurrenciesFact) Token() base.Token

type GenesisCurrenciesFactBSONUnMarshaler

type GenesisCurrenciesFactBSONUnMarshaler struct {
	Hint           string   `bson:"_hint"`
	GenesisNodeKey string   `bson:"genesis_node_key"`
	Keys           bson.Raw `bson:"keys"`
	Currencies     bson.Raw `bson:"currencies"`
}

type GenesisCurrenciesFactJSONMarshaler

type GenesisCurrenciesFactJSONMarshaler struct {
	base.BaseFactJSONMarshaler
	GenesisNodeKey base.Publickey       `json:"genesis_node_key"`
	Keys           currency.AccountKeys `json:"keys"`
	Currencies     []CurrencyDesign     `json:"currencies"`
}

type GenesisCurrenciesFactJSONUnMarshaler

type GenesisCurrenciesFactJSONUnMarshaler struct {
	base.BaseFactJSONUnmarshaler
	GenesisNodeKey string          `json:"genesis_node_key"`
	Keys           json.RawMessage `json:"keys"`
	Currencies     json.RawMessage `json:"currencies"`
}

type GetNewProcessor

type GetNewProcessor func(
	height base.Height,
	getStateFunc base.GetStateFunc,
	newPreProcessConstraintFunc base.NewOperationProcessorProcessFunc,
	newProcessConstraintFunc base.NewOperationProcessorProcessFunc) (base.OperationProcessor, error)

func NewCreateAccountsProcessor

func NewCreateAccountsProcessor() GetNewProcessor

func NewCreateContractAccountsProcessor

func NewCreateContractAccountsProcessor() GetNewProcessor

func NewCurrencyPolicyUpdaterProcessor

func NewCurrencyPolicyUpdaterProcessor(threshold base.Threshold) GetNewProcessor

func NewCurrencyRegisterProcessor

func NewCurrencyRegisterProcessor(threshold base.Threshold) GetNewProcessor

func NewKeyUpdaterProcessor

func NewKeyUpdaterProcessor() GetNewProcessor

func NewSuffrageInflationProcessor

func NewSuffrageInflationProcessor(threshold base.Threshold) GetNewProcessor

func NewTransfersProcessor

func NewTransfersProcessor() GetNewProcessor

func NewWithdrawsProcessor

func NewWithdrawsProcessor() GetNewProcessor

type KeyUpdaterProcessor

type KeyUpdaterProcessor struct {
	*base.BaseOperationProcessor
}

func (*KeyUpdaterProcessor) Close

func (opp *KeyUpdaterProcessor) Close() error

func (*KeyUpdaterProcessor) PreProcess

func (*KeyUpdaterProcessor) Process

type NilFeeer

type NilFeeer struct {
	hint.BaseHinter
}

func NewNilFeeer

func NewNilFeeer() NilFeeer

func (NilFeeer) Bytes

func (NilFeeer) Bytes() []byte

func (NilFeeer) ExchangeMin

func (NilFeeer) ExchangeMin() currency.Big

func (NilFeeer) Fee

func (NilFeeer) IsValid

func (fa NilFeeer) IsValid([]byte) error

func (NilFeeer) MarshalBSON

func (fa NilFeeer) MarshalBSON() ([]byte, error)

func (NilFeeer) MarshalJSON

func (fa NilFeeer) MarshalJSON() ([]byte, error)

func (NilFeeer) Min

func (NilFeeer) Min() currency.Big

func (NilFeeer) Receiver

func (NilFeeer) Receiver() base.Address

func (NilFeeer) Type

func (NilFeeer) Type() string

func (*NilFeeer) UnmarsahlBSON

func (fa *NilFeeer) UnmarsahlBSON(b []byte) error

func (*NilFeeer) UnmarsahlJSON

func (fa *NilFeeer) UnmarsahlJSON(b []byte) error

type OperationProcessor

type OperationProcessor struct {
	sync.RWMutex
	*logging.Logging
	*base.BaseOperationProcessor

	GetStateFunc base.GetStateFunc
	// contains filtered or unexported fields
}

func NewOperationProcessor

func NewOperationProcessor() *OperationProcessor

func (*OperationProcessor) Cancel

func (opr *OperationProcessor) Cancel() error

func (*OperationProcessor) Close

func (opr *OperationProcessor) Close() error

func (*OperationProcessor) New

func (opr *OperationProcessor) New(
	height base.Height,
	getStateFunc base.GetStateFunc,
	newPreProcessConstraintFunc base.NewOperationProcessorProcessFunc,
	newProcessConstraintFunc base.NewOperationProcessorProcessFunc) (*OperationProcessor, error)

func (*OperationProcessor) PreProcess

func (*OperationProcessor) Process

func (*OperationProcessor) SetProcessor

func (opr *OperationProcessor) SetProcessor(
	hint hint.Hint,
	newProcessor GetNewProcessor,
) (base.OperationProcessor, error)

type RatioFeeer

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

func NewRatioFeeer

func NewRatioFeeer(receiver base.Address, ratio float64, min, max, exchangeMin currency.Big) RatioFeeer

func (RatioFeeer) Bytes

func (fa RatioFeeer) Bytes() []byte

func (*RatioFeeer) DecodeBSON

func (fa *RatioFeeer) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*RatioFeeer) DecodeJSON

func (fa *RatioFeeer) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (RatioFeeer) ExchangeMin

func (fa RatioFeeer) ExchangeMin() currency.Big

func (RatioFeeer) Fee

func (fa RatioFeeer) Fee(a currency.Big) (currency.Big, error)

func (RatioFeeer) IsValid

func (fa RatioFeeer) IsValid([]byte) error

func (RatioFeeer) MarshalBSON

func (fa RatioFeeer) MarshalBSON() ([]byte, error)

func (RatioFeeer) MarshalJSON

func (fa RatioFeeer) MarshalJSON() ([]byte, error)

func (RatioFeeer) Min

func (fa RatioFeeer) Min() currency.Big

func (RatioFeeer) Receiver

func (fa RatioFeeer) Receiver() base.Address

func (RatioFeeer) Type

func (RatioFeeer) Type() string

type RatioFeeerBSONUnpacker

type RatioFeeerBSONUnpacker struct {
	Hint              string  `bson:"_hint"`
	Receiver          string  `bson:"receiver"`
	Ratio             float64 `bson:"ratio"`
	Min               string  `bson:"min"`
	Max               string  `bson:"max"`
	ExchangeMinAmount string  `bson:"exchange_min_amount"`
}

type RatioFeeerJSONMarshaler

type RatioFeeerJSONMarshaler struct {
	hint.BaseHinter
	Receiver          base.Address `json:"receiver"`
	Ratio             float64      `json:"ratio"`
	Min               string       `json:"min"`
	Max               string       `json:"max"`
	ExchangeMinAmount string       `json:"exchange_min_amount"`
}

type RatioFeeerJSONUnmarshaler

type RatioFeeerJSONUnmarshaler struct {
	Hint              hint.Hint `json:"_hint"`
	Receiver          string    `json:"receiver"`
	Ratio             float64   `json:"ratio"`
	Min               string    `json:"min"`
	Max               string    `json:"max"`
	ExchangeMinAmount string    `json:"exchange_min_amount"`
}

type SuffrageInflationProcessor

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

func (*SuffrageInflationProcessor) Close

func (opp *SuffrageInflationProcessor) Close() error

func (*SuffrageInflationProcessor) PreProcess

func (*SuffrageInflationProcessor) Process

type TransferFactJSONMarshaler

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

type TransfersItemProcessor

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

func (*TransfersItemProcessor) Close

func (opp *TransfersItemProcessor) Close() error

func (*TransfersItemProcessor) PreProcess

func (opp *TransfersItemProcessor) PreProcess(
	ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc,
) error

func (*TransfersItemProcessor) Process

func (opp *TransfersItemProcessor) Process(
	ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc,
) ([]base.StateMergeValue, error)

type TransfersProcessor

type TransfersProcessor struct {
	*base.BaseOperationProcessor
}

func (*TransfersProcessor) Close

func (opp *TransfersProcessor) Close() error

func (*TransfersProcessor) PreProcess

func (*TransfersProcessor) Process

type Withdraws

type Withdraws struct {
	currency.BaseOperation
}

func NewWithdraws

func NewWithdraws(fact WithdrawsFact) (Withdraws, error)

func (*Withdraws) DecodeBSON

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

func (*Withdraws) DecodeJSON

func (op *Withdraws) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (*Withdraws) HashSign

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

func (Withdraws) MarshalBSON

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

func (Withdraws) MarshalJSON

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

func (Withdraws) Process

type WithdrawsFact

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

func NewWithdrawsFact

func NewWithdrawsFact(token []byte, sender base.Address, items []WithdrawsItem) WithdrawsFact

func (WithdrawsFact) Addresses

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

func (WithdrawsFact) Bytes

func (fact WithdrawsFact) Bytes() []byte

func (*WithdrawsFact) DecodeBSON

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

func (*WithdrawsFact) DecodeJSON

func (fact *WithdrawsFact) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (WithdrawsFact) GenerateHash

func (fact WithdrawsFact) GenerateHash() util.Hash

func (WithdrawsFact) Hash

func (fact WithdrawsFact) Hash() util.Hash

func (WithdrawsFact) IsValid

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

func (WithdrawsFact) Items

func (fact WithdrawsFact) Items() []WithdrawsItem

func (WithdrawsFact) MarshalBSON

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

func (WithdrawsFact) MarshalJSON

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

func (WithdrawsFact) Rebuild

func (fact WithdrawsFact) Rebuild() WithdrawsFact

func (WithdrawsFact) Sender

func (fact WithdrawsFact) Sender() base.Address

func (WithdrawsFact) Token

func (fact WithdrawsFact) Token() base.Token

type WithdrawsFactBSONUnmarshaler

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

type WithdrawsFactJSONUnmarshaler

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

type WithdrawsItem

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

type WithdrawsItemBSONUnmarshaler

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

type WithdrawsItemJSONMarshaler

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

type WithdrawsItemMultiAmounts

type WithdrawsItemMultiAmounts struct {
	BaseWithdrawsItem
}

func NewWithdrawsItemMultiAmounts

func NewWithdrawsItemMultiAmounts(target base.Address, amounts []currency.Amount) WithdrawsItemMultiAmounts

func (WithdrawsItemMultiAmounts) IsValid

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

func (WithdrawsItemMultiAmounts) Rebuild

type WithdrawsItemProcessor

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

func (*WithdrawsItemProcessor) Close

func (opp *WithdrawsItemProcessor) Close() error

func (*WithdrawsItemProcessor) PreProcess

func (opp *WithdrawsItemProcessor) PreProcess(
	ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc,
) error

func (*WithdrawsItemProcessor) Process

func (opp *WithdrawsItemProcessor) Process(
	ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc,
) ([]base.StateMergeValue, error)

type WithdrawsItemSingleAmount

type WithdrawsItemSingleAmount struct {
	BaseWithdrawsItem
}

func NewWithdrawsItemSingleAmount

func NewWithdrawsItemSingleAmount(target base.Address, amount currency.Amount) WithdrawsItemSingleAmount

func (WithdrawsItemSingleAmount) IsValid

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

func (WithdrawsItemSingleAmount) Rebuild

type WithdrawsProcessor

type WithdrawsProcessor struct {
	*base.BaseOperationProcessor
}

func (*WithdrawsProcessor) Close

func (opp *WithdrawsProcessor) Close() error

func (*WithdrawsProcessor) PreProcess

func (*WithdrawsProcessor) Process

Source Files

Jump to

Keyboard shortcuts

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