Skip to Content
dApp 接入
本页目录

requestAccounts

开始交互前,需要先获得相应权限。调用 requestAccounts() 会请求用户将 Bitcoin 账户连接到本站。请在用户点击“连接”等操作后调用。连接成功不代表用户预先批准了后续签名或付款。

方法

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

示例

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

演示

打开示例 

最后更新于