-
Notifications
You must be signed in to change notification settings - Fork 8
Major refactoring and compatibility with dynamic bundle #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nampc1
wants to merge
15
commits into
tetherto:main
Choose a base branch
from
nampc1:nampc/dev
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,445
−4,254
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.