⚠️ WARNING: This project is currently under development and not ready for production use. Use at your own risk.
A wallet plugin for Wharf that allows signing transactions using a web-based authenticator service. This plugin opens a popup window to handle authentication and transaction signing through a web interface.
- Web-based authentication flow
- Popup window interface for secure interaction
- Support for transaction signing
- Currently only supports Jungle 4 testnet
- Configurable web authenticator URL
yarn add @wharfkit/wallet-plugin-web-authenticator
import { SessionKit } from '@wharfkit/session'
import { WalletPluginWebAuthenticator } from '@wharfkit/wallet-plugin-web-authenticator'
// Initialize the wallet plugin
const webAuthenticator = new WalletPluginWebAuthenticator({
webAuthenticatorUrl: 'https://your-authenticator-url.com' // Optional, defaults to http://localhost:5174
})
// Create a new SessionKit instance with the plugin
const sessionKit = new SessionKit({
appName: 'your-app',
chains: [...],
walletPlugins: [webAuthenticator]
})
The plugin accepts the following configuration options:
interface WebAuthenticatorOptions {
webAuthenticatorUrl?: string // The URL of your web authenticator service
}
Your web authenticator service should implement the following endpoints:
/sign
- Handles both login requests and transaction signing- Query Parameters:
esr
- The encoded signing requestchain
- The chain nameaccountName
- (Only for signing) The account namepermissionName
- (Only for signing) The permission name
- Query Parameters:
The authenticator should respond by posting a message to the opener window with the following format:
For login:
{
payload: {
cid: string // Chain ID
sa: string // Signing account
sp: string // Signing permission
}
}
For signing:
{
signatures: string[] // Array of signatures
}
You need Make, node.js and yarn installed.
- Clone the repository
- Install dependencies:
yarn install
- Build the project:
make
- Run tests:
make test
See the Makefile for other useful targets. Before submitting a pull request make sure to run make lint
.
- The plugin verifies the origin of messages from the popup window against the configured authenticator URL
- Popups must be enabled in the user's browser
- The web authenticator service should implement appropriate security measures
- Currently only supports the Jungle 4 testnet chain
- Requires popup windows to be enabled in the browser
- Web authenticator service must be available and properly configured
Made with ☕️ & ❤️ by Greymass, if you find this useful please consider supporting us.