sign

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeForSigning

func EncodeForSigning(typedData apitypes.TypedData) (hash common.Hash, err error)

EncodeForSigning - Encoding the typed data

func VerifySig

func VerifySig(from, sigHex string, msg []byte) bool

VerifySig - Verify signature with recovered address

Types

type EtherSigner

type EtherSigner interface {
	// SignTypedData - Sign typed data
	SignTypedData(typedData apitypes.TypedData) (sig []byte, err error)
	Sign(digestHash []byte) (sig []byte, err error)
	GetAddress() string
}

type GcpKmsSigner

type GcpKmsSigner struct {
	KeyVersionName string
	Address        common.Address
}

func NewGcpKmsSigner

func NewGcpKmsSigner(hexAddress string, keyVersionName string) (*GcpKmsSigner, error)

func (*GcpKmsSigner) GetAddress

func (k *GcpKmsSigner) GetAddress() string

func (*GcpKmsSigner) Sign added in v0.0.4

func (k *GcpKmsSigner) Sign(digestHash []byte) ([]byte, error)

func (*GcpKmsSigner) SignTypedData

func (k *GcpKmsSigner) SignTypedData(typedData apitypes.TypedData) (sig []byte, err error)

SignTypedData - Sign typed data

type Wallet

type Wallet struct {
	PrivateKey *ecdsa.PrivateKey
	Address    common.Address
}

func NewWallet

func NewWallet(address string, privateKey string) (*Wallet, error)

func (*Wallet) GetAddress

func (w *Wallet) GetAddress() string

func (*Wallet) Sign added in v0.0.4

func (w *Wallet) Sign(digestHash []byte) (sig []byte, err error)

func (*Wallet) SignTypedData

func (w *Wallet) SignTypedData(typedData apitypes.TypedData) (sig []byte, err error)

SignTypedData - Sign typed data

Jump to

Keyboard shortcuts

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