@paperxyz/embedded-wallet-service-wagmi
v4.0.0
Published
Wagmi connector for Embedded Wallets by Paper
Downloads
57
Readme
Paper is a developer platform for NFT commerce that easily onboards users without a wallet or cryptocurrency.
Documentation
Installation
Install embedded-wallet-service-wagmi and peer dependencies (wagmi and ethers):
npm install @paperxyz/embedded-wallet-service-wagmi wagmi ethers@^5
yarn add @paperxyz/embedded-wallet-service-wagmi wagmi ethers@^5
Add the Embedded Wallet connector to wagmi:
import { createClient, configureChains } from "wagmi";
import { polygon } from "wagmi/chains";
import { publicProvider } from "wagmi/providers/public";
const { chains, provider } = configureChains([polygon], [publicProvider()]);
// Create a Wagmi-compatible connector for Paper Embedded Wallet.
const paperEmbeddedWallet = new PaperEmbeddedWalletWagmiConnector({
chains,
options: {
chain: "Polygon",
clientId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
},
});
const client = createClient({
connectors: [paperEmbeddedWallet],
provider,
});
// Wrap your application with WagmiConfig.
function App() {
return <WagmiConfig client={client}>/** ...your app */</WagmiConfig>;
}
Arguments
chains
The list of chains your application may use.
options
The argument passed into the PaperEmbeddedWalletSdk
constructor. See PaperEmbeddedWalletSdk.