Skip to content

Releases: echoprotocol/echojs-lib

Fix serialization of `contract_create_operation`

08 Oct 11:15
6415194
Compare
Choose a tag to compare
1.8.0-rc.2

Fix serialization of contract_create_operation (#85)

Fix serialization of `contract_create_operation`

27 Sep 10:47
Compare
Choose a tag to compare

Fix asset_issue_operation's serializer

09 Sep 09:24
bd2d89c
Compare
Choose a tag to compare

Fixes

  • Fixed two fields in asset_issue_operation serializer:
    • asset_to_issuer >> asset_to_issue
    • issuer_to_account >> issue_to_account
  • Fixed addOperation method second argument typing
  • Added OPERATIONS_IDS and CACHE_MAPS into typing of library's export
  • Fixed typing of getAccountBalances method's result

Other

  • Added test for asset_issue_operation
  • Added example of usage asset_issue_operation in docs
  • Using compiled library in some tests

Serializers

05 Sep 07:59
76bbea1
Compare
Choose a tag to compare

All serializers was restructured, rewrited and thrown to lib's export. There are documentation of cache options was added.


New structure of serializers:

Migration to [email protected]

22 Aug 09:03
Compare
Choose a tag to compare

Migration to [email protected]

  • New method check_erc20_token
  • Removed methods:
    • get_call_order;
    • get_limit_orders;
    • get_order_book;
    • set_settle_orders;
    • subscribe_to_market;
    • unsubscribe_to_market.
  • Removed fields:
    • getFullAccounts result:
      • referrer
      • lifetime_referrer_name
      • cashback_balance
      • limit_orders
      • call_orders
      • settle_orders
      • withdraws
    • Network config:
      • lifetime_referrer_percent_of_fee
      • lifetime_referrer_percent_of_fee
      • cashback_vesting_threshold
      • count_non_member_votes
      • allow_non_member_whitelists
      • fee_liquidation_threshold
    • ChainProperties:
      • num_special_accounts
      • num_special_assets

Serializer:

  • map_t able to serialize not only [key, value][], but also Map<key, value> and { [key: string]: value } (last one is able to use if key can be serialized from string)

New fee_parameters for operations:

  • change_sidechain_config_operation;
  • account_address_create_operation;
  • transfer_to_address_operation;
  • generate_eth_address_operation;
  • create_eth_address_operation;
  • deposit_eth_operation;
  • withdraw_eth_operation;
  • approve_withdraw_eth_operation;
  • contract_fund_pool_operation;
  • contract_whitelist_operation;
  • sidechain_issue_operation;
  • sidechain_burn_operation;
  • register_erc20_token_operation;
  • deposit_erc20_token_operation;
  • withdraw_erc20_token_operation;
  • approve_erc20_token_withdraw_operation;
  • contract_update_operation.

Fixed bugs:

  • Apis are registered twice on "reconnect" method call
  • When the connection is broken, after its restoration, if setStatusSubscribe('connect', cb) was called before the connection, then cb is called before re-registering the api.
  • Invalid url's port validator

Tests of:

  • Error "connection closed" on disconnect while updating cache
  • Subscriber

All operations typing

19 Aug 11:31
Compare
Choose a tag to compare

Chain apis moved from root export of "constants/ws-constants" into exported enum ChainApi of the same file.

Fix some methods and operations

16 Aug 17:28
Compare
Choose a tag to compare
  • Fix ASSET_CREATE operation
  • Fix ACCOUNT_CREATE operation serialization
  • Fix tests
  • Fix "extensions" serialization
  • Fix nested operations serialization
  • Tests of:
    • field "extensions"
    • serialization errors of:
      • array
      • set
      • optional
      • static_variant
      • operation
      • serializable object
    • result of SerializableSet#validate
  • remove address_auth from docs

Start migration to [email protected]

16 Aug 08:31
Compare
Choose a tag to compare
  • Change/Remove some operations id
  • Change/Remove some protocol's and implementation's objects' ids
  • Fix getFullAccounts method

Changes in cache, subscriber and constants; Changing typings

09 Aug 09:08
0b3e6bc
Compare
Choose a tag to compare

v1.4.1 >> v1.5.0 Changelog

Cache

In options of Echo instance added field cache. Options of cache:

  • isUsed (default to true) - if equals to true, lib will use cache
  • expirationTime (default to 60*60e3) - lifetime cached objects in seconds, equals to 1 hour by default
  • minCleaningTime (default to 500) - minimum cleaning interval in seconds, equals to half of a second by default

If cache field is not provided, default values will used.

If cache equals to null, cache will not used.

If expirationTime equals to null cache will not been cleaned.

Subscriber

Now subscriber field of Echo's instance available before connection will be established.

Handling connection closing

Added method handleConnectionClosedError. Example of usage:

const { default: echo, handleConnectionClosedError } = require("echojs-lib");
echo.connect('ws://127.0.0.1:6311').then(() => {
	echo.api.getFullAccounts(['1.2.6'])
		.catch((err) => handleConnectionClosedError(err, () => console.error('connection closed')))
		.catch((err) => console.error('unknown error:', err));
});

Changed serialization errors messages

Added path to errored field. Example:

operation with id 40: key "extensions": optional type: array element with index 0: serialization is not implemented

Duplication of constants in default is removed

Examples:

const { default: chainConfig } = require("echojs-lib/dist/constants/chain-config");
const { ADDRESS_PREFIX } = chainConfig;

/* becomes */

const { ADDRESS_PREFIX } = require("echojs-lib/dist/constants/chain-config");
const { default: chainConfig } = require("echojs-lib/dist/config/chain-config");
const { LENGTH_DECODE_PUBLIC_KEY } = chainConfig;

/* becomes */

const { LENGTH_DECODE_PUBLIC_KEY } = require("echojs-lib/dist/config/chain-config");
const { default: chainTypes } = require("echojs-lib/dist/constants/chain-types");
const { IMPLEMENTATION_OBJECT_TYPE } = chainTypes;

/* becomes */

const { IMPLEMENTATION_OBJECT_TYPE } = require("echojs-lib/dist/constants/chain-types");
const { default: constants } = require("echojs-lib/dist/constants");
const { CACHE_MAPS } = constants;

/** becomes */

const { CACHE_MAPS } = require("echojs-lib/dist/constants");
const { default: wsConstants } = require("echojs-lib/dist/constants/ws-constants");
const { REGISTRATION_API } = wsConstants;

/** becomes */

const { REGISTRATION_API } = require("echojs-lib/dist/constants/ws-constants");

Other changes

  • Fixed "extensions" field serialization
  • Fixed contracts history updating in cache
  • Fixed declaration files
  • Changed error message when user try to use api which is not active
  • Method Api#getFullContract optimized
  • Catch "connection closed" error of contract history updating in cache
  • Catch "connection closed" error of account updating in cache
  • Move "connection closed" error message in ws-constants
  • Removed getSidechainTransfers method
  • Fixed object_id validator

v1.4.2

02 Aug 12:21
1044094
Compare
Choose a tag to compare
[ECHOJS-83] CI/CD Implementation (#2)