Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
466b94f
fix(sync): retain archived vault monitoring and complete refresh feed…
antuz123 Oct 8, 2026
941b3fb
fix(ask): preserve reading position and retry failed messages
antuz123 Oct 8, 2026
fa748cd
fix: align remote links with iOS association and validate routes
antuz123 Oct 8, 2026
1250be2
fix(network): keep private nodes isolated and verify faucet visibility
antuz123 Oct 8, 2026
aa60721
fix(sync): fence account and network scope during refresh
antuz123 Oct 8, 2026
2d7b30f
fix(sync): verify active Realm before wallet writes
antuz123 Oct 8, 2026
8aab57e
fix: verify www remote links in Android activity
antuz123 Oct 8, 2026
c5932d7
fix(network): retain public failover after manual node selection
antuz123 Oct 8, 2026
54ec852
fix(ask): require resolving failed send before new message
antuz123 Oct 8, 2026
b848cd4
fix(faucet): drop stale profile outcomes
antuz123 Oct 8, 2026
d488d5f
fix(network): fence stale Electrum work by connection generation
antuz123 Oct 8, 2026
0113fd5
test(sync): cover Realm handover during refresh
antuz123 Oct 8, 2026
ffd4594
fix(sync): treat closed Realm as stale scope
antuz123 Oct 8, 2026
615c110
fix(network): fence Electrum work during Realm account handover
antuz123 Oct 8, 2026
024006e
fix(sync): report failed node connection on pull refresh
antuz123 Oct 8, 2026
9c8a011
perf(wallets): reuse Realm list snapshots across renders
antuz123 Oct 8, 2026
7b1e7e1
fix(wallets): keep ID lookup within one reactive query
antuz123 Oct 8, 2026
54d53d7
test(vault): validate passphrase and fixed inheritance policy
antuz123 Oct 9, 2026
1bee2e9
Wait for visible balance before confirming Testnet faucet receipt
antuz123 Oct 9, 2026
d280c3b
test(vault): validate actual descriptor and receive addresses
antuz123 Oct 9, 2026
74df554
ci: run stacked R4 source checks against the actual PR base
redkeep-agents Oct 13, 2026
28c7ab0
test: make stacked R4 source checks independent of public network state
redkeep-agents Oct 13, 2026
163cccb
test: accept actual AES rejection for an incorrect decryption key
redkeep-agents Oct 13, 2026
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
1 change: 1 addition & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
pull_request:
branches:
- sprint
- codex/r3-release-baseline-to-sprint
- dev
- main

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
pull_request:
branches:
- sprint
- codex/r3-release-baseline-to-sprint
- dev
- main
- release/2.6.3
Expand Down
9 changes: 0 additions & 9 deletions android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,6 @@
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>

<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:host="bitcoinkeeper.app" />
<data android:pathPrefix="/app/dev" />
</intent-filter>

<meta-data
android:name="android.nfc.cardemulation.host_apdu_service"
android:resource="@xml/apduservice" />
Expand Down
12 changes: 11 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,19 @@
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:host="bitcoinkeeper.app" />
<data android:host="www.bitcoinkeeper.app" />
<data android:pathPrefix="@string/deep_link_prefix" />
</intent-filter>

