From 43a10a926adc7d96eac47d615b77283e808bf4e3 Mon Sep 17 00:00:00 2001 From: im-adithya Date: Wed, 29 May 2024 10:39:06 +0530 Subject: [PATCH] chore: update README --- README.md | 86 +++++++++++++++++++++++++------------------------------ 1 file changed, 39 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index df2d6f0..b07bf56 100644 --- a/README.md +++ b/README.md @@ -33,13 +33,15 @@ This `GET` request returns a pubkey's NWC capabilities (if any) ```json { - "id": "a16ye1391c22xx........xxxxx", - "pubkey": "a16y69effexxxx........xxxxx", - "created_at": 1708336682, - "kind": 13194, - "tags": [], - "content": "pay_invoice, pay_keysend, get_balance, get_info, make_invoice, lookup_invoice, list_transactions", - "sig": "" + "event": { + "id": "a16ye1391c22xx........xxxxx", + "pubkey": "a16y69effexxxx........xxxxx", + "created_at": 1708336682, + "kind": 13194, + "tags": [], + "content": "pay_invoice, pay_keysend, get_balance, get_info, make_invoice, lookup_invoice, list_transactions", + "sig": "" + } } ``` @@ -85,29 +87,34 @@ Returns the response event directly or to the Webhook URL if provided. #### Response (with webhook) ```json -"webhook received" +{ + "state": "WEBHOOK_RECEIVED" +} ``` #### Response (without webhook) ```json { - "id": "a16ycf4a01bcxx........xxxxx", - "pubkey": "a16y69effexxxx........xxxxx", - "created_at": 1709033612, - "kind": 23195, - "tags": [ - [ - "p", - "f490f5xxxxx........xxxxx" + "event": { + "id": "a16ycf4a01bcxx........xxxxx", + "pubkey": "a16y69effexxxx........xxxxx", + "created_at": 1709033612, + "kind": 23195, + "tags": [ + [ + "p", + "f490f5xxxxx........xxxxx" + ], + [ + "e", + "a41aefxxxxx........xxxxx" + ] ], - [ - "e", - "a41aefxxxxx........xxxxx" - ] - ], - "content": "", - "sig": "" + "content": "", + "sig": "", + }, + "state": "PUBLISHED" } ``` @@ -130,34 +137,16 @@ Publishes any **signed** event to the specified relay. | relayUrl | optional | string | If no relay is provided, it uses the default relay (wss://relay.getalby.com/v1) | | event | required | JSON object (see [example](#event-example)) | **Signed** event | -#### Response (with webhook) - -```json -"published" -``` - -#### Response (without webhook) +#### Response ```json { - "id": "a16ycf4a01bcxx........xxxxx", - "pubkey": "a16y69effexxxx........xxxxx", - "created_at": 1709033612, - "kind": 23195, - "tags": [ - [ - "p", - "f490f5xxxxx........xxxxx" - ], - [ - "e", - "a41aefxxxxx........xxxxx" - ] - ], - "content": "", - "sig": "" + "eventId": "a16ycf4a01bcxx........xxxxx", + "relayUrl": "wss://relay.custom.com/v1", + "state": "PUBLISHED", } ``` + ------------------------------------------------------------------------------------------ @@ -308,7 +297,10 @@ Delete previously requested subscriptions. #### Response ```json -"subscription x stopped" +{ + "message": "Subscription stopped successfully", + "state": "CLOSED" +} ```