feat: allow scanning elect-rs using get_tweaks

This commit is contained in:
Rafael Saes 2024-02-26 15:33:31 -03:00
parent 6b795b5ba3
commit 2cbf1dca88
46 changed files with 369 additions and 404 deletions

View file

@ -23,9 +23,28 @@ class BitcoinReceivePageOption implements ReceivePageOption {
BitcoinReceivePageOption.p2sh,
BitcoinReceivePageOption.p2tr,
BitcoinReceivePageOption.p2wsh,
BitcoinReceivePageOption.p2pkh
BitcoinReceivePageOption.p2pkh,
BitcoinReceivePageOption.silent_payments,
];
BitcoinAddressType toType() {
switch (this) {
case BitcoinReceivePageOption.p2tr:
return SegwitAddresType.p2tr;
case BitcoinReceivePageOption.p2wsh:
return SegwitAddresType.p2wsh;
case BitcoinReceivePageOption.p2pkh:
return P2pkhAddressType.p2pkh;
case BitcoinReceivePageOption.p2sh:
return P2shAddressType.p2wpkhInP2sh;
case BitcoinReceivePageOption.silent_payments:
return SilentPaymentsAddresType.p2sp;
case BitcoinReceivePageOption.p2wpkh:
default:
return SegwitAddresType.p2wpkh;
}
}
factory BitcoinReceivePageOption.fromType(BitcoinAddressType type) {
switch (type) {
case SegwitAddresType.p2tr:

View file

@ -78,6 +78,7 @@ abstract class BitcoinWalletBase extends ElectrumWallet with Store {
Map<String, int>? initialChangeAddressIndex,
int initialSilentAddressIndex = 0,
}) async {
final seedBytes = await mnemonicToSeedBytes(mnemonic);
return BitcoinWallet(
mnemonic: mnemonic,
password: password,
@ -86,10 +87,18 @@ abstract class BitcoinWalletBase extends ElectrumWallet with Store {
initialAddresses: initialAddresses,
initialSilentAddresses: initialSilentAddresses,
initialSilentAddressIndex: initialSilentAddressIndex,
silentAddress: await SilentPaymentOwner.fromMnemonic(mnemonic,
silentAddress: await SilentPaymentOwner.fromPrivateKeys(
scanPrivkey: ECPrivate.fromHex(bitcoin.HDWallet.fromSeed(
seedBytes,
network: network == BitcoinNetwork.testnet ? bitcoin.testnet : bitcoin.bitcoin,
).derivePath(SCAN_PATH).privKey!),
spendPrivkey: ECPrivate.fromHex(bitcoin.HDWallet.fromSeed(
seedBytes,
network: network == BitcoinNetwork.testnet ? bitcoin.testnet : bitcoin.bitcoin,
).derivePath(SPEND_PATH).privKey!),
hrp: network == BitcoinNetwork.testnet ? 'tsp' : 'sp'),
initialBalance: initialBalance,
seedBytes: await mnemonicToSeedBytes(mnemonic),
seedBytes: seedBytes,
initialRegularAddressIndex: initialRegularAddressIndex,
initialChangeAddressIndex: initialChangeAddressIndex,
addressPageType: addressPageType,
@ -106,6 +115,7 @@ abstract class BitcoinWalletBase extends ElectrumWallet with Store {
final snp = await ElectrumWalletSnapshot.load(name, walletInfo.type, password,
walletInfo.network != null ? BasedUtxoNetwork.fromName(walletInfo.network!) : null);
final seedBytes = await mnemonicToSeedBytes(snp.mnemonic);
return BitcoinWallet(
mnemonic: snp.mnemonic,
password: password,
@ -114,10 +124,18 @@ abstract class BitcoinWalletBase extends ElectrumWallet with Store {
initialAddresses: snp.addresses,
initialSilentAddresses: snp.silentAddresses,
initialSilentAddressIndex: snp.silentAddressIndex,
silentAddress: await SilentPaymentOwner.fromMnemonic(snp.mnemonic,
silentAddress: await SilentPaymentOwner.fromPrivateKeys(
scanPrivkey: ECPrivate.fromHex(bitcoin.HDWallet.fromSeed(
seedBytes,
network: snp.network == BitcoinNetwork.testnet ? bitcoin.testnet : bitcoin.bitcoin,
).derivePath(SCAN_PATH).privKey!),
spendPrivkey: ECPrivate.fromHex(bitcoin.HDWallet.fromSeed(
seedBytes,
network: snp.network == BitcoinNetwork.testnet ? bitcoin.testnet : bitcoin.bitcoin,
).derivePath(SPEND_PATH).privKey!),
hrp: snp.network == BitcoinNetwork.testnet ? 'tsp' : 'sp'),
initialBalance: snp.balance,
seedBytes: await mnemonicToSeedBytes(snp.mnemonic),
seedBytes: seedBytes,
initialRegularAddressIndex: snp.regularAddressIndex,
initialChangeAddressIndex: snp.changeAddressIndex,
addressPageType: snp.addressPageType,

View file

@ -48,15 +48,19 @@ class ElectrumClient {
Timer? _aliveTimer;
String unterminatedString;
Future<void> connectToUri(Uri uri) async => await connect(host: uri.host, port: uri.port);
Uri? uri;
Future<void> connectToUri(Uri uri) async {
this.uri = uri;
await connect(host: uri.host, port: uri.port);
}
Future<void> connect({required String host, required int port}) async {
try {
await socket?.close();
} catch (_) {}
socket = await SecureSocket.connect(host, port,
timeout: connectionTimeout, onBadCertificate: (_) => true);
socket = await Socket.connect(host, port, timeout: connectionTimeout);
_setIsConnected(true);
socket!.listen((Uint8List event) {
@ -275,6 +279,9 @@ class ElectrumClient {
Future<Map<String, dynamic>> getHeader({required int height}) async =>
await call(method: 'blockchain.block.get_header', params: [height]) as Map<String, dynamic>;
Future<Map<String, dynamic>> getTweaks({required int height}) async =>
await call(method: 'blockchain.block.tweaks', params: [height]) as Map<String, dynamic>;
Future<double> estimatefee({required int p}) =>
call(method: 'blockchain.estimatefee', params: [p]).then((dynamic result) {
if (result is double) {

View file

@ -6,7 +6,7 @@ import 'dart:math';
import 'package:bitcoin_base/bitcoin_base.dart';
import 'package:bitcoin_flutter/bitcoin_flutter.dart' as bitcoin;
import 'package:bitcoin_base/bitcoin_base.dart' as bitcoin_base;
import 'package:blockchain_utils/blockchain_utils.dart';
import 'package:collection/collection.dart';
import 'package:cw_bitcoin/bitcoin_address_record.dart';
import 'package:cw_bitcoin/bitcoin_transaction_credentials.dart';
@ -146,7 +146,7 @@ abstract class ElectrumWalletBase
Map<String, BehaviorSubject<Object>?> _scripthashesUpdateSubject;
BehaviorSubject<Object>? _chainTipUpdateSubject;
bool _isTransactionUpdating;
// Future<Isolate>? _isolate;
Future<Isolate>? _isolate;
void Function(FlutterErrorDetails)? _onError;
Timer? _autoSaveTimer;
@ -160,66 +160,66 @@ abstract class ElectrumWalletBase
Timer.periodic(Duration(seconds: _autoSaveInterval), (_) async => await save());
}
// @action
// Future<void> _setListeners(int height, {int? chainTip}) async {
// final currentChainTip = chainTip ?? await electrumClient.getCurrentBlockChainTip() ?? 0;
// syncStatus = AttemptingSyncStatus();
@action
Future<void> _setListeners(int height, {int? chainTip}) async {
final currentChainTip = chainTip ?? await electrumClient.getCurrentBlockChainTip() ?? 0;
syncStatus = AttemptingSyncStatus();
// if (_isolate != null) {
// final runningIsolate = await _isolate!;
// runningIsolate.kill(priority: Isolate.immediate);
// }
if (_isolate != null) {
final runningIsolate = await _isolate!;
runningIsolate.kill(priority: Isolate.immediate);
}
// final receivePort = ReceivePort();
// _isolate = Isolate.spawn(
// startRefresh,
// ScanData(
// sendPort: receivePort.sendPort,
// primarySilentAddress: walletAddresses.primarySilentAddress!,
// networkType: networkType,
// height: height,
// chainTip: currentChainTip,
// electrumClient: ElectrumClient(),
// transactionHistoryIds: transactionHistory.transactions.keys.toList(),
// node: electrumClient.uri.toString(),
// labels: walletAddresses.labels,
// ));
final receivePort = ReceivePort();
_isolate = Isolate.spawn(
startRefresh,
ScanData(
sendPort: receivePort.sendPort,
primarySilentAddress: walletAddresses.primarySilentAddress!,
network: network,
height: height,
chainTip: currentChainTip,
electrumClient: ElectrumClient(),
transactionHistoryIds: transactionHistory.transactions.keys.toList(),
node: electrumClient.uri.toString(),
labels: walletAddresses.labels,
));
// await for (var message in receivePort) {
// if (message is BitcoinUnspent) {
// if (!unspentCoins.any((utx) =>
// utx.hash.contains(message.hash) &&
// utx.vout == message.vout &&
// utx.address.contains(message.address))) {
// unspentCoins.add(message);
await for (var message in receivePort) {
if (message is BitcoinUnspent) {
if (!unspentCoins.any((utx) =>
utx.hash.contains(message.hash) &&
utx.vout == message.vout &&
utx.address.contains(message.address))) {
unspentCoins.add(message);
// if (unspentCoinsInfo.values.any((element) =>
// element.walletId.contains(id) &&
// element.hash.contains(message.hash) &&
// element.address.contains(message.address))) {
// _addCoinInfo(message);
if (unspentCoinsInfo.values.any((element) =>
element.walletId.contains(id) &&
element.hash.contains(message.hash) &&
element.address.contains(message.address))) {
_addCoinInfo(message);
// await walletInfo.save();
// await save();
// }
await walletInfo.save();
await save();
}
// balance[currency] = await _fetchBalances();
// }
// }
balance[currency] = await _fetchBalances();
}
}
// if (message is Map<String, ElectrumTransactionInfo>) {
// transactionHistory.addMany(message);
// await transactionHistory.save();
// }
if (message is Map<String, ElectrumTransactionInfo>) {
transactionHistory.addMany(message);
await transactionHistory.save();
}
// // check if is a SyncStatus type since "is SyncStatus" doesn't work here
// if (message is SyncResponse) {
// syncStatus = message.syncStatus;
// walletInfo.restoreHeight = message.height;
// await walletInfo.save();
// }
// }
// }
// check if is a SyncStatus type since "is SyncStatus" doesn't work here
if (message is SyncResponse) {
syncStatus = message.syncStatus;
walletInfo.restoreHeight = message.height;
await walletInfo.save();
}
}
}
@action
@override
@ -261,11 +261,11 @@ abstract class ElectrumWalletBase
};
syncStatus = ConnectedSyncStatus();
// final currentChainTip = await electrumClient.getCurrentBlockChainTip();
final currentChainTip = await electrumClient.getCurrentBlockChainTip();
// if ((currentChainTip ?? 0) > walletInfo.restoreHeight) {
// _setListeners(walletInfo.restoreHeight, chainTip: currentChainTip);
// }
if ((currentChainTip ?? 0) > walletInfo.restoreHeight) {
_setListeners(walletInfo.restoreHeight, chainTip: currentChainTip);
}
} catch (e) {
print(e.toString());
syncStatus = FailedSyncStatus();
@ -697,7 +697,7 @@ abstract class ElectrumWalletBase
@override
Future<void> rescan({required int height, int? chainTip, ScanData? scanData}) async {
// _setListeners(height);
_setListeners(height);
}
@override
@ -1003,7 +1003,7 @@ abstract class ElectrumWalletBase
try {
final currentHeight = await electrumClient.getCurrentBlockChainTip();
if (currentHeight != null) walletInfo.restoreHeight = currentHeight;
// _setListeners(walletInfo.restoreHeight, chainTip: currentHeight);
_setListeners(walletInfo.restoreHeight, chainTip: currentHeight);
} catch (e, s) {
print(e.toString());
_onError?.call(FlutterErrorDetails(
@ -1106,10 +1106,10 @@ abstract class ElectrumWalletBase
class ScanData {
final SendPort sendPort;
final SilentPaymentReceiver primarySilentAddress;
final SilentPaymentOwner primarySilentAddress;
final int height;
final String node;
final bitcoin.NetworkType networkType;
final BasedUtxoNetwork network;
final int chainTip;
final ElectrumClient electrumClient;
final List<String> transactionHistoryIds;
@ -1120,7 +1120,7 @@ class ScanData {
required this.primarySilentAddress,
required this.height,
required this.node,
required this.networkType,
required this.network,
required this.chainTip,
required this.electrumClient,
required this.transactionHistoryIds,
@ -1133,7 +1133,7 @@ class ScanData {
primarySilentAddress: scanData.primarySilentAddress,
height: newHeight,
node: scanData.node,
networkType: scanData.networkType,
network: scanData.network,
chainTip: scanData.chainTip,
transactionHistoryIds: scanData.transactionHistoryIds,
electrumClient: scanData.electrumClient,
@ -1149,333 +1149,220 @@ class SyncResponse {
SyncResponse(this.height, this.syncStatus);
}
// Future<void> startRefresh(ScanData scanData) async {
// var cachedBlockchainHeight = scanData.chainTip;
Future<void> startRefresh(ScanData scanData) async {
var cachedBlockchainHeight = scanData.chainTip;
// Future<int> getNodeHeightOrUpdate(int baseHeight) async {
// if (cachedBlockchainHeight < baseHeight || cachedBlockchainHeight == 0) {
// final electrumClient = scanData.electrumClient;
// if (!electrumClient.isConnected) {
// final node = scanData.node;
// await electrumClient.connectToUri(Uri.parse(node));
// }
Future<int> getNodeHeightOrUpdate(int baseHeight) async {
if (cachedBlockchainHeight < baseHeight || cachedBlockchainHeight == 0) {
final electrumClient = scanData.electrumClient;
if (!electrumClient.isConnected) {
final node = scanData.node;
await electrumClient.connectToUri(Uri.parse(node));
}
// cachedBlockchainHeight =
// await electrumClient.getCurrentBlockChainTip() ?? cachedBlockchainHeight;
// }
cachedBlockchainHeight =
await electrumClient.getCurrentBlockChainTip() ?? cachedBlockchainHeight;
}
// return cachedBlockchainHeight;
// }
return cachedBlockchainHeight;
}
// var lastKnownBlockHeight = 0;
// var initialSyncHeight = 0;
var lastKnownBlockHeight = 0;
var initialSyncHeight = 0;
// var syncHeight = scanData.height;
// var currentChainTip = scanData.chainTip;
var syncHeight = scanData.height;
var currentChainTip = scanData.chainTip;
// if (syncHeight <= 0) {
// syncHeight = currentChainTip;
// }
if (syncHeight <= 0) {
syncHeight = currentChainTip;
}
// if (initialSyncHeight <= 0) {
// initialSyncHeight = syncHeight;
// }
if (initialSyncHeight <= 0) {
initialSyncHeight = syncHeight;
}
// if (lastKnownBlockHeight == syncHeight) {
// scanData.sendPort.send(SyncResponse(currentChainTip, SyncedSyncStatus()));
// return;
// }
if (lastKnownBlockHeight == syncHeight) {
scanData.sendPort.send(SyncResponse(currentChainTip, SyncedSyncStatus()));
return;
}
// // Run this until no more blocks left to scan txs. At first this was recursive
// // i.e. re-calling the startRefresh function but this was easier for the above values to retain
// // their initial values
// while (true) {
// lastKnownBlockHeight = syncHeight;
// Run this until no more blocks left to scan txs. At first this was recursive
// i.e. re-calling the startRefresh function but this was easier for the above values to retain
// their initial values
while (true) {
lastKnownBlockHeight = syncHeight;
// final syncingStatus =
// SyncingSyncStatus.fromHeightValues(currentChainTip, initialSyncHeight, syncHeight);
// scanData.sendPort.send(SyncResponse(syncHeight, syncingStatus));
final syncingStatus =
SyncingSyncStatus.fromHeightValues(currentChainTip, initialSyncHeight, syncHeight);
scanData.sendPort.send(SyncResponse(syncHeight, syncingStatus));
// if (syncingStatus.blocksLeft <= 0) {
// scanData.sendPort.send(SyncResponse(currentChainTip, SyncedSyncStatus()));
// return;
// }
if (syncingStatus.blocksLeft <= 0) {
scanData.sendPort.send(SyncResponse(currentChainTip, SyncedSyncStatus()));
return;
}
// // print(["Scanning from height:", syncHeight]);
print(["Scanning from height:", syncHeight]);
// try {
// final networkPath =
// scanData.networkType.network == bitcoin.BtcNetwork.mainnet ? "" : "/testnet";
try {
// Get all the tweaks from the block
final electrumClient = scanData.electrumClient;
if (!electrumClient.isConnected) {
final node = scanData.node;
await electrumClient.connectToUri(Uri.parse(node));
}
final tweaks = await electrumClient.getTweaks(height: syncHeight);
// // This endpoint gets up to 10 latest blocks from the given height
// final tenNewestBlocks =
// (await http.get(Uri.parse("https://blockstream.info$networkPath/api/blocks/$syncHeight")))
// .body;
// var decodedBlocks = json.decode(tenNewestBlocks) as List<dynamic>;
for (var i = 0; i < tweaks.length; i++) {
try {
// final txid = tweaks.keys.toList()[i];
final details = tweaks.values.toList()[i];
print(["details", details]);
final output_pubkeys = (details["output_pubkeys"] as List<String>);
// decodedBlocks.sort((a, b) => (a["height"] as int).compareTo(b["height"] as int));
// decodedBlocks =
// decodedBlocks.where((element) => (element["height"] as int) >= syncHeight).toList();
// print(["Scanning tx:", txid]);
// // for each block, get up to 25 txs
// for (var i = 0; i < decodedBlocks.length; i++) {
// final blockJson = decodedBlocks[i];
// final blockHash = blockJson["id"];
// final txCount = blockJson["tx_count"] as int;
// TODO: if tx already scanned & stored skip
// if (scanData.transactionHistoryIds.contains(txid)) {
// // already scanned tx, continue to next tx
// pos++;
// continue;
// }
// // print(["Scanning block index:", i, "with tx count:", txCount]);
final result = SilentPayment.scanTweak(
scanData.primarySilentAddress.b_scan,
scanData.primarySilentAddress.B_spend,
details["tweak"] as String,
output_pubkeys.map((e) => BytesUtils.fromHexString(e)).toList(),
labels: scanData.labels,
);
// int startIndex = 0;
// // go through each tx in block until no more txs are left
// while (startIndex < txCount) {
// // This endpoint gets up to 25 txs from the given block hash and start index
// final twentyFiveTxs = json.decode((await http.get(Uri.parse(
// "https://blockstream.info$networkPath/api/block/$blockHash/txs/$startIndex")))
// .body) as List<dynamic>;
if (result.isEmpty) {
// no results tx, continue to next tx
continue;
}
// // print(["Scanning txs index:", startIndex]);
if (result.length > 1) {
print("MULTIPLE UNSPENT COINS FOUND!");
} else {
print("UNSPENT COIN FOUND!");
}
// // For each tx, apply silent payment filtering and do shared secret calculation when applied
// for (var i = 0; i < twentyFiveTxs.length; i++) {
// try {
// final tx = twentyFiveTxs[i];
// final txid = tx["txid"] as String;
// result.forEach((key, value) async {
// final outpoint = output_pubkeys[key];
// // print(["Scanning tx:", txid]);
// if (outpoint == null) {
// return;
// }
// // TODO: if tx already scanned & stored skip
// // if (scanData.transactionHistoryIds.contains(txid)) {
// // // already scanned tx, continue to next tx
// // pos++;
// // continue;
// // }
// final tweak = value[0];
// String? label;
// if (value.length > 1) label = value[1];
// List<String> pubkeys = [];
// List<bitcoin.Outpoint> outpoints = [];
// final txInfo = ElectrumTransactionInfo(
// WalletType.bitcoin,
// id: txid,
// height: syncHeight,
// amount: outpoint.value!,
// fee: 0,
// direction: TransactionDirection.incoming,
// isPending: false,
// date: DateTime.fromMillisecondsSinceEpoch((blockJson["timestamp"] as int) * 1000),
// confirmations: currentChainTip - syncHeight,
// to: bitcoin.SilentPaymentAddress.createLabeledSilentPaymentAddress(
// scanData.primarySilentAddress.scanPubkey,
// scanData.primarySilentAddress.spendPubkey,
// label != null ? label.fromHex : "0".fromHex,
// hrp: scanData.primarySilentAddress.hrp,
// version: scanData.primarySilentAddress.version)
// .toString(),
// unspent: null,
// );
// bool skip = false;
// final status = json.decode((await http
// .get(Uri.parse("https://blockstream.info/testnet/api/tx/$txid/outspends")))
// .body) as List<dynamic>;
// for (var i = 0; i < (tx["vin"] as List<dynamic>).length; i++) {
// final input = tx["vin"][i];
// final prevout = input["prevout"];
// final scriptPubkeyType = prevout["scriptpubkey_type"];
// String? pubkey;
// bool spent = false;
// for (final s in status) {
// if ((s["spent"] as bool) == true) {
// spent = true;
// if (scriptPubkeyType == "v0_p2wpkh" || scriptPubkeyType == "v1_p2tr") {
// final witness = input["witness"];
// if (witness == null) {
// skip = true;
// // print("Skipping, no witness");
// break;
// }
// scanData.sendPort.send({txid: txInfo});
// if (witness.length == 2) {
// pubkey = witness[1] as String;
// } else if (witness.length == 1) {
// pubkey = "02" + (prevout["scriptpubkey"] as String).fromHex.sublist(2).hex;
// }
// }
// final sentTxId = s["txid"] as String;
// final sentTx = json.decode(
// (await http.get(Uri.parse("https://blockstream.info/testnet/api/tx/$sentTxId")))
// .body);
// if (scriptPubkeyType == "p2pkh") {
// pubkey = bitcoin.P2pkhAddress(
// scriptSig: bitcoin.Script.fromRaw(hexData: input["scriptsig"] as String))
// .pubkey;
// }
// int amount = 0;
// for (final out in (sentTx["vout"] as List<dynamic>)) {
// amount += out["value"] as int;
// }
// if (pubkey == null) {
// skip = true;
// // print("Skipping, invalid witness");
// break;
// }
// final height = s["status"]["block_height"] as int;
// pubkeys.add(pubkey);
// outpoints.add(
// bitcoin.Outpoint(txid: input["txid"] as String, index: input["vout"] as int));
// }
// scanData.sendPort.send({
// sentTxId: ElectrumTransactionInfo(
// WalletType.bitcoin,
// id: sentTxId,
// height: height,
// amount: amount,
// fee: 0,
// direction: TransactionDirection.outgoing,
// isPending: false,
// date: DateTime.fromMillisecondsSinceEpoch(
// (s["status"]["block_time"] as int) * 1000),
// confirmations: currentChainTip - height,
// )
// });
// }
// }
// if (skip) {
// // skipped tx, continue to next tx
// continue;
// }
// if (spent) {
// return;
// }
// Map<String, bitcoin.Outpoint> outpointsByP2TRpubkey = {};
// for (var i = 0; i < (tx["vout"] as List<dynamic>).length; i++) {
// final output = tx["vout"][i];
// if (output["scriptpubkey_type"] != "v1_p2tr") {
// // print("Skipping, not a v1_p2tr output");
// continue;
// }
// final unspent = BitcoinUnspent(
// BitcoinAddressRecord(
// bitcoin.P2trAddress(program: key, networkType: scanData.network).address,
// index: 0,
// isHidden: true,
// isUsed: true,
// silentAddressLabel: null,
// silentPaymentTweak: tweak,
// type: bitcoin.AddressType.p2tr,
// ),
// txid,
// outpoint.value!,
// outpoint.index,
// silentPaymentTweak: tweak,
// type: bitcoin.AddressType.p2tr,
// );
// final script = (output["scriptpubkey"] as String).fromHex;
// // found utxo for tx, send unspent coin to main isolate
// scanData.sendPort.send(unspent);
// // final alreadySpentOutput = (await electrumClient.getHistory(
// // scriptHashFromScript(script, networkType: scanData.networkType)))
// // .length >
// // 1;
// // also send tx data for tx history
// txInfo.unspent = unspent;
// scanData.sendPort.send({txid: txInfo});
// });
} catch (_) {}
}
// // if (alreadySpentOutput) {
// // print("Skipping, invalid witness");
// // break;
// // }
// Finished scanning block, add 1 to height and continue to next block in loop
syncHeight += 1;
currentChainTip = await getNodeHeightOrUpdate(syncHeight);
scanData.sendPort.send(SyncResponse(syncHeight,
SyncingSyncStatus.fromHeightValues(currentChainTip, initialSyncHeight, syncHeight)));
} catch (e, stacktrace) {
print(stacktrace);
print(e.toString());
// final p2tr = bitcoin.P2trAddress(
// program: script.sublist(2).hex, networkType: scanData.networkType);
// final address = p2tr.address;
// print(["Verifying taproot address:", address]);
// outpointsByP2TRpubkey[script.sublist(2).hex] =
// bitcoin.Outpoint(txid: txid, index: i, value: output["value"] as int);
// }
// if (pubkeys.isEmpty || outpoints.isEmpty || outpointsByP2TRpubkey.isEmpty) {
// // skipped tx, continue to next tx
// continue;
// }
// final outpointHash = bitcoin.SilentPayment.hashOutpoints(outpoints);
// final result = bitcoin.scanOutputs(
// scanData.primarySilentAddress.scanPrivkey,
// scanData.primarySilentAddress.spendPubkey,
// bitcoin.getSumInputPubKeys(pubkeys),
// outpointHash,
// outpointsByP2TRpubkey.keys.map((e) => e.fromHex).toList(),
// labels: scanData.labels,
// );
// if (result.isEmpty) {
// // no results tx, continue to next tx
// continue;
// }
// if (result.length > 1) {
// print("MULTIPLE UNSPENT COINS FOUND!");
// } else {
// print("UNSPENT COIN FOUND!");
// }
// result.forEach((key, value) async {
// final outpoint = outpointsByP2TRpubkey[key];
// if (outpoint == null) {
// return;
// }
// final tweak = value[0];
// String? label;
// if (value.length > 1) label = value[1];
// final txInfo = ElectrumTransactionInfo(
// WalletType.bitcoin,
// id: txid,
// height: syncHeight,
// amount: outpoint.value!,
// fee: 0,
// direction: TransactionDirection.incoming,
// isPending: false,
// date: DateTime.fromMillisecondsSinceEpoch((blockJson["timestamp"] as int) * 1000),
// confirmations: currentChainTip - syncHeight,
// to: bitcoin.SilentPaymentAddress.createLabeledSilentPaymentAddress(
// scanData.primarySilentAddress.scanPubkey,
// scanData.primarySilentAddress.spendPubkey,
// label != null ? label.fromHex : "0".fromHex,
// hrp: scanData.primarySilentAddress.hrp,
// version: scanData.primarySilentAddress.version)
// .toString(),
// unspent: null,
// );
// final status = json.decode((await http
// .get(Uri.parse("https://blockstream.info/testnet/api/tx/$txid/outspends")))
// .body) as List<dynamic>;
// bool spent = false;
// for (final s in status) {
// if ((s["spent"] as bool) == true) {
// spent = true;
// scanData.sendPort.send({txid: txInfo});
// final sentTxId = s["txid"] as String;
// final sentTx = json.decode((await http
// .get(Uri.parse("https://blockstream.info/testnet/api/tx/$sentTxId")))
// .body);
// int amount = 0;
// for (final out in (sentTx["vout"] as List<dynamic>)) {
// amount += out["value"] as int;
// }
// final height = s["status"]["block_height"] as int;
// scanData.sendPort.send({
// sentTxId: ElectrumTransactionInfo(
// WalletType.bitcoin,
// id: sentTxId,
// height: height,
// amount: amount,
// fee: 0,
// direction: TransactionDirection.outgoing,
// isPending: false,
// date: DateTime.fromMillisecondsSinceEpoch(
// (s["status"]["block_time"] as int) * 1000),
// confirmations: currentChainTip - height,
// )
// });
// }
// }
// if (spent) {
// return;
// }
// final unspent = BitcoinUnspent(
// BitcoinAddressRecord(
// bitcoin.P2trAddress(program: key, networkType: scanData.networkType).address,
// index: 0,
// isHidden: true,
// isUsed: true,
// silentAddressLabel: null,
// silentPaymentTweak: tweak,
// type: bitcoin.AddressType.p2tr,
// ),
// txid,
// outpoint.value!,
// outpoint.index,
// silentPaymentTweak: tweak,
// type: bitcoin.AddressType.p2tr,
// );
// // found utxo for tx, send unspent coin to main isolate
// scanData.sendPort.send(unspent);
// // also send tx data for tx history
// txInfo.unspent = unspent;
// scanData.sendPort.send({txid: txInfo});
// });
// } catch (_) {}
// }
// // Finished scanning batch of txs in block, add 25 to start index and continue to next block in loop
// startIndex += 25;
// }
// // Finished scanning block, add 1 to height and continue to next block in loop
// syncHeight += 1;
// currentChainTip = await getNodeHeightOrUpdate(syncHeight);
// scanData.sendPort.send(SyncResponse(syncHeight,
// SyncingSyncStatus.fromHeightValues(currentChainTip, initialSyncHeight, syncHeight)));
// }
// } catch (e, stacktrace) {
// print(stacktrace);
// print(e.toString());
// scanData.sendPort.send(SyncResponse(syncHeight, NotConnectedSyncStatus()));
// break;
// }
// }
// }
scanData.sendPort.send(SyncResponse(syncHeight, NotConnectedSyncStatus()));
break;
}
}
}
class EstimatedTxResult {
EstimatedTxResult(

View file

@ -243,7 +243,7 @@ abstract class ElectrumWalletAddressesBase extends WalletAddresses with Store {
for (int i = 0; i < silentAddresses.length; i++) {
final silentAddressRecord = silentAddresses[i];
final silentAddress =
SilentPaymentDestination.fromAddress(silentAddressRecord.address, 0).spendPubkey.toHex();
SilentPaymentDestination.fromAddress(silentAddressRecord.address, 0).B_spend.toHex();
if (silentAddressRecord.silentPaymentTweak != null)
labels[silentAddress] = silentAddressRecord.silentPaymentTweak!;
@ -259,7 +259,7 @@ abstract class ElectrumWalletAddressesBase extends WalletAddresses with Store {
final address = BitcoinAddressRecord(
SilentPaymentAddress.createLabeledSilentPaymentAddress(
primarySilentAddress!.scanPubkey, primarySilentAddress!.spendPubkey, tweak,
primarySilentAddress!.B_scan, primarySilentAddress!.B_spend, tweak,
hrp: primarySilentAddress!.hrp, version: primarySilentAddress!.version)
.toString(),
index: currentSilentAddressIndex,

View file

@ -44,7 +44,6 @@ abstract class LitecoinWalletBase extends ElectrumWallet with Store {
currency: CryptoCurrency.ltc) {
walletAddresses = LitecoinWalletAddresses(
walletInfo,
electrumClient: electrumClient,
initialAddresses: initialAddresses,
initialRegularAddressIndex: initialRegularAddressIndex,
initialChangeAddressIndex: initialChangeAddressIndex,

View file

@ -15,7 +15,6 @@ abstract class LitecoinWalletAddressesBase extends ElectrumWalletAddresses with
required super.mainHd,
required super.sideHd,
required super.network,
required super.electrumClient,
super.initialAddresses,
super.initialRegularAddressIndex,
super.initialChangeAddressIndex,

View file

@ -34,6 +34,10 @@ dependencies:
git:
url: https://github.com/cake-tech/bitcoin_base.git
ref: cake-update-v2
blockchain_utils:
git:
url: https://github.com/rafael-xmr/blockchain_utils
ref: cake-update-v1
dev_dependencies:
flutter_test:

View file

@ -51,7 +51,6 @@ abstract class BitcoinCashWalletBase extends ElectrumWallet with Store {
currency: CryptoCurrency.bch) {
walletAddresses = BitcoinCashWalletAddresses(
walletInfo,
electrumClient: electrumClient,
initialAddresses: initialAddresses,
initialRegularAddressIndex: initialRegularAddressIndex,
initialChangeAddressIndex: initialChangeAddressIndex,

View file

@ -15,7 +15,6 @@ abstract class BitcoinCashWalletAddressesBase extends ElectrumWalletAddresses wi
required super.mainHd,
required super.sideHd,
required super.network,
required super.electrumClient,
super.initialAddresses,
super.initialRegularAddressIndex,
super.initialChangeAddressIndex,

View file

@ -33,8 +33,10 @@ dependencies:
git:
url: https://github.com/cake-tech/bitcoin_base.git
ref: cake-update-v2
blockchain_utils:
git:
url: https://github.com/rafael-xmr/blockchain_utils
ref: cake-update-v1
dev_dependencies:
flutter_test:

View file

@ -186,6 +186,12 @@ class CWBitcoin extends Bitcoin {
return BitcoinReceivePageOption.fromType(bitcoinWallet.walletAddresses.addressPageType);
}
@override
bool hasSelectedSilentPayments(Object wallet) {
final bitcoinWallet = wallet as ElectrumWallet;
return bitcoinWallet.walletAddresses.addressPageType == SilentPaymentsAddresType.p2sp;
}
@override
List<BitcoinReceivePageOption> getBitcoinReceivePageOptions() => BitcoinReceivePageOption.all;

View file

@ -26,7 +26,7 @@ class AddressValidator extends TextValidator {
return '^[0-9a-zA-Z]{59}\$|^[0-9a-zA-Z]{92}\$|^[0-9a-zA-Z]{104}\$'
'|^[0-9a-zA-Z]{105}\$|^addr1[0-9a-zA-Z]{98}\$';
case CryptoCurrency.btc:
return '^${P2pkhAddress.regex.pattern}\$|^${P2shAddress.regex.pattern}\$|^${P2wpkhAddress.regex.pattern}\$|${P2trAddress.regex.pattern}\$|^${P2wshAddress.regex.pattern}\$|^${bitcoin.SilentPaymentAddress.REGEX.pattern}\$';
return '^${P2pkhAddress.regex.pattern}\$|^${P2shAddress.regex.pattern}\$|^${P2wpkhAddress.regex.pattern}\$|${P2trAddress.regex.pattern}\$|^${P2wshAddress.regex.pattern}\$|^${SilentPaymentAddress.regex.pattern}\$';
case CryptoCurrency.nano:
return '[0-9a-zA-Z_]';
case CryptoCurrency.banano:
@ -275,7 +275,7 @@ class AddressValidator extends TextValidator {
'([^0-9a-zA-Z]|^)${P2wpkhAddress.regex.pattern}|\$)'
'([^0-9a-zA-Z]|^)${P2wshAddress.regex.pattern}|\$)'
'([^0-9a-zA-Z]|^)${P2trAddress.regex.pattern}|\$)'
'|${bitcoin.SilentPaymentAddress.REGEX.pattern}\$';
'|${SilentPaymentAddress.regex.pattern}\$';
case CryptoCurrency.ltc:
return '([^0-9a-zA-Z]|^)^L[a-zA-Z0-9]{26,33}([^0-9a-zA-Z]|\$)'
'|([^0-9a-zA-Z]|^)[LM][a-km-zA-HJ-NP-Z1-9]{26,33}([^0-9a-zA-Z]|\$)'

View file

@ -4,7 +4,7 @@ import 'package:cw_core/sync_status.dart';
String syncStatusTitle(SyncStatus syncStatus) {
if (syncStatus is SyncingSyncStatus) {
return syncStatus.blocksLeft == 1
? S.current.Block_remaining('${syncStatus.blocksLeft}')
? S.current.block_remaining
: S.current.Blocks_remaining('${syncStatus.blocksLeft}');
}

View file

@ -199,6 +199,11 @@ class AddressPage extends BasePage {
}
reaction((_) => receiveOptionViewModel.selectedReceiveOption, (ReceivePageOption option) {
if (option is BitcoinReceivePageOption) {
addressListViewModel.setAddressType(option.toType());
return;
}
switch (option) {
case ReceivePageOption.anonPayInvoice:
Navigator.pushNamed(

View file

@ -45,7 +45,7 @@ class PresentReceiveOptionPicker extends StatelessWidget {
fontSize: 18.0, fontWeight: FontWeight.bold, fontFamily: 'Lato', color: color),
),
Observer(
builder: (_) => Text(describeOption(receiveOptionViewModel.selectedReceiveOption),
builder: (_) => Text(receiveOptionViewModel.selectedReceiveOption.toString(),
style: TextStyle(fontSize: 10.0, fontWeight: FontWeight.w500, color: color)))
],
),
@ -101,7 +101,7 @@ class PresentReceiveOptionPicker extends StatelessWidget {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(describeOption(option),
Text(option.toString(),
textAlign: TextAlign.left,
style: textSmall(
color: Theme.of(context)

View file

@ -13,8 +13,7 @@ class AddressEditOrCreatePage extends BasePage {
: _formKey = GlobalKey<FormState>(),
_labelController = TextEditingController(),
super() {
_labelController.addListener(
() => addressEditOrCreateViewModel.label = _labelController.text);
_labelController.addListener(() => addressEditOrCreateViewModel.label = _labelController.text);
_labelController.text = addressEditOrCreateViewModel.label;
}
@ -55,10 +54,8 @@ class AddressEditOrCreatePage extends BasePage {
: S.of(context).new_subaddress_create,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
isLoading:
addressEditOrCreateViewModel.state is AddressIsSaving,
isDisabled:
addressEditOrCreateViewModel.label?.isEmpty ?? true,
isLoading: addressEditOrCreateViewModel.state is AddressIsSaving,
isDisabled: addressEditOrCreateViewModel.label?.isEmpty ?? true,
),
)
],
@ -70,14 +67,13 @@ class AddressEditOrCreatePage extends BasePage {
if (_isEffectsInstalled) {
return;
}
reaction((_) => addressEditOrCreateViewModel.state,
(AddressEditOrCreateState state) {
if (state is AddressSavedSuccessfully) {
WidgetsBinding.instance
.addPostFrameCallback((_) => Navigator.of(context).pop());
}
});
reaction((_) => addressEditOrCreateViewModel.state, (AddressEditOrCreateState state) {
if (state is AddressSavedSuccessfully) {
WidgetsBinding.instance.addPostFrameCallback((_) => Navigator.of(context).pop());
}
});
_isEffectsInstalled = true;
}
}
}

View file

@ -42,7 +42,7 @@ import 'package:cw_core/wallet_type.dart';
import 'package:eth_sig_util/util/utils.dart';
import 'package:flutter/services.dart';
import 'package:mobx/mobx.dart';
import 'package:cake_wallet/entities/provider_types.dart';
import 'package:cake_wallet/bitcoin/bitcoin.dart';
part 'dashboard_view_model.g.dart';
@ -277,12 +277,10 @@ abstract class DashboardViewModelBase with Store {
@observable
WalletBase<Balance, TransactionHistoryBase<TransactionInfo>, TransactionInfo> wallet;
bool get hasRescan => wallet.type == WalletType.monero || wallet.type == WalletType.haven;
// bool get hasRescan =>
// (wallet.type == WalletType.bitcoin &&
// wallet.walletAddresses.addressPageType == bitcoin.AddressType.p2sp) ||
// wallet.type == WalletType.monero ||
// wallet.type == WalletType.haven;
bool get hasRescan =>
(wallet.type == WalletType.bitcoin && bitcoin!.hasSelectedSilentPayments(wallet)) ||
wallet.type == WalletType.monero ||
wallet.type == WalletType.haven;
final KeyService keyService;
@ -344,15 +342,13 @@ abstract class DashboardViewModelBase with Store {
bool hasExchangeAction;
@computed
bool get isEnabledBuyAction =>
!settingsStore.disableBuy && availableBuyProviders.isNotEmpty;
bool get isEnabledBuyAction => !settingsStore.disableBuy && availableBuyProviders.isNotEmpty;
@observable
bool hasBuyAction;
@computed
bool get isEnabledSellAction =>
!settingsStore.disableSell && availableSellProviders.isNotEmpty;
bool get isEnabledSellAction => !settingsStore.disableSell && availableSellProviders.isNotEmpty;
@observable
bool hasSellAction;
@ -477,7 +473,8 @@ abstract class DashboardViewModelBase with Store {
Future<List<String>> checkAffectedWallets() async {
// await load file
final vulnerableSeedsString = await rootBundle.loadString('assets/text/cakewallet_weak_bitcoin_seeds_hashed_sorted_version1.txt');
final vulnerableSeedsString = await rootBundle
.loadString('assets/text/cakewallet_weak_bitcoin_seeds_hashed_sorted_version1.txt');
final vulnerableSeeds = vulnerableSeedsString.split("\n");
final walletInfoSource = await CakeHive.openBox<WalletInfo>(WalletInfo.boxName);

View file

@ -410,8 +410,9 @@ abstract class WalletAddressListViewModelBase extends WalletChangeListenerViewMo
wallet.type == WalletType.bitcoinCash;
@computed
bool get isAutoGenerateSubaddressEnabled =>
_settingsStore.autoGenerateSubaddressStatus != AutoGenerateSubaddressStatus.disabled;
bool get isAutoGenerateSubaddressEnabled => wallet.type == WalletType.bitcoin
? !bitcoin!.hasSelectedSilentPayments(wallet)
: _settingsStore.autoGenerateSubaddressStatus != AutoGenerateSubaddressStatus.disabled;
List<ListItem> _baseItems;

View file

@ -75,6 +75,7 @@
"bitcoin_dark_theme": "موضوع البيتكوين الظلام",
"bitcoin_light_theme": "موضوع البيتكوين الخفيفة",
"bitcoin_payments_require_1_confirmation": "تتطلب مدفوعات Bitcoin تأكيدًا واحدًا ، والذي قد يستغرق 20 دقيقة أو أكثر. شكرا لصبرك! سيتم إرسال بريد إلكتروني إليك عند تأكيد الدفع.",
"block_remaining": "1 كتلة متبقية",
"Blocks_remaining": "بلوك متبقي ${status}",
"bright_theme": "مشرق",
"buy": "اشتري",

View file

@ -75,6 +75,7 @@
"bitcoin_dark_theme": "Тъмна тема за биткойн",
"bitcoin_light_theme": "Лека биткойн тема",
"bitcoin_payments_require_1_confirmation": "Плащанията с Bitcoin изискват потвърждение, което може да отнеме 20 минути или повече. Благодарим за търпението! Ще получите имейл, когато плащането е потвърдено.",
"block_remaining": "1 блок останал",
"Blocks_remaining": "${status} оставащи блока",
"bright_theme": "Ярко",
"buy": "Купуване",

View file

@ -75,6 +75,7 @@
"bitcoin_dark_theme": "Tmavé téma bitcoinů",
"bitcoin_light_theme": "Světlé téma bitcoinů",
"bitcoin_payments_require_1_confirmation": "U plateb Bitcoinem je vyžadováno alespoň 1 potvrzení, což může trvat 20 minut i déle. Děkujeme za vaši trpělivost! Až bude platba potvrzena, budete informováni e-mailem.",
"block_remaining": "1 blok zbývající",
"Blocks_remaining": "Zbývá ${status} bloků",
"bright_theme": "Jasný",
"buy": "Koupit",

View file

@ -75,6 +75,7 @@
"bitcoin_dark_theme": "Dunkles Bitcoin-Thema",
"bitcoin_light_theme": "Bitcoin Light-Thema",
"bitcoin_payments_require_1_confirmation": "Bitcoin-Zahlungen erfordern 1 Bestätigung, was 20 Minuten oder länger dauern kann. Danke für Ihre Geduld! Sie erhalten eine E-Mail, wenn die Zahlung bestätigt ist.",
"block_remaining": "1 Block verbleibend",
"Blocks_remaining": "${status} verbleibende Blöcke",
"bright_theme": "Strahlend hell",
"buy": "Kaufen",

View file

@ -75,6 +75,7 @@
"bitcoin_dark_theme": "Bitcoin Dark Theme",
"bitcoin_light_theme": "Bitcoin Light Theme",
"bitcoin_payments_require_1_confirmation": "Bitcoin payments require 1 confirmation, which can take 20 minutes or longer. Thanks for your patience! You will be emailed when the payment is confirmed.",
"block_remaining": "1 Block Remaining",
"Blocks_remaining": "${status} Blocks Remaining",
"bright_theme": "Bright",
"buy": "Buy",

View file

@ -75,6 +75,7 @@
"bitcoin_dark_theme": "Tema oscuro de Bitcoin",
"bitcoin_light_theme": "Tema de la luz de Bitcoin",
"bitcoin_payments_require_1_confirmation": "Los pagos de Bitcoin requieren 1 confirmación, que puede demorar 20 minutos o más. ¡Gracias por su paciencia! Se le enviará un correo electrónico cuando se confirme el pago.",
"block_remaining": "1 bloqueo restante",
"Blocks_remaining": "${status} Bloques restantes",
"bright_theme": "Brillante",
"buy": "Comprar",

View file

@ -75,6 +75,7 @@
"bitcoin_dark_theme": "Thème sombre Bitcoin",
"bitcoin_light_theme": "Thème léger Bitcoin",
"bitcoin_payments_require_1_confirmation": "Les paiements Bitcoin nécessitent 1 confirmation, ce qui peut prendre 20 minutes ou plus. Merci pour votre patience ! Vous serez averti par e-mail lorsque le paiement sera confirmé.",
"block_remaining": "1 bloc restant",
"Blocks_remaining": "Blocs Restants : ${status}",
"bright_theme": "Vif",
"buy": "Acheter",

View file

@ -75,6 +75,7 @@
"bitcoin_dark_theme": "Bitcoin Dark Jigo",
"bitcoin_light_theme": "Jigon Hasken Bitcoin",
"bitcoin_payments_require_1_confirmation": "Akwatin Bitcoin na buɗe 1 sambumbu, da yake za ta samu mintuna 20 ko yawa. Ina kira ga sabuwar lafiya! Zaka sanarwa ta email lokacin da aka samu akwatin samun lambar waya.",
"block_remaining": "1 toshe ragowar",
"Blocks_remaining": "${status} Katanga ya rage",
"bright_theme": "Mai haske",
"buy": "Sayi",

View file

@ -75,6 +75,7 @@
"bitcoin_dark_theme": "बिटकॉइन डार्क थीम",
"bitcoin_light_theme": "बिटकॉइन लाइट थीम",
"bitcoin_payments_require_1_confirmation": "बिटकॉइन भुगतान के लिए 1 पुष्टिकरण की आवश्यकता होती है, जिसमें 20 मिनट या अधिक समय लग सकता है। आपके धैर्य के लिए धन्यवाद! भुगतान की पुष्टि होने पर आपको ईमेल किया जाएगा।",
"block_remaining": "1 ब्लॉक शेष",
"Blocks_remaining": "${status} शेष रहते हैं",
"bright_theme": "उज्ज्वल",
"buy": "खरीदें",

View file

@ -75,6 +75,7 @@
"bitcoin_dark_theme": "Bitcoin Tamna tema",
"bitcoin_light_theme": "Bitcoin Light Theme",
"bitcoin_payments_require_1_confirmation": "Bitcoin plaćanja zahtijevaju 1 potvrdu, što može potrajati 20 minuta ili dulje. Hvala na Vašem strpljenju! Dobit ćete e-poruku kada plaćanje bude potvrđeno.",
"block_remaining": "Preostalo 1 blok",
"Blocks_remaining": "${status} preostalih blokova",
"bright_theme": "Jarka",
"buy": "Kupi",

View file

@ -75,6 +75,7 @@
"bitcoin_dark_theme": "Tema Gelap Bitcoin",
"bitcoin_light_theme": "Tema Cahaya Bitcoin",
"bitcoin_payments_require_1_confirmation": "Pembayaran Bitcoin memerlukan 1 konfirmasi, yang bisa memakan waktu 20 menit atau lebih. Terima kasih atas kesabaran Anda! Anda akan diemail saat pembayaran dikonfirmasi.",
"block_remaining": "1 blok tersisa",
"Blocks_remaining": "${status} Blok Tersisa",
"bright_theme": "Cerah",
"buy": "Beli",

View file

@ -75,6 +75,7 @@
"bitcoin_dark_theme": "Tema oscuro di Bitcoin",
"bitcoin_light_theme": "Tema luce Bitcoin",
"bitcoin_payments_require_1_confirmation": "I pagamenti in bitcoin richiedono 1 conferma, che può richiedere 20 minuti o più. Grazie per la vostra pazienza! Riceverai un'e-mail quando il pagamento sarà confermato.",
"block_remaining": "1 blocco rimanente",
"Blocks_remaining": "${status} Blocchi Rimanenti",
"bright_theme": "Colorato",
"buy": "Comprare",

View file

@ -75,6 +75,7 @@
"bitcoin_dark_theme": "ビットコインダークテーマ",
"bitcoin_light_theme": "ビットコインライトテーマ",
"bitcoin_payments_require_1_confirmation": "ビットコインの支払いには 1 回の確認が必要で、これには 20 分以上かかる場合があります。お待ち頂きまして、ありがとうございます!支払いが確認されると、メールが送信されます。",
"block_remaining": "残り1ブロック",
"Blocks_remaining": "${status} 残りのブロック",
"bright_theme": "明るい",
"buy": "購入",

View file

@ -75,6 +75,7 @@
"bitcoin_dark_theme": "비트코인 다크 테마",
"bitcoin_light_theme": "비트코인 라이트 테마",
"bitcoin_payments_require_1_confirmation": "비트코인 결제는 1번의 확인이 필요하며 20분 이상이 소요될 수 있습니다. 기다려 주셔서 감사합니다! 결제가 확인되면 이메일이 전송됩니다.",
"block_remaining": "남은 블록 1 개",
"Blocks_remaining": "${status} 남은 블록",
"bright_theme": "선명한",
"buy": "구입",

View file

@ -75,6 +75,7 @@
"bitcoin_dark_theme": "Bitcoin Dark Theme",
"bitcoin_light_theme": "Bitcoin Light အပြင်အဆင်",
"bitcoin_payments_require_1_confirmation": "Bitcoin ငွေပေးချေမှုများသည် မိနစ် 20 သို့မဟုတ် ထို့ထက်ပိုကြာနိုင်သည် 1 အတည်ပြုချက် လိုအပ်သည်။ မင်းရဲ့စိတ်ရှည်မှုအတွက် ကျေးဇူးတင်ပါတယ်။ ငွေပေးချေမှုကို အတည်ပြုပြီးသောအခါ သင့်ထံ အီးမေးလ်ပို့ပါမည်။",
"block_remaining": "ကျန်ရှိနေသေးသော block",
"Blocks_remaining": "${status} ဘလောက်များ ကျန်နေပါသည်။",
"bright_theme": "တောက်ပ",
"buy": "ဝယ်ပါ။",

View file

@ -75,6 +75,7 @@
"bitcoin_dark_theme": "Bitcoin donker thema",
"bitcoin_light_theme": "Bitcoin Light-thema",
"bitcoin_payments_require_1_confirmation": "Bitcoin-betalingen vereisen 1 bevestiging, wat 20 minuten of langer kan duren. Dank voor uw geduld! U ontvangt een e-mail wanneer de betaling is bevestigd.",
"block_remaining": "1 blok resterend",
"Blocks_remaining": "${status} Resterende blokken",
"bright_theme": "Helder",
"buy": "Kopen",

View file

@ -75,6 +75,7 @@
"bitcoin_dark_theme": "Ciemny motyw Bitcoina",
"bitcoin_light_theme": "Lekki motyw Bitcoin",
"bitcoin_payments_require_1_confirmation": "Płatności Bitcoin wymagają 1 potwierdzenia, co może zająć 20 minut lub dłużej. Dziękuję za cierpliwość! Otrzymasz wiadomość e-mail, gdy płatność zostanie potwierdzona.",
"block_remaining": "1 blok pozostałym",
"Blocks_remaining": "Pozostało ${status} bloków",
"bright_theme": "Biały",
"buy": "Kup",

View file

@ -75,6 +75,7 @@
"bitcoin_dark_theme": "Tema escuro Bitcoin",
"bitcoin_light_theme": "Tema claro de bitcoin",
"bitcoin_payments_require_1_confirmation": "Os pagamentos em Bitcoin exigem 1 confirmação, o que pode levar 20 minutos ou mais. Obrigado pela sua paciência! Você receberá um e-mail quando o pagamento for confirmado.",
"block_remaining": "1 bloco restante",
"Blocks_remaining": "${status} blocos restantes",
"bright_theme": "Brilhante",
"buy": "Comprar",

View file

@ -75,6 +75,7 @@
"bitcoin_dark_theme": "Биткойн Темная тема",
"bitcoin_light_theme": "Легкая биткойн-тема",
"bitcoin_payments_require_1_confirmation": "Биткойн-платежи требуют 1 подтверждения, что может занять 20 минут или дольше. Спасибо тебе за твое терпение! Вы получите электронное письмо, когда платеж будет подтвержден.",
"block_remaining": "1 Блок остался",
"Blocks_remaining": "${status} Осталось блоков",
"bright_theme": "Яркая",
"buy": "Купить",

View file

@ -75,6 +75,7 @@
"bitcoin_dark_theme": "ธีมมืด Bitcoin",
"bitcoin_light_theme": "ธีมแสง Bitcoin",
"bitcoin_payments_require_1_confirmation": "การชำระเงินด้วย Bitcoin ต้องการการยืนยัน 1 ครั้ง ซึ่งอาจใช้เวลา 20 นาทีหรือนานกว่านั้น ขอบคุณสำหรับความอดทนของคุณ! คุณจะได้รับอีเมลเมื่อการชำระเงินได้รับการยืนยัน",
"block_remaining": "เหลือ 1 บล็อก",
"Blocks_remaining": "${status} บล็อกที่เหลืออยู่",
"bright_theme": "สดใส",
"buy": "ซื้อ",

View file

@ -75,6 +75,7 @@
"bitcoin_dark_theme": "Bitcoin Madilim na Tema",
"bitcoin_light_theme": "Tema ng ilaw ng bitcoin",
"bitcoin_payments_require_1_confirmation": "Ang mga pagbabayad sa Bitcoin ay nangangailangan ng 1 kumpirmasyon, na maaaring tumagal ng 20 minuto o mas mahaba. Salamat sa iyong pasensya! Mag -email ka kapag nakumpirma ang pagbabayad.",
"block_remaining": "1 bloke ang natitira",
"Blocks_remaining": "Ang natitirang ${status} ay natitira",
"bright_theme": "Maliwanag",
"buy": "Bilhin",

View file

@ -75,6 +75,7 @@
"bitcoin_dark_theme": "Bitcoin Karanlık Teması",
"bitcoin_light_theme": "Bitcoin Hafif Tema",
"bitcoin_payments_require_1_confirmation": "Bitcoin ödemeleri, 20 dakika veya daha uzun sürebilen 1 onay gerektirir. Sabrınız için teşekkürler! Ödeme onaylandığında e-posta ile bilgilendirileceksiniz.",
"block_remaining": "Kalan 1 blok",
"Blocks_remaining": "${status} Blok Kaldı",
"bright_theme": "Parlak",
"buy": "Alış",

View file

@ -75,6 +75,7 @@
"bitcoin_dark_theme": "Темна тема Bitcoin",
"bitcoin_light_theme": "Світла тема Bitcoin",
"bitcoin_payments_require_1_confirmation": "Платежі Bitcoin потребують 1 підтвердження, яке може зайняти 20 хвилин або більше. Дякую за Ваше терпіння! Ви отримаєте електронний лист, коли платіж буде підтверджено.",
"block_remaining": "1 блок, що залишився",
"Blocks_remaining": "${status} Залишилось блоків",
"bright_theme": "Яскрава",
"buy": "Купити",

View file

@ -75,6 +75,7 @@
"bitcoin_dark_theme": "بٹ کوائن ڈارک تھیم",
"bitcoin_light_theme": "بٹ کوائن لائٹ تھیم",
"bitcoin_payments_require_1_confirmation": "بٹ کوائن کی ادائیگی میں 1 تصدیق کی ضرورت ہوتی ہے ، جس میں 20 منٹ یا اس سے زیادہ وقت لگ سکتا ہے۔ آپ کے صبر کا شکریہ! ادائیگی کی تصدیق ہونے پر آپ کو ای میل کیا جائے گا۔",
"block_remaining": "1 بلاک باقی",
"Blocks_remaining": "${status} بلاکس باقی ہیں۔",
"bright_theme": "روشن",
"buy": "خریدنے",

View file

@ -75,6 +75,7 @@
"bitcoin_dark_theme": "Bitcoin Dark Akori",
"bitcoin_light_theme": "Bitcoin Light Akori",
"bitcoin_payments_require_1_confirmation": "Àwọn àránṣẹ́ Bitcoin nílò ìjẹ́rìísí kan. Ó lè lo ìṣéjú ogun tàbí ìṣéjú jù. A dúpẹ́ fún sùúrù yín! Ẹ máa gba ímeèlì t'ó bá jẹ́rìísí àránṣẹ́ náà.",
"block_remaining": "1 bulọọki to ku",
"Blocks_remaining": "Àkójọpọ̀ ${status} kikù",
"bright_theme": "Funfun",
"buy": "Rà",

View file

@ -75,6 +75,7 @@
"bitcoin_dark_theme": "比特币黑暗主题",
"bitcoin_light_theme": "比特币浅色主题",
"bitcoin_payments_require_1_confirmation": "比特币支付需要 1 次确认,这可能需要 20 分钟或更长时间。谢谢你的耐心!确认付款后,您将收到电子邮件。",
"block_remaining": "剩下1个块",
"Blocks_remaining": "${status} 剩余的块",
"bright_theme": "明亮",
"buy": "购买",

View file

@ -145,6 +145,7 @@ abstract class Bitcoin {
Future<void> setAddressType(Object wallet, dynamic option);
BitcoinReceivePageOption getSelectedAddressType(Object wallet);
bool hasSelectedSilentPayments(Object wallet);
List<BitcoinReceivePageOption> getBitcoinReceivePageOptions();
}
""";