package keymanager

import (
	"context"
	"math/big"

	"github.com/ethereum/go-ethereum/core/types"
	"github.com/fbsobreira/gotron-sdk/pkg/proto/core"
)

// 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 string) (*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)
	// SignTronTransaction signs a native TRON transaction using the identified key material.
	SignTronTransaction(ctx context.Context, keyID string, tx *core.Transaction) (*core.Transaction, error)
}
