restunpack

package
v0.9.9-rc4 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UnpackServiceName rest.ServiceName = "unpack"

UnpackServiceName defines the service name for the Unpack service.

Functions

func GetEntryFromAddress

func GetEntryFromAddress(networkId utils.NetworkID, address common.Address) (*entries.Entry, error)

func GetEntryFromContract

func GetEntryFromContract(ctx context.Context, pool *clients.ClientPool, contract *models.Contract) (*entries.Entry, error)

func RegisterAbiHandler

func RegisterAbiHandler(n *Namespace) error

RegisterAbiHandler registers the endpoint to retrieve ABI

func RegisterContractHandler

func RegisterContractHandler(n *Namespace) error

RegisterContractHandler registers the endpoint to retrieve Contract details

func RegisterEventByContractSignatureHandler

func RegisterEventByContractSignatureHandler(n *Namespace) error

RegisterEventByContractSignatureHandler registers the endpoint to retrieve Event by Contract Signature

func RegisterEventsBySignatureHandler

func RegisterEventsBySignatureHandler(n *Namespace) error

RegisterEventsBySignatureHandler registers the endpoint to retrieve Events by Signature

func RegisterFunctionByContractSignatureHandler

func RegisterFunctionByContractSignatureHandler(n *Namespace) error

RegisterFunctionByContractSignatureHandler registers the endpoint to retrieve Function by Contract Signature

func RegisterFunctionsBySignatureHandler

func RegisterFunctionsBySignatureHandler(n *Namespace) error

RegisterFunctionsBySignatureHandler registers the endpoint to retrieve Functions by Signature

func RegisterOpcodeHandler

func RegisterOpcodeHandler(n *Namespace) error

RegisterOpcodeHandler registers the endpoint to retrieve Opcode

func RegisterTransactionHandler

func RegisterTransactionHandler(n *Namespace) error

RegisterTransactionHandler registers the endpoint to retrieve Transaction details

func UnpackOpcodes

func UnpackOpcodes(n *Namespace, ctx context.Context, input *InputOpcodeRequest) (*rest.Response[rpctypes.Opcode], error)

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

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

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

func (s *Namespace) RegisterHandlers() error

RegisterHandlers registers all the necessary handlers for the Stats namespace.

Jump to

Keyboard shortcuts

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