Releases: echoprotocol/echojs-lib
Releases · echoprotocol/echojs-lib
Fix serialization of `contract_create_operation`
1.8.0-rc.2 Fix serialization of contract_create_operation (#85)
Fix serialization of `contract_create_operation`
1.6.3 Up version
Fix asset_issue_operation's serializer
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
andCACHE_MAPS
into typing of library's export - Fixed typing of
getAccountBalances
method's result
Other
Serializers
All serializers was restructured, rewrited and thrown to lib's export. There are documentation of cache options was added.
New structure of serializers:
- Basic
- Collections
- Chain basic
- Plugins
- Protocol Objects
- account
options
create
update
whitelist
transfer
addressCreate
price
priceFeed
- asset
options
bitassetOptions
create
update
updateBitasset
updateFeedProducers
issue
reserve
fundFeePool
publishFeed
claimFees
authority
- balance
claim
chainParameters
- committeeMember
create
update
updateGlobalParameters
- contract
base
create
call
transfer
fundPool
whitelist
update
ethAddress
feeParameters
feeSchedule
- proposal
create
update
delete
- sidechain
changeConfig
- eth
createAddress
approveAddress
deposit
withdraw
approveWithdraw
issue
burn
- erc20
registerToken
depositToken
withdrawToken
approveTokenWithdraw
- transfer
default
override
toAddress
- vesting
balanceCreate
policyInitializer
linearPolicyInitializer
cddPolicyInitializer
balanceWithdraw
voteId
VoteIdSerializer
- account
- Operation
Migration to [email protected]
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 alsoMap<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, thencb
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
Chain apis moved from root export of "constants/ws-constants" into exported enum ChainApi
of the same file.
Fix some methods and operations
- 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]
- 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
v1.4.1 >> v1.5.0 Changelog
Cache
In options of Echo instance added field cache
. Options of cache:
isUsed
(default totrue
) - if equals totrue
, lib will use cacheexpirationTime
(default to60*60e3
) - lifetime cached objects in seconds, equals to 1 hour by defaultminCleaningTime
(default to500
) - 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
[ECHOJS-83] CI/CD Implementation (#2)