abi_pb

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_abi_contract_proto protoreflect.FileDescriptor
View Source
var File_abi_method_proto protoreflect.FileDescriptor
View Source
var File_abi_root_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Contract

type Contract struct {

	// A repeated field containing all the methods associated with the contract.
	// Each method is represented by the Method message, which details the method's name,
	// input parameters, output parameters, and other relevant attributes.
	Methods []*Method `protobuf:"bytes,1,rep,name=methods,proto3" json:"methods,omitempty"`
	// contains filtered or unexported fields
}

Contract represents a Solidity contract's ABI (Application Binary Interface) details. In the Ethereum ecosystem, a contract's ABI is essential for encoding and decoding data to and from the contract. This Contract message encapsulates the methods that are part of the contract, allowing for a structured representation of the contract's functionalities.

func (*Contract) Descriptor deprecated

func (*Contract) Descriptor() ([]byte, []int)

Deprecated: Use Contract.ProtoReflect.Descriptor instead.

func (*Contract) GetMethods

func (x *Contract) GetMethods() []*Method

func (*Contract) ProtoMessage

func (*Contract) ProtoMessage()

func (*Contract) ProtoReflect

func (x *Contract) ProtoReflect() protoreflect.Message

func (*Contract) Reset

func (x *Contract) Reset()

func (*Contract) String

func (x *Contract) String() string

type Method

type Method struct {

	// If the function has parameters of type 'struct' or 'tuple', this field contains its components.
	Components []*MethodIO `protobuf:"bytes,1,rep,name=components,proto3" json:"components,omitempty"`
	// The input parameters of the function.
	Inputs []*MethodIO `protobuf:"bytes,2,rep,name=inputs,proto3" json:"inputs,omitempty"`
	// The output parameters of the function.
	Outputs []*MethodIO `protobuf:"bytes,3,rep,name=outputs,proto3" json:"outputs,omitempty"`
	// The name of the function.
	Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
	// The type of the method (always "function" for functions).
	Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"`
	// The state mutability of the function (e.g., pure, view, nonpayable, payable).
	StateMutability string `protobuf:"bytes,6,opt,name=stateMutability,proto3" json:"stateMutability,omitempty"`
	// contains filtered or unexported fields
}

Method represents a contract function in the ABI. It provides a structured representation of the function's attributes, such as its name, type, input parameters, and output parameters.

func (*Method) Descriptor deprecated

func (*Method) Descriptor() ([]byte, []int)

Deprecated: Use Method.ProtoReflect.Descriptor instead.

func (*Method) GetComponents

func (x *Method) GetComponents() []*MethodIO

func (*Method) GetInputs

func (x *Method) GetInputs() []*MethodIO

func (*Method) GetName

func (x *Method) GetName() string

func (*Method) GetOutputs

func (x *Method) GetOutputs() []*MethodIO

func (*Method) GetStateMutability

func (x *Method) GetStateMutability() string

func (*Method) GetType

func (x *Method) GetType() string

func (*Method) ProtoMessage

func (*Method) ProtoMessage()

func (*Method) ProtoReflect

func (x *Method) ProtoReflect() protoreflect.Message

func (*Method) Reset

func (x *Method) Reset()

func (*Method) String

func (x *Method) String() string

type MethodIO

type MethodIO struct {

	// Indicates if the parameter is indexed. This is primarily used for event parameters.
	Indexed bool `protobuf:"varint,1,opt,name=indexed,proto3" json:"indexed,omitempty"`
	// Represents the internal Solidity type of the parameter.
	InternalType string `protobuf:"bytes,2,opt,name=internalType,proto3" json:"internalType,omitempty"`
	// The name of the parameter.
	Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	// The type of the parameter, as represented in the ABI.
	Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"`
	// If the parameter is of type 'struct' or 'tuple', this field contains its components.
	Components []*MethodIO `protobuf:"bytes,5,rep,name=components,proto3" json:"components,omitempty"`
	// The state mutability of the function (e.g., pure, view, nonpayable, payable).
	StateMutability string `protobuf:"bytes,6,opt,name=stateMutability,proto3" json:"stateMutability,omitempty"`
	// The input parameters of the function.
	Inputs []*MethodIO `protobuf:"bytes,7,rep,name=inputs,proto3" json:"inputs,omitempty"`
	// The output parameters of the function.
	Outputs []*MethodIO `protobuf:"bytes,8,rep,name=outputs,proto3" json:"outputs,omitempty"`
	// contains filtered or unexported fields
}

