For the complete documentation index, see llms.txt. This page is also available as Markdown.

Types and Errors

This page groups the shared types used by the current NEP-21 proposal.

Basic Types

These aliases appear throughout the provider interface.

Type
Definition
Description

Base64Encoded

string

Base64 encoded data.

Address

string

N3 address.

UInt160

string

160-bit hash as a hexadecimal string.

UInt256

string

256-bit hash as a hexadecimal string.

ECPoint

string

ECC public key.

Integer

number | string

Large integer value.

HexString

string

Hexadecimal string.

Version

string

Version string.

Network

number

N3 network magic number.

Provider and Event Types

These types support provider discovery and runtime provider events.

export type EventName =
  | "accountchanged"
  | "networkchanged";

export type ProviderReadyEvent = CustomEvent<{
  provider: IDapiProvider;
}>;

export type ProviderRequestEvent = CustomEvent<{
  version: Version;
}>;

export type AccountChangedEvent = CustomEvent<{
  accounts: Account[];
}>;

export type NetworkChangedEvent = CustomEvent<{
  network: Network;
}>;

Account and Authentication Types

These types are used by authenticate, getAccounts, and pickAddress.

Contract Parameter Types

These types describe contract method parameters and arguments.

Invocation and VM Result Types

These types are used by call, invoke, makeTransaction, and application log results.

Transaction and Signing Types

These types are used when creating, signing, or relaying transactions.

Chain Data Types

These types are returned by read methods for blocks, transactions, application logs, storage, and tokens.

Errors

Promises reject with an error object.

Code
Name
Description

10000

UNKNOWN

An unknown error has occurred.

10001

UNSUPPORTED

The requested feature or operation is not supported.

10002

INVALID

The input data is in an invalid format.

10003

NOTFOUND

The requested data does not exist.

10004

FAILED

The contract execution failed.

10005

TIMEOUT

The requested operation was cancelled due to timeout.

10006

CANCELED

The requested operation was cancelled by the user.

10007

INSUFFICIENT_FUNDS

The requested operation failed due to insufficient balance.

10008

RPC_ERROR

An exception was thrown by the RPC server.