utils

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidRange = errors.New("invalid range")
)

Functions

func GetMessageHash

func GetMessageHash(message string) common.Hash

GetMessageHash gets EIP-191 personal-sign message digest to sign https://github.com/ethers-io/ethers.js/blob/c5cb7cd71d9a12b8feeec4fd956d0a416b0be32f/src.ts/hash/message.ts#L35-L36

func GetTypedDataHash

func GetTypedDataHash(typedData apitypes.TypedData) (common.Hash, error)

GetTypedDataHash returns the hash of the fully encoded eip-712 %%value%% for %%types%% with %%domain%%. https://github.com/ethers-io/ethers.js/blob/c5cb7cd71d9a12b8feeec4fd956d0a416b0be32f/src.ts/hash/typed-data.ts#L491

func ReadNAndShift

func ReadNAndShift[T any](data []T, baseOffset int, n int) ([]T, int, error)

func Slice

func Slice[T any](slice []T, from int, to int) ([]T, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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