Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@drift-labs/snap-wallet-adapter
Advanced tools
A Solana Wallet Standard wallet adapter for the Connect by Drift MetaMask Snap.
This is a wallet adapter for the Connect by Drift MetaMask Snap that implements the Solana Wallet Standard. Installing and adding this snap to your application gives your users the ability to use MetaMask to interact with Solana!
The wallet adapter is locked to this version of the Connect by Drift snap.
To install:
npm install --save @drift-labs/snap-wallet-adapter
To use the adapter in your application, create a new wallet adapter using the SnapWalletAdapter
constructor that is exported from this package:
import { SnapWalletAdapter } from '@drift-labs/snap-wallet-adapter';
const driftSnapWalletAdapter = new SnapWalletAdapter();
To listen to events and connect, use the same interface as other Wallet Standard adapters:
driftSnapWalletAdapter.on('connect', handleConnect);
driftSnapWalletAdapter.on('disconnect', handleDisconnect);
driftSnapWalletAdapter.on('error', handleError);
await driftSnapWAlletAdapter.connet();
To display the name of the adapter and the icon you can use the icon and name properties of the wallet adapter instance (react example):
const jsx = (
<div>
<img src={driftSnapWalletAdapter.icon} />
{driftSnapWalletAdapter.name}
</div>
);
This allows the snap wallet adapter instance to be appended to an array of other Wallet Standard adapters, and seamlessly be displayed and interacted with without code changes.
The icon will display the MetaMask icon, and the name will disply as Connect by Drift
which is the name of the snap.
When the user connects to this wallet, MetaMask will open and either directly connect to the Connect by Drift snap, or will prompt the user to install the Connect by Drift snap if they haven't done so before.
FAQs
A Solana Wallet Standard wallet adapter for the Connect by Drift MetaMask Snap.
We found that @drift-labs/snap-wallet-adapter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.