generated from shuding/nextra-docs-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3591528
commit 4cd2675
Showing
1 changed file
with
95 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# Create Nonce | ||
|
||
Creates a Burnable nonce | ||
**Required**: Authorized pubkey must sign the request. | ||
|
||
--- | ||
|
||
## Request | ||
|
||
> **POST** /api/nonce | ||
### Parameters | ||
|
||
Empty | ||
|
||
### Format | ||
|
||
The **body** should be wrapped in a NOSTR event, included in the `content` | ||
|
||
```json highlight=5-6 | ||
{ | ||
"id": "eventHash", | ||
"pubkey": "AUTHORIZED_PUB_KEY", | ||
"kind": 1112, | ||
"content": {}, // Empty | ||
"tags": [], | ||
"sig": "signature of AUTHORIZED_PUB_KEY" | ||
} | ||
``` | ||
|
||
--- | ||
|
||
## Response | ||
|
||
### 200 | ||
|
||
Valid Response | ||
|
||
```json | ||
{ | ||
"success": true, | ||
"nonce": "Nonce" | ||
} | ||
``` | ||
|
||
### 400 | ||
|
||
Malformed request | ||
|
||
```json | ||
{ | ||
"success": false, | ||
"reason": "Should send as NOSTR event" | ||
} | ||
``` | ||
|
||
### 403 | ||
|
||
Forbidden operation | ||
|
||
```json | ||
{ | ||
"success": false, | ||
"reason": "Pubkey not authorized" | ||
} | ||
``` | ||
|
||
### 405 | ||
|
||
Method Not Allowed | ||
|
||
```json | ||
{ | ||
"success": false, | ||
"reason": "Must use POST method" | ||
} | ||
``` | ||
|
||
### 409 | ||
|
||
Conflict | ||
|
||
```json | ||
{ | ||
"success": false, | ||
"reason": "Username already taken" | ||
} | ||
``` | ||
|
||
```json | ||
{ | ||
"success": false, | ||
"reason": "Pubkey already assigned to an existing account" | ||
} | ||
``` |