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 NewTokenInfoHandler(auth x.Authenticator, issuer weave.Address) weave.Handler
- func RegisterQuery(qr weave.QueryRouter)
- func RegisterRoutes(r weave.Registry, auth x.Authenticator, issuer weave.Address)
- type Initializer
- type NewTokenInfoMsg
- func (*NewTokenInfoMsg) Descriptor() ([]byte, []int)
- func (m *NewTokenInfoMsg) GetMetadata() *weave.Metadata
- func (m *NewTokenInfoMsg) GetName() string
- func (m *NewTokenInfoMsg) GetTicker() string
- func (m *NewTokenInfoMsg) Marshal() (dAtA []byte, err error)
- func (m *NewTokenInfoMsg) MarshalTo(dAtA []byte) (int, error)
- func (NewTokenInfoMsg) Path() string
- func (*NewTokenInfoMsg) ProtoMessage()
- func (m *NewTokenInfoMsg) Reset()
- func (m *NewTokenInfoMsg) Size() (n int)
- func (m *NewTokenInfoMsg) String() string
- func (m *NewTokenInfoMsg) Unmarshal(dAtA []byte) error
- func (t *NewTokenInfoMsg) Validate() error
- func (m *NewTokenInfoMsg) XXX_DiscardUnknown()
- func (m *NewTokenInfoMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *NewTokenInfoMsg) XXX_Merge(src proto.Message)
- func (m *NewTokenInfoMsg) XXX_Size() int
- func (m *NewTokenInfoMsg) XXX_Unmarshal(b []byte) error
- type TokenInfo
- func (t *TokenInfo) Copy() orm.CloneableData
- 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
- type TokenInfoHandler
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 NewTokenInfoHandler ¶
func RegisterQuery ¶
func RegisterQuery(qr weave.QueryRouter)
func RegisterRoutes ¶
Types ¶
type Initializer ¶
type Initializer struct{}
Initializer fulfils the Initializer interface to load data from the genesis file
func (*Initializer) FromGenesis ¶
FromGenesis will parse initial account info from genesis and save it to the database
type NewTokenInfoMsg ¶
type NewTokenInfoMsg 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"` }
NewTokenInfoMsg will register a new currency. Ticker (currency symbol) can be registered only once.
func (*NewTokenInfoMsg) Descriptor ¶
func (*NewTokenInfoMsg) Descriptor() ([]byte, []int)
func (*NewTokenInfoMsg) GetMetadata ¶ added in v0.15.0
func (m *NewTokenInfoMsg) GetMetadata() *weave.Metadata
func (*NewTokenInfoMsg) GetName ¶
func (m *NewTokenInfoMsg) GetName() string
func (*NewTokenInfoMsg) GetTicker ¶
func (m *NewTokenInfoMsg) GetTicker() string
func (*NewTokenInfoMsg) Marshal ¶
func (m *NewTokenInfoMsg) Marshal() (dAtA []byte, err error)
func (NewTokenInfoMsg) Path ¶
func (NewTokenInfoMsg) Path() string
func (*NewTokenInfoMsg) ProtoMessage ¶
func (*NewTokenInfoMsg) ProtoMessage()
func (*NewTokenInfoMsg) Reset ¶
func (m *NewTokenInfoMsg) Reset()
func (*NewTokenInfoMsg) Size ¶
func (m *NewTokenInfoMsg) Size() (n int)
func (*NewTokenInfoMsg) String ¶
func (m *NewTokenInfoMsg) String() string
func (*NewTokenInfoMsg) Unmarshal ¶
func (m *NewTokenInfoMsg) Unmarshal(dAtA []byte) error
func (*NewTokenInfoMsg) Validate ¶
func (t *NewTokenInfoMsg) Validate() error
func (*NewTokenInfoMsg) XXX_DiscardUnknown ¶ added in v0.12.0
func (m *NewTokenInfoMsg) XXX_DiscardUnknown()
func (*NewTokenInfoMsg) XXX_Marshal ¶ added in v0.12.0
func (m *NewTokenInfoMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*NewTokenInfoMsg) XXX_Merge ¶ added in v0.12.0
func (m *NewTokenInfoMsg) XXX_Merge(src proto.Message)
func (*NewTokenInfoMsg) XXX_Size ¶ added in v0.12.0
func (m *NewTokenInfoMsg) XXX_Size() int
func (*NewTokenInfoMsg) XXX_Unmarshal ¶ added in v0.12.0
func (m *NewTokenInfoMsg) XXX_Unmarshal(b []byte) error
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) Copy ¶
func (t *TokenInfo) Copy() orm.CloneableData
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 ¶
TockenInfoBucket stores TokenInfo instances, using ticker name (currency symbol) as the key.
func NewTokenInfoBucket ¶
func NewTokenInfoBucket() *TokenInfoBucket
type TokenInfoHandler ¶
type TokenInfoHandler struct {
// contains filtered or unexported fields
}