From 57795188d8a74cc8ba19a15b25fe11771de707bc Mon Sep 17 00:00:00 2001 From: thephez Date: Tue, 29 Jul 2025 13:11:20 -0400 Subject: [PATCH] docs(sdk): updates missing from 2711 The following output files are updated when running generate_docs.py after #2711 was merged --- packages/wasm-sdk/AI_REFERENCE.md | 56 +++++++---------------- packages/wasm-sdk/docs.html | 74 +++++++++---------------------- 2 files changed, 37 insertions(+), 93 deletions(-) diff --git a/packages/wasm-sdk/AI_REFERENCE.md b/packages/wasm-sdk/AI_REFERENCE.md index 93392ab5d6c..190a029d637 100644 --- a/packages/wasm-sdk/AI_REFERENCE.md +++ b/packages/wasm-sdk/AI_REFERENCE.md @@ -731,55 +731,29 @@ const result = await sdk.{transition_name}(identityHex, ...params, privateKeyHex **Identity Create** - `identityCreate` *Create a new identity with initial credits* -Parameters: -- `assetLockProof` (string, required) - Asset lock proof (hex-encoded JSON) -- `assetLockProofPrivateKey` (string, required) - Private key for the asset lock proof (WIF format) -- `publicKeys` (string, required) - JSON array of public keys to add to the identity - -Example: -```javascript -// Asset lock proof is a hex-encoded JSON object -const assetLockProof = "a9147d3b... (hex-encoded)"; -const assetLockProofPrivateKey = "XFfpaSbZq52HPy3WWwe1dXsZMiU1bQn8vQd34HNXkSZThevBWRn1"; // WIF format - -// Public keys array with proper key types -const publicKeys = JSON.stringify([ - { - id: 0, - type: 0, // ECDSA_SECP256K1 = 0, BLS12_381 = 1, ECDSA_HASH160 = 2 - purpose: 0, // AUTHENTICATION = 0, ENCRYPTION = 1, DECRYPTION = 2, TRANSFER = 3, etc. - securityLevel: 0, // MASTER = 0, CRITICAL = 1, HIGH = 2, MEDIUM = 3 - data: "A5GzYHPIolbHkFrp5l+s9IvF2lWMuuuSu3oWZB8vWHNJ", // Base64-encoded public key - readOnly: false - }, - { - id: 1, - type: 0, - purpose: 0, - securityLevel: 2, - data: "AnotherBase64EncodedPublicKeyHere", // Base64-encoded public key - readOnly: false - } -]); +Parameters (in addition to identity/key): +- `seedPhrase` (textarea, required) - Seed Phrase + - Example: `Enter seed phrase (12-24 words) or click Generate` +- `generateSeedButton` (button, optional) - Generate New Seed +- `identityIndex` (number, required) - Identity Index +- `keySelectionMode` (select, required) - Key Selection Mode +- `keyPreview` (keyPreview, optional) - Keys to be added -const result = await sdk.identityCreate(assetLockProof, assetLockProofPrivateKey, publicKeys); +Example: +```javascript +const result = await sdk.identityCreate(identityHex, /* params */, privateKeyHex); ``` **Identity Top Up** - `identityTopUp` *Add credits to an existing identity* -Parameters: -- `identityId` (string, required) - The identity ID to top up (base58 format) -- `assetLockProof` (string, required) - Asset lock proof (hex-encoded JSON) -- `assetLockProofPrivateKey` (string, required) - Private key for the asset lock proof (WIF format) +Parameters (in addition to identity/key): +- `identityId` (text, required) - Identity ID + - Example: `Enter the identity ID to top up (base58)` Example: ```javascript -const identityId = "5DbLwAxGBzUzo81VewMUwn4b5P4bpv9FNFybi25XB5Bk"; // base58 -const assetLockProof = "a9147d3b... (hex-encoded)"; -const assetLockProofPrivateKey = "XFfpaSbZq52HPy3WWwe1dXsZMiU1bQn8vQd34HNXkSZThevBWRn1"; // WIF format - -const result = await sdk.identityTopUp(identityId, assetLockProof, assetLockProofPrivateKey); +const result = await sdk.identityTopUp(identityHex, /* params */, privateKeyHex); ``` **Identity Update** - `identityUpdate` @@ -787,7 +761,7 @@ const result = await sdk.identityTopUp(identityId, assetLockProof, assetLockProo Parameters (in addition to identity/key): - `addPublicKeys` (textarea, optional) - Keys to Add (JSON array) - - Example: `[{"type":0,"purpose":0,"securityLevel":2,"data":"base64_encoded_public_key","readOnly":false}]` + - Example: `[{"keyType":"ECDSA_HASH160","purpose":"AUTHENTICATION","data":"base64_key_data"}]` - `disablePublicKeys` (text, optional) - Key IDs to Disable (comma-separated) - Example: `2,3,5` diff --git a/packages/wasm-sdk/docs.html b/packages/wasm-sdk/docs.html index d81d76f3b4b..3e13bf5df41 100644 --- a/packages/wasm-sdk/docs.html +++ b/packages/wasm-sdk/docs.html @@ -2335,52 +2335,37 @@

