client

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package client provides a GraphQL client for consuming logs.

Index

Constants

View Source
const GetBlockTimeCountDocument = `query GetBlockTimeCount ($chain_id: Int!) {
	response: blockTimeCount(chain_id: $chain_id)
}
`
View Source
const GetBlockTimeDocument = `` /* 133-byte string literal not displayed */
View Source
const GetFirstStoredBlockNumberDocument = `query GetFirstStoredBlockNumber ($chain_id: Int!) {
	response: firstStoredBlockNumber(chain_id: $chain_id)
}
`
View Source
const GetLastIndexedDocument = `` /* 152-byte string literal not displayed */
View Source
const GetLastStoredBlockNumberDocument = `query GetLastStoredBlockNumber ($chain_id: Int!) {
	response: lastStoredBlockNumber(chain_id: $chain_id)
}
`
View Source
const GetLogCountDocument = `` /* 146-byte string literal not displayed */
View Source
const GetLogsRangeDocument = `` /* 379-byte string literal not displayed */
View Source
const GetTxSenderDocument = `query GetTxSender ($chain_id: Int!, $tx_hash: String!) {
	response: txSender(chain_id: $chain_id, tx_hash: $tx_hash)
}
`

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Client *client.Client
}

func NewClient

func NewClient(cli *http.Client, baseURL string, options ...client.HTTPRequestOption) *Client

func (*Client) GetBlockTime added in v0.0.9

func (c *Client) GetBlockTime(ctx context.Context, chainID int, blockNumber int, httpRequestOptions ...client.HTTPRequestOption) (*GetBlockTime, error)

func (*Client) GetBlockTimeCount added in v0.0.13

func (c *Client) GetBlockTimeCount(ctx context.Context, chainID int, httpRequestOptions ...client.HTTPRequestOption) (*GetBlockTimeCount, error)

func (*Client) GetFirstStoredBlockNumber added in v0.0.9

func (c *Client) GetFirstStoredBlockNumber(ctx context.Context, chainID int, httpRequestOptions ...client.HTTPRequestOption) (*GetFirstStoredBlockNumber, error)

func (*Client) GetLastIndexed added in v0.0.11

func (c *Client) GetLastIndexed(ctx context.Context, chainID int, contractAddress string, httpRequestOptions ...client.HTTPRequestOption) (*GetLastIndexed, error)

func (*Client) GetLastStoredBlockNumber added in v0.0.9

func (c *Client) GetLastStoredBlockNumber(ctx context.Context, chainID int, httpRequestOptions ...client.HTTPRequestOption) (*GetLastStoredBlockNumber, error)

func (*Client) GetLogCount added in v0.0.12

func (c *Client) GetLogCount(ctx context.Context, chainID int, contractAddress string, httpRequestOptions ...client.HTTPRequestOption) (*GetLogCount, error)

func (*Client) GetLogsRange

func (c *Client) GetLogsRange(ctx context.Context, chainID int, startBlock int, endBlock int, page int, contractAddress *string, httpRequestOptions ...client.HTTPRequestOption) (*GetLogsRange, error)

func (*Client) GetTxSender added in v0.0.9

func (c *Client) GetTxSender(ctx context.Context, chainID int, txHash string, httpRequestOptions ...client.HTTPRequestOption) (*GetTxSender, error)

type GetBlockTime added in v0.0.9

type GetBlockTime struct {
	Response *int "json:\"response\" graphql:\"response\""
}

type GetBlockTimeCount added in v0.0.13

type GetBlockTimeCount struct {
	Response *int "json:\"response\" graphql:\"response\""
}

type GetFirstStoredBlockNumber added in v0.0.9

type GetFirstStoredBlockNumber struct {
	Response *int "json:\"response\" graphql:\"response\""
}

type GetLastIndexed added in v0.0.11

type GetLastIndexed struct {
	Response *int "json:\"response\" graphql:\"response\""
}

type GetLastStoredBlockNumber added in v0.0.9

type GetLastStoredBlockNumber struct {
	Response *int "json:\"response\" graphql:\"response\""
}

type GetLogCount added in v0.0.12

type GetLogCount struct {
	Response *int "json:\"response\" graphql:\"response\""
}

type GetLogsRange

type GetLogsRange struct {
	Response []*struct {
		ContractAddress string   "json:\"contract_address\" graphql:\"contract_address\""
		ChainID         int      "json:\"chain_id\" graphql:\"chain_id\""
		Topics          []string "json:\"topics\" graphql:\"topics\""
		Data            string   "json:\"data\" graphql:\"data\""
		BlockNumber     int      "json:\"block_number\" graphql:\"block_number\""
		TxHash          string   "json:\"tx_hash\" graphql:\"tx_hash\""
		TxIndex         int      "json:\"tx_index\" graphql:\"tx_index\""
		BlockHash       string   "json:\"block_hash\" graphql:\"block_hash\""
		Index           int      "json:\"index\" graphql:\"index\""
		Removed         bool     "json:\"removed\" graphql:\"removed\""
	} "json:\"response\" graphql:\"response\""
}

type GetTxSender added in v0.0.9

type GetTxSender struct {
	Response *string "json:\"response\" graphql:\"response\""
}

type Query

type Query struct {
	Logs                   []*model.Log         "json:\"logs\" graphql:\"logs\""
	LogsRange              []*model.Log         "json:\"logsRange\" graphql:\"logsRange\""
	Receipts               []*model.Receipt     "json:\"receipts\" graphql:\"receipts\""
	ReceiptsRange          []*model.Receipt     "json:\"receiptsRange\" graphql:\"receiptsRange\""
	Transactions           []*model.Transaction "json:\"transactions\" graphql:\"transactions\""
	TransactionsRange      []*model.Transaction "json:\"transactionsRange\" graphql:\"transactionsRange\""
	BlockTime              *int                 "json:\"blockTime\" graphql:\"blockTime\""
	LastStoredBlockNumber  *int                 "json:\"lastStoredBlockNumber\" graphql:\"lastStoredBlockNumber\""
	FirstStoredBlockNumber *int                 "json:\"firstStoredBlockNumber\" graphql:\"firstStoredBlockNumber\""
	TxSender               *string              "json:\"txSender\" graphql:\"txSender\""
	LastIndexed            *int                 "json:\"lastIndexed\" graphql:\"lastIndexed\""
	LogCount               *int                 "json:\"logCount\" graphql:\"logCount\""
	BlockTimeCount         *int                 "json:\"blockTimeCount\" graphql:\"blockTimeCount\""
}

Directories

Path Synopsis
Package main generates a GQL client.
Package main generates a GQL client.

Jump to

Keyboard shortcuts

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