
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
@openzeppelin/contracts-ui-builder-react-core
Advanced tools
Core React context providers and hooks for the OpenZeppelin Contracts UI Builder.
This package provides core React Context providers and hooks for the OpenZeppelin Contracts UI Builder ecosystem. It centralizes the management of global wallet state, active network selection, active adapter instances, and the consumption of adapter-specific UI capabilities (like facade hooks and UI context providers).
It is a foundational package intended to be used by the main @openzeppelin/contracts-ui-builder-app application and can also be leveraged by exported standalone applications to ensure consistent wallet and adapter integration patterns.
AdapterProvider which maintains a registry of ContractAdapter instances, ensuring only one instance exists per network configuration (singleton pattern).WalletStateProvider which builds upon AdapterProvider to manage:
NetworkConfig.ContractAdapter instance for this global network and its loading state.EcosystemSpecificReactHooks (facade hooks) provided by the active adapter.WagmiProvider for EVM adapters), which is crucial for the functionality of facade hooks.useAdapterContext() and useWalletState() for components to access this managed state and functionality.AdapterProvider: Manages adapter instances. Requires a resolveAdapter prop to fetch/create adapters.WalletStateProvider: Manages global active network/adapter/wallet state. Requires a getNetworkConfigById prop and is typically nested within an AdapterProvider.AdapterContextWalletStateContextuseAdapterContext(): To access AdapterProvider's getAdapterForNetwork function.useWalletState(): To access global state like activeNetworkId, activeAdapter, walletFacadeHooks, and the setActiveNetworkId dispatcher.AdapterProviderPropsWalletStateProviderPropsAdapterContextValue, AdapterRegistryWalletStateContextValueThis package is typically used as a workspace dependency (e.g., "@openzeppelin/contracts-ui-builder-react-core": "workspace:^") within the Contracts UI Builder monorepo.
It has peer dependencies on react and react-dom, and direct dependencies on @openzeppelin/contracts-ui-builder-types and @openzeppelin/contracts-ui-builder-utils.
// In your main application setup (e.g., App.tsx)
import {
AdapterProvider,
WalletStateProvider,
} from '@openzeppelin/contracts-ui-builder-react-core';
import { getAdapter, getNetworkById } from './core/ecosystemManager';
// App-specific adapter/network resolvers
function AppRoot() {
return (
<AdapterProvider resolveAdapter={getAdapter}>
<WalletStateProvider
initialNetworkId="ethereum-mainnet" // Optional: Set a default active network
getNetworkConfigById={getNetworkById}
>
{/* Your application components that can now use useWalletState() */}
</WalletStateProvider>
</AdapterProvider>
);
}
import { useWalletState } from '@openzeppelin/contracts-ui-builder-react-core';
function MyWalletComponent() {
const {
activeNetworkId,
activeNetworkConfig,
activeAdapter,
isAdapterLoading,
walletFacadeHooks,
setActiveNetworkId,
} = useWalletState();
if (isAdapterLoading || !activeAdapter) {
return <p>Loading wallet information...</p>;
}
// Example: Using a facade hook if available
const accountInfo = walletFacadeHooks?.useAccount ? walletFacadeHooks.useAccount() : null;
const isConnected = accountInfo?.isConnected;
return (
<div>
<p>Current Network: {activeNetworkConfig?.name || 'None'}</p>
<p>Wallet Connected: {isConnected ? 'Yes' : 'No'}</p>
{/* Further UI using adapter or facade hooks */}
</div>
);
}
This package aims to decouple the builder application logic from the direct management of adapter instances and their UI contexts, promoting a cleaner and more maintainable architecture.
react-core/
βββ src/
β βββ providers/ # React context providers
β βββ contexts/ # React contexts
β βββ hooks/ # Consumer hooks
β βββ types/ # Package-specific types
β βββ utils/ # Internal utilities
β βββ index.ts # Main package exports
βββ package.json # Package configuration
βββ tsconfig.json # TypeScript configuration
βββ tsup.config.ts # Build configuration
βββ vitest.config.ts # Test configuration
βββ README.md # This documentation
This package has minimal dependencies to maintain a lightweight footprint:
FAQs
Core React context providers and hooks for the OpenZeppelin Contracts UI Builder.
The npm package @openzeppelin/contracts-ui-builder-react-core receives a total of 10 weekly downloads. As such, @openzeppelin/contracts-ui-builder-react-core popularity was classified as not popular.
We found that @openzeppelin/contracts-ui-builder-react-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 9 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
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: whatβs affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.