Skip to content

Commit

Permalink
Merge pull request #15 from impredmet/master
Browse files Browse the repository at this point in the history
Refactor getBitcoinUtxos method to use Web3API for retrieving UTXOs
  • Loading branch information
BlobMaster41 authored Oct 2, 2024
2 parents 154f2f7 + ac03369 commit 53b2d19
Show file tree
Hide file tree
Showing 2 changed files with 1,126 additions and 1,114 deletions.
12 changes: 8 additions & 4 deletions src/background/controller/provider/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,14 @@ class ProviderController extends BaseController {

@Reflect.metadata('SAFE', true)
getBitcoinUtxos = async () => {
const account = await wallet.getCurrentAccount();
if (!account) return [];
const utxos = await wallet.getBTCUtxos();
return utxos;
try {
const account = await wallet.getCurrentAccount();
if (!account) return [];
return await Web3API.getUTXOs([account.address]);
} catch (e) {
console.error(e);
return [];
}
};
}

Expand Down
Loading

0 comments on commit 53b2d19

Please sign in to comment.