BTC
BTC Provider is used to connect UKey Wallet's Bitcoin account capabilities in the web page, including reading accounts, signing messages, and initiating payments. Read window.$ukey.btc first, and then fall back to window.unisat when compatibility with the old entry is required.
Fast Links
Mini Demo
const provider = (window as any).$ukey?.btc || (window as any).unisat
if (!provider) throw new Error('UKey Wallet BTC Provider not detected')
await provider.requestAccounts()
Events and Networks
accountsChanged,networkChanged: Resynchronize the account and network status after receiving the event.
Top Errors
- User Deny: Keeps the page actionable and allows the user to retry the request.
- Invalid inputs: Check if the address, network and amount formats match.