stark

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package stark implements utilities for generating signers.L2Signer

Index

Constants

View Source
const (
	SeedStarkMessage = "Only sign this request if you’ve initiated an action with Immutable X."
)

Variables

This section is empty.

Functions

This section is empty.

Types

type StarkSigner

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

StarkSigner implements L2Signer interface.

func GenerateStarkSigner

func GenerateStarkSigner(signer signers.L1Signer) (*StarkSigner, error)

GenerateStarkSigner factory method to create StarkSigner.

func NewStarkSigner

func NewStarkSigner(privateKey, publicKey *big.Int, curve *caigo.StarkCurve) *StarkSigner

func (*StarkSigner) GetAddress

func (base *StarkSigner) GetAddress() string

GetAddress returns the stark public key of the StarkSigner as a 64 digit hex string prefixed with 0x.

func (*StarkSigner) SignMessage

func (base *StarkSigner) SignMessage(message string) (string, error)

func (*StarkSigner) VerifySignature

func (base *StarkSigner) VerifySignature(hash *big.Int, signature, requiredSigner string) error

VerifySignature validates the given signature is signed by the requiredSigner or not.

Jump to

Keyboard shortcuts

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