Skip to content
This repository was archived by the owner on Aug 23, 2021. It is now read-only.

Commit 11087c0

Browse files
committed
Updates API doc
1 parent 04b5373 commit 11087c0

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

API.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* [client.cat](#clientcat)
1212
* [client.import](#clientimport)
1313
* [client.listAsks](#clientlistasks)
14-
* client.payments
14+
* [client.payments](#clientpayments)
1515
* client.proposeStorageDeal
1616
* client.queryStorageDeal
1717
* [config.get](#configget)
@@ -401,6 +401,46 @@ After first iteration:
401401
*/
402402
```
403403

404+
## `client.payments`
405+
406+
> List payments for a given deal
407+
408+
### `client.payments([options])`
409+
410+
#### Parameters
411+
412+
| Name | Type | Description |
413+
|------|------|-------------|
414+
| channel id | `String` | Channel id from which to list vouchers |
415+
| options | `Object` | Optional options |
416+
| options.signal | [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) | A signal that can be used to abort the request |
417+
418+
#### Returns
419+
420+
| Type | Description |
421+
|------|-------------|
422+
| `Promise<Object[]>` | List of payments |
423+
424+
```js
425+
const cid = 'zDPWYqFCuTNxiwRkt1iDJWEy6qKPGCunMGHrP1ojsMrZDWKYsgzF'
426+
const payments = await fc.client.payments(cid)
427+
console.log(payments)
428+
429+
/*
430+
[
431+
{
432+
"channel":0,
433+
"payer":"t1bcvxo4ztdkukjmrsjvc5d4w24cl55vvbrssspyy",
434+
"target":"t1uo4nzu44apoclkbjbbvc4f3irbptg3ctjq44wiq",
435+
"amount":"25000",
436+
"valid_at":8,
437+
"condition":null,
438+
"signature":"1My76149fPIulbdO/DKlkUBMMSLwGYSw2XmVKXq3HrxMG5kkmBgsaPZ/DzdxiOWX5kdnXJ++AFQqsmWHd5dtOwE="
439+
}
440+
]
441+
*/
442+
```
443+
404444
## `config.get`
405445

406446
> Get config values

0 commit comments

Comments
 (0)