types

package
v3.0.0-alpha.0...-07d934f Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: GPL-3.0 Imports: 26 Imported by: 27

Documentation

Index

Constants

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

Variables

View Source
var (
	AddressHint       = hint.MustNewHint("mca-v0.0.1")
	EthAddressHint    = hint.MustNewHint("eca-v0.0.1")
	ZeroAddressSuffix = "-X"
)
View Source
var (
	MaxAddressSize = 100
	MinAddressSize = base.AddressTypeSize + 3

	REStringAddressString = `[a-zA-Z0-9][\w\-\.\!\$\*\@]*[a-zA-Z0-9]`
)
View Source
var (
	MinLengthContractID = 3
	MaxLengthContractID = 50
	REContractIDExp     = regexp.MustCompile(`^[A-Z0-9][A-Z0-9-_\.\!\$\*\@]*[A-Z0-9]$`)
)
View Source
var (
	MinLengthCurrencyID = 3
	MaxLengthCurrencyID = 10
	ReValidCurrencyID   = regexp.MustCompile(`^[A-Z0-9][A-Z0-9_\.\!\$\*\@]*[A-Z0-9]$`)
	ReSpcecialChar      = regexp.MustCompile(`^[^\s:/?#\[\]@]*$`)
)
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 (
	AccountKeyHint     = hint.MustNewHint("mitum-currency-key-v0.0.1")
	AccountKeysHint    = hint.MustNewHint("mitum-currency-keys-v0.0.1")
	EthAccountKeysHint = hint.MustNewHint("mitum-currency-eth-keys-v0.0.1")
	NilAccountKeysHint = hint.MustNewHint("mitum-currency-nil-keys-v0.0.1")
)
View Source
var (
	NetworkPolicyHint           = hint.MustNewHint("currency-network-policy-v0.0.1")
	NetworkPolicyStateValueHint = hint.MustNewHint("currency-network-policy-state-value-v0.0.1")

	DefaultMaxOperationsInProposal uint64 = 333
	DefaultMaxSuffrageSize         uint64 = 33

	// NOTE suffrage candidate can be approved within lifespan height; almost 15
	// days(based on 5 second for one block)
	DefaultSuffrageCandidateLifespan base.Height = 1 << 18
	DefaultSuffrageExpelLifespan                 = base.Height(333) //nolint:gomnd //...
	DefaultEmptyProposalNoBlock                  = false
)
View Source
var (
	MEPrivatekeyHint = hint.MustNewHint("epr-v0.0.1")
	MEPublickeyHint  = hint.MustNewHint("epu-v0.0.1")
)
View Source
var (
	AccountHint = hint.MustNewHint("mitum-currency-account-v0.0.1")
)
View Source
var (
	AmountHint = hint.MustNewHint("mitum-currency-amount-v0.0.1")
)
View Source
var ContractAccountKeysHint = hint.MustNewHint("mitum-currency-contract-account-keys-v0.0.1")
View Source
var ContractAccountStatusHint = hint.MustNewHint("mitum-currency-contract-account-status-v0.0.1")
View Source
var (
	CurrencyDesignHint = hint.MustNewHint("mitum-currency-currency-design-v0.0.1")
)
View Source
var (
	CurrencyPolicyHint = hint.MustNewHint("mitum-currency-currency-policy-v0.0.1")
)
View Source
var MaxAccountKeyInKeys = 10
View Source
var StringAddressHint = hint.MustNewHint("sas-v2")
View Source
var UnlimitedMaxFeeAmount = common.NewBig(-1)

Functions

func CheckThreshold

func CheckThreshold(fs []base.Sign, keys AccountKeys) error

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 NewEthAccountFromKeys

func NewEthAccountFromKeys(keys AccountKeys) (Account, error)

func ZeroAccount

func ZeroAccount(cid CurrencyID) (Account, error)

func (Account) Address

func (ac Account) Address() base.Address

