types

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

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

Go to latest
Published: Feb 13, 2026 License: GPL-3.0 Imports: 27 Imported by: 48

Documentation

Index

Constants

View Source
const (
	AuthTypeED25519   = VerificationMethodType("Ed25519VerificationKey2020")
	AuthTypeECDSASECP = VerificationMethodType("EcdsaSecp256k1VerificationKey2019")
	AuthTypeImFact    = VerificationMethodType("EcdsaSecp256k1VerificationKeyImFact2025")
	AuthTypeLinked    = VerificationMethodType("LinkedVerificationMethod")
)
View Source
const (
	Allowed = iota
	WithdrawalBlocked
	MaxBalanceStatus // last value is used for read length of BalanceStatus
)
View Source
const (
	FeeerNil       = "nil"
	FeeerFixed     = "fixed"
	ItemFeeerFixed = "fixed-item"
	FeeerRatio     = "ratio"
)
View Source
const (
	AddressLength = 20
)
View Source
const DIDPrefix = "did"
View Source
const DIDSeparator = ":"
View Source
const MaxHandlers = 20
View Source
const MaxRecipients = 20

Variables

View Source
var (
	AddressHint       = hint.MustNewHint("fca-v0.0.1")
	ZeroAddressSuffix = "-X"
)
View Source
var (
	VerificationMethodHint      = hint.MustNewHint("mitum-did-verification-method-v0.0.1")
	VerificationMethodOrRefHint = hint.MustNewHint("mitum-did-verification-method-or-ref-v0.0.1")
)
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
	ReCurrencyID        = `[A-Z0-9][A-Z0-9_\.\!\$\*\@]*[A-Z0-9]`
	ReValidCurrencyID   = regexp.MustCompile(`^` + ReCurrencyID + `$`)
	ReSpecialCh         = `[^\s:/?#\[\]$@]*`
	ReValidSpcecialCh   = regexp.MustCompile(`^` + ReSpecialCh + `$`)
)
View Source
var (
	NilFeeerHint       = hint.MustNewHint("mitum-currency-nil-feeer-v0.0.1")
	FixedFeeerHint     = hint.MustNewHint("mitum-currency-fixed-feeer-v0.0.1")
	FixedItemFeeerHint = hint.MustNewHint("mitum-currency-fixed-item-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")
	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("fpr-v0.0.1")
	MEPublickeyHint  = hint.MustNewHint("fpu-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 DIDDocumentHint = hint.MustNewHint("mitum-did-document-v0.0.1")
View Source
var DataHint = hint.MustNewHint("mitum-did-data-v0.0.1")
View Source
var DesignHint = hint.MustNewHint("mitum-did-design-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

func ChecksumHex

func ChecksumHex(buf [42]byte) []byte

ChecksumHex return the hex in the manner of EIP55

func IsZeroAddress

func IsZeroAddress(ad string) bool

func ParseDIDScheme

func ParseDIDScheme(did string) (method, methodSpecificID string, err 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 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 AccountStatus

type AccountStatus interface {
	util.IsValider
}

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 NewAddressFromString

func NewAddressFromString(s string) (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 (ad Address) IsValid([]byte) error

func (Address) MarshalBSONValue

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

func (Address) MarshalText

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

type Addresses

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

type AllowedOperation

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

func NewAllowedOperation

func NewAllowedOperation(contract base.Address, operation hint.Hint) *AllowedOperation

func (AllowedOperation) Bytes

func (a AllowedOperation) Bytes() []byte

func (AllowedOperation) Contract

func (a AllowedOperation) Contract() base.Address

func (AllowedOperation) Equal

func (AllowedOperation) MarshalBSON

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

func (AllowedOperation) MarshalJSON

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

func (AllowedOperation) Operation

func (a AllowedOperation) Operation() hint.Hint

func (*AllowedOperation) UnmarshalBSON

func (a *AllowedOperation) UnmarshalBSON(b []byte) error

func (*AllowedOperation) UnmarshalJSON

func (a *AllowedOperation) UnmarshalJSON(b []byte) error

type AllowedOperationBSONMarshaler

type AllowedOperationBSONMarshaler struct {
	Contract  string `bson:"contract,omitempty"`
	Operation string `bson:"operation"`
}

type AllowedOperationBSONUnMarshaler

type AllowedOperationBSONUnMarshaler struct {
	Contract  string `bson:"contract"`
	Operation string `bson:"operation"`
}

type AllowedOperationJSONMarshaler

type AllowedOperationJSONMarshaler struct {
	Contract  base.Address `json:"contract,omitempty"`
	Operation string       `json:"operation"`
}

type AllowedOperationJSONUnMarshaler

type AllowedOperationJSONUnMarshaler struct {
	Contract  string `json:"contract"`
	Operation string `json:"operation"`
}

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 AttestationPolicy

type AttestationPolicy interface {
	PolicyType() string
	AllowedOperations() []AllowedOperation
	util.Byter
	util.IsValider
	bson.Marshaler
}

type BalanceStatus

type BalanceStatus uint8

func (BalanceStatus) Bytes

func (bs BalanceStatus) Bytes() []byte

func (BalanceStatus) IsValid

func (bs BalanceStatus) IsValid([]byte) error

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 BaseVerificationMethod

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

func NewBaseVerificationMethod

func NewBaseVerificationMethod(id DIDURLRef, controller DIDRef) BaseVerificationMethod

func (BaseVerificationMethod) BSONMarshaler

func (BaseVerificationMethod) Bytes

func (b BaseVerificationMethod) Bytes() []byte

func (BaseVerificationMethod) Controller

func (b BaseVerificationMethod) Controller() DIDRef

func (BaseVerificationMethod) ID

func (BaseVerificationMethod) Marshaler

func (*BaseVerificationMethod) SetController

func (b *BaseVerificationMethod) SetController(controller DIDRef)

func (*BaseVerificationMethod) SetID

func (b *BaseVerificationMethod) SetID(id DIDURLRef)

func (*BaseVerificationMethod) SetType

func (b *BaseVerificationMethod) SetType(verificationType VerificationMethodType)

func (BaseVerificationMethod) Type

func (BaseVerificationMethod) UnmarshalBSON

func (b BaseVerificationMethod) UnmarshalBSON(v []byte) error

func (BaseVerificationMethod) UnmarshalJSON

func (b BaseVerificationMethod) UnmarshalJSON(v []byte) error

type BaseVerificationMethodBSONMarshaler

type BaseVerificationMethodBSONMarshaler struct {
	ID         string `bson:"id"`
	Controller string `bson:"controller"`
	Type       string `bson:"type"`
}

type BaseVerificationMethodBSONUnMarshaler

type BaseVerificationMethodBSONUnMarshaler struct {
	ID         string `bson:"id"`
	Controller string `bson:"controller"`
	Type       string `bson:"type"`
}

type BaseVerificationMethodJSONMarshaler

type BaseVerificationMethodJSONMarshaler struct {
	ID         string `json:"id"`
	Controller string `json:"controller"`
	Type       string `json:"type"`
}

type BaseVerificationMethodJSONUnMarshaler

type BaseVerificationMethodJSONUnMarshaler struct {
	ID         string `json:"id"`
	Controller string `json:"controller"`
	Type       string `json:"type"`
}

type ContractAccountBSONUnmarshaler

type ContractAccountBSONUnmarshaler struct {
	Hint              string   `bson:"_hint"`
	Owner             string   `bson:"owner"`
	IsActive          bool     `bson:"is_active"`
	BalanceStatus     uint8    `bson:"balance_status"`
	RegisterOperation string   `bson:"register_operation"`
	Handlers          []string `bson:"handlers"`
	Recipients        []string `bson:"recipients"`
}

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, handlers []base.Address) ContractAccountStatus

func (ContractAccountStatus) BalanceStatus

func (cs ContractAccountStatus) BalanceStatus() BalanceStatus

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) Handlers

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

func (ContractAccountStatus) Hash

func (cs ContractAccountStatus) Hash() util.Hash

func (ContractAccountStatus) IsActive

func (cs ContractAccountStatus) IsActive() bool

func (ContractAccountStatus) IsHandler

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

func (ContractAccountStatus) IsRecipients

func (cs ContractAccountStatus) IsRecipients(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) Owner

func (cs ContractAccountStatus) Owner() base.Address

func (ContractAccountStatus) Recipients

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

func (ContractAccountStatus) RegisterOperation

func (cs ContractAccountStatus) RegisterOperation() *hint.Hint

func (*ContractAccountStatus) SetActive

func (cs *ContractAccountStatus) SetActive(b bool)

func (*ContractAccountStatus) SetBalanceStatus

func (cs *ContractAccountStatus) SetBalanceStatus(b BalanceStatus)

func (*ContractAccountStatus) SetHandlers

func (cs *ContractAccountStatus) SetHandlers(handlers []base.Address) error

func (*ContractAccountStatus) SetOwner

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

func (*ContractAccountStatus) SetRecipients

func (cs *ContractAccountStatus) SetRecipients(recipients []base.Address) error

func (*ContractAccountStatus) SetRegisterOperation

func (cs *ContractAccountStatus) SetRegisterOperation(h *hint.Hint)

type ContractAccountStatusJSONMarshaler

type ContractAccountStatusJSONMarshaler struct {
	hint.BaseHinter
	Owner             base.Address   `json:"owner"`
	IsActive          bool           `json:"is_active"`
	BalanceStatus     BalanceStatus  `json:"balance_status"`
	RegisterOperation *hint.Hint     `json:"register_operation,omitempty"`
	Handlers          []base.Address `json:"handlers"`
	Recipients        []base.Address `json:"recipients"`
}

type ContractAccountStatusJSONUnmarshaler

type ContractAccountStatusJSONUnmarshaler struct {
	Hint              hint.Hint  `json:"_hint"`
	Owner             string     `json:"owner"`
	IsActive          bool       `json:"is_active"`
	BalanceStatus     uint8      `json:"balance_status"`
	RegisterOperation *hint.Hint `json:"register_operation"`
	Handlers          []string   `json:"handlers"`
	Recipients        []string   `json:"recipients"`
}

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(
	initialSupply common.Big, currency CurrencyID, decimal common.Big, genesisAccount base.Address, po CurrencyPolicy,
) CurrencyDesign

func (CurrencyDesign) AddTotalSupply

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

func (CurrencyDesign) Bytes

func (de CurrencyDesign) Bytes() []byte

func (CurrencyDesign) Currency

func (de CurrencyDesign) Currency() CurrencyID

func (CurrencyDesign) Decimal

func (de CurrencyDesign) Decimal() common.Big

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) InitialSupply

func (de CurrencyDesign) InitialSupply() Amount

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)

func (CurrencyDesign) TotalSupply

func (de CurrencyDesign) TotalSupply() common.Big

type CurrencyDesignBSONUnmarshaler

type CurrencyDesignBSONUnmarshaler struct {
	Hint          string   `bson:"_hint"`
	InitialSupply string   `bson:"initial_supply"`
	Currency      string   `bson:"currency"`
	Decimal       string   `bson:"decimal"`
	Genesis       string   `bson:"genesis_account"`
	Policy        bson.Raw `bson:"policy"`
	TotalSupply   string   `bson:"total_supply"`
}

type CurrencyDesignJSONMarshaler

type CurrencyDesignJSONMarshaler struct {
	hint.BaseHinter
	InitialSupply string         `json:"initial_supply"`
	Currency      string         `json:"currency_id"`
	Decimal       string         `json:"decimal"`
	Genesis       base.Address   `json:"genesis_account"`
	Policy        CurrencyPolicy `json:"policy"`
	TotalSupply   string         `json:"total_supply"`
}

type CurrencyDesignJSONUnmarshaler

type CurrencyDesignJSONUnmarshaler struct {
	Hint          hint.Hint       `json:"_hint"`
	InitialSupply string          `json:"initial_supply"`
	Currency      string          `json:"currency_id"`
	Decimal       string          `json:"decimal"`
	Genesis       string          `json:"genesis_account"`
	Policy        json.RawMessage `json:"policy"`
	TotalSupply   string          `json:"total_supply"`
}

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) MinBalance

