npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cityofzion/neon-dapi

v5.10.1

Published

Neon implementation of dApi(NEP-21)

Readme

neon-dapi

Overview

TypeScript implementation of the NEP-21 dAPI standard for Neo N3. Provides the DapiProvider interface that wallets must implement, along with DapiOperations — a helper class that handles the blockchain heavy lifting so wallet developers only need to wire up user interaction.

Installation

npm i @cityofzion/neon-dapi @cityofzion/neon-core

@cityofzion/neon-core is a peer dependency and must be installed alongside this package.

Concepts

Types

All NEP-21 types are exported from this package and can be imported directly. Key types include:

  • DapiProvider — The interface wallets must implement. Defines the full NEP-21 surface exposed to dApps: account access, asset transfers, contract invocations, signing, and blockchain queries.
  • Account, Signer, Transaction, Block — Core blockchain data structures.
  • InvocationArguments, InvocationResult — Input and output for contract calls.
  • ContractParametersContext — Unsigned transaction context used in multi-sig flows (makeTransactionsignrelay).
  • TransactionOptions — Fee and validity overrides for transaction building.
  • SignOptions, SignedMessage — Message signing configuration and result.
  • AuthenticationChallengePayload, AuthenticationResponsePayload — NEP-20 authentication payloads.
  • ProviderReadyEvent, ProviderRequestEvent, AccountChangedEvent, NetworkChangedEvent — Custom DOM events for the provider lifecycle and wallet state changes.
  • Primitive aliases — UInt160, UInt256, ECPoint, Integer, Base64Encoded, Network — string/number aliases with semantic names matching the NEP-21 spec.

DapiOperations class

A helper that implements the blockchain and cryptographic operations required by DapiProvider. It is not a provider itself — it exists to reduce boilerplate by handling RPC calls, transaction building, signing, and fee calculation.

Methods that require direct wallet UI interaction (pickAddress, on, removeListener) are intentionally omitted from DapiOperations because they depend on the specific wallet environment and cannot be generalized.

DapiError

Standardized error class thrown by all DapiOperations methods. Each error carries a DapiErrorCode so dApps can handle failure cases programmatically.

DapiNetwork

Enum with the canonical Neo N3 network magic numbers.

import { DapiNetwork } from "@cityofzion/neon-dapi";

DapiNetwork.MAINNET // 860833102
DapiNetwork.TESTNET // 894710606

Conformance Suite

The package ships a browser-based conformance suite (conformance/) that validates any injected NEP-21 provider against the full spec. Each method is exercised and results are reported as pass/fail directly in the page.

The suite runs against the live injected provider — no mocking occurs. Useful for wallet developers to verify their DapiProvider implementation before release.

Running

Serve the conformance directory with any static file server and open it in a browser that has a Neo wallet extension active:

# Using npx serve
npx serve packages/neon-dapi/conformance

Then open http://localhost:3000 (or whichever port your server uses) in the browser.

Note: Some tests require a connected account with funds on the target network.

Click Run All to execute the full suite, or run individual tests from the UI.

DapiErrorCode

| Code | Value | Meaning | |---|---|---| | UNKNOWN | 10000 | An unknown error has occurred. | | UNSUPPORTED | 10001 | The requested feature is not supported. | | INVALID | 10002 | The input data is in an invalid format. | | NOTFOUND | 10003 | The requested data doesn't exist. | | FAILED | 10004 | The contract execution failed. | | TIMEOUT | 10005 | The operation was cancelled due to timeout. | | CANCELED | 10006 | The operation was cancelled by the user. | | INSUFFICIENT_FUNDS | 10007 | The operation failed due to insufficient balance. | | RPC_ERROR | 10008 | An exception was thrown by the RPC server. |