wallet_openBridge
Help Users Bridge Assets Between Bitcoin Layers
Your app can use the wallet_openBridge method to prompt the user to bridge assets between Bitcoin layers with their Xverse wallet.
This can be especially useful to onboard users to apps operating on Bitcoin and Bitcoin L2s like Starknet, Spark or Stacks.
Request Params
fromAssetThe asset (ticker) you wish your user to bridge to another Bitcoin layer
Example:
BTCwhen bridging BTC from Bitcoin Mainnet to Starknet
toAssetThe asset (ticker) you wish your user to receive on the destination Bitcoin layer
Example:
WBTCwhen bridging BTC from Bitcoin Mainnet to Starknet
Permissions Required
🔓 Your app must have first connected to the wallet and obtained account read permissions
🔒 If your user has not connected their active Xverse account to your app yet, and your app does not the necessary account read permissions -> the method will throw with an access denied error
wallet_openBridge Result: Open the Bridge Flow
✅ Success
If the account is connected and the requested bridge route exists
-> the method successfully returns
openBridgeResult-> Xverse wallet opens the relevant bridge screen for the requested bridge route
the user can then choose an amount and confirm the bridge in Xverse Wallet

❌ Error
If the account is not connected or the requested bridge route does not exist, the method will reject with an error object
Last updated