jsonrpc

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package jsonrpc implements the core/rpc/client/user.TxSvcClient interface that is required by core/client.Client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*rpcclient.JSONRPCClient
}

Client is a JSON-RPC client for the Kwil user service. It use the JSONRPCClient from the rpcclient package for the actual JSON-RPC communication, and implements the user.TxSvcClient interface.

func NewClient

func NewClient(url *url.URL, opts ...rpcclient.RPCClientOpts) *Client

func (*Client) Broadcast

func (cl *Client) Broadcast(ctx context.Context, tx *transactions.Transaction, sync rpcclient.BroadcastWait) ([]byte, error)

func (*Client) Call

func (cl *Client) Call(ctx context.Context, msg *transactions.CallMessage, opts ...rpcclient.ActionCallOption) ([]map[string]any, []string, error)

func (*Client) ChainInfo

func (cl *Client) ChainInfo(ctx context.Context) (*types.ChainInfo, error)

func (*Client) Challenge added in v0.3.0

func (cl *Client) Challenge(ctx context.Context) ([]byte, error)

func (*Client) ChangesetMetadata added in v0.3.0

func (cl *Client) ChangesetMetadata(ctx context.Context, height int64) (numChangesets int64, changesetsSizes []int64, err error)

ChangesetMetadata gets metadata about the changesets at the given height.

func (*Client) EstimateCost

func (cl *Client) EstimateCost(ctx context.Context, tx *transactions.Transaction) (*big.Int, error)

func (*Client) GenesisSnapshotChunk added in v0.3.0

func (cl *Client) GenesisSnapshotChunk(ctx context.Context, height uint64, chunkIdx uint32) ([]byte, error)

GenesisSnapshotChunk returns a chunk of the genesis snapshot at the given height and chunkIdx.

func (*Client) GenesisState added in v0.3.0

func (cl *Client) GenesisState(ctx context.Context) (*types.MigrationMetadata, error)

GenesisState returns the genesis state of the chain.

func (*Client) GetAccount

func (cl *Client) GetAccount(ctx context.Context, pubKey []byte, status types.AccountStatus) (*types.Account, error)

func (*Client) GetSchema

func (cl *Client) GetSchema(ctx context.Context, dbid string) (*types.Schema, error)

func (*Client) Health added in v0.3.0

func (cl *Client) Health(ctx context.Context) (*types.Health, error)

func (*Client) ListDatabases

func (cl *Client) ListDatabases(ctx context.Context, ownerPubKey []byte) ([]*types.DatasetIdentifier, error)

func (*Client) ListMigrations added in v0.3.0

func (cl *Client) ListMigrations(ctx context.Context) ([]*types.Migration, error)

ListMigrations lists all migrations that have been proposed that are still in the pending state.

func (*Client) LoadChangeset added in v0.3.0

func (cl *Client) LoadChangeset(ctx context.Context, height int64, index int64) ([]byte, error)

LoadChangesets loads changesets from the node's database at the given height.

func (*Client) MigrationStatus added in v0.3.0

func (cl *Client) MigrationStatus(ctx context.Context) (*types.MigrationState, error)

func (*Client) Ping

func (cl *Client) Ping(ctx context.Context) (string, error)

func (*Client) Query

func (cl *Client) Query(ctx context.Context, dbid, query string) ([]map[string]any, error)

func (*Client) TxQuery

func (cl *Client) TxQuery(ctx context.Context, txHash []byte) (*transactions.TcTxQueryResponse, error)

Jump to

Keyboard shortcuts

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