From f7a88d045e3b4cbf1ce11ff749941e3ec517cb73 Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Tue, 16 Aug 2022 10:07:53 -0500 Subject: [PATCH] v1.8.3 --- bin/printversion.ps1 | 2 +- bin/printversion.sh | 2 +- native/Cargo.lock | 2 +- native/Cargo.toml | 2 +- package.json | 2 +- src/components/Send.tsx | 40 +++++++++++++++++++++++++++++++++++++- src/components/Sidebar.tsx | 2 +- src/utils/utils.ts | 2 +- 8 files changed, 46 insertions(+), 8 deletions(-) diff --git a/bin/printversion.ps1 b/bin/printversion.ps1 index 12538485..a2d094ed 100644 --- a/bin/printversion.ps1 +++ b/bin/printversion.ps1 @@ -1 +1 @@ -echo "VERSION=1.8.0-beta3" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append +echo "VERSION=1.8.3" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append diff --git a/bin/printversion.sh b/bin/printversion.sh index 8037e966..ae936fdd 100755 --- a/bin/printversion.sh +++ b/bin/printversion.sh @@ -1,3 +1,3 @@ #!/bin/bash -VERSION="1.8.0-beta3" +VERSION="1.8.3" echo "VERSION=$VERSION" >> $GITHUB_ENV diff --git a/native/Cargo.lock b/native/Cargo.lock index ff61c053..c8ba8530 100644 --- a/native/Cargo.lock +++ b/native/Cargo.lock @@ -3099,7 +3099,7 @@ dependencies = [ [[package]] name = "zecwalletlitelib" version = "0.1.0" -source = "git+https://github.com/adityapk00/zecwallet-light-cli?rev=8d9faccafe0056ad9b5f4e2a64dbba10ba6aeb17#8d9faccafe0056ad9b5f4e2a64dbba10ba6aeb17" +source = "git+https://github.com/adityapk00/zecwallet-light-cli?rev=656f48980cbb7389d38cb616ed327563a11f81dd#656f48980cbb7389d38cb616ed327563a11f81dd" dependencies = [ "arr_macro", "base58", diff --git a/native/Cargo.toml b/native/Cargo.toml index c4fe6a64..c8e0e7c3 100644 --- a/native/Cargo.toml +++ b/native/Cargo.toml @@ -15,7 +15,7 @@ default-features = false features = ["napi-6"] [dependencies] -zecwalletlitelib = { git = "https://github.com/adityapk00/zecwallet-light-cli", rev = "8d9faccafe0056ad9b5f4e2a64dbba10ba6aeb17" } +zecwalletlitelib = { git = "https://github.com/adityapk00/zecwallet-light-cli", rev = "656f48980cbb7389d38cb616ed327563a11f81dd" } #zecwalletlitelib = { path = "../../zecwallet-light-cli/lib" } lazy_static = "1.4.0" diff --git a/package.json b/package.json index 4d576f60..85737e75 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "zecwallet-lite", "productName": "Zecwallet Lite", - "version": "1.8.0-beta3", + "version": "1.8.3", "private": true, "description": "Zecwallet Lite", "license": "MIT", diff --git a/src/components/Send.tsx b/src/components/Send.tsx index a4861de7..22e39a8d 100644 --- a/src/components/Send.tsx +++ b/src/components/Send.tsx @@ -233,7 +233,7 @@ const ConfirmModalToAddr = ({ toaddr, info }: ConfirmModalToAddrProps) => { return (
-
+
{Utils.splitStringIntoChunks(toaddr.to, 6).join(" ")}
@@ -257,6 +257,7 @@ const ConfirmModalToAddr = ({ toaddr, info }: ConfirmModalToAddrProps) => { // Internal because we're using withRouter just below type ConfirmModalProps = { sendPageState: SendPageState; + totalBalance: TotalBalance; info: Info; sendTransaction: (sendJson: SendManyJson[], setSendProgress: (p?: SendProgress) => void) => Promise; clearToAddrs: () => void; @@ -268,6 +269,7 @@ type ConfirmModalProps = { const ConfirmModalInternal: React.FC = ({ sendPageState, + totalBalance, info, sendTransaction, clearToAddrs, @@ -281,6 +283,28 @@ const ConfirmModalInternal: React.FC = const sendingTotal = sendPageState.toaddrs.reduce((s, t) => s + t.amount, 0.0) + defaultFee; const { bigPart, smallPart } = Utils.splitZecAmountIntoBigSmall(sendingTotal); + // Determine the tx privacy level + let privacyLevel = ""; + // 1. If we're sending to a t-address, it is "transparent" + const isToTransparent = sendPageState.toaddrs.map((to) => Utils.isTransparent(to.to)).reduce((p, c) => p || c, false); + if (isToTransparent) { + privacyLevel = "Transparent"; + } else { + // 2. If we're sending to sapling or orchard, and don't have enough funds in the pool, it is "AmountsRevealed" + const toSapling = sendPageState.toaddrs + .map((to) => (Utils.isSapling(to.to) ? to.amount : 0)) + .reduce((s, c) => s + c, 0); + const toOrchard = sendPageState.toaddrs + .map((to) => (Utils.isUnified(to.to) ? to.amount : 0)) + .reduce((s, c) => s + c, 0); + if (toSapling > totalBalance.spendableZ || toOrchard > totalBalance.uabalance) { + privacyLevel = "AmountsRevealed"; + } else { + // Else, it is a shielded transaction + privacyLevel = "Shielded"; + } + } + const sendButton = () => { // First, close the confirm modal. closeModal(); @@ -367,6 +391,19 @@ const ConfirmModalInternal: React.FC = ))}
+ +
+
+
Privacy Level
+
+
+
+ {privacyLevel} +
+
+
+
+
@@ -640,6 +677,7 @@ export default class Send extends PureComponent { { openErrorModal( "Zecwallet Lite",
-
Zecwallet Lite v1.8.0-beta3
+
Zecwallet Lite v1.8.3
Built with Electron. Copyright (c) 2018-2022, Aditya Kulkarni.
The MIT License (MIT) Copyright (c) 2018-2022 Zecwallet diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 38e36c60..50398178 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -11,7 +11,7 @@ export default class Utils { static V2_LIGHTWALLETD: string = "https://lwdv2.zecwallet.co:1443"; // v3 LightwalletD - static V3_LIGHTWALLETD: string = "https://mainnet.lightwalletd.com:9067"; + static V3_LIGHTWALLETD: string = "https://lwdv3.zecwallet.co"; static isUnified(addr: string): boolean { if (!addr) return false;