Skip to main content

useWalletContext

@coinbase/waas-sdk-web-reactAPI


Function: useWalletContext()

useWalletContext(): TWaasContext

A hook for using an MPC wallet, in a component that is already wrapped in the WalletProvider.

Returns

TWaasContext

The @coinbase/waas-sdk-web#Waas instance, and a wallet.

This must be used within a WalletProvider.

e.g

   <WalletProvider>
<MyComponent />
</WalletProvider>

//...

const MyComponent = () => {
const {wallet, isCreatingWallet} = useWalletContext();
//...
}

Was this helpful?