Skip to content

Commit

Permalink
better getUnspentOutputByNFT error
Browse files Browse the repository at this point in the history
  • Loading branch information
micahkendall committed Aug 29, 2024
1 parent d70bbd3 commit bc849b5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/blaze-query/src/blockfrost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,12 @@ export class Blockfrost implements Provider {
);
}
// Ensures a single asset address is returned
if (response.length !== 1) {
if (response.length === 0) {
throw new Error(
"getUnspentOutputByNFT: No addresses found holding the asset.",
);
}
if (response.length > 1) {
throw new Error(
"getUnspentOutputByNFT: Asset must be held by only one address. Multiple found.",
);
Expand Down

0 comments on commit bc849b5

Please sign in to comment.