Skip to content

Commit 9cb9f7a

Browse files
Update documentation to include full description of parameters
1 parent f4ea95b commit 9cb9f7a

File tree

7 files changed

+38
-144
lines changed

7 files changed

+38
-144
lines changed

docs/api_reference/sdk-src_network-client.md

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -110,30 +110,6 @@ networkClient.setHeader('Accept-Language', 'en-US');
110110

111111
---
112112

113-
### `removeHeader(headerName)`
114-
115-
![modifier: public](images/badges/modifier-public.svg)
116-
117-
Remove a header from the `AleoNetworkClient`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-
137113
### `fetchData(url)`
138114

139115
![modifier: public](images/badges/modifier-public.svg)
@@ -1146,30 +1122,6 @@ networkClient.setHeader('Accept-Language', 'en-US');
11461122
11471123
---
11481124
1149-
### `removeHeader(headerName)`
1150-
1151-
![modifier: public](images/badges/modifier-public.svg)
1152-
1153-
Remove a header from the `AleoNetworkClient`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-
11731125
### `fetchData(url) ► Promise.<Type>`
11741126
11751127
![modifier: public](images/badges/modifier-public.svg)

docs/api_reference/sdk-src_program-manager.md

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -108,30 +108,6 @@ programManager.setHeader('Accept-Language', 'en-US');
108108

109109
---
110110

111-
### `removeHeader(headerName)`
112-
113-
![modifier: public](images/badges/modifier-public.svg)
114-
115-
Remove a header from the &#x60;AleoNetworkClient&#x60;s header map
116-
117-
Parameters | Type | Description
118-
--- | --- | ---
119-
__headerName__ | `string` | *The name of the header to be removed*
120-
121-
#### Examples
122-
123-
```javascript
124-
import { ProgramManager } from "@provablehq/sdk/mainnet.js";
125-
126-
// Create a ProgramManager
127-
const programManager = new ProgramManager("https://api.explorer.provable.com/v1");
128-
129-
// Remove the default `X-Aleo-SDK-Version` header
130-
programManager.removeHeader('X-Aleo-SDK-Version');
131-
```
132-
133-
---
134-
135111
### `buildDeploymentTransaction(program, priorityFee, privateFee, recordSearchParams, feeRecord, privateKey) ► string`
136112

137113
![modifier: public](images/badges/modifier-public.svg)
@@ -1357,30 +1333,6 @@ programManager.setHeader('Accept-Language', 'en-US');
13571333

13581334
---
13591335

1360-
### `removeHeader(headerName)`
1361-
1362-
![modifier: public](images/badges/modifier-public.svg)
1363-
1364-
Remove a header from the &#x60;AleoNetworkClient&#x60;s header map
1365-
1366-
Parameters | Type | Description
1367-
--- | --- | ---
1368-
__headerName__ | `string` | *The name of the header to be removed*
1369-
1370-
#### Examples
1371-
1372-
```javascript
1373-
import { ProgramManager } from "@provablehq/sdk/mainnet.js";
1374-
1375-
// Create a ProgramManager
1376-
const programManager = new ProgramManager("https://api.explorer.provable.com/v1");
1377-
1378-
// Remove the default `X-Aleo-SDK-Version` header
1379-
programManager.removeHeader('X-Aleo-SDK-Version');
1380-
```
1381-
1382-
---
1383-
13841336
### `buildDeploymentTransaction(program, priorityFee, privateFee, recordSearchParams, feeRecord, privateKey) ► string`
13851337

13861338
![modifier: public](images/badges/modifier-public.svg)

docs/api_reference/sdk-src_wasm.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ Create a new authorization from a request object.
216216

217217
Parameters | Type | Description
218218
--- | --- | ---
219-
__request__ | `ExecutionRequest` | **
219+
__request__ | `ExecutionRequest` | *The ExecutionRequest to build the authorization from.*
220220
__*return*__ | [Authorization](sdk-src_wasm.md) | **
221221

