currency

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2019 License: Apache-2.0 Imports: 10 Imported by: 5

Documentation

Overview

Package currency is a generated protocol buffer package.

It is generated from these files:
	x/currency/codec.proto

It has these top-level messages:
	TokenInfo
	NewTokenInfoMsg

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

Constants

View Source
const (
	CodeInvalidToken = 2000
)

Variables

View Source
var (
	ErrInvalidLengthCodec = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowCodec   = fmt.Errorf("proto: integer overflow")
)

Functions

func ErrDuplicateToken

func ErrDuplicateToken(name string) error

func ErrInvalidSigFigs

func ErrInvalidSigFigs(figs int32) error

func ErrInvalidTokenName

func ErrInvalidTokenName(name string) error

func NewTokenInfo

func NewTokenInfo(ticker, name string, sigFigs int32) orm.Object

NewTokenInfo returns a new instance of Token Info, as represented by orm object.

func NewTokenInfoHandler

func NewTokenInfoHandler(auth x.Authenticator, issuer weave.Address) weave.Handler

func RegisterQuery

func RegisterQuery(qr weave.QueryRouter)

func RegisterRoutes

func RegisterRoutes(r weave.Registry, auth x.Authenticator, issuer weave.Address)

Types

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, db weave.KVStore) error

FromGenesis will parse initial account info from genesis and save it to the database

type NewTokenInfoMsg

type NewTokenInfoMsg struct {
	Ticker  string `protobuf:"bytes,1,opt,name=ticker,proto3" json:"ticker,omitempty"`
	Name    string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	SigFigs int32  `protobuf:"varint,3,opt,name=sig_figs,json=sigFigs,proto3" json:"sig_figs,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) GetName

func (m *NewTokenInfoMsg) GetName() string

func (*NewTokenInfoMsg) GetSigFigs

func (m *NewTokenInfoMsg) GetSigFigs() int32

func (*NewTokenInfoMsg) GetTicker

func (m *NewTokenInfoMsg) GetTicker() string

func (*NewTokenInfoMsg) Marshal

func (m *NewTokenInfoMsg) Marshal() (dAtA []byte, err error)

func (*NewTokenInfoMsg) MarshalTo

func (m *NewTokenInfoMsg) MarshalTo(dAtA []byte) (int, 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

type TokenInfo

type TokenInfo struct {
	Name    string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	SigFigs int32  `protobuf:"varint,2,opt,name=sig_figs,json=sigFigs,proto3" json:"sig_figs,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) Descriptor() ([]byte, []int)

func (*TokenInfo) GetName

func (m *TokenInfo) GetName() string

func (*TokenInfo) GetSigFigs

func (m *TokenInfo) GetSigFigs() int32

func (*TokenInfo) Marshal

func (m *TokenInfo) Marshal() (dAtA []byte, err error)

func (*TokenInfo) MarshalTo

func (m *TokenInfo) MarshalTo(dAtA []byte) (int, error)

func (*TokenInfo) ProtoMessage

func (*TokenInfo) ProtoMessage()

func (*TokenInfo) Reset

func (m *TokenInfo) Reset()

func (*TokenInfo) Size

func (m *TokenInfo) Size() (n int)

func (*TokenInfo) String

func (m *TokenInfo) String() string

func (*TokenInfo) Unmarshal

func (m *TokenInfo) Unmarshal(dAtA []byte) error

func (*TokenInfo) Validate

func (t *TokenInfo) Validate() error

type TokenInfoBucket

type TokenInfoBucket struct {
	orm.Bucket
}

TockenInfoBucket stores TokenInfo instances, using ticker name (currency symbol) as the key.

func NewTokenInfoBucket

func NewTokenInfoBucket() *TokenInfoBucket

func (*TokenInfoBucket) Get

func (b *TokenInfoBucket) Get(db weave.KVStore, ticker string) (orm.Object, error)

func (*TokenInfoBucket) Save

func (b *TokenInfoBucket) Save(db weave.KVStore, obj orm.Object) error

type TokenInfoHandler

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

func (*TokenInfoHandler) Check

func (*TokenInfoHandler) Deliver

Jump to

Keyboard shortcuts

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