Skip to content

Releases: Chia-Mine/clvm-js

v3.0.0

15 May 14:27
18cfeec
Compare
Choose a tag to compare

This version is compatible with 960f8d139940fa0814d3fac44da9a2975642f5d3 of clvm

Breaking Change

  • The type of None is now undefined (Previously it was null)
  • Removed isSExp() and isCLVMObject() since these don't exist in the Python's clvm and they brought slightly different behaviour.
  • run_program() has been deprecated. Use run_chia_program or run_clvm instead.
    Note: run_program() is still available, but it cannot handle new CHIP-0011 operators like secp256k1_verify.

Changed

  • Now op_div does not accept negative operands.
  • convert_atom_to_bytes() now is able to convert an object which has toBytes() method.
  • SExp can be initialized from LazyNode of clvm_wasm (Rust version of clvm)
  • Upgraded bls-signatures to 2.0.3
  • Upgraded npm dev dependencies
  • Replaced yarn.lock with pnpm-lock.yaml

Added

  • Added clvm_rs(clvm_wasm) support
    • Exposed run_chia_program
    • Exposed run_clvm
    • Exposed LazyNode
      • Added toJSON() method to LazyNode (This is not implemented in clvm_wasm)
    • Exposed Flag
    • Exposed serialized_length
    • Exposed node_from_bytes
  • Added asUint8Array() method to Stream
  • Added toJSON() method to Bytes
  • Added toJSON() method to SExp
  • Added tests
  • Added example code

Known Issues

  • Loading blsjs.wasm into a web browser from ESModule code requires to put the wasm file into url's root path.
    For example, when the main (compiled) js file is loaded by
    <script type='module' src="https://xxx.yyy.zzz/aaa/bbb/ccc/main.js"></script>
    blsjs.wasm will be fetched from https://xxx.yyy.zzz/blsjs.wasm.
    This is module context only. if the main js file is not on module context like
    <script defer src="https://xxx.yyy.zzz/aaa/bbb/ccc/main.js"></script>,
    blsjs.wasm will be fetched from https://xxx.yyy.zzz/aaa/bbb/ccc/blsjs.wasm.
    However, with clvm >= 3.0.0, most of bls operations run inside clvm_wasm_bg.wasm.
    So I believe you don't need to load blsjs.wasm in most cases.

v2.0.1

03 Nov 13:31
a5b8a17
Compare
Choose a tag to compare

This version is compatible with 480b32840c525e17b5ab2f29036c033febaae71e of clvm

Changed

  • Changed error message format if argument of x is a single atom.
    For example, when you run (x (q . 2000)), output will be
    (Prev) FAIL: clvm raise (2000) => (Now) FAIL: clvm raise 2000

v2.0.0

20 Jul 13:47
bdf6d28
Compare
Choose a tag to compare

This version is compatible with fc73cd9dc2fc30a1fd461d0f05af9f9679e042c8 of clvm

Breaking Change

The behaviour of op_div has changed. See detailed explanation here

Changed

  • Made op_div bug-compatible with clvm_rs
  • Replaced npm package @chiamine/bls-signatures with bls-signatures

v1.0.9

02 Dec 19:44
8a27f56
Compare
Choose a tag to compare

This version is compatible with 389efa3fbe65c77600da63c78d29c0866d292754 of clvm

Fixed

  • Fixed an issue of as_javascript with tuples inside tuples and ending with 0

v1.0.8

04 Sep 12:35
a74dccc
Compare
Choose a tag to compare

This version is compatible with 2722c78ddb92f067c5025196f397e4d2955f9053 of clvm

Fixed

  • Fixed typo in error message
  • Fixed an issue where op_substr did not work as expected.
  • Fixed an issue where cost calculation for op_subtract was not correct.
  • Fixed limbs_for_int return wrong value when argument is 0.
  • Fixed an issue where Bytes comparison returns wrong result in some cases.
  • Fixed an issue where op_softfork crashed with argument atom larger than or equal to 53bit.
  • Fixed G1Element error message.

v1.0.7

03 Sep 13:46
a9fdc12
Compare
Choose a tag to compare

This version is compatible with 2722c78ddb92f067c5025196f397e4d2955f9053 of clvm

Added

  • Added type declaration file browser/index.d.ts on build.

Changed

  • Changed SExp/CLVMObject properties atom and pair to readonly to prevent potential bug.
  • Changed src/__bls_signatures__.ts location to src/__bls_signatures__/index.ts to prepare for future wasm-loading tweaks.
  • Upgraded @chiamine/bls-signatures to 0.2.1-beta.2.
  • Use CLVMType instead of CLVMObject as a valid type representation of CLVMObject.
    (CLVMObject should not be used as a type because there might be number of type incompatibility due to new private field)

v1.0.6

17 Aug 14:37
c15fdd4
Compare
Choose a tag to compare

This version is compatible with ab4560900cf475ff515054bec0ca9a4491aca366 of [email protected]

Changed

  • Improved bigint_from_bytes around 3-10 times faster.
  • Improved int_from_bytes performance.
  • Improved bigint_to_bytes around 2 times faster.
  • Improved int_to_bytes performance.

Fixed

  • Fixed an issue where utility function division/modulo returned wrong values in some cases.

Added

  • Added divmod utility function.

v1.0.5

14 Aug 09:40
1223fde
Compare
Choose a tag to compare

This version is compatible with ab4560900cf475ff515054bec0ca9a4491aca366 of [email protected]

Fixed

  • Fixed an issue where op_lsh did not work as expected.

v1.0.4

13 Aug 17:52
8fbe3fd
Compare
Choose a tag to compare

This version is compatible with ab4560900cf475ff515054bec0ca9a4491aca366 of [email protected]

Fixed

  • Fixed an issue where int_from_bytes and bigint_from_bytes returned always signed int/bigint.
  • Fixed an issue where int_to_bytes and bigint_to_bytes blindly recognized the argument as a signed int/bigint.

v1.0.3

12 Aug 17:57
a08bf80
Compare
Choose a tag to compare

This version is compatible with ab4560900cf475ff515054bec0ca9a4491aca366 of [email protected]

Fixed

  • Fixed an issue where op_logand, op_logior, op_logxor did not work
  • Fixed an issue where result of div/mod against negative bigint was not compatible with original clvm