
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@tian000/react-native-wallet-sdk
Advanced tools
Phantom React Native SDK allows you to seamlessly onboard users to your application, without requiring them to have previously installed a wallet. With Phantom React Native SDK, users can create a self-custodial wallet with just their Google account and a 4-digit pin. Once created, this wallet will automatically sync with Phantom's mobile and extension apps without the user needing to know their seed phrase or manage any private keys.
yarn | npm | pnpm add @phantom/react-native-wallet-sdk
import { createPhantom, PhantomConfig } from "@phantom/react-native-wallet-sdk";
import { VersionedTransaction } from "@solana/web3.js";
import React, { useState } from "react";
import { Alert, Button, View } from "react-native";
const opts: PhantomConfig = {
redirectURI: "my-app://",
sdkKey: "my-sdk-key",
};
const phantom = createPhantom(opts);
const App = () => {
const [solanaAddress, setSolanaAddress] = useState<string | null>(null);
const handleLogin = async () => {
const { solana: solanaAddress } = await phantom.loginWithGoogle();
setSolanaAddress(solanaAddress);
// Persist the user's Solana address to storage
// The account will stay logged in until the user logs out
};
if (!solanaAddress) {
return (
<View>
<Button title="Login with Phantom" onPress={handleLogin} />
</View>
);
}
// Sign a message or transaction with the Phantom Embedded wallet
const handleSignMessage = async () => {
const { signature } = await phantom.providers.solana.signMessage(new TextEncoder().encode("Hello, world!"));
Alert.alert("Signature", JSON.stringify(signature));
};
const handleSignTransaction = async () => {
const transaction = new VersionedTransaction(/* Create your transaction here. */);
const signedTransaction = await phantom.providers.solana.signTransaction(transaction);
Alert.alert("Signature", JSON.stringify(signedTransaction.serialize()));
};
return (
<View>
<Button title="Sign Message" onPress={handleSignMessage} />
<Button title="Sign Transaction" onPress={handleSignTransaction} />
</View>
);
};
The following optional parameters can be passed as createPhantom({options...})
to customize the Phantom Embedded
wallet experience.
Parameter | Type | Description |
---|---|---|
sdkKey | string | Contact Phantom for your SDK key |
redirectURI | string | A base URI that will redirect to your app. Can be a custom scheme (e.g. my-app:// ) or a universal link (e.g. https://my-app.com ). |
Try out Phantom Embedded via our demo app:
Phantom React Native SDK is in active development and will be prioritizing features requested by early adopters. If you are
interested in working with us, please email us at developers@phantom.app
or message @brianfriel
on Telegram.
If the user has a social account linked to their Phantom extension - the same Phantom account will be used in the Phantom React Native SDK.
Once `createPhantom` has been called, it will return an object that contains the provider methods for interacting with the Phantom wallet.
It's free!
We are providing early access to beta software for testing purposes only. Embedded wallet should be used in a non-production environment only. Phantom will not be liable for any losses or damages suffered by you or your end users if you push the early access version of embedded wallets to a production environment.
All suggestions, enhancement requests, recommendations or other feedback provided by you relating to the embedded wallet will be the sole and exclusive property of Phantom and by using the early access version of embedded wallets and providing feedback to Phantom you agree to assign any rights in that feedback to Phantom.
FAQs
Phantom wallet embedded wallet SDK
The npm package @tian000/react-native-wallet-sdk receives a total of 0 weekly downloads. As such, @tian000/react-native-wallet-sdk popularity was classified as not popular.
We found that @tian000/react-native-wallet-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.