Commit Graph

128 Commits

Author SHA1 Message Date
sairajzero
80879a250b Bug fix
- Fixed: incorrect eCode file mapped
- moved productStr inside IIF
- Fixed: some minor syntax bugs
2022-10-11 03:05:04 +05:30
sairajzero
7c99f41e48 API for close-blockchain-bonds 2022-10-10 19:23:20 +05:30
sairajzero
90d2a4764e Close-Blockchain-bond support
- Adding feature to close blockchain bonds upon user requests (when lock-in period is over)
- Improved some syntax and structure of coding
2022-10-10 19:22:51 +05:30
sairajzero
fef11b4712 moving conversion.js into service folder 2022-10-09 23:08:48 +05:30
sairajzero
5344b79cdb Minor Syntax improvements
- Replaced convertDateToString() to new Date() as SQL queries accepts js-object Date
- Pass nested array for bulk insert in backup-restore
2022-10-08 19:13:50 +05:30
sairajzero
a193291bd7 APIs for coin-convert feature 2022-10-07 23:02:59 +05:30
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
1e8f2c17e7 Fix: invoking 'collectAndCall' for withdraws 2022-09-26 01:34:26 +05:30
sairajzero
dd232c5a71 Fixes: sinkID and sinkPrivKey usage 2022-09-25 02:28:08 +05:30
sairajzero
65f7a5d94e Improved sink-key management
- multiple sink keys supported
- sink keys are split and shared among nodes (master and slaves)
- when a key is required, master collects the shares from slaves and reconstructs. (key is removed from memory after usage)
2022-09-25 01:06:08 +05:30
sairajzero
078a3af051 Update market.js
- Removed floID field returned by get-transact API (as its already filtered by floID)
2022-05-25 04:14:09 +05:30
sairajzero
166778e7f8 get-transact API
- Get user's deposit and withdraw history (private request: ie, requires signing)
- Update floTokenAPI
2022-05-25 03:55:55 +05:30
sairajzero
56e571606c Update stdop 2022-05-25 02:31:31 +05:30
sairajzero
f73e96bb5a Update _constants.js
MAXIMUM_LAUNCH_SELL_CHIPS reduced to 100000
2022-05-24 17:26:17 +05:30
sairajzero
e09e25fbd4 Updating price up/down percentage 2022-05-14 19:31:16 +05:30
sairajzero
a77f7d77d6 Error codes
- Added error codes for floExchangeAPI
2022-05-12 01:40:31 +05:30
sairajzero
8722b6cb60 Issue Fix
- Trigger coupling on cancel orders
2022-05-08 01:54:10 +05:30
sairajzero
838a12b361 Bug fix
- Fixed: Timeout not called upon initial coupling
- 'Cannot sell below purchased price' incorrectly shown when its actually valid order placement
- UI: parsing of get-rates API (latest update)
2022-05-07 23:17:02 +05:30
sairajzero
09953d252a Optimised blockchainReCheck
- Check if a new block has come at start of blockchainReCheck
- Checks for confirmation of txns only when a new block in the blockchain
2022-05-07 01:23:55 +05:30
sairajzero
d444e96259 checkSellRequirement: sell-chip's base
- 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
2022-05-07 01:04:49 +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
d44531211a Bug Fix: list buy/sell giving error
Fixed: only_full_group_by error return by SQL statement
2022-05-04 15:16:18 +05:30
sairajzero
55bd121021 API for ordered list for sell/buy
- 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
2022-05-02 22:53:57 +05:30
sairajzero
3c97cb4810 Update _constants.js
- dec MAXIMUM_LAUNCH_SELL_CHIPS to 250K
- inc SIGN_EXPIRE_TIME to 5 mins
2022-05-01 20:18:03 +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
e88799f01f update std-op 2022-04-26 03:30:51 +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
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
sairajzero
9caf3fc9ec Distributor feature and Balance structure change
- 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).
2022-04-13 01:06:01 +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
fa46e1132f Bug fix: getRate for an asset not working 2022-03-29 15:53:01 +05:30
sairajzero
01dcd9b2d1 Bug fix
Fixed: Unable to process null returned from SQL SUM()
2022-03-22 14:11:55 +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
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
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
sairajzero
e2d8abe347 Update floBlockchainAPI.js 2022-03-08 02:30:21 +05:30