Developer documentation

Quickstart

Create a provider, connect accounts, and sign with ethers.

Prerequisites

  • npm install @wallcard/sdk-core (and @wallcard/sdk-react for React).
  • Your dApp origin allowlisted for SessionConnect (NodeRails onboarding).

Create the provider

Production wallet and API URLs are embedded in the SDK. Pass mode (and optional overrides) only.

import { createNoderailsCardProvider } from "@wallcard/sdk-core";

export const wallcard = createNoderailsCardProvider({
  mode: "popup", // popup (default) | iframe | auto
});

Connect (eth_requestAccounts)

const accounts = await wallcard.request({ method: "eth_requestAccounts" });
const evmAddress = accounts[0];

This opens SessionConnect in an in-page iframe overlay (default). The user links their WallCard to your dApp origin. A short-lived session is cached in sessionStorage for that origin.

Sign with ethers v6

import { BrowserProvider } from "ethers";

const browserProvider = new BrowserProvider(wallcard as import("ethers").Eip1193Provider);
const signer = await browserProvider.getSigner();
const signature = await signer.signMessage("Hello from my dApp");

signMessage maps to personal_sign under the hood. WallCard opens OnetimeConnect for PIN and email OTP (or push approval for large moves when enabled).

React

Use NoderailsCardProvider and useNoderailsCardWallet() from @wallcard/sdk-react when you want a shared provider instance in React trees.