Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
NoParent = TokenTypeID(make([]byte, crypto.SHA256.Size()))
)
Functions ¶
Types ¶
type Configuration ¶
type Configuration interface { Client() ABClient Storage() (Storage, error) BatchSize() int HttpServer(http.Handler) http.Server Listener() net.Listener Logger() log.Logger SystemID() []byte APIAddr() string }
func NewConfig ¶
func NewConfig(apiAddr, abURL, boltDB string, logger log.Logger, systemID []byte) Configuration
NewConfig returns Configuration suitable for using as Run parameter.
- apiAddr: address on which to expose REST API;
- abURL: AlphaBill backend from where to sync blocks;
- boltDB: filename (with full path) of the bolt db to use as storage;
- logger: logger implementation.
type FeeCreditBill ¶ added in v0.2.0
type FeeCreditBill struct { Id []byte `json:"id"` Value uint64 `json:"value,string"` TxHash []byte `json:"txHash"` LastAddFCTxHash []byte `json:"lastAddFcTxHash"` }
func (*FeeCreditBill) GetID ¶ added in v0.2.0
func (f *FeeCreditBill) GetID() []byte
func (*FeeCreditBill) GetLastAddFCTxHash ¶ added in v0.2.0
func (f *FeeCreditBill) GetLastAddFCTxHash() []byte
func (*FeeCreditBill) GetTxHash ¶ added in v0.2.0
func (f *FeeCreditBill) GetTxHash() []byte
func (*FeeCreditBill) GetValue ¶ added in v0.2.0
func (f *FeeCreditBill) GetValue() uint64
func (*FeeCreditBill) ToGenericBill ¶ added in v0.2.0
func (f *FeeCreditBill) ToGenericBill() *wallet.Bill
type RoundNumberResponse ¶
type RoundNumberResponse struct {
RoundNumber uint64 `json:"roundNumber,string"`
}
type Storage ¶
type Storage interface { Close() error GetBlockNumber() (uint64, error) SetBlockNumber(blockNumber uint64) error SaveTokenTypeCreator(id TokenTypeID, kind Kind, creator sdk.PubKey) error SaveTokenType(data *TokenUnitType, proof *sdk.Proof) error GetTokenType(id TokenTypeID) (*TokenUnitType, error) QueryTokenType(kind Kind, creator sdk.PubKey, startKey TokenTypeID, count int) ([]*TokenUnitType, TokenTypeID, error) SaveToken(data *TokenUnit, proof *sdk.Proof) error RemoveToken(id TokenID) error GetToken(id TokenID) (*TokenUnit, error) QueryTokens(kind Kind, owner sdk.Predicate, startKey TokenID, count int) ([]*TokenUnit, TokenID, error) GetTxProof(unitID types.UnitID, txHash sdk.TxHash) (*sdk.Proof, error) GetFeeCreditBill(unitID types.UnitID) (*FeeCreditBill, error) SetFeeCreditBill(fcb *FeeCreditBill, proof *sdk.Proof) error GetClosedFeeCredit(fcbID types.UnitID) (*types.TransactionRecord, error) SetClosedFeeCredit(fcbID types.UnitID, txr *types.TransactionRecord) error }
type TokenTypeID ¶
type TokenUnit ¶
type TokenUnit struct { // common ID TokenID `json:"id"` Symbol string `json:"symbol"` TypeID TokenTypeID `json:"typeId"` TypeName string `json:"typeName"` Owner wallet.Predicate `json:"owner"` // fungible only Amount uint64 `json:"amount,omitempty,string"` Decimals uint32 `json:"decimals,omitempty"` Burned bool `json:"burned,omitempty"` // nft only NftName string `json:"nftName,omitempty"` NftURI string `json:"nftUri,omitempty"` NftData []byte `json:"nftData,omitempty"` NftDataUpdatePredicate wallet.Predicate `json:"nftDataUpdatePredicate,omitempty"` // meta Kind Kind `json:"kind"` TxHash wallet.TxHash `json:"txHash"` }
type TokenUnitType ¶
type TokenUnitType struct { // common ID TokenTypeID `json:"id"` ParentTypeID TokenTypeID `json:"parentTypeId"` Symbol string `json:"symbol"` Name string `json:"name,omitempty"` Icon *tokens.Icon `json:"icon,omitempty"` SubTypeCreationPredicate wallet.Predicate `json:"subTypeCreationPredicate,omitempty"` TokenCreationPredicate wallet.Predicate `json:"tokenCreationPredicate,omitempty"` InvariantPredicate wallet.Predicate `json:"invariantPredicate,omitempty"` // fungible only DecimalPlaces uint32 `json:"decimalPlaces,omitempty"` // nft only NftDataUpdatePredicate wallet.Predicate `json:"nftDataUpdatePredicate,omitempty"` // meta Kind Kind `json:"kind"` TxHash wallet.TxHash `json:"txHash"` }
Click to show internal directories.
Click to hide internal directories.