client

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package client provides a Go SDK for the remote-signer service.

The client uses a resource-based API design (Stripe/Octokit style):

client.EVM.Sign.Execute(ctx, req)
client.EVM.Rules.List(ctx, filter)
client.Audit.List(ctx, filter)
client.Templates.Get(ctx, id)

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnauthorized    = evm.ErrUnauthorized
	ErrNotFound        = evm.ErrNotFound
	ErrSignerNotFound  = evm.ErrSignerNotFound
	ErrInvalidPayload  = evm.ErrInvalidPayload
	ErrRateLimited     = evm.ErrRateLimited
	ErrPendingApproval = evm.ErrPendingApproval
	ErrRejected        = evm.ErrRejected
	ErrBlocked         = evm.ErrBlocked
	ErrTimeout         = evm.ErrTimeout
)

Re-export sentinel errors from the evm package.

Functions

This section is empty.

Types

type APIError

type APIError = transport.APIError

APIError represents an error returned by the remote-signer API.

type Client

type Client struct {
	// EVM provides EVM-specific operations (signing, rules, signers, HD wallets, etc.).
	EVM *evm.Service

	// Audit provides audit log operations.
	Audit *audit.Service

	// Templates provides rule template operations.
	Templates *templates.Service
	// contains filtered or unexported fields
}

Client is a client for the remote-signer service.

func NewClient

func NewClient(cfg Config) (*Client, error)

NewClient creates a new Client with the given configuration.

func (*Client) Health

func (c *Client) Health(ctx context.Context) (*HealthResponse, error)

Health checks the health of the remote-signer service.

func (*Client) Metrics added in v0.0.2

func (c *Client) Metrics(ctx context.Context) (string, error)

Metrics fetches the Prometheus exposition format metrics from /metrics.

type Config

type Config struct {
	// BaseURL is the base URL of the remote-signer service.
	BaseURL string

	// APIKeyID is the API key identifier.
	APIKeyID string

	// PrivateKey is the Ed25519 private key for signing requests.
	PrivateKey ed25519.PrivateKey

	// PrivateKeyHex is an alternative way to provide the private key as hex string.
	PrivateKeyHex string

	// PrivateKeyBase64 is an alternative way to provide the private key in base64 DER format.
	PrivateKeyBase64 string

	// HTTPClient is an optional custom HTTP client.
	HTTPClient *http.Client

	// PollInterval is the interval between status checks when waiting for approval.
	// Default: 2 seconds.
	PollInterval time.Duration

	// PollTimeout is the maximum time to wait for approval.
	// Default: 5 minutes.
	PollTimeout time.Duration

	// TLSCertFile is the path to the client TLS certificate (for mTLS).
	TLSCertFile string

	// TLSKeyFile is the path to the client TLS private key (for mTLS).
	TLSKeyFile string

	// TLSCAFile is the path to the CA certificate to verify the server.
	TLSCAFile string

	// TLSSkipVerify skips server certificate verification.
	TLSSkipVerify bool
}

Config holds configuration for creating a new Client.

type ErrorResponse

type ErrorResponse = transport.ErrorResponse

ErrorResponse represents an error response from the API.

type HealthResponse

type HealthResponse struct {
	Status  string `json:"status"`
	Version string `json:"version"`
}

HealthResponse represents the health check response.

type SignError

type SignError = evm.SignError

SignError represents an error during the signing process.

Directories

Path Synopsis
Package audit provides audit log client services for the remote-signer.
Package audit provides audit log client services for the remote-signer.
Package evm provides EVM-specific client services for the remote-signer.
Package evm provides EVM-specific client services for the remote-signer.
internal
Package mock provides per-resource mock implementations for testing.
Package mock provides per-resource mock implementations for testing.
Package templates provides template client services for the remote-signer.
Package templates provides template client services for the remote-signer.

Jump to

Keyboard shortcuts

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