# @near-wallet-selector/core

> This is the core package for NEAR Wallet Selector.

Latest version **10.1.4** (published 2025-12-04) · (MIT OR Apache-2.0) license · 0 weekly downloads

## Install

```sh
npm install @near-wallet-selector/core
pnpm add @near-wallet-selector/core
yarn add @near-wallet-selector/core
bun add @near-wallet-selector/core
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 10.1.4 |
| Published | 2025-12-04 |
| First published | 2022-03-29 |
| Weekly downloads | 0 |
| License | (MIT OR Apache-2.0) |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 9 |
| Unpacked size | 590.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 180 |
| Maintainers | ewiner, frol, roman009 |
| Keywords | near, blockchain, wallets, dapps, near-protocol, near-blockchain, wallet selector core |

## Links

- npm: https://www.npmjs.com/package/@near-wallet-selector/core
- Repository: https://github.com/near/wallet-selector
- Homepage: https://github.com/near/wallet-selector/tree/main/packages/core
- Issues: https://github.com/near/wallet-selector/issues
- npm.io page: https://npm.io/package/@near-wallet-selector/core

## Dependencies (9)

- [rxjs](https://npm.io/package/rxjs.md) 7.8.1
- [borsh](https://npm.io/package/borsh.md) 2.0.0
- [events](https://npm.io/package/events.md) 3.3.0
- [js-sha256](https://npm.io/package/js-sha256.md) 0.9.0
- [@near-js/types](https://npm.io/package/@near-js/types.md) ^2.3.0
- [@near-js/crypto](https://npm.io/package/@near-js/crypto.md) ^2.3.0
- [@near-js/signers](https://npm.io/package/@near-js/signers.md) ^2.3.0
- [@near-js/providers](https://npm.io/package/@near-js/providers.md) ^2.3.0
- [@near-js/transactions](https://npm.io/package/@near-js/transactions.md) ^2.3.0

## Recent versions

- 10.1.4 (latest) — 2025-12-04
- 10.0.0-beta.1 (beta) — 2025-10-10
- 4.0.0 (next) — 2022-05-30
- 10.1.3 — 2025-12-02
- 10.1.2 — 2025-11-25
- 10.1.1 — 2025-11-17
- 10.1.0 — 2025-10-28
- 10.0.0 — 2025-10-14
- 10.0.0-beta.0 — 2025-09-30
- 9.5.4 — 2025-09-23
- 9.5.3 — 2025-09-22
- 9.5.2 — 2025-09-19
- 9.5.1 — 2025-09-03
- 9.5.0 — 2025-09-03
- 9.4.1 — 2025-09-03
- … 95 more at https://npm.io/package/@near-wallet-selector/core/versions

## README

# @near-wallet-selector/core

This is the core package for NEAR Wallet Selector.

## Upgrading from v9 to v10

If you're upgrading from v9.x to v10.x, please read the [Migration Guide](../../MIGRATION-v10.md) for detailed instructions on the breaking changes and how to update your code.

## Installation and Usage

The easiest way to use this package is to install it from the NPM registry


```bash
# Using pnpm
pnpm add -w @near-wallet-selector/core

# Using NPM.
npm install @near-wallet-selector/core
```

Then use it in your dApp:

```ts
import { setupWalletSelector } from "@near-wallet-selector/core";
import { setupMyNearWallet } from "@near-wallet-selector/my-near-wallet";

// The entire set of options can be found in the section below.
const selector = await setupWalletSelector({
  network: "testnet",
  modules: [setupMyNearWallet()],
});

// Example with createAccessKeyFor for limited access keys (object format)
const selectorWithLimitedAccess = await setupWalletSelector({
  network: "testnet",
  modules: [setupMyNearWallet()],
  createAccessKeyFor: {
    contractId: "guest-book.testnet",
    methodNames: ["addMessage", "getMessages"]
  },
});

// Example with createAccessKeyFor using string format (creates key with no method restrictions)
const selectorWithSimpleAccess = await setupWalletSelector({
  network: "testnet",
  modules: [setupMyNearWallet()],
  createAccessKeyFor: "guest-book.testnet",
});
```

## Options

- `network` (`NetworkId | Network`): Network ID or object matching that of your dApp configuration . Network ID can be either `mainnet` or `testnet`.
  - `networkId` (`string`): Custom network ID (e.g. `localnet`).
  - `nodeUrl` (`string`): Custom URL for RPC requests.
  - `helperUrl` (`string`): Custom URL for creating accounts.
  - `explorerUrl` (`string`): Custom URL for the NEAR explorer.
  - `indexerUrl` (`string`): Custom URL for the Indexer service.
- `debug` (`boolean?`): Enable internal logging for debugging purposes. Defaults to `false`.
- `optimizeWalletOrder` (`boolean?`): Enable automatic wallet order. Reorders last signed in wallet on top, then installed wallets over not installed and deprecated wallets.
- `randomizeWalletOrder` (`boolean?`): Randomize wallets order in the `More` section of the UI.
- `allowMultipleSelectors` (`boolean?`): Optionally allow creating new instances of wallet selector.
- `languageCode` (`string?`): Optionally set specific ISO 639-1 two-letter language code, disables language detection based on the browser's settings.
- `relayerUrl` (`string?`): Optionally set the URL that meta-transaction enabled wallet modules can use to submit DelegateActions to a relayer
- `createAccessKeyFor` (`string | object?`): The contract ID and method names to create a function call access key for. This allows wallets to create limited access keys for specific contract methods. Can be either:
  - A string containing just the contract ID (creates access key with no method restrictions)
  - An object with the following properties:
    - `contractId` (`string`): The contract ID to create the access key for.
    - `methodNames` (`Array<string>`): Array of method names that the access key will be limited to.
- `storage` (`StorageService?`): Async storage implementation. Useful when [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) is unavailable. Defaults to `localStorage`.
- `modules` (`Array<WalletModuleFactory>`): List of wallets to support in your dApp.

## API Reference

You can find the entire API reference for Wallet Selector [here](./docs/api/selector.md).

## License

This repository is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

---
_Source: https://npm.io/package/@near-wallet-selector/core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
