Documentation ¶
Overview ¶
Package currency provides an implementation of a token registry. It allows to keep keep track of token/currency configuration.
Once configured, token declaration cannot be altered.
Index ¶
- Variables
- func NewTokenInfo(ticker, name string) orm.Object
- func RegisterQuery(qr weave.QueryRouter)
- func RegisterRoutes(r weave.Registry, auth x.Authenticator, issuer weave.Address)
- type CreateMsg
- func (*CreateMsg) Descriptor() ([]byte, []int)
- func (m *CreateMsg) GetMetadata() *weave.Metadata
- func (m *CreateMsg) GetName() string
- func (m *CreateMsg) GetTicker() string
- func (m *CreateMsg) Marshal() (dAtA []byte, err error)
- func (m *CreateMsg) MarshalTo(dAtA []byte) (int, error)
- func (CreateMsg) Path() string
- func (*CreateMsg) ProtoMessage()
- func (m *CreateMsg) Reset()
- func (m *CreateMsg) Size() (n int)
- func (m *CreateMsg) String() string
- func (m *CreateMsg) Unmarshal(dAtA []byte) error
- func (msg *CreateMsg) Validate() error
- func (m *CreateMsg) XXX_DiscardUnknown()
- func (m *CreateMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CreateMsg) XXX_Merge(src proto.Message)
- func (m *CreateMsg) XXX_Size() int
- func (m *CreateMsg) XXX_Unmarshal(b []byte) error
- type Initializer
- type TokenInfo
- func (*TokenInfo) Descriptor() ([]byte, []int)
- func (m *TokenInfo) GetMetadata() *weave.Metadata
- func (m *TokenInfo) GetName() string
- func (m *TokenInfo) Marshal() (dAtA []byte, err error)
- func (m *TokenInfo) MarshalTo(dAtA []byte) (int, error)
- func (*TokenInfo) ProtoMessage()
- func (m *TokenInfo) Reset()
- func (m *TokenInfo) Size() (n int)
- func (m *TokenInfo) String() string
- func (m *TokenInfo) Unmarshal(dAtA []byte) error
- func (t *TokenInfo) Validate() error
- func (m *TokenInfo) XXX_DiscardUnknown()
- func (m *TokenInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TokenInfo) XXX_Merge(src proto.Message)
- func (m *TokenInfo) XXX_Size() int
- func (m *TokenInfo) XXX_Unmarshal(b []byte) error
- type TokenInfoBucket
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthCodec = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowCodec = fmt.Errorf("proto: integer overflow") )
Functions ¶
func NewTokenInfo ¶
NewTokenInfo returns a new instance of Token Info, as represented by orm object.
func RegisterQuery ¶
func RegisterQuery(qr weave.QueryRouter)
func RegisterRoutes ¶
Types ¶
type CreateMsg ¶ added in v0.17.0
type CreateMsg struct { Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` Ticker string `protobuf:"bytes,2,opt,name=ticker,proto3" json:"ticker,omitempty"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` }
CreateMsg will register a new currency. Ticker (currency symbol) can be registered only once.
func (*CreateMsg) Descriptor ¶ added in v0.17.0
func (*CreateMsg) GetMetadata ¶ added in v0.17.0
func (*CreateMsg) ProtoMessage ¶ added in v0.17.0
func (*CreateMsg) ProtoMessage()
func (*CreateMsg) XXX_DiscardUnknown ¶ added in v0.17.0
func (m *CreateMsg) XXX_DiscardUnknown()
func (*CreateMsg) XXX_Marshal ¶ added in v0.17.0
func (*CreateMsg) XXX_Unmarshal ¶ added in v0.17.0
type Initializer ¶
type Initializer struct{}
Initializer fulfils the Initializer interface to load data from the genesis file
func (*Initializer) FromGenesis ¶
func (*Initializer) FromGenesis(opts weave.Options, params weave.GenesisParams, kv weave.KVStore) error
FromGenesis will parse initial account info from genesis and save it to the database
type TokenInfo ¶
type TokenInfo struct { Metadata *weave.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` }
TokenInfo contains information about a single currency. It is used as an alternative solution to hardcoding supported currencies information.
func (*TokenInfo) Descriptor ¶
func (*TokenInfo) GetMetadata ¶ added in v0.15.0
func (*TokenInfo) ProtoMessage ¶
func (*TokenInfo) ProtoMessage()
func (*TokenInfo) XXX_DiscardUnknown ¶ added in v0.12.0
func (m *TokenInfo) XXX_DiscardUnknown()
func (*TokenInfo) XXX_Marshal ¶ added in v0.12.0
func (*TokenInfo) XXX_Unmarshal ¶ added in v0.12.0
type TokenInfoBucket ¶
TokenInfoBucket stores TokenInfo instances, using ticker name (currency symbol) as the key.
func NewTokenInfoBucket ¶
func NewTokenInfoBucket() *TokenInfoBucket