Commit Graph

316 Commits

Author SHA1 Message Date
sairajzero
deb746ef9e Increase decimal toFixed(8) 2022-03-30 20:38:08 +05:30
sairaj mote
c35220df7e making exchange UI mobile friendly 2022-03-30 20:18:42 +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
sairaj mote
d379006c31 Added FLOBNB as asset to UI 2022-03-30 00:50:45 +05:30
sairaj mote
6028e2b541 UI improvements 2022-03-29 23:58:10 +05:30
sairaj mote
1e2971ac8e major UI changes 2022-03-29 18:37:26 +05:30
Sai Raj
8380808c2c
Merge branch 'sairajzero:main' into main 2022-03-29 15:54:36 +05:30
sairajzero
fa46e1132f Bug fix: getRate for an asset not working 2022-03-29 15:53:01 +05:30
sairaj mote
8d0c31176f Fixed bug causing incorrect month being displayed 2022-03-22 17:14:58 +05:30
sairajzero
01dcd9b2d1 Bug fix
Fixed: Unable to process null returned from SQL SUM()
2022-03-22 14:11:55 +05:30
sairajzero
6702541254 minor bug fix
Fixed: K_Bucket not defined bug in user page
2022-03-21 16:30:25 +05:30
sairajzero
6add4625c8 Renaming files
Renamed tokenAPI to floTokenAPI
Renamed exchangeAPI to floExchangeAPI
2022-03-21 16:24:25 +05:30
sairajzero
5e074f5e1d warping exchange-api functions
- Warped exchange api functions into an object (works with both modules.exports and window (browser))
- Moved K_bucket.js into exchangeAPI.js
2022-03-21 16:20:33 +05:30
sairajzero
ef0599d915 get-balance API
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
2022-03-18 00:50:39 +05:30
sairajzero
a18ccf426e Added clearLocalStorage
- Added a UI button that clears local data
 . Useful to clear login credentials, nodelist, lastTx when stuck in some version change bugs
2022-03-17 19:17:52 +05:30
sairajzero
2b2c231f0b Bug fix
- Fixed: txid not stored in DB when retrying withdraw FLO
- UI: disabled all registration/signup buttons (as there is not need for signup)
2022-03-17 18:49:41 +05:30
sairajzero
eed495ab83 Bug fixes
- 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
2022-03-17 03:06:00 +05:30
sairajzero
4c6ae601ea Update lib.js 2022-03-16 02:20:56 +05:30
sairajzero
eeb3c70a10 Optimised request.js code 2022-03-16 02:11:36 +05:30
sairajzero
b229b6b3d5 Arranging files
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
2022-03-16 01:06:59 +05:30
sairajzero
1823a46a98 Transfer transactions now support one-to-many
- 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
2022-03-16 00:33:22 +05:30
sairajzero
f59c6b3f2a Removing need for user registration
- 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.
2022-03-15 04:06:43 +05:30
sairajzero
3296b16710 Get transaction details
- 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
2022-03-12 03:31:01 +05:30
sairajzero
0520791696 Adding transfer token feature
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
2022-03-12 02:25:31 +05:30
Sai Raj
136ba68b42
Merge pull request #6 from ranchimall/main
UI
2022-03-09 20:46:07 +05:30
Sai Raj
9ae1ea2602
Merge pull request #4 from sairajzero/main
Update floBlockchainAPI.js
2022-03-09 20:45:42 +05:30
sairajzero
e2d8abe347 Update floBlockchainAPI.js 2022-03-08 02:30:21 +05:30
Sai Raj
1097daba9b
Merge branch 'sairajzero:main' into main 2022-02-24 17:59:57 +05:30
sairajzero
f9f89d91d3 BugFix: consumeAsset - not working when using entire coin 2022-02-24 17:59:09 +05:30
sairaj mote
e864018553 UX fix 2022-02-19 18:32:02 +05:30
sairaj mote
9939beb555 UI fixes 2022-02-19 16:36:59 +05:30
sairajzero
2e209372a3 Renaming user-pages
home.html => index.html
fn.js => api.js
2022-02-19 00:36:24 +05:30
sairajzero
04ccf3d762 requests http:// to https:// 2022-02-19 00:32:14 +05:30
sairajzero
456c85c805 Bug fix 2022-02-18 23:09:41 +05:30
sairajzero
6aa5d13cc3 websocket ws:// to wss:// 2022-02-18 23:03:48 +05:30
sairajzero
4434ad6b3e Support for SQL version 5.7 2022-02-18 22:23:17 +05:30
sairajzero
53b47057ff Minor fixes
- 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)
2022-02-18 20:11:34 +05:30
sairajzero
af7d4c625d Adding official adminID: FMxYC7gYZhouzqtHZukGnPiQ8nvG4CMzXM 2022-02-18 19:24:58 +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
1fcd62f2e5 Slave: wait before sync on master-change
When Update master event occurs, master needs time to sync its missing data, so slaves should sync only after BACKUP_INTERVAL
2022-02-18 00:11:55 +05:30
sairajzero
15d36eb088 All Constants moved to _constants.js 2022-02-17 23:52:31 +05:30
sairajzero
a2dcfb27ce Bug fixes
- 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)
2022-02-17 22:53:03 +05:30
sairajzero
12e90abe8b Re-sync Improvements
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
2022-02-17 04:43:05 +05:30
sairajzero
d30603134f Sink threshold fix 2022-02-16 14:07:12 +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
0ff3f2a7fb Update Sink key transfer
- 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
2022-02-12 05:41:01 +05:30
sairajzero
cab65161ba Bug fix And UI for asset/token selection
- 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
2022-02-08 20:44:55 +05:30
sairajzero
a06c5b4c7b Backup Sync improvements
- 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
2022-02-08 06:26:03 +05:30
Sai Raj
3fb401a226
Merge pull request #5 from ranchimall/main
Readme
2022-02-07 03:43:20 +05:30