wallet-plugin-properwallet
v0.1.0
Published
WharfKit wallet plugin for ProperWallet — an EOS/Vaulta mobile wallet with a built-in dApp browser
Maintainers
Readme
wallet-plugin-properwallet
WharfKit wallet plugin for ProperWallet — a non-custodial EOS/Vaulta mobile wallet with a built-in dApp browser.
When a site is opened in ProperWallet's browser, the wallet injects a bridge into the page. This plugin is a small typed adapter over that bridge, so any WharfKit dApp can offer ProperWallet as a login option with three lines of code.
Install
npm install wallet-plugin-properwalletUse
import {SessionKit} from '@wharfkit/session'
import {WalletPluginProperWallet} from 'wallet-plugin-properwallet'
const walletPlugins = [/* your existing plugins */]
// Only offer it where it can actually work — inside the ProperWallet browser.
if (WalletPluginProperWallet.isAvailable()) {
walletPlugins.push(new WalletPluginProperWallet())
}
const sessionKit = new SessionKit({appName, chains, ui, walletPlugins})That is the whole integration. Everything else is standard WharfKit.
How it works
| Plugin call | Bridge call | What the user sees |
|---|---|---|
| login() | window.properwallet.login() | the wallet returns the open account and permission |
| sign() | window.properwallet.signTransaction() | a confirmation screen in the wallet; signatures come back |
The plugin never receives a private key. The wallet signs and returns signatures, and every signing request is confirmed by the user — a rejection surfaces here as a thrown error, which WharfKit reports as a cancelled transaction.
isAvailable() — please gate on it
In an ordinary desktop or mobile browser the bridge is absent and isAvailable()
returns false. Filter the plugin out in that case, the way in-app-browser wallets
are normally handled: a login button that cannot possibly work looks like a broken
site, not a missing wallet.
A QR / deep-link flow for desktop browsers is on the roadmap. When it ships,
isAvailable() starts returning true outside the in-app browser as well, and
nothing in your integration has to change.
Chains
EOS / Vaulta mainnet — aca376f2…f0e906. More on request.
Testing
npm install
npm test # 17 unit tests against a faked bridge
npm run build # tsc -> dist/The unit tests cover what actually breaks integrations: detection, the login
response shape, and the three different signature envelopes the wallet has shipped
([sig], {signatures}, {result: {signatures}}).
On a real device
examples/harness/index.html is a single self-contained page. Host it anywhere over
HTTPS and open it in the ProperWallet dApp browser. It reports which globals the
wallet injected, exercises the bridge directly (login, account, sign), and — once
this package is on npm — runs a full SessionKit.login() through the plugin.
Nothing on that page is broadcast to the chain: the signing test builds a real transaction, gets it signed, and stops there.
License
MIT
