Skip to content

Commit

Permalink
chore: add connect API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
horsefacts committed Oct 27, 2023
1 parent 890849f commit 357ee66
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/hubble/src/rpc/httpServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export class HttpAPIServer {

initHandlers() {
//================connect================
// @doc-tag: /connect
// @doc-tag: /connect?message=...&signature=...
this.app.post<{ Body: { message: string; signature: string } }>("/v1/connect", async (request, reply) => {
const { message, signature } = request.body;
const verifierOpts = getVerifier(this.l2PublicClient);
Expand Down
29 changes: 29 additions & 0 deletions apps/hubble/www/docs/docs/httpapi/connect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Farcaster Connect API

## connect
Verify a Farcaster Connect message and signature.


**Body Parameters**
| Parameter | Description |
| --------- | ----------- |
| message | Farcaster Connect sign in message |
| signature | ERC-191 signature |


**Example**
```bash
curl http://127.0.0.1:2281/v1/connect \
-H 'Content-Type: application/json' \
-d'{"message": "msg", "signature": "sig"}
```
**Response**
```json
{
"fid": 20943,
"success": true
}
```

0 comments on commit 357ee66

Please sign in to comment.