Skip to content

Commit f4ea95b

Browse files
Documentation updates & fixes
1 parent fb021b0 commit f4ea95b

File tree

8 files changed

+147
-84
lines changed

8 files changed

+147
-84
lines changed

docs/api_reference/sdk-src_program-manager.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ __*return*__ | `string` | *The transaction id of the deployed program or a failu
202202
/// Import the mainnet version of the sdk.
203203
import { AleoKeyProvider, ProgramManager, NetworkRecordProvider } from "@provablehq/sdk/mainnet.js";
204204

205-
// Create a new NetworkClient, KeyProvider, and RecordProvider
205+
// Create a new NetworkClient, KeyProvider, and RecordProvider.
206206
const keyProvider = new AleoKeyProvider();
207207
const recordProvider = new NetworkRecordProvider(account, networkClient);
208208
keyProvider.useCache = true;
@@ -243,7 +243,7 @@ __*return*__ | `Promise.<Transaction>` | *- A promise that resolves to the trans
243243
/// Import the mainnet version of the sdk.
244244
import { AleoKeyProvider, ProgramManager, NetworkRecordProvider } from "@provablehq/sdk/mainnet.js";
245245

246-
// Create a new NetworkClient, KeyProvider, and RecordProvider using official Aleo record, key, and network providers
246+
// Create a new NetworkClient, KeyProvider, and RecordProvider.
247247
const keyProvider = new AleoKeyProvider();
248248
const recordProvider = new NetworkRecordProvider(account, networkClient);
249249
keyProvider.useCache = true;
@@ -290,12 +290,12 @@ __*return*__ | `Promise.<ProvingRequest>` | *- A promise that resolves to the tr
290290
/// Import the mainnet version of the sdk.
291291
import { AleoKeyProvider, ProgramManager, NetworkRecordProvider } from "@provablehq/sdk/mainnet.js";
292292

293-
// Create a new NetworkClient, KeyProvider, and RecordProvider using official Aleo record, key, and network providers
293+
// Create a new NetworkClient, KeyProvider, and RecordProvider.
294294
const keyProvider = new AleoKeyProvider();
295295
const recordProvider = new NetworkRecordProvider(account, networkClient);
296296
keyProvider.useCache = true;
297297

298-
// Initialize a program manager with the key provider to automatically fetch keys for executions
298+
// Initialize a ProgramManager with the key and record providers.
299299
const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, recordProvider);
300300

301301
// Build the proving request.
@@ -312,10 +312,11 @@ const provingRequest = await programManager.provingRequest({
312312
broadcast: true,
313313
});
314314

315-
// Submit the transaction to the network and await the response.
315+
// Submit the ProvingRequest to the network and await the response.
316316
const provingResponse = await programManager.networkClient.submitProvingRequest(provingRequest);
317317
// Get the transaction from the proving response.
318318
const tx = provingResponse.transaction;
319+
// Check if the proving service has already submitted the transaction.
319320
const submitted = provingResponse.broadcast;
320321

321322
// Get the transaction id.
@@ -352,12 +353,12 @@ __*return*__ | `Promise.<Authorization>` | *- A promise that resolves to an &#x6
352353
/// Import the mainnet version of the sdk.
353354
import { AleoKeyProvider, ProgramManager, NetworkRecordProvider } from "@provablehq/sdk/mainnet.js";
354355

355-
// Create a new NetworkClient, KeyProvider, and RecordProvider using official Aleo record, key, and network providers
356+
// Create a new NetworkClient, KeyProvider, and RecordProvider.
356357
const keyProvider = new AleoKeyProvider();
357358
const recordProvider = new NetworkRecordProvider(account, networkClient);
358359
keyProvider.useCache = true;
359360

360-
// Initialize a program manager with the key provider to automatically fetch keys for executions
361+
// Initialize a ProgramManager with the key and record providers.
361362
const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, recordProvider);
362363

363364
// Build the `Authorization`.
@@ -390,12 +391,12 @@ __*return*__ | `Promise.<Authorization>` | *- A promise that resolves to an &#x6
390391
/// Import the mainnet version of the sdk.
391392
import { AleoKeyProvider, ProgramManager, NetworkRecordProvider } from "@provablehq/sdk/mainnet.js";
392393

393-
// Create a new NetworkClient, KeyProvider, and RecordProvider using official Aleo record, key, and network providers
394+
// Create a new NetworkClient, KeyProvider, and RecordProvider.
394395
const keyProvider = new AleoKeyProvider();
395396
const recordProvider = new NetworkRecordProvider(account, networkClient);
396397
keyProvider.useCache = true;
397398

