
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@demox-labs/leo-wallet-adapter
Advanced tools
Modular TypeScript wallet adapters and components for Aleo applications.
@demox-labs/leo-wallet-adapter
Modular TypeScript wallet adapters and components for Aleo applications.
Install these dependencies:
yarn add leo-wallet-adapter && yarn add react
import React, { FC, useMemo } from 'react';
import { WalletProvider, LeoWalletAdapter } from '@demox-labs/leo-wallet-adapter';
import { WalletAdapterNetwork } from '@solana/wallet-adapter-base';
import { UnsafeBurnerWalletAdapter } from '@solana/wallet-adapter-wallets';
import {
WalletModalProvider,
WalletDisconnectButton,
WalletMultiButton
} from '@solana/wallet-adapter-react-ui';
import { clusterApiUrl } from '@solana/web3.js';
// Default styles that can be overridden by your app
require('@solana/wallet-adapter-react-ui/styles.css');
export const Wallet: FC = () => {
// The network can be set to 'devnet', 'testnet', or 'mainnet-beta'.
const network = WalletAdapterNetwork.Devnet;
// You can also provide a custom RPC endpoint.
const endpoint = useMemo(() => clusterApiUrl(network), [network]);
const wallets = useMemo(
() => [
/**
* Select the wallets you wish to support, by instantiating wallet adapters here.
*
* Common adapters can be found in the npm package `@demox-labs/leo-wallet-adapter`.
*/
new LeoWalletAdapter(),
],
[]
);
return (
<WalletProvider wallets={wallets} autoConnect>
<WalletModalProvider>
<WalletMultiButton />
{ /* Your app's components go here, nested within the context providers. */ }
</WalletModalProvider>
</WalletProvider>
);
};
import { useWallet, WalletNotConnectedError, LeoWalletAdapter } from '@demox-labs/leo-wallet-adapter';
import React, { FC, useCallback } from 'react';
export const SignMessageForAleo: FC = () => {
const { publicKey, wallet } = useWallet();
const onClick = async () => {
if (!publicKey) throw new WalletNotConnectedError();
const message = "I'm a message!";
const messageBytes = new TextEncoder().encode(message);
const signatureBytes = await (wallet?.adapter as LeoWalletAdapter).signMessage(messageBytes);
const signature = new TextDecoder().decode(signatureBytes);
console.log(signature);
};
return (
<button onClick={onClick} disabled={!publicKey}>
Sign a message!
</button>
);
};
FAQs
Modular TypeScript wallet adapters and components for Aleo applications.
We found that @demox-labs/leo-wallet-adapter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.