getMessage() . "\n"); } // --- Call getNewSubaddress --- echo "ℹ️ Calling getNewSubaddress()...\n"; $newAddress = $wallet->getNewSubaddress(); if (!$newAddress) { die("❌ ERROR: The wallet RPC call failed. Check if your salvium-wallet-rpc is running and accessible.\n"); } echo "✅ Received address: " . $newAddress . "\n"; // --- Validate the Address Format --- $expectedPrefix = 'SC1'; if (str_starts_with($newAddress, $expectedPrefix)) { echo "✅ SUCCESS: The new address starts with the correct 'SC1' prefix.\n"; } else { echo "❌ FAILURE: The new address does not start with 'SC1'.\n"; echo " - Expected prefix: " . $expectedPrefix . "\n"; echo " - Actual prefix: " . substr($newAddress, 0, 3) . "\n"; } ?>