Skip to content

Commit

Permalink
Make xverse provider the default provider (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
victorkirov authored Jan 23, 2024
1 parent a81a566 commit 61bddf1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/provider/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { BitcoinProvider } from './types';
export async function getProviderOrThrow(
getProvider?: () => Promise<BitcoinProvider | undefined>
): Promise<BitcoinProvider> {
const provider = (await getProvider?.()) || window.BitcoinProvider;
const provider = (await getProvider?.()) || window.XverseProviders?.BitcoinProvider || window.BitcoinProvider;

if (!provider) {
throw new Error('No Bitcoin wallet installed');
Expand Down
3 changes: 3 additions & 0 deletions src/provider/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@ export interface BitcoinProvider extends BaseBitcoinProvider {
declare global {
interface Window {
BitcoinProvider?: BitcoinProvider;
XverseProviders?:{
BitcoinProvider?: BitcoinProvider;
}
}
}

0 comments on commit 61bddf1

Please sign in to comment.