func (po CurrencyPolicy) MinBalance() common.Big

type CurrencyPolicyBSONUnmarshaler

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

type CurrencyPolicyJSONMarshaler

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

type CurrencyPolicyJSONUnmarshaler

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

type DIDDocument

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

func NewDIDDocument

func NewDIDDocument(did DIDRef) DIDDocument

func (DIDDocument) Authentication

func (d DIDDocument) Authentication(id string) (VerificationRelationshipEntry, error)

func (DIDDocument) Bytes

func (d DIDDocument) Bytes() []byte

func (DIDDocument) DID

func (d DIDDocument) DID() DIDRef

func (*DIDDocument) DecodeBSON

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

func (*DIDDocument) DecodeJSON

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

func (DIDDocument) IsValid

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

func (DIDDocument) MarshalBSON

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

func (DIDDocument) MarshalJSON

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

func (*DIDDocument) SetAuthentication

func (d *DIDDocument) SetAuthentication(auth VerificationRelationshipEntry)

func (DIDDocument) SetVerificationMethod

func (d DIDDocument) SetVerificationMethod()

func (DIDDocument) VerificationMethod

func (d DIDDocument) VerificationMethod(id string) (IVerificationMethod, error)

type DIDDocumentBSONUnmarshaler

type DIDDocumentBSONUnmarshaler struct {
	Hint      string                    `bson:"_hint"`
	Context_  []string                  `bson:"@context"`
	ID        string                    `bson:"id"`
	Auth      []VerificationMethodOrRef `bson:"authentication"`
	VRFMethod bson.Raw                  `bson:"verificationMethod"`
	Service   []Service                 `bson:"service"`
}