Identity Create

Parameters:
- Asset Lock Proof - string + Seed Phrase + textarea (required) -
Hex-encoded JSON asset lock proof +
Example: Enter seed phrase (12-24 words) or click Generate +
+
+ Generate New Seed + button + (optional)
- Asset Lock Proof Private Key - string + Identity Index + number (required) -
WIF format private key
- Public Keys - string + Key Selection Mode + select (required) -
JSON array of public keys +
Options: Default (Recommended), Advanced +
+
+ Keys to be added + keyPreview + (optional)
Example
-
// Asset lock proof is a hex-encoded JSON object -const assetLockProof = "a9147d3b... (hex-encoded)"; -const assetLockProofPrivateKey = "XFfpaSbZq52HPy3WWwe1dXsZMiU1bQn8vQd34HNXkSZThevBWRn1"; // WIF format - -// Public keys array with proper key types -const publicKeys = JSON.stringify([ - { - id: 0, - type: 0, // ECDSA_SECP256K1 = 0, BLS12_381 = 1, ECDSA_HASH160 = 2 - purpose: 0, // AUTHENTICATION = 0, ENCRYPTION = 1, DECRYPTION = 2, TRANSFER = 3, etc. - securityLevel: 0, // MASTER = 0, CRITICAL = 1, HIGH = 2, MEDIUM = 3 - data: "A5GzYHPIolbHkFrp5l+s9IvF2lWMuuuSu3oWZB8vWHNJ", // Base64-encoded public key - readOnly: false - }, - { - id: 1, - type: 0, - purpose: 0, - securityLevel: 2, - data: "AnotherBase64EncodedPublicKeyHere", // Base64-encoded public key - readOnly: false - } -]); - -const result = await sdk.identityCreate(assetLockProof, assetLockProofPrivateKey, publicKeys);
+
const result = await sdk.identityCreate(identityHex, /* params */, privateKeyHex);

Identity Top Up

@@ -2390,30 +2375,15 @@

Identity Top Up

Parameters:
Identity ID - string - (required) -
Base58 format identity ID -
-
- Asset Lock Proof - string + text (required) -
Hex-encoded JSON asset lock proof +
Example: Enter the identity ID to top up (base58)
-
- Asset Lock Proof Private Key - string - (required) -
WIF format private key
Example
-
const identityId = "5DbLwAxGBzUzo81VewMUwn4b5P4bpv9FNFybi25XB5Bk"; // base58 -const assetLockProof = "a9147d3b... (hex-encoded)"; -const assetLockProofPrivateKey = "XFfpaSbZq52HPy3WWwe1dXsZMiU1bQn8vQd34HNXkSZThevBWRn1"; // WIF format - -const result = await sdk.identityTopUp(identityId, assetLockProof, assetLockProofPrivateKey);
+
const result = await sdk.identityTopUp(identityHex, /* params */, privateKeyHex);

Identity Update