Skip to Content
dApps
On this page

requestAccounts

To begin interaction, you first need to obtain the appropriate permissions. Calling requestAccounts() asks the user to connect a Bitcoin account to your site. Call it from a user action, such as a Connect button. A successful connection does not pre-approve later signatures or payments.

Method

declare function requestAccounts(): Promise<string[]>;

Example

const provider = (window.$onekey && window.$onekey.btc) || window.unisat; const accounts = await provider.requestAccounts()

Demo

Open example 

Last updated on