
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
@near-wallet-selector/near-snap
Advanced tools
This is the NEAR Metamask Snap package for NEAR Wallet Selector.
The easiest way to use this package is to install it from the NPM registry, this package requires near-api-js
v1.0.0 or above:
# Using Yarn
pnpm add -w near-api-js
# Using NPM.
npm install near-api-js
# Using Yarn
pnpm add -w @near-wallet-selector/near-snap
# Using NPM.
npm install @near-wallet-selector/near-snap
Then use it in your dApp:
import { setupWalletSelector } from "@near-wallet-selector/core";
import { setupNearSnap } from "@near-wallet-selector/near-snap";
// Near Snap for Wallet Selector can be setup without any params or it can take few optional params, see options below.
const nearSnap = setupNearSnap({
iconUrl: "https://<Wallet Icon URL Here>" // optional
});
const selector = await setupWalletSelector({
network: "testnet",
modules: [nearSnap],
});
The library uses @near-snap/sdk, you can read more about the functionality here: https://github.com/here-wallet/near-snap
iconUrl
: (string?
): Icon is optional. Default image point to Metamask Flask Logo in base64 format.deprecated
: (boolean?
): Deprecated is optional. Default is false
.Assets such as icons can be found in the /assets
directory of the package. Below is an example using Webpack:
import { setupNearSnap } from "@near-wallet-selector/near-snap";
import SnapIconUrl from "@near-wallet-selector/near-snap/assets/snap-icon.svg";
const snapWallet = setupNearSnap({
iconUrl: SnapIconUrl
});
This repository is distributed under the terms of both the MIT license and the Apache License (Version 2.0).
FAQs
Metamask snap to interact with Near dapps.
The npm package @near-wallet-selector/near-snap receives a total of 209 weekly downloads. As such, @near-wallet-selector/near-snap popularity was classified as not popular.
We found that @near-wallet-selector/near-snap demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.