本页目录
BTC
通过 OneKey 注入的 BTC provider 接入 Bitcoin。使用 window.$onekey.btc 明确选择 OneKey;全局兼容 provider 可能属于其他钱包。
快速链接
最小示例
const provider = window.$onekey?.btc
if (!provider) throw new Error('OneKey BTC provider not detected')
await provider.requestAccounts()事件与网络
accountsChanged、chainChanged— 重新同步账户和网络状态。
常见错误
- 用户拒绝:优雅处理并允许重试
- 参数无效:确保地址/金额格式正确
最后更新于