222222
---
@@ -253,7 +253,7 @@ Reconstructs an Authorization object from its string representation.
253253

254254
Parameters | Type | Description
255255
--- | --- | ---
256-
__authorization__ | `string` | **
256+
__authorization__ | `String` | *The string representation of the Authorization.*
257257
__*return*__ | [Authorization](sdk-src_wasm.md) | **
258258

259259
---
@@ -278,7 +278,7 @@ Creates an authorization object from a left-endian byte representation of an Aut
278278

279279
Parameters | Type | Description
280280
--- | --- | ---
281-
__bytes__ | `Uint8Array` | **
281+
__bytes__ | `Uint8Array` | *Left-endian bytes representing the Authorization.*
282282
__*return*__ | [Authorization](sdk-src_wasm.md) | **
283283

284284
---
@@ -291,7 +291,7 @@ Check if an Authorization object is the same as another.
291291

292292
Parameters | Type | Description
293293
--- | --- | ---
294-
__other__ | [Authorization](sdk-src_wasm.md) | **
294+
__other__ | [Authorization](sdk-src_wasm.md) | *The Authorization object to determine equality with.*
295295
__*return*__ | `boolean` | **
296296

297297
---
@@ -364,7 +364,7 @@ Insert a transition into the Authorization.
364364

365365
Parameters | Type | Description
366366
--- | --- | ---
367-
__transition__ | `Transition` | **
367+
__transition__ | `Transition` | *The transition object to insert into the Authorization.*
368368
__*return*__ | `void` | **
369369

370370
---
@@ -2432,13 +2432,13 @@ Represents a proving request to a delegated proving service.
24322432
24332433
![modifier: public](images/badges/modifier-public.svg) ![modifier: static](images/badges/modifier-static.svg)
24342434
2435-
Creates a new ProvingRequest from a function authorization and an optional fee authorization.
2435+
Creates a new ProvingRequest from a function Authorization and an optional fee Authorization.
24362436
24372437
Parameters | Type | Description
24382438
--- | --- | ---
2439-
__authorization__ | [Authorization](sdk-src_wasm.md) | **
2440-
__fee_authorization__ | [Authorization](sdk-src_wasm.md) | **
2441-
__broadcast__ | `boolean` | **
2439+
__authorization__ | [Authorization](sdk-src_wasm.md) | *An Authorization for a function.*
2440+
__fee_authorization__ | [Authorization](sdk-src_wasm.md) | *The authorization for the &#x60;credits.aleo/fee_public&#x60; or &#x60;credits.aleo/fee_private&#x60; function that pays the fee for the execution of the main function.*
2441+
__broadcast__ | `boolean` | *Flag that indicates whether the remote proving service should attempt to submit the transaction on the caller&#x27;s behalf.*
24422442
__*return*__ | [ProvingRequest](sdk-src_wasm.md) | **
24432443
24442444
---
@@ -2451,7 +2451,7 @@ Creates a ProvingRequest from a string representation.
24512451
24522452
Parameters | Type | Description
24532453
--- | --- | ---
2454-
__request__ | `string` | **
2454+
__request__ | `Uint8Array` | *String representation of the ProvingRequest.*
24552455
__*return*__ | [ProvingRequest](sdk-src_wasm.md) | **
24562456
24572457
---
@@ -2472,11 +2472,11 @@ __*return*__ | `string` | **
24722472
24732473
![modifier: public](images/badges/modifier-public.svg) ![modifier: static](images/badges/modifier-static.svg)
24742474
2475-
Creates a ProvingRequest from a left-endian byte representation of the proving request.
2475+
Creates a ProvingRequest from a left-endian byte representation of the ProvingRequest.
24762476
24772477
Parameters | Type | Description
24782478
--- | --- | ---
2479-
__bytes__ | `Uint8Array` | **
2479+
__bytes__ | `Uint8Array` | *Left-endian bytes representing the proving request.*
24802480
__*return*__ | [ProvingRequest](sdk-src_wasm.md) | **
24812481
24822482
---
@@ -2497,7 +2497,7 @@ __*return*__ | `Uint8Array` | **
24972497
24982498
![modifier: public](images/badges/modifier-public.svg)
24992499
2500-
Get the main authorization for the request.
2500+
Get the Authorization of the main function in the ProvingRequest.
25012501
25022502
Parameters | Type | Description
25032503
--- | --- | ---
@@ -2509,7 +2509,7 @@ __*return*__ | [Authorization](sdk-src_wasm.md) | **
25092509
25102510
![modifier: public](images/badges/modifier-public.svg)
25112511
2512-
Get the fee authorization for the request.
2512+
Get the fee Authorization in the ProvingRequest.
25132513
25142514
Parameters | Type | Description
25152515
--- | --- | ---
@@ -2521,7 +2521,7 @@ __*return*__ | [Authorization](sdk-src_wasm.md) | **
25212521
25222522
![modifier: public](images/badges/modifier-public.svg)
25232523
2524-
Get the broadcast flag for the request.
2524+
Get the broadcast flag set in the ProvingRequest.
25252525
25262526
Parameters | Type | Description
25272527
--- | --- | ---

