localsigner

package
v0.0.107 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: MIT Imports: 8 Imported by: 3

Documentation

Overview

Package localsigner is a local signer

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Signer

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

Signer is a new local signer.

func NewSigner

func NewSigner(key *ecdsa.PrivateKey) *Signer

NewSigner creates a new signer.

Example
testWallet, err := wallet.FromHex("63e21d10fd50155dbba0e7d3f7431a400b84b4c2ac1ee38872f82448fe3ecfb9")
if err != nil {
	panic(err)
}

newSigner := localsigner.NewSigner(testWallet.PrivateKey())
fmt.Println(newSigner.Address())
Output:

0xC49926C4124cEe1cbA0Ea94Ea31a6c12318df947

func (*Signer) Address

func (s *Signer) Address() common.Address

Address gets the address of the signer.

func (*Signer) GetTransactor

func (s *Signer) GetTransactor(ctx context.Context, chainID *big.Int) (*bind.TransactOpts, error)

GetTransactor gets the transcator.

func (*Signer) SignMessage

func (s *Signer) SignMessage(_ context.Context, message []byte, hash bool) (signer.Signature, error)

SignMessage signs a message w/o eip-155.

Jump to

Keyboard shortcuts

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