mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 20:39:51 +00:00
Nano-GPT (#1336)
* init * updates * nano updates * updates * updates * [skipci] wip deep link changes * fix deep links * minor fix * add reminder message on buy and exchange routes * [skip ci] font fixes * review updates * [skip ci] minor fix * save * fixes * minor code cleanup * minor potential fix
This commit is contained in:
parent
e5be737236
commit
baad7f7469
46 changed files with 486 additions and 195 deletions
|
@ -1,19 +1,29 @@
|
|||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/nano/nano.dart';
|
||||
|
||||
class PaymentRequest {
|
||||
PaymentRequest(this.address, this.amount, this.note, this.scheme);
|
||||
PaymentRequest(this.address, this.amount, this.note, this.scheme, {this.callbackUrl, this.callbackMessage});
|
||||
|
||||
factory PaymentRequest.fromUri(Uri? uri) {
|
||||
var address = "";
|
||||
var amount = "";
|
||||
var note = "";
|
||||
var scheme = "";
|
||||
String? callbackUrl;
|
||||
String? callbackMessage;
|
||||
|
||||
if (uri != null) {
|
||||
address = uri.path;
|
||||
address = uri.queryParameters['address'] ?? uri.path;
|
||||
amount = uri.queryParameters['tx_amount'] ?? uri.queryParameters['amount'] ?? "";
|
||||
note = uri.queryParameters['tx_description'] ?? uri.queryParameters['message'] ?? "";
|
||||
scheme = uri.scheme;
|
||||
callbackUrl = uri.queryParameters['callback'];
|
||||
callbackMessage = uri.queryParameters['callbackMessage'];
|
||||
}
|
||||
|
||||
if (scheme == "nano-gpt") {
|
||||
// treat as nano so filling out the address works:
|
||||
scheme = "nano";
|
||||
}
|
||||
|
||||
if (nano != null) {
|
||||
|
@ -26,11 +36,20 @@ class PaymentRequest {
|
|||
}
|
||||
}
|
||||
|
||||
return PaymentRequest(address, amount, note, scheme);
|
||||
return PaymentRequest(
|
||||
address,
|
||||
amount,
|
||||
note,
|
||||
scheme,
|
||||
callbackUrl: callbackUrl,
|
||||
callbackMessage: callbackMessage,
|
||||
);
|
||||
}
|
||||
|
||||
final String address;
|
||||
final String amount;
|
||||
final String note;
|
||||
final String scheme;
|
||||
final String? callbackUrl;
|
||||
final String? callbackMessage;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue