Skip to content

Commit 712ef1d

Browse files
Merge branch 'feature/proving-requests' into update/add-ctx-headers
Signed-off-by: Mike Turner <[email protected]>
2 parents dfb1dbe + a08d7a5 commit 712ef1d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+3505
-361
lines changed

create-leo-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-leo-app",
3-
"version": "0.9.0",
3+
"version": "0.9.1",
44
"type": "module",
55
"license": "GPL-3.0",
66
"collaborators": [

docs/api_reference/sdk-src_network-client.md

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,55 @@ networkClient.setHost("http://api.explorer.provable.com/v1");
8585

8686
---
8787

88+
### `setHeader(headerName, value)`
89+
90+
![modifier: public](images/badges/modifier-public.svg)
91+
92+
Set a header in the &#x60;AleoNetworkClient&#x60;s header map
93+
94+
Parameters | Type | Description
95+
--- | --- | ---
96+
__headerName__ | `string` | *The name of the header to set*
97+
__value__ | `string` | *The header value*
98+
99+
#### Examples
100+
101+
```javascript
102+
import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
103+
104+
// Create a networkClient
105+
const networkClient = new AleoNetworkClient();
106+
107+
// Set the value of the `Accept-Language` header to `en-US`
108+
networkClient.setHeader('Accept-Language', 'en-US');
109+
```
110+
111+
---
112+
113+
### `removeHeader(headerName)`
114+
115+
![modifier: public](images/badges/modifier-public.svg)
116+
117+
Remove a header from the &#x60;AleoNetworkClient&#x60;s header map
118+
119+
Parameters | Type | Description
120+
--- | --- | ---
121+
__headerName__ | `string` | *The name of the header to be removed*
122+
123+
#### Examples
124+
125+
```javascript
126+
import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
127+
128+
// Create a networkClient
129+
const networkClient = new AleoNetworkClient();
130+
131+
// Remove the default `X-Aleo-SDK-Version` header
132+
networkClient.removeHeader('X-Aleo-SDK-Version');
133+
```
134+
135+
---
136+
88137
### `fetchData(url)`
89138

90139
![modifier: public](images/badges/modifier-public.svg)
@@ -956,6 +1005,20 @@ __*return*__ | `Promise.<string>` | *The solution id of the submitted solution o
9561005
9571006
---
9581007
1008+
### `submitProvingRequest(provingRequest, url) ► Promise.<ProvingResponse>`
1009+
1010+
![modifier: public](images/badges/modifier-public.svg)
1011+
1012+
Submit a &#x60;ProvingRequest&#x60; to the Aleo network.
1013+
1014+
Parameters | Type | Description
1015+
--- | --- | ---
1016+
__provingRequest__ | [ProvingRequest](sdk-src_wasm.md) | *The &#x60;ProvingRequest&#x60; to submit*
1017+
__url__ | `string` | *(Optional) The url of the proving service.*
1018+
__*return*__ | `Promise.<ProvingResponse>` | *The solution id of the submitted solution or the resulting error.*
1019+
1020+
---
1021+
9591022
### `waitForTransactionConfirmation(transactionId, checkInterval, timeout) ► Promise.<Transaction>`
9601023
9611024
![modifier: public](images/badges/modifier-public.svg)
@@ -1058,6 +1121,55 @@ networkClient.setHost("http://api.explorer.provable.com/v1");
10581121
10591122
---
10601123
1124+
### `setHeader(headerName, value)`
1125+
1126+
![modifier: public](images/badges/modifier-public.svg)
1127+
1128+
Set a header in the &#x60;AleoNetworkClient&#x60;s header map
1129+
1130+
Parameters | Type | Description
1131+
--- | --- | ---
1132+
__headerName__ | `string` | *The name of the header to set*
1133+
__value__ | `string` | *The header value*
1134+
1135+
#### Examples
1136+
1137+
```javascript
1138+
import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
1139+
1140+
// Create a networkClient
1141+
const networkClient = new AleoNetworkClient();
1142+
1143+
// Set the value of the `Accept-Language` header to `en-US`
1144+
networkClient.setHeader('Accept-Language', 'en-US');
1145+
```
1146+
1147+
---
1148+
1149+
### `removeHeader(headerName)`
1150+
1151+
![modifier: public](images/badges/modifier-public.svg)
1152+
1153+
Remove a header from the &#x60;AleoNetworkClient&#x60;s header map
1154+
1155+
Parameters | Type | Description
1156+
--- | --- | ---
1157+
__headerName__ | `string` | *The name of the header to be removed*
1158+
1159+
#### Examples
1160+
1161+
```javascript
1162+
import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
1163+
1164+
// Create a networkClient
1165+
const networkClient = new AleoNetworkClient();
1166+
1167+
// Remove the default `X-Aleo-SDK-Version` header
1168+
networkClient.removeHeader('X-Aleo-SDK-Version');
1169+
```
1170+
1171+
---
1172+
10611173
### `fetchData(url) ► Promise.<Type>`
10621174
10631175
![modifier: public](images/badges/modifier-public.svg)
@@ -1931,6 +2043,20 @@ __*return*__ | `Promise.<string>` | *The solution id of the submitted solution o
19312043
19322044
---
19332045
2046+
### `submitProvingRequest(provingRequest, url) ► Promise.<ProvingResponse>`
2047+
2048+
![modifier: public](images/badges/modifier-public.svg)
2049+
2050+
Submit a &#x60;ProvingRequest&#x60; to the Aleo network.
2051+
2052+
Parameters | Type | Description
2053+
--- | --- | ---
2054+
__provingRequest__ | [ProvingRequest](sdk-src_wasm.md) | *The &#x60;ProvingRequest&#x60; to submit*
2055+
__url__ | `string` | *(Optional) The url of the proving service.*
2056+
__*return*__ | `Promise.<ProvingResponse>` | *The solution id of the submitted solution or the resulting error.*
2057+
2058+
---
2059+
19342060
### `waitForTransactionConfirmation(transactionId, checkInterval, timeout) ► Promise.<Transaction>`
19352061
19362062
![modifier: public](images/badges/modifier-public.svg)
@@ -1967,3 +2093,31 @@ const transaction = await networkClient.waitForTransactionConfirmation(transacti
19672093
```
19682094
19692095
---
2096+
2097+
### `_sendPost(url, options) ► `
2098+
2099+
![modifier: private](images/badges/modifier-private.svg)
2100+
2101+
Wrapper around the POST helper to allow mocking in tests. Not meant for use in production.
2102+
2103+
Parameters | Type | Description
2104+
--- | --- | ---
2105+
__url__ | `undefined` | *The URL to POST to.*
2106+
__options__ | `undefined` | *The RequestInit options for the POST request.*
2107+
__*return*__ | `undefined` | *The Response object from the POST request.*
2108+
2109+
---
2110+
2111+
### `_sendPost(url, options) ► `
2112+
2113+
![modifier: private](images/badges/modifier-private.svg)
2114+
2115+
Wrapper around the POST helper to allow mocking in tests. Not meant for use in production.
2116+
2117+
Parameters | Type | Description
2118+
--- | --- | ---
2119+
__url__ | `undefined` | *The URL to POST to.*
2120+
__options__ | `undefined` | *The RequestInit options for the POST request.*
2121+
__*return*__ | `undefined` | *The Response object from the POST request.*
2122+
2123+
---

0 commit comments

Comments
 (0)