sdk/src/network-client.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,6 @@ class AleoNetworkClient {
120120
this.headers[headerName] = value;
121121
}
122122

123-
/**
124-
* Remove a header from the `AleoNetworkClient`s header map
125-
*
126-
* @param {string} headerName The name of the header to be removed
127-
*
128-
* @example
129-
* import { AleoNetworkClient } from "@provablehq/sdk/mainnet.js";
130-
*
131-
* // Create a networkClient
132-
* const networkClient = new AleoNetworkClient();
133-
*
134-
* // Remove the default `X-Aleo-SDK-Version` header
135-
* networkClient.removeHeader('X-Aleo-SDK-Version');
136-
*/
137123
removeHeader(headerName: string) {
138124
delete this.headers[headerName];
139125
}

sdk/src/program-manager.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -239,20 +239,6 @@ class ProgramManager {
239239
this.networkClient.headers[headerName] = value;
240240
}
241241

242-
/**
243-
* Remove a header from the `AleoNetworkClient`s header map
244-
*
245-
* @param {string} headerName The name of the header to be removed
246-
*
247-
* @example
248-
* import { ProgramManager } from "@provablehq/sdk/mainnet.js";
249-
*
250-
* // Create a ProgramManager
251-
* const programManager = new ProgramManager("https://api.explorer.provable.com/v1");
252-
*
253-
* // Remove the default `X-Aleo-SDK-Version` header
254-
* programManager.removeHeader('X-Aleo-SDK-Version');
255-
*/
256242
removeHeader(headerName: string) {
257243
delete this.networkClient.headers[headerName]
258244
}

