
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@demox-labs/miden-wallet-adapter
Advanced tools
Modular TypeScript wallet adapters and React components for Miden applications.
The Miden Wallet Adapter package provides everything you need to integrate the Miden Wallet into your decentralized application (dApp) using React. This package bundles all the core functionality, React integration, UI components, and adapter implementation in a single convenient package.
# npm
npm install @demox-labs/miden-wallet-adapter
# yarn
yarn add @demox-labs/miden-wallet-adapter
# pnpm
pnpm add @demox-labs/miden-wallet-adapter
This package requires React as a peer dependency:
npm install react react-dom
Wrap your app with the WalletProvider
and WalletModalProvider
:
import React from 'react';
import {
WalletProvider,
WalletModalProvider,
MidenWalletAdapter,
} from '@demox-labs/miden-wallet-adapter';
import '@demox-labs/miden-wallet-adapter/styles.css';
const wallets = [
new MidenWalletAdapter({ appName: 'Your Miden App' }),
];
function App() {
return (
<WalletProvider wallets={wallets}>
<WalletModalProvider>
<YourAppComponents />
</WalletModalProvider>
</WalletProvider>
);
}
Note: Either the stylesheet must be imported or custom styles must be defined
Use the WalletMultiButton
for a complete wallet connection experience:
import { WalletMultiButton } from '@demox-labs/miden-wallet-adapter';
function Header() {
return (
<header>
<h1>My Miden dApp</h1>
<WalletMultiButton />
</header>
);
}
Access wallet state and functionality with the useWallet
hook:
import { useWallet, SendTransaction } from '@demox-labs/miden-wallet-adapter';
function SendComponent() {
const { wallet, accountId, connected } = useWallet();
const handleSend = async () => {
if (!wallet || !accountId) return;
const transaction = new SendTransaction(
accountId,
'recipient_address_here',
'faucet_id_here',
'public', // or 'private'
BigInt(1000) // amount
);
try {
await wallet.adapter.requestSend(transaction);
console.log('Transaction sent successfully!');
} catch (error) {
console.error('Transaction failed:', error);
}
};
if (!connected) {
return <p>Please connect your wallet</p>;
}
return (
<div>
<p>Connected: {accountId}</p>
<button onClick={handleSend}>Send Transaction</button>
</div>
);
}
import { useWallet, CustomTransaction } from '@demox-labs/miden-wallet-adapter';
function CustomTransactionComponent() {
const { wallet, accountId } = useWallet();
const handleCustomTransaction = async () => {
if (!wallet || !accountId) return;
const customTransaction = new CustomTransaction(
accountId,
transactionRequest // TransactionRequest from Miden Web SDK
);
await wallet.adapter.requestTransaction(customTransaction);
};
return <button onClick={handleCustomTransaction}>Execute Custom Transaction</button>;
}
import { useWallet, ConsumeTransaction } from '@demox-labs/miden-wallet-adapter';
function ConsumeComponent() {
const { wallet, accountId } = useWallet();
const handleConsume = async () => {
if (!wallet || !accountId) return;
const consumeTransaction = new ConsumeTransaction(
accountId,
noteId,
'private' // or 'public'
);
await wallet.adapter.requestConsume(consumeTransaction);
};
return <button onClick={handleConsume}>Consume Note</button>;
}
The package includes several pre-built React components:
WalletMultiButton
- All-in-one button for connect/disconnect/account displayWalletConnectButton
- Simple connect buttonWalletDisconnectButton
- Simple disconnect buttonWalletModal
- Modal for wallet selectionWalletModalButton
- Button that opens the wallet modalWalletAdapter
- Base wallet adapter interfaceWalletAdapterNetwork
- Network types (Testnet, Localnet)WalletReadyState
- Wallet readiness statesTransactionType
- Transaction type enumerationSendTransaction
- For sending assetsConsumeTransaction
- For consuming notesCustomTransaction
- For custom transaction requestsWalletError
- Base wallet errorWalletConnectionError
- Connection-related errorsWalletSignTransactionError
- Transaction signing errorsIf you prefer more granular control, you can install individual packages:
# Core infrastructure only
npm install @demox-labs/miden-wallet-adapter-base
# React integration
npm install @demox-labs/miden-wallet-adapter-react
# UI components
npm install @demox-labs/miden-wallet-adapter-reactui
# Miden wallet adapter
npm install @demox-labs/miden-wallet-adapter-miden
# Install dependencies
yarn install
# Build the package
yarn build
# Generate documentation
yarn doc
Contributions are welcome! Please read our contributing guidelines and submit pull requests to our GitHub repository.
MIT
FAQs
Modular TypeScript wallet adapters and React components for Miden applications.
The npm package @demox-labs/miden-wallet-adapter receives a total of 381 weekly downloads. As such, @demox-labs/miden-wallet-adapter popularity was classified as not popular.
We found that @demox-labs/miden-wallet-adapter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.