- Check for sell-chips's base price when placing sell order.
- Returns 'Cannot sell below purchased price' when not enough sell-chips above the base for placing order
- get-rates API will now give a countDown timer
- this will be time at which next price update will happen unless a trade occurs
- Update: _constants.js for previous update
- moved periodic-process start/stop to market.js
- price.getRates() will update price only when updatePrice is true (ie, regular fn call wont update price unnecessarily)
- Trigger coupling for asset on successful order placement
- Return (or wait) if a coupling instance is running for asset
- Reset timeout when price is updated and/or trade has happened.
- Next coupling instance will be set for timeout upon completion of one instance
- Stop all coupling instances on app pause (i.e., node is not master)
- The API for Listing sell/buy orders now returns ordered list of the queue (approx).
- list-buyorders, list-sellorders and list-trades API now accepts optional GET parameter 'asset'.
. If passed, then orders/trades of only given asset will be returned.
. If asset is not passed, then returns all asset by default as before.
- list buy/sell order API return max of 100 best orders
- list trade API return max of 1000 recent trades
- Fixed: Trade balance not updated correctly
- Fixed: sell-chips were not checked correctly on placing sell orders
- Fixed: sell-chips not added when distributed
- Fixed: sell-chips (FLO) not added when deposited by launch-seller
- Fixed various bugs
- initialPrice will be added to priceHistory table (initially)
Changes to remove ambiguity of data during backup system
- Converted all Float and Decimal to DECIMAL(16, 8)
- Converted Datetime to Timestamp
- Fixed: Storing time data in backup
- Users can only sell when enough sell-chips (for asset) are available.
- sell-chips are obtained by
. buying assets
. receiving asset from distributor
. deposit (FLO only) as launch-seller (maximum of 1 million)
- Updated coupling for the requirement
- Improved getBestSeller and getBestBuyer: Directly fetch from SQL query
- Removed group.js (moved required functions to market.js)
- Updated SQL schema
- Distributor feature allows to mark floIDs as distributors for certain asset.
- Added 2 APIs: add-distributor, remove-distributor
- Changing structure for token balance in exchange system. (requirement for new rule update).
Added: get-balance API to fetch total balance
- accepts 2 parameters: floID and token. Requires atleast one of them for the API to work
/get-balance?floID=<floID>&token=<token> : responses balance of a specific token for a floID
/get-balance?floID=<floID> : responses all token balance for a floID
/get-balance?token=<token> : reponses balance of a specific token for every floID
Note (optional): in GET request
- floID=<floID> can be replaced with addr=<floID>
- token=<token> can be replaced with asset=<asset>
Both responses the same result as above
- Fixed: transferToken not processed by server
- blockchainReCheck stops and adds itself to Timeout callback when sinkID is not loaded (uses MINI_PERIOD_INTERVAL = PERIOD_INTERVAL/10 for timeout ms)
- Fixed: confirmDepositFLO - asset attribute missing in SQL syntax
- When sinkID is not loaded, cancel check for confirmDepositFLO and confirmDepositToken
- Fixed: Incorrect receiver (sinkID) bug in confirmDepositFLO.checkTx
- Uncommented loaded, received, retrived sink logs
- Changed (SQL schema) sign field in RequestLog table to VARCHAR(160)
- Fixed: minor syntax errors and typos bugs
Moved all public/ to docs/ so that github pages can be hosted on docs/ alone
- Moved floGlobals.js, lib.js, floCrypto.js, floBlockchainAPI.js, tokenAPI.js, KBucket.js to docs/scripts/
- Renamed api.js to exchangeAPI.js and moved to docs/scripts/
- Moved index.html to docs/
- Moved css components to docs/css
- Updated all imports for the above changes.
- User pages (index.html) uses floCrypto.js and floBlockchainAPI.js in docs/script dir instead of fetching from cdn
- receiver parameter now requires an object in the format
{floID1: amount1, floID2: amount2 ...}
- Transaction hash (id) for both trade and transfer transactions are now generated using SHA of JSON-string object
- Updated schema for one-to-many TransferTransactions
- Users can directly login or request without the need for user registration.
- Users can sign the requests either directly with own privateKey or by using a proxy
- Request's timestamp will be checked for Sign expiry.
- Request's sign will be checked for duplication.
- Cash table update will try to insert if record is not there
- Request Log table will also store a boolean value for sign by proxy or not
- Updated the SQL schema for the above changes.
- Transaction details can be fetched using the following API
/get-transaction?txid=<txid>
- Get rates now accepts parameter 'asset' (optional) to return rate of particular asset.
/get-rates?asset=<asset>
/get-rates
- Get transactions (trade) API is changed to the following
/list-trades
Transfer tokens
- Added transferToken: Users can directly transfer tokens (including FLO) to other registered users.
- Updated schema changes for the above requirement.
- Trade transactions and transfer transactions will generate a txid (using SHA256).
Other changes
- changed all signing type to lowercase
- Sell requirement checks for respective asset for minimum buy
- Minimum buy is set to 0 (for exchange startup)
- Fixed: buy/sell orders sorted incorrectly by time_placed (should be FCFS. ie, ASC)
- Fixed: Buy/sell order placement not working in UI
- Fixed: Buy order placement not checking the cash balance properly
- Fixed: Re-sync not working properly
. (Master) Typo in SQL syntax
. (Master) Incorrect index of data sent by master
. (Slave) Invalid request send when requesting re-sync
- Removed counts for add, delete packets and total-add (As resync uses diff count)
When table data needs resync (ie, when checksum fails), Instead of requesting the entire data, following procedure is done
- row-group (based on id column) hashes is requested from master
- hashes are checked on the DB
- request chunks that have failed hash check
- Backup data integrity is verified using Checksum for each table
- If checksum mismatch is found (for a table) after a backup sync, the table data is cleared and re-synced
- Moved backup sync module to backup/sync.js
- Fixed: checkForRatedSellers not using correct asset when checking for rated sellers
- Others: priceHistory is converted toFixed(3) before storing in DB. (As large/non-terminating decimals cause ambiguity btw nodes during checksum)
- Same sink is used across nodes (sink is generated only when exchange starts for the 1st time)
- Shares as encrypted before sending to nodes (also store encrypted share in DB)
- Load share/key from DB (if available) when node starts
- share-threshold is calculated based on number of alive nodes
- Fixed: Shamirs algo fails when threshold is less than 2 (used round-about)
- Fixed: Minor bugs
- Fixed bugs in deposit and withdrawal
- Added UI select option for token selection on deposit and withdrawal
- Added UI style to buy/sell asset selection
- Removed: Immutable table-type (Previously immutable tables are now considered as mutable tables in backup feature)
- Backup sync-data from master are temporally cached and then processed after receiving all sync-data
- Backup sync-data from cache are now processed in ordered manner (to prevent foreign key constrain error, repeated data, re-adding a deleted data)
- Updated SQL Schema
- Fixed: SQL schema asset foreign key incorrectly referenced
- Fixed: initial rate of asset not loading correctly from DB
- Fixed: get-rate API returning [object Object] instead of rates
- Fixed: Bug where transaction-loop happens with 0 quantity
- Improved: spendAsset to use assets NULL/Non-NULL base correctly
- Fixed: minor typos, syntax errors and SQL query errors
User-pages:
- Added: UI fields for assets in Buy/Sell orders
- Updated: UI display of correct asset in listing orders and transactions
- Updated: localStorage keys are prefixed 'exchange-'
- Fixed: Rates and Balance amount not displayed correctly
Others:
- Added: temporary code for tracing output lines in set_globals.js (commented out by default)
- Read blockchain for asset's initial price
- Transfer all tokens to new sink on master transfer
Other Improvements:
- Slave: close existing backup sync when master WS closes
- Updated SQL schema, updated SQL syntax as required
2 types of property:
1. Cash - main/central currency used for trading
2. Asset - (FLO/tokens) Can be brought or sold in the exchange market .
- Allow multiple tokens to act as asset in addition to FLO.
- Changes required for the above in deposits, withdraws, placing orders
- some code optimization in market.js
- Updated SQL schema
- Upon receiving responseError INCORRECT_SERVER_ERROR, reload the client page.
(Triggered mainly when master is changed).
- Fixed some minor syntax bugs
Fixed Client page bugs:
- Fixed minor bugs in client side pages
- client page to use floGlobals.js
- moved KBucket.js to public (as its need by client page too).
Fixed Server Bugs:
- Added Access-Control-Allow-Origin to response headers
- Fixed: trustedIDs not loaded
- Fixed minor bugs (syntax errors)
Case: No other node active when self node is init
- Start the exchange system.
Case: When node becomes master when prev node goes down
- Add self share to collectShare
- collect shares from other node to re-construct sink private key
- Fixed some minor bugs
- Run multiple nodes in the same directory with diff config files
- pass the env variable 'I' (optional) to run a diff node instance with config file config<I>.json (also uses keys<I>.json)
- Updated setup files
- Fixed bugs in SQL schema
Store the following values upon successful transaction
- Timestamp
- Quanity, unit value, total cost
- Old/New Balance of Rupee and FLO for both seller and buyer
- All floID based columns (floID, seller, buyer) are now foreign keys with reference to User.floID
- tag in Tags table is now referred to tag in TagList
- Indicate the error when adding user tags via API
- load init price from DB if possible, else fetch from API
- store the price history in DB every 1 hr
- get the 24hr-past-rate from DB
- update the last tx timestamp upon successful transaction
- added priceHistory table to SQL schema and backup
- Update current_price when no seller or buyer available.
- Inc price only when sell-orders from rated sellers are available.
- User must buy a minimum FLO before placing a sell order unless they are a 'Miner'.
- Fixed: error caused during inputRupee
- Passing timezone UTC in DB connection for uniformity between main server and backups.
- Changed single-line comments to multi-line comments in schema.sql
- Addng truncateAll.sql: can be used to clear the database (data only).
- Adding setup files to configure, set password.
- Private key will now be stored in encrypted shares. Password will be required for running the server.
- Automated creation of MySQL schema.
- Making floGlobals common for both server and client.
- Fixed a minor bug in database.js
- Uses the proxy public key sent by the users upon login to verify signatures on requests.
* This allows the users to not store their actual private key in the browser. Only the proxy private-key will be needed to be stored in the browser in addition to respective session data.
- Stores the request data and respective signatures upon successful processing.