package keymanager

import (
	"context"
	"math/big"

	"github.com/ethereum/go-ethereum/core/types"
	pmodel "github.com/tech/sendico/pkg/model"
)

// ManagedWalletKey captures information returned after provisioning a managed wallet key.
type ManagedWalletKey struct {
	KeyID     string
	Address   string
	PublicKey string
}

// Manager defines the contract for managing managed wallet keys.
type Manager interface {
	// CreateManagedWalletKey provisions a new managed wallet key for the provided wallet reference and network.
	CreateManagedWalletKey(ctx context.Context, walletRef string, network pmodel.ChainNetwork) (*ManagedWalletKey, error)
	// SignTransaction signs the provided transaction using the identified key material.
	SignTransaction(ctx context.Context, keyID string, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error)
}
