mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-27 14:09:50 +00:00
426ac99e34
* Fix Hive issue * Disable RobinHood for Nano * Validate context is still mounted [skip ci] * Disable Exolix for new exchanges Remove duplicate ethereum case * add nano/banano to manifest/info.plist * fix qr code issues for nano * Add Nano-wallet to restore form qr Add iOS keychain accessibility config * support app links for ethereum and nano [skip ci] * catch exceptions from gas price and estimated gas * Add bitcoin cash to app links Fix restore from QR for bitcoin cash * Fixate bottom buttons for create/restore wallet in wallet list page --------- Co-authored-by: fosse <matt.cfosse@gmail.com>
36 lines
1,017 B
Dart
36 lines
1,017 B
Dart
import 'package:cake_wallet/nano/nano.dart';
|
|
|
|
class PaymentRequest {
|
|
PaymentRequest(this.address, this.amount, this.note, this.scheme);
|
|
|
|
factory PaymentRequest.fromUri(Uri? uri) {
|
|
var address = "";
|
|
var amount = "";
|
|
var note = "";
|
|
var scheme = "";
|
|
|
|
if (uri != null) {
|
|
address = uri.path;
|
|
amount = uri.queryParameters['tx_amount'] ?? uri.queryParameters['amount'] ?? "";
|
|
note = uri.queryParameters['tx_description'] ?? uri.queryParameters['message'] ?? "";
|
|
scheme = uri.scheme;
|
|
}
|
|
|
|
if (nano != null) {
|
|
if (amount.isNotEmpty) {
|
|
if (address.contains("nano")) {
|
|
amount = nanoUtil!.getRawAsUsableString(amount, nanoUtil!.rawPerNano);
|
|
} else if (address.contains("ban")) {
|
|
amount = nanoUtil!.getRawAsUsableString(amount, nanoUtil!.rawPerBanano);
|
|
}
|
|
}
|
|
}
|
|
|
|
return PaymentRequest(address, amount, note, scheme);
|
|
}
|
|
|
|
final String address;
|
|
final String amount;
|
|
final String note;
|
|
final String scheme;
|
|
}
|