handlers

package
v0.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLogs

func GetLogs(c *gin.Context)

@Summary Get all logs @Description Retrieve all logs across all contracts @Tags events @Accept json @Produce json @Security BasicAuth @Param chainId path string true "Chain ID" @Param filter query string false "Filter parameters" @Param group_by query string false "Field to group results by" @Param sort_by query string false "Field to sort results by" @Param sort_order query string false "Sort order (asc or desc)" @Param page query int false "Page number for pagination" @Param limit query int false "Number of items per page" default(5) @Param aggregate query []string false "List of aggregate functions to apply" @Success 200 {object} api.QueryResponse{data=[]LogModel} @Failure 400 {object} api.Error @Failure 401 {object} api.Error @Failure 500 {object} api.Error @Router /{chainId}/events [get]

func GetLogsByContract

func GetLogsByContract(c *gin.Context)

@Summary Get logs by contract @Description Retrieve logs for a specific contract @Tags events @Accept json @Produce json @Security BasicAuth @Param chainId path string true "Chain ID" @Param contract path string true "Contract address" @Param filter query string false "Filter parameters" @Param group_by query string false "Field to group results by" @Param sort_by query string false "Field to sort results by" @Param sort_order query string false "Sort order (asc or desc)" @Param page query int false "Page number for pagination" @Param limit query int false "Number of items per page" default(5) @Param aggregate query []string false "List of aggregate functions to apply" @Success 200 {object} api.QueryResponse{data=[]LogModel} @Failure 400 {object} api.Error @Failure 401 {object} api.Error @Failure 500 {object} api.Error @Router /{chainId}/events/{contract} [get]

func GetLogsByContractAndSignature

func GetLogsByContractAndSignature(c *gin.Context)

@Summary Get logs by contract and event signature @Description Retrieve logs for a specific contract and event signature. When a valid event signature is provided, the response includes decoded log data with both indexed and non-indexed parameters. @Tags events @Accept json @Produce json @Security BasicAuth @Param chainId path string true "Chain ID" @Param contract path string true "Contract address" @Param signature path string true "Event signature (e.g., 'Transfer(address,address,uint256)')" @Param filter query string false "Filter parameters" @Param group_by query string false "Field to group results by" @Param sort_by query string false "Field to sort results by" @Param sort_order query string false "Sort order (asc or desc)" @Param page query int false "Page number for pagination" @Param limit query int false "Number of items per page" default(5) @Param aggregate query []string false "List of aggregate functions to apply" @Success 200 {object} api.QueryResponse{data=[]DecodedLogModel} @Failure 400 {object} api.Error @Failure 401 {object} api.Error @Failure 500 {object} api.Error @Router /{chainId}/events/{contract}/{signature} [get]

func GetTransactions

func GetTransactions(c *gin.Context)

@Summary Get all transactions @Description Retrieve all transactions across all contracts @Tags transactions @Accept json @Produce json @Security BasicAuth @Param chainId path string true "Chain ID" @Param filter query string false "Filter parameters" @Param group_by query string false "Field to group results by" @Param sort_by query string false "Field to sort results by" @Param sort_order query string false "Sort order (asc or desc)" @Param page query int false "Page number for pagination" @Param limit query int false "Number of items per page" default(5) @Param aggregate query []string false "List of aggregate functions to apply" @Success 200 {object} api.QueryResponse{data=[]TransactionModel} @Failure 400 {object} api.Error @Failure 401 {object} api.Error @Failure 500 {object} api.Error @Router /{chainId}/transactions [get]

func GetTransactionsByContract

func GetTransactionsByContract(c *gin.Context)

@Summary Get transactions by contract @Description Retrieve transactions for a specific contract @Tags transactions @Accept json @Produce json @Security BasicAuth @Param chainId path string true "Chain ID" @Param to path string true "Contract address" @Param filter query string false "Filter parameters" @Param group_by query string false "Field to group results by" @Param sort_by query string false "Field to sort results by" @Param sort_order query string false "Sort order (asc or desc)" @Param page query int false "Page number for pagination" @Param limit query int false "Number of items per page" default(5) @Param aggregate query []string false "List of aggregate functions to apply" @Success 200 {object} api.QueryResponse{data=[]TransactionModel} @Failure 400 {object} api.Error @Failure 401 {object} api.Error @Failure 500 {object} api.Error @Router /{chainId}/transactions/{to} [get]

