You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: ledger_secp256k1.go
    path of file: ./repos/cosmos-sdk/crypto/ledger
    
    the code of the file until where you have to start completion: package ledger

import (
	"errors"
	"fmt"
	"math/big"
	"os"

	secp "github.com/decred/dcrd/dcrec/secp256k1/v4"
	"github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa"
	"gitlab.com/yawning/secp256k1-voi/secec"

	"github.com/cosmos/cosmos-sdk/crypto/hd"
	"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
	"github.com/cosmos/cosmos-sdk/crypto/types"
)

// options stores the Ledger Options that c
    
func getPubKeyUnsafe(device SECP256K1, path hd.BIP44Params) (types.PubKey, error) {
	publicKey, err := device.GetPublicKeySECP256K1(path.DerivationPath())
	if err != nil {
		return nil, fmt.Errorf("please open the %v app on the Ledger device - error: %w", options.appName, err)
	}

	// re-serialize in the 33-byte compressed format
	cmp, err := secec.NewPublicKey(publicKey)
	if err != nil {
		return nil, fmt.Errorf("error parsing public key: %w", err)
	}

	compressedPublicKey := make([]byte, secp256k1.PubKeySize)
	copy(compressedPublicKey, cmp.CompressedBytes())

	return options.createPubkey(compressedPublicKey), nil
}