utils

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2025 License: Apache-2.0 Imports: 27 Imported by: 5 modules, 8 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const Percentage = 100

Variables

This section is empty.

Functions

This section is empty.

Types

type ISign

type ISign interface {
	// sign function receives raw message, not hash of message
	Sign(message []byte, dataType string) ([]byte, error)
	GetAddress() common.Address
}

func NewSignMethod

func NewSignMethod(config *SignMethodConfig) (ISign, error)

type KmsSign

type KmsSign struct {
	*kms.KmsSign
}

func NewKmsSign

func NewKmsSign(kmsConfig *kms.KmsConfig) (*KmsSign, error)

func (*KmsSign) GetAddress

func (kmsSign *KmsSign) GetAddress() common.Address

func (*KmsSign) Sign

func (kmsSign *KmsSign) Sign(message []byte, dataType string) ([]byte, error)

type PrivateKeyConfig

type PrivateKeyConfig struct {
	PrivateKey string `json:"privateKey"`
}

type PrivateKeySign

type PrivateKeySign struct {
	// contains filtered or unexported fields
}

func NewPrivateKeySign

func NewPrivateKeySign(plainPrivateKey string) (*PrivateKeySign, error)

func (*PrivateKeySign) GetAddress

func (privateKeySign *PrivateKeySign) GetAddress() common.Address

func (*PrivateKeySign) Sign

func (privateKeySign *PrivateKeySign) Sign(message []byte, dataType string) ([]byte, error)

type SignMethodConfig

type SignMethodConfig struct {
	PlainPrivateKey string         `json:"plainPrivateKey,omitempty" mapstructure:"plainPrivateKey"`
	KmsConfig       *kms.KmsConfig `json:"kmsConfig,omitempty"`
}

type Utils

type Utils interface {
	Invoke(any interface{}, name string, args ...interface{}) (reflect.Value, error)
	LoadAbi(path string) (*abi.ABI, error)
	GetArguments(a abi.ABI, name string, data []byte, isInput bool) (abi.Arguments, error)
	UnpackToInterface(a abi.ABI, name string, data []byte, isInput bool, v interface{}) error
	Title(text string) string
	NewEthClient(url string) (EthClient, error)
	SendContractTransaction(signMethod ISign, chainId *big.Int, gasLimitBumpRatio uint64, fn func(opts *bind.TransactOpts) (*types.Transaction, error)) (*types.Transaction, error)
	SignTypedData(typedData core.TypedData, signMethod ISign) (hexutil.Bytes, error)
	FilterLogs(client EthClient, opts *bind.FilterOpts, contractAddresses []common.Address, filteredMethods map[*abi.ABI]map[string]struct{}) ([]types.Log, error)
	RlpHash(x interface{}) (h common.Hash)
	UnpackLog(smcAbi abi.ABI, out interface{}, event string, data []byte) error
}

func NewUtils

func NewUtils() Utils

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL