Documentation
¶
Index ¶
Constants ¶
const AccountReferenceType = avm_abi.AccountReferenceType
AccountReferenceType is the ABI argument type string for account references
const AnyTransactionType = avm_abi.AnyTransactionType
AnyTransactionType is the ABI argument type string for a nonspecific transaction argument
const ApplicationCallTransactionType = avm_abi.ApplicationCallTransactionType
ApplicationCallTransactionType is the ABI argument type string for an application call transaction argument
const ApplicationReferenceType = avm_abi.ApplicationReferenceType
ApplicationReferenceType is the ABI argument type string for application references
const AssetConfigTransactionType = avm_abi.AssetConfigTransactionType
AssetConfigTransactionType is the ABI argument type string for an asset configuration transaction argument
const AssetFreezeTransactionType = avm_abi.AssetFreezeTransactionType
AssetFreezeTransactionType is the ABI argument type string for an asset freeze transaction argument
const AssetReferenceType = avm_abi.AssetReferenceType
AssetReferenceType is the ABI argument type string for asset references
const AssetTransferTransactionType = avm_abi.AssetTransferTransactionType
AssetTransferTransactionType is the ABI argument type string for an asset transfer transaction argument
const KeyRegistrationTransactionType = avm_abi.KeyRegistrationTransactionType
KeyRegistrationTransactionType is the ABI argument type string for a key registration transaction argument
const PaymentTransactionType = avm_abi.PaymentTransactionType
PaymentTransactionType is the ABI argument type string for a payment transaction argument
const VoidReturnType = avm_abi.VoidReturnType
VoidReturnType is the ABI return type string for a method that does not return any value
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.
Types ¶
type Arg ¶
type Arg struct {
// Optional, user-friendly name for the argument
Name string `json:"name,omitempty"`
// The type of the argument as a string. See the method GetTypeObject to
// obtain the ABI type object
Type string `json:"type"`
// Optional, user-friendly description for the argument
Desc string `json:"desc,omitempty"`
// contains filtered or unexported fields
}
Arg represents an ABI Method argument
func (*Arg) GetTypeObject ¶
GetTypeObject parses and returns the ABI type object for this argument's type. An error will be returned if this argument's type is a transaction or reference type
func (Arg) IsReferenceArg ¶
IsReferenceArg checks if this argument's type is a reference type
func (Arg) IsTransactionArg ¶
IsTransactionArg checks if this argument's type is a transaction type
type Contract ¶
type Contract struct {
// A user-friendly name for the contract
Name string `json:"name"`
// Optional, user-friendly description for the contract
Desc string `json:"desc,omitempty"`
// Optional information about the contract's instances across different
// networks
Networks map[string]ContractNetworkInfo `json:"networks,omitempty"`
// The methods that the contract implements
Methods []Method `json:"methods"`
}
Contract represents an ABI contract, which is a concrete set of methods implemented by a single app
type ContractNetworkInfo ¶
type ContractNetworkInfo struct {
// The application ID of the contract for this network
AppID uint64 `json:"appID"`
}
ContractNetworkInfo contains network-specific information about the contract
type Interface ¶
type Interface struct {
// A user-friendly name for the interface
Name string `json:"name"`
// Optional, user-friendly description for the interface
Desc string `json:"desc,omitempty"`
// The methods that the interface contains
Methods []Method `json:"methods"`
}
Interface represents an ABI interface, which is a logically grouped collection of methods
type Method ¶
type Method struct {
// The name of the method
Name string `json:"name"`
// Optional, user-friendly description for the method
Desc string `json:"desc,omitempty"`
// The arguments of the method, in order
Args []Arg `json:"args"`
// Information about the method's return value
Returns Return `json:"returns"`
}
Method represents an individual ABI method definition
func MethodFromSignature ¶
MethodFromSignature decoded a method signature string into a Method object.
func (*Method) GetSelector ¶
GetSelector calculates and returns the 4-byte selector of the method
func (*Method) GetSignature ¶
GetSignature calculates and returns the signature of the method
func (*Method) GetTxCount ¶
GetTxCount returns the number of transactions required to invoke this method
type Return ¶
type Return struct {
// The type of the return value as a string. See the method GetTypeObject to
// obtain the ABI type object
Type string `json:"type"`
// Optional, user-friendly description for the return value
Desc string `json:"desc,omitempty"`
// contains filtered or unexported fields
}
Return represents an ABI method return value
func (*Return) GetTypeObject ¶
GetTypeObject parses and returns the ABI type object for this return type. An error will be returned if this is a void return type.