func (Account) Bytes

func (ac Account) Bytes() []byte

func (*Account) DecodeBSON

func (ac *Account) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*Account) DecodeJSON

func (ac *Account) DecodeJSON(b []byte, enc encoder.Encoder) error

func (Account) EncodeJSON

func (ac Account) EncodeJSON() AccountJSONMarshaler

func (Account) GenerateHash

func (ac Account) GenerateHash() util.Hash

func (Account) Hash

func (ac Account) Hash() util.Hash

func (Account) IsValid

func (ac Account) IsValid([]byte) error

func (Account) Keys

func (ac Account) Keys() AccountKeys

func (Account) MarshalBSON

func (ac Account) MarshalBSON() ([]byte, error)

func (Account) MarshalJSON

func (ac Account) MarshalJSON() ([]byte, error)

func (Account) SetKeys

func (ac Account) SetKeys(keys AccountKeys) (Account, error)

type AccountBSONUnmarshaler

type AccountBSONUnmarshaler struct {
	Hint    string          `bson:"_hint"`
	Hash    valuehash.Bytes `bson:"hash"`
	Address string          `bson:"address"`
	Keys    bson.Raw        `bson:"keys"`
}

type AccountJSONMarshaler

type AccountJSONMarshaler struct {
	hint.BaseHinter
	Hash    util.Hash    `json:"hash"`
	Address base.Address `json:"address"`
	Keys    AccountKeys  `json:"keys"`
}

type AccountJSONUnmarshaler

type AccountJSONUnmarshaler struct {
	Hint    hint.Hint             `json:"_hint"`
	Hash    valuehash.HashDecoder `json:"hash"`
	Address string                `json:"address"`
	Keys    json.RawMessage       `json:"keys"`
}

type AccountKey

type AccountKey interface {
	hint.Hinter
	util.IsValider
	util.Byter
	Key() base.Publickey
	Weight() uint
	Equal(AccountKey) bool
}

type AccountKeys

type AccountKeys interface {
	hint.Hinter
	util.IsValider
	util.Byter
	util.Hasher
	Threshold() uint
	Keys() []AccountKey
	Key(base.Publickey) (AccountKey, bool)
	Equal(AccountKeys) bool
}

func NewNilAccountKeys

func NewNilAccountKeys(pub base.Publickey) (AccountKeys, error)

func NewNilAccountKeysFromAddress

func NewNilAccountKeysFromAddress(addr base.Address) (AccountKeys, error)

type AddFee

type AddFee map[CurrencyID][2]common.Big

func (AddFee) Add

func (af AddFee) Add(key CurrencyID, add common.Big) AddFee

func (AddFee) Fee

func (af AddFee) Fee(key CurrencyID, fee common.Big) AddFee

type Address

type Address struct {
	base.BaseStringAddress
}

func NewAddress

func NewAddress(s string) Address

func NewAddressFromKeys

func NewAddressFromKeys(keys AccountKeys) (Address, error)

func ZeroAddress

func ZeroAddress(cid CurrencyID) Address

func (*Address) DecodeBSON

func (ca *Address) DecodeBSON(b []byte, _ *bsonenc.Encoder) error

func (*Address) DecodeJSON

func (ca *Address) DecodeJSON(b []byte, _ encoder.Encoder) error

func (Address) IsValid

func (ca Address) IsValid([]byte) error

func (Address) MarshalBSONValue

func (ca Address) MarshalBSONValue() (bsontype.Type, []byte, error)

func (Address) MarshalText

func (ca Address) MarshalText() ([]byte, error)

type Addresses

type Addresses interface {
	Addresses() ([]base.Address, error)
}

type Amount

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

func MustNewAmount

func MustNewAmount(big common.Big, cid CurrencyID) Amount

func NewAmount

func NewAmount(big common.Big, cid CurrencyID) Amount

func NewZeroAmount

func NewZeroAmount(cid CurrencyID) Amount

