Documentation ¶
Index ¶
- Constants
- Variables
- func EIP191HashMessage(message []byte) []byte
- func UnipassHashMessage(message []byte) []byte
- func VerifyMessageSignature(ctx context.Context, account common.Address, message, signature []byte, ...) (bool, error)
- func VerifySignature(ctx context.Context, account common.Address, msgHash [32]byte, sig []byte, ...) (bool, error)
- func VerifyTypedDataSignature(ctx context.Context, account common.Address, data apitypes.TypedData, ...) (bool, error)
Constants ¶
View Source
const EIP191MessagePrefix = "\x19Ethereum Signed Message:\n"
View Source
const IsValidSignatureABI = "" /* 328-byte string literal not displayed */
View Source
const UnipassMessagePrefix = "\x18UniPass Signed Message:\n"
Variables ¶
View Source
var EIP1271_SELECTOR = [32]byte{22, 38, 186, 126}
0x1626ba7e
Functions ¶
func EIP191HashMessage ¶
func UnipassHashMessage ¶
func VerifyMessageSignature ¶
func VerifyMessageSignature( ctx context.Context, account common.Address, message, signature []byte, isEIP191 bool, client *ethclient.Client) (bool, error)
Verify ethereum account signature, including EOA account and Contract account.
- parameter
- param ctx
- param account: account address.
- param message.
- param signature.
- param isEIP191Prefix boolean: Does the personal hash algorithm use EIP191 prefix. There are two message prefix for personal hash algorithm during signing:
- EIP191Prefix: `\x19Ethereum Signed Message:\n`
- UniPassPrefix: `\x18UniPass Signed Message:\n`
- param client: optional param, for contract signature validation
- returns signature validation result and error message
func VerifySignature ¶
func VerifyTypedDataSignature ¶
func VerifyTypedDataSignature( ctx context.Context, account common.Address, data apitypes.TypedData, signature []byte, client *ethclient.Client) (bool, error)
Verify typedData signature, including EOA account and Contract account.
- parameter
- param ctx
- param account: account address.
- param data.
- param signature.
- param client: optional param, for contract signature validation
- returns signature validation result and error message
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.