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

feat: enable uninscribed utxos retrieval, closes #5067 #5370

Merged
merged 1 commit into from
May 14, 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 config/wallet-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@
"mainnetApiUrl": "https://api2.ordinalsbot.com",
"signetApiUrl": "https://signet.ordinalsbot.com"
},
"recoverUninscribedTaprootUtxosFeatureEnabled": false,
"recoverUninscribedTaprootUtxosFeatureEnabled": true,
"runesEnabled": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function CollectiblesLayout({
}: CollectiblesLayoutProps) {
return (
<>
<Flex flexDirection="row" justifyContent="space-between" flex={1}>
<Flex flexDirection="row" justifyContent="space-between" alignItems="center" flex={1}>
<HStack columnGap="space.02">
<styled.span textStyle="label.01" paddingY="space.05">
{title}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function RetrieveTaprootToNativeSegwitLayout(
As we don't support tranferring from Taproot addresses yet, you can retrieve funds to
your account's main Native SegWit balance here.
</styled.span>
<styled.span mt="space.04" textStyle="body.02">
<styled.span my="space.04" textStyle="body.02">
This transaction may take upwards of 30 minutes to confirm.
</styled.span>
{children}
Expand Down
12 changes: 8 additions & 4 deletions src/app/query/bitcoin/balance/btc-taproot-balance.hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,21 @@ import { useTaprootAccountUtxosQuery } from '../address/utxos-by-address.query';
import { UtxoWithDerivationPath } from '../bitcoin-client';
import { useGetInscriptionsInfiniteQuery } from '../ordinals/inscriptions.query';

const RETRIEVE_UTXO_DUST_AMOUNT = 10000;

export function useCurrentTaprootAccountUninscribedUtxos() {
const { data: utxos = [] } = useTaprootAccountUtxosQuery();

const query = useGetInscriptionsInfiniteQuery();

return useMemo(() => {
const inscriptions = query.data?.pages?.flatMap(page => page.inscriptions) ?? [];
return filterUtxosWithInscriptions(
inscriptions,
utxos.filter(utxo => utxo.status.confirmed)
) as UtxoWithDerivationPath[];

const filteredUtxosList = utxos
.filter(utxo => utxo.status.confirmed)
.filter(utxo => utxo.value > RETRIEVE_UTXO_DUST_AMOUNT);

return filterUtxosWithInscriptions(inscriptions, filteredUtxosList) as UtxoWithDerivationPath[];
}, [query.data?.pages, utxos]);
}

Expand Down
Loading