rpc

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

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

func DialContext(ctx context.Context, url string) (*Client, error)

DialContext connects a client to the given URL with context.

func NewClient

func NewClient(c *ethrpc.Client) *Client

NewClient creates a client that uses the given RPC client.

func (*Client) Client

func (c *Client) Client() *ethrpc.Client

Client gets the underlying RPC client.

func (*Client) Close

func (c *Client) Close()

Close closes the underlying RPC connection.

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

func (c *Client) GetBlock(ctx context.Context, roundNumber uint64) (*types.Block, error)

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

func (c *Client) GetRoundNumber(ctx context.Context) (uint64, error)

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

func (c *Client) SendTransaction(ctx context.Context, tx *types.TransactionOrder) ([]byte, error)

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

func (c *TokensClient) GetToken(ctx context.Context, id tokens.TokenID) (*tokens.TokenUnit, error)

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).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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