398-
// Initialize a program manager with the key provider to automatically fetch keys for executions
399+
// Initialize a ProgramManager with the key and record providers.
399400
const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, recordProvider);
400401

401402
// Build a credits.aleo/fee_public `Authorization`.
@@ -1450,7 +1451,7 @@ __*return*__ | `string` | *The transaction id of the deployed program or a failu
14501451
/// Import the mainnet version of the sdk.
14511452
import { AleoKeyProvider, ProgramManager, NetworkRecordProvider } from "@provablehq/sdk/mainnet.js";
14521453

1453-
// Create a new NetworkClient, KeyProvider, and RecordProvider
1454+
// Create a new NetworkClient, KeyProvider, and RecordProvider.
14541455
const keyProvider = new AleoKeyProvider();
14551456
const recordProvider = new NetworkRecordProvider(account, networkClient);
14561457
keyProvider.useCache = true;
@@ -1491,7 +1492,7 @@ __*return*__ | `Promise.<Transaction>` | *- A promise that resolves to the trans
14911492
/// Import the mainnet version of the sdk.
14921493
import { AleoKeyProvider, ProgramManager, NetworkRecordProvider } from "@provablehq/sdk/mainnet.js";
14931494

1494-
// Create a new NetworkClient, KeyProvider, and RecordProvider using official Aleo record, key, and network providers
1495+
// Create a new NetworkClient, KeyProvider, and RecordProvider.
14951496
const keyProvider = new AleoKeyProvider();
14961497
const recordProvider = new NetworkRecordProvider(account, networkClient);
14971498
keyProvider.useCache = true;
@@ -1538,12 +1539,12 @@ __*return*__ | `Promise.<ProvingRequest>` | *- A promise that resolves to the tr
15381539
/// Import the mainnet version of the sdk.
15391540
import { AleoKeyProvider, ProgramManager, NetworkRecordProvider } from "@provablehq/sdk/mainnet.js";
15401541

1541-
// Create a new NetworkClient, KeyProvider, and RecordProvider using official Aleo record, key, and network providers
1542+
// Create a new NetworkClient, KeyProvider, and RecordProvider.
15421543
const keyProvider = new AleoKeyProvider();
15431544
const recordProvider = new NetworkRecordProvider(account, networkClient);
15441545
keyProvider.useCache = true;
15451546

1546-
// Initialize a program manager with the key provider to automatically fetch keys for executions
1547+
// Initialize a ProgramManager with the key and record providers.
15471548
const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, recordProvider);
15481549

15491550
// Build the proving request.
@@ -1560,10 +1561,11 @@ const provingRequest = await programManager.provingRequest({
15601561
broadcast: true,
15611562
});
15621563

1563-
// Submit the transaction to the network and await the response.
1564+
// Submit the ProvingRequest to the network and await the response.
15641565
const provingResponse = await programManager.networkClient.submitProvingRequest(provingRequest);
15651566
// Get the transaction from the proving response.
15661567
const tx = provingResponse.transaction;
1568+
// Check if the proving service has already submitted the transaction.
15671569
const submitted = provingResponse.broadcast;
15681570

15691571
// Get the transaction id.
@@ -1600,12 +1602,12 @@ __*return*__ | `Promise.<Authorization>` | *- A promise that resolves to an &#x6
16001602
/// Import the mainnet version of the sdk.
16011603
import { AleoKeyProvider, ProgramManager, NetworkRecordProvider } from "@provablehq/sdk/mainnet.js";
16021604

1603-
// Create a new NetworkClient, KeyProvider, and RecordProvider using official Aleo record, key, and network providers
1605+
// Create a new NetworkClient, KeyProvider, and RecordProvider.
16041606
const keyProvider = new AleoKeyProvider();
16051607
const recordProvider = new NetworkRecordProvider(account, networkClient);
16061608
keyProvider.useCache = true;
16071609

1608-
// Initialize a program manager with the key provider to automatically fetch keys for executions
1610+
// Initialize a ProgramManager with the key and record providers.
16091611
const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, recordProvider);
16101612

16111613
// Build the `Authorization`.
@@ -1638,12 +1640,12 @@ __*return*__ | `Promise.<Authorization>` | *- A promise that resolves to an &#x6
16381640
/// Import the mainnet version of the sdk.
16391641
import { AleoKeyProvider, ProgramManager, NetworkRecordProvider } from "@provablehq/sdk/mainnet.js";
16401642