wasm/src/synthesizer/authorization.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ pub struct Authorization(AuthorizationNative);
3737
#[wasm_bindgen]
3838
impl Authorization {
3939
/// Create a new authorization from a request object.
40+
///
41+
/// @param {ExecutionRequest} request The ExecutionRequest to build the authorization from.
4042
pub fn new(request: ExecutionRequest) -> Result<Authorization, JsValue> {
4143
Ok(Authorization(AuthorizationNative::new(RequestNative::from(request))))
4244
}
@@ -54,6 +56,8 @@ impl Authorization {
5456
}
5557

5658
/// Reconstructs an Authorization object from its string representation.
59+
///
60+
/// @param {String} authorization The string representation of the Authorization.
5761
#[wasm_bindgen(js_name = "fromString")]
5862
pub fn from_string(authorization: String) -> Result<Authorization, String> {
5963
Ok(Authorization(AuthorizationNative::from_str(&authorization).map_err(|e| e.to_string())?))
@@ -67,6 +71,8 @@ impl Authorization {
6771
}
6872

6973
/// Creates an authorization object from a left-endian byte representation of an Authorization.
74+
///
75+
/// @param {Uint8Array} bytes Left-endian bytes representing the Authorization.
7076
#[wasm_bindgen(js_name = "fromBytesLe")]
7177
pub fn from_bytes_le(bytes: Uint8Array) -> Result<Authorization, String> {
7278
let rust_bytes = bytes.to_vec();
@@ -75,6 +81,8 @@ impl Authorization {
7581
}
7682

7783
/// Check if an Authorization object is the same as another.
84+
///
85+
/// @param {Authorization} other The Authorization object to determine equality with.
7886
pub fn equals(&self, other: &Authorization) -> bool {
7987
self == other
8088
}
@@ -115,6 +123,8 @@ impl Authorization {
115123
#[wasm_bindgen]
116124
impl Authorization {
117125
/// Insert a transition into the Authorization.
126+
///
127+
/// @param {Transition} transition The transition object to insert into the Authorization.
118128
#[wasm_bindgen(js_name = insertTransition)]
119129
pub fn insert_transition(&self, transition: Transition) -> Result<(), String> {
120130
let transition = <TransitionNative as From<Transition>>::from(transition);

wasm/src/synthesizer/proving_request.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,18 @@ pub struct ProvingRequest(ProvingRequestNative);
3434

3535
#[wasm_bindgen]
3636
impl ProvingRequest {
37-
/// Creates a new ProvingRequest from a function authorization and an optional fee authorization.
37+
/// Creates a new ProvingRequest from a function Authorization and an optional fee Authorization.
38+
///
39+
/// @param {Authorization} authorization An Authorization for a function.
40+
/// @param {Authorization} fee_authorization The authorization for the `credits.aleo/fee_public` or `credits.aleo/fee_private` function that pays the fee for the execution of the main function.
41+
/// @param {boolean} broadcast Flag that indicates whether the remote proving service should attempt to submit the transaction on the caller's behalf.
3842
pub fn new(authorization: Authorization, fee_authorization: Option<Authorization>, broadcast: bool) -> Self {
3943
ProvingRequest(ProvingRequestNative::new(authorization, fee_authorization, broadcast))
4044
}
4145

4246
/// Creates a ProvingRequest from a string representation.
47+
///
48+
/// @param {Uint8Array} request String representation of the ProvingRequest.
4349
#[wasm_bindgen(js_name = "fromString")]
4450
pub fn from_string(request: String) -> Result<ProvingRequest, String> {
4551
Ok(ProvingRequest(ProvingRequestNative::from_str(&request).map_err(|e| e.to_string())?))
@@ -52,7 +58,9 @@ impl ProvingRequest {
5258
self.0.to_string()
5359
}
5460

55-
/// Creates a ProvingRequest from a left-endian byte representation of the proving request.
61+
/// Creates a ProvingRequest from a left-endian byte representation of the ProvingRequest.
62+
///
63+
/// @param {Uint8Array} bytes Left-endian bytes representing the proving request.
5664
#[wasm_bindgen(js_name = "fromBytesLe")]
5765
pub fn from_bytes_le(bytes: Uint8Array) -> Result<ProvingRequest, String> {
5866
let rust_bytes = bytes.to_vec();
@@ -67,18 +75,18 @@ impl ProvingRequest {
6775
Ok(Uint8Array::from(bytes.as_slice()))
6876
}
6977

70-
/// Get the main authorization for the request.
78+
/// Get the Authorization of the main function in the ProvingRequest.
7179
pub fn authorization(&self) -> Authorization {
7280
Authorization::from(self.0.authorization())
7381
}
7482

75-
/// Get the fee authorization for the request.
83+
/// Get the fee Authorization in the ProvingRequest.
7684
#[wasm_bindgen(js_name = "feeAuthorization")]
7785
pub fn fee_authorization(&self) -> Option<Authorization> {
7886
self.0.fee_authorization().map(Authorization::from)
7987
}
8088

81-
/// Get the broadcast flag for the request.
89+
/// Get the broadcast flag set in the ProvingRequest.
8290
pub fn broadcast(&self) -> bool {
8391
self.0.broadcast()
8492
}

0 commit comments

Comments
 (0)