Documentation
¶
Index ¶
Constants ¶
const ( GenerateWalletSuccessTopic = "mpc.mpc_keygen_result.*" // wildcard to listen to all success events ResharingSuccessTopic = "mpc.mpc_reshare_result.*" // wildcard to listen to all success events )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KMSSigner ¶ added in v0.3.2
type KMSSigner struct {
// contains filtered or unexported fields
}
KMSSigner implements the Signer interface for AWS KMS-based signing
func (*KMSSigner) Algorithm ¶ added in v0.3.2
func (k *KMSSigner) Algorithm() types.EventInitiatorKeyType
Algorithm implements the Signer interface for KMSSigner
type KMSSignerOptions ¶ added in v0.3.2
type KMSSignerOptions struct {
Region string // AWS region (e.g., "us-east-1", "us-west-2") - Required
KeyID string // AWS KMS key ID or ARN - Required
EndpointURL string // Custom endpoint URL (optional, for LocalStack/custom services)
AccessKeyID string // AWS access key ID (optional, uses default credential chain if not provided)
SecretAccessKey string // AWS secret access key (optional, uses default credential chain if not provided)
}
KMSSignerOptions defines options for creating a KMSSigner
type LocalSigner ¶ added in v0.3.2
type LocalSigner struct {
// contains filtered or unexported fields
}
LocalSigner implements the Signer interface for local key management
func (*LocalSigner) Algorithm ¶ added in v0.3.2
func (s *LocalSigner) Algorithm() types.EventInitiatorKeyType
Algorithm implements the Signer interface for LocalSigner
func (*LocalSigner) PublicKey ¶ added in v0.3.2
func (s *LocalSigner) PublicKey() (string, error)
PublicKey implements the Signer interface for LocalSigner
type LocalSignerOptions ¶ added in v0.3.2
type LocalSignerOptions struct {
KeyPath string // Path to the key file
Encrypted bool // Whether the key is encrypted
Password string // Password for decryption (required if encrypted)
}
LocalSignerOptions defines options for creating a LocalSigner
type MPCClient ¶
type MPCClient interface {
CreateWallet(walletID string) error
CreateWalletWithAuthorizers(walletID string, authorizerSignatures []types.AuthorizerSignature) error
OnWalletCreationResult(callback func(event event.KeygenResultEvent)) error
SignTransaction(msg *types.SignTxMessage) error
OnSignResult(callback func(event event.SigningResultEvent)) error
Resharing(msg *types.ResharingMessage) error
OnResharingResult(callback func(event event.ResharingResultEvent)) error
}
func NewMPCClient ¶
NewMPCClient creates a new MPC client using the provided options. The signer must be provided to handle message signing.
type Options ¶
type Options struct {
// NATS connection
NatsConn *nats.Conn
// Signer for signing messages
Signer Signer
}
Options defines configuration options for creating a new MPCClient
type Signer ¶ added in v0.3.2
type Signer interface {
// Sign signs the given data and returns the signature
Sign(data []byte) ([]byte, error)
// Algorithm returns the key algorithm used by this signer
Algorithm() types.EventInitiatorKeyType
// PublicKey returns the public key in hex format
PublicKey() (string, error)
}
Signer defines the interface for signing messages with different key types
func NewKMSSigner ¶ added in v0.3.2
func NewKMSSigner(keyType types.EventInitiatorKeyType, opts KMSSignerOptions) (Signer, error)
NewKMSSigner creates a new KMSSigner using AWS KMS Note: AWS KMS supports P256, not Ed25519
func NewLocalSigner ¶ added in v0.3.2
func NewLocalSigner(keyType types.EventInitiatorKeyType, opts LocalSignerOptions) (Signer, error)
NewLocalSigner creates a new LocalSigner for the specified key type