Commit Graph

22 Commits

Author SHA1 Message Date
sairajzero
178fcf4ce2 Update database module
- Updated database module so that other modules can use it directly by require()
- use path module where-ever needed
- Fixed: public directory not viewed in browser when opening the link
2022-11-12 04:30:25 +05:30
sairajzero
e4adaf7ed7 Minor changes and Bug fixes
- deduce BTC fee from users
- If timeout rejected tx are confirmed, refund the asset
- Blockchain bond and Bob's fund withdraw now sends equivalent BTC to users (via BTC blockchain)
- Fixed minor bugs
- Changed toFixed (fn to limit the decimal) to toStandardDecimal (set_global.js)
2022-11-05 03:56:40 +05:30
sairajzero
76339f1621 Optimization and Bug fix
- Renamed all `status` columns to `r_status`
- r_status uses INT instead of VARCHAR
- status-codes are used instead of strings
- Codes for status and modes can be found at floExchangeAPI.processCode
- Merged DepositCoin, WithdrawCoin, DepositToken, WithdrawToken into VaultTransactions so that all deposit/withdraw transactions can be viewed in order
- Updated relevant SQL syntaxes for the above
- Converted all multi-valued placeholders in SQL queries to array based placeholders
- Fixed minor bugs
2022-10-20 04:23:35 +05:30
sairajzero
a193291bd7 APIs for coin-convert feature 2022-10-07 23:02:59 +05:30
sairajzero
fb9ac8080b Fixed: price storeHistory
- price.storeHistory interval will trigger only when node is master
2022-05-07 00:15:34 +05:30
sairajzero
54470b42d7 get-rates API improved
- 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
2022-05-07 00:03:36 +05:30
sairajzero
d3c5682994 Improved Triggers for coupling process
- 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)
2022-05-06 23:43:44 +05:30
sairajzero
6c86c0a94b Adding switch for rated-seller check 2022-05-01 19:49:22 +05:30
sairajzero
7092213826 Bug fixes
- 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)
2022-04-27 00:29:51 +05:30
sairajzero
deb746ef9e Increase decimal toFixed(8) 2022-03-30 20:38:08 +05:30
sairajzero
4967d52a88 Bug fix: rate history API not working 2022-03-30 05:49:43 +05:30
sairajzero
6451f02546 rate-history API 2022-03-30 05:38:55 +05:30
sairajzero
4416ab5ad3 Adding Blockchain refresh interval
- Added blockchain refresh interval
- Updating some constants
- Disabled various console.debug
2022-02-18 19:24:09 +05:30
sairajzero
15d36eb088 All Constants moved to _constants.js 2022-02-17 23:52:31 +05:30
sairajzero
2a125eb4d2 Verify backup data integrity
- 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)
2022-02-16 01:55:31 +05:30
sairajzero
ab3df761b0 Bug fixes
- 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)
2022-02-07 03:12:20 +05:30
sairajzero
048ab0667b Multi asset: initial price and other improvements
- 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
2022-02-05 20:23:36 +05:30
sairajzero
dbad25044a Multi-asset price.js 2022-02-03 05:46:26 +05:30
sairajzero
9feef5bfe9 Minor fixes
- Fixed bug: sell order placement not working.
- log the current_rate
- indicate when max price-up/down has reached.
2021-12-05 00:37:45 +05:30
sairajzero
d3b27348ee Bug fix
- Fixed various bugs in the last update
- Added 'use strict'; to multiple files to prevent undeclared variables
2021-12-03 20:09:40 +05:30
sairajzero
4a898e6bff Initial price
- 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
2021-12-03 01:45:59 +05:30
sairajzero
278fc8bcbd Price updation
- 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'.
2021-12-02 05:26:01 +05:30