Skip to main content

Topup your Wallet in PnP Web Modal SDK

For topping up the wallet of a user, you can use the showCheckout function which is part of Wallet Services Plugin. This method allow users to select their local currency and specify the token to top up their wallet.

note

This is a paid feature and the minimum pricing plan to use this SDK in a production environment is the Scale Plan. You can use this feature in Web3Auth Sapphire Devnet network for free.

Parameters

NameDescription
receiveWalletAddress?Specifies the recipient's address. By default, it is set to the currently connected address.
tokenList?Specifies the tokens to display in the list. By default, all tokens are shown. Use the ticker name to specify which tokens to display, such as [USDC, USDT, ETH]. Please checkout the coverage details for full list of supported networks and tokens.
fiatList?Specifies the available fiat currencies enabled for purchase. Use the currency acronym to define which fiat currencies to display, such as [USD, SGD, INR, JPY]. Please checkout the coverage details for full list of supported currencies.
showDetermines whether the checkout UI is displayed. This can be used to programmatically control its visibility.

Usage

import { WalletServicesPlugin } from "@web3auth/wallet-services-plugin";

const walletServicesPlugin = new WalletServicesPlugin();
web3auth.addPlugin(walletServicesPlugin); // Add the plugin to web3auth

await walletServicesPlugin.showCheckout(); // Opens the TopUp modal

Supported Cryptocurrency

To checkout the support cryptocurrency and networks, please checkout the coverage documentation.