type DIDDocumentJSONMarshaler

type DIDDocumentJSONMarshaler struct {
	hint.BaseHinter
	Context_  []string                        `json:"@context"`
	ID        string                          `json:"id"`
	Auth      []VerificationRelationshipEntry `json:"authentication"`
	VRFMethod []IVerificationMethod           `json:"verificationMethod"`
	Service   []Service                       `json:"service"`
}

type DIDDocumentJSONUnmarshaler

type DIDDocumentJSONUnmarshaler struct {
	Hint      hint.Hint       `json:"_hint"`
	Context_  []string        `json:"@context"`
	ID        string          `json:"id"`
	Auth      json.RawMessage `json:"authentication"`
	VRFMethod json.RawMessage `json:"verificationMethod"`
	Service   []Service       `json:"service"`
}

type DIDRef

type DIDRef string

func NewDIDRef

func NewDIDRef(method, methodSpecificID string) (*DIDRef, error)

func NewDIDRefFromString

func NewDIDRefFromString(s string) (*DIDRef, error)

func (DIDRef) Bytes

func (d DIDRef) Bytes() []byte

func (DIDRef) IsValid

func (d DIDRef) IsValid(_ []byte) error

func (DIDRef) Method

func (d DIDRef) Method() string

func (DIDRef) MethodSpecificID

