-
-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(conenct): add nostrSignEvent method
- Loading branch information
Showing
5 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Assert } from '@trezor/schema-utils'; | ||
|
||
import { AbstractMethod } from '../core/AbstractMethod'; | ||
import { PROTO } from '../constants'; | ||
|
||
export default class NostrSignEvent extends AbstractMethod<'nostrSignEvent', PROTO.NostrSignEvent> { | ||
init() { | ||
this.requiredPermissions = ['read', 'write']; | ||
|
||
Assert(PROTO.NostrSignEvent, this.payload); | ||
|
||
this.params = this.payload; | ||
} | ||
|
||
get info() { | ||
return 'sign nostr event? '; | ||
} | ||
|
||
get confirmation() { | ||
return { | ||
// todo: | ||
view: 'export-xpub' as const, | ||
label: 'sign?', | ||
}; | ||
} | ||
|
||
async run() { | ||
const cmd = this.device.getCommands(); | ||
const response = await cmd.typedCall('NostrSignEvent', 'NostrEventSignature', this.params); | ||
return response.message; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { PROTO } from '../../constants'; | ||
import { Params, Response } from '../params'; | ||
|
||
export declare function nostrSignEvent( | ||
params: Params<PROTO.NostrSignEvent>, | ||
): Response<PROTO.NostrEventSignature>; |