Documentation
¶
Index ¶
- Constants
- Variables
- func IsERC20TransferSelector(id Selector) bool
- func MakeJsonABI(methods []Method) ([]byte, error)
- type ArgType
- type Argument
- type Arguments
- type BigInt
- type Bool
- type Bytes
- type DataType
- type DecodedArg
- type DecodedCallData
- type ERC20TransferArguments
- type Int
- type List
- type Method
- type MethodsMap
- type Payment
- type Selector
- type Signature
- type String
- type Type
Constants ¶
View Source
const ( EthereumAddressSize int = 20 NumberOfERC20TransferArguments int = 2 )
View Source
const SelectorSize = 4
Variables ¶
View Source
var UnsupportedType = errors.New("unsupported type")
Functions ¶
func IsERC20TransferSelector ¶
IsERC20TransferSelector checks that selector is an ERC20Transfer function selector
func MakeJsonABI ¶
Types ¶
type ArgType ¶
type ArgType byte
type Arguments ¶
type Arguments []Argument
func (Arguments) UnpackRideValues ¶
UnpackRideValues can be used to unpack ABI-encoded hexdata according to the ABI-specification, without supplying a struct to unpack into. Instead, this method returns a list containing the values. An atomic argument will be a list with one element.
type DecodedArg ¶
func (*DecodedArg) DecodedValue ¶
func (da *DecodedArg) DecodedValue() interface{}
func (*DecodedArg) InternalType ¶
func (da *DecodedArg) InternalType() byte
func (*DecodedArg) String ¶
func (da *DecodedArg) String() string
type DecodedCallData ¶
type DecodedCallData struct { Signature Signature Name string Inputs []DecodedArg Payments []Payment }
DecodedCallData is an internal type to represent a method call parsed according to an ABI method signature.
func (DecodedCallData) String ¶
func (cd DecodedCallData) String() string
String implements stringer interface for DecodedCallData
type ERC20TransferArguments ¶
type ERC20TransferArguments struct { Recipient [EthereumAddressSize]byte Amount int64 }
func GetERC20TransferArguments ¶
func GetERC20TransferArguments(decodedData *DecodedCallData) (ERC20TransferArguments, error)
GetERC20TransferArguments parses DecodedCallData to ERC20TransferArguments
type Method ¶
type Method struct { RawName string // RawName is the raw method name parsed from ABI Inputs Arguments // Sig returns the methods string signature according to the ABI spec. // e.g. function foo(uint32 a, int b) = "foo(uint32,int256)" // Please note that "int" is substitute for its canonical representation "int256" Payments *Argument Sig Signature }
type MethodsMap ¶
type MethodsMap struct {
// contains filtered or unexported fields
}
func NewErc20MethodsMap ¶
func NewErc20MethodsMap() MethodsMap
func NewMethodsMapFromRideDAppMeta ¶
func NewMethodsMapFromRideDAppMeta(dApp meta.DApp) (MethodsMap, error)
func (MethodsMap) MarshalJSON ¶
func (mm MethodsMap) MarshalJSON() ([]byte, error)
func (MethodsMap) MethodBySelector ¶
func (mm MethodsMap) MethodBySelector(id Selector) (Method, error)
func (MethodsMap) ParseCallDataRide ¶
func (mm MethodsMap) ParseCallDataRide(data []byte) (*DecodedCallData, error)
type Type ¶
type Type struct { Elem *Type // nested types for SliceType Size int T ArgType // Our own type checking // Tuple relative fields TupleRawName string // Raw struct name defined in source code, may be empty. TupleFields Arguments // Type and name information of all tuple fields // contains filtered or unexported fields }
Type is the reflection of the supported argument type.
Click to show internal directories.
Click to hide internal directories.