func (d DIDRef) MethodSpecificID() string

func (DIDRef) String

func (d DIDRef) String() string

type DIDURLRef

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

func NewDIDURLRef

func NewDIDURLRef(did, fragment string) (*DIDURLRef, error)

func NewDIDURLRefFromString

func NewDIDURLRefFromString(s string) (*DIDURLRef, error)

func (DIDURLRef) Bytes

func (r DIDURLRef) Bytes() []byte

func (DIDURLRef) DID

func (r DIDURLRef) DID() DIDRef

func (DIDURLRef) Fragment

func (r DIDURLRef) Fragment() string

func (DIDURLRef) IsValid

func (r DIDURLRef) IsValid(_ []byte) error

func (DIDURLRef) MethodSpecificID

func (r DIDURLRef) MethodSpecificID() string

func (DIDURLRef) String

func (r DIDURLRef) String() string

type Data

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

func NewData

func NewData(
	address base.Address, method string,
) (*Data, error)

func (Data) Address

func (d Data) Address() base.Address

func (Data) Bytes

func (d Data) Bytes() []byte

func (Data) DID

func (d Data) DID() DIDRef

func (*Data) DecodeBSON

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

func (*Data) DecodeJSON

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

func (Data) Equal

func (d Data) Equal(b Data) bool

func (Data) IsValid

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

func (Data) MarshalBSON

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

func (Data) MarshalJSON

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

type DataBSONUnmarshaler

type DataBSONUnmarshaler struct {
	Hint    string `bson:"_hint"`
	Address string `bson:"address"`
	DID     string `bson:"did"`
}

type DataJSONMarshaler

type DataJSONMarshaler struct {
	hint.BaseHinter
	Address string `json:"address"`
	DID     string `json:"did"`
}

type DataJSONUnmarshaler

type DataJSONUnmarshaler struct {
	Hint    hint.Hint `json:"_hint"`
	Address string    `json:"address"`
	DID     string    `json:"did"`
}

type Design

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

func NewDesign

func NewDesign(didMethod string) Design

