
Security News
PEP 810 Proposes Explicit Lazy Imports for Python 3.15
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
@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.
The npm package @demox-labs/leo-wallet-adapter receives a total of 0 weekly downloads. As such, @demox-labs/leo-wallet-adapter popularity was classified as not popular.
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
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.