func GetTransactionsByContractAndSignature

func GetTransactionsByContractAndSignature(c *gin.Context)

@Summary Get transactions by contract and signature @Description Retrieve transactions for a specific contract and signature. When a valid function signature is provided, the response includes decoded transaction data with function inputs. @Tags transactions @Accept json @Produce json @Security BasicAuth @Param chainId path string true "Chain ID" @Param to path string true "Contract address" @Param signature path string true "Function signature (e.g., 'transfer(address,uint256)')" @Param filter query string false "Filter parameters" @Param group_by query string false "Field to group results by" @Param sort_by query string false "Field to sort results by" @Param sort_order query string false "Sort order (asc or desc)" @Param page query int false "Page number for pagination" @Param limit query int false "Number of items per page" default(5) @Param aggregate query []string false "List of aggregate functions to apply" @Success 200 {object} api.QueryResponse{data=[]DecodedTransactionModel} @Failure 400 {object} api.Error @Failure 401 {object} api.Error @Failure 500 {object} api.Error @Router /{chainId}/transactions/{to}/{signature} [get]

Types

type DecodedLogDataModel

type DecodedLogDataModel struct {
	Name      string                 `json:"name"`
	Signature string                 `json:"signature"`
	Inputs    map[string]interface{} `json:"inputs"`
}

type DecodedLogModel

type DecodedLogModel struct {
	LogModel
	Decoded DecodedLogDataModel `json:"decoded"`
}

type DecodedTransactionDataModel

type DecodedTransactionDataModel struct {
	Name      string                 `json:"name"`
	Signature string                 `json:"signature"`
	Inputs    map[string]interface{} `json:"inputs"`
}

type DecodedTransactionModel

type DecodedTransactionModel struct {
	TransactionModel
	Decoded DecodedTransactionDataModel `json:"decoded"`
}

type LogModel

type LogModel struct {
	ChainId          string   `json:"chain_id"`
	BlockNumber      string   `json:"block_number"`
	BlockHash        string   `json:"block_hash"`
	BlockTimestamp   uint64   `json:"block_timestamp"`
	TransactionHash  string   `json:"transaction_hash"`
	TransactionIndex uint64   `json:"transaction_index"`
	LogIndex         uint64   `json:"log_index"`
	Address          string   `json:"address"`
	Data             string   `json:"data"`
	Topics           []string `json:"topics"`
}

LogModel represents a simplified Log structure for Swagger documentation

type TransactionModel

type TransactionModel struct {
	ChainId              string  `json:"chain_id"`
	Hash                 string  `json:"hash"`
	Nonce                uint64  `json:"nonce"`
	BlockHash            string  `json:"block_hash"`
	BlockNumber          string  `json:"block_number"`
	BlockTimestamp       uint64  `json:"block_timestamp"`
	TransactionIndex     uint64  `json:"transaction_index"`
	FromAddress          string  `json:"from_address"`
	ToAddress            string  `json:"to_address"`
	Value                string  `json:"value"`
	Gas                  uint64  `json:"gas"`
	GasPrice             string  `json:"gas_price"`
	Data                 string  `json:"data"`
	MaxFeePerGas         string  `json:"max_fee_per_gas"`
	MaxPriorityFeePerGas string  `json:"max_priority_fee_per_gas"`
	TransactionType      uint8   `json:"transaction_type"`
	R                    string  `json:"r"`
	S                    string  `json:"s"`
	V                    string  `json:"v"`
	AccessListJson       *string `json:"access_list_json"`
	ContractAddress      *string `json:"contract_address"`
	GasUsed              *uint64 `json:"gas_used"`
	CumulativeGasUsed    *uint64 `json:"cumulative_gas_used"`
	EffectiveGasPrice    *string `json:"effective_gas_price"`
	BlobGasUsed          *uint64 `json:"blob_gas_used"`
	BlobGasPrice         *string `json:"blob_gas_price"`
	LogsBloom            *string `json:"logs_bloom"`
	Status               *uint64 `json:"status"`
}

TransactionModel represents a simplified Transaction structure for Swagger documentation

Jump to

Keyboard shortcuts

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