<!-- Keep legacy apex links resolvable. Only www is verified because the apex redirects. -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:host="bitcoinkeeper.app" />
<data android:pathPrefix="@string/deep_link_prefix" />
</intent-filter>
</activity>
<meta-data android:name="firebase_analytics_collection_deactivated" android:value="true" />
<meta-data android:name="google_analytics_adid_collection_enabled" android:value="false" />
Expand Down
3 changes: 2 additions & 1 deletion ios/hexa_keeper/hexa_keeper.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
<string>development</string>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:bitcoinkeeper.app/app/prod</string>
<string>applinks:www.bitcoinkeeper.app</string>
<string>applinks:bitcoinkeeper.app</string>
</array>
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
Expand Down
3 changes: 2 additions & 1 deletion ios/hexa_keeper_dev.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
<string>development</string>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:bitcoinkeeper.app/app/dev</string>
<string>applinks:www.bitcoinkeeper.app</string>
<string>applinks:bitcoinkeeper.app</string>
</array>
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
Expand Down
4 changes: 4 additions & 0 deletions src/context/Localization/language/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@
"faucetDailyLimitTitle": "Daily Limit Reached",
"faucetDailyLimitBody": "You can request test sats up to 5 times per day. Try again after midnight UTC.",
"faucetDailyLimitError": "Daily limit reached. Try again after midnight UTC.",
"faucetPendingTitle": "Test sats are still pending",
"faucetPropagationPending": "The faucet sent test sats, but this wallet has not seen the transaction yet. Your balance may take a moment to update.",
"faucetSyncPending": "The faucet sent test sats, but the wallet could not sync. Check your server connection before requesting again.",
"faucetOutcomeUnknown": "The faucet request timed out. Test sats may already have been sent. Check your balance before requesting again.",
"Singlekey": "Single-key",
"multikey2of3": "2 of 3 multi-key",
"multikey3of5": "3 of 5 multi-key",
Expand Down
4 changes: 4 additions & 0 deletions src/context/Localization/language/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,10 @@
"faucetDailyLimitTitle": "Daily Limit Reached",
"faucetDailyLimitBody": "You can request test sats up to 5 times per day. Try again after midnight UTC.",
"faucetDailyLimitError": "Daily limit reached. Try again after midnight UTC.",
"faucetPendingTitle": "Los sats de prueba siguen pendientes",
"faucetPropagationPending": "El grifo envió sats de prueba, pero la cartera aún no ve la transacción. El saldo puede tardar en actualizarse.",
"faucetSyncPending": "El grifo envió sats de prueba, pero la cartera no pudo sincronizarse. Comprueba la conexión al servidor antes de volver a solicitarlos.",
"faucetOutcomeUnknown": "La solicitud al grifo agotó el tiempo de espera. Puede que ya se hayan enviado sats de prueba. Comprueba el saldo antes de volver a solicitarlos.",
"Singlekey": "Single-key",
"multikey2of3": "2 of 3 multi-key",
"multikey3of5": "3 of 5 multi-key",
Expand Down
40 changes: 35 additions & 5 deletions src/hooks/useTestSats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
setTestCoinsFailed,
setTestCoinsReceived,
setTestCoinsQuotaReached,
setTestCoinsPending,
} from 'src/store/reducers/wallets';
import { LocalizationContext } from 'src/context/Localization/LocContext';
import { useNavigation } from '@react-navigation/native';
Expand All @@ -19,9 +20,8 @@ import KeeperModal from 'src/components/KeeperModal';

