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

@radiant-core/constants

v1.2.0

Published

Shared constants for Radiant Blockchain development tools - opcodes, limits, flags

Downloads

10

Readme

@radiantblockchain/constants

Shared constants for Radiant Blockchain development tools.

This package provides opcodes, limits, flags, and network parameters used across the Radiant ecosystem:

  • rxdeb - Script debugger
  • radiantjs - JavaScript SDK
  • RadiantScript - Smart contract compiler

Installation

npm install @radiantblockchain/constants
# or
yarn add @radiantblockchain/constants

Usage

Import Everything

import {
  Opcodes,
  Limits,
  ScriptFlags,
  Networks,
  getOpcodeName,
  isRadiantOpcode,
} from '@radiantblockchain/constants';

Import Specific Modules

// Just opcodes
import { Opcodes, getOpcodeName } from '@radiantblockchain/constants/opcodes';

// Just limits
import { Limits, toPhotons } from '@radiantblockchain/constants/limits';

// Just flags
import { ScriptFlags, STANDARD_SCRIPT_VERIFY_FLAGS } from '@radiantblockchain/constants/flags';

// Just networks
import { mainnet, testnet, getNetwork } from '@radiantblockchain/constants/networks';

API Reference

Opcodes

import { Opcodes, getOpcodeName, isRadiantOpcode } from '@radiantblockchain/constants';

// Get opcode value
console.log(Opcodes.OP_CHECKSIG);        // 0xac
console.log(Opcodes.OP_PUSHINPUTREF);    // 0xd0
console.log(Opcodes.OP_INPUTINDEX);      // 0xc0

// Get opcode name from value
console.log(getOpcodeName(0xac));        // "OP_CHECKSIG"
console.log(getOpcodeName(0xd0));        // "OP_PUSHINPUTREF"

// Check if opcode is Radiant-specific
console.log(isRadiantOpcode(0xac));      // false (Bitcoin opcode)
console.log(isRadiantOpcode(0xd0));      // true (Radiant opcode)

Limits

import { Limits, toPhotons, toRxd } from '@radiantblockchain/constants';

// Script limits
console.log(Limits.MAX_SCRIPT_SIZE);         // 32_000_000
console.log(Limits.MAX_STACK_SIZE);          // 32_000_000
console.log(Limits.MAX_SCRIPTNUM_SIZE);      // 8 (64-bit integers)

// Convert between RXD and photons
console.log(toPhotons(1.5));                 // 150000000n
console.log(toRxd(150000000n));              // 1.5

Script Flags

import { 
  ScriptFlags, 
  STANDARD_SCRIPT_VERIFY_FLAGS,
  hasFlag,
  getFlagNames 
} from '@radiantblockchain/constants';

// Check flags
const flags = STANDARD_SCRIPT_VERIFY_FLAGS;
console.log(hasFlag(flags, ScriptFlags.SCRIPT_64_BIT_INTEGERS));      // true
console.log(hasFlag(flags, ScriptFlags.SCRIPT_NATIVE_INTROSPECTION)); // true

// Get human-readable flag names
console.log(getFlagNames(flags));
// ["SCRIPT_VERIFY_P2SH", "SCRIPT_VERIFY_STRICTENC", ...]

Networks

import { mainnet, testnet, getNetwork, ElectrumServers } from '@radiantblockchain/constants';

// Network parameters
console.log(mainnet.port);           // 7333
console.log(mainnet.pubKeyHash);     // 0x00
console.log(testnet.pubKeyHash);     // 0x6f

// Get network by name
const network = getNetwork('mainnet');

// Electrum servers
console.log(ElectrumServers.mainnet);
// [{ host: 'electrum.radiant.ovh', port: 50002, protocol: 'ssl' }, ...]

Radiant-Specific Opcodes

This package includes all Radiant-specific opcodes not found in Bitcoin:

Native Introspection (0xC0-0xCD)

  • OP_INPUTINDEX - Push current input index
  • OP_TXVERSION - Push transaction version
  • OP_TXINPUTCOUNT - Push number of inputs
  • OP_TXOUTPUTCOUNT - Push number of outputs
  • OP_UTXOVALUE - Push UTXO value at index
  • OP_UTXOBYTECODE - Push UTXO script at index
  • OP_OUTPUTVALUE - Push output value at index
  • OP_OUTPUTBYTECODE - Push output script at index
  • ... and more

Reference Opcodes (0xD0-0xED)

  • OP_PUSHINPUTREF - Push and track a reference
  • OP_REQUIREINPUTREF - Require a reference exists
  • OP_REFVALUESUM_UTXOS - Sum of values for a reference
  • OP_CODESCRIPTHASHVALUESUM_UTXOS - Sum by code script hash
  • ... and more

State Separator (0xBD-0xBF)

  • OP_STATESEPARATOR - Separates state from code script
  • OP_STATESEPARATORINDEX_UTXO - Get separator index
  • OP_STATESEPARATORINDEX_OUTPUT - Get separator index for output

License

MIT