Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 41 additions & 15 deletions packages/wasm-sdk/AI_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ Parameters:
- Example: `0,1,2`
- `searchPurposeMap` (text, optional) - Search Purpose Map JSON (required for 'search' type)
- Example: `{"0": {"0": "current"}, "1": {"0": "all"}}`
- `limit` (number, optional) - Limit
- `offset` (number, optional) - Offset

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

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

Parameters:
- `identityIds` (array, required) - Identity IDs
- `ids` (array, required) - Identity IDs

Example:
```javascript
Expand Down Expand Up @@ -152,6 +155,7 @@ const result = await sdk.getIdentityByPublicKeyHash("publicKeyHash");
Parameters:
- `publicKeyHash` (text, required) - Public Key Hash
- Example: `518038dc858461bcee90478fd994bba8057b7531`
- `startAfter` (text, optional) - Start After

Example:
```javascript
Expand Down Expand Up @@ -190,6 +194,8 @@ Parameters:
- `identityId` (text, required) - Identity ID
- `tokenIds` (array, optional) - Token IDs (optional)
- Example: `["Hqyu8WcRwXCTwbNxdga4CN5gsVEGc67wng4TFzceyLUv"]`
- `limit` (number, optional) - Limit
- `offset` (number, optional) - Offset

Example:
```javascript
Expand Down Expand Up @@ -231,6 +237,7 @@ Parameters:
- Example: `HLY575cNazmc5824FxqaEMEBuzFeE4a98GDRNKbyJqCM`
- `limit` (number, optional) - Limit
- `offset` (number, optional) - Offset
- `startAtMs` (number, optional) - Start At Timestamp (ms)

Example:
```javascript
Expand Down Expand Up @@ -327,6 +334,20 @@ Example:
const result = await sdk.dpnsResolve("name");
```

**DPNS Search Name** - `dpnsSearch`
*Search for DPNS names that start with a given prefix*

Parameters:
- `prefix` (text, required) - Name Prefix
- Example: `Enter prefix (e.g., ali)`
- `limit` (number, optional) - Limit
- Example: `Default: 10`

Example:
```javascript
const result = await sdk.dpnsSearch("prefix");
```

#### Voting & Contested Resources

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

Parameters:
- `contractId` (text, required) - Contract ID
- `dataContractId` (text, required) - Contract ID
- `documentTypeName` (text, required) - Document Type
- `indexName` (text, required) - Index Name
- `indexValues` (array, required) - Index Values
- Example: `["dash", "alice"]`
- `contestantId` (text, required) - Contestant Identity ID
- `startAtVoterInfo` (text, optional) - Start At Voter Info
- `limit` (number, optional) - Limit
- `startAtIdentifierInfo` (text, optional) - Start At Identifier Info
- `count` (number, optional) - Count
- Example: `Default: 100`
- `orderAscending` (checkbox, optional) - Order Ascending

Example:
```javascript
const result = await sdk.getContestedResourceVotersForIdentity("contractId", "documentTypeName", "indexName", [], "contestantId");
const result = await sdk.getContestedResourceVotersForIdentity("dataContractId", "documentTypeName", "indexName", [], "contestantId");
```

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

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

Parameters:
- `startTimeInfo` (text, optional) - Start Time Info
- Example: `Timestamp in milliseconds as string`
- `endTimeInfo` (text, optional) - End Time Info
- Example: `Timestamp in milliseconds as string`
- `startTimeMs` (number, optional) - Start Time (ms)
- Example: `Timestamp in milliseconds as string (e.g., 1650000000000)`
- `endTimeMs` (number, optional) - End Time (ms)
- Example: `Timestamp in milliseconds as string (e.g., 1650086400000)`
- `limit` (number, optional) - Limit
- `offset` (number, optional) - Offset
- `orderAscending` (checkbox, optional) - Order Ascending

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

Parameters:
- `epoch` (number, required) - Start Epoch
- `startEpoch` (number, required) - Start Epoch
- `count` (number, required) - Count
- `ascending` (checkbox, optional) - Ascending Order

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

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

Parameters:
- `startProTxHash` (text, required) - Start ProTx Hash
- `epoch` (number, required) - Epoch
- `limit` (number, optional) - Limit
- `startAfter` (text, optional) - Start After (Evonode ID)
- Example: `143dcd6a6b7684fde01e88a10e5d65de9a29244c5ecd586d14a342657025f113`
- `count` (number, required) - Count
- `orderAscending` (checkbox, optional) - Order Ascending

Example:
```javascript
const result = await sdk.getEvonodesProposedEpochBlocksByRange("startProTxHash", 100);
const result = await sdk.getEvonodesProposedEpochBlocksByRange(100);
```

#### Token Queries
Expand Down
Loading
Loading