diff --git a/src/provider/index.ts b/src/provider/index.ts index 6485abb..6530f3c 100644 --- a/src/provider/index.ts +++ b/src/provider/index.ts @@ -3,7 +3,7 @@ import type { BitcoinProvider } from './types'; export async function getProviderOrThrow( getProvider?: () => Promise ): Promise { - const provider = (await getProvider?.()) || window.BitcoinProvider; + const provider = (await getProvider?.()) || window.XverseProviders?.BitcoinProvider || window.BitcoinProvider; if (!provider) { throw new Error('No Bitcoin wallet installed'); diff --git a/src/provider/types.ts b/src/provider/types.ts index a88810e..b95f071 100644 --- a/src/provider/types.ts +++ b/src/provider/types.ts @@ -29,5 +29,8 @@ export interface BitcoinProvider extends BaseBitcoinProvider { declare global { interface Window { BitcoinProvider?: BitcoinProvider; + XverseProviders?:{ + BitcoinProvider?: BitcoinProvider; + } } }