Guide
Last updated
Was this helpful?
Last updated
Was this helpful?
This guide helps users understand how to use the OneKey Provider API to easily build web applications that can interact with BTC.
Download the . Install the OneKey browser extension.
The OneKey browser extension injects Provider API
into visited websites.
Two types of APIs are provided: window.unisat
and window.$onekey.btc
.
It is recommended to use window.$onekey.btc
.
Both APIs have the same functionality, just different names.
Before you start using Provider Api you need to check for browser support by checking if the variable window.unisat
is defined:
Before using the following API, you first need to use the provider.requestAccounts
method to request the user to access the relevant BTC account.
Other APIs can be called only after user authorization.
Clarify Needs: Identify required functionalities, call relevant interfaces
Key Operations: Such as account switching
Get user's account information:
Send a payment:
Request signature for any message:
More Interfaces:
More Information: