Skip to content

Conversation

@nampc1
Copy link
Contributor

@nampc1 nampc1 commented Jan 21, 2026

No description provided.

gatteo and others added 15 commits January 13, 2026 15:05
Remove the tight coupling to pear-wrk-wdk by accepting bundleConfig
(containing bundle and HRPC) as explicit function parameters instead
of importing from the package directly.

Key changes:
- WorkletLifecycleService.startWorklet now accepts bundleConfig as 2nd param
- WdkAppProvider passes bundleConfig directly to startWorklet
- ensureWorkletStarted simplified to just validate worklet is started
- Remove pear-wrk-wdk from dependencies
- Update all tests to use local mocks instead of pear-wrk-wdk imports
- Define HRPC types locally in src/types/hrpc.ts

This allows consumers to provide their own bundle and HRPC implementation,
making the library more flexible and decoupled.
- Add Bundle Configuration section explaining two options:
  - Option A: Generate custom bundle with wdk-worklet-bundler CLI
  - Option B: Use pre-built pear-wrk-wdk package
- Update all examples to include the required bundle prop
- Update WdkAppProvider API reference with full props interface
- Add TypeScript configuration guidance for generated bundles
Set SecureStorage in WalletSetupService synchronously during render
instead of in a useEffect. This prevents race conditions where child
components' useEffect hooks run before the parent's effect, causing
"SecureStorage not initialized" errors.
Update the `pear-wrk-wdk` dependency to the `nampc/dynamic-worklet`
branch. This change also involves removing unused dependency entries
from `package-lock.json`.
This commit introduces several improvements:

- **Generics for `callAccountMethod`**: The
  `AccountService.callAccountMethod` function now supports generic type
  parameters (`TMethods`, `K`) to enable strict typing of method
  arguments and return values. Developers can define custom `MethodMap`
  types for their applications, improving type safety and developer
  experience.
- **New Wallet Generation Utilities**: `useWalletManager` now exposes
  `generateEntropyAndEncrypt`, `getMnemonicFromEntropy`, and
  `getSeedAndEntropyFromMnemonic` functions. These utilities facilitate
  custom wallet creation flows, such as displaying mnemonics before
  saving or importing existing wallets.
- **Type Definitions**: New type definitions for `MethodMap` and
  `LooseMethods` are added to `src/types/accountMethods.ts` to support
  the generic typing of account methods.
- **Provider Props**: The `WdkAppProviderProps` interface now accepts a
  generic type parameter `TConfig` to allow for more specific network
  configurations.
- **Type Casting**: Minor type casting adjustments in `useWallet` and
  `walletUtils` to align with the new generic types.
- **Dependency Updates**: Removed unused dependencies from
  `package-lock.json`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants