Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
89 changes: 53 additions & 36 deletions public/AI_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2977,8 +2977,6 @@ const result = await sdk.voting.masternodeVote({ masternodeProTxHash, votePoll,
**Address Transfer** - `addresses.transfer`
*Transfer credits between Platform addresses*

**Disabled:** Platform addresses not fully implemented in SDK

Signature: `transfer(options: wasm.AddressFundsTransferOptions): Promise<Map<string, wasm.PlatformAddressInfo>>`

Parameters:
Expand Down Expand Up @@ -3013,19 +3011,19 @@ Returns:

Example:
```javascript
import { PlatformAddressInput, PlatformAddressOutput, PlatformAddressSigner } from '@dashevo/evo-sdk';
const inputs = [new PlatformAddressInput({ address: senderAddress, amount })];
const outputs = [new PlatformAddressOutput({ address: recipientAddress, amount })];
import { PlatformAddressSigner, PrivateKey } from '@dashevo/evo-sdk';
const signer = new PlatformAddressSigner();
signer.addKey(privateKey);
await sdk.addresses.transfer({ inputs, outputs, signer });
const senderAddress = signer.addKey(PrivateKey.fromWIF(addressPrivateKeyWif));
const addressInfo = await sdk.addresses.get(senderAddress);
if (!addressInfo) throw new Error('Platform Address is not funded');
const input = { address: senderAddress.toBech32m(network), amount: BigInt(amount) };
const output = { address: recipientAddress, amount: BigInt(amount) };
await sdk.addresses.transfer({ inputs: [input], outputs: [output], signer });
```

**Top Up Identity from Address** - `addresses.topUpIdentity`
*Top up an identity using Platform address credits*

**Disabled:** Platform addresses not fully implemented in SDK

Signature: `topUpIdentity(options: wasm.IdentityTopUpFromAddressesOptions): Promise<wasm.IdentityTopUpFromAddressesResult>`

Parameters:
Expand Down Expand Up @@ -3055,19 +3053,20 @@ Returns:

Example:
```javascript
import { PlatformAddressInput, PlatformAddressSigner } from '@dashevo/evo-sdk';
const identity = await sdk.identities.fetch(identityId);
const inputs = [new PlatformAddressInput({ address: senderAddress, amount })];
if (!identity) throw new Error('Identity not found');
import { PlatformAddressSigner, PrivateKey } from '@dashevo/evo-sdk';
const signer = new PlatformAddressSigner();
signer.addKey(privateKey);
await sdk.addresses.topUpIdentity({ identity, inputs, signer });
const senderAddress = signer.addKey(PrivateKey.fromWIF(addressPrivateKeyWif));
const addressInfo = await sdk.addresses.get(senderAddress);
if (!addressInfo) throw new Error('Platform Address is not funded');
const input = { address: senderAddress.toBech32m(network), amount: BigInt(amount) };
await sdk.addresses.topUpIdentity({ identity, inputs: [input], signer });
```

**Withdraw to Core** - `addresses.withdraw`
*Withdraw Platform address credits to Dash Core*

**Disabled:** Platform addresses not fully implemented in SDK

Signature: `withdraw(options: wasm.AddressFundsWithdrawOptions): Promise<Map<string, wasm.PlatformAddressInfo>>`

Parameters:
Expand Down Expand Up @@ -3115,19 +3114,38 @@ Returns:

Example:
```javascript
import { CoreScript, PlatformAddressInput, PlatformAddressSigner } from '@dashevo/evo-sdk';
const inputs = [new PlatformAddressInput({ address: senderAddress, amount })];
const outputScript = CoreScript.newP2PKH(coreAddress);
import { PlatformAddressSigner, PrivateKey } from '@dashevo/evo-sdk';
const signer = new PlatformAddressSigner();
signer.addKey(privateKey);
await sdk.addresses.withdraw({ inputs, coreFeePerByte, pooling, outputScript, signer });
const senderAddress = signer.addKey(PrivateKey.fromWIF(addressPrivateKeyWif));
const addressInfo = await sdk.addresses.get(senderAddress);
if (!addressInfo) throw new Error('Platform Address is not funded');
const input = { address: senderAddress.toBech32m(network), amount: BigInt(amount) };
import { CoreScript, PoolingWasm, wallet } from '@dashevo/evo-sdk';
const BASE58_ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
async function coreScriptFromAddress(address) {
if (!await wallet.validateAddress(address, network)) throw new Error('Dash Core address is invalid for the selected network');
let value = 0n;
for (const character of address) {
value = value * 58n + BigInt(BASE58_ALPHABET.indexOf(character));
}
const decoded = [];
while (value > 0n) { decoded.unshift(Number(value & 255n)); value >>= 8n; }
for (const character of address) { if (character !== '1') break; decoded.unshift(0); }
const payload = Uint8Array.from(decoded.slice(0, 21));
const hash = payload.slice(1);
if ([0x4c, 0x8c].includes(payload[0])) return CoreScript.fromP2PKH(hash);
if ([0x10, 0x13].includes(payload[0])) return CoreScript.fromP2SH(hash);
throw new Error('Unsupported Dash Core address version');
}
const outputScript = await coreScriptFromAddress(toAddress);
const parsedCoreFeePerByte = coreFeePerByte == null || coreFeePerByte === '' ? 1 : Number(coreFeePerByte);
if (!Number.isSafeInteger(parsedCoreFeePerByte) || parsedCoreFeePerByte < 0 || parsedCoreFeePerByte > 0xffffffff) throw new Error('Core fee per byte must be an unsigned 32-bit integer');
await sdk.addresses.withdraw({ inputs: [input], coreFeePerByte: parsedCoreFeePerByte, pooling: PoolingWasm.Never, outputScript, signer });
```

**Transfer from Identity to Address** - `addresses.transferFromIdentity`
*Transfer credits from an identity to Platform addresses*

**Disabled:** Platform addresses not fully implemented in SDK

Signature: `transferFromIdentity(options: wasm.IdentityTransferToAddressesOptions): Promise<wasm.IdentityTransferToAddressesResult>`

Parameters:
Expand Down Expand Up @@ -3160,9 +3178,10 @@ Returns:

Example:
```javascript
import { IdentitySigner, PlatformAddressOutput } from '@dashevo/evo-sdk';
import { IdentitySigner } from '@dashevo/evo-sdk';
const identity = await sdk.identities.fetch(identityId);
const outputs = [new PlatformAddressOutput({ address: recipientAddress, amount })];
if (!identity) throw new Error('Identity not found');
const outputs = [{ address: recipientAddress, amount: BigInt(amount) }];
const signer = new IdentitySigner();
signer.addKeyFromWif(privateKeyWif);
await sdk.addresses.transferFromIdentity({ identity, outputs, signer });
Expand All @@ -3171,8 +3190,6 @@ await sdk.addresses.transferFromIdentity({ identity, outputs, signer });
**Fund Address from Asset Lock** - `addresses.fundFromAssetLock`
*Fund Platform addresses from an asset lock*

**Disabled:** Platform addresses not fully implemented in SDK

Signature: `fundFromAssetLock(options: wasm.AddressFundingFromAssetLockOptions): Promise<Map<string, wasm.PlatformAddressInfo>>`

Parameters:
Expand Down Expand Up @@ -3211,19 +3228,19 @@ Returns:

Example:
```javascript
import { AssetLockProof, PlatformAddressOutput, PlatformAddressSigner, PrivateKey } from '@dashevo/evo-sdk';
import { AssetLockProof, FeeStrategyStep, PlatformAddressSigner, PrivateKey } from '@dashevo/evo-sdk';
const assetLockProof = AssetLockProof.fromHex(assetLockProofHex);
const assetLockPrivateKey = PrivateKey.fromWIF(assetLockPrivateKeyWif);
const outputs = [new PlatformAddressOutput({ address: recipientAddress, amount })];
const signer = new PlatformAddressSigner();
await sdk.addresses.fundFromAssetLock({ assetLockProof, assetLockPrivateKey, outputs, signer });
signer.addKey(PrivateKey.fromWIF(addressPrivateKeyWif));
const outputs = [{ address: recipientAddress }];
const feeStrategy = [FeeStrategyStep.reduceOutput(0)];
await sdk.addresses.fundFromAssetLock({ assetLockProof, assetLockPrivateKey, outputs, feeStrategy, signer });
```

**Create Identity from Address** - `addresses.createIdentity`
*Create a new identity funded from Platform addresses*

**Disabled:** Platform addresses not fully implemented in SDK

Signature: `createIdentity(options: wasm.IdentityCreateFromAddressesOptions): Promise<wasm.IdentityCreateFromAddressesResult>`

Parameters:
Expand Down Expand Up @@ -3262,16 +3279,16 @@ Returns:

Example:
```javascript
import { Identifier, Identity, IdentityPublicKeyInCreation, IdentitySigner, KeyType, PlatformAddressInput, PlatformAddressSigner, PrivateKey, Purpose, SecurityLevel } from '@dashevo/evo-sdk';
import { Identifier, Identity, IdentityPublicKeyInCreation, IdentitySigner, KeyType, PlatformAddressSigner, PrivateKey, Purpose, SecurityLevel } from '@dashevo/evo-sdk';
const identityPrivateKey = PrivateKey.fromWIF(identityPrivateKeyWif);
const identity = new Identity(Identifier.random());
const identity = new Identity(Identifier.fromBytes(crypto.getRandomValues(new Uint8Array(32))));
const identityPublicKey = new IdentityPublicKeyInCreation({ keyId: 0, purpose: Purpose.AUTHENTICATION, securityLevel: SecurityLevel.MASTER, keyType: KeyType.ECDSA_SECP256K1, data: identityPrivateKey.getPublicKey().toBytes() }).toIdentityPublicKey();
identity.addPublicKey(identityPublicKey);
const inputs = [new PlatformAddressInput({ address: senderAddress, amount })];
const addressSigner = new PlatformAddressSigner();
const derivedAddress = addressSigner.addKey(PrivateKey.fromWIF(addressPrivateKeyWif));
const inputs = [{ address: derivedAddress.toBech32m(network), amount: BigInt(amount) }];
const identitySigner = new IdentitySigner();
identitySigner.addKey(identityPrivateKey);
const addressSigner = new PlatformAddressSigner();
addressSigner.addKey(addressPrivateKey);
await sdk.addresses.createIdentity({ identity, inputs, identitySigner, addressSigner });
```

Expand Down
54 changes: 10 additions & 44 deletions public/api-definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2385,7 +2385,6 @@
"addressTransfer": {
"label": "Address Transfer",
"description": "Transfer credits between Platform addresses",
"disabled": "Platform addresses not fully implemented in SDK",
"inputs": [
{
"name": "senderAddress",
Expand All @@ -2394,13 +2393,6 @@
"required": true,
"placeholder": "tdash1krt0z5hrcaphyuraxmk2h2ff8nyv5fmncsgf7evf"
},
{
"name": "senderNonce",
"type": "number",
"label": "Sender Nonce",
"required": true,
"placeholder": "0"
},
{
"name": "amount",
"type": "text",
Expand All @@ -2420,7 +2412,6 @@
"addressTopUpIdentity": {
"label": "Top Up Identity from Address",
"description": "Top up an identity using Platform address credits",
"disabled": "Platform addresses not fully implemented in SDK",
"inputs": [
{
"name": "identityId",
Expand All @@ -2436,13 +2427,6 @@
"required": true,
"placeholder": "tdash1krt0z5hrcaphyuraxmk2h2ff8nyv5fmncsgf7evf"
},
{
"name": "senderNonce",
"type": "number",
"label": "Sender Nonce",
"required": true,
"placeholder": "0"
},
{
"name": "amount",
"type": "text",
Expand All @@ -2455,7 +2439,6 @@
"addressWithdraw": {
"label": "Withdraw to Core",
"description": "Withdraw Platform address credits to Dash Core",
"disabled": "Platform addresses not fully implemented in SDK",
"inputs": [
{
"name": "senderAddress",
Expand All @@ -2464,13 +2447,6 @@
"required": true,
"placeholder": "tdash1krt0z5hrcaphyuraxmk2h2ff8nyv5fmncsgf7evf"
},
{
"name": "senderNonce",
"type": "number",
"label": "Sender Nonce",
"required": true,
"placeholder": "0"
},
{
"name": "amount",
"type": "text",
Expand All @@ -2497,7 +2473,6 @@
"addressTransferFromIdentity": {
"label": "Transfer from Identity to Address",
"description": "Transfer credits from an identity to Platform addresses",
"disabled": "Platform addresses not fully implemented in SDK",
"inputs": [
{
"name": "recipientAddress",
Expand All @@ -2518,28 +2493,26 @@
"addressFundFromAssetLock": {
"label": "Fund Address from Asset Lock",
"description": "Fund Platform addresses from an asset lock",
"disabled": "Platform addresses not fully implemented in SDK",
"inputs": [
{
"name": "addressPrivateKeyWif",
"type": "password",
"label": "Recipient Platform Address Private Key (WIF)",
"required": true
},
Comment thread
coderabbitai[bot] marked this conversation as resolved.
{
"name": "recipientAddress",
"type": "text",
"label": "Recipient Platform Address",
"required": true,
"placeholder": "tdash1krt0z5hrcaphyuraxmk2h2ff8nyv5fmncsgf7evf"
},
{
"name": "amount",
"type": "text",
"label": "Amount (credits)",
"required": true
}
],
"sdk_method": "addresses.fundFromAssetLock"
},
"addressCreateIdentity": {
"label": "Create Identity from Address",
"description": "Create a new identity funded from Platform addresses",
"disabled": "Platform addresses not fully implemented in SDK",
"inputs": [
{
"name": "senderAddress",
Expand All @@ -2548,25 +2521,18 @@
"required": true,
"placeholder": "tdash1krt0z5hrcaphyuraxmk2h2ff8nyv5fmncsgf7evf"
},
{
"name": "senderNonce",
"type": "number",
"label": "Sender Nonce",
"required": true,
"placeholder": "0"
},
{
"name": "amount",
"type": "text",
"label": "Amount (credits)",
"required": true
},
{
"name": "publicKeys",
"type": "json",
"label": "Public Keys (JSON)",
"name": "identityPrivateKeyWif",
"type": "password",
"label": "New Identity Private Key (WIF)",
"required": true,
"placeholder": "[{\"id\":0,\"type\":0,\"purpose\":0,\"securityLevel\":0,\"data\":\"...\"}]"
"placeholder": "c..."
}
],
"sdk_method": "addresses.createIdentity"
Expand Down
2 changes: 1 addition & 1 deletion public/documentation-check-report.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
================================================================================
Evo SDK Documentation Check
================================================================================
Timestamp: 2026-07-23T14:22:05.264009
Timestamp: 2026-07-23T17:08:43.096666

✅ All documentation is up to date!
================================================================================
12 changes: 6 additions & 6 deletions public/sdk-operation-catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -4645,7 +4645,7 @@
"sdkMethod": "addresses.transfer",
"label": "Address Transfer",
"description": "Transfer credits between Platform addresses",
"disabled": "Platform addresses not fully implemented in SDK",
"disabled": null,
"signature": "transfer(options: wasm.AddressFundsTransferOptions): Promise<Map<string, wasm.PlatformAddressInfo>>",
"parameters": [
{
Expand Down Expand Up @@ -4718,7 +4718,7 @@
"sdkMethod": "addresses.topUpIdentity",
"label": "Top Up Identity from Address",
"description": "Top up an identity using Platform address credits",
"disabled": "Platform addresses not fully implemented in SDK",
"disabled": null,
"signature": "topUpIdentity(options: wasm.IdentityTopUpFromAddressesOptions): Promise<wasm.IdentityTopUpFromAddressesResult>",
"parameters": [
{
Expand Down Expand Up @@ -4782,7 +4782,7 @@
"sdkMethod": "addresses.withdraw",
"label": "Withdraw to Core",
"description": "Withdraw Platform address credits to Dash Core",
"disabled": "Platform addresses not fully implemented in SDK",
"disabled": null,
"signature": "withdraw(options: wasm.AddressFundsWithdrawOptions): Promise<Map<string, wasm.PlatformAddressInfo>>",
"parameters": [
{
Expand Down Expand Up @@ -4880,7 +4880,7 @@
"sdkMethod": "addresses.transferFromIdentity",
"label": "Transfer from Identity to Address",
"description": "Transfer credits from an identity to Platform addresses",
"disabled": "Platform addresses not fully implemented in SDK",
"disabled": null,
"signature": "transferFromIdentity(options: wasm.IdentityTransferToAddressesOptions): Promise<wasm.IdentityTransferToAddressesResult>",
"parameters": [
{
Expand Down Expand Up @@ -4951,7 +4951,7 @@
"sdkMethod": "addresses.fundFromAssetLock",
"label": "Fund Address from Asset Lock",
"description": "Fund Platform addresses from an asset lock",
"disabled": "Platform addresses not fully implemented in SDK",
"disabled": null,
"signature": "fundFromAssetLock(options: wasm.AddressFundingFromAssetLockOptions): Promise<Map<string, wasm.PlatformAddressInfo>>",
"parameters": [
{
Expand Down Expand Up @@ -5033,7 +5033,7 @@
"sdkMethod": "addresses.createIdentity",
"label": "Create Identity from Address",
"description": "Create a new identity funded from Platform addresses",
"disabled": "Platform addresses not fully implemented in SDK",
"disabled": null,
"signature": "createIdentity(options: wasm.IdentityCreateFromAddressesOptions): Promise<wasm.IdentityCreateFromAddressesResult>",
"parameters": [
{
Expand Down
Loading