You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pages/docs/creators/javascript/react/api-reference-overview.md
+8-10Lines changed: 8 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,13 +8,11 @@ type: React Reference
8
8
9
9
This section contains short descriptions of all the components and hooks available in the React SDK. Click on the name of the component or hook to see the full documentation.
|[YagnaProvider](/docs/creators/javascript/react/yagna-provider)| This component provides context for the Golem React SDK. It's required to wrap your app with this component if you want to use the SDK. |
14
-
|[useYagna](/docs/creators/javascript/react/use-yagna)| This hook provides information about the Yagna connection status. |
15
-
|[useExecutor](/docs/creators/javascript/react/use-executor)| This hook allows you to initialize and manage a task executor. |
16
-
|[useTask](/docs/creators/javascript/react/use-task)| This hook allows you to run a single task on the Golem Network |
17
-
|[useInvoices](/docs/creators/javascript/react/use-invoices)| This hook allows you to fetch all invoices known to your Yagna node. |
18
-
|[useHandleInvoice](/docs/creators/javascript/react/use-handle-invoice)| This hook allows you to handle invoices (currently only paying them is supported). |
19
-
|[useDebitNotes](/docs/creators/javascript/react/use-debit-notes)| This hook allows you to fetch all debit notes known to your Yagna node. |
20
-
|[useHandleDebitNote](/docs/creators/javascript/react/use-handle-debit-note)| This hook allows you to handle debit notes (currently only paying them is supported). |
|[YagnaProvider](/docs/creators/javascript/react/yagna-provider)| This component provides context for the Golem React SDK. It's required to wrap your app with this component if you want to use the SDK. |
14
+
|[useYagna](/docs/creators/javascript/react/use-yagna)| This hook provides information about the Yagna connection status. |
15
+
|[useExecutor](/docs/creators/javascript/react/use-executor)| This hook allows you to initialize and manage a task executor. |
16
+
|[useTask](/docs/creators/javascript/react/use-task)| This hook allows you to run a single task on the Golem Network |
17
+
|[useInvoices](/docs/creators/javascript/react/use-invoices)| This hook allows you to search through all invoices known to your Yagna node. |
18
+
|[useHandleInvoice](/docs/creators/javascript/react/use-handle-invoice)| This hook allows you to handle invoices (currently only paying them is supported). |
Add this component to your application and refresh the page. If you have set up everything correctly you should see "Yagna is connected"
101
+
Add this component to your application and refresh the page. Enter your app-key and if you have set up everything correctly you should see "Connected to Yagna!".
Copy file name to clipboardExpand all lines: src/pages/docs/creators/javascript/react/index.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,6 @@ The Golem React SDK provides a set of React hooks and components that make it ea
19
19
- Connecting to Yagna - use the [useYagna](/docs/creators/javascript/react/use-yagna) hook to connect display the connection status and reconnect to Yagna if the connection is lost.
20
20
- Running tasks on the network - use the [useExecutor](/docs/creators/javascript/react/use-executor) hook to initialize and terminate executors and the [useTask](/docs/creators/javascript/react/use-task) hook to run tasks on the network.
21
21
- Listing and handling invoices - use the [useInvoices](/docs/creators/javascript/react/use-invoices) hook to list invoices and the [useHandleInvoice](/docs/creators/javascript/react/use-handle-invoice) hook to handle invoices.
22
-
- Listing and handling debit notes - use the [useDebitNotes](/docs/creators/javascript/react/use-debit-notes) hook to list debit notes and the [useHandleDebitNote](/docs/creators/javascript/react/use-handle-debit-note) hook to handle debit notes.
23
22
24
23
{% docnavigation title="API reference" %}
25
24
@@ -31,6 +30,8 @@ If you want to learn more about each of the hooks and components provided by the
31
30
32
31
To help you get started we have created an example application that uses every hook and component provided by the SDK. You can find the source code for the example app on [GitHub](https://github.com/golemfactory/golem-sdk-react/tree/master/examples/react-with-vite). Feel free to clone the repository and play around with the code. Follow the instructions in the README to run the app locally.
33
32
33
+
To see the example app in action, you can also visit the [live demo](https://golem-react-showcase.vercel.app/).
34
+
34
35
## GitHub repository
35
36
36
37
The source code for the SDK along with an example app is available on [GitHub](https://github.com/golemfactory/golem-sdk-react) and we welcome contributions.
Copy file name to clipboardExpand all lines: src/pages/docs/creators/javascript/react/use-invoices.md
+19-40Lines changed: 19 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
---
2
2
title: useInvoices
3
-
description: React hook for fetching all invoices
3
+
description: React hook for searching invoices
4
4
type: React Reference
5
5
---
6
6
7
7
# useInvoices
8
8
9
-
`useInvoices` is a hook that fetches all invoices known to the connected yagna instance. It paginates data by default. Under the hood it uses [SWR](https://swr.vercel.app/) so you get all the benefits of caching and revalidation. It's also possible to configure that behavior by passing the `swrConfig` parameter. It returns an object with the following properties:
9
+
`useInvoices` is a hook that allows you to search through all invoices known to the connected yagna instance. Under the hood it uses [SWR](https://swr.vercel.app/) so you get all the benefits of caching and revalidation. It's also possible to configure that behavior by passing the `swrConfig` parameter. It returns an object with the following properties:
| after (optional) | A string representing the timestamp to start fetching invoices from. If not provided, the hook will fetch invoices starting from the earliest invoice known to the connected yagna instance. |
43
-
| limit (optional) | The maximum number of invoices to fetch. Defaults to 10. |
0 commit comments