client

package
v0.0.120 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 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 GetLastConfirmedBlockNumberDocument = `query GetLastConfirmedBlockNumber ($chain_id: Int!) {
	response: lastConfirmedBlockNumber(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 GetReceiptCountDocument = `query GetReceiptCount ($chain_id: Int!) {
	response: receiptCount(chain_id: $chain_id)
}
`
View Source
const GetTransactionsDocument = `` /* 292-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) GetLastConfirmedBlockNumber added in v0.0.27

func (c *Client) GetLastConfirmedBlockNumber(ctx context.Context, chainID int, httpRequestOptions ...client.HTTPRequestOption) (*GetLastConfirmedBlockNumber, 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) GetReceiptCount added in v0.0.26

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

func (*Client) GetTransactions added in v0.0.43

func (c *Client) GetTransactions(ctx context.Context, chainID int, page int, txHash *string, httpRequestOptions ...client.HTTPRequestOption) (*GetTransactions, 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 GetLastConfirmedBlockNumber added in v0.0.27

type GetLastConfirmedBlockNumber 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 GetReceiptCount added in v0.0.26

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

type GetTransactions added in v0.0.43

type GetTransactions struct {
	Response []*struct {
		ChainID   int    "json:\"chain_id\" graphql:\"chain_id\""
		TxHash    string "json:\"tx_hash\" graphql:\"tx_hash\""
		Protected bool   "json:\"protected\" graphql:\"protected\""
		Type      int    "json:\"type\" graphql:\"type\""
		Data      string "json:\"data\" graphql:\"data\""
		Gas       int    "json:\"gas\" graphql:\"gas\""
		GasPrice  int    "json:\"gas_price\" graphql:\"gas_price\""
		GasTipCap string "json:\"gas_tip_cap\" graphql:\"gas_tip_cap\""
		GasFeeCap string "json:\"gas_fee_cap\" graphql:\"gas_fee_cap\""
		Value     string "json:\"value\" graphql:\"value\""
		Nonce     int    "json:\"nonce\" graphql:\"nonce\""
		To        string "json:\"to\" graphql:\"to\""
		Timestamp int    "json:\"timestamp\" graphql:\"timestamp\""
		Sender    string "json:\"sender\" graphql:\"sender\""
	} "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\""
	LastConfirmedBlockNumber *int                 "json:\"lastConfirmedBlockNumber\" graphql:\"lastConfirmedBlockNumber\""
	TxSender                 *string              "json:\"txSender\" graphql:\"txSender\""
	LastIndexed              *int                 "json:\"lastIndexed\" graphql:\"lastIndexed\""
	LogCount                 *int                 "json:\"logCount\" graphql:\"logCount\""
	ReceiptCount             *int                 "json:\"receiptCount\" graphql:\"receiptCount\""
	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