func (Amount) Big

func (am Amount) Big() common.Big

func (Amount) Bytes

func (am Amount) Bytes() []byte

func (Amount) Currency

func (am Amount) Currency() CurrencyID

func (*Amount) DecodeBSON

func (am *Amount) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*Amount) DecodeJSON

func (am *Amount) DecodeJSON(b []byte, enc encoder.Encoder) error

func (Amount) Equal

func (am Amount) Equal(b Amount) bool

func (Amount) GenerateHash

func (am Amount) GenerateHash() util.Hash

func (Amount) Hash

func (am Amount) Hash() util.Hash

func (Amount) IsEmpty

func (am Amount) IsEmpty() bool

func (Amount) IsValid

func (am Amount) IsValid([]byte) error

func (Amount) MarshalBSON

func (am Amount) MarshalBSON() ([]byte, error)

func (Amount) MarshalJSON

func (am Amount) MarshalJSON() ([]byte, error)

func (Amount) String

func (am Amount) String() string

func (Amount) WithBig

func (am Amount) WithBig(big common.Big) Amount

type AmountBSONUnmarshaler

type AmountBSONUnmarshaler struct {
	Hint      string `bson:"_hint"`
	Currency  string `bson:"currency"`
	AmountBig string `bson:"amount"`
}

type AmountJSONMarshaler

type AmountJSONMarshaler struct {
	AmountBig string     `json:"amount"`
	Currency  CurrencyID `json:"currency"`
	hint.BaseHinter
}

type AmountJSONUnmarshaler

type AmountJSONUnmarshaler struct {
	AmountBig string    `json:"amount"`
	Currency  string    `json:"currency"`
	Hint      hint.Hint `json:"_hint"`
}

type BaseAccountKey

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

func NewBaseAccountKey

func NewBaseAccountKey(k base.Publickey, w uint) (BaseAccountKey, error)

func (BaseAccountKey) Bytes

func (ky BaseAccountKey) Bytes() []byte

func (*BaseAccountKey) DecodeBSON

func (ky *BaseAccountKey) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*BaseAccountKey) DecodeJSON

func (ky *BaseAccountKey) DecodeJSON(b []byte, enc encoder.Encoder) error

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() base.Publickey

func (BaseAccountKey) MarshalBSON

func (ky BaseAccountKey) MarshalBSON() ([]byte, error)

func (BaseAccountKey) MarshalJSON

func (ky BaseAccountKey) MarshalJSON() ([]byte, 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) DecodeBSON

func (ks *BaseAccountKeys) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*BaseAccountKeys) DecodeJSON

func (ks *BaseAccountKeys) DecodeJSON(b []byte, enc encoder.Encoder) error

func (BaseAccountKeys) Equal

func (ks BaseAccountKeys) Equal(b AccountKeys) bool

func (BaseAccountKeys) GenerateHash

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

func (BaseAccountKeys) Hash

func (ks BaseAccountKeys) Hash() util.Hash

func (BaseAccountKeys) IsValid

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

func (BaseAccountKeys) Key

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

type BaseStringAddress

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

func NewBaseStringAddressWithHint

func NewBaseStringAddressWithHint(ht hint.Hint, s string) BaseStringAddress

func (BaseStringAddress) Bytes

func (ad BaseStringAddress) Bytes() []byte

func (BaseStringAddress) Equal

func (ad BaseStringAddress) Equal(b base.Address) bool

func (BaseStringAddress) IsValid

func (ad BaseStringAddress) IsValid([]byte) error

func (BaseStringAddress) MarshalText

func (ad BaseStringAddress) MarshalText() ([]byte, error)

func (BaseStringAddress) String

func (ad BaseStringAddress) String() string

type ContractAccountBSONUnmarshaler

type ContractAccountBSONUnmarshaler struct {
	Hint      string   `bson:"_hint"`
	Owner     string   `bson:"owner"`
	IsActive  bool     `bson:"is_active"`
	Operators []string `bson:"operators"`
}

