Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(wallet): Beignet Upgrade #1610

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"@synonymdev/web-relay": "1.0.7",
"backpack-client": "github:synonymdev/bitkit-backup-client#f08fdb28529d8a3f8bfecc789443c43b966a7581",
"bech32": "2.0.0",
"beignet": "0.0.26",
"beignet": "0.0.27",
"bip21": "2.0.3",
"bip32": "4.0.0",
"bip39": "3.1.0",
Expand Down
10 changes: 8 additions & 2 deletions src/utils/wallet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,8 @@ const onElectrumConnectionChange = (isConnected: boolean): void => {
}
};

// Used to prevent duplicate notifications for the same txid that seems to occur when Bitkit is brought from background to foreground.
let receivedTxids: string[] = [];
const onMessage: TOnMessage = (key, data) => {
switch (key) {
case 'transactionReceived':
Expand All @@ -953,11 +955,13 @@ const onMessage: TOnMessage = (key, data) => {
});
const isTransferToSavings = transfer?.type === 'coop-close' ?? false;

if (!isTransferToSavings) {
const isDuplicate = receivedTxids.includes(txId);
if (!isTransferToSavings && !isDuplicate) {
showNewOnchainTxPrompt({
id: txId,
value: btcToSats(txMsg.transaction.value),
});
receivedTxids.push(txId);
}
}
setTimeout(() => {
Expand Down Expand Up @@ -996,7 +1000,9 @@ const onMessage: TOnMessage = (key, data) => {
});
break;
case 'newBlock':
refreshWallet({}).then();
refreshWallet({
onchain: false, // Beignet will handle this.
}).then();
}
};

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5712,10 +5712,10 @@ bech32@^1.1.2, bech32@^1.1.4:
resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9"
integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==

[email protected].26:
version "0.0.26"
resolved "https://registry.yarnpkg.com/beignet/-/beignet-0.0.26.tgz#f1138e9c97ec67b4748b272996b6aee02eea3e64"
integrity sha512-OvouVDlQfrP69EkwJThwTyRKtj7wVcrMBaKIkNiy4+IcMTghPKk+DoC+oe73cnO10Utw98xG6ulWtOFT+o96nw==
[email protected].27:
version "0.0.27"
resolved "https://registry.yarnpkg.com/beignet/-/beignet-0.0.27.tgz#a6ddb3d238b37a2ae074aecdad036a89b771de38"
integrity sha512-gwZgWV93Y6x8bj3PXeDTeHrBCiWk3nHRa2Jn4SnUsa5RqIMbg2e6WW8NBmZXPD6ER+hokiQL23GKU2TrVl6HbA==
dependencies:
"@bitcoinerlab/secp256k1" "1.0.5"
bech32 "2.0.0"
Expand Down
Loading