
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
@tetherto/wdk-react-native-core
Advanced tools
Core functionality for React Native wallets - wallet management, balance fetching, and worklet operations
Core functionality for React Native wallets, providing wallet management, balance fetching, and more.
This library uses a unique worklet bundle to run intensive cryptographic operations on a separate thread, ensuring your app's UI remains fast and responsive.
npm install @tetherto/wdk-react-native-core
You need the bundler to generate the bundle file. You can install it globally or as a dev dependency in your project.
Global Install (Recommended for easy access):
npm install -g @tetherto/wdk-worklet-bundler
Or, as a Dev Dependency:
npm install --save-dev @tetherto/wdk-worklet-bundler
A key part of this library's architecture is the Worklet Bundle.
What is the Worklet Bundle?
The bundle is a separate JavaScript file (bundle.js) that contains all the core cryptographic and blockchain logic. This code runs on a dedicated, high-performance thread, completely separate from the React Native UI thread.
Why is it necessary? Running wallet operations in a separate thread is crucial for performance. It ensures that intensive tasks like signing transactions or deriving keys do not slow down or freeze your app's user interface, resulting in a smooth and responsive experience. The bundling step also allows you to create a small, optimized bundle with only the blockchain modules you actually need.
To get the bundle, use the @tetherto/wdk-worklet-bundler CLI to generate one with only the blockchain modules you need:
# 1. Initialize configuration in your React Native project
wdk-worklet-bundler init
# 2. Edit wdk.config.js to configure your networks (see example below)
# 3. Generate the bundle
wdk-worklet-bundler generate
Example wdk.config.js:
// wdk.config.js
module.exports = {
// Define the networks you want to support and their corresponding packages.
networks: {
ethereum: {
package: '@tetherto/wdk-wallet-evm-erc-4337'
},
bitcoin: {
package: '@tetherto/wdk-wallet-btc'
}
}
};
After running wdk-worklet-bundler generate, you will see the bundle in the directory .wdk.
For the full bundler documentation, see wdk-worklet-bundler.
Getting started involves three main steps:
WdkAppProvider and pass it your configuration.useWalletManager and useAddresses to manage the wallet and access its data.➡️ For a complete example, see the Full Quick Start Guide.
The library's functionality is exposed through a set of React hooks. They are designed to separate concerns, giving you specific tools for managing the app state, wallet lifecycle, and account interactions.
useWdkAppimport { useWdkApp } from '@tetherto/wdk-react-native-core';
const { isReady, error } = useWdkApp();
if (!isReady) {
// Show a loading or splash screen while the worklet starts
}
useWalletManagerimport { useWdkApp, useWalletManager } from '@tetherto/wdk-react-native-core';
const { isReady } = useWdkApp();
const { createWallet, loadWallet } = useWalletManager();
useEffect(() => {
if (isReady) {
const setup = async () => {
await createWallet();
};
setup();
}
}, [isReady, hasWallet, createWallet, loadWallet]);
useAddressesimport { useAddresses } from '@tetherto/wdk-react-native-core';
const { addresses, loadAddresses } = useAddresses();
// After a wallet is loaded (e.g. in another useEffect), load addresses.
useEffect(() => {
if (walletIsActive) { // Replace with your app's state logic
loadAddresses([0, 1]); // Load addresses for account 0 and 1
}
}, [walletIsActive, loadAddresses]);
useAccountaccount object to call signMessage when a user clicks a button.import { useAccount } from '@tetherto/wdk-react-native-core';
const { account } = useAccount({ network: 'ethereum', accountIndex: 0 });
const handleSignPress = async () => {
const signature = await account?.signMessage('Hello WDK');
console.log(signature);
};
useBalanceimport { useBalance } from '@tetherto/wdk-react-native-core';
// Assume 'ethAsset' is an asset object you've defined elsewhere
const { data } = useBalance({
accountIndex: 0,
asset: ethAsset
});
const balanceString = data?.balance; // e.g., '1000000000000000000'
See Best Practices for important patterns and recommendations for building robust apps.
See Architecture for details on the internal design.
See Security for details on security features and best practices.
See Troubleshooting for common issues and solutions.
See the Contributing Guide for details on how to build, test, and contribute to this project.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
FAQs
Core functionality for React Native wallets - wallet management, balance fetching, and worklet operations
We found that @tetherto/wdk-react-native-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.