JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q71223F
  • License MIT

The common o1js utilities for Nacho.

Package Exports

  • nacho-common-o1js
  • nacho-common-o1js/build/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (nacho-common-o1js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

nacho-common-o1js

The common o1js utilities for Nacho.

nacho-common-o1js package is intended to be used for Nacho only as it contains naive implementations of the things Nacho needs.

📦 Installation

If you are using npm:

npm install nacho-common-o1js

If you are using yarn:

yarn add nacho-common-o1js

If you are using pnpm:

pnpm add nacho-common-o1js

🔍 Details

Nacho's common o1js utilities are some provable data structures, functions and constant values.

🧱 Provable Data Structures

  • Balance:

    Represents a token balance of a user in the layer 2.

  • Burn:

    Represents a token burn of a user in the layer 2.

  • Deposit:

    Represents a token deposit of a user in the layer 1.

  • DoubleBalanceWitness:

    Represents the witness of two leaves in the Merkle tree that storesbalances.

  • Liquidity:

    Represents an AMM pool liquidity of a user in the layer 2.

  • Pool:

    Represents an AMM pool in the layer 2.

  • SingleBalanceWitness:

    Represents the witness of a leaf in the Merkle tree that stores balances.

  • SingleBurnWitness:

    Represents the witness of a leaf in the Merkle tree that stores burns.

  • SingleLiquidityWitness:

    Represents the witness of a leaf in the Merkle tree that stores AMM liquidities.

  • SinglePoolWitness:

    Represents the witness of a leaf in the Merkle tree that stores AMM pools.

  • SingleWithdrawalWitness:

    Represents the witness of a leaf in the Merkle tree that stores withdrawals.

  • StateRoots:

    Represents the Merkle roots of the layer 2's state in the layer 1.

  • Withdrawal:

    Represents a token withdrawal of a user in the layer 1.

🛠️ Provable Functions

  • addOnePerMilFee:

    Multiplies the given number by 1.001.

  • choose:

    Equivalent of conditional operator.

  • normalDiv:

    Normal division operation on field elements.

  • putInOrder:

    Swaps the order of given elements based on given the condition.

🏷️ Constant Values

📝 License

This project is licensed under the MIT License.

You may use the source code of this project accordingly.

👤 About Me

I am Berzan and I am developing Nacho to express my skills in the real world.

I built this library to use inside Nacho.