lightclient

package
v2.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	SetScripts(ctx context.Context, scriptDetails []*ScriptDetail) error
	GetScripts(ctx context.Context) ([]*ScriptDetail, error)
	SendTransaction(ctx context.Context, tx *types.Transaction) (*types.Hash, error)
	GetTipHeader(ctx context.Context) (*types.Header, error)
	GetGenesisBlock(ctx context.Context) (*types.Block, error)
	GetHeader(ctx context.Context, hash types.Hash) (*types.Header, error)
	GetTransaction(ctx context.Context, hash types.Hash) (*TransactionWithHeader, error)
	FetchHeader(ctx context.Context, hash types.Hash) (*FetchedHeader, error)
	FetchTransaction(ctx context.Context, hash types.Hash) (*FetchedTransaction, error)
	GetCells(ctx context.Context, searchKey *indexer.SearchKey, order indexer.SearchOrder, limit uint64, afterCursor string) (*indexer.LiveCells, error)
	GetTransactions(ctx context.Context, searchKey *indexer.SearchKey, order indexer.SearchOrder, limit uint64, afterCursor string) (*TxsWithCell, error)
	GetTransactionsGrouped(ctx context.Context, searchKey *indexer.SearchKey, order indexer.SearchOrder, limit uint64, afterCursor string) (*TxsWithCells, error)
	GetCellsCapacity(ctx context.Context, searchKey *indexer.SearchKey) (*indexer.Capacity, error)
	CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error
	Close()
}

func Dial

func Dial(url string) (Client, error)

func DialContext

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

func NewClient

func NewClient(c *rpc.Client) Client

type FetchStatus

type FetchStatus string
const (
	FetchStatusFetched  FetchStatus = "fetched"
	FetchStatusFetching FetchStatus = "fetching"
	FetchStatusAdded    FetchStatus = "added"
	FetchStatusNotFound FetchStatus = "not_found"
)

type FetchedHeader

type FetchedHeader struct {
	Status    FetchStatus   `json:"status"`
	Data      *types.Header `json:"data"`
	FirstSent uint64        `json:"first_sent"`
	TimeStamp uint64        `json:"time_stamp"`
}

func (*FetchedHeader) UnmarshalJSON

func (r *FetchedHeader) UnmarshalJSON(input []byte) error

type FetchedTransaction

type FetchedTransaction struct {
	Status    FetchStatus            `json:"status"`
	Data      *TransactionWithHeader `json:"data"`
	FirstSent uint64                 `json:"first_sent"`
	TimeStamp uint64                 `json:"time_stamp"`
}

func (*FetchedTransaction) UnmarshalJSON

func (r *FetchedTransaction) UnmarshalJSON(input []byte) error

type ScriptDetail

type ScriptDetail struct {
	Script      *types.Script    `json:"script"`
	ScriptType  types.ScriptType `json:"script_type"`
	BlockNumber uint64           `json:"block_number"`
}

func (ScriptDetail) MarshalJSON

func (r ScriptDetail) MarshalJSON() ([]byte, error)

func (*ScriptDetail) UnmarshalJSON

func (r *ScriptDetail) UnmarshalJSON(input []byte) error

type TransactionWithHeader

type TransactionWithHeader struct {
	Transaction *types.Transaction `json:"transaction"`
	Header      *types.Header      `json:"header"`
}

type TxWithCell

type TxWithCell struct {
	BlockNumber uint64             `json:"block_number"`
	IoIndex     uint               `json:"io_index"`
	IoType      indexer.IoType     `json:"io_type"`
	Transaction *types.Transaction `json:"transaction"`
	TxIndex     uint               `json:"tx_index"`
}

func (*TxWithCell) UnmarshalJSON

func (r *TxWithCell) UnmarshalJSON(input []byte) error

type TxWithCells

type TxWithCells struct {
	Transaction *types.Transaction `json:"transaction"`
	BlockNumber uint64             `json:"block_number"`
	TxIndex     uint               `json:"tx_index"`
	Cells       []*indexer.Cell    `json:"Cells"`
}

func (*TxWithCells) UnmarshalJSON

func (r *TxWithCells) UnmarshalJSON(input []byte) error

type TxsWithCell

type TxsWithCell struct {
	LastCursor string        `json:"last_cursor"`
	Objects    []*TxWithCell `json:"objects"`
}

type TxsWithCells

type TxsWithCells struct {
	LastCursor string         `json:"last_cursor"`
	Objects    []*TxWithCells `json:"objects"`
}

Jump to

Keyboard shortcuts

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