requestAccounts

To begin interaction, you first need to obtain the appropriate permissions. Calling requestAccounts() will prompt the user to allow the use of the browser's web access feature. After this, you are free to call any other API methods.

Method

async function requestAccounts(): string[]

Example

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

const accounts = async provider.requestAccounts()

Demo

Last updated