Documentation
¶
Index ¶
- func MPCSupportedCurrencies() []currency.Type
- type Config
- type MPCProcessor
- func (mp *MPCProcessor) Authorize(ctx context.Context, req processor.PaymentRequest) (*processor.PaymentResult, error)
- func (mp *MPCProcessor) Capture(ctx context.Context, transactionID string, amount currency.Cents) (*processor.PaymentResult, error)
- func (mp *MPCProcessor) Charge(ctx context.Context, req processor.PaymentRequest) (*processor.PaymentResult, error)
- func (mp *MPCProcessor) EstimateFee(ctx context.Context, req processor.PaymentRequest) (currency.Cents, error)
- func (mp *MPCProcessor) GenerateAddress(ctx context.Context, customerID string, chain string) (string, error)
- func (mp *MPCProcessor) GetBalance(ctx context.Context, address string, chain string) (*processor.Balance, error)
- func (mp *MPCProcessor) GetTransaction(ctx context.Context, txID string) (*processor.Transaction, error)
- func (mp *MPCProcessor) IsAvailable(ctx context.Context) bool
- func (mp *MPCProcessor) Refund(ctx context.Context, req processor.RefundRequest) (*processor.RefundResult, error)
- func (mp *MPCProcessor) SupportedChains() []string
- func (mp *MPCProcessor) Type() processor.ProcessorType
- func (mp *MPCProcessor) ValidateWebhook(ctx context.Context, payload []byte, signature string) (*processor.WebhookEvent, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MPCSupportedCurrencies ¶
MPCSupportedCurrencies returns cryptocurrencies supported by MPC
Types ¶
type Config ¶
type Config struct {
KMSEndpoint string // Hanzo KMS API endpoint
MPCEndpoint string // Hanzo MPC Signer endpoint
APIKey string // API key for authentication
}
Config holds MPC processor configuration
type MPCProcessor ¶
type MPCProcessor struct {
*processor.BaseProcessor
// contains filtered or unexported fields
}
MPCProcessor implements the processor.CryptoProcessor interface using Hanzo KMS (control plane) + MPC Signer (signing backend)
func NewProcessor ¶
func NewProcessor(cfg Config) *MPCProcessor
NewProcessor creates a new MPC processor
func (*MPCProcessor) Authorize ¶
func (mp *MPCProcessor) Authorize(ctx context.Context, req processor.PaymentRequest) (*processor.PaymentResult, error)
Authorize creates a pending transaction (for approval workflows)
func (*MPCProcessor) Capture ¶
func (mp *MPCProcessor) Capture(ctx context.Context, transactionID string, amount currency.Cents) (*processor.PaymentResult, error)
Capture executes an approved transaction
func (*MPCProcessor) Charge ¶
func (mp *MPCProcessor) Charge(ctx context.Context, req processor.PaymentRequest) (*processor.PaymentResult, error)
Charge processes a crypto payment (withdrawal from custody)
func (*MPCProcessor) EstimateFee ¶
func (mp *MPCProcessor) EstimateFee(ctx context.Context, req processor.PaymentRequest) (currency.Cents, error)
EstimateFee estimates transaction fees
func (*MPCProcessor) GenerateAddress ¶
func (mp *MPCProcessor) GenerateAddress(ctx context.Context, customerID string, chain string) (string, error)
GenerateAddress generates a new deposit address for a customer This triggers DKG (Distributed Key Generation) on the MPC nodes
func (*MPCProcessor) GetBalance ¶
func (mp *MPCProcessor) GetBalance(ctx context.Context, address string, chain string) (*processor.Balance, error)
GetBalance retrieves the balance for an address
func (*MPCProcessor) GetTransaction ¶
func (mp *MPCProcessor) GetTransaction(ctx context.Context, txID string) (*processor.Transaction, error)
GetTransaction retrieves transaction details
func (*MPCProcessor) IsAvailable ¶
func (mp *MPCProcessor) IsAvailable(ctx context.Context) bool
IsAvailable checks if the processor is available
func (*MPCProcessor) Refund ¶
func (mp *MPCProcessor) Refund(ctx context.Context, req processor.RefundRequest) (*processor.RefundResult, error)
Refund processes a refund (send back to source)
func (*MPCProcessor) SupportedChains ¶
func (mp *MPCProcessor) SupportedChains() []string
SupportedChains returns blockchain networks supported by MPC
func (*MPCProcessor) Type ¶
func (mp *MPCProcessor) Type() processor.ProcessorType
Type returns the processor type
func (*MPCProcessor) ValidateWebhook ¶
func (mp *MPCProcessor) ValidateWebhook(ctx context.Context, payload []byte, signature string) (*processor.WebhookEvent, error)
ValidateWebhook validates incoming blockchain event