Getting Started
Installation
Latest stable version: 2.2.3
# Install via NPM (You can use any wallet selector version you want)
npm install @wpdas/naxios @near-wallet-selector/modal-ui@8.9.13 --save# Install via yarn (You can use any wallet selector version you want)
yarn add @wpdas/naxios @near-wallet-selector/modal-ui@8.9.13Preparing 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()import naxios from '@wpdas/naxios'
/**
* NEAR Contract API
*/
const contractApi = new naxios({
rpcNodeUrl: 'https://free.rpc.fastnear.com', // optional
contractId: CONTRACT_ID,
network: 'testnet', // or mainnet, localnet
}).contractApi()import naxios from '@wpdas/naxios'
/**
* NEAR RPC API
*/
const contractApi = new naxios({
rpcNodeUrl: 'https://free.rpc.fastnear.com', // optional
contractId: CONTRACT_ID,
network: 'testnet', // or mainnet, localnet
}).rpcApi()Last updated