Releases: Chia-Mine/clvm-js
v3.0.0
This version is compatible with 960f8d139940fa0814d3fac44da9a2975642f5d3
of clvm
Breaking Change
- The type of
None
is nowundefined
(Previously it wasnull
) - Removed
isSExp()
andisCLVMObject()
since these don't exist in the Python'sclvm
and they brought slightly different behaviour. run_program()
has been deprecated. Userun_chia_program
orrun_clvm
instead.
Note:run_program()
is still available, but it cannot handle new CHIP-0011 operators likesecp256k1_verify
.
Changed
- Now
op_div
does not accept negative operands. convert_atom_to_bytes()
now is able to convert an object which hastoBytes()
method.SExp
can be initialized fromLazyNode
ofclvm_wasm
(Rust version ofclvm
)- Upgraded
bls-signatures
to2.0.3
- Upgraded npm dev dependencies
- Replaced
yarn.lock
withpnpm-lock.yaml
Added
- Added
clvm_rs
(clvm_wasm
) support- Exposed
run_chia_program
- Exposed
run_clvm
- Exposed
LazyNode
- Added
toJSON()
method toLazyNode
(This is not implemented inclvm_wasm
)
- Added
- Exposed
Flag
- Exposed
serialized_length
- Exposed
node_from_bytes
- Exposed
- Added
asUint8Array()
method toStream
- Added
toJSON()
method toBytes
- Added
toJSON()
method toSExp
- 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 fromhttps://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 fromhttps://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 loadblsjs.wasm
in most cases.
v2.0.1
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
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 withclvm_rs
- Replaced npm package
@chiamine/bls-signatures
withbls-signatures
v1.0.9
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
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 is0
. - 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
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
andpair
to readonly to prevent potential bug. - Changed
src/__bls_signatures__.ts
location tosrc/__bls_signatures__/index.ts
to prepare for future wasm-loading tweaks. - Upgraded
@chiamine/bls-signatures
to 0.2.1-beta.2. - Use
CLVMType
instead ofCLVMObject
as a valid type representation ofCLVMObject
.
(CLVMObject should not be used as a type because there might be number of type incompatibility due to new private field)
v1.0.6
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
This version is compatible with ab4560900cf475ff515054bec0ca9a4491aca366
of [email protected]
Fixed
- Fixed an issue where
op_lsh
did not work as expected.
v1.0.4
This version is compatible with ab4560900cf475ff515054bec0ca9a4491aca366
of [email protected]
Fixed
- Fixed an issue where
int_from_bytes
andbigint_from_bytes
returned always signed int/bigint. - Fixed an issue where
int_to_bytes
andbigint_to_bytes
blindly recognized the argument as a signed int/bigint.
v1.0.3
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 originalclvm