A React provider to make interactions with Panda Wallet a breeze.
The Panda Wallet Provider simplifies the process of integrating Panda Wallet into your react application by creating a provider that wraps your application.
For detailed instructions on integration and all available methods, be sure to check out the Provider API Docs.
Install the package using npm:
npm install panda-wallet-provider
First, wrap your application with the PandaProvider.
//... other imports
import { PandaProvider } from "panda-wallet-provider";
const root = ReactDOM.createRoot(
document.getElementById("root") as HTMLElement
);
root.render(
<PandaProvider>
<App />
</PandaProvider>
);
You can now use the usePandaWallet hook to interact with the wallet.
import { usePandaWallet } from 'panda-wallet-provider';
function YourComponent() {
const wallet = usePandaWallet();
const isReady = wallet.isReady;
console.log(isReady);
// true
return (
// Your TSX
);
}
You can also import the PandaIcon
for use in your project.
import { PandaIcon } from "panda-wallet-provider";
function YourComponent() {
return (
<div>
<PandaIcon size="32px" />
</div>
);
}