keys/keybase.go
func (kb dbKeybase) CreateLedger(name string, path crypto.DerivationPath, algo SignAlgo) (Info, error) {
	if algo != AlgoSecp256k1 {
		return nil, fmt.Errorf("Only secp256k1 is supported for Ledger devices")
	}
	priv, err := crypto.NewPrivKeyLedgerSecp256k1(path)
	if err != nil {
		return nil, err
	}
	pub := priv.PubKey()
	return kb.writeLedgerKey(pub, path, name), nil
}
func (kb dbKeybase) CreateLedger(name string, path crypto.DerivationPath, algo SignAlgo) (Info, error) {
	if algo != AlgoSecp256k1 {
		return nil, fmt.Errorf("Only secp256k1 is supported for Ledger devices")
	}
	priv, err := crypto.NewPrivKeyLedgerSecp256k1(path)
	if err != nil {
		return nil, err
	}
	pub := priv.PubKey()
	return kb.writeLedgerKey(pub, path, name), nil
}
func ( kb dbKeybase ) CreateLedger ( name string , path crypto . DerivationPath , algo SignAlgo ) ( Info , error ) { if algo != AlgoSecp256k1 { return nil , fmt . Errorf ( " " ) } priv , err := crypto . NewPrivKeyLedgerSecp256k1 ( path ) if err != nil { return nil , err } pub := priv . PubKey ( ) return kb . writeLedgerKey ( pub , path , name ) , nil }
// CreateLedger creates a new locally-stored reference to a Ledger keypair
// It returns the created key info and an error if the Ledger could not be queried
CreateLedger creates a new locally - stored reference to a Ledger keypair It returns the created key info and an error if the Ledger could not be queried