Skip to content

Commit 28b7f27

Browse files
authored
fix: update revealScript to use fetched UTXOs for address (#11)
1 parent b61b362 commit 28b7f27

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/sdk/src/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,11 +465,16 @@ export const revealScript = async (
465465
retryCount++;
466466
}
467467

468+
const address = await getWalletAddress();
469+
const { entries } = await rpcClient.getUtxosByAddresses({
470+
addresses: [address],
471+
});
472+
468473
// Reveal the script
469474
const { transactions: revealTransactions } = await createTransactions({
470-
changeAddress: await getWalletAddress(),
475+
changeAddress: address,
471476
priorityEntries: [scriptUtxo],
472-
entries: [scriptUtxo],
477+
entries,
473478
outputs: [],
474479
priorityFee: priorityFee ?? BigInt(0),
475480
networkId: await getNetwork(),

0 commit comments

Comments
 (0)