wallet_openBuy
Last updated
Your app can use the wallet_openBuy method to prompt the user to buy the crypto asset your app requires, using their Xverse wallet's native onramps.
This can be especially useful to onboard users to apps operating on Bitcoin and Bitcoin L2s like Starknet, Spark or Stacks.
asset
The asset (ticker) to buy
Example: WBTC when buying WBTC on Starknet
π 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
If the account is connected and the requested onramp exists
-> the method successfully returns openBuyResult
-> Xverse wallet opens the relevant buy screen for the requested onramp
the user can then select their currency, payment method and provider using Xverse wallet

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