Documentation ¶
Index ¶
- type AdminClient
- type Client
- func (c *Client) Client() *ethrpc.Client
- func (c *Client) Close()
- func (c *Client) GetBill(ctx context.Context, unitID types.UnitID, includeStateProof bool) (*api.Bill, error)
- func (c *Client) GetBlock(ctx context.Context, roundNumber uint64) (*types.Block, error)
- func (c *Client) GetFeeCreditRecord(ctx context.Context, unitID types.UnitID, includeStateProof bool) (*api.FeeCreditBill, error)
- func (c *Client) GetRoundNumber(ctx context.Context) (uint64, error)
- func (c *Client) GetTransactionProof(ctx context.Context, txHash types.Bytes) (*types.TransactionRecord, *types.TxProof, error)
- func (c *Client) GetUnitsByOwnerID(ctx context.Context, ownerID types.Bytes) ([]types.UnitID, error)
- func (c *Client) SendTransaction(ctx context.Context, tx *types.TransactionOrder) ([]byte, error)
- type TokensClient
- func (c *TokensClient) GetToken(ctx context.Context, id tokens.TokenID) (*tokens.TokenUnit, error)
- func (c *TokensClient) GetTokenTypes(ctx context.Context, kind tokens.Kind, creator wallet.PubKey) ([]*tokens.TokenUnitType, error)
- func (c *TokensClient) GetTokens(ctx context.Context, kind tokens.Kind, ownerID []byte) ([]*tokens.TokenUnit, error)
- func (c *TokensClient) GetTypeHierarchy(ctx context.Context, typeID tokens.TokenTypeID) ([]*tokens.TokenUnitType, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminClient ¶ added in v0.4.0
type AdminClient struct {
// contains filtered or unexported fields
}
AdminClient defines typed wrappers for the Alphabill RPC admin service API.
func NewAdminClient ¶ added in v0.4.0
func NewAdminClient(c *ethrpc.Client) *AdminClient
NewAdminClient creates admin client that uses the given RPC client.
func (*AdminClient) Client ¶ added in v0.4.0
func (c *AdminClient) Client() *ethrpc.Client
Client gets the underlying RPC client.
func (*AdminClient) Close ¶ added in v0.4.0
func (c *AdminClient) Close()
Close closes the underlying RPC connection.
func (*AdminClient) GetNodeInfo ¶ added in v0.4.0
func (c *AdminClient) GetNodeInfo(ctx context.Context) (*rpc.NodeInfoResponse, error)
GetNodeInfo returns status info of the rpc node.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client defines typed wrappers for the Alphabill RPC API.
func DialContext ¶
DialContext connects a client to the given URL with context.
func (*Client) GetBill ¶ added in v0.4.0
func (c *Client) GetBill(ctx context.Context, unitID types.UnitID, includeStateProof bool) (*api.Bill, error)
GetBill returns bill for the given bill id. Returns api.ErrNotFound if the bill does not exist.
func (*Client) GetBlock ¶ added in v0.4.0
GetBlock returns block for the given round number. Returns ErrNotFound if the block does not exist.
func (*Client) GetFeeCreditRecord ¶ added in v0.4.0
func (c *Client) GetFeeCreditRecord(ctx context.Context, unitID types.UnitID, includeStateProof bool) (*api.FeeCreditBill, error)
GetFeeCreditRecord returns fee credit bill for the given bill id. Returns api.ErrNotFound if the fee credit bill does not exist.
func (*Client) GetRoundNumber ¶
GetRoundNumber returns the latest round number seen by the rpc node.
func (*Client) GetTransactionProof ¶ added in v0.4.0
func (c *Client) GetTransactionProof(ctx context.Context, txHash types.Bytes) (*types.TransactionRecord, *types.TxProof, error)
GetTransactionProof returns transaction record and proof for the given transaction hash. Returns api.ErrNotFound if proof was not found.
func (*Client) GetUnitsByOwnerID ¶ added in v0.4.0
func (c *Client) GetUnitsByOwnerID(ctx context.Context, ownerID types.Bytes) ([]types.UnitID, error)
GetUnitsByOwnerID returns list of unit identifiers that belong to the given owner.
func (*Client) SendTransaction ¶ added in v0.4.0
SendTransaction broadcasts the given transaction to the network, returns the submitted transaction hash.
type TokensClient ¶ added in v0.4.0
type TokensClient struct {
*Client
}
TokensClient defines typed wrappers for the Alphabill RPC API.
func NewTokensClient ¶ added in v0.4.0
func NewTokensClient(c *Client) *TokensClient
NewTokensClient creates a client that uses the given RPC client.
func (*TokensClient) GetToken ¶ added in v0.4.0
GetToken returns token for the given token id. Returns api.ErrNotFound if the token does not exist.
func (*TokensClient) GetTokenTypes ¶ added in v0.4.0
func (c *TokensClient) GetTokenTypes(ctx context.Context, kind tokens.Kind, creator wallet.PubKey) ([]*tokens.TokenUnitType, error)
func (*TokensClient) GetTokens ¶ added in v0.4.0
func (c *TokensClient) GetTokens(ctx context.Context, kind tokens.Kind, ownerID []byte) ([]*tokens.TokenUnit, error)
GetTokens returns tokens for the given owner id.
func (*TokensClient) GetTypeHierarchy ¶ added in v0.4.0
func (c *TokensClient) GetTypeHierarchy(ctx context.Context, typeID tokens.TokenTypeID) ([]*tokens.TokenUnitType, error)
GetTypeHierarchy returns type hierarchy for given token type id where the root type is the last element (no parent).