Connect Wallet (Pulse Web SDK)
The Pulse Web SDK lets a web app connect to the PulseVM desktop wallet, request a signature, and broadcast — the same ConnectWallet() shape as proton-web-sdk, but the wallet selector shows Pulse Wallet (Desktop) instead of Anchor.
Keys never touch the browser. The app hands an unsigned transaction to the wallet over the pulsevm:// URL scheme; the wallet decodes it, signs with a Secure Enclave / imported key behind Touch ID, and returns the signature.
▶ Simple demo▶ Pulse Edition demo (full selector)
Both demos need the PulseVM desktop wallet installed and launched once (so macOS registers the
pulsevm://scheme) and default to the A‑Chain testnet.
Two SDKs
| When to use | |
|---|---|
| pulse-web-sdk (simple) | A tiny, zero-dependency, desktop-only connector. Drops into a plain .html page — what the simple demo uses. |
| proton-web-sdk Pulse Edition | A fork of proton-web-sdk with the full wallet selector: WebAuth / Anchor (mobile QR + browser, over achain) plus a native PulseVM Wallet (Desktop) option over pulsevm://. Use when you want the familiar multi-wallet modal — see the Pulse Edition demo. |
The rest of this page covers the simple SDK. For the Pulse Edition, see its README.
Install
The SDK isn't published to npm yet — build it from source for now:
git clone https://github.com/paulgnz/pulse-web-sdk
cd pulse-web-sdk && npm install && npm run build
# then import from the built dist/, or `npm link` it into your appOnce published, this becomes
npm install @pulsevm/pulse-web-sdk. The live demo inlines the same transport, so it needs no install.
Connect
import { ConnectWallet } from "@pulsevm/pulse-web-sdk"
const { session } = await ConnectWallet({
appName: "My PulseVM dapp",
chainId: "0d6f033e887f…", // your network's chain id
rpcEndpoint: "https://rpc.a-chain-testnet.protonnz.com",
})
console.log(session.actor, session.permission) // e.g. "protonnz" "active"ConnectWallet() restores an existing session if one is saved, otherwise it shows the wallet selector and opens the desktop wallet to authorize.
Sign & broadcast a transfer
const result = await session.transact({
actions: [{
account: "pulse.token",
name: "transfer",
authorization: [{ actor: session.actor, permission: session.permission }],
data: { from: session.actor, to: "pulse", quantity: "0.0001 XPR", memo: "hello" },
}],
})
console.log(result.transactionId) // broadcast by default; pass { broadcast: false } to get just the signatureThe wallet renders a decode-before-sign view of the real action (amount, recipient, memo) before the user authorizes — nothing is signed blind.
Handling the callback
The wallet returns to your callback URL with the result. On that page, call handleCallback() once on load — it stores the result and notifies the opener:
import { handleCallback } from "@pulsevm/pulse-web-sdk"
handleCallback()Notes & limits
- This SDK build serializes the
transferaction. For arbitrary actions, serialize with pulsevm-js and pass the packed transaction to the wallet. - Transport is the
pulsevm://URL scheme, so the desktop wallet must be installed. A browser-extension / mobile transport can be added later behind the sameConnectWallet()API. - Source:
@pulsevm/pulse-web-sdk· see also the TypeScript Quickstart for writing contracts.