Documentation
¶
Overview ¶
Package currency is the currency model, based on mitum.
Index ¶
- Constants
- Variables
- func CalculateItemsFee(cp *CurrencyPool, items []AmountsItem) (map[CurrencyID][2]Big, error)
- func CheckEnoughBalance(holder base.Address, required map[CurrencyID][2]Big, ...) (map[CurrencyID]AmountState, error)
- func IsStateAccountKey(key string) bool
- func IsStateBalanceKey(key string) bool
- func IsStateCurrencyDesignKey(key string) bool
- func IsValidMemo(s string) error
- func IsValidOperationFact(fact operation.OperationFact, b []byte) error
- func NewFeeOperationProcessor(cp *CurrencyPool, op FeeOperation) state.Processor
- func NewFeeToken(feeer Feeer, height base.Height) []byte
- func SetStateAccountValue(st state.State, v Account) (state.State, error)
- func SetStateBalanceValue(st state.State, v Amount) (state.State, error)
- func SetStateCurrencyDesignValue(st state.State, v CurrencyDesign) (state.State, error)
- func SetStateKeysValue(st state.State, v AccountKeys) (state.State, error)
- func StateBalanceKeyPrefix(a base.Address, cid CurrencyID) string
- func StateKeyAccount(a base.Address) string
- func StateKeyBalance(a base.Address, cid CurrencyID) string
- func StateKeyCurrencyDesign(cid CurrencyID) string
- type Account
- func (ac Account) Address() base.Address
- func (ac Account) Bytes() []byte
- func (ac Account) GenerateHash() valuehash.Hash
- func (ac Account) Hash() valuehash.Hash
- func (ac Account) IsEmpty() bool
- func (ac Account) Keys() AccountKeys
- func (ac Account) MarshalBSON() ([]byte, error)
- func (ac Account) MarshalJSON() ([]byte, error)
- func (ac Account) PackerJSON() AccountPackerJSON
- func (ac Account) SetKeys(keys AccountKeys) (Account, error)
- func (ac *Account) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
- func (ac *Account) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
- type AccountBSONUnpacker
- type AccountJSONUnpacker
- type AccountKey
- type AccountKeys
- type AccountPackerJSON
- type Address
- func (ca Address) IsValid([]byte) error
- func (ca Address) MarshalBSONValue() (bsontype.Type, []byte, error)
- func (ca Address) MarshalText() ([]byte, error)
- func (ca Address) SetHint(ht hint.Hint) hint.Hinter
- func (ca *Address) UnpackBSON(b []byte, _ *bsonenc.Encoder) error
- func (ca *Address) UnpackJSON(b []byte, _ *jsonenc.Encoder) error
- type Addresses
- type Amount
- func (am Amount) Big() Big
- func (am Amount) Bytes() []byte
- func (am Amount) Currency() CurrencyID
- func (am Amount) Equal(b Amount) bool
- func (am Amount) GenerateHash() valuehash.Hash
- func (am Amount) Hash() valuehash.Hash
- func (am Amount) IsEmpty() bool
- func (am Amount) IsValid([]byte) error
- func (am Amount) MarshalBSON() ([]byte, error)
- func (am Amount) MarshalJSON() ([]byte, error)
- func (am Amount) String() string
- func (am *Amount) UnmarshalBSON(b []byte) error
- func (am *Amount) UnmarshalJSON(b []byte) error
- func (am Amount) WithBig(big Big) Amount
- type AmountBSONPacker
- type AmountBSONUnpacker
- type AmountJSONPacker
- type AmountJSONUnpacker
- type AmountState
- func (st AmountState) Add(a Big) AmountState
- func (st AmountState) AddFee(fee Big) AmountState
- func (st AmountState) Clear() state.State
- func (st AmountState) Currency() CurrencyID
- func (st AmountState) Fee() Big
- func (AmountState) Hint() hint.Hint
- func (st AmountState) IsValid(b []byte) error
- func (st AmountState) MarshalBSON() ([]byte, error)
- func (st AmountState) MarshalJSON() ([]byte, error)
- func (st AmountState) Merge(b state.State) (state.State, error)
- func (st AmountState) SetHash(h valuehash.Hash) (state.State, error)
- func (st AmountState) SetHeight(h base.Height) state.State
- func (st AmountState) SetOperation(ops []valuehash.Hash) state.State
- func (st AmountState) SetPreviousHeight(h base.Height) (state.State, error)
- func (st AmountState) SetValue(v state.Value) (state.State, error)
- func (st AmountState) Sub(a Big) AmountState
- type AmountsItem
- type BaseAccountKey
- func (ky BaseAccountKey) Bytes() []byte
- func (ky BaseAccountKey) Equal(b AccountKey) bool
- func (ky BaseAccountKey) IsValid([]byte) error
- func (ky BaseAccountKey) Key() key.Publickey
- func (ky BaseAccountKey) MarshalBSON() ([]byte, error)
- func (ky BaseAccountKey) MarshalJSON() ([]byte, error)
- func (ky *BaseAccountKey) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
- func (ky *BaseAccountKey) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
- func (ky BaseAccountKey) Weight() uint
- type BaseAccountKeys
- func (ks BaseAccountKeys) Bytes() []byte
- func (ks BaseAccountKeys) Equal(b AccountKeys) bool
- func (ks BaseAccountKeys) GenerateHash() (valuehash.Hash, error)
- func (ks BaseAccountKeys) Hash() valuehash.Hash
- func (ks BaseAccountKeys) IsValid([]byte) error
- func (ks BaseAccountKeys) Key(k key.Publickey) (AccountKey, bool)
- func (ks BaseAccountKeys) Keys() []AccountKey
- func (ks BaseAccountKeys) MarshalBSON() ([]byte, error)
- func (ks BaseAccountKeys) MarshalJSON() ([]byte, error)
- func (ks BaseAccountKeys) Threshold() uint
- func (ks *BaseAccountKeys) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
- func (ks *BaseAccountKeys) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
- type BaseCreateAccountsItem
- func (it BaseCreateAccountsItem) Address() (base.Address, error)
- func (it BaseCreateAccountsItem) Amounts() []Amount
- func (it BaseCreateAccountsItem) Bytes() []byte
- func (it BaseCreateAccountsItem) IsValid([]byte) error
- func (it BaseCreateAccountsItem) Keys() AccountKeys
- func (it BaseCreateAccountsItem) MarshalBSON() ([]byte, error)
- func (it BaseCreateAccountsItem) MarshalJSON() ([]byte, error)
- func (it BaseCreateAccountsItem) Rebuild() CreateAccountsItem
- func (it *BaseCreateAccountsItem) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
- func (it *BaseCreateAccountsItem) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
- type BaseOperation
- func (op BaseOperation) AddFactSigns(fs ...base.FactSign) (base.FactSignUpdater, error)
- func (op BaseOperation) GenerateHash() valuehash.Hash
- func (op BaseOperation) IsValid(networkID []byte) error
- func (op BaseOperation) MarshalBSON() ([]byte, error)
- func (op BaseOperation) MarshalJSON() ([]byte, error)
- func (op *BaseOperation) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
- func (op *BaseOperation) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
- type BaseTransfersItem
- func (it BaseTransfersItem) Amounts() []Amount
- func (it BaseTransfersItem) Bytes() []byte
- func (it BaseTransfersItem) IsValid([]byte) error
- func (it BaseTransfersItem) MarshalBSON() ([]byte, error)
- func (it BaseTransfersItem) MarshalJSON() ([]byte, error)
- func (it BaseTransfersItem) Rebuild() TransfersItem
- func (it BaseTransfersItem) Receiver() base.Address
- func (it *BaseTransfersItem) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
- func (it *BaseTransfersItem) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
- type BaseTransfersItemBSONUnpacker
- type BaseTransfersItemJSONUnpacker
- type Big
- func (a Big) Add(b Big) Big
- func (a Big) Compare(b Big) int
- func (a Big) Div(b Big) Big
- func (a Big) Equal(b Big) bool
- func (Big) IsValid([]byte) error
- func (a Big) IsZero() bool
- func (a Big) MarshalBSONValue() (bsontype.Type, []byte, error)
- func (a Big) MarshalJSON() ([]byte, error)
- func (a Big) Mul(b Big) Big
- func (a Big) MulFloat64(b float64) Big
- func (a Big) MulInt64(b int64) Big
- func (a Big) Neg() Big
- func (a Big) OverNil() bool
- func (a Big) OverZero() bool
- func (a Big) String() string
- func (a Big) Sub(b Big) Big
- func (a *Big) UnmarshalBSONValue(t bsontype.Type, b []byte) error
- func (a *Big) UnmarshalJSON(b []byte) error
- type CreateAccounts
- type CreateAccountsFact
- func (fact CreateAccountsFact) Addresses() ([]base.Address, error)
- func (fact CreateAccountsFact) Bytes() []byte
- func (fact CreateAccountsFact) GenerateHash() valuehash.Hash
- func (fact CreateAccountsFact) Hash() valuehash.Hash
- func (fact CreateAccountsFact) IsValid(b []byte) error
- func (fact CreateAccountsFact) Items() []CreateAccountsItem
- func (fact CreateAccountsFact) MarshalBSON() ([]byte, error)
- func (fact CreateAccountsFact) MarshalJSON() ([]byte, error)
- func (fact CreateAccountsFact) Rebuild() CreateAccountsFact
- func (fact CreateAccountsFact) Sender() base.Address
- func (fact CreateAccountsFact) Targets() ([]base.Address, error)
- func (fact CreateAccountsFact) Token() []byte
- func (fact *CreateAccountsFact) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
- func (fact *CreateAccountsFact) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
- type CreateAccountsFactBSONUnpacker
- type CreateAccountsFactJSONPacker
- type CreateAccountsFactJSONUnpacker
- type CreateAccountsItem
- type CreateAccountsItemBSONUnpacker
- type CreateAccountsItemJSONPacker
- type CreateAccountsItemJSONUnpacker
- type CreateAccountsItemMultiAmounts
- type CreateAccountsItemProcessor
- type CreateAccountsItemSingleAmount
- type CreateAccountsProcessor
- type CurrencyDesign
- func (de CurrencyDesign) AddAggregate(b Big) (CurrencyDesign, error)
- func (de CurrencyDesign) Aggregate() Big
- func (de CurrencyDesign) Bytes() []byte
- func (de CurrencyDesign) GenesisAccount() base.Address
- func (de CurrencyDesign) IsValid([]byte) error
- func (de CurrencyDesign) MarshalBSON() ([]byte, error)
- func (de CurrencyDesign) MarshalJSON() ([]byte, error)
- func (de CurrencyDesign) Policy() CurrencyPolicy
- func (de CurrencyDesign) SetPolicy(po CurrencyPolicy) CurrencyDesign
- func (de *CurrencyDesign) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
- func (de *CurrencyDesign) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
- type CurrencyDesignBSONUnpacker
- type CurrencyDesignJSONPacker
- type CurrencyDesignJSONUnpacker
- type CurrencyID
- type CurrencyPolicy
- func (po CurrencyPolicy) Bytes() []byte
- func (po CurrencyPolicy) Feeer() Feeer
- func (po CurrencyPolicy) IsValid([]byte) error
- func (po CurrencyPolicy) MarshalBSON() ([]byte, error)
- func (po CurrencyPolicy) MarshalJSON() ([]byte, error)
- func (po CurrencyPolicy) NewAccountMinBalance() Big
- func (po *CurrencyPolicy) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
- func (po *CurrencyPolicy) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
- type CurrencyPolicyBSONUnpacker
- type CurrencyPolicyJSONPacker
- type CurrencyPolicyJSONUnpacker
- type CurrencyPolicyUpdater
- type CurrencyPolicyUpdaterFact
- func (fact CurrencyPolicyUpdaterFact) Bytes() []byte
- func (fact CurrencyPolicyUpdaterFact) Currency() CurrencyID
- func (fact CurrencyPolicyUpdaterFact) GenerateHash() valuehash.Hash
- func (fact CurrencyPolicyUpdaterFact) Hash() valuehash.Hash
- func (fact CurrencyPolicyUpdaterFact) IsValid(b []byte) error
- func (fact CurrencyPolicyUpdaterFact) MarshalBSON() ([]byte, error)
- func (fact CurrencyPolicyUpdaterFact) MarshalJSON() ([]byte, error)
- func (fact CurrencyPolicyUpdaterFact) Policy() CurrencyPolicy
- func (fact CurrencyPolicyUpdaterFact) Token() []byte
- func (fact *CurrencyPolicyUpdaterFact) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
- func (fact *CurrencyPolicyUpdaterFact) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
- type CurrencyPolicyUpdaterFactBSONUnpacker
- type CurrencyPolicyUpdaterFactJSONPacker
- type CurrencyPolicyUpdaterFactJSONUnpacker
- type CurrencyPolicyUpdaterProcessor
- type CurrencyPool
- func (cp *CurrencyPool) CIDs() []CurrencyID
- func (cp *CurrencyPool) Clear()
- func (cp *CurrencyPool) Designs() map[CurrencyID]CurrencyDesign
- func (cp *CurrencyPool) Exists(cid CurrencyID) bool
- func (cp *CurrencyPool) Feeer(cid CurrencyID) (Feeer, bool)
- func (cp *CurrencyPool) Get(cid CurrencyID) (CurrencyDesign, bool)
- func (cp *CurrencyPool) Policy(cid CurrencyID) (CurrencyPolicy, bool)
- func (cp *CurrencyPool) Set(st state.State) error
- func (cp *CurrencyPool) State(cid CurrencyID) (state.State, bool)
- func (cp *CurrencyPool) States() map[CurrencyID]state.State
- func (cp *CurrencyPool) TraverseDesign(callback func(cid CurrencyID, de CurrencyDesign) bool)
- func (cp *CurrencyPool) TraverseState(callback func(cid CurrencyID, de state.State) bool)
- type CurrencyRegister
- type CurrencyRegisterFact
- func (fact CurrencyRegisterFact) Bytes() []byte
- func (fact CurrencyRegisterFact) Currency() CurrencyDesign
- func (fact CurrencyRegisterFact) GenerateHash() valuehash.Hash
- func (fact CurrencyRegisterFact) Hash() valuehash.Hash
- func (fact CurrencyRegisterFact) IsValid(b []byte) error
- func (fact CurrencyRegisterFact) MarshalBSON() ([]byte, error)
- func (fact CurrencyRegisterFact) MarshalJSON() ([]byte, error)
- func (fact CurrencyRegisterFact) Token() []byte
- func (fact *CurrencyRegisterFact) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
- func (fact *CurrencyRegisterFact) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
- type CurrencyRegisterFactBSONUnpacker
- type CurrencyRegisterFactJSONPacker
- type CurrencyRegisterFactJSONUnpacker
- type CurrencyRegisterProcessor
- type DuplicationType
- type FeeOperation
- func (FeeOperation) AddFactSigns(...base.FactSign) (base.FactSignUpdater, error)
- func (op FeeOperation) Fact() base.Fact
- func (op FeeOperation) GenerateHash() valuehash.Hash
- func (op FeeOperation) Hash() valuehash.Hash
- func (op FeeOperation) IsValid([]byte) error
- func (FeeOperation) LastSignedAt() time.Time
- func (op FeeOperation) MarshalBSON() ([]byte, error)
- func (op FeeOperation) MarshalJSON() ([]byte, error)
- func (FeeOperation) Process(func(key string) (state.State, bool, error), ...) error
- func (FeeOperation) Signs() []base.FactSign
- func (op *FeeOperation) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
- func (op *FeeOperation) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
- type FeeOperationBSONUnpacker
- type FeeOperationFact
- func (fact FeeOperationFact) Amounts() []Amount
- func (fact FeeOperationFact) Bytes() []byte
- func (fact FeeOperationFact) Hash() valuehash.Hash
- func (fact FeeOperationFact) IsValid([]byte) error
- func (fact FeeOperationFact) MarshalBSON() ([]byte, error)
- func (fact FeeOperationFact) MarshalJSON() ([]byte, error)
- func (fact FeeOperationFact) Token() []byte
- func (fact *FeeOperationFact) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
- func (fact *FeeOperationFact) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
- type FeeOperationFactBSONUnpacker
- type FeeOperationFactJSONPacker
- type FeeOperationFactJSONUnpacker
- type FeeOperationJSONPacker
- type FeeOperationJSONUnpacker
- type FeeOperationProcessor
- type Feeer
- type FixedFeeer
- func (fa FixedFeeer) Bytes() []byte
- func (fa FixedFeeer) Fee(Big) (Big, error)
- func (fa FixedFeeer) IsValid([]byte) error
- func (fa FixedFeeer) MarshalBSON() ([]byte, error)
- func (fa FixedFeeer) MarshalJSON() ([]byte, error)
- func (fa FixedFeeer) Min() Big
- func (fa FixedFeeer) Receiver() base.Address
- func (FixedFeeer) Type() string
- func (fa *FixedFeeer) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
- func (fa *FixedFeeer) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
- type FixedFeeerBSONUnpacker
- type FixedFeeerJSONPacker
- type FixedFeeerJSONUnpacker
- type GenesisCurrencies
- func (op GenesisCurrencies) IsValid(networkID []byte) error
- func (op GenesisCurrencies) MarshalBSON() ([]byte, error)
- func (op GenesisCurrencies) MarshalJSON() ([]byte, error)
- func (op GenesisCurrencies) Process(getState func(key string) (state.State, bool, error), ...) error
- func (op *GenesisCurrencies) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
- func (op *GenesisCurrencies) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
- type GenesisCurrenciesFact
- func (fact GenesisCurrenciesFact) Address() (base.Address, error)
- func (fact GenesisCurrenciesFact) Bytes() []byte
- func (fact GenesisCurrenciesFact) Currencies() []CurrencyDesign
- func (fact GenesisCurrenciesFact) GenerateHash() valuehash.Hash
- func (fact GenesisCurrenciesFact) GenesisNodeKey() key.Publickey
- func (fact GenesisCurrenciesFact) Hash() valuehash.Hash
- func (fact GenesisCurrenciesFact) IsValid(b []byte) error
- func (fact GenesisCurrenciesFact) Keys() AccountKeys
- func (fact GenesisCurrenciesFact) MarshalBSON() ([]byte, error)
- func (fact GenesisCurrenciesFact) MarshalJSON() ([]byte, error)
- func (fact GenesisCurrenciesFact) Token() []byte
- func (fact *GenesisCurrenciesFact) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
- func (fact *GenesisCurrenciesFact) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
- type GenesisCurrenciesFactBSONUnpacker
- type GenesisCurrenciesFactJSONPacker
- type GenesisCurrenciesFactJSONUnpacker
- type GetNewProcessor
- func NewCreateAccountsProcessor(cp *CurrencyPool) GetNewProcessor
- func NewCurrencyPolicyUpdaterProcessor(cp *CurrencyPool, pubs []key.Publickey, threshold base.Threshold) GetNewProcessor
- func NewCurrencyRegisterProcessor(cp *CurrencyPool, pubs []key.Publickey, threshold base.Threshold) GetNewProcessor
- func NewKeyUpdaterProcessor(cp *CurrencyPool) GetNewProcessor
- func NewSuffrageInflationProcessor(cp *CurrencyPool, pubs []key.Publickey, threshold base.Threshold) GetNewProcessor
- func NewTransfersProcessor(cp *CurrencyPool) GetNewProcessor
- type KeyBSONUnpacker
- type KeyJSONPacker
- type KeyJSONUnpacker
- type KeyUpdater
- type KeyUpdaterFact
- func (fact KeyUpdaterFact) Addresses() ([]base.Address, error)
- func (fact KeyUpdaterFact) Bytes() []byte
- func (fact KeyUpdaterFact) Currency() CurrencyID
- func (fact KeyUpdaterFact) GenerateHash() valuehash.Hash
- func (fact KeyUpdaterFact) Hash() valuehash.Hash
- func (fact KeyUpdaterFact) IsValid(b []byte) error
- func (fact KeyUpdaterFact) Keys() AccountKeys
- func (fact KeyUpdaterFact) MarshalBSON() ([]byte, error)
- func (fact KeyUpdaterFact) MarshalJSON() ([]byte, error)
- func (fact KeyUpdaterFact) Target() base.Address
- func (fact KeyUpdaterFact) Token() []byte
- func (fact *KeyUpdaterFact) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
- func (fact *KeyUpdaterFact) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
- type KeyUpdaterFactBSONUnpacker
- type KeyUpdaterFactJSONPacker
- type KeyUpdaterFactJSONUnpacker
- type KeyUpdaterProcessor
- type KeysBSONUnpacker
- type KeysJSONPacker
- type KeysJSONUnpacker
- type MemoBSONUnpacker
- type MemoJSONUnpacker
- type NilFeeer
- func (NilFeeer) Bytes() []byte
- func (NilFeeer) Fee(Big) (Big, error)
- func (fa NilFeeer) IsValid([]byte) error
- func (fa NilFeeer) MarshalBSON() ([]byte, error)
- func (fa NilFeeer) MarshalJSON() ([]byte, error)
- func (NilFeeer) Min() Big
- func (NilFeeer) Receiver() base.Address
- func (NilFeeer) Type() string
- func (fa *NilFeeer) UnmarsahlBSON(b []byte) error
- func (fa *NilFeeer) UnmarsahlJSON(b []byte) error
- type OperationProcessor
- func (opr *OperationProcessor) Cancel() error
- func (opr *OperationProcessor) Close() error
- func (opr *OperationProcessor) New(pool *storage.Statepool) prprocessor.OperationProcessor
- func (opr *OperationProcessor) PreProcess(op state.Processor) (state.Processor, error)
- func (opr *OperationProcessor) Process(op state.Processor) error
- func (opr *OperationProcessor) SetProcessor(hinter hint.Hinter, newProcessor GetNewProcessor) (prprocessor.OperationProcessor, error)
- type RatioFeeer
- func (fa RatioFeeer) Bytes() []byte
- func (fa RatioFeeer) Fee(a Big) (Big, error)
- func (fa RatioFeeer) IsValid([]byte) error
- func (fa RatioFeeer) MarshalBSON() ([]byte, error)
- func (fa RatioFeeer) MarshalJSON() ([]byte, error)
- func (fa RatioFeeer) Min() Big
- func (fa RatioFeeer) Receiver() base.Address
- func (RatioFeeer) Type() string
- func (fa *RatioFeeer) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
- func (fa *RatioFeeer) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
- type RatioFeeerBSONUnpacker
- type RatioFeeerJSONPacker
- type RatioFeeerJSONUnpacker
- type SuffrageInflation
- type SuffrageInflationFact
- func (fact SuffrageInflationFact) Bytes() []byte
- func (fact SuffrageInflationFact) GenerateHash() valuehash.Hash
- func (fact SuffrageInflationFact) Hash() valuehash.Hash
- func (fact SuffrageInflationFact) IsValid(b []byte) error
- func (fact SuffrageInflationFact) Items() []SuffrageInflationItem
- func (fact SuffrageInflationFact) MarshalBSON() ([]byte, error)
- func (fact SuffrageInflationFact) MarshalJSON() ([]byte, error)
- func (fact SuffrageInflationFact) Token() []byte
- func (fact *SuffrageInflationFact) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
- func (fact *SuffrageInflationFact) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
- type SuffrageInflationFactBSONUnpacker
- type SuffrageInflationFactJSONPacker
- type SuffrageInflationFactJSONUnpacker
- type SuffrageInflationItem
- type SuffrageInflationItemPacker
- type SuffrageInflationItemUnpacker
- type SuffrageInflationProcessor
- type TransferFactJSONPacker
- type Transfers
- type TransfersFact
- func (fact TransfersFact) Addresses() ([]base.Address, error)
- func (fact TransfersFact) Bytes() []byte
- func (fact TransfersFact) GenerateHash() valuehash.Hash
- func (fact TransfersFact) Hash() valuehash.Hash
- func (fact TransfersFact) IsValid(b []byte) error
- func (fact TransfersFact) Items() []TransfersItem
- func (fact TransfersFact) MarshalBSON() ([]byte, error)
- func (fact TransfersFact) MarshalJSON() ([]byte, error)
- func (fact TransfersFact) Rebuild() TransfersFact
- func (fact TransfersFact) Sender() base.Address
- func (fact TransfersFact) Token() []byte
- func (fact *TransfersFact) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
- func (fact *TransfersFact) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
- type TransfersFactBSONUnpacker
- type TransfersItem
- type TransfersItemJSONPacker
- type TransfersItemMultiAmounts
- type TransfersItemProcessor
- type TransfersItemSingleAmount
- type TransfersProcessor
Constants ¶
View Source
const ( FeeerNil = "nil" FeeerFixed = "fixed" FeeerRatio = "ratio" )
Variables ¶
View Source
var ( AccountType = hint.Type("mitum-currency-account") AccountHint = hint.NewHint(AccountType, "v0.0.1") AccountHinter = Account{BaseHinter: hint.NewBaseHinter(AccountHint)} )
View Source
var ( AddressType = hint.Type("mca") AddressHint = hint.NewHint(AddressType, "v0.0.1") AddressHinter = Address{StringAddress: base.NewStringAddressWithHint(AddressHint, "")} ZeroAddressSuffix = "-X" )
View Source
var ( AmountType = hint.Type("mitum-currency-amount") AmountHint = hint.NewHint(AmountType, "v0.0.1") AmountHinter = Amount{BaseHinter: hint.NewBaseHinter(AmountHint)} )
View Source
var ( NilBig = NewBig(-1) NilBigString = big.NewInt(-1).String() ZeroBig = NewBig(0) )
View Source
var ( CreateAccountsFactType = hint.Type("mitum-currency-create-accounts-operation-fact") CreateAccountsFactHint = hint.NewHint(CreateAccountsFactType, "v0.0.1") CreateAccountsFactHinter = CreateAccountsFact{BaseHinter: hint.NewBaseHinter(CreateAccountsFactHint)} CreateAccountsType = hint.Type("mitum-currency-create-accounts-operation") CreateAccountsHint = hint.NewHint(CreateAccountsType, "v0.0.1") CreateAccountsHinter = CreateAccounts{BaseOperation: operationHinter(CreateAccountsHint)} )
View Source
var ( CreateAccountsItemMultiAmountsType = hint.Type("mitum-currency-create-accounts-multiple-amounts") CreateAccountsItemMultiAmountsHint = hint.NewHint(CreateAccountsItemMultiAmountsType, "v0.0.1") CreateAccountsItemMultiAmountsHinter = CreateAccountsItemMultiAmounts{ BaseCreateAccountsItem: BaseCreateAccountsItem{ BaseHinter: hint.NewBaseHinter(CreateAccountsItemMultiAmountsHint), }, } )
View Source
var ( CreateAccountsItemSingleAmountType = hint.Type("mitum-currency-create-accounts-single-amount") CreateAccountsItemSingleAmountHint = hint.NewHint(CreateAccountsItemSingleAmountType, "v0.0.1") CreateAccountsItemSingleAmountHinter = CreateAccountsItemSingleAmount{ BaseCreateAccountsItem: BaseCreateAccountsItem{ BaseHinter: hint.NewBaseHinter(CreateAccountsItemSingleAmountHint), }, } )
View Source
var ( MinLengthCurrencyID = 3 MaxLengthCurrencyID = 10 ReValidCurrencyID = regexp.MustCompile(`^[A-Z0-9][A-Z0-9_\.\!\$\*\@]*[A-Z0-9]$`) )
View Source
var ( CurrencyDesignType = hint.Type("mitum-currency-currency-design") CurrencyDesignHint = hint.NewHint(CurrencyDesignType, "v0.0.1") CurrencyDesignHinter = CurrencyDesign{BaseHinter: hint.NewBaseHinter(CurrencyDesignHint)} )
View Source
var ( CurrencyPolicyType = hint.Type("mitum-currency-currency-policy") CurrencyPolicyHint = hint.NewHint(CurrencyPolicyType, "v0.0.1") CurrencyPolicyHinter = CurrencyPolicy{BaseHinter: hint.NewBaseHinter(CurrencyPolicyHint)} )
View Source
var ( CurrencyPolicyUpdaterFactType = hint.Type("mitum-currency-currency-policy-updater-operation-fact") CurrencyPolicyUpdaterFactHint = hint.NewHint(CurrencyPolicyUpdaterFactType, "v0.0.1") CurrencyPolicyUpdaterFactHinter = CurrencyPolicyUpdaterFact{ BaseHinter: hint.NewBaseHinter(CurrencyPolicyUpdaterFactHint), } CurrencyPolicyUpdaterType = hint.Type("mitum-currency-currency-policy-updater-operation") CurrencyPolicyUpdaterHint = hint.NewHint(CurrencyPolicyUpdaterType, "v0.0.1") CurrencyPolicyUpdaterHinter = CurrencyPolicyUpdater{BaseOperation: operationHinter(CurrencyPolicyUpdaterHint)} )
View Source
var ( CurrencyRegisterFactType = hint.Type("mitum-currency-currency-register-operation-fact") CurrencyRegisterFactHint = hint.NewHint(CurrencyRegisterFactType, "v0.0.1") CurrencyRegisterFactHinter = CurrencyRegisterFact{BaseHinter: hint.NewBaseHinter(CurrencyRegisterFactHint)} CurrencyRegisterType = hint.Type("mitum-currency-currency-register-operation") CurrencyRegisterHint = hint.NewHint(CurrencyRegisterType, "v0.0.1") CurrencyRegisterHinter = CurrencyRegister{BaseOperation: operationHinter(CurrencyRegisterHint)} )
View Source
var ( FeeOperationFactType = hint.Type("mitum-currency-fee-operation-fact") FeeOperationFactHint = hint.NewHint(FeeOperationFactType, "v0.0.1") FeeOperationFactHinter = FeeOperationFact{BaseHinter: hint.NewBaseHinter(FeeOperationFactHint)} FeeOperationType = hint.Type("mitum-currency-fee-operation") FeeOperationHint = hint.NewHint(FeeOperationType, "v0.0.1") FeeOperationHinter = FeeOperation{BaseHinter: hint.NewBaseHinter(FeeOperationHint)} )
View Source
var ( NilFeeerType = hint.Type("mitum-currency-nil-feeer") NilFeeerHint = hint.NewHint(NilFeeerType, "v0.0.1") NilFeeerHinter = NilFeeer{BaseHinter: hint.NewBaseHinter(NilFeeerHint)} FixedFeeerType = hint.Type("mitum-currency-fixed-feeer") FixedFeeerHint = hint.NewHint(FixedFeeerType, "v0.0.1") FixedFeeerHinter = FixedFeeer{BaseHinter: hint.NewBaseHinter(FixedFeeerHint)} RatioFeeerType = hint.Type("mitum-currency-ratio-feeer") RatioFeeerHint = hint.NewHint(RatioFeeerType, "v0.0.1") RatioFeeerHinter = RatioFeeer{BaseHinter: hint.NewBaseHinter(RatioFeeerHint)} )
View Source
var ( GenesisCurrenciesFactType = hint.Type("mitum-currency-genesis-currencies-operation-fact") GenesisCurrenciesFactHint = hint.NewHint(GenesisCurrenciesFactType, "v0.0.1") GenesisCurrenciesFactHinter = GenesisCurrenciesFact{BaseHinter: hint.NewBaseHinter(GenesisCurrenciesFactHint)} GenesisCurrenciesType = hint.Type("mitum-currency-genesis-currencies-operation") GenesisCurrenciesHint = hint.NewHint(GenesisCurrenciesType, "v0.0.1") GenesisCurrenciesHinter = GenesisCurrencies{BaseOperation: operation.EmptyBaseOperation(GenesisCurrenciesHint)} )
View Source
var ( AccountKeyType = hint.Type("mitum-currency-key") AccountKeyHint = hint.NewHint(AccountKeyType, "v0.0.1") AccountKeyHinter = BaseAccountKey{BaseHinter: hint.NewBaseHinter(AccountKeyHint)} AccountKeysType = hint.Type("mitum-currency-keys") AccountKeysHint = hint.NewHint(AccountKeysType, "v0.0.1") AccountKeysHinter = BaseAccountKeys{BaseHinter: hint.NewBaseHinter(AccountKeysHint)} )
View Source
var ( KeyUpdaterFactType = hint.Type("mitum-currency-keyupdater-operation-fact") KeyUpdaterFactHint = hint.NewHint(KeyUpdaterFactType, "v0.0.1") KeyUpdaterFactHinter = KeyUpdaterFact{BaseHinter: hint.NewBaseHinter(KeyUpdaterFactHint)} KeyUpdaterType = hint.Type("mitum-currency-keyupdater-operation") KeyUpdaterHint = hint.NewHint(KeyUpdaterType, "v0.0.1") KeyUpdaterHinter = KeyUpdater{BaseOperation: operationHinter(KeyUpdaterHint)} )
View Source
var ( StateKeyAccountSuffix = ":account" StateKeyBalanceSuffix = ":balance" StateKeyCurrencyDesignPrefix = "currencydesign:" )
View Source
var ( SuffrageInflationFactType = hint.Type("mitum-currency-suffrage-inflation-operation-fact") SuffrageInflationFactHint = hint.NewHint(SuffrageInflationFactType, "v0.0.1") SuffrageInflationFactHinter = SuffrageInflationFact{BaseHinter: hint.NewBaseHinter(SuffrageInflationFactHint)} SuffrageInflationType = hint.Type("mitum-currency-suffrage-inflation-operation") SuffrageInflationHint = hint.NewHint(SuffrageInflationType, "v0.0.1") SuffrageInflationHinter = SuffrageInflation{BaseOperation: operationHinter(SuffrageInflationHint)} )
View Source
var ( TransfersFactType = hint.Type("mitum-currency-transfers-operation-fact") TransfersFactHint = hint.NewHint(TransfersFactType, "v0.0.1") TransfersFactHinter = TransfersFact{BaseHinter: hint.NewBaseHinter(TransfersFactHint)} TransfersType = hint.Type("mitum-currency-transfers-operation") TransfersHint = hint.NewHint(TransfersType, "v0.0.1") TransfersHinter = Transfers{BaseOperation: operationHinter(TransfersHint)} )
View Source
var ( TransfersItemMultiAmountsType = hint.Type("mitum-currency-transfers-item-multi-amounts") TransfersItemMultiAmountsHint = hint.NewHint(TransfersItemMultiAmountsType, "v0.0.1") TransfersItemMultiAmountsHinter = TransfersItemMultiAmounts{ BaseTransfersItem: BaseTransfersItem{BaseHinter: hint.NewBaseHinter(TransfersItemMultiAmountsHint)}, } )
View Source
var ( TransfersItemSingleAmountType = hint.Type("mitum-currency-transfers-item-single-amount") TransfersItemSingleAmountHint = hint.NewHint(TransfersItemSingleAmountType, "v0.0.1") TransfersItemSingleAmountHinter = TransfersItemSingleAmount{ BaseTransfersItem: BaseTransfersItem{BaseHinter: hint.NewBaseHinter(TransfersItemSingleAmountHint)}, } )
View Source
var MaxAccountKeyInKeys = 10
View Source
var MaxCreateAccountsItems uint = 10
View Source
var MaxMemoSize = 100 // TODO should be managed by policy
View Source
var MaxTransferItems uint = 10
View Source
var UnlimitedMaxFeeAmount = NewBig(-1)
Functions ¶
func CalculateItemsFee ¶
func CalculateItemsFee(cp *CurrencyPool, items []AmountsItem) (map[CurrencyID][2]Big, error)
func CheckEnoughBalance ¶
func CheckEnoughBalance( holder base.Address, required map[CurrencyID][2]Big, getState func(key string) (state.State, bool, error), ) (map[CurrencyID]AmountState, error)
func IsStateAccountKey ¶
func IsStateBalanceKey ¶
func IsValidMemo ¶
func IsValidOperationFact ¶
func IsValidOperationFact(fact operation.OperationFact, b []byte) error
func NewFeeOperationProcessor ¶
func NewFeeOperationProcessor(cp *CurrencyPool, op FeeOperation) state.Processor
func SetStateAccountValue ¶
func SetStateBalanceValue ¶
func SetStateKeysValue ¶
func StateBalanceKeyPrefix ¶
func StateBalanceKeyPrefix(a base.Address, cid CurrencyID) string
func StateKeyAccount ¶
func StateKeyBalance ¶
func StateKeyBalance(a base.Address, cid CurrencyID) string
func StateKeyCurrencyDesign ¶
func StateKeyCurrencyDesign(cid CurrencyID) string
Types ¶
type Account ¶
type Account struct {
hint.BaseHinter
// contains filtered or unexported fields
}
func NewAccount ¶
func NewAccount(address base.Address, keys AccountKeys) (Account, error)
func NewAccountFromKeys ¶
func NewAccountFromKeys(keys AccountKeys) (Account, error)
func ZeroAccount ¶
func ZeroAccount(cid CurrencyID) (Account, error)
func (Account) GenerateHash ¶
func (Account) Keys ¶
func (ac Account) Keys() AccountKeys
func (Account) MarshalBSON ¶
func (Account) MarshalJSON ¶
func (Account) PackerJSON ¶
func (ac Account) PackerJSON() AccountPackerJSON
type AccountBSONUnpacker ¶
type AccountJSONUnpacker ¶
type AccountJSONUnpacker struct {
H valuehash.Bytes `json:"hash"`
AD base.AddressDecoder `json:"address"`
KS json.RawMessage `json:"keys"`
}
type AccountKey ¶
type AccountKeys ¶
type AccountKeys interface {
hint.Hinter
isvalid.IsValider
util.Byter
valuehash.Hasher
Threshold() uint
Keys() []AccountKey
Key(key.Publickey) (AccountKey, bool)
Equal(AccountKeys) bool
}
func StateKeysValue ¶
func StateKeysValue(st state.State) (AccountKeys, error)
type AccountPackerJSON ¶
type AccountPackerJSON struct {
jsonenc.HintedHead
H valuehash.Hash `json:"hash"`
AD base.Address `json:"address"`
KS AccountKeys `json:"keys"`
}
type Address ¶
type Address struct {
base.StringAddress
}
func NewAddress ¶
func NewAddressFromKeys ¶
func NewAddressFromKeys(keys AccountKeys) (Address, error)
func ZeroAddress ¶
func ZeroAddress(cid CurrencyID) Address
func (Address) MarshalBSONValue ¶
func (Address) MarshalText ¶
type Amount ¶
type Amount struct {
hint.BaseHinter
// contains filtered or unexported fields
}
func MustNewAmount ¶
func MustNewAmount(big Big, cid CurrencyID) Amount
func NewAmount ¶
func NewAmount(big Big, cid CurrencyID) Amount
func NewZeroAmount ¶
func NewZeroAmount(cid CurrencyID) Amount
func (Amount) Currency ¶
func (am Amount) Currency() CurrencyID
func (Amount) GenerateHash ¶
func (Amount) MarshalBSON ¶
func (Amount) MarshalJSON ¶
func (*Amount) UnmarshalBSON ¶
func (*Amount) UnmarshalJSON ¶
type AmountBSONPacker ¶
type AmountBSONPacker struct {
CR CurrencyID `bson:"currency"`
BG Big `bson:"amount"`
}
type AmountBSONUnpacker ¶
type AmountJSONPacker ¶
type AmountJSONPacker struct {
jsonenc.HintedHead
BG Big `json:"amount"`
CR CurrencyID `json:"currency"`
}
type AmountJSONUnpacker ¶
type AmountState ¶
func NewAmountState ¶
func NewAmountState(st state.State, cid CurrencyID) AmountState
func (AmountState) Add ¶
func (st AmountState) Add(a Big) AmountState
func (AmountState) AddFee ¶
func (st AmountState) AddFee(fee Big) AmountState
func (AmountState) Clear ¶
func (st AmountState) Clear() state.State
func (AmountState) Currency ¶
func (st AmountState) Currency() CurrencyID
func (AmountState) Fee ¶
func (st AmountState) Fee() Big
func (AmountState) Hint ¶
func (AmountState) Hint() hint.Hint
func (AmountState) IsValid ¶
func (st AmountState) IsValid(b []byte) error
func (AmountState) MarshalBSON ¶
func (st AmountState) MarshalBSON() ([]byte, error)
func (AmountState) MarshalJSON ¶
func (st AmountState) MarshalJSON() ([]byte, error)
func (AmountState) SetOperation ¶
func (st AmountState) SetOperation(ops []valuehash.Hash) state.State
func (AmountState) SetPreviousHeight ¶
func (AmountState) Sub ¶
func (st AmountState) Sub(a Big) AmountState
type AmountsItem ¶
type AmountsItem interface {
Amounts() []Amount
}
type BaseAccountKey ¶
type BaseAccountKey struct {
hint.BaseHinter
// contains filtered or unexported fields
}
func NewBaseAccountKey ¶
func NewBaseAccountKey(k key.Publickey, w uint) (BaseAccountKey, error)
func (BaseAccountKey) Bytes ¶
func (ky BaseAccountKey) Bytes() []byte
func (BaseAccountKey) Equal ¶
func (ky BaseAccountKey) Equal(b AccountKey) bool
func (BaseAccountKey) IsValid ¶
func (ky BaseAccountKey) IsValid([]byte) error
func (BaseAccountKey) Key ¶
func (ky BaseAccountKey) Key() key.Publickey
func (BaseAccountKey) MarshalBSON ¶
func (ky BaseAccountKey) MarshalBSON() ([]byte, error)
func (BaseAccountKey) MarshalJSON ¶
func (ky BaseAccountKey) MarshalJSON() ([]byte, error)
func (*BaseAccountKey) UnpackBSON ¶
func (ky *BaseAccountKey) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
func (*BaseAccountKey) UnpackJSON ¶
func (ky *BaseAccountKey) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
func (BaseAccountKey) Weight ¶
func (ky BaseAccountKey) Weight() uint
type BaseAccountKeys ¶
type BaseAccountKeys struct {
hint.BaseHinter
// contains filtered or unexported fields
}
func EmptyBaseAccountKeys ¶
func EmptyBaseAccountKeys() BaseAccountKeys
func NewBaseAccountKeys ¶
func NewBaseAccountKeys(keys []AccountKey, threshold uint) (BaseAccountKeys, error)
func (BaseAccountKeys) Bytes ¶
func (ks BaseAccountKeys) Bytes() []byte
func (BaseAccountKeys) Equal ¶
func (ks BaseAccountKeys) Equal(b AccountKeys) bool
func (BaseAccountKeys) GenerateHash ¶
func (ks BaseAccountKeys) GenerateHash() (valuehash.Hash, error)
func (BaseAccountKeys) Hash ¶
func (ks BaseAccountKeys) Hash() valuehash.Hash
func (BaseAccountKeys) IsValid ¶
func (ks BaseAccountKeys) IsValid([]byte) error
func (BaseAccountKeys) Key ¶
func (ks BaseAccountKeys) Key(k key.Publickey) (AccountKey, bool)
func (BaseAccountKeys) Keys ¶
func (ks BaseAccountKeys) Keys() []AccountKey
func (BaseAccountKeys) MarshalBSON ¶
func (ks BaseAccountKeys) MarshalBSON() ([]byte, error)
func (BaseAccountKeys) MarshalJSON ¶
func (ks BaseAccountKeys) MarshalJSON() ([]byte, error)
func (BaseAccountKeys) Threshold ¶
func (ks BaseAccountKeys) Threshold() uint
func (*BaseAccountKeys) UnpackBSON ¶
func (ks *BaseAccountKeys) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
func (*BaseAccountKeys) UnpackJSON ¶
func (ks *BaseAccountKeys) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
type BaseCreateAccountsItem ¶
type BaseCreateAccountsItem struct {
hint.BaseHinter
// contains filtered or unexported fields
}
func NewBaseCreateAccountsItem ¶
func NewBaseCreateAccountsItem(ht hint.Hint, keys AccountKeys, amounts []Amount) BaseCreateAccountsItem
func (BaseCreateAccountsItem) Address ¶
func (it BaseCreateAccountsItem) Address() (base.Address, error)
func (BaseCreateAccountsItem) Amounts ¶
func (it BaseCreateAccountsItem) Amounts() []Amount
func (BaseCreateAccountsItem) Bytes ¶
func (it BaseCreateAccountsItem) Bytes() []byte
func (BaseCreateAccountsItem) IsValid ¶
func (it BaseCreateAccountsItem) IsValid([]byte) error
func (BaseCreateAccountsItem) Keys ¶
func (it BaseCreateAccountsItem) Keys() AccountKeys
func (BaseCreateAccountsItem) MarshalBSON ¶
func (it BaseCreateAccountsItem) MarshalBSON() ([]byte, error)
func (BaseCreateAccountsItem) MarshalJSON ¶
func (it BaseCreateAccountsItem) MarshalJSON() ([]byte, error)
func (BaseCreateAccountsItem) Rebuild ¶
func (it BaseCreateAccountsItem) Rebuild() CreateAccountsItem
func (*BaseCreateAccountsItem) UnpackBSON ¶
func (it *BaseCreateAccountsItem) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
func (*BaseCreateAccountsItem) UnpackJSON ¶
func (it *BaseCreateAccountsItem) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
type BaseOperation ¶
type BaseOperation struct {
operation.BaseOperation
Memo string
}
func NewBaseOperationFromFact ¶
func NewBaseOperationFromFact( ht hint.Hint, fact operation.OperationFact, fs []base.FactSign, memo string, ) (BaseOperation, error)
func (BaseOperation) AddFactSigns ¶
func (op BaseOperation) AddFactSigns(fs ...base.FactSign) (base.FactSignUpdater, error)
func (BaseOperation) GenerateHash ¶
func (op BaseOperation) GenerateHash() valuehash.Hash
func (BaseOperation) IsValid ¶
func (op BaseOperation) IsValid(networkID []byte) error
func (BaseOperation) MarshalBSON ¶
func (op BaseOperation) MarshalBSON() ([]byte, error)
func (BaseOperation) MarshalJSON ¶
func (op BaseOperation) MarshalJSON() ([]byte, error)
func (*BaseOperation) UnpackBSON ¶
func (op *BaseOperation) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
func (*BaseOperation) UnpackJSON ¶
func (op *BaseOperation) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
type BaseTransfersItem ¶
type BaseTransfersItem struct {
hint.BaseHinter
// contains filtered or unexported fields
}
func NewBaseTransfersItem ¶
func (BaseTransfersItem) Amounts ¶
func (it BaseTransfersItem) Amounts() []Amount
func (BaseTransfersItem) Bytes ¶
func (it BaseTransfersItem) Bytes() []byte
func (BaseTransfersItem) IsValid ¶
func (it BaseTransfersItem) IsValid([]byte) error
func (BaseTransfersItem) MarshalBSON ¶
func (it BaseTransfersItem) MarshalBSON() ([]byte, error)
func (BaseTransfersItem) MarshalJSON ¶
func (it BaseTransfersItem) MarshalJSON() ([]byte, error)
func (BaseTransfersItem) Rebuild ¶
func (it BaseTransfersItem) Rebuild() TransfersItem
func (BaseTransfersItem) Receiver ¶
func (it BaseTransfersItem) Receiver() base.Address
func (*BaseTransfersItem) UnpackBSON ¶
func (it *BaseTransfersItem) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
func (*BaseTransfersItem) UnpackJSON ¶
func (it *BaseTransfersItem) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
type BaseTransfersItemBSONUnpacker ¶
type BaseTransfersItemBSONUnpacker struct {
RC base.AddressDecoder `bson:"receiver"`
AM bson.Raw `bson:"amounts"`
}
type BaseTransfersItemJSONUnpacker ¶
type BaseTransfersItemJSONUnpacker struct {
RC base.AddressDecoder `json:"receiver"`
AM json.RawMessage `json:"amounts"`
}
type Big ¶
func MustBigFromString ¶
func NewBigFromBigInt ¶
func NewBigFromInterface ¶
func NewBigFromString ¶
func (Big) MarshalJSON ¶
func (Big) MulFloat64 ¶
func (*Big) UnmarshalJSON ¶
type CreateAccounts ¶
type CreateAccounts struct {
BaseOperation
}
func NewCreateAccounts ¶
func NewCreateAccounts(fact CreateAccountsFact, fs []base.FactSign, memo string) (CreateAccounts, error)
func (*CreateAccounts) UnpackBSON ¶
func (op *CreateAccounts) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
func (*CreateAccounts) UnpackJSON ¶
func (op *CreateAccounts) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
type CreateAccountsFact ¶
type CreateAccountsFact struct {
hint.BaseHinter
// contains filtered or unexported fields
}
func NewCreateAccountsFact ¶
func NewCreateAccountsFact(token []byte, sender base.Address, items []CreateAccountsItem) CreateAccountsFact
func (CreateAccountsFact) Addresses ¶
func (fact CreateAccountsFact) Addresses() ([]base.Address, error)
func (CreateAccountsFact) Bytes ¶
func (fact CreateAccountsFact) Bytes() []byte
func (CreateAccountsFact) GenerateHash ¶
func (fact CreateAccountsFact) GenerateHash() valuehash.Hash
func (CreateAccountsFact) Hash ¶
func (fact CreateAccountsFact) Hash() valuehash.Hash
func (CreateAccountsFact) IsValid ¶
func (fact CreateAccountsFact) IsValid(b []byte) error
func (CreateAccountsFact) Items ¶
func (fact CreateAccountsFact) Items() []CreateAccountsItem
func (CreateAccountsFact) MarshalBSON ¶
func (fact CreateAccountsFact) MarshalBSON() ([]byte, error)
func (CreateAccountsFact) MarshalJSON ¶
func (fact CreateAccountsFact) MarshalJSON() ([]byte, error)
func (CreateAccountsFact) Rebuild ¶
func (fact CreateAccountsFact) Rebuild() CreateAccountsFact
func (CreateAccountsFact) Sender ¶
func (fact CreateAccountsFact) Sender() base.Address
func (CreateAccountsFact) Targets ¶
func (fact CreateAccountsFact) Targets() ([]base.Address, error)
func (CreateAccountsFact) Token ¶
func (fact CreateAccountsFact) Token() []byte
func (*CreateAccountsFact) UnpackBSON ¶
func (fact *CreateAccountsFact) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
func (*CreateAccountsFact) UnpackJSON ¶
func (fact *CreateAccountsFact) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
type CreateAccountsFactJSONPacker ¶
type CreateAccountsFactJSONPacker struct {
jsonenc.HintedHead
H valuehash.Hash `json:"hash"`
TK []byte `json:"token"`
SD base.Address `json:"sender"`
IT []CreateAccountsItem `json:"items"`
}
type CreateAccountsFactJSONUnpacker ¶
type CreateAccountsFactJSONUnpacker struct {
H valuehash.Bytes `json:"hash"`
TK []byte `json:"token"`
SD base.AddressDecoder `json:"sender"`
IT json.RawMessage `json:"items"`
}
type CreateAccountsItem ¶
type CreateAccountsItem interface {
hint.Hinter
isvalid.IsValider
AmountsItem
Bytes() []byte
Keys() AccountKeys
Address() (base.Address, error)
Rebuild() CreateAccountsItem
}
type CreateAccountsItemJSONPacker ¶
type CreateAccountsItemJSONPacker struct {
jsonenc.HintedHead
KS AccountKeys `json:"keys"`
AS []Amount `json:"amounts"`
}
type CreateAccountsItemJSONUnpacker ¶
type CreateAccountsItemJSONUnpacker struct {
KS json.RawMessage `json:"keys"`
AM json.RawMessage `json:"amounts"`
}
type CreateAccountsItemMultiAmounts ¶
type CreateAccountsItemMultiAmounts struct {
BaseCreateAccountsItem
}
func NewCreateAccountsItemMultiAmounts ¶
func NewCreateAccountsItemMultiAmounts(keys AccountKeys, amounts []Amount) CreateAccountsItemMultiAmounts
func (CreateAccountsItemMultiAmounts) IsValid ¶
func (it CreateAccountsItemMultiAmounts) IsValid([]byte) error
func (CreateAccountsItemMultiAmounts) Rebuild ¶
func (it CreateAccountsItemMultiAmounts) Rebuild() CreateAccountsItem
type CreateAccountsItemProcessor ¶
type CreateAccountsItemProcessor struct {
// contains filtered or unexported fields
}
func (*CreateAccountsItemProcessor) Close ¶
func (opp *CreateAccountsItemProcessor) Close() error
func (*CreateAccountsItemProcessor) PreProcess ¶
type CreateAccountsItemSingleAmount ¶
type CreateAccountsItemSingleAmount struct {
BaseCreateAccountsItem
}
func NewCreateAccountsItemSingleAmount ¶
func NewCreateAccountsItemSingleAmount(keys AccountKeys, amount Amount) CreateAccountsItemSingleAmount
func (CreateAccountsItemSingleAmount) IsValid ¶
func (it CreateAccountsItemSingleAmount) IsValid([]byte) error
func (CreateAccountsItemSingleAmount) Rebuild ¶
func (it CreateAccountsItemSingleAmount) Rebuild() CreateAccountsItem
type CreateAccountsProcessor ¶
type CreateAccountsProcessor struct {
CreateAccounts
// contains filtered or unexported fields
}
func (*CreateAccountsProcessor) Close ¶
func (opp *CreateAccountsProcessor) Close() error
func (*CreateAccountsProcessor) PreProcess ¶
type CurrencyDesign ¶
type CurrencyDesign struct {
hint.BaseHinter
Amount
// contains filtered or unexported fields
}
func NewCurrencyDesign ¶
func NewCurrencyDesign(amount Amount, genesisAccount base.Address, po CurrencyPolicy) CurrencyDesign
func StateCurrencyDesignValue ¶
func StateCurrencyDesignValue(st state.State) (CurrencyDesign, error)
func (CurrencyDesign) AddAggregate ¶
func (de CurrencyDesign) AddAggregate(b Big) (CurrencyDesign, error)
func (CurrencyDesign) Aggregate ¶
func (de CurrencyDesign) Aggregate() Big
func (CurrencyDesign) Bytes ¶
func (de CurrencyDesign) Bytes() []byte
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
func (*CurrencyDesign) UnpackBSON ¶
func (de *CurrencyDesign) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
func (*CurrencyDesign) UnpackJSON ¶
func (de *CurrencyDesign) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
type CurrencyDesignJSONPacker ¶
type CurrencyDesignJSONPacker struct {
jsonenc.HintedHead
AM Amount `json:"amount"`
GA base.Address `json:"genesis_account"`
PO CurrencyPolicy `json:"policy"`
AG Big `json:"aggregate"`
}
type CurrencyDesignJSONUnpacker ¶
type CurrencyDesignJSONUnpacker struct {
AM Amount `json:"amount"`
GA base.AddressDecoder `json:"genesis_account"`
PO json.RawMessage `json:"policy"`
AG Big `json:"aggregate"`
}
type CurrencyID ¶
type CurrencyID string
func (CurrencyID) Bytes ¶
func (cid CurrencyID) Bytes() []byte
func (CurrencyID) IsValid ¶
func (cid CurrencyID) IsValid([]byte) error
func (CurrencyID) String ¶
func (cid CurrencyID) String() string
type CurrencyPolicy ¶
type CurrencyPolicy struct {
hint.BaseHinter
// contains filtered or unexported fields
}
func NewCurrencyPolicy ¶
func NewCurrencyPolicy(newAccountMinBalance Big, feeer Feeer) CurrencyPolicy
func (CurrencyPolicy) Bytes ¶
func (po CurrencyPolicy) Bytes() []byte
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() Big
func (*CurrencyPolicy) UnpackBSON ¶
func (po *CurrencyPolicy) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
func (*CurrencyPolicy) UnpackJSON ¶
func (po *CurrencyPolicy) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
type CurrencyPolicyJSONPacker ¶
type CurrencyPolicyJSONPacker struct {
jsonenc.HintedHead
MN Big `json:"new_account_min_balance"`
FE Feeer `json:"feeer"`
}
type CurrencyPolicyJSONUnpacker ¶
type CurrencyPolicyJSONUnpacker struct {
MN Big `json:"new_account_min_balance"`
FE json.RawMessage `json:"feeer"`
}
type CurrencyPolicyUpdater ¶
type CurrencyPolicyUpdater struct {
BaseOperation
}
func NewCurrencyPolicyUpdater ¶
func NewCurrencyPolicyUpdater( fact CurrencyPolicyUpdaterFact, fs []base.FactSign, memo string, ) (CurrencyPolicyUpdater, error)
func (*CurrencyPolicyUpdater) UnpackBSON ¶
func (op *CurrencyPolicyUpdater) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
func (*CurrencyPolicyUpdater) UnpackJSON ¶
func (op *CurrencyPolicyUpdater) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
type CurrencyPolicyUpdaterFact ¶
type CurrencyPolicyUpdaterFact struct {
hint.BaseHinter
// contains filtered or unexported fields
}
func NewCurrencyPolicyUpdaterFact ¶
func NewCurrencyPolicyUpdaterFact(token []byte, cid CurrencyID, policy CurrencyPolicy) CurrencyPolicyUpdaterFact
func (CurrencyPolicyUpdaterFact) Bytes ¶
func (fact CurrencyPolicyUpdaterFact) Bytes() []byte
func (CurrencyPolicyUpdaterFact) Currency ¶
func (fact CurrencyPolicyUpdaterFact) Currency() CurrencyID
func (CurrencyPolicyUpdaterFact) GenerateHash ¶
func (fact CurrencyPolicyUpdaterFact) GenerateHash() valuehash.Hash
func (CurrencyPolicyUpdaterFact) Hash ¶
func (fact CurrencyPolicyUpdaterFact) Hash() valuehash.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 (fact CurrencyPolicyUpdaterFact) Policy() CurrencyPolicy
func (CurrencyPolicyUpdaterFact) Token ¶
func (fact CurrencyPolicyUpdaterFact) Token() []byte
func (*CurrencyPolicyUpdaterFact) UnpackBSON ¶
func (fact *CurrencyPolicyUpdaterFact) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
func (*CurrencyPolicyUpdaterFact) UnpackJSON ¶
func (fact *CurrencyPolicyUpdaterFact) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
type CurrencyPolicyUpdaterFactJSONPacker ¶
type CurrencyPolicyUpdaterFactJSONPacker struct {
jsonenc.HintedHead
H valuehash.Hash `json:"hash"`
TK []byte `json:"token"`
CI CurrencyID `json:"currency"`
PO CurrencyPolicy `json:"policy"`
}
type CurrencyPolicyUpdaterProcessor ¶
type CurrencyPolicyUpdaterProcessor struct {
CurrencyPolicyUpdater
// contains filtered or unexported fields
}
func (*CurrencyPolicyUpdaterProcessor) Close ¶
func (opp *CurrencyPolicyUpdaterProcessor) Close() error
func (*CurrencyPolicyUpdaterProcessor) PreProcess ¶
type CurrencyPool ¶
func NewCurrencyPool ¶
func NewCurrencyPool() *CurrencyPool
func (*CurrencyPool) CIDs ¶
func (cp *CurrencyPool) CIDs() []CurrencyID
func (*CurrencyPool) Clear ¶
func (cp *CurrencyPool) Clear()
func (*CurrencyPool) Designs ¶
func (cp *CurrencyPool) Designs() map[CurrencyID]CurrencyDesign
func (*CurrencyPool) Exists ¶
func (cp *CurrencyPool) Exists(cid CurrencyID) bool
func (*CurrencyPool) Feeer ¶
func (cp *CurrencyPool) Feeer(cid CurrencyID) (Feeer, bool)
func (*CurrencyPool) Get ¶
func (cp *CurrencyPool) Get(cid CurrencyID) (CurrencyDesign, bool)
func (*CurrencyPool) Policy ¶
func (cp *CurrencyPool) Policy(cid CurrencyID) (CurrencyPolicy, bool)
func (*CurrencyPool) State ¶
func (cp *CurrencyPool) State(cid CurrencyID) (state.State, bool)
func (*CurrencyPool) States ¶
func (cp *CurrencyPool) States() map[CurrencyID]state.State
func (*CurrencyPool) TraverseDesign ¶
func (cp *CurrencyPool) TraverseDesign(callback func(cid CurrencyID, de CurrencyDesign) bool)
func (*CurrencyPool) TraverseState ¶
func (cp *CurrencyPool) TraverseState(callback func(cid CurrencyID, de state.State) bool)
type CurrencyRegister ¶
type CurrencyRegister struct {
BaseOperation
}
func NewCurrencyRegister ¶
func NewCurrencyRegister(fact CurrencyRegisterFact, fs []base.FactSign, memo string) (CurrencyRegister, error)
func (*CurrencyRegister) UnpackBSON ¶
func (op *CurrencyRegister) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
func (*CurrencyRegister) UnpackJSON ¶
func (op *CurrencyRegister) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
type CurrencyRegisterFact ¶
type CurrencyRegisterFact struct {
hint.BaseHinter
// 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) GenerateHash ¶
func (fact CurrencyRegisterFact) GenerateHash() valuehash.Hash
func (CurrencyRegisterFact) Hash ¶
func (fact CurrencyRegisterFact) Hash() valuehash.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() []byte
func (*CurrencyRegisterFact) UnpackBSON ¶
func (fact *CurrencyRegisterFact) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
func (*CurrencyRegisterFact) UnpackJSON ¶
func (fact *CurrencyRegisterFact) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
type CurrencyRegisterFactJSONPacker ¶
type CurrencyRegisterFactJSONPacker struct {
jsonenc.HintedHead
H valuehash.Hash `json:"hash"`
TK []byte `json:"token"`
CR CurrencyDesign `json:"currency"`
}
type CurrencyRegisterFactJSONUnpacker ¶
type CurrencyRegisterFactJSONUnpacker struct {
H valuehash.Bytes `json:"hash"`
TK []byte `json:"token"`
CR json.RawMessage `json:"currency"`
}
type CurrencyRegisterProcessor ¶
type CurrencyRegisterProcessor struct {
CurrencyRegister
// contains filtered or unexported fields
}
func (*CurrencyRegisterProcessor) Close ¶
func (opp *CurrencyRegisterProcessor) Close() error
func (*CurrencyRegisterProcessor) PreProcess ¶
type DuplicationType ¶
type DuplicationType string
const ( DuplicationTypeSender DuplicationType = "sender" DuplicationTypeCurrency DuplicationType = "currency" )
type FeeOperation ¶
type FeeOperation struct {
hint.BaseHinter
// contains filtered or unexported fields
}
func NewFeeOperation ¶
func NewFeeOperation(fact FeeOperationFact) FeeOperation
func (FeeOperation) AddFactSigns ¶
func (FeeOperation) AddFactSigns(...base.FactSign) (base.FactSignUpdater, error)
func (FeeOperation) Fact ¶
func (op FeeOperation) Fact() base.Fact
func (FeeOperation) GenerateHash ¶
func (op FeeOperation) GenerateHash() valuehash.Hash
func (FeeOperation) Hash ¶
func (op FeeOperation) Hash() valuehash.Hash
func (FeeOperation) IsValid ¶
func (op FeeOperation) IsValid([]byte) error
func (FeeOperation) LastSignedAt ¶
func (FeeOperation) LastSignedAt() time.Time
func (FeeOperation) MarshalBSON ¶
func (op FeeOperation) MarshalBSON() ([]byte, error)
func (FeeOperation) MarshalJSON ¶
func (op FeeOperation) MarshalJSON() ([]byte, error)
func (FeeOperation) Signs ¶
func (FeeOperation) Signs() []base.FactSign
func (*FeeOperation) UnpackBSON ¶
func (op *FeeOperation) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
func (*FeeOperation) UnpackJSON ¶
func (op *FeeOperation) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
type FeeOperationFact ¶
type FeeOperationFact struct {
hint.BaseHinter
// contains filtered or unexported fields
}
func NewFeeOperationFact ¶
func NewFeeOperationFact(height base.Height, ams map[CurrencyID]Big) FeeOperationFact
func (FeeOperationFact) Amounts ¶
func (fact FeeOperationFact) Amounts() []Amount
func (FeeOperationFact) Bytes ¶
func (fact FeeOperationFact) Bytes() []byte
func (FeeOperationFact) Hash ¶
func (fact FeeOperationFact) Hash() valuehash.Hash
func (FeeOperationFact) IsValid ¶
func (fact FeeOperationFact) IsValid([]byte) error
func (FeeOperationFact) MarshalBSON ¶
func (fact FeeOperationFact) MarshalBSON() ([]byte, error)
func (FeeOperationFact) MarshalJSON ¶
func (fact FeeOperationFact) MarshalJSON() ([]byte, error)
func (FeeOperationFact) Token ¶
func (fact FeeOperationFact) Token() []byte
func (*FeeOperationFact) UnpackBSON ¶
func (fact *FeeOperationFact) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
func (*FeeOperationFact) UnpackJSON ¶
func (fact *FeeOperationFact) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
type FeeOperationFactJSONUnpacker ¶
type FeeOperationFactJSONUnpacker struct {
H valuehash.Bytes `json:"hash"`
TK []byte `json:"token"`
AM json.RawMessage `json:"amounts"`
}
type FeeOperationJSONPacker ¶
type FeeOperationJSONPacker struct {
jsonenc.HintedHead
H valuehash.Hash `json:"hash"`
FT FeeOperationFact `json:"fact"`
}
type FeeOperationJSONUnpacker ¶
type FeeOperationJSONUnpacker struct {
H valuehash.Bytes `json:"hash"`
FT json.RawMessage `json:"fact"`
}
type FeeOperationProcessor ¶
type FeeOperationProcessor struct {
FeeOperation
// contains filtered or unexported fields
}
type FixedFeeer ¶
type FixedFeeer struct {
hint.BaseHinter
// contains filtered or unexported fields
}
func NewFixedFeeer ¶
func NewFixedFeeer(receiver base.Address, amount Big) FixedFeeer
func (FixedFeeer) Bytes ¶
func (fa FixedFeeer) Bytes() []byte
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() Big
func (FixedFeeer) Receiver ¶
func (fa FixedFeeer) Receiver() base.Address
func (FixedFeeer) Type ¶
func (FixedFeeer) Type() string
func (*FixedFeeer) UnpackBSON ¶
func (fa *FixedFeeer) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
func (*FixedFeeer) UnpackJSON ¶
func (fa *FixedFeeer) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
type FixedFeeerBSONUnpacker ¶
type FixedFeeerBSONUnpacker struct {
HT hint.Hint `bson:"_hint"`
RC base.AddressDecoder `bson:"receiver"`
AM Big `bson:"amount"`
}
type FixedFeeerJSONPacker ¶
type FixedFeeerJSONPacker struct {
jsonenc.HintedHead
RC base.Address `json:"receiver"`
AM Big `json:"amount"`
}
type FixedFeeerJSONUnpacker ¶
type FixedFeeerJSONUnpacker struct {
HT hint.Hint `json:"_hint"`
RC base.AddressDecoder `json:"receiver"`
AM Big `json:"amount"`
}
type GenesisCurrencies ¶
type GenesisCurrencies struct {
operation.BaseOperation
}
func NewGenesisCurrencies ¶
func NewGenesisCurrencies( genesisNodeKey key.Privatekey, keys AccountKeys, cs []CurrencyDesign, networkID base.NetworkID, ) (GenesisCurrencies, 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) UnpackBSON ¶
func (op *GenesisCurrencies) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
func (*GenesisCurrencies) UnpackJSON ¶
func (op *GenesisCurrencies) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
type GenesisCurrenciesFact ¶
type GenesisCurrenciesFact struct {
hint.BaseHinter
// contains filtered or unexported fields
}
func NewGenesisCurrenciesFact ¶
func NewGenesisCurrenciesFact( token []byte, genesisNodeKey key.Publickey, keys 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) GenerateHash ¶
func (fact GenesisCurrenciesFact) GenerateHash() valuehash.Hash
func (GenesisCurrenciesFact) GenesisNodeKey ¶
func (fact GenesisCurrenciesFact) GenesisNodeKey() key.Publickey
func (GenesisCurrenciesFact) Hash ¶
func (fact GenesisCurrenciesFact) Hash() valuehash.Hash
func (GenesisCurrenciesFact) IsValid ¶
func (fact GenesisCurrenciesFact) IsValid(b []byte) error
func (GenesisCurrenciesFact) Keys ¶
func (fact GenesisCurrenciesFact) Keys() AccountKeys
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() []byte
func (*GenesisCurrenciesFact) UnpackBSON ¶
func (fact *GenesisCurrenciesFact) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
func (*GenesisCurrenciesFact) UnpackJSON ¶
func (fact *GenesisCurrenciesFact) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
type GenesisCurrenciesFactJSONPacker ¶
type GenesisCurrenciesFactJSONPacker struct {
jsonenc.HintedHead
H valuehash.Hash `json:"hash"`
TK []byte `json:"token"`
GK key.Publickey `json:"genesis_node_key"`
KS AccountKeys `json:"keys"`
CS []CurrencyDesign `json:"currencies"`
}
type GenesisCurrenciesFactJSONUnpacker ¶
type GenesisCurrenciesFactJSONUnpacker struct {
H valuehash.Bytes `json:"hash"`
TK []byte `json:"token"`
GK key.PublickeyDecoder `json:"genesis_node_key"`
KS json.RawMessage `json:"keys"`
CS json.RawMessage `json:"currencies"`
}
type GetNewProcessor ¶
func NewCreateAccountsProcessor ¶
func NewCreateAccountsProcessor(cp *CurrencyPool) GetNewProcessor
func NewCurrencyPolicyUpdaterProcessor ¶
func NewCurrencyPolicyUpdaterProcessor( cp *CurrencyPool, pubs []key.Publickey, threshold base.Threshold, ) GetNewProcessor
func NewCurrencyRegisterProcessor ¶
func NewCurrencyRegisterProcessor(cp *CurrencyPool, pubs []key.Publickey, threshold base.Threshold) GetNewProcessor
func NewKeyUpdaterProcessor ¶
func NewKeyUpdaterProcessor(cp *CurrencyPool) GetNewProcessor
func NewSuffrageInflationProcessor ¶
func NewSuffrageInflationProcessor(cp *CurrencyPool, pubs []key.Publickey, threshold base.Threshold) GetNewProcessor
func NewTransfersProcessor ¶
func NewTransfersProcessor(cp *CurrencyPool) GetNewProcessor
type KeyBSONUnpacker ¶
type KeyBSONUnpacker struct {
W uint `bson:"weight"`
K key.PublickeyDecoder `bson:"key"`
}
type KeyJSONPacker ¶
type KeyJSONPacker struct {
jsonenc.HintedHead
W uint `json:"weight"`
K key.Publickey `json:"key"`
}
type KeyJSONUnpacker ¶
type KeyJSONUnpacker struct {
W uint `json:"weight"`
K key.PublickeyDecoder `json:"key"`
}
type KeyUpdater ¶
type KeyUpdater struct {
BaseOperation
}
func NewKeyUpdater ¶
func NewKeyUpdater(fact KeyUpdaterFact, fs []base.FactSign, memo string) (KeyUpdater, error)
func (*KeyUpdater) UnpackBSON ¶
func (op *KeyUpdater) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
func (*KeyUpdater) UnpackJSON ¶
func (op *KeyUpdater) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
type KeyUpdaterFact ¶
type KeyUpdaterFact struct {
hint.BaseHinter
// contains filtered or unexported fields
}
func NewKeyUpdaterFact ¶
func NewKeyUpdaterFact(token []byte, target base.Address, keys AccountKeys, currency CurrencyID) KeyUpdaterFact
func (KeyUpdaterFact) Bytes ¶
func (fact KeyUpdaterFact) Bytes() []byte
func (KeyUpdaterFact) Currency ¶
func (fact KeyUpdaterFact) Currency() CurrencyID
func (KeyUpdaterFact) GenerateHash ¶
func (fact KeyUpdaterFact) GenerateHash() valuehash.Hash
func (KeyUpdaterFact) Hash ¶
func (fact KeyUpdaterFact) Hash() valuehash.Hash
func (KeyUpdaterFact) IsValid ¶
func (fact KeyUpdaterFact) IsValid(b []byte) error
func (KeyUpdaterFact) Keys ¶
func (fact KeyUpdaterFact) Keys() AccountKeys
func (KeyUpdaterFact) MarshalBSON ¶
func (fact KeyUpdaterFact) MarshalBSON() ([]byte, error)
func (KeyUpdaterFact) MarshalJSON ¶
func (fact KeyUpdaterFact) MarshalJSON() ([]byte, error)
func (KeyUpdaterFact) Target ¶
func (fact KeyUpdaterFact) Target() base.Address
func (KeyUpdaterFact) Token ¶
func (fact KeyUpdaterFact) Token() []byte
func (*KeyUpdaterFact) UnpackBSON ¶
func (fact *KeyUpdaterFact) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
func (*KeyUpdaterFact) UnpackJSON ¶
func (fact *KeyUpdaterFact) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
type KeyUpdaterFactJSONPacker ¶
type KeyUpdaterFactJSONPacker struct {
jsonenc.HintedHead
H valuehash.Hash `json:"hash"`
TK []byte `json:"token"`
TG base.Address `json:"target"`
KS AccountKeys `json:"keys"`
CR CurrencyID `json:"currency"`
}
type KeyUpdaterFactJSONUnpacker ¶
type KeyUpdaterFactJSONUnpacker struct {
H valuehash.Bytes `json:"hash"`
TK []byte `json:"token"`
TG base.AddressDecoder `json:"target"`
KS json.RawMessage `json:"keys"`
CR string `json:"currency"`
}
type KeyUpdaterProcessor ¶
type KeyUpdaterProcessor struct {
KeyUpdater
// contains filtered or unexported fields
}
func (*KeyUpdaterProcessor) Close ¶
func (opp *KeyUpdaterProcessor) Close() error
func (*KeyUpdaterProcessor) PreProcess ¶
type KeysBSONUnpacker ¶
type KeysJSONPacker ¶
type KeysJSONPacker struct {
jsonenc.HintedHead
H valuehash.Hash `json:"hash"`
KS []AccountKey `json:"keys"`
TH uint `json:"threshold"`
}
type KeysJSONUnpacker ¶
type KeysJSONUnpacker struct {
H valuehash.Bytes `json:"hash"`
KS json.RawMessage `json:"keys"`
TH uint `json:"threshold"`
}
type MemoBSONUnpacker ¶
type MemoBSONUnpacker struct {
Memo string `bson:"memo"`
}
type MemoJSONUnpacker ¶
type MemoJSONUnpacker struct {
Memo string `json:"memo"`
}
type NilFeeer ¶
type NilFeeer struct {
hint.BaseHinter
}
func NewNilFeeer ¶
func NewNilFeeer() NilFeeer
func (NilFeeer) MarshalBSON ¶
func (NilFeeer) MarshalJSON ¶
func (*NilFeeer) UnmarsahlBSON ¶
func (*NilFeeer) UnmarsahlJSON ¶
type OperationProcessor ¶
type OperationProcessor struct {
sync.RWMutex
*logging.Logging
// contains filtered or unexported fields
}
func NewOperationProcessor ¶
func NewOperationProcessor(cp *CurrencyPool) *OperationProcessor
func (*OperationProcessor) Cancel ¶
func (opr *OperationProcessor) Cancel() error
func (*OperationProcessor) Close ¶
func (opr *OperationProcessor) Close() error
func (*OperationProcessor) New ¶
func (opr *OperationProcessor) New(pool *storage.Statepool) prprocessor.OperationProcessor
func (*OperationProcessor) PreProcess ¶
func (*OperationProcessor) Process ¶
func (opr *OperationProcessor) Process(op state.Processor) error
func (*OperationProcessor) SetProcessor ¶
func (opr *OperationProcessor) SetProcessor( hinter hint.Hinter, newProcessor GetNewProcessor, ) (prprocessor.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 Big) RatioFeeer
func (RatioFeeer) Bytes ¶
func (fa RatioFeeer) Bytes() []byte
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() Big
func (RatioFeeer) Receiver ¶
func (fa RatioFeeer) Receiver() base.Address
func (RatioFeeer) Type ¶
func (RatioFeeer) Type() string
func (*RatioFeeer) UnpackBSON ¶
func (fa *RatioFeeer) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
func (*RatioFeeer) UnpackJSON ¶
func (fa *RatioFeeer) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
type RatioFeeerBSONUnpacker ¶
type RatioFeeerJSONPacker ¶
type RatioFeeerJSONUnpacker ¶
type SuffrageInflation ¶
type SuffrageInflation struct {
BaseOperation
}
func NewSuffrageInflation ¶
func NewSuffrageInflation(fact SuffrageInflationFact, fs []base.FactSign, memo string) (SuffrageInflation, error)
func (*SuffrageInflation) UnpackBSON ¶
func (op *SuffrageInflation) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
func (*SuffrageInflation) UnpackJSON ¶
func (op *SuffrageInflation) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
type SuffrageInflationFact ¶
type SuffrageInflationFact struct {
hint.BaseHinter
// contains filtered or unexported fields
}
func NewSuffrageInflationFact ¶
func NewSuffrageInflationFact(token []byte, items []SuffrageInflationItem) SuffrageInflationFact
func (SuffrageInflationFact) Bytes ¶
func (fact SuffrageInflationFact) Bytes() []byte
func (SuffrageInflationFact) GenerateHash ¶
func (fact SuffrageInflationFact) GenerateHash() valuehash.Hash
func (SuffrageInflationFact) Hash ¶
func (fact SuffrageInflationFact) Hash() valuehash.Hash
func (SuffrageInflationFact) IsValid ¶
func (fact SuffrageInflationFact) IsValid(b []byte) error
func (SuffrageInflationFact) Items ¶
func (fact SuffrageInflationFact) Items() []SuffrageInflationItem
func (SuffrageInflationFact) MarshalBSON ¶
func (fact SuffrageInflationFact) MarshalBSON() ([]byte, error)
func (SuffrageInflationFact) MarshalJSON ¶
func (fact SuffrageInflationFact) MarshalJSON() ([]byte, error)
func (SuffrageInflationFact) Token ¶
func (fact SuffrageInflationFact) Token() []byte
func (*SuffrageInflationFact) UnpackBSON ¶
func (fact *SuffrageInflationFact) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
func (*SuffrageInflationFact) UnpackJSON ¶
func (fact *SuffrageInflationFact) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
type SuffrageInflationFactJSONPacker ¶
type SuffrageInflationFactJSONPacker struct {
jsonenc.HintedHead
H valuehash.Hash `json:"hash"`
TK []byte `json:"token"`
IS []SuffrageInflationItem `json:"items"`
}
type SuffrageInflationFactJSONUnpacker ¶
type SuffrageInflationFactJSONUnpacker struct {
H valuehash.Bytes `json:"hash"`
TK []byte `json:"token"`
IS []json.RawMessage `json:"items"`
}
type SuffrageInflationItem ¶
type SuffrageInflationItem struct {
// contains filtered or unexported fields
}
func NewSuffrageInflationItem ¶
func NewSuffrageInflationItem(receiver base.Address, amount Amount) SuffrageInflationItem
func (SuffrageInflationItem) Bytes ¶
func (item SuffrageInflationItem) Bytes() []byte
func (SuffrageInflationItem) IsValid ¶
func (item SuffrageInflationItem) IsValid([]byte) error
func (SuffrageInflationItem) MarshalBSON ¶
func (item SuffrageInflationItem) MarshalBSON() ([]byte, error)
func (SuffrageInflationItem) MarshalJSON ¶
func (item SuffrageInflationItem) MarshalJSON() ([]byte, error)
type SuffrageInflationItemUnpacker ¶
type SuffrageInflationItemUnpacker struct {
RC base.AddressDecoder `bson:"receiver" json:"receiver"`
AM Amount `bson:"amount" json:"amount"`
}
type SuffrageInflationProcessor ¶
type SuffrageInflationProcessor struct {
SuffrageInflation
// contains filtered or unexported fields
}
func (*SuffrageInflationProcessor) Close ¶
func (opp *SuffrageInflationProcessor) Close() error
func (*SuffrageInflationProcessor) PreProcess ¶
type TransferFactJSONPacker ¶
type TransferFactJSONPacker struct {
jsonenc.HintedHead
H valuehash.Hash `json:"hash"`
TK []byte `json:"token"`
SD base.Address `json:"sender"`
IT []TransfersItem `json:"items"`
}
type Transfers ¶
type Transfers struct {
BaseOperation
}
func NewTransfers ¶
func (*Transfers) UnpackBSON ¶
type TransfersFact ¶
type TransfersFact struct {
hint.BaseHinter
// contains filtered or unexported fields
}
func NewTransfersFact ¶
func NewTransfersFact(token []byte, sender base.Address, items []TransfersItem) TransfersFact
func (TransfersFact) Bytes ¶
func (fact TransfersFact) Bytes() []byte
func (TransfersFact) GenerateHash ¶
func (fact TransfersFact) GenerateHash() valuehash.Hash
func (TransfersFact) Hash ¶
func (fact TransfersFact) Hash() valuehash.Hash
func (TransfersFact) IsValid ¶
func (fact TransfersFact) IsValid(b []byte) error
func (TransfersFact) Items ¶
func (fact TransfersFact) Items() []TransfersItem
func (TransfersFact) MarshalBSON ¶
func (fact TransfersFact) MarshalBSON() ([]byte, error)
func (TransfersFact) MarshalJSON ¶
func (fact TransfersFact) MarshalJSON() ([]byte, error)
func (TransfersFact) Rebuild ¶
func (fact TransfersFact) Rebuild() TransfersFact
func (TransfersFact) Sender ¶
func (fact TransfersFact) Sender() base.Address
func (TransfersFact) Token ¶
func (fact TransfersFact) Token() []byte
func (*TransfersFact) UnpackBSON ¶
func (fact *TransfersFact) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
func (*TransfersFact) UnpackJSON ¶
func (fact *TransfersFact) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
type TransfersItem ¶
type TransfersItem interface {
hint.Hinter
isvalid.IsValider
AmountsItem
Bytes() []byte
Receiver() base.Address
Rebuild() TransfersItem
}
type TransfersItemJSONPacker ¶
type TransfersItemJSONPacker struct {
jsonenc.HintedHead
RC base.Address `json:"receiver"`
AM []Amount `json:"amounts"`
}
type TransfersItemMultiAmounts ¶
type TransfersItemMultiAmounts struct {
BaseTransfersItem
}
func NewTransfersItemMultiAmounts ¶
func NewTransfersItemMultiAmounts(receiver base.Address, amounts []Amount) TransfersItemMultiAmounts
func (TransfersItemMultiAmounts) IsValid ¶
func (it TransfersItemMultiAmounts) IsValid([]byte) error
func (TransfersItemMultiAmounts) Rebuild ¶
func (it TransfersItemMultiAmounts) Rebuild() TransfersItem
type TransfersItemProcessor ¶
type TransfersItemProcessor struct {
// contains filtered or unexported fields
}
func (*TransfersItemProcessor) Close ¶
func (opp *TransfersItemProcessor) Close() error
func (*TransfersItemProcessor) PreProcess ¶
type TransfersItemSingleAmount ¶
type TransfersItemSingleAmount struct {
BaseTransfersItem
}
func NewTransfersItemSingleAmount ¶
func NewTransfersItemSingleAmount(receiver base.Address, amount Amount) TransfersItemSingleAmount
func (TransfersItemSingleAmount) IsValid ¶
func (it TransfersItemSingleAmount) IsValid([]byte) error
func (TransfersItemSingleAmount) Rebuild ¶
func (it TransfersItemSingleAmount) Rebuild() TransfersItem
type TransfersProcessor ¶
type TransfersProcessor struct {
Transfers
// contains filtered or unexported fields
}
func (*TransfersProcessor) Close ¶
func (opp *TransfersProcessor) Close() error
func (*TransfersProcessor) PreProcess ¶
Source Files
¶
- account.go
- account_bson.go
- account_encode.go
- account_json.go
- address.go
- address_bson.go
- address_json.go
- amount.go
- amount_bson.go
- amount_json.go
- amount_state.go
- amount_state_bson.go
- amount_state_json.go
- big.go
- big_bson.go
- big_json.go
- create_accounts.go
- create_accounts_bson.go
- create_accounts_encode.go
- create_accounts_item.go
- create_accounts_item_bson.go
- create_accounts_item_encode.go
- create_accounts_item_json.go
- create_accounts_json.go
- create_accounts_multi_amounts.go
- create_accounts_process.go
- create_accounts_single_amount.go
- currency.go
- currency_design.go
- currency_design_bson.go
- currency_design_encode.go
- currency_design_json.go
- currency_policy.go
- currency_policy_bson.go
- currency_policy_encode.go
- currency_policy_json.go
- currency_policy_updater.go
- currency_policy_updater_bson.go
- currency_policy_updater_encode.go
- currency_policy_updater_json.go
- currency_policy_updater_process.go
- currency_pool.go
- currency_register.go
- currency_register_bson.go
- currency_register_encode.go
- currency_register_json.go
- currency_register_process.go
- doc.go
- fee.go
- fee_bson.go
- fee_encode.go
- fee_json.go
- feeer.go
- feeer_bson.go
- feeer_encode.go
- feeer_json.go
- genesis_currencies.go
- genesis_currencies_bson.go
- genesis_currencies_encode.go
- genesis_currencies_json.go
- genesis_currencies_process.go
- keys.go
- keys_bson.go
- keys_encode.go
- keys_json.go
- keyupdater.go
- keyupdater_bson.go
- keyupdater_encode.go
- keyupdater_json.go
- keyupdater_process.go
- memo.go
- operation.go
- operation_bson.go
- operation_json.go
- operation_processor.go
- signs.go
- state.go
- suffrage_inflation.go
- suffrage_inflation_bson.go
- suffrage_inflation_encode.go
- suffrage_inflation_json.go
- suffrage_inflation_process.go
- transfers.go
- transfers_bson.go
- transfers_encode.go
- transfers_item.go
- transfers_item_bson.go
- transfers_item_json.go
- transfers_json.go
- transfers_multi_amounts.go
- transfers_process.go
- transfers_single_amount.go
Click to show internal directories.
Click to hide internal directories.