Documentation ¶
Index ¶
- Variables
- func AbiCoder(argTypes []string, argValues []interface{}) ([]byte, error)
- func AbiCoderHex(argTypes []string, argValues []interface{}) (string, error)
- func AbiDecodeExpr(expr string, input []byte, argValues []interface{}) error
- func AbiDecodeExprAndStringify(expr string, input []byte) ([]string, error)
- func AbiDecoder(argTypes []string, input []byte, argValues []interface{}) error
- func AbiDecoderWithReturnedValues(argTypes []string, input []byte) ([]interface{}, error)
- func AbiEncodeMethodCalldata(methodExpr string, argValues []interface{}) ([]byte, error)
- func AbiEncodeMethodCalldataFromStringValues(methodExpr string, argStringValues []string) ([]byte, error)
- func AbiMarshalStringValues(argTypes []string, input []byte) ([]string, error)
- func AbiUnmarshalStringValues(argTypes []string, stringValues []string) ([]interface{}, error)
- func AddressPadding(input string) string
- func BytesToBytes32(slice []byte) [32]byte
- func EventTopicHash(event string) (ethkit.Hash, string, error)
- func FunctionSignature(functionExpr string) string
- func HexDecode(h string) ([]byte, error)
- func HexDecodeBigIntArray(bigNumsHex []string) ([]*big.Int, error)
- func HexDecodeBytes32(h string) ([32]byte, error)
- func HexEncode(h []byte) string
- func HexEncodeBigIntArray(bigNums []*big.Int) ([]string, error)
- func HexTrimLeadingZeros(hex string) (string, error)
- func Keccak256(input []byte) []byte
- func Keccak256Hash(input []byte) common.Hash
- func MustHexDecode(h string) []byte
- func MustNewArrayTypeTuple(components []abi.ArgumentMarshaling) abi.Type
- func MustNewType(str string) abi.Type
- func PadZeros(array []byte, totalLength int) ([]byte, error)
- func ParseMethodABI(methodExpr, returnsExpr string) (*abi.ABI, string, error)
- func SHA3(input []byte) common.Hash
- func SolidityPack(argTypes []string, argValues []interface{}) ([]byte, error)
- func SolidityPackHex(argTypes []string, argValues []interface{}) (string, error)
- func StringifyValues(values []interface{}) ([]string, error)
- func ValidateEventSig(eventSig string) (bool, error)
- type EventDecoder
- func (d *EventDecoder) DecodeLog(log types.Log) (EventDef, []interface{}, bool, error)
- func (d *EventDecoder) DecodeLogAsHex(log types.Log) (EventDef, []string, bool, error)
- func (d *EventDecoder) EventDefList() []EventDef
- func (d *EventDecoder) RegisterContractABI(contractABI abi.ABI, eventNames ...string) error
- func (d *EventDecoder) RegisterContractABIJSON(contractABIJSON string, eventNames ...string) error
- func (d *EventDecoder) RegisterEventSig(eventSig ...string) error
- func (d *EventDecoder) TopicsList() []string
- func (d *EventDecoder) TopicsMap() map[string]struct{}
- type EventDef
- func DecodeTransactionLogByContractABI(txnLog types.Log, contractABI abi.ABI) (EventDef, []interface{}, bool, error)
- func DecodeTransactionLogByContractABIAsHex(txnLog types.Log, contractABI abi.ABI) (EventDef, []string, bool, error)
- func DecodeTransactionLogByContractABIJSON(txnLog types.Log, contractABIJSON string) (EventDef, []interface{}, bool, error)
- func DecodeTransactionLogByEventSig(txnLog types.Log, eventSig string) (EventDef, []interface{}, bool, error)
- func DecodeTransactionLogByEventSigAsHex(txnLog types.Log, eventSig string) (EventDef, []string, bool, error)
- func ParseEventDef(event string) (EventDef, error)
- type MerkleTree
- type Options
- type Proof
- type TypedData
- type TypedDataArgument
- type TypedDataDomain
- type TypedDataTypes
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultMerkleTreeOptions = Options{ SortLeaves: true, SortPairs: true, }
Functions ¶
func AbiCoderHex ¶
func AbiDecodeExpr ¶
func AbiDecoder ¶
func AbiEncodeMethodCalldata ¶
func AbiMarshalStringValues ¶
func AbiUnmarshalStringValues ¶
AbiDecodeStringValues will take an array of ethereum types and string values, and decode the string values to runtime objects.
func AddressPadding ¶
func BytesToBytes32 ¶
func EventTopicHash ¶ added in v1.24.11
EventTopicHash returns the keccak256 hash of the event signature
e.g. "Transfer(address indexed from, address indexed to, uint256 value)" will return 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
func FunctionSignature ¶
func HexDecodeBytes32 ¶
func HexTrimLeadingZeros ¶
func Keccak256Hash ¶ added in v1.17.0
func MustHexDecode ¶
func MustNewArrayTypeTuple ¶ added in v1.4.1
func MustNewArrayTypeTuple(components []abi.ArgumentMarshaling) abi.Type
func MustNewType ¶ added in v1.4.1
func ParseMethodABI ¶
ParseMethodABI will return an `abi.ABI` object from the short-hand method string expression, for example, methodExpr: `balanceOf(address)` returnsExpr: `uint256`
func SolidityPack ¶
func SolidityPackHex ¶
func StringifyValues ¶
func ValidateEventSig ¶ added in v1.26.3
Types ¶
type EventDecoder ¶ added in v1.26.5
type EventDecoder struct {
// contains filtered or unexported fields
}
func NewEventDecoder ¶ added in v1.26.5
func NewEventDecoder() *EventDecoder
func (*EventDecoder) DecodeLogAsHex ¶ added in v1.26.5
func (*EventDecoder) EventDefList ¶ added in v1.27.2
func (d *EventDecoder) EventDefList() []EventDef
func (*EventDecoder) RegisterContractABI ¶ added in v1.26.5
func (d *EventDecoder) RegisterContractABI(contractABI abi.ABI, eventNames ...string) error
func (*EventDecoder) RegisterContractABIJSON ¶ added in v1.26.5
func (d *EventDecoder) RegisterContractABIJSON(contractABIJSON string, eventNames ...string) error
func (*EventDecoder) RegisterEventSig ¶ added in v1.26.5
func (d *EventDecoder) RegisterEventSig(eventSig ...string) error
func (*EventDecoder) TopicsList ¶ added in v1.27.2
func (d *EventDecoder) TopicsList() []string
func (*EventDecoder) TopicsMap ¶ added in v1.27.2
func (d *EventDecoder) TopicsMap() map[string]struct{}
type EventDef ¶ added in v1.26.2
type EventDef struct { TopicHash string `json:"topicHash"` // the event topic hash, ie. 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef Name string `json:"name"` // the event name, ie. Transfer Sig string `json:"sig"` // the event sig, ie. Transfer(address,address,uint256) ArgTypes []string `json:"argTypes"` // the event arg types, ie. [address, address, uint256] ArgNames []string `json:"argNames"` // the event arg names, ie. [from, to, value] or ["","",""] ArgIndexed []bool `json:"argIndexed"` // the event arg indexed flag, ie. [true, false, true] NumIndexed int `json:"-"` }
func DecodeTransactionLogByContractABI ¶ added in v1.26.2
func DecodeTransactionLogByContractABIAsHex ¶ added in v1.26.5
func DecodeTransactionLogByContractABIJSON ¶ added in v1.26.2
func DecodeTransactionLogByContractABIJSON(txnLog types.Log, contractABIJSON string) (EventDef, []interface{}, bool, error)
..
func DecodeTransactionLogByEventSig ¶ added in v1.26.2
func DecodeTransactionLogByEventSigAsHex ¶ added in v1.26.5
func ParseEventDef ¶ added in v1.26.2
type MerkleTree ¶ added in v1.26.0
type MerkleTree[TLeaf any] struct { // contains filtered or unexported fields }
func NewMerkleTree ¶ added in v1.26.0
func NewMerkleTree[TLeaf any](leaves []TLeaf, hashFn *func(TLeaf) ([]byte, error), options *Options) *MerkleTree[TLeaf]
func (*MerkleTree[TLeaf]) GetHexProof ¶ added in v1.26.0
func (mt *MerkleTree[TLeaf]) GetHexProof(leaf TLeaf) [][]byte
func (*MerkleTree[TLeaf]) GetProof ¶ added in v1.26.0
func (mt *MerkleTree[TLeaf]) GetProof(leaf TLeaf) ([]Proof, error)
func (*MerkleTree[TLeaf]) GetRoot ¶ added in v1.26.0
func (mt *MerkleTree[TLeaf]) GetRoot() []byte
type TypedData ¶
type TypedData struct { Types TypedDataTypes `json:"types"` PrimaryType string `json:"primaryType"` Domain TypedDataDomain `json:"domain"` Message map[string]interface{} `json:"message"` }
func (*TypedData) EncodeDigest ¶
type TypedDataArgument ¶
type TypedDataDomain ¶
type TypedDataDomain struct { Name string `json:"name,omitempty"` Version string `json:"version,omitempty"` ChainID *big.Int `json:"chainId,omitempty"` VerifyingContract *common.Address `json:"verifyingContract,omitempty"` Salt *[32]byte `json:"salt,omitempty"` }
func (TypedDataDomain) Map ¶
func (t TypedDataDomain) Map() map[string]interface{}
type TypedDataTypes ¶
type TypedDataTypes map[string][]TypedDataArgument
func (TypedDataTypes) EncodeType ¶
func (t TypedDataTypes) EncodeType(primaryType string) (string, error)
Click to show internal directories.
Click to hide internal directories.