diff --git a/packages/wasm-sdk/AI_REFERENCE.md b/packages/wasm-sdk/AI_REFERENCE.md index 2372507d95b..93392ab5d6c 100644 --- a/packages/wasm-sdk/AI_REFERENCE.md +++ b/packages/wasm-sdk/AI_REFERENCE.md @@ -731,24 +731,55 @@ const result = await sdk.{transition_name}(identityHex, ...params, privateKeyHex **Identity Create** - `identityCreate` *Create a new identity with initial credits* -Parameters (in addition to identity/key): -- `publicKeys` (keyArray, required) - Public Keys -- `assetLockProof` (assetLockProof, required) - Asset Lock Proof +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 + } +]); -Example: -```javascript -const result = await sdk.identityCreate(identityHex, /* params */, privateKeyHex); +const result = await sdk.identityCreate(assetLockProof, assetLockProofPrivateKey, publicKeys); ``` **Identity Top Up** - `identityTopUp` *Add credits to an existing identity* -Parameters (in addition to identity/key): -- `assetLockProof` (assetLockProof, required) - Asset Lock Proof +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) Example: ```javascript -const result = await sdk.identityTopUp(identityHex, /* params */, privateKeyHex); +const identityId = "5DbLwAxGBzUzo81VewMUwn4b5P4bpv9FNFybi25XB5Bk"; // base58 +const assetLockProof = "a9147d3b... (hex-encoded)"; +const assetLockProofPrivateKey = "XFfpaSbZq52HPy3WWwe1dXsZMiU1bQn8vQd34HNXkSZThevBWRn1"; // WIF format + +const result = await sdk.identityTopUp(identityId, assetLockProof, assetLockProofPrivateKey); ``` **Identity Update** - `identityUpdate` @@ -756,7 +787,7 @@ const result = await sdk.identityTopUp(identityHex, /* params */, privateKeyHex) Parameters (in addition to identity/key): - `addPublicKeys` (textarea, optional) - Keys to Add (JSON array) - - Example: `[{"keyType":"ECDSA_HASH160","purpose":"AUTHENTICATION","data":"base64_key_data"}]` + - Example: `[{"type":0,"purpose":0,"securityLevel":2,"data":"base64_encoded_public_key","readOnly":false}]` - `disablePublicKeys` (text, optional) - Key IDs to Disable (comma-separated) - Example: `2,3,5` @@ -974,7 +1005,6 @@ Parameters (in addition to identity/key): - `contractId` (text, required) - Data Contract ID - `tokenPosition` (number, required) - Token Contract Position - `amount` (text, required) - Amount to Burn -- `keyId` (number, required) - Key ID (for signing) - `publicNote` (text, optional) - Public Note Example: @@ -989,7 +1019,6 @@ Parameters (in addition to identity/key): - `contractId` (text, required) - Data Contract ID - `tokenPosition` (number, required) - Token Contract Position - `amount` (text, required) - Amount to Mint -- `keyId` (number, required) - Key ID (for signing) - `issuedToIdentityId` (text, optional) - Issue To Identity ID - `publicNote` (text, optional) - Public Note @@ -1005,7 +1034,6 @@ Parameters (in addition to identity/key): - `contractId` (text, required) - Data Contract ID - `tokenPosition` (number, required) - Token Contract Position - `distributionType` (select, required) - Distribution Type -- `keyId` (number, required) - Key ID (for signing) - `publicNote` (text, optional) - Public Note Example: @@ -1022,7 +1050,6 @@ Parameters (in addition to identity/key): - `priceType` (select, required) - Price Type - `priceData` (text, optional) - Price Data (single price or JSON map) - Example: `Leave empty to remove pricing` -- `keyId` (number, required) - Key ID (for signing) - `publicNote` (text, optional) - Public Note Example: @@ -1037,7 +1064,7 @@ Parameters (in addition to identity/key): - `contractId` (text, required) - Data Contract ID - `tokenPosition` (number, required) - Token Contract Position - `amount` (text, required) - Amount to Purchase -- `totalAgreedPrice` (text, required) - Total Agreed Price (in credits) +- `totalAgreedPrice` (text, optional) - Total Agreed Price (in credits) - Optional, fetches from pricing schedule if not provided - `keyId` (number, required) - Key ID (for signing) Example: @@ -1053,7 +1080,6 @@ Parameters (in addition to identity/key): - `tokenPosition` (number, required) - Token Contract Position - `configItemType` (select, required) - Config Item Type - `configValue` (text, required) - Config Value (JSON or specific value) -- `keyId` (number, required) - Key ID (for signing) - `publicNote` (text, optional) - Public Note Example: diff --git a/packages/wasm-sdk/docs.html b/packages/wasm-sdk/docs.html index 0b9fce2a6b3..d81d76f3b4b 100644 --- a/packages/wasm-sdk/docs.html +++ b/packages/wasm-sdk/docs.html @@ -2335,20 +2335,52 @@

Identity Create

