Skip to main content

Wallet Services

Web3Auth Wallet Services provides a comprehensive suite of wallet functionality including fiat-on-ramp, swaps, and interoperability with WalletConnect. These services enhance your application by offering a complete wallet experience without building these features from scratch.

tip

All these configurations can be directly accessed and managed through the Embedded Wallets dashboard. Manual configuration in the SDK is optional and provided here for reference purposes.

note

Access to Wallet Services is gated. You can use this feature in sapphire_devnet for free. The minimum pricing plan to use this feature in a production environment is the Scale Plan.

walletServicesConfig

The walletServicesConfig option allows you to customize the Wallet Services experience for your users.

walletServicesConfig?: WalletServicesConfig;

Configuration options

PropertyTypeDescription
confirmationStrategyCONFIRMATION_STRATEGY_TYPEHow to display confirmation screens.
modalZIndexnumberZ-index for modal windows.
enableKeyExportbooleanEnable private key export functionality.
whiteLabelObjectCustomization options for the widget appearance.

Confirmation strategy options

StrategyDescription
defaultUses auto-approve by default, modal for WalletConnect requests.
modalAlways uses modal for confirmations.
auto-approveAutomatically approves transactions without confirmation.

Whitelabel options

PropertyTypeDescription
showWidgetButtonbooleanWhether to show the widget button.
buttonPositionBUTTON_POSITION_TYPEPosition of the widget button on the page.
hideNftDisplaybooleanHide NFT display in the wallet.
hideTokenDisplaybooleanHide token display in the wallet.
hideTransfersbooleanHide transfer functionality.
hideTopupbooleanHide top-up (fiat on-ramp) functionality.
hideReceivebooleanHide receive address functionality.
hideSwapbooleanHide token swap functionality.
hideShowAllTokensbooleanHide the "show all tokens" option.
hideWalletConnectbooleanHide WalletConnect integration.
defaultPortfolio"token" | "nft"Default portfolio view.

Button position options

PositionDescription
bottom-leftBottom left corner of the page.
top-leftTop left corner of the page.
bottom-rightBottom right corner of the page.
top-rightTop right corner of the page.

Usage

web3AuthContext.tsx
import {
BUTTON_POSITION,
CONFIRMATION_STRATEGY,
WEB3AUTH_NETWORK,
type Web3AuthOptions,
} from '@web3auth/modal'

const web3AuthOptions: Web3AuthOptions = {
clientId: 'YOUR_WEB3AUTH_CLIENT_ID', // Pass your Web3Auth Client ID, ideally using an environment variable
web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,
walletServicesConfig: {
confirmationStrategy: CONFIRMATION_STRATEGY.MODAL,
modalZIndex: 99999,
enableKeyExport: false,
whiteLabel: {
showWidgetButton: true,
buttonPosition: BUTTON_POSITION.BOTTOM_RIGHT,
hideNftDisplay: false,
hideTokenDisplay: false,
hideTransfers: false,
hideTopup: false,
hideReceive: false,
hideSwap: false,
hideShowAllTokens: false,
hideWalletConnect: false,
defaultPortfolio: 'token',
},
},
}

const web3AuthContextConfig = {
web3AuthOptions,
}