feat: Add solana to Open Crypto Pay (#2417)

This commit is contained in:
Konstantin Ullrich
2025-07-30 02:24:26 +03:00
committed by GitHub
parent 86831d1f05
commit d32569fc84
3 changed files with 12 additions and 4 deletions
@@ -12,6 +12,9 @@ class OpenCryptoPayService {
value.toLowerCase().contains("lightning=lnurl") ||
value.toLowerCase().startsWith("lnurl");
static bool requiresClientCommit(CryptoCurrency currency) =>
[CryptoCurrency.xmr, CryptoCurrency.sol].contains(currency) || currency.tag == "SOL";
Future<String> commitOpenCryptoPayRequest(
String txHex, {
required String txId,
@@ -39,7 +42,7 @@ class OpenCryptoPayService {
throw OpenCryptoPayException(body.toString());
}
throw OpenCryptoPayException(
"Unexpected status code ${response.statusCode} ${response}");
"Unexpected status code ${response.statusCode} ${response.body}");
}
Future<void> cancelOpenCryptoPayRequest(OpenCryptoPayRequest request) async {
@@ -162,6 +165,10 @@ class OpenCryptoPayService {
return "Ethereum";
case "POL":
return "Polygon";
case "TRX":
return "Tron";
case "SOL":
return "Solana";
default:
return asset.fullName!;
}
+1 -1
View File
@@ -560,7 +560,7 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
if (ocpRequest != null) {
state = TransactionCommitting();
if (selectedCryptoCurrency == CryptoCurrency.xmr) {
if (OpenCryptoPayService.requiresClientCommit(selectedCryptoCurrency)) {
await pendingTransaction!.commit();
}