Skip to Content
dAppsNear

NEAR

Integrate NEAR Protocol into your dApp using OneKey’s NEAR provider. Use the provider SDK and its supported near-api-js version for the methods documented below.

Features

  • Account connection and management
  • Transaction signing and sending
  • Message signing
  • Read network state (mainnet/testnet)
  • RPC requests through the selected network endpoint

Installation

npm install @onekeyfe/onekey-near-provider near-api-js@^0.44.2 # or yarn add @onekeyfe/onekey-near-provider near-api-js@^0.44.2

Quick Start

import { OneKeyNearProvider } from '@onekeyfe/onekey-near-provider' // Create provider instance const provider = new OneKeyNearProvider() // Request account access const accounts = await provider.requestSignIn() console.log('Connected accounts:', accounts) // Get current network const network = await provider.request({ method: 'near_network' }) console.log('Current network:', network)

Documentation

Getting Started

Integration Guides

Transactions & Signing

Advanced

Reference

Error Handling

CodeMessageDescription
4001User RejectedUser denied the request
-32602Invalid ParamsMethod parameters are invalid
-32603Internal ErrorInternal JSON-RPC error
Last updated on