MethodIO represents an input or output parameter of a contract method or event. It provides a structured representation of the parameter's attributes, such as its name, type, and whether it's indexed (for events).

func (*MethodIO) Descriptor deprecated

func (*MethodIO) Descriptor() ([]byte, []int)

Deprecated: Use MethodIO.ProtoReflect.Descriptor instead.

func (*MethodIO) GetComponents

func (x *MethodIO) GetComponents() []*MethodIO

func (*MethodIO) GetIndexed

func (x *MethodIO) GetIndexed() bool

func (*MethodIO) GetInputs

func (x *MethodIO) GetInputs() []*MethodIO

func (*MethodIO) GetInternalType

func (x *MethodIO) GetInternalType() string

func (*MethodIO) GetName

func (x *MethodIO) GetName() string

func (*MethodIO) GetOutputs

func (x *MethodIO) GetOutputs() []*MethodIO

func (*MethodIO) GetStateMutability

func (x *MethodIO) GetStateMutability() string

func (*MethodIO) GetType

func (x *MethodIO) GetType() string

func (*MethodIO) ProtoMessage

func (*MethodIO) ProtoMessage()

func (*MethodIO) ProtoReflect

func (x *MethodIO) ProtoReflect() protoreflect.Message

func (*MethodIO) Reset

func (x *MethodIO) Reset()

func (*MethodIO) String

func (x *MethodIO) String() string

type Root

type Root struct {

	// The unique identifier for the entry contract.
	// This ID is used as a reference to the main or primary contract within the ABI.
	EntryContractId int64 `protobuf:"varint,1,opt,name=entryContractId,proto3" json:"entryContractId,omitempty"`
	// The name of the entry contract.
	// This provides a human-readable identifier for the primary contract within the ABI.
	EntryContractName string `protobuf:"bytes,2,opt,name=entryContractName,proto3" json:"entryContractName,omitempty"`
	// The total number of contracts present in the ABI.
	// This count includes the entry contract and any other contracts that are part of the ABI.
	ContractsCount int32 `protobuf:"varint,3,opt,name=contractsCount,proto3" json:"contractsCount,omitempty"`
	// A map that associates contract names with their corresponding Contract details.
	// The key is the name of the contract, and the value is the Contract message containing details about the contract's methods and other attributes.
	Contracts map[string]*Contract `` /* 159-byte string literal not displayed */
	// contains filtered or unexported fields
}

Root represents the root of a Solidity contract's ABI (Application Binary Interface). The ABI is a critical component for interacting with contracts in Ethereum. It is a representation of the contract's functions, the input and output parameters of these functions, and details about the data types of these parameters. The Root message encapsulates the main details of the ABI, including the entry contract's ID and name, the total number of contracts, and a map of contract names to their corresponding Contract details.

func (*Root) Descriptor deprecated

func (*Root) Descriptor() ([]byte, []int)

Deprecated: Use Root.ProtoReflect.Descriptor instead.

func (*Root) GetContracts

func (x *Root) GetContracts() map[string]*Contract

func (*Root) GetContractsCount

func (x *Root) GetContractsCount() int32

func (*Root) GetEntryContractId

func (x *Root) GetEntryContractId() int64

func (*Root) GetEntryContractName

func (x *Root) GetEntryContractName() string

func (*Root) ProtoMessage

func (*Root) ProtoMessage()

func (*Root) ProtoReflect

func (x *Root) ProtoReflect() protoreflect.Message

func (*Root) Reset

func (x *Root) Reset()

func (*Root) String

func (x *Root) String() string

Jump to

Keyboard shortcuts

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