Asks device to sign given nostr event using the private key derived by given BIP32 path. User is asked to confirm all transaction details on OneKey.
const result = await HardwareSDK.nostrSignEvent(connectId, deviceId, params);
enum EventKind {
Metadata = 0,
Text = 1,
RelayRec = 2,
Contacts = 3,
DM = 4,
Deleted = 5,
Reaction = 7,
BadgeAward = 8,
ChannelCreation = 40,
ChannelMetadata = 41,
ChannelMessage = 42,
ChannelHideMessage = 43,
Reporting = 1984,
ZapRequest = 9734,
Zap = 9735,
RelayListMetadata = 10002,
ClientAuthentication = 22242,
NostrConnect = 24133,
ProfileBadges = 30008,
BadgeDefinition = 30009,
LongFormContent = 30023,
ApplicationSpecificData = 30078,
}
type NostrEvent = {
id?: string;
kind: EventKind;
pubkey?: string;
content: string;
tags: string[][];
created_at: number;
sig?: string;
};
const response = await HardwareSDK.nostrSignEvent(
connectId,
deviceId,
{
path: string,
event: {
kind: 1,
content: 'Hello world',
tags: [],
created_at: 1702268010,
},
}
);
{
success: true,
payload: {
event: {
kind: 1,
content: 'Hello world',
tags: [],
created_at: 1702268010,
sig: '',
},
}
}
{
success: false,
payload: {
error: string, // error message
code: number // error code
}
}