Releases: CityOfZion/neon-js
Releases · CityOfZion/neon-js
Update mint tokens scripts logic
Update mint tokens scripts logic to compare script hashes to determine order of scripts
Correct typescript typings
- Update typescript typings. They should be working correctly now.
a little hiccup to the past
- Fix
TxAttrUsage
not being imported properly.
Blast to the past
Patch pulling fixes from v3.x:
- push instead of unshift for
api.attachInvokedContractForMintToken
. - getPrices patch.
- update export name for
TxAttrUsage
. - Fix transaction attribute deserialization.
- Fix _emitNum emitting trimmed hex numbers.
Async encryption and better smart contract script creation
-
Wallet
- Implement encryptAsync and decryptAsync using a new scrypt library. Further work will be done to convert the existing encrypt/decrypt to use the new library.
- Claims object is now slicable, allowing users to break up the Claims object into smaller Claims.
-
Util
- Override more methods in Fixed8 to return Fixed8s.
- Update util functions to use Fixed8 internally.
-
API
- Mark
api.nep5.doTransferToken
for deprecation.
- Mark
-
Sc
- createScript now accepts an array of scripts to parse and concatenate.
-
Docs
- Start to overhaul docs to favor examples and integrating the reference into the main docs instead of having it as a standalone section.
-
Others
- NPM packages updated to latest.
-
Fixes
- Fix scryptParams to use n,r,p
- Update default RPC endpoints to use https
- Fix Account defaults
- Fix _emitNum emitting trimmed hex numbers
getThisFrom
-
API
- Expose the
loadBalance
method. This method allows the use of the dynamic API switch withinneon-js
for the external providers. - Implement the full set of APIs on neoscan. Neoscan is now complete and up to par with neonDB in terms of features.
- Expose
getXFrom
set of methods which follow the API config convention and is usable with the loadBalance function.
- Expose the
3.0.0
Fixed8 Fixed8 Everywhere
-
Logging
- Setup logging directed at
stdout
andstderr
. Logging package is loglevel. - Defaults to silent.
- Not exposed through semantic style currently.
- All deprecation messages are set to 'warn' level.
- See logging for more details.
- Setup logging directed at
-
Utils
- Fixed8: A new class extending bignumber.js that replaces all value storage in neon-js
- This class is now used for all classes that involves coin values with decimal places.
- Comes with helper methods such as
toHex
andfromHex
.import {u} from '@cityofzion/neon-js' // accepts numbers or string const num1 = new u.Fixed8(123.4567) const num2 = u.Fixed8.fromHex('0000000005f5e100') // 1 const num3 = num1.add(num2) // immutable console.log(num3.toString()) // '124.4567'
-
Wallet
Claims
is now a ES6 class. While it does not have any spceial methods for it now, it is one of the high level objects that we will be working with inneon-js
. This allows easy creation ofClaims
using the constructor by passing in a CLaims-like javascript object.components
have been created for the minor sub-components found inClaims
andBalance
. These methods are useful for us to rapidly create components that are usable withneon-js
methods. Refer to the wallet section for more information.- BREAKING Excess NEP2 functions are now fully deprecated. The list is
encryptWifAccount
,generateENcryptedWif
,encryptWIF
,decryptWIF
.
-
Transaction
- Update all methods to conform with the new Fixed8 classes. This also means that
neon-js
will not be compatible with just normal javascript objects anymore.
- Update all methods to conform with the new Fixed8 classes. This also means that
-
API
- BREAKING Update external API libraries (neonDB and neoscan) to return
Balance
andClaims
objects. Fixed8 will be used in the new models, making arithmetic operations very different from normal javascript numbers. - A bug has been discovered in
getPrice
. While it works for NEO and GAS, it will not work for any of the NEP5 tokens.getPrices
has been fixed for this bug. However, there is no easy fix forgetPrice
and thus, we will move forward with deprecatinggetPrice
in favor ofgetPrices
.
- BREAKING Update external API libraries (neonDB and neoscan) to return
-
Fixes
- fix getPrices by adding a limit=0 to the query.
- fix default Account.contract field not having the required shape.
- fix transaction attribute being deserialized wrongly.
2.3.1: Patch neonDB numbers
This cleans neonDB numbers before use.
2.3.0: All about the NEP5
-
Smart Contract
- Add OpCodes
APPEND
andREVERSE
.
- Add OpCodes
-
API
- Add
getPrices
to get multiple token prices with a single API call. - Update parsing of
api/getToken
to include case of empty string for parsing thedecimals
field. - Update
doMintToken
to include extra information required for future invokes. - Implement the API switch.
- Add
-
Fixes
- Fix
core.signTransaction
to check if input is a HEX private key. - Fix NEP5 tokens to parse by
decimals
field. - Fix default values for invocation exclusive component.
- Fix
-
Others
- Add docs build information to readme.
Token
Fixed doTransferToken