Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 7fdba64

Browse files
authored
docs: update remote pinning docs (#3786)
Fix typos and errors in the example code.
1 parent fdc03ab commit 7fdba64

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

docs/core-api/PIN.md

+12-13
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ An optional object which may have the following keys:
8181

8282
| Type | Description |
8383
| -------- | -------- |
84-
| [CID][] | The CIDs that was pinned |
84+
| [CID][] | The CID that was pinned |
8585

8686
### Example
8787

@@ -295,13 +295,13 @@ An object may have the following optional fields:
295295

296296
| Type | Description |
297297
| ---- | -------- |
298-
| Promise<void> | Resolves if added succesfully, or fails with error e.g. if service with such name is already registered |
298+
| Promise<void> | Resolves if added successfully, or fails with error e.g. if service with such name is already registered |
299299

300300

301301
### Example
302302

303303
```JavaScript
304-
await ipfs.pin.remote.sevice.add('pinata', {
304+
await ipfs.pin.remote.service.add('pinata', {
305305
endpoint: new URL('https://api.pinata.cloud'),
306306
key: 'your-pinata-key'
307307
})
@@ -349,7 +349,7 @@ If stats could not be fetched from service (e.g. endpoint was unreachable) objec
349349
| status | `'invalid'` | Service status |
350350

351351

352-
If stats were fetched from service succesfully object has following form:
352+
If stats were fetched from service successfully object has following form:
353353

354354
| Name | Type | Description |
355355
| ---- | ---- | -------- |
@@ -372,7 +372,7 @@ Object has following fields:
372372
### Example
373373

374374
```JavaScript
375-
await ipfs.pin.remote.sevice.ls()
375+
await ipfs.pin.remote.service.ls()
376376
// [{
377377
// service: 'pinata'
378378
// endpoint: new URL('https://api.pinata.cloud'),
@@ -426,7 +426,7 @@ An object may have the following optional fields:
426426
### Example
427427

428428
```JavaScript
429-
await ipfs.pin.remote.sevice.rm('pinata')
429+
await ipfs.pin.remote.service.rm('pinata')
430430
```
431431

432432
A great source of [examples][] can be found in the tests for this API.
@@ -529,21 +529,20 @@ An object may have the following optional fields:
529529

530530
| Type | Description |
531531
| ---- | -------- |
532-
| AyncIterable<[Pin][]> | Pin Objects |
532+
| AysncIterable<[Pin][]> | Pin Objects |
533533

534534
### Example
535535

536536
```JavaScript
537-
const pins = await ipfs.pin.remote.ls({
538-
service: 'pinata'
539-
})
540-
console.log(pins)
537+
for await (const pin of ipfs.pin.remote.ls({ service: 'pinata' })) {
538+
console.log(pin)
539+
}
541540
// Logs:
542-
// [{
541+
// {
543542
// status: 'pinned',
544543
// cid: CID('QmWATWQ7fVPP2EFGu71UkfnqhYXDYH566qy47CnJDgvs8u'),
545544
// name: 'block-party'
546-
// }]
545+
// }
547546
```
548547

549548
A great source of [examples][] can be found in the tests for this API.

0 commit comments

Comments
 (0)