Skip to main content

nostrEncryptMessage

Use requirement

  • Firmware version required
    • UKey Lite 24 / UKey Lite 25: 3.6.0
    • UKey Core 26: 4.6.0

Nostr: Encrypt Message

Asks device to encrypt message using the private key derived by given BIP32 path. User is asked to confirm all transaction details on Ukey Wallet.

const result = await HardwareSDK.nostrEncryptMessage(
connectId,
deviceId,
params,
);

Params

Optional common params

  • path - required string | Array<number> minimum length is 3. read more
  • pubkey - required string public key .
  • plaintext - required string messages that need to be encrypted.
  • showOnUKey - optional boolean determines if address will be displayed on device. Default is set to true .

Examples

const response = await HardwareSDK.nostrEncryptMessage(connectId, deviceId, {
path: "m/44'/1237'/0'/0/0",
pubkey: "2118c65161c7d68b4bdbe1374f658532670057ab1bb0c99937d0ff7cff45cb5e",
plaintext: "Hello world",
showOnUKey: true,
});

Result

{
success: true,
payload: {
path: string;
pubkey: string;
plaintext: string;
encryptedMessage: string;
}
}

Error

{
success: false,
payload: {
error: string, // error message
code: number // error code
}
}