nostrGetPublicKey
Use requirement
- Firmware version required
- UKey Lite 24 / UKey Lite 25: 3.6.0
- UKey Core 26: 4.6.0
Nostr: get publicKey
Retrieves BIP32 extended public derived by given BIP32 path. User is presented with a description of the requested key and asked to confirm the export.
const result = await HardwareSDK.nostrGetPublicKey(connectId, deviceId, params);
Params
Exporting single public key
path- requiredstring | Array<number>minimum length is3. read moreshowOnUKey- optionalbooleandetermines if address will be displayed on device. Default is set totrue
Exporting bundle of public keys
bundle-Arrayof Objects withpath,coinfields
Example
Return public key of first ethereum account:
HardwareSDK.nostrGetPublicKey(connectId, deviceId, {
path: "m/44'/1237'/0'/0/0",
showOnUKey: true,
});
Return a bundle of public keys for multiple ethereum accounts:
HardwareSDK.nostrGetPublicKey(connectId, deviceId, {
bundle: [
{ path: "m/44'/1237'/0'/0/0" }, // account 1
{ path: "m/44'/1237'/0'" }, // account 2
{ path: "m/44'/1237'/0'/0/1" }, // account 3
],
});
Result
Result with only one public key
{
success: true,
payload: {
path: Array<number>, // hardended path
publickey: string, // publickey
npub: string, // npub
}
}
Result with bundle of public keys
{
success: true,
payload: [
{ path, publickey, npub }, // account 1
{ path, publickey, npub }, // account 2
{ path, publickey, npub }, // account 3
]
}
Error
{
success: false,
payload: {
error: string, // error message
code: number // error code
}
}