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
9 changes: 9 additions & 0 deletions public/api-definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
"getIdentitiesContractKeys": {
"label": "Get Contract Keys for Identities",
"description": "Fetch contract-specific keys for one or more identities.",
"disabled": "Requires fix for upstream issue: https://github.com/dashpay/platform/issues/3028",
"inputs": [
{
"name": "identityIds",
Expand Down Expand Up @@ -1444,6 +1445,7 @@
"getPlatformAddress": {
"label": "Get Platform Address",
"description": "Fetch information about a Platform address including its nonce and balance.",
"disabled": "Platform addresses not fully implemented in SDK",
"inputs": [
{
"name": "address",
Expand All @@ -1458,6 +1460,7 @@
"getPlatformAddresses": {
"label": "Get Multiple Platform Addresses",
"description": "Fetch information about multiple Platform addresses.",
"disabled": "Platform addresses not fully implemented in SDK",
"inputs": [
{
"name": "addresses",
Expand Down Expand Up @@ -2488,6 +2491,7 @@
"addressTransfer": {
"label": "Address Transfer",
"description": "Transfer credits between Platform addresses",
"disabled": "Platform addresses not fully implemented in SDK",
"inputs": [
{
"name": "senderAddress",
Expand Down Expand Up @@ -2527,6 +2531,7 @@
"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 Down Expand Up @@ -2566,6 +2571,7 @@
"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 Down Expand Up @@ -2614,6 +2620,7 @@
"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 @@ -2639,6 +2646,7 @@
"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": "recipientAddress",
Expand All @@ -2665,6 +2673,7 @@
"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 Down
19 changes: 17 additions & 2 deletions public/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,10 @@ function populateOperations(categoryKey) {
const option = document.createElement('option');
option.value = key;
option.textContent = def?.label || key;
if (def?.disabled) {
// option.disabled = true; // Allow clicking to see operation details
option.textContent += ' (Disabled)';
}
elements.queryType.appendChild(option);
}
elements.queryType.style.display = 'block';
Expand Down Expand Up @@ -723,11 +727,22 @@ function onOperationChange(categoryKey, operationKey) {
}
const label = def.label || operationKey;
elements.queryTitle.textContent = label;
if (def.description) {

// Check if operation is disabled
const isDisabled = !!def.disabled;
if (isDisabled) {
const reason = typeof def.disabled === 'string' ? def.disabled
: def.disabled?.reason || 'This operation is temporarily disabled';
elements.queryDescription.textContent = `DISABLED: ${reason}`;
elements.queryDescription.style.display = 'block';
elements.queryDescription.classList.add('disabled-warning');
} else if (def.description) {
elements.queryDescription.textContent = def.description;
elements.queryDescription.style.display = 'block';
elements.queryDescription.classList.remove('disabled-warning');
} else {
elements.queryDescription.style.display = 'none';
elements.queryDescription.classList.remove('disabled-warning');
}
renderInputs(def);
const supportsProof = config.allowProof && PROOF_CAPABLE.has(operationKey);
Expand All @@ -744,7 +759,7 @@ function onOperationChange(categoryKey, operationKey) {
updateAuthInputsVisibility(authRequirements);
if (elements.executeButton) {
elements.executeButton.style.display = 'block';
elements.executeButton.disabled = false;
elements.executeButton.disabled = isDisabled;
}
state.selected = { type, categoryKey, operationKey, definition: def, auth: authRequirements };
}
Expand Down
10 changes: 10 additions & 0 deletions public/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,16 @@ details.sdk-config summary span:last-child {
line-height: 1.4;
}

.query-description.disabled-warning {
background-color: #f8d7da;
color: #721c24;
font-style: italic;
}

select option:disabled {
color: #999;
}

.action-button {
padding: 8px 16px;
background-color: #2196f3;
Expand Down
5 changes: 4 additions & 1 deletion tests/e2e/utils/sdk-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -600,12 +600,15 @@ class EvoSdkPage extends BaseTest {

/**
* Get available query types for current category
* Note: Strips " (Disabled)" suffix from operation names so tests remain agnostic to disabled state
*/
async getAvailableQueryTypes() {
const queryTypeSelect = this.page.locator(this.selectors.queryType);
await queryTypeSelect.waitFor({ state: 'visible' });
const options = await queryTypeSelect.locator('option').allTextContents();
return options.filter(option => option.trim() !== '' && option !== 'Select Query Type');
return options
.filter(option => option.trim() !== '' && option !== 'Select Query Type')
.map(option => option.replace(/ \(Disabled\)$/, ''));
}

/**
Expand Down