func (Design) Bytes

func (de Design) Bytes() []byte

func (Design) DIDMethod

func (de Design) DIDMethod() string

func (*Design) DecodeBSON

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

func (*Design) DecodeJSON

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

func (Design) Equal

func (de Design) Equal(cd Design) bool

func (Design) GenerateHash

func (de Design) GenerateHash() util.Hash

func (Design) Hash

func (de Design) Hash() util.Hash

func (Design) IsValid

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

func (Design) MarshalBSON

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

func (Design) MarshalJSON

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

type DesignBSONUnmarshaler

type DesignBSONUnmarshaler struct {
	Hint      string `bson:"_hint"`
	DIDMethod string `bson:"didMethod"`
}

type DesignJSONMarshaler

type DesignJSONMarshaler struct {
	hint.BaseHinter
	DIDMethod string `json:"didMethod"`
}

type DesignJSONUnmarshaler

type DesignJSONUnmarshaler struct {
	Hint      hint.Hint `json:"_hint"`
	DIDMethod string    `json:"didMethod"`
}

type DuplicationKeyType

type DuplicationKeyType string

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 FixedItemFeeer

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

func NewFixedItemFeeer

func NewFixedItemFeeer(receiver base.Address, amount, itemFeeAmount common.Big) FixedItemFeeer

func (FixedItemFeeer) Bytes

func (fa FixedItemFeeer) Bytes() []byte

func (*FixedItemFeeer) DecodeBSON

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

func (*FixedItemFeeer) DecodeJSON

func (fa *FixedItemFeeer) DecodeJSON(b []byte, enc encoder.Encoder) error

func (FixedItemFeeer) Fee

func (fa FixedItemFeeer) Fee(common.Big) (common.Big, error)

func (FixedItemFeeer) IsValid

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

func (FixedItemFeeer) ItemFee

func (fa FixedItemFeeer) ItemFee(common.Big) (common.Big, error)

func (FixedItemFeeer) MarshalBSON

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

func (FixedItemFeeer) MarshalJSON

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

func (FixedItemFeeer) Min

func (fa FixedItemFeeer) Min() common.Big

func (FixedItemFeeer) Receiver

func (fa FixedItemFeeer) Receiver() base.Address

func (FixedItemFeeer) Type

func (FixedItemFeeer) Type() string

type FixedItemFeeerBSONUnmarshaler

type FixedItemFeeerBSONUnmarshaler struct {
	Hint          string `bson:"_hint"`
	Receiver      string `bson:"receiver"`
	Amount        string `bson:"amount"`
	ItemFeeAmount string `bson:"item_fee_amount"`
}

type FixedItemFeeerJSONMarshaler

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

type FixedItemFeeerJSONUnmarshaler

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

type GetNewProcessor

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

type GetNewProcessorWithProposal

type GetNewProcessorWithProposal func(
	height base.Height,
	proposal *base.ProposalSignFact,
	getStateFunc base.GetStateFunc,
	newPreProcessConstraintFunc base.NewOperationProcessorProcessFunc,
	newProcessConstraintFunc base.NewOperationProcessorProcessFunc) (base.OperationProcessor, error)

type IVerificationMethod

type IVerificationMethod interface {
	ID() DIDURLRef
	Controller() DIDRef
	Type() VerificationMethodType
	util.Byter
	util.IsValider
}

type ItemFeeer

type ItemFeeer interface {
	Feeer
	ItemFee(common.Big) (common.Big, error)
}

type JWK

type JWK struct {
	Kty string `json:"kty" bson:"kty"`
	Crv string `json:"crv" bson:"crv"`
	X   string `json:"x" bson:"x"`
	Y   string `json:"y" bson:"y"`
}

func NewJWK

func NewJWK(kty string, crv string, x string, y string) JWK

func (JWK) Bytes

func (j JWK) Bytes() []byte

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 common.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, _ *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 Service

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

func NewService

func NewService(
	id DIDURLRef, serviceType, serviceEndPoint string,
) Service

func (Service) Bytes

func (d Service) Bytes() []byte

func (Service) ID

func (s Service) ID() DIDURLRef

func (Service) IsValid

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

func (Service) MarshalBSON

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

func (Service) MarshalJSON

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

func (*Service) UnmarshalBSON

func (d *Service) UnmarshalBSON(b []byte) error

func (*Service) UnmarshalJSON

