From b26fb51785fdcf95d32c1ae3b5b28a7eebd768fb Mon Sep 17 00:00:00 2001 From: nazeh Date: Mon, 5 Aug 2024 16:42:00 +0300 Subject: [PATCH] docs(js): update README with API documentation --- pubky/pkg/README.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pubky/pkg/README.md b/pubky/pkg/README.md index c2f89d0..2bf2c2b 100644 --- a/pubky/pkg/README.md +++ b/pubky/pkg/README.md @@ -110,10 +110,20 @@ let response = await client.get(url) ### delete ```js -let response = await delete(url); +let response = await client.delete(url); ``` - url: A string representing the Pubky URL. +### list +```js +let response = await client.list(url, cursor, reverse, limit) +``` +- url: A string representing the Pubky URL. The path in that url is the prefix that you want to list files within. +- cursor: Usually the last URL from previous calls. List urls after/before (depending on `reverse`) the cursor. +- reverse: Whether or not return urls in reverse order. +- limit: Number of urls to return. +- Returns: A list of URLs of the files in the `url` you passed. + ### Keypair #### random @@ -186,5 +196,5 @@ Use the logged addresses as inputs to `PubkyClient` ```js import { PubkyClient } from '../index.js' -const client = new PubkyClient().testnet(); +const client = PubkyClient().testnet(); ```