-
Notifications
You must be signed in to change notification settings - Fork 146
Home
This documentation explains how developers can interact with the Hiro Wallet. This is relevant for app developers looking to craft their own onboarding user experience.
Looking to easily integrate the Hiro Wallet with your app? Check out @stacks/connect
→
When the Hiro Wallet is installed, a script is injected to the page, and a new object StacksProvider
assigned to the global window
variable.
if (window.StacksProvider) {
// User has Hiro Wallet installed 🥳
} else {
// Prompt user to install the wallet
}
The StacksProvider is a JavaScript object injected into web pages of users with the Hiro Wallet web extension installed.
This method accepts an encoded JWT payload, and returns a JWT payload signed with the users dataPrivateKey
StacksProvider.authenticationRequest(encodedJwt: string) => Promise<string>
This method accepts an JWT payload with an unsigned transaction encrypted with the app's appPrivateKey
. This is decoded, decrypted, validated, and then signed by the wallet.
StacksProvider.transactionRequest(encodedJwt: string) => Promise<SponsoredFinishedTxPayload | FinishedTxPayload>