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 🙏

© 2024 – Pkg Stats / Ryan Hefner

chia-condition-codes

v1.0.7

Published

Named condition codes for chia-lisp

Downloads

28

Readme

Readme for Chia Blockchain Conditions

Installation

Install the package from npm:

npm install chia-condition-codes

Usage

After installation, you can import the enum into your project:

const { ConditionCodes } = require('chia-condition-codes');

OR

import { ConditionCodes } from 'chia-condition-codes';

Use the enum in your code like so:

const solution = Program.fromSource(`(${ConditionCodes.CREATE_COIN} 300000 (${hint} ${memos.join(" ")}))`);

Conditions Enum

The package exports an enumeration of various conditions used in the Chia blockchain. Each condition represents a specific rule or requirement in Chia's smart contract programming:

  • REMARK: Always valid. No parameters.
  • AGG_SIG_PARENT: Verifies a signature with the parent coin id. Part of CHIP-0011.
  • AGG_SIG_PUZZLE: Verifies a signature with the puzzle hash. Part of CHIP-0011.
  • AGG_SIG_AMOUNT: Verifies a signature with the amount of the coin.
  • AGG_SIG_PUZZLE_AMOUNT: Signature verification with puzzle hash and amount.
  • AGG_SIG_PARENT_AMOUNT: Signature verification with parent coin id and amount.
  • AGG_SIG_PARENT_PUZZLE: Signature verification with parent coin id and puzzle hash.
  • AGG_SIG_UNSAFE: Basic signature verification without domain strings.
  • AGG_SIG_ME: Verifies a signature with the coin id.
  • CREATE_COIN: Creates a new coin output.
  • RESERVE_FEE: Ensures minimum fee is reserved.
  • CREATE_COIN_ANNOUNCEMENT: Creates a coin announcement.
  • ASSERT_COIN_ANNOUNCEMENT: Asserts a coin announcement.
  • CREATE_PUZZLE_ANNOUNCEMENT: Creates a puzzle announcement.
  • ASSERT_PUZZLE_ANNOUNCEMENT: Asserts a puzzle announcement.
  • ASSERT_CONCURRENT_SPEND: Asserts concurrent spending of a coin.
  • ASSERT_CONCURRENT_PUZZLE: Asserts spending in the same block with a specific puzzle hash.
  • ASSERT_MY_COIN_ID: Asserts the coin's id.
  • ASSERT_MY_PARENT_ID: Asserts the coin's parent id.
  • ASSERT_MY_PUZZLE_HASH: Asserts the coin's puzzle hash.
  • ASSERT_MY_AMOUNT: Asserts the coin's amount.
  • ASSERT_MY_BIRTH_SECONDS: Asserts the coin's creation time in seconds.
  • ASSERT_MY_BIRTH_HEIGHT: Asserts the coin's creation block height.
  • ASSERT_EPHEMERAL: Asserts the coin's creation within the current block.
  • ASSERT_SECONDS_RELATIVE: Asserts the time passed since the coin's creation.
  • ASSERT_SECONDS_ABSOLUTE: Asserts a specific timestamp.
  • ASSERT_HEIGHT_RELATIVE: Asserts the block height passed since the coin's creation.
  • ASSERT_HEIGHT_ABSOLUTE: Asserts a specific block height.
  • ASSERT_BEFORE_SECONDS_RELATIVE: Asserts a time before a relative timestamp.
  • ASSERT_BEFORE_SECONDS_ABSOLUTE: Asserts a time before an absolute timestamp.
  • ASSERT_BEFORE_HEIGHT_RELATIVE: Asserts a block height before a relative height.
  • ASSERT_BEFORE_HEIGHT_ABSOLUTE: Asserts a block height before an absolute height.
  • SOFTFORK: Allows for future conditions as soft forks.

For complete documentation on all conditions, please refer to Chia Blockchain Conditions Documentation.