Skip to content

Commit bcdda30

Browse files
thephezclaude
andauthored
refactor(sdk): wasm-sdk doc generation refactor (#2726)
Co-authored-by: Claude <noreply@anthropic.com>
1 parent ab80785 commit bcdda30

14 files changed

+2259
-3971
lines changed

packages/wasm-sdk/AI_REFERENCE.md

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ Parameters:
5858
- Example: `0,1,2`
5959
- `searchPurposeMap` (text, optional) - Search Purpose Map JSON (required for 'search' type)
6060
- Example: `{"0": {"0": "current"}, "1": {"0": "all"}}`
61+
- `limit` (number, optional) - Limit
62+
- `offset` (number, optional) - Offset
6163

6264
Example:
6365
```javascript
@@ -71,7 +73,8 @@ Parameters:
7173
- `identitiesIds` (array, required) - Identity IDs
7274
- `contractId` (text, required) - Contract ID
7375
- `documentTypeName` (text, optional) - Document Type (optional)
74-
- `keyRequestType` (select, optional) - Key Request Type
76+
- `purposes` (multiselect, optional) - Key Purposes
77+
- Options: `0` (Authentication), `1` (Encryption), `2` (Decryption), `3` (Transfer), `5` (Voting)
7578

7679
Example:
7780
```javascript
@@ -116,7 +119,7 @@ const balance = await sdk.getIdentityBalance(identityId);
116119
*Get balances for multiple identities*
117120

118121
Parameters:
119-
- `identityIds` (array, required) - Identity IDs
122+
- `ids` (array, required) - Identity IDs
120123

121124
Example:
122125
```javascript
@@ -152,6 +155,7 @@ const result = await sdk.getIdentityByPublicKeyHash("publicKeyHash");
152155
Parameters:
153156
- `publicKeyHash` (text, required) - Public Key Hash
154157
- Example: `518038dc858461bcee90478fd994bba8057b7531`
158+
- `startAfter` (text, optional) - Start After
155159

156160
Example:
157161
```javascript
@@ -190,6 +194,8 @@ Parameters:
190194
- `identityId` (text, required) - Identity ID
191195
- `tokenIds` (array, optional) - Token IDs (optional)
192196
- Example: `["Hqyu8WcRwXCTwbNxdga4CN5gsVEGc67wng4TFzceyLUv"]`
197+
- `limit` (number, optional) - Limit
198+
- `offset` (number, optional) - Offset
193199

194200
Example:
195201
```javascript
@@ -231,6 +237,7 @@ Parameters:
231237
- Example: `HLY575cNazmc5824FxqaEMEBuzFeE4a98GDRNKbyJqCM`
232238
- `limit` (number, optional) - Limit
233239
- `offset` (number, optional) - Offset
240+
- `startAtMs` (number, optional) - Start At Timestamp (ms)
234241

235242
Example:
236243
```javascript
@@ -327,6 +334,20 @@ Example:
327334
const result = await sdk.dpnsResolve("name");
328335
```
329336

337+
**DPNS Search Name** - `dpnsSearch`
338+
*Search for DPNS names that start with a given prefix*
339+
340+
Parameters:
341+
- `prefix` (text, required) - Name Prefix
342+
- Example: `Enter prefix (e.g., ali)`
343+
- `limit` (number, optional) - Limit
344+
- Example: `Default: 10`
345+
346+
Example:
347+
```javascript
348+
const result = await sdk.dpnsSearch("prefix");
349+
```
350+
330351
#### Voting & Contested Resources
331352

332353
**Get Contested Resources** - `getContestedResources`
@@ -372,19 +393,20 @@ const result = await sdk.getContestedResourceVoteState("dataContractId", "docume
372393
*Get voters who voted for a specific identity in a contested resource*
373394

374395
Parameters:
375-
- `contractId` (text, required) - Contract ID
396+
- `dataContractId` (text, required) - Contract ID
376397
- `documentTypeName` (text, required) - Document Type
377398
- `indexName` (text, required) - Index Name
378399
- `indexValues` (array, required) - Index Values
379400
- Example: `["dash", "alice"]`
380401
- `contestantId` (text, required) - Contestant Identity ID
381-
- `startAtVoterInfo` (text, optional) - Start At Voter Info
382-
- `limit` (number, optional) - Limit
402+
- `startAtIdentifierInfo` (text, optional) - Start At Identifier Info
403+
- `count` (number, optional) - Count
404+
- Example: `Default: 100`
383405
- `orderAscending` (checkbox, optional) - Order Ascending
384406

385407
Example:
386408
```javascript
387-
const result = await sdk.getContestedResourceVotersForIdentity("contractId", "documentTypeName", "indexName", [], "contestantId");
409+
const result = await sdk.getContestedResourceVotersForIdentity("dataContractId", "documentTypeName", "indexName", [], "contestantId");
388410
```
389411

390412
**Get Contested Resource Identity Votes** - `getContestedResourceIdentityVotes`
@@ -393,7 +415,7 @@ const result = await sdk.getContestedResourceVotersForIdentity("contractId", "do
393415
Parameters:
394416
- `identityId` (text, required) - Identity ID
395417
- `limit` (number, optional) - Limit
396-
- `startAtVotePollIdInfo` (text, optional) - Start At Vote Poll ID Info
418+
- `offset` (number, optional) - Offset
397419
- `orderAscending` (checkbox, optional) - Order Ascending
398420

399421
Example:
@@ -405,11 +427,12 @@ const result = await sdk.getContestedResourceIdentityVotes("identityId");
405427
*Get vote polls within a time range*
406428

407429
Parameters:
408-
- `startTimeInfo` (text, optional) - Start Time Info
409-
- Example: `Timestamp in milliseconds as string`
410-
- `endTimeInfo` (text, optional) - End Time Info
411-
- Example: `Timestamp in milliseconds as string`
430+
- `startTimeMs` (number, optional) - Start Time (ms)
431+
- Example: `Timestamp in milliseconds as string (e.g., 1650000000000)`
432+
- `endTimeMs` (number, optional) - End Time (ms)
433+
- Example: `Timestamp in milliseconds as string (e.g., 1650086400000)`
412434
- `limit` (number, optional) - Limit
435+
- `offset` (number, optional) - Offset
413436
- `orderAscending` (checkbox, optional) - Order Ascending
414437

415438
Example:
@@ -448,7 +471,7 @@ const result = await sdk.getProtocolVersionUpgradeVoteStatus("startProTxHash", 1
448471
*Get information about epochs*
449472

450473
Parameters:
451-
- `epoch` (number, required) - Start Epoch
474+
- `startEpoch` (number, required) - Start Epoch
452475
- `count` (number, required) - Count
453476
- `ascending` (checkbox, optional) - Ascending Order
454477

@@ -473,6 +496,7 @@ const result = await sdk.getCurrentEpoch();
473496
Parameters:
474497
- `startEpoch` (number, required) - Start Epoch
475498
- `count` (number, required) - Count
499+
- `ascending` (checkbox, optional) - Ascending Order
476500

477501
Example:
478502
```javascript
@@ -496,13 +520,15 @@ const result = await sdk.getEvonodesProposedEpochBlocksByIds(100, []);
496520
*Get proposed blocks by range*
497521

498522
Parameters:
499-
- `startProTxHash` (text, required) - Start ProTx Hash
523+
- `epoch` (number, required) - Epoch
524+
- `limit` (number, optional) - Limit
525+
- `startAfter` (text, optional) - Start After (Evonode ID)
500526
- Example: `143dcd6a6b7684fde01e88a10e5d65de9a29244c5ecd586d14a342657025f113`
501-
- `count` (number, required) - Count
527+
- `orderAscending` (checkbox, optional) - Order Ascending
502528

503529
Example:
504530
```javascript
505-
const result = await sdk.getEvonodesProposedEpochBlocksByRange("startProTxHash", 100);
531+
const result = await sdk.getEvonodesProposedEpochBlocksByRange(100);
506532
```
507533

508534
#### Token Queries

0 commit comments

Comments
 (0)