1641-
// Create a new NetworkClient, KeyProvider, and RecordProvider using official Aleo record, key, and network providers
1643+
// Create a new NetworkClient, KeyProvider, and RecordProvider.
16421644
const keyProvider = new AleoKeyProvider();
16431645
const recordProvider = new NetworkRecordProvider(account, networkClient);
16441646
keyProvider.useCache = true;
16451647

1646-
// Initialize a program manager with the key provider to automatically fetch keys for executions
1648+
// Initialize a ProgramManager with the key and record providers.
16471649
const programManager = new ProgramManager("https://api.explorer.provable.com/v1", keyProvider, recordProvider);
16481650

16491651
// Build a credits.aleo/fee_public `Authorization`.

docs/api_reference/sdk-src_wasm.md

Lines changed: 57 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ Authorization object containing the authorization for a transaction.
212212

213213
![modifier: public](images/badges/modifier-public.svg) ![modifier: static](images/badges/modifier-static.svg)
214214

215-
Create transition.
215+
Create a new authorization from a request object.
216216

217217
Parameters | Type | Description
218218
--- | --- | ---
@@ -225,19 +225,44 @@ __*return*__ | [Authorization](sdk-src_wasm.md) | **
225225

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

228-
Returns a new and independent replica of the authorization.
228+
Returns a new and independent replica of the Authorization.
229229

230230
Parameters | Type | Description
231231
--- | --- | ---
232232
__*return*__ | [Authorization](sdk-src_wasm.md) | **
233233

234234
---
235235

236+
### `toString() ► string`
237+
238+
![modifier: public](images/badges/modifier-public.svg)
239+
240+
Returns the string representation of the Authorization.
241+
242+
Parameters | Type | Description
243+
--- | --- | ---
244+
__*return*__ | `string` | **
245+
246+
---
247+
248+
### `fromString(authorization) ► Authorization`
249+
250+
![modifier: public](images/badges/modifier-public.svg) ![modifier: static](images/badges/modifier-static.svg)
251+
252+
Reconstructs an Authorization object from its string representation.
253+
254+
Parameters | Type | Description
255+
--- | --- | ---
256+
__authorization__ | `string` | **
257+
__*return*__ | [Authorization](sdk-src_wasm.md) | **
258+
259+
---
260+
236261
### `toBytesLe() ► Uint8Array`
237262

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

240-
Returns the bytes representation of the authorization.
265+
Returns the left-endian byte representation of the Authorization.
241266

242267
Parameters | Type | Description
243268
--- | --- | ---
@@ -249,7 +274,7 @@ __*return*__ | `Uint8Array` | **
249274

250275
![modifier: public](images/badges/modifier-public.svg) ![modifier: static](images/badges/modifier-static.svg)
251276

252-
Creates an authorization object from a bytes representation of an authorization.
277+
Creates an authorization object from a left-endian byte representation of an Authorization.
253278

254279
Parameters | Type | Description
255280
--- | --- | ---
@@ -262,7 +287,7 @@ __*return*__ | [Authorization](sdk-src_wasm.md) | **
262287

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

265-
Check if an authorization is the same as another.
290+
Check if an Authorization object is the same as another.
266291

267292
Parameters | Type | Description
268293
--- | --- | ---
@@ -275,7 +300,7 @@ __*return*__ | `boolean` | **
275300

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

278-
Returns the number of &#x60;Request&#x60;s in the authorization.
303+
Returns the number of &#x60;Request&#x60;s in the Authorization.
279304

280305
Parameters | Type | Description
281306
--- | --- | ---
@@ -287,7 +312,7 @@ __*return*__ | `number` | **
287312

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

290-
Return &#x60;true&#x60; if the authorization is empty.
315+
Return &#x60;true&#x60; if the Authorization is empty.
291316

292317
Parameters | Type | Description
293318
--- | --- | ---
@@ -299,7 +324,7 @@ __*return*__ | `boolean` | **
299324

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

302-
Returns &#x60;true&#x60; if the authorization is for call to &#x60;credits.aleo/fee_private&#x60;.
327+
Returns &#x60;true&#x60; if the Authorization is for &#x60;credits.aleo/fee_private&#x60;.
303328

304329
Parameters | Type | Description
305330
--- | --- | ---
@@ -311,7 +336,7 @@ __*return*__ | `boolean` | **
311336

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

