Skip to content

Commit

Permalink
v2.1.1 finalised (#502)
Browse files Browse the repository at this point in the history
* Version Bump

* Update changelog for Patch 1

* Ran `npm audit fix`

* Document the Stake/Unstake vue functions a bit

* Validate Stake amount in frontend with human-readable error

* Remove unnecessary linebreak from `VALIDATE_AMOUNT_LOW`

* Add Unlock-to-Stake fix to Changelog
  • Loading branch information
JSKitty authored Dec 15, 2024
1 parent 3f15159 commit 4be0a49
Show file tree
Hide file tree
Showing 15 changed files with 53 additions and 18 deletions.
20 changes: 20 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
# Patch 1
This patch is primarily an immediate response to a newly discovered Tx serialisation bug affecting syncing - making it impossible to sync on Firefox, research by Duddino suggests this may actually be a bug in Firefox's Gecko engine, as the bug has only been replicatable on Firefox.

Additionally, various minor fixes and improvements were added to resolve some UX issues.

We are aware of a slight degredation in 'time-to-boot' for MPW when opened in a new tab, and issues on extremely slow networks, however, this will be resolved in early 2025.

# Improvements
- Added Privacy warning on XPub sharing.
- Improved space-use for PIVX Promos UI.

# Bug Fixes
- Fixed a rare serialisation issue causing failed syncs on Firefox (potentially a bug in Firefox's engine!).
- Fixed ability to unlock wallet in the Staking UI.
- Fixed Wallet Export file type.
- Fixed Wallet Export button icon.
- Fixed private key wrapping consistency.
- Re-added CSV Exports to PIVX Promos after UI regression.
- Fixed Governance display on iOS.

# v2.1 - Feature Update
This upgrade contains huge Shield Improvements; a 10-30x faster Shield Sync (device-dependent) and full Shield Activity support.

Expand Down
2 changes: 1 addition & 1 deletion locale/cnr/translation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ QR_SCANNER_BAD_RECEIVER = "nije validan primalac plaćanja" # is not a valid pay
UNSUPPORTED_CHARACTER = "Karakter '{char}' nije podržan u adresama! (Nije kompatibilan sa Base58)" # The character '{char}' is unsupported in addresses! (Not Base58 compatible)
UNSUPPORTED_WEBWORKERS = "Ovaj pretraživač ne podržava Web Workers (višenitni JS), nažalost ne možete generisati Personalizovane novčanike!" # This browser doesn't support Web Workers (multi-threaded JS), unfortunately you cannot generate Vanity wallets!
INVALID_ADDRESS = "<b>Neispravna PIVX adresa!</b><br> {address}" # <b>Invalid PIVX address!</b><br> {address}
VALIDATE_AMOUNT_LOW = "<br>Minimalni iznos je {minimumAmount} {coinTicker}!" # <br>Minimum amount is {minimumAmount} {coinTicker}!
VALIDATE_AMOUNT_LOW = "Minimalni iznos je {minimumAmount} {coinTicker}!" # <br>Minimum amount is {minimumAmount} {coinTicker}!
VALIDATE_AMOUNT_DECIMAL = "{coinDecimal} decimalno prekoračenje" # {coinDecimal} decimal limit exceeded
SUCCESS_STAKING_ADDR = "<b>Staking adresa je postavljena!</b><br>Sada možete unstake-ovati!" # <b>Staking Address set!</b><br>Now go ahead and unstake!
CONFIRM_UNSTAKE_H_WALLET = "<b>Potvrdite vaše unstake-ovanje</b><br>Potvrdite TX na svom {strHardwareName}" # <b>Confirm your Unstake</b><br>Confirm the TX on your {strHardwareName}
Expand Down
2 changes: 1 addition & 1 deletion locale/de/translation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ INVALID_AMOUNT = "<b>Ungültige Menge!</b><br>" # <b>Invalid amount!</b><br>
TX_SENT = "Transaktion gesendet!" # Transaction sent!
TX_FAILED = "Transaktion fehlgeschlagen!" # Transaction Failed!
QR_SCANNER_BAD_RECEIVER = "ist kein gültiger Empfänger" # is not a valid payment receiver
VALIDATE_AMOUNT_LOW = "<br>Minimale Menge ist {minimumAmount} {coinTicker}!" # <br>Minimum amount is {minimumAmount} {coinTicker}!
VALIDATE_AMOUNT_LOW = "Minimale Menge ist {minimumAmount} {coinTicker}!" # <br>Minimum amount is {minimumAmount} {coinTicker}!
VALIDATE_AMOUNT_DECIMAL = "{coinDecimal} Nachkommastellen überschritten" # {coinDecimal} decimal limit exceeded
SUCCESS_STAKING_ADDR = "<b>Staking Adresse gesetzt</b><br>Gehe nun über zum Abberufen!" # <b>Staking Address set!</b><br>Now go ahead and unstake!
STAKE_ADDR_SET = "<b>Kalte Adresse gesetzt!</b><br>Zukünftige Delegierungen benutzen diese Adresse." # <b>Cold Address set!</b><br>Future stakes will use this address.
Expand Down
2 changes: 1 addition & 1 deletion locale/en/translation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ QR_SCANNER_BAD_RECEIVER = "is not a valid payment receiver" # is not a valid pay
UNSUPPORTED_CHARACTER = "The character '{char}' is unsupported in addresses! (Not Base58 compatible)" # The character '{char}' is unsupported in addresses! (Not Base58 compatible)
UNSUPPORTED_WEBWORKERS = "This browser doesn't support Web Workers (multi-threaded JS), unfortunately you cannot generate Vanity wallets!" # This browser doesn't support Web Workers (multi-threaded JS), unfortunately you cannot generate Vanity wallets!
INVALID_ADDRESS = "<b>Invalid PIVX address!</b><br> {address}" # <b>Invalid PIVX address!</b><br> {address}
VALIDATE_AMOUNT_LOW = "<br>Minimum amount is {minimumAmount} {coinTicker}!" # <br>Minimum amount is {minimumAmount} {coinTicker}!
VALIDATE_AMOUNT_LOW = "Minimum amount is {minimumAmount} {coinTicker}!" # <br>Minimum amount is {minimumAmount} {coinTicker}!
VALIDATE_AMOUNT_DECIMAL = "{coinDecimal} decimal limit exceeded" # {coinDecimal} decimal limit exceeded
SUCCESS_STAKING_ADDR = "<b>Staking Address set!</b><br>Now go ahead and unstake!" # <b>Staking Address set!</b><br>Now go ahead and unstake!
CONFIRM_UNSTAKE_H_WALLET = "<b>Confirm your Unstake</b><br>Confirm the TX on your {strHardwareName}" # <b>Confirm your Unstake</b><br>Confirm the TX on your {strHardwareName}
Expand Down
2 changes: 1 addition & 1 deletion locale/fr/translation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ INVALID_AMOUNT = "<b>Valeur non valide!</b><br>" # <b>Invalid amount!</b><br>
TX_SENT = "Transaction envoyée!" # Transaction sent!
TX_FAILED = "Échec de la Transaction!" # Transaction Failed!
QR_SCANNER_BAD_RECEIVER = "n'est pas un récepteur de paiement valide" # is not a valid payment receiver
VALIDATE_AMOUNT_LOW = "<br>La valeur minimale est de {minimumAmount} {coinTicker}!" # <br>Minimum amount is {minimumAmount} {coinTicker}!
VALIDATE_AMOUNT_LOW = "La valeur minimale est de {minimumAmount} {coinTicker}!" # <br>Minimum amount is {minimumAmount} {coinTicker}!
VALIDATE_AMOUNT_DECIMAL = "{coinDecimal} limite décimale dépassée" # {coinDecimal} decimal limit exceeded
SUCCESS_STAKING_ADDR = "<b>Adresse de Staking défini!</b><br>Poursuivre avec le unstake!" # <b>Staking Address set!</b><br>Now go ahead and unstake!
STAKE_ADDR_SET = "<b>Adresse du Cold Staking défini!</b><br>Cette adresse sera utilisée à l'avenir pour la réalisation de Stake.." # <b>Cold Address set!</b><br>Future stakes will use this address.
Expand Down
2 changes: 1 addition & 1 deletion locale/hi/translation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ QR_SCANNER_BAD_RECEIVER = "एक मान्य पेमेंट रिस
UNSUPPORTED_CHARACTER = "वर्ण '{char}' एड्रेसिस में समर्थित नहीं है! (Base58 संगत नहीं)" # The character '{char}' is unsupported in addresses! (Not Base58 compatible)
UNSUPPORTED_WEBWORKERS = "इस ब्राउज़र में वेब वर्कर्स (मल्टी-थ्रेडेड JS) का समर्थन नहीं है, दुर्भाग्यवश आप वैनीटी वॉलेट नहीं बना सकते!" # This browser doesn't support Web Workers (multi-threaded JS), unfortunately you cannot generate Vanity wallets!
INVALID_ADDRESS = "अवैध PIVX अमाउन्ट!" # <b>Invalid PIVX address!</b><br> {address}
VALIDATE_AMOUNT_LOW = "<br>न्यूनतम अमाउन्ट {minimumAmount} {coinTicker} है!" # <br>Minimum amount is {minimumAmount} {coinTicker}!
VALIDATE_AMOUNT_LOW = "न्यूनतम अमाउन्ट {minimumAmount} {coinTicker} है!" # <br>Minimum amount is {minimumAmount} {coinTicker}!
VALIDATE_AMOUNT_DECIMAL = "{coinDecimal} दशमलव सीमा से अधिक" # {coinDecimal} decimal limit exceeded
SUCCESS_STAKING_ADDR = "<b>स्टेकिंग एड्रेस सेट हो गया!</b><br>अब आगे बढ़ें और अनस्टेक करें!" # <b>Staking Address set!</b><br>Now go ahead and unstake!
CONFIRM_UNSTAKE_H_WALLET = "<b>अपने अनस्टेक की कन्फर्म करें</b><br>अपने {strHardwareName} पर TX कन्फर्म करें" # <b>Confirm your Unstake</b><br>Confirm the TX on your {strHardwareName}
Expand Down
2 changes: 1 addition & 1 deletion locale/nl/translation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ QR_SCANNER_BAD_RECEIVER = "is geen geldige betalingsontvanger" # is not a valid
UNSUPPORTED_CHARACTER = "Het teken '{char}' wordt niet ondersteund in adressen! (Niet compatibel met Base58)" # The character '{char}' is unsupported in addresses! (Not Base58 compatible)
UNSUPPORTED_WEBWORKERS = "Deze browser ondersteunt geen web workers (multi-threaded JS), helaas kun je geen Vanity wallets genereren!" # This browser doesn't support Web Workers (multi-threaded JS), unfortunately you cannot generate Vanity wallets!
INVALID_ADDRESS = "<b>Ongeldig PIVX-adres!</b><br> {address}" # <b>Invalid PIVX address!</b><br> {address}
VALIDATE_AMOUNT_LOW = "<br>Minimale bedrag is {minimumAmount} {coinTicker}!" # <br>Minimum amount is {minimumAmount} {coinTicker}!
VALIDATE_AMOUNT_LOW = "Minimale bedrag is {minimumAmount} {coinTicker}!" # <br>Minimum amount is {minimumAmount} {coinTicker}!
VALIDATE_AMOUNT_DECIMAL = "{coinDecimal} decimaallimiet overschreden" # {coinDecimal} decimal limit exceeded
SUCCESS_STAKING_ADDR = "<b>Stakingsadres ingesteld!</b><br>Ga nu verder en maak de staking ongedaan!" # <b>Staking Address set!</b><br>Now go ahead and unstake!
CONFIRM_UNSTAKE_H_WALLET = "<b>Bevestig je ontkoppeling</b><br>Bevestig de transactie op je {strHardwareName}" # <b>Confirm your Unstake</b><br>Confirm the TX on your {strHardwareName}
Expand Down
2 changes: 1 addition & 1 deletion locale/ph/translation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ INVALID_AMOUNT = "<b>Ang halaga ay hindi wasto!</b><br>" # <b>Invalid amount!</b
TX_SENT = "Ang transaksyon ay naipadala!" # Transaction sent!
TX_FAILED = "Nabigo ang Transaksyon" # Transaction Failed!
QR_SCANNER_BAD_RECEIVER = "ay hindi wastong tanggapan ng bayad " # is not a valid payment receiver
VALIDATE_AMOUNT_LOW = "<br>Ang pinakamababang halaga ay {minimumAmount} {coinTicker}!" # <br>Minimum amount is {minimumAmount} {coinTicker}!
VALIDATE_AMOUNT_LOW = "Ang pinakamababang halaga ay {minimumAmount} {coinTicker}!" # <br>Minimum amount is {minimumAmount} {coinTicker}!
VALIDATE_AMOUNT_DECIMAL = "{coinDecimal} Ang limitasyon sa decimal ay lumagpas" # {coinDecimal} decimal limit exceeded
SUCCESS_STAKING_ADDR = "Nakatakda na ang Staking address!</b><br> Pumunta ka na ngayon at mag unstake" # <b>Staking Address set!</b><br>Now go ahead and unstake!
STAKE_ADDR_SET = "Nakatakda na ang Cold Address!</b><br>Gagamitin ang address na to sa mga susunod na stakes" # <b>Cold Address set!</b><br>Future stakes will use this address.
Expand Down
2 changes: 1 addition & 1 deletion locale/pl/translation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ QR_SCANNER_BAD_RECEIVER = "nie jest prawidłowym odbiorcą" # is not a valid pay
UNSUPPORTED_CHARACTER = "Znak '{char}' nie jest obsługiwany w adresach! (Nie jest kompatybilny z Base58)" # The character '{char}' is unsupported in addresses! (Not Base58 compatible)
UNSUPPORTED_WEBWORKERS = "Ta przeglądarka nie obsługuje Web Workers (wielowątkowego JS), niestety nie można generować portfeli Vanity!" # This browser doesn't support Web Workers (multi-threaded JS), unfortunately you cannot generate Vanity wallets!
INVALID_ADDRESS = "<b>Nieprawidłowy adres PIVX!</b><br> {address}" # <b>Invalid PIVX address!</b><br> {address}
VALIDATE_AMOUNT_LOW = "<br>Kwota minimalna to {minimumAmount} {coinTicker}!" # <br>Minimum amount is {minimumAmount} {coinTicker}!
VALIDATE_AMOUNT_LOW = "Kwota minimalna to {minimumAmount} {coinTicker}!" # <br>Minimum amount is {minimumAmount} {coinTicker}!
VALIDATE_AMOUNT_DECIMAL = "{coinDecimal} Przekroczono limit dziesiętny" # {coinDecimal} decimal limit exceeded
SUCCESS_STAKING_ADDR = "<b>Adres Stakingu ustawiony!</b><br>A teraz śmiało,idź i zrób Unstake" # <b>Staking Address set!</b><br>Now go ahead and unstake!
CONFIRM_UNSTAKE_H_WALLET = "<b>Potwierdź swój Unstake</b><br>Potwierdź TX na urządzeniu {strHardwareName}" # <b>Confirm your Unstake</b><br>Confirm the TX on your {strHardwareName}
Expand Down
2 changes: 1 addition & 1 deletion locale/pt/translation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ INVALID_AMOUNT = "<b>Valor inválido!</b><br>" # <b>Invalid amount!</b><br>
TX_SENT = "Transação enviada!" # Transaction sent!
TX_FAILED = "Falha na transação!" # Transaction Failed!
QR_SCANNER_BAD_RECEIVER = "não é um receptor de pagamento válido" # is not a valid payment receiver
VALIDATE_AMOUNT_LOW = "<br>O valor mínimo é {minimumAmount} {coinTicker}!" # <br>Minimum amount is {minimumAmount} {coinTicker}!
VALIDATE_AMOUNT_LOW = "O valor mínimo é {minimumAmount} {coinTicker}!" # <br>Minimum amount is {minimumAmount} {coinTicker}!
VALIDATE_AMOUNT_DECIMAL = "{coinDecimal} limite decimal excedido" # {coinDecimal} decimal limit exceeded
SUCCESS_STAKING_ADDR = "<b>Endereço de Staking definido!</b><br>Prossiga com o unstake!" # <b>Staking Address set!</b><br>Now go ahead and unstake!
CONFIRM_UNSTAKE_H_WALLET = "<b>Confirme o seu Unstake</b><br>Confirme a TX no seu {strHardwareName}" # <b>Confirm your Unstake</b><br>Confirm the TX on your {strHardwareName}
Expand Down
2 changes: 1 addition & 1 deletion locale/template/translation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ QR_SCANNER_BAD_RECEIVER = "is not a valid payment receiver"
UNSUPPORTED_CHARACTER = "The character '{char}' is unsupported in addresses! (Not Base58 compatible)"
UNSUPPORTED_WEBWORKERS = "This browser doesn't support Web Workers (multi-threaded JS), unfortunately you cannot generate Vanity wallets!"
INVALID_ADDRESS = "<b>Invalid PIVX address!</b><br> {address}"
VALIDATE_AMOUNT_LOW = "<br>Minimum amount is {minimumAmount} {coinTicker}!"
VALIDATE_AMOUNT_LOW = "Minimum amount is {minimumAmount} {coinTicker}!"
VALIDATE_AMOUNT_DECIMAL = "{coinDecimal} decimal limit exceeded"
SUCCESS_STAKING_ADDR = "<b>Staking Address set!</b><br>Now go ahead and unstake!"
CONFIRM_UNSTAKE_H_WALLET = "<b>Confirm your Unstake</b><br>Confirm the TX on your {strHardwareName}"
Expand Down
2 changes: 1 addition & 1 deletion locale/uwu/translation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ QR_SCANNER_BAD_RECEIVER = "is not a valid payment receiver" # is not a valid pay
UNSUPPORTED_CHARACTER = "The chawacter '{char}' is unsupurrted in addwesses! (Not Base58 compatible)" # The character '{char}' is unsupported in addresses! (Not Base58 compatible)
UNSUPPORTED_WEBWORKERS = "Dis bwowser doesn't suppurrt web workers" # This browser doesn't support Web Workers (multi-threaded JS), unfortunately you cannot generate Vanity wallets!
INVALID_ADDRESS = "<b>Invawed PIVX addwess baka</b><br> {address} " # <b>Invalid PIVX address!</b><br> {address}
VALIDATE_AMOUNT_LOW = "<br>Minimum ameownt is {minimumAmount} {coinTicker}!" # <br>Minimum amount is {minimumAmount} {coinTicker}!
VALIDATE_AMOUNT_LOW = "Minimum ameownt is {minimumAmount} {coinTicker}!" # <br>Minimum amount is {minimumAmount} {coinTicker}!
VALIDATE_AMOUNT_DECIMAL = " decimal wimit exceeded. Yowouve gone too fawr!" # {coinDecimal} decimal limit exceeded
SUCCESS_STAKING_ADDR = "<b>Staking Addwess set!</b><br>Now go ahead and unstake senpai❣" # <b>Staking Address set!</b><br>Now go ahead and unstake!
STAKE_ADDR_SET = "<b>Cold Addwess set!</b><br>Future stakes will use dis addwess." # <b>Cold Address set!</b><br>Future stakes will use this address.
Expand Down
11 changes: 5 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mypivxwallet",
"version": "2.1.0",
"version": "2.1.1",
"description": "Wallet for PIVX",
"main": "scripts/index.js",
"type": "module",
Expand Down
16 changes: 16 additions & 0 deletions scripts/stake/Stake.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { ParsedSecret } from '../parsed_secret.js';
import { storeToRefs } from 'pinia';
import { ALERTS } from '../i18n';
import { useAlerts } from '../composables/use_alerts.js';
import { validateAmount } from '../legacy.js';
const { createAlert } = useAlerts();
const wallet = useWallet();
const { balance, coldBalance, price, currency, isViewOnly } =
Expand Down Expand Up @@ -52,20 +53,32 @@ watch(coldStakingAddress, async (coldStakingAddress) => {
await db.updateAccount(cAccount, true);
});
async function stake(value, ownerAddress) {
// Ensure the stake value meets the minimum delegation size
if (!validateAmount(value, COIN)) {
return;
}
// Don't allow attempts to stake using Ledger
if (wallet.isHardwareWallet) {
createAlert('warning', ALERTS.STAKING_LEDGER_NO_SUPPORT, 5000);
return;
}
// Ensure the wallet is unlocked
if (wallet.isViewOnly && !(await restoreWallet())) {
return;
}
// Prepare the Owner address
const cDB = await Database.getInstance();
const cAccount = await cDB.getAccount();
const returnAddress =
cAccount?.getContactBy({
name: ownerAddress,
pubkey: ownerAddress,
})?.pubkey || ownerAddress;
// Create the delegation
const res = await wallet.createAndSendTransaction(
getNetwork(),
coldStakingAddress.value,
Expand All @@ -79,13 +92,16 @@ async function stake(value, ownerAddress) {
}
async function unstake(value) {
// Ensure the wallet is unlocked
if (
!wallet.isHardwareWallet &&
wallet.isViewOnly &&
!(await restoreWallet())
) {
return;
}
// Create the delegation redeem transaction (unstake)
const res = await wallet.createAndSendTransaction(
getNetwork(),
wallet.getNewChangeAddress(),
Expand Down

0 comments on commit 4be0a49

Please sign in to comment.