npm install 0xsodium ethers
pnpm install 0xsodium ethers
import { sodium } from "0xsodium";
// calling wallet with iframe
const wallet = await sodium.initWallet("polygon", {
walletAppURL: "https://sodium-two.vercel.app",
transports: {
iframeTransport: {
enabled: true
}
}
});
// auto connect wallet in sodium gallery
const wallet = await sodium.initWallet("polygon", {
walletAppURL: "https://sodium-two.vercel.app",
transports: {
iframeTransport: {
enabled: true,
},
appTransport: {
enabled: true
}
}
});
const connectDetails = await wallet.connect({
app: "Your Dapp name",
authorize: true,
});
console.log("user accepted connect?", connectDetails.connected);