const useTestSats = ({ wallet }) => {
const { setAppLoading, setLoadingContent } = useContext(AppContext);
const { testCoinsReceived, testCoinsFailed, testCoinsQuotaReached } = useAppSelector(
(state) => state.wallet
);
const { testCoinsReceived, testCoinsFailed, testCoinsQuotaReached, testCoinsPending } =
useAppSelector((state) => state.wallet);
const { bitcoinNetworkType } = useAppSelector((state) => state.settings);
const { showToast } = useToastMessage();
const dispatch = useDispatch();
Expand All @@ -30,21 +30,33 @@ const useTestSats = ({ wallet }) => {
const navigation = useNavigation();
const { colorMode } = useColorMode();
const [quotaModalVisible, setQuotaModalVisible] = useState(false);
const [pendingModalKind, setPendingModalKind] = useState<typeof testCoinsPending>(null);

useEffect(() => {
setAppLoading(false);
if (testCoinsReceived) {
setAppLoading(false);
showToast(walletText.recievedSats, <TickIcon />);
setTimeout(() => {
const timer = setTimeout(() => {
dispatch(setTestCoinsReceived(false));
navigation.goBack();
}, 3000);
return () => clearTimeout(timer);
} else if (testCoinsFailed) {
setAppLoading(false);
showToast(errorText.processFailed);
dispatch(setTestCoinsFailed(false));
}
return undefined;
}, [testCoinsReceived, testCoinsFailed]);

useEffect(() => {
if (testCoinsPending) {
setAppLoading(false);
setPendingModalKind(testCoinsPending);
dispatch(setTestCoinsPending(null));
}
}, [testCoinsPending]);

useEffect(() => {
if (testCoinsQuotaReached) {
setAppLoading(false);
Expand Down Expand Up @@ -105,6 +117,24 @@ const useTestSats = ({ wallet }) => {
buttonText={common.ok}
buttonCallback={() => setQuotaModalVisible(false)}
/>
<KeeperModal
visible={!!pendingModalKind}
close={() => setPendingModalKind(null)}
title={walletText.faucetPendingTitle}
subTitle={
pendingModalKind === 'unknown'
? walletText.faucetOutcomeUnknown
: pendingModalKind === 'sync'
? walletText.faucetSyncPending
: walletText.faucetPropagationPending
}
modalBackground={`${colorMode}.modalWhiteBackground`}
textColor={`${colorMode}.textGreen`}
subTitleColor={`${colorMode}.modalSubtitleBlack`}
showCloseIcon={false}
buttonText={common.ok}
buttonCallback={() => setPendingModalKind(null)}
/>
</>
);
};
Expand Down
33 changes: 22 additions & 11 deletions src/hooks/useVault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { getJSONFromRealmObject } from 'src/storage/realm/utils';
import { useQuery } from '@realm/react';
import { VaultType, VisibilityType } from 'src/services/wallets/enums';
import { useAppSelector } from 'src/store/hooks';
import { useMemo } from 'react';

type Params =
| {
Expand All @@ -25,19 +26,29 @@ const useVault = ({
getFirst = false,
getHiddenWallets = true,
}: Params) => {
let allVaults: Vault[] = useQuery(RealmSchema.Vault);

const realmVaults = useQuery(RealmSchema.Vault) as unknown as Vault[];
const { bitcoinNetworkType } = useAppSelector((state) => state.settings);
allVaults = includeArchived
? allVaults.map(getJSONFromRealmObject)
: allVaults.filtered('archived != true').map(getJSONFromRealmObject);
// Filter vaults based on network
allVaults = allVaults.filter((wallet) => wallet.networkType === bitcoinNetworkType);
// Select before converting: toJSON traverses address, UTXO and history data.
// The useQuery reference changes on Realm writes, but stays stable across
// unrelated renders of the same screen.
const allVaultsIncludingCanary: Vault[] = useMemo(
() =>
realmVaults
.filter(
(vault) =>
(includeArchived || !vault.archived) && vault.networkType === bitcoinNetworkType
)
.map(getJSONFromRealmObject) as unknown as Vault[],
[realmVaults, includeArchived, bitcoinNetworkType]
);
//Filtering Canary Vaults from at all UI level where Vaults are consumed
const allVaultsIncludingCanary = allVaults;
allVaults = allVaults.filter((vault) => vault.type !== VaultType.CANARY);
const allNonHiddenNonArchivedVaults = allVaults.filter(
(vault) => vault.presentationData.visibility === VisibilityType.DEFAULT
const allVaults = useMemo(
() => allVaultsIncludingCanary.filter((vault) => vault.type !== VaultType.CANARY),
[allVaultsIncludingCanary]
);
const allNonHiddenNonArchivedVaults = useMemo(
() => allVaults.filter((vault) => vault.presentationData.visibility === VisibilityType.DEFAULT),
[allVaults]
);
if (!vaultId) {
if (getHiddenWallets) {
Expand Down
59 changes: 59 additions & 0 deletions src/hooks/useWalletRefresh.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { useCallback, useEffect, useRef, useState } from 'react';
import { useDispatch } from 'react-redux';
import { Vault } from 'src/services/wallets/interfaces/vault';
import { Wallet } from 'src/services/wallets/interfaces/wallet';
import { useAppSelector } from 'src/store/hooks';
import {
clearRefreshRequest,
startRefreshRequest,
} from 'src/store/reducers/wallets';
import { autoSyncWallets, refreshWallets } from 'src/store/sagaActions/wallets';

let nextRefreshRequest = 0;

export const useWalletRefresh = () => {
const dispatch = useDispatch();
const [requestId, setRequestId] = useState<string | null>(null);
const inFlight = useRef<string | null>(null);
const status = useAppSelector((state) =>
requestId ? state.wallet.refreshRequests[requestId] : undefined
);

useEffect(() => {
if (requestId && status !== 'pending') {
inFlight.current = null;
setRequestId(null);
dispatch(clearRefreshRequest(requestId));
}
}, [dispatch, requestId, status]);

useEffect(() => () => {
if (inFlight.current) dispatch(clearRefreshRequest(inFlight.current));
}, [dispatch]);

const start = useCallback(
(actionForRequest: (id: string) => { type: string; payload: any }) => {
if (inFlight.current) return;
const id = `wallet-refresh-${Date.now()}-${++nextRefreshRequest}`;
inFlight.current = id;
dispatch(startRefreshRequest(id));
setRequestId(id);
dispatch(actionForRequest(id));
},
[dispatch]
);

const refresh = useCallback(
(wallets: (Wallet | Vault)[], options: { hardRefresh?: boolean; dustScan?: boolean }) => {
if (!wallets?.length || wallets.some((wallet) => !wallet)) return;
start((id) => refreshWallets(wallets, options, id));
},
[start]
);

const autoRefresh = useCallback(() => {
start((id) => autoSyncWallets(false, false, true, undefined, false, id));
}, [start]);

return { refreshing: !!requestId && status !== 'success' && status !== 'failure', refresh, autoRefresh };
};
69 changes: 43 additions & 26 deletions src/hooks/useWallets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,63 @@ import { Wallet } from 'src/services/wallets/interfaces/wallet';
import { RealmSchema } from 'src/storage/realm/enum';
import { getJSONFromRealmObject } from 'src/storage/realm/utils';
import { VisibilityType, WalletType } from 'src/services/wallets/enums';
import { useObject, useQuery } from '@realm/react';
import { useQuery } from '@realm/react';
import { useAppSelector } from 'src/store/hooks';
import { useMemo } from 'react';

type useWalletsInterface = ({ getAll, walletIds }?: { getAll?: boolean; walletIds?: string[] }) => {
wallets: Wallet[];
};

const filterByNetwork = (wallets: Wallet[], bitcoinNetworkType?: string): Wallet[] =>
bitcoinNetworkType
? (wallets
.filter((wallet) => wallet.networkType === bitcoinNetworkType)
.map(getJSONFromRealmObject) as unknown as Wallet[])
: wallets;

const useWallets: useWalletsInterface = ({ walletIds = [], getAll = false } = {}) => {
const { bitcoinNetworkType } = useAppSelector((state) => state.settings);
const allWallets: Wallet[] = useQuery(RealmSchema.Wallet).filter((wallet) =>
[WalletType.DEFAULT, WalletType.IMPORTED].includes(wallet.type)
);

const filterByNetwork = (wallets) => {
if (bitcoinNetworkType)
return wallets
.map(getJSONFromRealmObject)
.filter((wallet) => wallet.networkType === bitcoinNetworkType);
else return wallets;
};
const realmWallets = useQuery(RealmSchema.Wallet) as unknown as Wallet[];
const validWalletIds = walletIds?.filter((item) => !!item) || [];
const walletIdsKey = JSON.stringify(validWalletIds);
const hasWalletIds = validWalletIds.length > 0;

// useQuery changes its collection reference when Realm reports an insert,
// deletion, or modification. Other screen renders can reuse this snapshot.
const listedWallets = useMemo(() => {
if (hasWalletIds && !getAll) return [];
const regularWallets = realmWallets.filter(
(wallet) => wallet.type === WalletType.DEFAULT || wallet.type === WalletType.IMPORTED
);
const visibleWallets = getAll
? regularWallets
: regularWallets.filter(
(wallet) => wallet.presentationData.visibility == VisibilityType.DEFAULT
);
return filterByNetwork(visibleWallets, bitcoinNetworkType);
}, [realmWallets, bitcoinNetworkType, getAll, hasWalletIds]);

// Resolve IDs from the same reactive query. Calling useObject in a loop
// changes the number of hooks when a route gains or loses an ID.
const selectedWallets = useMemo(() => {
if (getAll || !hasWalletIds) return [];
const ids = JSON.parse(walletIdsKey) as string[];
const matched = ids
.map((id) => realmWallets.find((wallet) => wallet.id === id))
.filter((wallet): wallet is Wallet => !!wallet);
return filterByNetwork(matched, bitcoinNetworkType);
}, [realmWallets, bitcoinNetworkType, getAll, hasWalletIds, walletIdsKey]);

if (getAll) {
return { wallets: filterByNetwork(allWallets) };
return { wallets: listedWallets };
}

const allWalletsNonHidden = allWallets.filter(
(wallet) => wallet.presentationData.visibility == VisibilityType.DEFAULT
);
walletIds = walletIds?.filter((item) => !!item);
if (walletIds && walletIds.length) {
const extractedWallets = [];
for (let index = 0; index < walletIds.length; index += 1) {
const id = walletIds[index];
const wallet: Wallet = useObject(RealmSchema.Wallet, id);
if (wallet) extractedWallets.push(wallet);
}
return { wallets: filterByNetwork(extractedWallets) };
if (hasWalletIds) {
return { wallets: selectedWallets };
}

return { wallets: filterByNetwork(allWalletsNonHidden) };
return { wallets: listedWallets };
};

export default useWallets;
Loading
Loading