Pear Worklet WDK
HRPC and framed JSON-RPC infrastructure for running WDK inside a Bare worklet
Pear Worklet WDK is the low-level transport and handler layer for running WDK inside a Bare worklet. It provides an HRPC client and server helper, a separate framed JSON-RPC server entrypoint for native hosts, and typed request payloads for WDK, wallet, protocol, and HRPC-only generic-module operations.
Powered by @tetherto/pear-wrk-wdk.
Features
- Bare worklet bridge: Connect a host app to a worklet through the shipped
HRPCclient and generated HRPC schema - Typed lifecycle requests: Initialize WDK with
initializeWDK({ config, encryptionKey, encryptedSeed })and tear it down withdispose() - Selective wallet resets: Re-register only the wallet modules listed in a new worklet
networksconfig usingresetWdkWallets({ config }) - Generic wallet and protocol calls: Call account methods through
callMethod({ methodName, network, accountIndex, args, options }), including Swidge protocols by name - HRPC generic modules: Construct named modules during WDK initialization, call their methods with
callModule(), and forward declared events to the host - Framed JSON-RPC server: Register a length-prefixed JSON-RPC 2.0 server through
@tetherto/pear-wrk-wdk/jsonrpc - Dynamic registration hooks: Register additional wallets or protocols with
registerWallet()andregisterProtocol()
Why this matters
- You can keep WDK state and signing operations off the main thread in Bare-based apps
- You can reconfigure selected wallet modules without fully disposing the worklet
- You can use one transport layer across custom mobile, desktop, or embedded Bare integrations
- You can host the same wallet and protocol handlers behind HRPC or a native JSON-RPC bridge, within each transport's supported method set
Use this package when you need direct control over the worklet host and RPC layer. If you want generated worklet entry files instead, start with @tetherto/wdk-worklet-bundler.
The top-level package exports the HRPC runtime value. Import registerRpcHandlers() from @tetherto/pear-wrk-wdk/worklet and registerJsonRpcHandlers() from @tetherto/pear-wrk-wdk/jsonrpc.
Generic-module calls and events are HRPC-only in v1.0.0-beta.10; the JSON-RPC handler does not expose them. This package also does not export a pre-built WDK bundle.
Pear Worklet WDK Configuration
Build HRPC or JSON-RPC contexts and configure WDK, wallet, protocol, and generic-module initialization
Pear Worklet WDK API Reference
Review the exported class, server helper, and request shapes