Documentation ¶
Index ¶
- Constants
- func IsReferenceType(s string) bool
- func IsTransactionType(s string) bool
- func ParseArgJSONtoByteSlice(argTypes []string, jsonArgs []string, applicationArgs *[][]byte) error
- func ParseMethodSignature(methodSig string) (name string, argTypes []string, returnType string, err error)
- type BaseType
- type Type
- func (t Type) ByteLen() (int, error)
- func (t Type) Decode(encoded []byte) (interface{}, error)
- func (t Type) Encode(value interface{}) ([]byte, error)
- func (t Type) Equal(t0 Type) bool
- func (t Type) IsDynamic() bool
- func (t Type) MarshalToJSON(value interface{}) ([]byte, error)
- func (t Type) String() string
- func (t Type) UnmarshalFromJSON(jsonEncoded []byte) (interface{}, error)
Constants ¶
const AccountReferenceType = "account"
AccountReferenceType is the ABI argument type string for account references
const AnyTransactionType = "txn"
AnyTransactionType is the ABI argument type string for a nonspecific transaction argument
const ApplicationReferenceType = "application"
ApplicationReferenceType is the ABI argument type string for application references
const AssetReferenceType = "asset"
AssetReferenceType is the ABI argument type string for asset references
Variables ¶
This section is empty.
Functions ¶
func IsReferenceType ¶
IsReferenceType checks if a type string represents a reference type argument, such as "account", "asset", or "application".
func IsTransactionType ¶
IsTransactionType checks if a type string represents a transaction type argument, such as "txn", "pay", "keyreg", etc.
func ParseArgJSONtoByteSlice ¶
ParseArgJSONtoByteSlice convert input method arguments to ABI encoded bytes it converts funcArgTypes into a tuple type and apply changes over input argument string (in JSON format) if there are greater or equal to 15 inputs, then we compact the tailing inputs into one tuple
Types ¶
type BaseType ¶
type BaseType uint32
BaseType is an type-alias for uint32. A BaseType value indicates the type of an ABI value.
const ( // Uint is the index (0) for `Uint` type in ABI encoding. Uint BaseType = iota // Byte is the index (1) for `Byte` type in ABI encoding. Byte // Ufixed is the index (2) for `UFixed` type in ABI encoding. Ufixed // Bool is the index (3) for `Bool` type in ABI encoding. Bool // ArrayStatic is the index (4) for static length array (<type>[length]) type in ABI encoding. ArrayStatic // Address is the index (5) for `Address` type in ABI encoding (an type alias of Byte[32]). Address // ArrayDynamic is the index (6) for dynamic length array (<type>[]) type in ABI encoding. ArrayDynamic // String is the index (7) for `String` type in ABI encoding (an type alias of Byte[]). String // Tuple is the index (8) for tuple `(<type 0>, ..., <type k>)` in ABI encoding. Tuple )
type Type ¶
type Type struct {
// contains filtered or unexported fields
}
Type is the struct that stores information about an ABI value's type.
func MakeTupleType ¶
MakeTupleType makes tuple ABI type by taking an array of tuple element types as argument.
func (Type) Decode ¶
Decode is an ABI type method to decode bytes to go values from ABI encoding rules
func (Type) Encode ¶
Encode is an ABI type method to encode go values into bytes following ABI encoding rules
func (Type) MarshalToJSON ¶
MarshalToJSON convert golang value to JSON format from ABI type
func (Type) UnmarshalFromJSON ¶
UnmarshalFromJSON convert bytes to golang value following ABI type and encoding rules