Skip to main content
Version: v2

Support other wallets

The Checkout widgets allow for other wallets/providers to be used by passing in a WrappedBrowserProvider (imported from the Checkout SDK). This integration allows you to utilise wallets that aren't part of the supported wallets (e.g. Rainbow).


note

If a provider isn't set, the Checkout widgets will automatically prompt the user to connect with one of the supported wallets. This allows you to drop-in any of the Checkout widgets without any further configuration.

Set your application's WrappedBrowserProvider object into the widget during widget creation.

import { useEffect, useState } from 'react';
import { checkout } from '@imtbl/sdk';

// create Checkout SDK
const checkoutSDK = new checkout.Checkout();

export function App() {
const [wallet, setWallet] =
useState<checkout.Widget<typeof checkout.WidgetType.WALLET>>();

// @ts-ignore You will need to handle your own wallet provider creation and wrap it in a Checkout WrappedBrowserProvider
const wrappedProvider = new checkout.WrappedBrowserProvider(/* other wallet provider */);

// Initialise widgets, create wallet widget
useEffect(() => {
(async () => {
const widgets = await checkoutSDK.widgets({
config: { theme: checkout.WidgetTheme.DARK },
});

// Pass your wrappedProvider into the create method when creating a new widget.
const wallet = widgets.create(checkout.WidgetType.WALLET, {
config: { theme: checkout.WidgetTheme.DARK },
provider: wrappedProvider
});

setWallet(wallet)

wallet.mount("wallet")
})();
}, []);

return (<div id="wallet" />);
}