openBuyCrypto static method

Future<void> openBuyCrypto()

Opens the AppKit directly to the Buy Crypto/OnRamp providers view

Throws an Exception if no wallet is connected.

Implementation

static Future<void> openBuyCrypto() async {
  // Check if wallet is connected first
  final account = Core.getAccount();
  if (!account.isConnected) {
    throw Exception('Wallet not connected. Please connect a wallet first.');
  }

  await window.appkit.openBuyCrypto().toDart;
}