Installation
Get up and running with WalletConnect so your dapp can connect to the Varial mobile app.
Prerequisites
Sign up at WalletConnect Dashboard and create a project to get your Project ID.
Choose an installation method below.
npm / yarn
npm install @walletconnect/universal-provider @reown/appkityarn add @walletconnect/universal-provider @reown/appkitThen initialize the provider and modal:
import { UniversalProvider } from "@walletconnect/universal-provider";
import { createAppKit } from "@reown/appkit/core";
import { mainnet } from "@reown/appkit/networks";
const projectId = "YOUR_PROJECT_ID";
// Provider — handles the WalletConnect protocol
const provider = await UniversalProvider.init({
projectId,
metadata: {
name: "My Stellar Dapp",
description: "A dapp that integrates with Varial",
url: "https://my-dapp.com",
icons: ["https://my-dapp.com/icon.png"],
},
});
// Modal — displays the QR code and wallet list.
// AppKit requires at least one network. Stellar is not built-in,
// so we pass a placeholder. With manualWCControl the modal won't
// use it for chain switching.
const modal = createAppKit({
projectId,
networks: [mainnet],
universalProvider: provider,
manualWCControl: true,
});Next steps
Connect to the Varial mobile app
Sign a transaction
Feature Varial upfront in the modal
Alternatives
Stellar Wallets Kit provides a multi-wallet interface that includes WalletConnect support. From v2.3.0, its WalletConnectModule supports all four Varial methods:
signTransaction()
stellar_signXDR
signAndSubmitTransaction()
stellar_signAndSubmitXDR
signMessage()
stellar_signMessage
signAuthEntry()
stellar_signAuthEntry
Use the kit if your dapp supports several Stellar wallets. Integrate WalletConnect directly, as shown in this guide, if you want full control over the session and the modal. Kit versions before v2.3.0 only support stellar_signXDR and stellar_signAndSubmitXDR.
Last updated
Was this helpful?