Skip to content

Commit

Permalink
refactor: remove utxo filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
fbwoolf committed Dec 18, 2024
1 parent 1b268fb commit 258f0b0
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions src/app/query/bitcoin/address/utxos-by-address.hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,14 @@ import { useNativeSegwitUtxosByAddress } from '@leather.io/query';

import { useCurrentAccountNativeSegwitIndexZeroSigner } from '@app/store/accounts/blockchain/bitcoin/native-segwit-account.hooks';

const defaultArgs = {
filterInscriptionUtxos: true,
filterPendingTxsUtxos: true,
filterRunesUtxos: true,
};

/**
* Warning: ⚠️ To avoid spending inscriptions, when using UTXOs
* we set `filterInscriptionUtxos` and `filterPendingTxsUtxos` to true
*/
export function useCurrentNativeSegwitUtxos(args = defaultArgs) {
const { filterInscriptionUtxos, filterPendingTxsUtxos, filterRunesUtxos } = args;

export function useCurrentNativeSegwitUtxos() {
const nativeSegwitSigner = useCurrentAccountNativeSegwitIndexZeroSigner();
const address = nativeSegwitSigner.address;

return useNativeSegwitUtxosByAddress({
address,
filterInscriptionUtxos,
filterPendingTxsUtxos,
filterRunesUtxos,
filterInscriptionUtxos: false,
filterPendingTxsUtxos: true,
filterRunesUtxos: false,
});
}

0 comments on commit 258f0b0

Please sign in to comment.