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 (e *UnauthorizedTransactionError) Error() string
func (*UnauthorizedTransactionError) ErrorCode ¶
func (e *UnauthorizedTransactionError) ErrorCode() int
Click to show internal directories.
Click to hide internal directories.