service

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MetricSignTransactionTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "signer_signtransaction_total",
			Help: ""},
		[]string{"client", "status", "error"},
	)
)

Functions

func NewAuthMiddleware

func NewAuthMiddleware() oprpc.Middleware

Types

type AuthConfig

type AuthConfig struct {
	ClientName  string   `yaml:"name"`
	KeyName     string   `yaml:"key"`
	ToAddresses []string `yaml:"toAddresses"`
	MaxValue    string   `yaml:"maxValue"`
}

func (AuthConfig) MaxValueToInt

func (c AuthConfig) MaxValueToInt() *big.Int

type ClientInfo

type ClientInfo struct {
	ClientName string
}

func ClientInfoFromContext

func ClientInfoFromContext(ctx context.Context) ClientInfo

type InvalidTransactionError

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

func (*InvalidTransactionError) Error

func (e *InvalidTransactionError) Error() string

func (*InvalidTransactionError) ErrorCode

func (e *InvalidTransactionError) ErrorCode() int

type SignerService

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

func NewSignerService

func NewSignerService(logger log.Logger, config SignerServiceConfig) *SignerService

func NewSignerServiceWithProvider

func NewSignerServiceWithProvider(
	logger log.Logger,
	config SignerServiceConfig,
	provider provider.SignatureProvider,
) *SignerService

func (*SignerService) RegisterAPIs

func (s *SignerService) RegisterAPIs(server *oprpc.Server)

func (*SignerService) SignTransaction

func (s *SignerService) SignTransaction(ctx context.Context, args signer.TransactionArgs) (hexutil.Bytes, error)

SignTransaction will sign the given transaction with the key configured for the authenticated client

type SignerServiceConfig

type SignerServiceConfig struct {
	Auth []AuthConfig `yaml:"auth"`
}

func ReadConfig

func ReadConfig(path string) (SignerServiceConfig, error)

func (SignerServiceConfig) GetAuthConfigForClient

func (s SignerServiceConfig) GetAuthConfigForClient(clientName string) (*AuthConfig, error)

type UnauthorizedTransactionError

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

func (*UnauthorizedTransactionError) Error

func (*UnauthorizedTransactionError) ErrorCode

func (e *UnauthorizedTransactionError) ErrorCode() int

Directories

Path Synopsis
Package provider is a generated GoMock package.
Package provider is a generated GoMock package.

Jump to

Keyboard shortcuts

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