func (d *Service) UnmarshalJSON(b []byte) error

type ServiceBSONUnmarshaler

type ServiceBSONUnmarshaler struct {
	ID              string `bson:"id"`
	Type            string `bson:"type"`
	ServiceEndPoint string `bson:"service_end_point"`
}

type ServiceJSONMarshaler

type ServiceJSONMarshaler struct {
	ID              string `json:"id"`
	Type            string `json:"type"`
	ServiceEndPoint string `json:"service_end_point"`
}

type ServiceJSONUnmarshaler

type ServiceJSONUnmarshaler struct {
	ID              string `json:"id"`
	Type            string `json:"type"`
	ServiceEndPoint string `json:"service_end_point"`
}

type StringAddress

type StringAddress struct {
	BaseStringAddress
}

func NewStringAddress

func NewStringAddress(s string) StringAddress

func ParseStringAddress

func ParseStringAddress(s string) (StringAddress, error)

func (*StringAddress) DecodeBSON

func (ad *StringAddress) DecodeBSON(b []byte, _ *bsonenc.Encoder) error

func (StringAddress) IsValid

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

func (StringAddress) MarshalBSONValue

func (ad StringAddress) MarshalBSONValue() (byte, []byte, error)

func (*StringAddress) UnmarshalText

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

type VMRefKind

type VMRefKind uint8
const (
	VMRefKindReference VMRefKind = iota
	VMRefKindEmbedded
)

func (VMRefKind) Bytes

func (k VMRefKind) Bytes() []byte

type VerificationMethod

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

func NewVerificationMethod

func NewVerificationMethod(id DIDURLRef, controller DIDRef) VerificationMethod

func (VerificationMethod) Allowed

func (v VerificationMethod) Allowed() []AllowedOperation

func (VerificationMethod) Bytes

func (v VerificationMethod) Bytes() []byte

func (*VerificationMethod) DecodeJSON

func (v *VerificationMethod) DecodeJSON(b []byte, enc encoder.Encoder) error

func (VerificationMethod) IsAllowed

func (v VerificationMethod) IsAllowed(operation AllowedOperation) bool

func (VerificationMethod) IsValid

func (v VerificationMethod) IsValid([]byte) error

func (VerificationMethod) MarshalBSON

func (v VerificationMethod) MarshalBSON() ([]byte, error)

func (VerificationMethod) MarshalJSON

func (v VerificationMethod) MarshalJSON() ([]byte, error)

func (VerificationMethod) PublicKey

func (v VerificationMethod) PublicKey() base.Publickey

func (VerificationMethod) PublicKeyJwk

func (v VerificationMethod) PublicKeyJwk() *JWK

func (VerificationMethod) PublicKeyMultibase

func (v VerificationMethod) PublicKeyMultibase() string

func (*VerificationMethod) SetAllowed

func (v *VerificationMethod) SetAllowed(operations []AllowedOperation)

func (*VerificationMethod) SetPublicKey

func (v *VerificationMethod) SetPublicKey(publicKey base.Publickey)

func (*VerificationMethod) SetPublicKeyJwk

func (v *VerificationMethod) SetPublicKeyJwk(jwk *JWK)

func (*VerificationMethod) SetPublicKeyMultibase

func (v *VerificationMethod) SetPublicKeyMultibase(publicKey base.Publickey) error

func (*VerificationMethod) SetTargetID

func (v *VerificationMethod) SetTargetID(id *DIDURLRef)

func (VerificationMethod) TargetID

func (v VerificationMethod) TargetID() *DIDURLRef

func (*VerificationMethod) UnmarshalBSON

func (v *VerificationMethod) UnmarshalBSON(b []byte) error

type VerificationMethodBSONMarshaler

type VerificationMethodBSONMarshaler struct {
	Hint               string             `bson:"_hint"`
	ID                 string             `bson:"id"`
	Controller         string             `bson:"controller"`
	Type               string             `bson:"type"`
	PublicKeyJwk       *JWK               `bson:"publicKeyJwk,omitempty"`
	PublicKeyMultibase string             `bson:"publicKeyMultibase,omitempty"`
	PublicKey          string             `bson:"publicKeyImFact,omitempty"`
	TargetId           string             `bson:"targetId,omitempty"`
	Allowed            []AllowedOperation `bson:"allowed,omitempty"`
}

