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, error) Storage() (Storage, error) BatchSize() int HttpServer(http.Handler) http.Server Listener() net.Listener Logger() *slog.Logger SystemID() types.SystemID APIAddr() string }
func NewConfig ¶
func NewConfig(systemID types.SystemID, apiAddr, abURL, boltDB string, observe Observability) 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 ¶
type FeeCreditBill struct { Id []byte `json:"id"` Value uint64 `json:"value,string"` TxHash []byte `json:"txHash"` Locked wallet.LockReason `json:"locked,string"` }
func (*FeeCreditBill) GetID ¶
func (f *FeeCreditBill) GetID() []byte
func (*FeeCreditBill) GetTxHash ¶
func (f *FeeCreditBill) GetTxHash() []byte
func (*FeeCreditBill) GetValue ¶
func (f *FeeCreditBill) GetValue() uint64
func (*FeeCreditBill) ToGenericBill ¶
func (f *FeeCreditBill) ToGenericBill() *wallet.Bill
type Observability ¶
type Observability interface { Tracer(name string, options ...trace.TracerOption) trace.Tracer TracerProvider() trace.TracerProvider Logger() *slog.Logger }
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 }
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"` Locked uint64 `json:"locked"` // 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.