Getting Started

Installation

Latest stable version: 2.2.0

# Install via NPM (You can use any wallet selector version you want)
npm install @wpdas/naxios @near-wallet-selector/modal-ui@8.9.1 --save

Good to know: @near-wallet-selector/modal-ui need to be installed together because Naxios is integrated with NEAR Wallet Selector.

Preparing it

Import the NEAR Wallet Selector styles. The app needs it to render the Wallet Selector correctly.

import '@near-wallet-selector/modal-ui/styles.css'

Using It

It's super easy to get a Wallet, Contract, and RPC API in place all at once. Take a look:

import naxios from '@wpdas/naxios'

/**
 * NEAR Wallet API
 */
const walletApi = new naxios({
  rpcNodeUrl: 'https://free.rpc.fastnear.com', // optional
  contractId: CONTRACT_ID,
  network: 'testnet', // or mainnet, localnet
}).walletApi()

Last updated