restcontracts

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ContractsServiceName rest.ServiceName = "contracts"

ContractsServiceName defines the service name for the Contracts service.

Functions

func RegisterGetContractByTransactionHashHandler

func RegisterGetContractByTransactionHashHandler(n *Namespace) error

RegisterGetContractByTransactionHashHandler registers the endpoint to retrieve a contract by transaction hash

func RegisterGetContractsByAddressesHandler

func RegisterGetContractsByAddressesHandler(n *Namespace) error

RegisterGetContractsByAddressesHandler registers the endpoint to retrieve contracts by a list of addresses

func RegisterGetContractsByBlockNumberHandler

func RegisterGetContractsByBlockNumberHandler(n *Namespace) error

RegisterGetContractsByBlockNumberHandler registers the endpoint to retrieve contracts by block number

func RegisterGetContractsByDeployerHandler

func RegisterGetContractsByDeployerHandler(n *Namespace) error

RegisterGetContractsByDeployerHandler registers the endpoint to retrieve contracts by deployer address

func RegisterGetContractsByStandardsHandler

func RegisterGetContractsByStandardsHandler(n *Namespace) error

RegisterGetContractsByStandardsHandler registers the endpoint to retrieve contracts by standards

func RegisterGetProxyContractsByAddressesHandler

func RegisterGetProxyContractsByAddressesHandler(n *Namespace) error

RegisterGetProxyContractsByAddressesHandler registers the endpoint to retrieve list of proxy implementation contracts by a contract addresses

func RegisterListContractsHandler

func RegisterListContractsHandler(n *Namespace) error

RegisterListContractsHandler registers the endpoint to retrieve contracts

Types

type InputNetworkAddress

type InputNetworkAddress struct {
	NetworkId utils.NetworkID `json:"networkId" path:"networkId" default:"1" example:"1" doc:"Network ID"` // Network ID specifies the blockchain network (e.g., 1 for Ethereum Mainnet)
	Address   common.Address  ``                                                                           // Address specifies the account address
	/* 135-byte string literal not displayed */
}

InputNetworkAddress represents the input parameters required to specify a network and address.

type InputNetworkAddressPaginated

type InputNetworkAddressPaginated struct {
	NetworkId utils.NetworkID `json:"networkId" path:"networkId" default:"1" example:"1" doc:"Network ID"` // Network ID specifies the blockchain network (e.g., 1 for Ethereum Mainnet)
	Address   common.Address  ``                                                                           // Address specifies the deployer address
	/* 135-byte string literal not displayed */
	Limit  uint `json:"limit" query:"limit" example:"10" doc:"Limit for the number of contracts to return"` // Limit specifies the number of contracts to return
	Offset uint `json:"offset" query:"offset" example:"0" doc:"Offset for pagination"`                      // Offset specifies the offset for pagination
}

InputNetworkAddressPaginated represents the input parameters required to specify a network, address, and pagination.

type InputNetworkAddresses

type InputNetworkAddresses struct {
	NetworkId utils.NetworkID `json:"networkId" path:"networkId" default:"1" example:"1" doc:"Network ID"` // Network ID specifies the blockchain network (e.g., 1 for Ethereum Mainnet)
	Addresses []string        ``                                                                           // Addresses specifies the list of contract addresses
	/* 158-byte string literal not displayed */
}

InputNetworkAddresses represents the input parameters required to specify a network and a list of addresses.

func (*InputNetworkAddresses) ToAddresses

func (t *InputNetworkAddresses) ToAddresses() []common.Address

type InputNetworkBlockPaginated

type InputNetworkBlockPaginated struct {
	NetworkId   utils.NetworkID `json:"networkId" path:"networkId" default:"1" example:"1" doc:"Network ID"`                             // Network ID specifies the blockchain network (e.g., 1 for Ethereum Mainnet)
	BlockNumber int64           `json:"blockNumber" path:"blockNumber" example:"18464515" doc:"Block number"`                            // Block number specifies the block number
	Limit       uint            `json:"limit" query:"limit" example:"10" default:"10" doc:"Limit for the number of contracts to return"` // Limit specifies the number of contracts to return
	Offset      uint            `json:"offset" query:"offset" example:"0" default:"0" doc:"Offset for pagination"`                       // Offset specifies the offset for pagination
}

InputNetworkBlockPaginated represents the input parameters required to specify a network, block number, and pagination.

type InputNetworkHash

type InputNetworkHash struct {
	NetworkId utils.NetworkID `json:"networkId" path:"networkId" default:"1" example:"1" doc:"Network ID"`                                                  // Network ID specifies the blockchain network (e.g., 1 for Ethereum Mainnet)
	Hash      common.Hash     `json:"hash" path:"hash" example:"0xbac4e10bdd8aed7b7728e4e8c445f03e27597378cc3a70fba29a93b7d6fe7f93" doc:"Transaction hash"` // Hash specifies the transaction hash
}

InputNetworkHash represents the input parameters required to specify a network and transaction hash.

type InputNetworkPaginated

type InputNetworkPaginated struct {
	NetworkId utils.NetworkID `json:"networkId" path:"networkId" default:"1" example:"1" doc:"Network ID"`                // Network ID specifies the blockchain network (e.g., 1 for Ethereum Mainnet)
	Limit     uint            `json:"limit" query:"limit" example:"10" doc:"Limit for the number of contracts to return"` // Limit specifies the number of accounts to return
	Offset    uint            `json:"offset" query:"offset" example:"0" doc:"Offset for pagination"`                      // Offset specifies the offset for pagination
}

InputNetworkPaginated represents the input parameters required to specify a network, limit and offset.

type InputNetworkStandardsPaginated

type InputNetworkStandardsPaginated struct {
	NetworkId utils.NetworkID `json:"networkId" path:"networkId" default:"1" example:"1" doc:"Network ID"`                                                    // Network ID specifies the blockchain network (e.g., 1 for Ethereum Mainnet)
	Standards []string        `json:"standards" query:"standards" example:"[\"ERC20\"]" uniqueItems:"true" minItems:"1" doc:"List of standards to filter by"` // Standards specifies the list of standards to filter by
	Limit     uint            `json:"limit" query:"limit" example:"10" default:"10" doc:"Limit for the number of contracts to return"`                        // Limit specifies the number of contracts to return
	Offset    uint            `json:"offset" query:"offset" example:"0" default:"0" doc:"Offset for pagination"`                                              // Offset specifies the offset for pagination
}

InputNetworkStandardsPaginated represents the input parameters required to specify a network, standards, and pagination.

type Namespace

type Namespace struct {
	*rest.Server
	// contains filtered or unexported fields
}

Namespace represents a service namespace containing configuration and dependencies for the Contracts service.

func NewNamespace

func NewNamespace(server *rest.Server, db db.Adapter, pool *clients.ClientPool, nats *nats.Conn, cache *cache.Redis) *Namespace

NewNamespace creates a new instance of Namespace with the provided server, database adapter, client pool, NATS connection, and Redis cache.

func (*Namespace) GetName

func (s *Namespace) GetName() rest.ServiceName

GetName returns the service name for the Contracts namespace.

func (*Namespace) RegisterHandlers

func (s *Namespace) RegisterHandlers() error

RegisterHandlers registers all the necessary handlers for the Accounts namespace.

Jump to

Keyboard shortcuts

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