@futureverse/wagmi-connectors
v3.0.1
Published
Provides Wagmi extensions for Futureverse wallets.
Downloads
2,978
Maintainers
Keywords
Readme
Futureverse Wagmi Connectors
Provides Wagmi extensions for Futureverse wallets.
Installation
NPM:
npm install @futureverse/wagmi-connectors --save
Yarn:
yarn add @futureverse/wagmi-connectors
Usage
Wagmi Config Setup Example
This example shows how to create a wagmi config with Xaman futureverse wallet connector. The code also uses Futureverse Auth React.
import { createConfig, http } from 'wagmi';
import { mainnet, sepolia } from 'wagmi/chains';
import { coinbaseWallet, metaMask, walletConnect } from 'wagmi/connectors';
import { root, porcini } from '@futureverse/auth';
import { xamanWallet, futureverseCustodialWallet } from '@futureverse/wagmi-connectors';
const wagmiConfig = createConfig({
chains: [mainnet, sepolia, root, porcini],
connectors: [
futureverseCustodialWallet({ authClient, custodialType: 'email' }),
futureverseCustodialWallet({
authClient,
custodialType: 'facebook',
}),
futureverseCustodialWallet({ authClient, custodialType: 'google' }),
metaMask({
dappMetadata: {
name: 'FuturePass',
},
}),
coinbaseWallet({
appName: 'FuturePass',
}),
...(xamanApiKey
? [
xamanWallet({
apiKey: xamanApiKey,
onQR: xamanOnQRCode,
onSign: xamanOnSigned,
authClient,
flow,
}),
]
: []),
...(walletConnectProjectId ? [walletConnect({ projectId: walletConnectProjectId })] : []),
],
transports: {
[mainnet.id]: http(),
[sepolia.id]: http(),
[root.id]: http(),
[porcini.id]: http(),
},
});