Skip to content

Releases: CityOfZion/neon-js

Dandylion

30 Apr 15:27
Compare
Choose a tag to compare
  • RPC

    • RPC Client now has the fields latency and lastSeenHeight and method ping().
    import {rpc} from '@cityofzion/neon-js'
    
    var client = new rpc.RPCClient(url)
    client.ping()
    .then(ms => {
      console.log(ms) // latency in milliseconds. Max of 2000 (default timeout for ping)
      console.log(client.latency) // This is an average of last 5 values retrieved using ping()
      console.log(client.lastSeenHeight) // This is filled whenever getBlockCount is called
    })
    • RPC Client now takes an extra argument config which exposes the underlying axios instance, allowing users to customize the axios configuration.
  • API

    • Add attribute and remark for signing empty transactions. Now if you use doInvoke for your token transfers, it will automatically setup your transaction to be accepted by the NEO node without the need for any asset inputs.
    • claimGas now accepts a claims property as an override for claims. This behavior is inline with sendAsset and doInvoke accepting balance overrides.
    • getRPCEndpoint now ensures that the returned endpoint is callable by doing a ping check internally. It will also cache the endpoint to return next time instead of repeatedly pinging every single healthy node.
  • Settings

    • Settings now contain timeout which setups the timeouts for ping and all rpc calls
  • Fixes

    • Fix faulty url in networks config file
    • Fix typings for strategy
    • Update neoscan.getMaxClaimAmount to use get_unclaimed endpoint

Heat Wave

09 Apr 08:40
a9dfaef
Compare
Choose a tag to compare
  • Fixes

    • wallet.decryptAsync to properly reject all errors
    • fix balancedApproach calculation strategy to consider bigger coins when insufficient small coins
    • Fix typo in typings

Cold Wave

03 Apr 06:49
055d91b
Compare
Choose a tag to compare
  • Transaction

    • Add calculation strategies to modify how inputs are selected. Current available strategies are smallestFirst, biggestFirst and balancedApproach. Currently only available as a global setting.
    import { tx, settings } from '@cityofzion/neon-js'
    
    // Change the strategy to use the biggest valued output available.
    settings.defaultCalculationStrategy = tx.calculationStrategy.biggestFirst
    // See all available strategies
    console.log(tx.calculationStrategy)

Change Of Heart

27 Mar 07:40
Compare
Choose a tag to compare
  • Wallet

    • Add scripthash support. Account now accepts scripthash as a constructor and isScriptHash is available as a verification method.
  • SC

    • Add arguments for handling specific ContractParam transformation. The first one to do this is Fixed8 which takes a decimals argument which adjusts the number to the number of decimals given. This is useful for contracts that use decimals places other than 8.

Return From Different Dimension

13 Mar 06:27
Compare
Choose a tag to compare
  • Docs

    • Add 2 new guides around doInvoke
  • Fixes

    • Fix script ordering for mintTokens
    • Remove new for Coin
    • Revert upgrade for bignumber.js
    • Fix typings and add typings check
    • Fix ScriptBuilder._emitString for large strings

Patch signature ordering

13 Mar 08:53
Compare
Choose a tag to compare

Macro Cosmos

11 Mar 04:31
Compare
Choose a tag to compare

3.4.0

  • Settings

    • There is now global settings that control how neon-js works. The first settings available are httpsOnly and networks.

      • httpsOnly is a boolean which will force neonDB and neoscan to return only https RPC nodes. Do note that an error will be thrown if no suitable nodes are found.
      • networks is an object containing every network configuration available for consumption. It comes default with MainNet, TestNet and CozNet. For now, these configurations only determine the neonDB/neoscan urls used for each network but they will serve more purposes in the future.
  • RPC

    • Network class representing a NEO network. This can be created by importing a protocol file or just manually entering the parameters. This is the new way which we can link neon-js to a private net that comes with a neoscan or neonDB setup.
  • Smart Contract

    • ScriptBuilder.toScriptParams allows you to reverse engineer a VM script back to its arguments. Due to the varied nature of the arguments, it is not possible to reverse it completely. More work has to be done on the user side to parse it in a meaningful manner.
    const sb = new sb.ScriptBuilder('00c1046e616d65675f0e5a86edd8e1f62b68d2b3f7c0a761fc5a67dc')
    const params = sb.toScriptParams()
    params = [{
          "scriptHash": "dc675afc61a7c0f7b3d2682bf6e1d8ed865a0e5f",
          "args": [
            "6e616d65", // 'name' in hexstring
            []
          ],
          "useTailCall": false
        }]
  • Wallet

    • New methods added for signing and verifying messages: signMessage, verifyMessage
  • Docs

    • Docs migrated to Docusaurus! This will make it easier to customize docs and also allow us to support Chinese as the alternative language.
  • Development

    • Upgraded dependencies to use webpack v4 and the new babel exports from its monorepo.
  • Fixes

    • Fix neonDB and neoscan getTransactionHistory. Do note that this can be considered a breaking change for some as the return structure has changed. However, this is considered a fix as the original return structure was not intended.
    • new Wallet to use default scrypt params when not provided.
    • Typescript typings refactored and cleaned up. Introduces the object-like interfaces which are the neon-js classes exported as plain javascript objects.

Mind Crush

27 Feb 07:25
Compare
Choose a tag to compare
  • Fix neoscan getMaxClaimAmount, getBalance and getClaims for invalid addresses
  • typings update for api.fillUrl
  • minor toString customizations

Brain Control

25 Feb 08:41
Compare
Choose a tag to compare
  • Fixes

    • Update typescript typings
    • Use user provided parameters when given for api core methods
    • Fix ScriptBuilder to accept empty string and zero value
    • neonDB to use get_all_nodes endpoint instead of best_node endpoint

Mind Control

20 Feb 04:33
Compare
Choose a tag to compare
  • API

    • Add support for manpulating smart contracts. This means that you can send assets from smart contracts. This support is currently enabled only in the core API methods sendAsset and doInvoke. This is currently experimental and is subject to breaking changes without notice (no minor version bump for changes to these).
    • Add support for config.account. You can now use Account in place of address and private key.
    • Add support for config.balance. You can use an old Balance object instead of retrieving a new one. Attaching a Balance object will cause the function to skip over the retrieval process.
  • Wallet

    • Add confirm to Balance object.
  • SC

    • Add ContractParam.hash160
  • Util

    • Add isHex and ensureHex as ways to conveniently check format of hexstrings.
  • Fixes

    • Add more logging messages throughout.
    • api.signTx now checks and converts the return value from external function to a Transaction object.
    • Fix regex string for rpc.getVersion.