Skip to content

Commit

Permalink
Merge branch 'main' into zano-pr
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCyjaneK authored Nov 7, 2024
2 parents 465f1de + 0fcfd76 commit 4081c51
Show file tree
Hide file tree
Showing 247 changed files with 4,723 additions and 1,264 deletions.
Binary file added assets/images/flags/abw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/flags/afg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/flags/ago.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/flags/aia.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/flags/and.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/flags/asm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/flags/atf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/flags/atg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/flags/aut.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/flags/aze.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/flags/bel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/flags/bes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/flags/bhr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/flags/blz.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/flags/bmu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/flags/bol.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/flags/brn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/flags/btn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/flags/bvt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/flags/bwa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/flags/cck.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/flags/cmr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/flags/cok.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/flags/cpv.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/flags/cri.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/flags/cuw.png
Binary file added assets/images/flags/cxr.png
Binary file added assets/images/flags/cyp.png
Binary file added assets/images/flags/dji.png
Binary file added assets/images/flags/dma.png
Binary file added assets/images/flags/dza.png
Binary file added assets/images/flags/ecu.png
Binary file added assets/images/flags/est.png
Binary file added assets/images/flags/eth.png
Binary file added assets/images/flags/fin.png
Binary file added assets/images/flags/fji.png
Binary file added assets/images/flags/flk.png
Binary file added assets/images/flags/fro.png
Binary file added assets/images/flags/fsm.png
Binary file added assets/images/flags/gab.png
Binary file added assets/images/flags/geo.png
Binary file added assets/images/flags/ggi.png
Binary file added assets/images/flags/ggy.png
Binary file added assets/images/flags/glp.png
Binary file added assets/images/flags/gmb.png
Binary file added assets/images/flags/grc.png
Binary file added assets/images/flags/grd.png
Binary file added assets/images/flags/grl.png
Binary file added assets/images/flags/guf.png
Binary file added assets/images/flags/gum.png
Binary file added assets/images/flags/guy.png
Binary file added assets/images/flags/hmd.png
Binary file added assets/images/flags/iot.png
Binary file added assets/images/flags/irl.png
Binary file added assets/images/flags/jam.png
Binary file added assets/images/flags/jey.png
Binary file added assets/images/flags/jor.png
Binary file added assets/images/flags/kaz.png
Binary file added assets/images/flags/ken.png
Binary file added assets/images/flags/kir.png
Binary file added assets/images/flags/kwt.png
Binary file added assets/images/flags/lbn.png
Binary file added assets/images/flags/lie.png
Binary file added assets/images/flags/lka.png
Binary file added assets/images/flags/ltu.png
Binary file added assets/images/flags/lux.png
Binary file added assets/images/flags/lva.png
Binary file added assets/images/flags/mco.png
Binary file added assets/images/flags/mlt.png
Binary file added assets/images/flags/mnp.png
Binary file added assets/images/flags/mrt.png
Binary file added assets/images/flags/msr.png
Binary file added assets/images/flags/mtq.png
Binary file added assets/images/flags/mwi.png
Binary file added assets/images/flags/myt.png
Binary file added assets/images/flags/ner.png
Binary file added assets/images/flags/nfk.png
Binary file added assets/images/flags/niu.png
Binary file added assets/images/flags/omn.png
Binary file added assets/images/flags/per.png
Binary file added assets/images/flags/plw.png
Binary file added assets/images/flags/pri.png
Binary file added assets/images/flags/pyf.png
Binary file added assets/images/flags/qat.png
Binary file added assets/images/flags/slb.png
Binary file added assets/images/flags/slv.png
Binary file added assets/images/flags/svk.png
Binary file added assets/images/flags/svn.png
Binary file added assets/images/flags/tkm.png
Binary file added assets/images/flags/ton.png
Binary file added assets/images/flags/tuv.png
Binary file added assets/images/flags/ury.png
Binary file added assets/images/flags/vat.png
Binary file added assets/images/flags/vir.png
Binary file added assets/images/flags/vut.png
2 changes: 2 additions & 0 deletions cw_bitcoin/lib/electrum.dart
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ class ElectrumClient {
final errorMsg = error.toString();
print(errorMsg);
unterminatedString = '';
socket = null;
},
onDone: () {
print("SOCKET CLOSED!!!!!");
Expand All @@ -132,6 +133,7 @@ class ElectrumClient {
if (host == socket?.address.host || socket == null) {
_setConnectionStatus(ConnectionStatus.disconnected);
socket?.destroy();
socket = null;
}
} catch (e) {
print("onDone: $e");
Expand Down
12 changes: 7 additions & 5 deletions cw_bitcoin/lib/electrum_balance.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ class ElectrumBalance extends Balance {
final decoded = json.decode(jsonSource) as Map;

return ElectrumBalance(
confirmed: decoded['confirmed'] as int? ?? 0,
unconfirmed: decoded['unconfirmed'] as int? ?? 0,
frozen: decoded['frozen'] as int? ?? 0);
confirmed: decoded['confirmed'] as int? ?? 0,
unconfirmed: decoded['unconfirmed'] as int? ?? 0,
frozen: decoded['frozen'] as int? ?? 0,
secondConfirmed: decoded['secondConfirmed'] as int? ?? 0,
secondUnconfirmed: decoded['secondUnconfirmed'] as int? ?? 0,
);
}

int confirmed;
Expand All @@ -36,8 +39,7 @@ class ElectrumBalance extends Balance {
int secondUnconfirmed = 0;

@override
String get formattedAvailableBalance =>
bitcoinAmountToString(amount: confirmed - frozen);
String get formattedAvailableBalance => bitcoinAmountToString(amount: confirmed - frozen);

@override
String get formattedAdditionalBalance => bitcoinAmountToString(amount: unconfirmed);
Expand Down
9 changes: 7 additions & 2 deletions cw_bitcoin/lib/electrum_transaction_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class ElectrumTransactionInfo extends TransactionInfo {
String? to,
this.unspents,
this.isReceivedSilentPayment = false,
Map<String, dynamic>? additionalInfo,
}) {
this.id = id;
this.height = height;
Expand All @@ -54,6 +55,7 @@ class ElectrumTransactionInfo extends TransactionInfo {
this.isReplaced = isReplaced;
this.confirmations = confirmations;
this.to = to;
this.additionalInfo = additionalInfo ?? {};
}

factory ElectrumTransactionInfo.fromElectrumVerbose(Map<String, Object> obj, WalletType type,
Expand Down Expand Up @@ -212,6 +214,7 @@ class ElectrumTransactionInfo extends TransactionInfo {
BitcoinSilentPaymentsUnspent.fromJSON(null, unspent as Map<String, dynamic>))
.toList(),
isReceivedSilentPayment: data['isReceivedSilentPayment'] as bool? ?? false,
additionalInfo: data['additionalInfo'] as Map<String, dynamic>?,
);
}

Expand Down Expand Up @@ -246,7 +249,8 @@ class ElectrumTransactionInfo extends TransactionInfo {
isReplaced: isReplaced ?? false,
inputAddresses: inputAddresses,
outputAddresses: outputAddresses,
confirmations: info.confirmations);
confirmations: info.confirmations,
additionalInfo: additionalInfo);
}

Map<String, dynamic> toJson() {
Expand All @@ -265,10 +269,11 @@ class ElectrumTransactionInfo extends TransactionInfo {
m['inputAddresses'] = inputAddresses;
m['outputAddresses'] = outputAddresses;
m['isReceivedSilentPayment'] = isReceivedSilentPayment;
m['additionalInfo'] = additionalInfo;
return m;
}

String toString() {
return 'ElectrumTransactionInfo(id: $id, height: $height, amount: $amount, fee: $fee, direction: $direction, date: $date, isPending: $isPending, isReplaced: $isReplaced, confirmations: $confirmations, to: $to, unspent: $unspents, inputAddresses: $inputAddresses, outputAddresses: $outputAddresses)';
return 'ElectrumTransactionInfo(id: $id, height: $height, amount: $amount, fee: $fee, direction: $direction, date: $date, isPending: $isPending, isReplaced: $isReplaced, confirmations: $confirmations, to: $to, unspent: $unspents, inputAddresses: $inputAddresses, outputAddresses: $outputAddresses, additionalInfo: $additionalInfo)';
}
}
Loading

0 comments on commit 4081c51

Please sign in to comment.