type ContractAccountKeys

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

func EmptyBaseContractAccountKeys

func EmptyBaseContractAccountKeys() ContractAccountKeys

func NewContractAccountKeys

func NewContractAccountKeys() (ContractAccountKeys, error)

func (ContractAccountKeys) Bytes

func (ks ContractAccountKeys) Bytes() []byte

func (*ContractAccountKeys) DecodeBSON

func (ks *ContractAccountKeys) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*ContractAccountKeys) DecodeJSON

func (ks *ContractAccountKeys) DecodeJSON(b []byte, enc encoder.Encoder) error

func (ContractAccountKeys) Equal

func (ks ContractAccountKeys) Equal(b AccountKeys) bool

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 (ks ContractAccountKeys) Keys() []AccountKey

func (ContractAccountKeys) MarshalBSON

func (ks ContractAccountKeys) MarshalBSON() ([]byte, error)

func (ContractAccountKeys) MarshalJSON

func (ks ContractAccountKeys) MarshalJSON() ([]byte, error)

func (ContractAccountKeys) Threshold

func (ks ContractAccountKeys) Threshold() uint

type ContractAccountStatus

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

func NewContractAccountStatus

func NewContractAccountStatus(owner base.Address, operators []base.Address) ContractAccountStatus

func (ContractAccountStatus) Bytes

func (cs ContractAccountStatus) Bytes() []byte

func (*ContractAccountStatus) DecodeBSON

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

func (*ContractAccountStatus) DecodeJSON

func (cs *ContractAccountStatus) DecodeJSON(b []byte, enc encoder.Encoder) error

func (ContractAccountStatus) Equal

func (ContractAccountStatus) GenerateHash

func (cs ContractAccountStatus) GenerateHash() util.Hash

func (ContractAccountStatus) Hash

func (cs ContractAccountStatus) Hash() util.Hash

func (ContractAccountStatus) IsActive

func (cs ContractAccountStatus) IsActive() bool

func (ContractAccountStatus) IsOperator

func (cs ContractAccountStatus) IsOperator(ad base.Address) bool

func (ContractAccountStatus) IsValid

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

func (ContractAccountStatus) MarshalBSON

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

func (ContractAccountStatus) MarshalJSON

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

func (ContractAccountStatus) Operators

func (cs ContractAccountStatus) Operators() []base.Address

func (ContractAccountStatus) Owner

func (cs ContractAccountStatus) Owner() base.Address

func (ContractAccountStatus) SetIsActive

func (*ContractAccountStatus) SetOperators

func (cs *ContractAccountStatus) SetOperators(operators []base.Address) error

func (*ContractAccountStatus) SetOwner

func (cs *ContractAccountStatus) SetOwner(a base.Address) error

type ContractAccountStatusJSONMarshaler

type ContractAccountStatusJSONMarshaler struct {
	hint.BaseHinter
	Owner     base.Address   `json:"owner"`
	IsActive  bool           `json:"is_active"`
	Operators []base.Address `json:"operators"`
}

type ContractAccountStatusJSONUnmarshaler

type ContractAccountStatusJSONUnmarshaler struct {
	Hint      hint.Hint `json:"_hint"`
	Owner     string    `json:"owner"`
	IsActive  bool      `json:"is_active"`
	Operators []string  `json:"operators"`
}

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 CurrencyDesign

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

func NewCurrencyDesign

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

func (CurrencyDesign) AddAggregate

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

func (CurrencyDesign) Aggregate

func (de CurrencyDesign) Aggregate() common.Big

func (CurrencyDesign) Amount

func (de CurrencyDesign) Amount() Amount

func (CurrencyDesign) Bytes

func (de CurrencyDesign) Bytes() []byte

func (CurrencyDesign) Currency

func (de CurrencyDesign) 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 encoder.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) SetGenesisAccount

