Documentation ¶
Index ¶
- Variables
- func GetEntryFromAddress(networkId utils.NetworkID, address common.Address) (*entries.Entry, error)
- func GetEntryFromContract(ctx context.Context, pool *clients.ClientPool, contract *models.Contract) (*entries.Entry, error)
- func RegisterAbiHandler(n *Namespace) error
- func RegisterContractHandler(n *Namespace) error
- func RegisterEventByContractSignatureHandler(n *Namespace) error
- func RegisterEventsBySignatureHandler(n *Namespace) error
- func RegisterFunctionByContractSignatureHandler(n *Namespace) error
- func RegisterFunctionsBySignatureHandler(n *Namespace) error
- func RegisterOpcodeHandler(n *Namespace) error
- func RegisterTransactionHandler(n *Namespace) error
- func UnpackOpcodes(n *Namespace, ctx context.Context, input *InputOpcodeRequest) (*rest.Response[rpctypes.Opcode], error)
- type InputAbiRequest
- type InputContractRequest
- type InputEventByContractSignatureRequest
- type InputEventsBySignatureRequest
- type InputFunctionByContractSignatureRequest
- type InputFunctionsBySignatureRequest
- type InputOpcodeRequest
- type InputTransactionRequest
- type Namespace
Constants ¶
This section is empty.
Variables ¶
var UnpackServiceName rest.ServiceName = "unpack"
UnpackServiceName defines the service name for the Unpack service.
Functions ¶
func GetEntryFromAddress ¶
func GetEntryFromContract ¶
func RegisterAbiHandler ¶
RegisterAbiHandler registers the endpoint to retrieve ABI
func RegisterContractHandler ¶
RegisterContractHandler registers the endpoint to retrieve Contract details
func RegisterEventByContractSignatureHandler ¶
RegisterEventByContractSignatureHandler registers the endpoint to retrieve Event by Contract Signature
func RegisterEventsBySignatureHandler ¶
RegisterEventsBySignatureHandler registers the endpoint to retrieve Events by Signature
func RegisterFunctionByContractSignatureHandler ¶
RegisterFunctionByContractSignatureHandler registers the endpoint to retrieve Function by Contract Signature
func RegisterFunctionsBySignatureHandler ¶
RegisterFunctionsBySignatureHandler registers the endpoint to retrieve Functions by Signature
func RegisterOpcodeHandler ¶
RegisterOpcodeHandler registers the endpoint to retrieve Opcode
func RegisterTransactionHandler ¶
RegisterTransactionHandler registers the endpoint to retrieve Transaction details
Types ¶
type InputAbiRequest ¶
type InputAbiRequest 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 `json:"address" query:"address" example:"0x0" doc:"Contract address"` // Address specifies the contract address Bytecode string `json:"bytecode" query:"bytecode" example:"6080604052..." doc:"Contract bytecode"` // Bytecode specifies the contract bytecode }
InputAbiRequest represents the input parameters required to specify a network, address, and bytecode.
type InputContractRequest ¶
type InputContractRequest 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 `json:"address" path:"address" example:"0x90bf4e5e508cca87c1c8470cc4d8a121157dac50" doc:"Contract address"` // Address specifies the contract address }
InputContractRequest represents the input parameters required to specify a network and contract address.
type InputEventByContractSignatureRequest ¶
type InputEventByContractSignatureRequest 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 `json:"address" path:"address" example:"0xd0ca25a9c0e351e44b59ad1b1f824466973fe31f" doc:"Contract address"` // Address specifies the contract address Signature common.Hash `` // Signature specifies the event signature /* 132-byte string literal not displayed */ }
InputEventByContractSignatureRequest represents the input parameters required to specify a network, address, and signature.
type InputEventsBySignatureRequest ¶
type InputEventsBySignatureRequest 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) Signature common.Hash `` // Signature specifies the event signature /* 132-byte string literal not displayed */ Limit uint `json:"limit" query:"limit" example:"10" default:"10" doc:"Limit for the number of events to return"` // Limit specifies the number of events to return Offset uint `json:"offset" query:"offset" example:"0" default:"0" doc:"Offset for pagination"` // Offset specifies the offset for pagination }
InputEventsBySignatureRequest represents the input parameters required to specify a network, signature, limit, and offset.
type InputFunctionByContractSignatureRequest ¶
type InputFunctionByContractSignatureRequest 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 `json:"address" path:"address" example:"0x90bf4e5e508cca87c1c8470cc4d8a121157dac50" doc:"Contract address"` // Address specifies the contract address Signature string `json:"signature" path:"signature" maxLength:"10" example:"0x12345678" doc:"Function signature"` // Signature specifies the function signature }
InputFunctionByContractSignatureRequest represents the input parameters required to specify a network, address, and signature.
type InputFunctionsBySignatureRequest ¶
type InputFunctionsBySignatureRequest 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) Signature string `json:"signature" path:"signature" maxLength:"10" example:"0x12345678" doc:"Function signature"` // Signature specifies the function signature Limit uint `json:"limit" query:"limit" example:"10" default:"10" doc:"Limit for the number of functions to return"` // Limit specifies the number of functions to return Offset uint `json:"offset" query:"offset" example:"0" default:"0" doc:"Offset for pagination"` // Offset specifies the offset for pagination }
InputFunctionsBySignatureRequest represents the input parameters required to specify a network, signature, limit, and offset.
type InputOpcodeRequest ¶
type InputOpcodeRequest 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 `json:"address" query:"address" example:"0x0" doc:"Contract address"` // Address specifies the contract address Bytecode string `json:"bytecode" query:"bytecode" example:"6080604052..." doc:"Contract bytecode"` // Bytecode specifies the contract bytecode }
InputOpcodeRequest represents the input parameters required to specify a network, address, and bytecode.
type InputTransactionRequest ¶
type InputTransactionRequest 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:"0x8a4b856606d511e77509df4191fc804a2ca5dd4fdb4e69df21dc1ade90ab505c" doc:"Transaction hash"` // Hash specifies the transaction hash ShowAst bool `json:"showAst" query:"showAst" example:"false" doc:"Flag to display function and event AST units"` // ShowAst specifies whether to include the AST }
InputTransactionRequest represents the input parameters required to specify a network, hash, and showAst flag.
type Namespace ¶
Namespace represents a service namespace containing configuration and dependencies for the Unpack 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 Unpack namespace.
func (*Namespace) RegisterHandlers ¶
RegisterHandlers registers all the necessary handlers for the Stats namespace.