Documentation ¶
Index ¶
- type Observability
- type TokenBackend
- func (tb *TokenBackend) GetFeeCreditBill(ctx context.Context, unitID types.UnitID) (*sdk.Bill, error)
- func (tb *TokenBackend) GetInfo(ctx context.Context) (*sdk.InfoResponse, error)
- func (tb *TokenBackend) GetRoundNumber(ctx context.Context) (*sdk.RoundNumber, error)
- func (tb *TokenBackend) GetToken(ctx context.Context, id backend.TokenID) (*backend.TokenUnit, error)
- func (tb *TokenBackend) GetTokenTypes(ctx context.Context, kind backend.Kind, creator sdk.PubKey, offset string, ...) ([]*backend.TokenUnitType, string, error)
- func (tb *TokenBackend) GetTokens(ctx context.Context, kind backend.Kind, owner sdk.PubKey, offset string, ...) ([]*backend.TokenUnit, string, error)
- func (tb *TokenBackend) GetTxProof(ctx context.Context, unitID types.UnitID, txHash sdk.TxHash) (*sdk.Proof, error)
- func (tb *TokenBackend) GetTypeHierarchy(ctx context.Context, id backend.TokenTypeID) ([]*backend.TokenUnitType, error)
- func (tb *TokenBackend) PostTransactions(ctx context.Context, pubKey sdk.PubKey, txs *sdk.Transactions) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Observability ¶
type Observability interface {
TracerProvider() trace.TracerProvider
}
type TokenBackend ¶
type TokenBackend struct {
// contains filtered or unexported fields
}
func New ¶
func New(abAddr url.URL, observe Observability) *TokenBackend
New creates REST API client for token wallet backend. The "abAddr" is address of the backend, Scheme and Host fields must be assigned.
func (*TokenBackend) GetFeeCreditBill ¶
func (*TokenBackend) GetInfo ¶
func (tb *TokenBackend) GetInfo(ctx context.Context) (*sdk.InfoResponse, error)
func (*TokenBackend) GetRoundNumber ¶
func (tb *TokenBackend) GetRoundNumber(ctx context.Context) (*sdk.RoundNumber, error)
func (*TokenBackend) GetTokenTypes ¶
func (tb *TokenBackend) GetTokenTypes(ctx context.Context, kind backend.Kind, creator sdk.PubKey, offset string, limit int) ([]*backend.TokenUnitType, string, error)
GetTokenTypes returns token types of particular kind (may be Any, ie all kinds), the optional "creator" parameter allows to further filter the types by it's creator public key. The "offsetKey" and "limit" parameters are for batched / paginated query support.
Returns:
- token types matching the query;
- offset for the next batch (if empty then there is no more data to query);
- non-nil error when something failed;
func (*TokenBackend) GetTokens ¶
func (tb *TokenBackend) GetTokens(ctx context.Context, kind backend.Kind, owner sdk.PubKey, offset string, limit int) ([]*backend.TokenUnit, string, error)
GetTokens returns tokens owned by "owner" and matching "kind" (may be Any, ie all kinds). For batched querying "offsetKey" must be set to the value returned by previous batch, empty string means "start from the beginning of the dataset". The "limit" parameter allows to set the max batch size (but smaller result set might be returned even when there is more data in the backend ie the "offsetKey" returned is not empty).
Returns:
- tokens matching the query;
- offset for the next batch (if empty then there is no more data to query);
- non-nil error when something failed;
func (*TokenBackend) GetTxProof ¶
func (*TokenBackend) GetTypeHierarchy ¶
func (tb *TokenBackend) GetTypeHierarchy(ctx context.Context, id backend.TokenTypeID) ([]*backend.TokenUnitType, error)
func (*TokenBackend) PostTransactions ¶
func (tb *TokenBackend) PostTransactions(ctx context.Context, pubKey sdk.PubKey, txs *sdk.Transactions) error