Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewChainReader ¶
func NewChainReader(lgr logger.Logger, client aptos.AptosRpcClient, config ChainReaderConfig) types.ContractReader
Types ¶
type AptosFunctionParam ¶
type AptosFunctionParam struct {
// The function parameter name.
Name string
// The function parameter Move type.
Type string
// True if this is a required parameter, false otherwise.
Required bool
// If this is not a required parameter and it is not provided, this default value will be used.
DefaultValue any
}
type ChainReaderConfig ¶
type ChainReaderConfig struct {
IsLoopPlugin bool
Modules map[string]*ChainReaderModule
}
type ChainReaderEvent ¶
type ChainReaderEvent struct {
// The struct where the event handle is defined.
EventHandleStructName string
// The name of the event handle field.
EventHandleFieldName string
// The event account address.
// This field can be defined in several ways:
// - Empty string, which means the event account address is the address of the bound contract.
// - An exact address hex string (eg. 0x1234 or 1234) containing the events.
// - A fully qualified function name (eg. 0x1234::my_contract::get_event_address) which
// takes no parameters and returns the actual event account address.
// - A name containing the module name and function name components
// (eg. my_first_contract::get_event_address) stored at the address of the bound contract,
// which takes no parameters and returns the actual event account address.
EventAccountAddress string
// Renames of event field names (optional). When not provided, the field names are used as-is.
EventFieldRenames map[string]RenamedField
}
type ChainReaderFunction ¶
type ChainReaderFunction struct {
// The function name (optional). When not provided, the key in the map under which this function
// is stored is used.
Name string
Params []AptosFunctionParam
ResultFieldRenames map[string]RenamedField
}
type ChainReaderModule ¶
type ChainReaderModule struct {
// The module name (optional). When not provided, the key in the map under which this module
// is stored is used.
Name string
Functions map[string]*ChainReaderFunction
Events map[string]*ChainReaderEvent
}
type RenamedField ¶
type RenamedField struct {
// The new field name (optional). This does not need to be provided if this field does not need
// to be renamed.
NewName string
// Rename sub-fields. This assumes that the event field value is a struct or a map with string keys.
SubFieldRenames map[string]RenamedField
}
Click to show internal directories.
Click to hide internal directories.