Parameters:
- Public Keys - keyArray + Asset Lock Proof + string (required) +
Hex-encoded JSON asset lock proof
- Asset Lock Proof - assetLockProof + Asset Lock Proof Private Key + string (required) +
WIF format private key +
+
+ Public Keys + string + (required) +
JSON array of public keys
Example
-
const result = await sdk.identityCreate(identityHex, /* params */, privateKeyHex);
+
// 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);

Identity Top Up

@@ -2356,16 +2388,32 @@

Identity Top Up

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

Identity Update

@@ -2827,11 +2875,6 @@
Parameters:
text (required)
-
- Key ID (for signing) - number - (required) -
Public Note text @@ -2864,11 +2907,6 @@
Parameters:
text (required)
-
- Key ID (for signing) - number - (required) -
Issue To Identity ID text @@ -2907,11 +2945,6 @@
Parameters:
(required)
Options: Perpetual, Pre-programmed
-
- Key ID (for signing) - number - (required) -
Public Note text @@ -2951,11 +2984,6 @@
Parameters:
(optional)
Example: Leave empty to remove pricing
-
- Key ID (for signing) - number - (required) -
Public Note text @@ -2989,9 +3017,9 @@
Parameters:
(required)
- Total Agreed Price (in credits) + Total Agreed Price (in credits) - Optional, fetches from pricing schedule if not provided text - (required) + (optional)
Key ID (for signing) @@ -3024,18 +3052,13 @@
Parameters:
Config Item Type select (required) -
Options: No Change, Conventions, Max Supply, Perpetual Distribution, New Tokens Destination Identity, Minting Allow Choosing Destination, Manual Minting, Manual Burning, Conventions Control Group, Conventions Admin Group, Max Supply Control Group, Max Supply Admin Group +
Options: Conventions, Max Supply, Perpetual Distribution, New Tokens Destination Identity, Minting Allow Choosing Destination, Manual Minting, Manual Burning, Conventions Control Group, Conventions Admin Group, Max Supply Control Group, Max Supply Admin Group
Config Value (JSON or specific value) text (required)
-
- Key ID (for signing) - number - (required) -
Public Note text diff --git a/packages/wasm-sdk/docs_manifest.json b/packages/wasm-sdk/docs_manifest.json index 90fceff4e09..f4c6ccda6b9 100644 --- a/packages/wasm-sdk/docs_manifest.json +++ b/packages/wasm-sdk/docs_manifest.json @@ -1,5 +1,5 @@ { - "generated_at": "2025-07-27T13:06:04.539212", + "generated_at": "2025-07-28T12:35:33.649527", "queries": { "getIdentity": { "category": "identity", diff --git a/packages/wasm-sdk/fixed_definitions.json b/packages/wasm-sdk/fixed_definitions.json index b03180cedc4..b286f55748e 100644 --- a/packages/wasm-sdk/fixed_definitions.json +++ b/packages/wasm-sdk/fixed_definitions.json @@ -1082,16 +1082,52 @@ "description": "Create a new identity with initial credits", "inputs": [ { - "name": "publicKeys", - "type": "keyArray", - "label": "Public Keys", - "required": true + "name": "seedPhrase", + "type": "textarea", + "label": "Seed Phrase", + "required": true, + "placeholder": "Enter seed phrase (12-24 words) or click Generate", + "help": "The wallet seed phrase that will be used to derive identity keys" }, { - "name": "assetLockProof", - "type": "assetLockProof", - "label": "Asset Lock Proof", - "required": true + "name": "generateSeedButton", + "type": "button", + "label": "Generate New Seed", + "action": "generateTestSeed" + }, + { + "name": "identityIndex", + "type": "number", + "label": "Identity Index", + "required": true, + "value": 0, + "min": 0, + "max": 999, + "help": "The identity index is an internal reference within the wallet. Leave as 0 for first identity." + }, + { + "name": "keySelectionMode", + "type": "select", + "label": "Key Selection Mode", + "required": true, + "value": "default", + "options": [ + { + "value": "default", + "label": "Default (Recommended)" + }, + { + "value": "advanced", + "label": "Advanced" + } + ], + "help": "Default adds standard keys for most Platform operations. Advanced allows custom key configuration." + }, + { + "name": "keyPreview", + "type": "keyPreview", + "label": "Keys to be added", + "help": "These keys will be added to your new identity" } ] }, @@ -1100,10 +1136,12 @@ "description": "Add credits to an existing identity", "inputs": [ { - "name": "assetLockProof", - "type": "assetLockProof", - "label": "Asset Lock Proof", - "required": true + "name": "identityId", + "type": "text", + "label": "Identity ID", + "required": true, + "placeholder": "Enter the identity ID to top up (base58)", + "help": "The identity ID that will receive the credits from the asset lock proof" } ] }, diff --git a/packages/wasm-sdk/index.html b/packages/wasm-sdk/index.html index 5ad4d43f85c..c962e55c76b 100644 --- a/packages/wasm-sdk/index.html +++ b/packages/wasm-sdk/index.html @@ -898,10 +898,14 @@

Dash Platform WASM JS SDK