Commit Graph

33 Commits

Author SHA1 Message Date
sairajzero
7d09babea7 Adding Coin-convert support
- Convert rupee token (currency) to coin (BTC) and vise-versa
2022-10-07 22:38:56 +05:30
sairajzero
bdd79a1a76 Adding support for BTC withdrawal 2022-09-30 05:52:30 +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
579d00b343 Update schema.sql 2022-04-21 14:05:22 +05:30
sairajzero
74b643fc08 Ambiguity fix
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
2022-04-18 21:07:15 +05:30
sairajzero
b56985810f Delete app-config.json 2022-04-17 03:52:59 +05:30
sairajzero
9331373faf Merge branch 'main' of https://github.com/ranchimall/exchange-market 2022-04-17 03:48:16 +05:30
sairajzero
f9551c856d Updating sell-requirement
- 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
2022-04-17 03:44:34 +05:30
sairaj mote
1e2971ac8e major UI changes 2022-03-29 18:37:26 +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
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
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
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
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
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
92caef2c37 Multi-asset: coupling process 2022-02-04 02:28:02 +05:30
sairajzero
67c31d79a9 Multiple asset support
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
2022-02-02 04:17:47 +05:30
sairajzero
cdc55dbdc9 Update truncateAll.sql 2022-01-26 02:22:33 +05:30
sairajzero
8c1aad3d28 Bug fixes
- Added lastTx table to SQL schema
- setup file 'reset-password' now accepts any private key (node keys)
- Fixed minor SQL syntax
2022-01-23 04:51:15 +05:30
sairajzero
52a1b3077d multi-node support
- 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
2022-01-23 03:24:27 +05:30
sairajzero
348cc989c9 Custom session for distributed servers
- Adding custom session login for the distributed server system.
- Added Sessions table to backup
2022-01-18 05:11:34 +05:30
sairajzero
abb82b0b34 Minor Fixes
- Adding tables to SQL schema
- Moved Kbucket usage from main.js to backup/head.js
- node Kbucket, ordered NodeList are calculated in backup/head.js
2022-01-14 04:52:41 +05:30
sairajzero
f1e9658007 Audit Transaction
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
2021-12-06 22:13:37 +05:30
sairajzero
1b6488bdd1 Adding foreign key attributes to SQL schema
- 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
2021-12-05 00:40:49 +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
744979fb2a Adding tables for Tags (groups) 2021-11-05 21:43:15 +05:30
sairajzero
f7584629b9 Bug fixes
- 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).
2021-10-21 21:08:12 +05:30
sairajzero
a7bab7ed6e Backup DB feature 2021-10-15 22:54:15 +05:30
sairajzero
96b9d3b6e9 Setup files
- 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
2021-09-29 04:14:02 +05:30
sairajzero
8c31de3ccc Config update
- private key and flo addr for the admin
- Adding token URL
2021-09-24 03:34:01 +05:30
sairajzero
80b9d36287 adding args and set_globals 2021-08-30 22:01:42 +05:30