Wallet Kit
API
WalletKitProvider

WalletKitProvider

The WalletKitProvider is used to setup the necessary context for you React application. It should be at the root of your application, so that you can use any of the Sui Wallet Kit components underneath it.

import { WalletKitProvider } from '@mysten/wallet-kit';
 
function App() {
  return (
    <WalletKitProvider>
      <YourApp />
    <WalletKitProvider />
  );
};

The WalletKitProvider creates an instance of Sui Wallet Kit Core internally, and manages all wallet state for you automatically.

Props

All props are optional.

  • preferredWallets - A list of wallets that are sorted to the top of the wallet list, if they are available to connect to. By default, wallets are sorted by the order they are loaded in.
  • storageAdapter = localStorageAdapter - Configures how the most recently connected to wallet is stored. Defaults to using localStorage.
  • storageKey = "wallet-kit:last-wallet" - The key to use to store the most recently connected wallet.
  • enableUnsafeBurner = false - Set to true to enable the UnsafeBurnerWalletAdapter, that you can use in development to test wallet features without requiring a wallet. Should not be set to true in a production environment, as the UnsafeBurnerWalletAdapter does not work in any non-test environment.
  • disableAutoConnect = false - When set to false, Sui Wallet Kit will automatically attempt to connect to the most recently-used wallet when it loads. When set to true, this behavior is disabled.
  • features = ["sui:signAndExecuteTransaction"] - A list of Wallet Standard features that are required for the dApp to function. This filters the list of wallets presented to users when selecting a wallet to connect from, ensuring that only wallets that meet the dApps requirements can connect.