func (de *CurrencyDesign) SetGenesisAccount(ac base.Address)

func (*CurrencyDesign) SetPolicy

func (de *CurrencyDesign) SetPolicy(po CurrencyPolicy)

type CurrencyDesignBSONUnmarshaler

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

type CurrencyDesignJSONMarshaler

type CurrencyDesignJSONMarshaler struct {
	hint.BaseHinter
	Amount    Amount         `json:"amount"`
	Genesis   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"`
	Genesis   string          `json:"genesis_account"`
	Policy    json.RawMessage `json:"policy"`
	Aggregate string          `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 common.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 encoder.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() common.Big

type CurrencyPolicyBSONUnmarshaler

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

type CurrencyPolicyJSONMarshaler

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

type CurrencyPolicyJSONUnmarshaler

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

type DuplicationType

type DuplicationType string

type EthAccountKeys

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

func NewEthAccountKeys

func NewEthAccountKeys(keys []AccountKey, threshold uint) (EthAccountKeys, error)

func (EthAccountKeys) Bytes

func (ks EthAccountKeys) Bytes() []byte

func (*EthAccountKeys) DecodeBSON

func (ks *EthAccountKeys) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*EthAccountKeys) DecodeJSON

func (ks *EthAccountKeys) DecodeJSON(b []byte, enc encoder.Encoder) error

func (EthAccountKeys) Equal

func (ks EthAccountKeys) Equal(b AccountKeys) bool

func (EthAccountKeys) GenerateHash

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

func (EthAccountKeys) Hash

func (ks EthAccountKeys) Hash() util.Hash

func (EthAccountKeys) IsValid

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

func (EthAccountKeys) Key

func (EthAccountKeys) Keys

func (ks EthAccountKeys) Keys() []AccountKey

func (EthAccountKeys) MarshalBSON

func (ks EthAccountKeys) MarshalBSON() ([]byte, error)

func (EthAccountKeys) MarshalJSON

func (ks EthAccountKeys) MarshalJSON() ([]byte, error)

func (EthAccountKeys) Threshold

func (ks EthAccountKeys) Threshold() uint

type EthAddress

type EthAddress struct {
	base.BaseStringAddress
}

func NewEthAddress

func NewEthAddress(s string) EthAddress

func NewEthAddressFromKeys

func NewEthAddressFromKeys(keys AccountKeys) (EthAddress, error)

func (*EthAddress) DecodeBSON

func (ca *EthAddress) DecodeBSON(b []byte, _ *bsonenc.Encoder) error

func (*EthAddress) DecodeJSON

func (ca *EthAddress) DecodeJSON(b []byte, _ encoder.Encoder) error

func (EthAddress) IsValid

func (ca EthAddress) IsValid([]byte) error

func (EthAddress) MarshalBSONValue

func (ca EthAddress) MarshalBSONValue() (bsontype.Type, []byte, error)

func (EthAddress) MarshalText

func (ca EthAddress) MarshalText() ([]byte, error)

type EthKeysHashJSONUnMarshaler

type EthKeysHashJSONUnMarshaler struct {
	Hash common.HashDecoder `json:"hash"`
}

type Feeer

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

type FixedFeeer

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

func NewFixedFeeer

func NewFixedFeeer(receiver base.Address, amount common.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 encoder.Encoder) error

func (FixedFeeer) Fee

func (fa FixedFeeer) Fee(common.Big) (common.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() common.Big

func (FixedFeeer) Receiver

func (fa FixedFeeer) Receiver() base.Address

func (FixedFeeer) Type

func (FixedFeeer) Type() string

type FixedFeeerBSONUnmarshaler

type FixedFeeerBSONUnmarshaler struct {
	Hint     string `bson:"_hint"`
	Receiver string `bson:"receiver"`
	Amount   string `bson:"amount"`
}

type FixedFeeerJSONMarshaler

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

type FixedFeeerJSONUnmarshaler

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

type GetNewProcessor

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

type KeyBSONUnmarshaler

type KeyBSONUnmarshaler struct {
	Hint   string `bson:"_hint"`
	Weight uint   `bson:"weight"`
	Keys   string `bson:"key"`
}

type KeyJSONMarshaler

type KeyJSONMarshaler struct {
	hint.BaseHinter
	Weight uint           `json:"weight"`
	Key    base.Publickey `json:"key"`
}

type KeyJSONUnmarshaler

type KeyJSONUnmarshaler struct {
	Hint   hint.Hint `json:"_hint"`
	Weight uint      `json:"weight"`
	Key    string    `json:"key"`
}

type KeysBSONUnmarshaler

type KeysBSONUnmarshaler struct {
	Hint      string   `bson:"_hint"`
	Hash      string   `bson:"hash"`
	Keys      bson.Raw `bson:"keys"`
	Threshold uint     `bson:"threshold"`
}

type KeysHashJSONUnMarshaler

type KeysHashJSONUnMarshaler struct {
	Hash valuehash.HashDecoder `json:"hash"`
}

type KeysJSONMarshaler

type KeysJSONMarshaler struct {
	hint.BaseHinter
	Hash      util.Hash    `json:"hash"`
	Keys      []AccountKey `json:"keys"`
	Threshold uint         `json:"threshold"`
}

type KeysJSONUnMarshaler

type KeysJSONUnMarshaler struct {
	Hint      hint.Hint       `json:"_hint"`
	Keys      json.RawMessage `json:"keys"`
	Threshold uint            `json:"threshold"`
}

type MEPrivatekey

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

MEPrivatekey is the default privatekey of mitum, it is based on BTC Privatekey.

func LoadMEPrivatekey

func LoadMEPrivatekey(s string) (MEPrivatekey, error)

func NewMEPrivatekey

func NewMEPrivatekey() MEPrivatekey

func NewMEPrivatekeyFromSeed

func NewMEPrivatekeyFromSeed(s string) (MEPrivatekey, error)

func ParseMEPrivatekey

func ParseMEPrivatekey(s string) (MEPrivatekey, error)

func (MEPrivatekey) Bytes

func (k MEPrivatekey) Bytes() []byte

func (MEPrivatekey) Equal

func (k MEPrivatekey) Equal(b base.PKKey) bool

func (MEPrivatekey) IsValid

func (k MEPrivatekey) IsValid([]byte) error

func (MEPrivatekey) MarshalText

func (k MEPrivatekey) MarshalText() ([]byte, error)

func (MEPrivatekey) Publickey

func (k MEPrivatekey) Publickey() base.Publickey

func (MEPrivatekey) Sign

func (k MEPrivatekey) Sign(b []byte) (base.Signature, error)

func (MEPrivatekey) String

func (k MEPrivatekey) String() string

func (*MEPrivatekey) UnmarshalText

func (k *MEPrivatekey) UnmarshalText(b []byte) error

type MEPublickey

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

MEPublickey is the optional public key of mitum, it is based on Ether Privatekey.

func LoadMEPublicKey

func LoadMEPublicKey(s string) (MEPublickey, error)

func NewMEPublickey

func NewMEPublickey(k *ecdsa.PublicKey) MEPublickey

func ParseMEPublickey

func ParseMEPublickey(s string) (MEPublickey, error)

func (MEPublickey) Bytes

func (k MEPublickey) Bytes() []byte

func (MEPublickey) Equal

func (k MEPublickey) Equal(b base.PKKey) bool

func (MEPublickey) IsValid

func (k MEPublickey) IsValid([]byte) error

func (MEPublickey) MarshalText

func (k MEPublickey) MarshalText() ([]byte, error)

func (MEPublickey) String

func (k MEPublickey) String() string

func (*MEPublickey) UnmarshalText

func (k *MEPublickey) UnmarshalText(b []byte) error

func (MEPublickey) Verify

func (k MEPublickey) Verify(input []byte, sig base.Signature) error

type NetworkPolicy

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

func DefaultNetworkPolicy

func DefaultNetworkPolicy() NetworkPolicy

func NewNetworkPolicy

func NewNetworkPolicy(
	suffrageCandidateLimit uint64,
	maxOperationsInProposal uint64,
	suffrageCandidateLifespan base.Height,
	maxSuffrageSize uint64,
	suffrageExpelLifespan base.Height,
	emptyProposalNoBlock bool,
) NetworkPolicy

func (*NetworkPolicy) DecodeBSON

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

func (*NetworkPolicy) DecodeJSON

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

func (NetworkPolicy) EmptyProposalNoBlock

func (p NetworkPolicy) EmptyProposalNoBlock() bool

func (NetworkPolicy) HashBytes

func (p NetworkPolicy) HashBytes() []byte

func (NetworkPolicy) IsValid

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

func (NetworkPolicy) MarshalBSON

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

func (NetworkPolicy) MarshalJSON

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

func (NetworkPolicy) MaxOperationsInProposal

func (p NetworkPolicy) MaxOperationsInProposal() uint64

func (NetworkPolicy) MaxSuffrageSize

func (p NetworkPolicy) MaxSuffrageSize() uint64

func (*NetworkPolicy) SetEmptyProposalNoBlock

func (p *NetworkPolicy) SetEmptyProposalNoBlock(i bool) NetworkPolicy

func (*NetworkPolicy) SetMaxOperationsInProposal

func (p *NetworkPolicy) SetMaxOperationsInProposal(i uint64) NetworkPolicy

func (*NetworkPolicy) SetMaxSuffrageSize

func (p *NetworkPolicy) SetMaxSuffrageSize(i uint64) NetworkPolicy

func (*NetworkPolicy) SetSuffrageCandidateLifespan

func (p *NetworkPolicy) SetSuffrageCandidateLifespan(i base.Height) NetworkPolicy

func (*NetworkPolicy) SetSuffrageCandidateLimiterRule

func (p *NetworkPolicy) SetSuffrageCandidateLimiterRule(i base.SuffrageCandidateLimiterRule) NetworkPolicy

func (*NetworkPolicy) SetSuffrageExpelLifespan

func (p *NetworkPolicy) SetSuffrageExpelLifespan(i base.Height) NetworkPolicy

func (NetworkPolicy) SuffrageCandidateLifespan

func (p NetworkPolicy) SuffrageCandidateLifespan() base.Height

func (NetworkPolicy) SuffrageCandidateLimiterRule

func (p NetworkPolicy) SuffrageCandidateLimiterRule() base.SuffrageCandidateLimiterRule

func (NetworkPolicy) SuffrageExpelLifespan

func (p NetworkPolicy) SuffrageExpelLifespan() base.Height

type NetworkPolicyBSONUnMarshaler

type NetworkPolicyBSONUnMarshaler struct {
	Hint                         string      `bson:"_hint"`
	SuffrageCandidateLimiterRule bson.Raw    `bson:"suffrage_candidate_limiter"`
	MaxOperationsInProposal      uint64      `bson:"max_operations_in_proposal"`
	SuffrageCandidateLifespan    base.Height `bson:"suffrage_candidate_lifespan"`
	MaxSuffrageSize              uint64      `bson:"max_suffrage_size"`
	SuffrageExpelLifespan        base.Height `bson:"suffrage_expel_lifespan"`
	EmptyProposalNoBlock         bool        `bson:"empty_proposal_no_block"`
}

type NetworkPolicyStateValue

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

func NewNetworkPolicyStateValue

func NewNetworkPolicyStateValue(policy base.NetworkPolicy) NetworkPolicyStateValue

func (*NetworkPolicyStateValue) DecodeBSON

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

func (*NetworkPolicyStateValue) DecodeJSON

func (s *NetworkPolicyStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error

func (NetworkPolicyStateValue) HashBytes

func (s NetworkPolicyStateValue) HashBytes() []byte

func (NetworkPolicyStateValue) IsValid

func (s NetworkPolicyStateValue) IsValid([]byte) error

func (NetworkPolicyStateValue) MarshalBSON

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

func (NetworkPolicyStateValue) MarshalJSON

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

func (NetworkPolicyStateValue) Policy

type NetworkPolicyStateValueBSONUnmarshaler

type NetworkPolicyStateValueBSONUnmarshaler struct {
	Hint   string   `bson:"_hint"`
	Policy bson.Raw `bson:"policy"`
}

type NetworkPolicyStateValueJSONMarshaler

type NetworkPolicyStateValueJSONMarshaler struct {
	Policy base.NetworkPolicy `json:"policy"`
	hint.BaseHinter
}

type NetworkPolicyStateValueJSONUnmarshaler

type NetworkPolicyStateValueJSONUnmarshaler struct {
	Policy json.RawMessage `json:"policy"`
}

type NilAccountKeys

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

func (NilAccountKeys) Bytes

func (ks NilAccountKeys) Bytes() []byte

func (*NilAccountKeys) DecodeBSON

func (ks *NilAccountKeys) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*NilAccountKeys) DecodeJSON

func (ks *NilAccountKeys) DecodeJSON(b []byte, enc encoder.Encoder) error

func (NilAccountKeys) Equal

func (ks NilAccountKeys) Equal(b AccountKeys) bool

func (NilAccountKeys) GenerateHash

func (ks NilAccountKeys) GenerateHash(pub base.Publickey) util.Hash

func (NilAccountKeys) Hash

func (ks NilAccountKeys) Hash() util.Hash

func (NilAccountKeys) IsValid

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

func (NilAccountKeys) Key

func (ks NilAccountKeys) Key(pub base.Publickey) (AccountKey, bool)

func (NilAccountKeys) Keys

func (ks NilAccountKeys) Keys() []AccountKey

func (NilAccountKeys) MarshalBSON

func (ks NilAccountKeys) MarshalBSON() ([]byte, error)

func (NilAccountKeys) MarshalJSON

func (ks NilAccountKeys) MarshalJSON() ([]byte, error)

func (NilAccountKeys) Threshold

func (ks NilAccountKeys) Threshold() uint

type NilFeeer

type NilFeeer struct {
	hint.BaseHinter
}

func NewNilFeeer

func NewNilFeeer() NilFeeer

func (NilFeeer) Bytes

func (NilFeeer) Bytes() []byte

func (NilFeeer) Fee

func (NilFeeer) Fee(common.Big) (common.Big, error)

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() common.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 RatioFeeer

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

func NewRatioFeeer

func NewRatioFeeer(receiver base.Address, ratio float64, min, max common.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 encoder.Encoder) error

func (RatioFeeer) Fee

func (fa RatioFeeer) Fee(a common.Big) (common.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() common.Big

func (RatioFeeer) Receiver

func (fa RatioFeeer) Receiver() base.Address

func (RatioFeeer) Type

func (RatioFeeer) Type() string

type RatioFeeerBSONUnmarshaler

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

type RatioFeeerJSONMarshaler

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

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"`
}

type StringAddress

type StringAddress struct {
	BaseStringAddress
}

func NewStringAddress

func NewStringAddress(s string) StringAddress

func ParseStringAddress

func ParseStringAddress(s string) (StringAddress, error)

func (StringAddress) IsValid

func (ad StringAddress) IsValid([]byte) error

func (StringAddress) MarshalBSONValue

func (ad StringAddress) MarshalBSONValue() (bsontype.Type, []byte, error)

func (*StringAddress) UnmarshalText

func (ad *StringAddress) UnmarshalText(b []byte) error

Jump to

Keyboard shortcuts

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