usecoinbasewallet
title: useCoinbaseWallet
displayed_sidebar: react
Hook that enables users to connect to their Coinbase wallet.
import { useCoinbaseWallet } from "@thirdweb-dev/react";
Usage
import { useCoinbaseWallet, Web3Button } from "@thirdweb-dev/react";
function App() {
const coinbaseWallet = useCoinbaseWallet();
return (
<Web3Button
providerName="Coinbase"
action={() => coinbaseWallet()}
>
Connect to Coinbase
</Web3Button>
);
}
Returns
Returns a Promise
that resolves to the Coinbase ConnectorData
object.
{
data?: ConnectorData<any> | undefined;
error?: Error | undefined;
}
The ConnectorData
object has the following structure:
{
provider: string;
chainId: string;
accounts: string[];
library: any;
}