Commit Graph

718 Commits

Author SHA1 Message Date
sairajzero
fa46e1132f Bug fix: getRate for an asset not working 2022-03-29 15:53:01 +05:30
sairajzero
a939545e31 Bug fix: floCloudAPI v2.1.3a 2022-03-23 18:10:44 +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
481ec83f78 floBlockchainAPI v2.2.1a | floCloudAPI v2.1.3
floBlockchainAPI v2.2.1a
- Minor bug fixed: Out of bound index when handling unconfirmed transactions in readData

floCloudAPI v2.1.3
- fetching object-data will now properly check for correct object when updating in local and ignores vc that have been parsed previously
- fetching general-data will now use afterTime instead of lowerVectorClock (thus, any change in tag/note is reflected in it).
  . existing apps will automatically change the stored lastVC of generalData to respective afterTime value
- Fixed: objectifier not called on singleRequests for objectData and generalData
2022-03-08 04:28:40 +05:30
sairajzero
e2d8abe347 Update floBlockchainAPI.js 2022-03-08 02:30:21 +05:30
sairajzero
ecb4266a89 floBlockchainAPI_v2.2.1 | floCloudAPI_v2.1.2a
(Bug fixes)
floBlockchainAPI v2.2.1
- Fixed: Unconfirmed transaction (propably dropped) causing new transaction not to be read in readData

floCloudAPI v2.1.2a
- Fixed: singleRequest not returning response correctly
- Fixed: afterTime optional parameter not added in requests
- Fixed: setStatus and requestStatus not working
2022-03-08 02:19:15 +05:30
sairajzero
85baa8e6e1 floCloudAPI v2.1.2
Added support for status feature
1. setStatus(options): set status as online for myFloID
2. requestStatus(trackList, options) : request status of floID(s) in trackList
- Both uses websocket connection
- resolves a reqID (local) that can be used in closeRequest function
- Use callback parameter in options to use the response from cloud

Added support for note feature
1. noteApplicationData(vectorClock, note): add/edit a note for a data in cloud
- Only allows receiverID of the data to add/edit note
- subAdmin can use it as exception, when receiverID is adminID

Other changes
- Fixed issues of tagApplicationData (previously markApplicationData) not working.
- Fixed issue where senderID option not working correctly in requesting data from cloud (new cloud uses 'senderID' parameter for both array of floIDs or a single floID)
*NOTE: change senderIDs to senderID in apps if any*
2022-03-04 06:47:04 +05:30
Sai Raj
f99a97e53e
Merge pull request #7 from ranchimall/master
Update readme
2022-02-27 22:16:48 +05:30
sairajzero
6f47473408 Moved cryptocoin initialization to 'lib' script-tag 2022-02-27 22:10:49 +05:30
sairajzero
3f54c5aa5c Some minor fixes: floCloudAPI v2.1.1
- MarkApplicationData not working correctly when Array is passed
- Marking data should fetch to data's receiverID supernode
- findDiff and mergeDiff moved to bottom of floCloudAPI tag
2022-02-27 21:41:35 +05:30
sairajzero
0eb4d59dc3 Bug fix 2022-02-27 21:34:05 +05:30
sairajzero
10fa130229 Organizing scripts: floBlockchainAPI v2.2.0
- converted XMLHttpRequest to fetch request
2022-02-27 20:38:14 +05:30
sairajzero
3cb6c3f60c Organizing scripts: floCrypto v2.2.0 2022-02-27 20:33:51 +05:30
sairajzero
8094660f53 Organizing scripts: lib v1.2.0 2022-02-27 20:31:15 +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