314-
Returns &#x60;true&#x60; if the authorization is for call to &#x60;credits.aleo/fee_public&#x60;.
339+
Returns &#x60;true&#x60; if the Authorization is for &#x60;credits.aleo/fee_public&#x60;.
315340

316341
Parameters | Type | Description
317342
--- | --- | ---
@@ -323,19 +348,32 @@ __*return*__ | `boolean` | **
323348

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

326-
Returns &#x60;true&#x60; if the authorization is for call to &#x60;credits.aleo/split&#x60;.
351+
Returns &#x60;true&#x60; if the Authorization is for &#x60;credits.aleo/split&#x60;.
327352

328353
Parameters | Type | Description
329354
--- | --- | ---
330355
__*return*__ | `boolean` | **
331356

332357
---
333358

359+
### `insertTransition(transition) ► void`
360+
361+
![modifier: public](images/badges/modifier-public.svg)
362+
363+
Insert a transition into the Authorization.
364+
365+
Parameters | Type | Description
366+
--- | --- | ---
367+
__transition__ | `Transition` | **
368+
__*return*__ | `void` | **
369+
370+
---
371+
334372
### `transitions() ► Array.<Transition>`
335373

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

338-
Get the transitions in an authorization.
376+
Get the transitions in an Authorization.
339377

340378
Parameters | Type | Description
341379
--- | --- | ---
@@ -347,11 +385,11 @@ __*return*__ | `Array.<Transition>` | *Array of transition objects*
347385

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

350-
Returns the execution ID for the authorization.
388+
Returns the execution ID for the Authorization.
351389

352390
Parameters | Type | Description
353391
--- | --- | ---
354-
__*return*__ | [Field](sdk-src_wasm.md) | *The execution ID for the authorization, call toString() after this result to get the string representation.*
392+
__*return*__ | [Field](sdk-src_wasm.md) | *The execution ID for the Authorization, call toString() after this result to get the string representation.*
355393

356394
---
357395

@@ -2394,7 +2432,7 @@ Represents a proving request to a delegated proving service.
23942432
23952433
![modifier: public](images/badges/modifier-public.svg) ![modifier: static](images/badges/modifier-static.svg)
23962434
2397-
Creates a new proving request from an authorization and fee authorization.
2435+
Creates a new ProvingRequest from a function authorization and an optional fee authorization.
23982436
23992437
Parameters | Type | Description
24002438
--- | --- | ---
@@ -2409,7 +2447,7 @@ __*return*__ | [ProvingRequest](sdk-src_wasm.md) | **
24092447
24102448
![modifier: public](images/badges/modifier-public.svg) ![modifier: static](images/badges/modifier-static.svg)
24112449
2412-
Creates a proving request from a string representation.
2450+
Creates a ProvingRequest from a string representation.
24132451
24142452
Parameters | Type | Description
24152453
--- | --- | ---
@@ -2422,7 +2460,7 @@ __*return*__ | [ProvingRequest](sdk-src_wasm.md) | **
24222460
24232461
![modifier: public](images/badges/modifier-public.svg)
24242462
2425-
Creates a string representation of the proving request.
2463+
Creates a string representation of the ProvingRequest.
24262464
24272465
Parameters | Type | Description
24282466
--- | --- | ---
@@ -2434,7 +2472,7 @@ __*return*__ | `string` | **
24342472
24352473
![modifier: public](images/badges/modifier-public.svg) ![modifier: static](images/badges/modifier-static.svg)
24362474
2437-
Creates a proving request from a bytes representation.
2475+
Creates a ProvingRequest from a left-endian byte representation of the proving request.
24382476
24392477
Parameters | Type | Description
24402478
--- | --- | ---
@@ -2447,7 +2485,7 @@ __*return*__ | [ProvingRequest](sdk-src_wasm.md) | **
24472485
24482486
![modifier: public](images/badges/modifier-public.svg)
24492487
2450-
Creates a byte representation of the proving request.
2488+
Creates a left-endian byte representation of the ProvingRequest.
24512489
24522490
Parameters | Type | Description
24532491
--- | --- | ---
@@ -2495,7 +2533,7 @@ __*return*__ | `boolean` | **
24952533
24962534
![modifier: public](images/badges/modifier-public.svg)
24972535
2498-
Check if an authorization is the same as another.
2536+
Check if a ProvingRequest is the same as another ProvingRequest.
24992537
25002538
Parameters | Type | Description
25012539
--- | --- | ---

0 commit comments

Comments
 (0)