File tree Expand file tree Collapse file tree
lib/services/open_crypto_pay Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ class OpenCryptoPayMethodSupport {
1818 case 'Ethereum' :
1919 case 'Bitcoin' :
2020 case 'Firo' :
21+ // Firo starts here for transparent/provider-broadcast payments; Spark
22+ // or oversized raw transactions fall back to txid at confirmation.
2123 return OpenCryptoPaySubmissionFlow .rawHexToProvider;
2224 case 'Lightning' :
2325 case 'BinancePay' :
Original file line number Diff line number Diff line change @@ -274,4 +274,11 @@ class OpenCryptoPayCommit {
274274 });
275275
276276 bool get isExpired => expiresAt.isBefore (DateTime .now ());
277+
278+ bool get canCommitRawHex =>
279+ submissionFlow == OpenCryptoPaySubmissionFlow .rawHexToProvider;
280+
281+ bool get canCommitTxId =>
282+ submissionFlow == OpenCryptoPaySubmissionFlow .txIdAfterLocalBroadcast ||
283+ method == 'Firo' ;
277284}
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ class OpenCryptoPayApi {
4444 }) async {
4545 final lnurl = LnurlUtils .extractLnurl (qrUrl);
4646 if (lnurl == null ) {
47- throw Exception ('No lightning parameter found in URL ' );
47+ throw Exception ('No LNURL payload found' );
4848 }
4949
5050 final apiUrl = Uri .parse (LnurlUtils .decodeLnurl (lnurl));
@@ -132,9 +132,7 @@ class OpenCryptoPayApi {
132132 required OpenCryptoPayCommit commit,
133133 required String txId,
134134 }) async {
135- if (commit.submissionFlow !=
136- OpenCryptoPaySubmissionFlow .txIdAfterLocalBroadcast &&
137- commit.method != 'Firo' ) {
135+ if (! commit.canCommitTxId) {
138136 throw UnsupportedError (
139137 'OpenCryptoPay method ${commit .method } cannot be committed with txid' ,
140138 );
@@ -149,7 +147,7 @@ class OpenCryptoPayApi {
149147 required OpenCryptoPayCommit commit,
150148 required String hex,
151149 }) async {
152- if (commit.submissionFlow != OpenCryptoPaySubmissionFlow .rawHexToProvider ) {
150+ if (! commit.canCommitRawHex ) {
153151 throw UnsupportedError (
154152 'OpenCryptoPay method ${commit .method } cannot be committed with hex' ,
155153 );
You can’t perform that action at this time.
0 commit comments