local

package
v0.1.0-dev Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package local is the in-memory secp256k1 TransactionSigner (adapter kind "unsafe-local"). Test and vector use only: construction requires an explicit UnsafeTestOnly opt-in and always refuses when the network type is mainnet.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// UnsafeTestOnly must be set explicitly; there is no production use of
	// this signer.
	UnsafeTestOnly bool
	// NetworkType "mainnet" (case-insensitive) refuses construction
	// regardless of UnsafeTestOnly.
	NetworkType string
}

type Signer

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

func New

func New(opts Options) (*Signer, error)

func (*Signer) GenerateKey

func (s *Signer) GenerateKey(keyRef string) ([]byte, error)

GenerateKey creates a fresh random key under keyRef and returns its compressed public key.

func (*Signer) GetPublicKey

func (*Signer) ImportKey

func (s *Signer) ImportKey(keyRef string, secret []byte) error

ImportKey registers a 32-byte secp256k1 secret under keyRef, replacing any existing key.

func (*Signer) Sign

Jump to

Keyboard shortcuts

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