type VerificationMethodBSONUnMarshaler

type VerificationMethodBSONUnMarshaler struct {
	Hint               string             `bson:"_hint"`
	PublicKeyJwk       *JWK               `bson:"publicKeyJwk"`
	PublicKeyMultibase string             `bson:"publicKeyMultibase"`
	PublicKey          string             `bson:"publicKeyImFact"`
	TargetId           string             `bson:"targetId"`
	Allowed            []AllowedOperation `bson:"allowed"`
}

type VerificationMethodJSONMarshaler

type VerificationMethodJSONMarshaler struct {
	hint.BaseHinter
	ID                 string             `json:"id"`
	Controller         string             `json:"controller"`
	Type               string             `json:"type"`
	PublicKeyJwk       *JWK               `json:"publicKeyJwk,omitempty"`
	PublicKeyMultibase string             `json:"publicKeyMultibase,omitempty"`
	PublicKey          string             `json:"publicKeyImFact,omitempty"`
	TargetId           string             `json:"targetId,omitempty"`
	Allowed            []AllowedOperation `json:"allowed,omitempty"`
}

type VerificationMethodJSONUnMarshaler

type VerificationMethodJSONUnMarshaler struct {
	PublicKeyJwk       *JWK               `json:"publicKeyJwk"`
	PublicKeyMultibase string             `json:"publicKeyMultibase"`
	PublicKey          string             `json:"publicKeyImFact"`
	TargetId           string             `json:"targetId"`
	Allowed            []AllowedOperation `json:"allowed"`
}

type VerificationMethodOrRef

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

func NewVerificationMethodOrRef

func NewVerificationMethodOrRef() *VerificationMethodOrRef

func (VerificationMethodOrRef) Bytes

func (v VerificationMethodOrRef) Bytes() []byte

func (*VerificationMethodOrRef) DecodeJSON

func (v *VerificationMethodOrRef) DecodeJSON(b []byte, enc encoder.Encoder) error

func (VerificationMethodOrRef) IsValid

func (v VerificationMethodOrRef) IsValid([]byte) error

func (VerificationMethodOrRef) Kind

func (VerificationMethodOrRef) MarshalBSONValue

func (v VerificationMethodOrRef) MarshalBSONValue() (byte, []byte, error)

func (VerificationMethodOrRef) MarshalJSON

func (v VerificationMethodOrRef) MarshalJSON() ([]byte, error)

func (VerificationMethodOrRef) Method

func (VerificationMethodOrRef) Ref

func (*VerificationMethodOrRef) SetRef

func (*VerificationMethodOrRef) SetVerificationMethod

func (v *VerificationMethodOrRef) SetVerificationMethod(vrfm IVerificationMethod)

func (*VerificationMethodOrRef) UnmarshalBSONValue

func (v *VerificationMethodOrRef) UnmarshalBSONValue(bt byte, data []byte) error

type VerificationMethodOrRefBSONUnmarshaler

type VerificationMethodOrRefBSONUnmarshaler struct {
	Hint   string            `bson:"_hint"`
	REF    string            `bson:"ref"`
	METHOD bson.Raw          `bson:"method"`
	KIND   VMRefKind         `bson:"kind"`
	POLICY AttestationPolicy `bson:"policy"`
}

type VerificationMethodOrRefJSONMarshaler

type VerificationMethodOrRefJSONMarshaler struct {
	hint.BaseHinter
	REF    string              `json:"ref,omitempty"`
	METHOD IVerificationMethod `json:"method,omitempty"`
	POLICY AttestationPolicy   `json:"policy,omitempty"`
}

type VerificationMethodOrRefJSONUnmarshaler

type VerificationMethodOrRefJSONUnmarshaler struct {
	Hint   hint.Hint         `json:"_hint"`
	REF    string            `json:"ref"`
	METHOD json.RawMessage   `json:"method"`
	POLICY AttestationPolicy `json:"policy"`
}

type VerificationMethodType

type VerificationMethodType string

func (VerificationMethodType) String

func (k VerificationMethodType) String() string

type VerificationRelationshipEntry

type VerificationRelationshipEntry interface {
	Kind() VMRefKind
	Method() IVerificationMethod
	Ref() *DIDURLRef
	jsonutil.Decodable
	bson.ValueMarshaler
	util.Byter
	util.IsValider
}

Jump to

Keyboard shortcuts

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