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

docs: update remote pinning docs #3786

Merged
merged 1 commit into from
Aug 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions docs/core-api/PIN.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ An optional object which may have the following keys:

| Type | Description |
| -------- | -------- |
| [CID][] | The CIDs that was pinned |
| [CID][] | The CID that was pinned |

### Example

Expand Down Expand Up @@ -295,13 +295,13 @@ An object may have the following optional fields:

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


### Example

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


If stats were fetched from service succesfully object has following form:
If stats were fetched from service successfully object has following form:

| Name | Type | Description |
| ---- | ---- | -------- |
Expand All @@ -372,7 +372,7 @@ Object has following fields:
### Example

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

```JavaScript
await ipfs.pin.remote.sevice.rm('pinata')
await ipfs.pin.remote.service.rm('pinata')
```

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

| Type | Description |
| ---- | -------- |
| AyncIterable<[Pin][]> | Pin Objects |
| AysncIterable<[Pin][]> | Pin Objects |

### Example

```JavaScript
const pins = await ipfs.pin.remote.ls({
service: 'pinata'
})
console.log(pins)
for await (const pin of ipfs.pin.remote.ls({ service: 'pinata' })) {
console.log(pin)
}
// Logs:
// [{
// {
// status: 'pinned',
// cid: CID('QmWATWQ7fVPP2EFGu71UkfnqhYXDYH566qy47CnJDgvs8u'),
// name: 'block-party'
// }]
// }
```

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