mpc

package
v1.36.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MPCSupportedCurrencies

func MPCSupportedCurrencies() []currency.Type

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

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

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

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

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

Jump to

Keyboard shortcuts

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