indexer

package
v0.1.7-0...-f014df5 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScriptTypeLock ScriptType = "lock"
	ScriptTypeType ScriptType = "type"

	SearchOrderAsc  SearchOrder = "asc"
	SearchOrderDesc SearchOrder = "desc"

	IOTypeIn  IoType = "input"
	IOTypeOut IoType = "output"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Capacity

type Capacity struct {
	Capacity    uint64     `json:"capacity"`
	BlockHash   types.Hash `json:"block_hash"`
	BlockNumber uint64     `json:"block_number"`
}

type Client

type Client interface {
	// GetCells returns the live cells collection by the lock or type script.
	GetCells(ctx context.Context, searchKey *SearchKey, order SearchOrder, limit uint64, afterCursor string) (*LiveCells, error)

	// GetTransactions returns the transactions collection by the lock or type script.
	GetTransactions(ctx context.Context, searchKey *SearchKey, order SearchOrder, limit uint64, afterCursor string) (*Transactions, error)

	//GetTip returns the latest height processed by indexer
	GetTip(ctx context.Context) (*TipHeader, error)

	//GetCellsCapacity returns the live cells capacity by the lock or type script.
	GetCellsCapacity(ctx context.Context, searchKey *SearchKey) (*Capacity, error)

	// Close close client
	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 IoType

type IoType string

type LiveCell

type LiveCell struct {
	BlockNumber uint64            `json:"block_number"`
	OutPoint    *types.OutPoint   `json:"out_point"`
	Output      *types.CellOutput `json:"output"`
	OutputData  []byte            `json:"output_data"`
	TxIndex     uint              `json:"tx_index"`
}

type LiveCells

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

type ScriptType

type ScriptType string

type SearchKey

type SearchKey struct {
	Script     *types.Script `json:"script"`
	ScriptType ScriptType    `json:"script_type"`
	ArgsLen    uint          `json:"args_len,omitempty"`
}

type SearchOrder

type SearchOrder string

type TipHeader

type TipHeader struct {
	BlockHash   types.Hash `json:"block_hash"`
	BlockNumber uint64     `json:"block_number"`
}

type Transaction

type Transaction struct {
	BlockNumber uint64     `json:"block_number"`
	IoIndex     uint       `json:"io_index"`
	IoType      IoType     `json:"io_type"`
	TxHash      types.Hash `json:"tx_hash"`
	TxIndex     uint       `json:"tx_index"`
}

type Transactions

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

Jump to

Keyboard shortcuts

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