Compare commits

...

478 Commits

Author SHA1 Message Date
sairaj mote
14eb4525ae UX improvement 2023-08-23 01:25:56 +05:30
sairaj mote
bc08c455da UI bug fixes 2023-08-15 20:06:41 +05:30
sairaj mote
0a49a735db Bug fix 2023-07-23 16:13:12 +05:30
SaketAnand
5e39a7ca99
Update README.md 2023-07-19 17:42:40 +05:30
sairaj mote
35f22f9e4d UX improvement and code refactoring 2023-07-18 19:49:58 +05:30
SaketAnand
63599dec2d
Update README.md 2023-07-13 01:35:50 +05:30
sairaj mote
a3d082f1d2 Rendering optimization 2023-07-06 18:46:56 +05:30
sairaj mote
9983059012
Merge pull request #11 from ranchimall/dev
Blockbook based UI and backend
2023-07-06 18:32:33 +05:30
sairaj mote
eb44309641 bug fix 2023-07-06 18:30:49 +05:30
sairaj mote
ffa2726a9e Minor bug fix 2023-07-06 18:30:01 +05:30
sairaj mote
9ce06f5cbb Added UI for new transaction format 2023-07-06 18:17:31 +05:30
sairajzero
2a78454cae Fixes and improvements
- Fixes for blockbook API (floBlockchainAPI >=3.0.0)
- Improvements to listTransactions
- formatted tx details have mining details separately. Added senders and receivers details containing full list of senders and receivers.  Added other tx details like confirmation, fee, block
- listTransactions fn now uses options: page, pageSize
2023-07-06 06:59:05 +05:30
sairajzero
a4ca904d28 remove old unused files 2023-07-06 05:55:12 +05:30
sairajzero
f025cca156 Merge https://github.com/ranchimall/Standard_Operations into dev 2023-07-06 05:37:07 +05:30
sairaj mote
c1b0fc3fbe app name fix 2023-07-05 21:46:07 +05:30
sairajzero
904deaa63c floBlockchainAPI v3.0.1b - bug fix
- Fixed: vin address at .addresses[0] not .scriptSig.addresses[0]
2023-07-05 13:48:38 +05:30
sairajzero
e120b657da floBlockchainAPI v3.0.1a
- Fixed: readTx and all its dependencies not having txs property when address (floID) doesnt have any tx
2023-07-05 13:35:07 +05:30
sairajzero
5398fcbbbc floBlockchainAPI v3.0.1
- Fixed readTxs: not working
- Removed fromBlock and toBlock options from readTxs

- Fixed: chain querying to blockbook format for readAllTxs, readData, getLatestData

- Changed `mempool` option to `confirmed` option (for blockbook API)
- Removed `before` options from respective fns
2023-07-05 05:14:44 +05:30
sairaj mote
45a9e1bdbb Minor UI changes 2023-07-05 02:49:37 +05:30
sairajzero
d15af05764 floBlockchainAPI v3.0.0: BlockBook API
- Converting API calls to FLO blockbook API
- Changes and fixes required for the same
2023-07-04 00:20:24 +05:30
sairaj mote
27cc49abe4 wording change 2023-06-20 15:59:23 +05:30
sairaj mote
15dccda265 changed input order of swap creation 2023-06-20 15:07:53 +05:30
sairaj mote
ce129c4816 Fixing naming 2023-06-20 14:59:55 +05:30
sairaj mote
2c5a905899 Bug fixes 2023-06-15 20:01:11 +05:30
sairaj mote
9e1cf97fef Bug fixes 2023-06-15 01:33:34 +05:30
sairaj mote
c09e93b14c Bug fixes 2023-06-05 16:49:49 +05:30
sairaj mote
cef0a5536b Minor text change 2023-06-05 16:25:47 +05:30
sairajzero
49d5c2411c btcOperator v1.1.3b: fix
- Fixed: fee increment minimum value
Minimum fee increment should be atleast MIN_FEE_UPDATE (219 satoshi)
2023-06-01 21:09:50 +05:30
sairajzero
365d3d4503 btcOperator v1.1.3a: bug fix
- Fixed: minor syntax errors and typos
- Fixed: createTransaction not giving correct fee and output value when dust is ignored
2023-06-01 21:06:04 +05:30
sairajzero
34c30aea05 btcOperator v1.1.3: increase fee
- editFee: increase the fee for the given transaction.
can pass either tx hex directly to edit it, or pass txid of unconfirmed tx to edit it for rebroadcasting

- transaction outputs will be removed if the value is less than DUST amount (546 satoshi)
2023-06-01 20:03:42 +05:30
Sai Raj
daeef19d5a
Merge pull request #10 from ranchimall/master 2023-05-19 01:01:09 +05:30
Sai Raj
3a00221587
Merge branch 'sairajzero:master' into master 2023-05-19 00:59:49 +05:30
sairaj mote
6ed2497307 added option to allowing loading more transactions 2023-05-17 00:46:33 +05:30
sairaj mote
bcc9a19698 pagination UI bug fix 2023-05-16 04:50:18 +05:30
sairaj mote
84b46e5617 Added permanent link of first page to pagination 2023-05-16 04:38:09 +05:30
sairaj mote
48e9ee1fd7
Merge pull request #10 from ranchimall/dev
Dev
2023-05-16 03:56:17 +05:30
sairaj mote
593243f81d
Merge branch 'master' into dev 2023-05-16 03:55:56 +05:30
sairaj mote
841fae6a17 Added ability to fetch beyond first 1000 txs 2023-05-16 03:54:27 +05:30
sairaj mote
f8efd6d9a2 moving functionality to listTransactions fn 2023-05-14 02:08:22 +05:30
sairaj mote
1d6746c123 Update main.min.css 2023-05-14 00:40:37 +05:30
sairajzero
f83884b591 Update flo-webwallet.js
- removed syncTransactions and readTransactions
- replace the above with listTransactions function set
- listTransactions(address) gets the latest  tx (1000 max)
- listTransactions.syncOld(address, initItem): use the initItem received by listTransaction or prevous .syncOld call. give the next old 1000 tx
- listTransaction.syncNew(address, lastItem): use lastItem received by listTransaction or previous .syncNew call). gives the new txs (1000 max) from last call
2023-05-13 18:24:11 +05:30
sairajzero
92303cbc47 floBlockchainAPI v2.5.6b: bug fix 2023-05-13 18:18:23 +05:30
Sai Raj
0b2a5fb322
Merge pull request #9 from ranchimall/dev
flosight update
2023-05-12 01:22:51 +05:30
Sai Raj
5c2ce4f03e
Merge branch 'master' into dev 2023-05-12 01:22:39 +05:30
sairaj mote
742f1f8e63 Minor changes 2023-05-11 01:27:21 +05:30
sairajzero
49fca9c2c4 Bug fixes 2023-05-10 03:20:01 +05:30
sairajzero
e8bc41974c moving required stdop files to scripts/ 2023-05-10 02:35:55 +05:30
sairajzero
561ed08a89 Merge https://github.com/ranchimall/Standard_Operations into dev 2023-05-10 02:34:47 +05:30
sairajzero
8c2fe3fac2 remove stdops 2023-05-10 02:34:19 +05:30
Sai Raj
0eb4215f23
Merge branch 'sairajzero:master' into master 2023-05-10 02:13:33 +05:30
sairajzero
0526a2944f update stdops 2023-05-10 02:02:58 +05:30
sairajzero
d777303097 floTokenAPI v1.0.4a
- fixed: typo in bulkTransferTokens
2023-05-10 02:01:47 +05:30
sairajzero
8b4669cea8 Fixes for new flosight changes 2023-05-10 02:01:07 +05:30
sairajzero
86a340a2e8 update stdops 2023-05-10 01:52:56 +05:30
sairajzero
0c14975fcb removing unused dummy fns 2023-05-10 01:52:34 +05:30
sairajzero
94fb4f4849 compactIDB v2.1.2
- Fixed: options.limit not working in searchData
- Added option reverse to searchData (if set to true, the ordering will be reversed
2023-05-10 01:50:46 +05:30
sairajzero
1390c91907 floBlockchainAPI v2.5.6a
- minor bug fix: default value for options missing in readAllTxs fn
- removed flosight.duckdns.org from apiURL
2023-05-10 01:46:36 +05:30
sairaj mote
bda7d2295b Hard dependency removal
--Wallet should work even if smart contract related APIs are not working
2023-05-09 01:14:15 +05:30
sairaj mote
bd92f1de01 Implemented bulk token transfer UI 2023-05-08 03:43:23 +05:30
sairaj mote
b9eade2ee9 Feature update
-- added ability to search FLO addresses to retrieve transactions and balance
-- added check in smart contract creation to prevent duplicate names
-- bug fixes
2023-05-06 20:50:03 +05:30
sairajzero
46ae8581e4 floDapps v2.4.0
- Update for new flosight version
- requires floBlockchainAPI >= v2.5.6
- requires floCloudAPI >= v2.4.3a

- lastTx now stores the lastItem property (ie, txid)
- backward-support: maintaining support for idb data (lastTx) from old floDapps module to be converted to this version
2023-05-04 17:09:02 +05:30
sairajzero
9e10a02dc8 floBlockchainAPI v2.5.6
- All search query (get method) now uses URLSearchParams to construct the string
- renamed all lastKey property to lastItem to match flosight response
2023-05-04 17:04:55 +05:30
sairajzero
704def4db1 floCloudAPI v2.4.3a
- Added property: SNStorageName (string content "SuperNodeStorage"
2023-05-04 16:59:10 +05:30
sairajzero
e421d401da Moved bunkTransferTokens code to floTokenAPI
- floWebWallet.bunkTransferTokens is still available, but it invokes floTokenAPI.bunkTransferTokens where the code is moved to
2023-05-02 22:17:52 +05:30
sairajzero
0ebc6f2f0e Update floTokenAPI.js 2023-05-02 22:16:55 +05:30
sairajzero
7e618c98f2 floTokenAPI v1.0.4: Added bunkTransferTokens
- Added bunkTransferTokens: bulk transfer tokens to multiple receivers
- usage: floWebWallet.bunkTransferTokens(sender, privKey, token, receivers)
sender: floID of sender
privKey: private key of sender
token: token to send
receivers: an object representing receiver floID and token amount
ie, {receiverID1: amount1, receiverID2: amount2....}
eg: {Fxyz: 123, Fpqr:321, Fabc: 987}
2023-05-02 22:15:54 +05:30
sairajzero
c369ba9577 Update floBlockchainAPI.js 2023-05-02 21:51:20 +05:30
sairajzero
a762f4441b floBlockchainAPI v2.5.5a: bug fix 2023-05-02 21:47:48 +05:30
sairajzero
f86818c1cb bunkTransferTokens: Improvements and fixes
- Fixes for floBlockchainAPI update (and waitForConfirmation moved to floBlockchainAPI)
- reject when receiver object list is empty
- when only 1 receiver is there, directly send tx using floTokenAPI.sendTx without spliting UTXOs
2023-05-02 21:43:06 +05:30
sairajzero
b710826d9b Update floBlockchainAPI.js 2023-05-02 21:05:29 +05:30
sairajzero
5b8b1ea7fc Update floCrypto.js 2023-05-02 21:01:44 +05:30
sairajzero
b09c88f0df floDapps v2.3.5
- Added get property trustedIDs to floGlobals
ie, floGlobals.trustedIDs will give the list of trustedIDs for the app
2023-05-01 20:44:44 +05:30
sairaj mote
279268d85e UI bug fixes 2023-05-01 01:18:30 +05:30
sairaj mote
185fc6a372 UI bug fix 2023-05-01 01:10:26 +05:30
sairaj mote
51d34518e2 Min expiration changes 2023-04-29 20:37:11 +05:30
sairaj mote
4a2493b5f5 Bug fixes 2023-04-29 20:30:43 +05:30
sairaj mote
653c5a91c2 Bug fixes 2023-04-29 20:28:43 +05:30
sairaj mote
6b760b6a38 Moved to main net 2023-04-29 20:20:29 +05:30
sairaj mote
e1b5ab8b81 Upgraded balance API to v2 2023-04-29 20:20:00 +05:30
sairaj mote
736ee68d31 Bug fixes 2023-04-29 18:52:43 +05:30
sairaj mote
7f3e0158d5 bug fix 2023-04-29 17:45:47 +05:30
sairajzero
8afde73e78 floBlockchainAPI v2.5.5: adding getLatestData
- Added getLatestData: Get the latest flo Data that match the caseFn from txs of given Address
2023-04-29 05:29:39 +05:30
sairajzero
fe33250b47 floBlockchainAPI v2.5.4
- Adding support for 'before' and 'latest' option in readTxs and its derivatives
2023-04-29 04:36:56 +05:30
sairaj mote
fff137b50b Adding smart contract templates 2023-04-29 03:42:48 +05:30
sairajzero
7bd528d55e floBlockchainAPI v2.5.3
- Added waitForConfirmation: Wait for the given txid to get confirmation in blockchain
2023-04-29 03:22:38 +05:30
sairajzero
456e9097de floBlockchainAPI v2.5.2: Added splitUTXOs
- splitUTXOs: split sufficient UTXOs of a given floID for a parallel sending
2023-04-29 03:03:45 +05:30
sairaj mote
44e7f86f8e Adding contract triggering UI 2023-04-28 00:56:27 +05:30
sairaj mote
2117134496 Bug fix 2023-04-26 02:40:11 +05:30
sairaj mote
074d2ae5bc Added default expiration days as 60 for deposit 2023-04-26 00:22:12 +05:30
sairaj mote
456f49f65f Better transaction results 2023-04-25 22:47:04 +05:30
sairaj mote
8e89a5c4d8 Bug fixes 2023-04-25 22:07:54 +05:30
sairaj mote
d75f40e76e Bug fixes 2023-04-25 19:18:50 +05:30
sairaj mote
d949edfe0c Adding smart contract deposit option 2023-04-25 17:46:20 +05:30
sairaj mote
4be3d17dde UI improvements 2023-04-25 04:00:06 +05:30
sairaj mote
bf379ea9a0 Adding smart contract page 2023-04-25 03:35:35 +05:30
sairaj mote
d5d2dddefa Adding smart contract participation and price change 2023-04-25 03:34:48 +05:30
sairaj mote
d73aafaae0 Bug fixes 2023-04-25 03:26:58 +05:30
sairaj mote
4a73c2bb12 switching to mainnet 2023-04-25 03:18:27 +05:30
sairaj mote
3d5d7eade9 testing 2023-04-25 03:15:35 +05:30
sairaj mote
b54f967e84 Bug fixes 2023-04-25 03:06:33 +05:30
sairaj mote
6ae06a3d96 Integration smart contract participation 2023-04-25 02:42:25 +05:30
sairaj mote
8c0726b6f9 Implementing dynamic price updating 2023-04-24 15:40:25 +05:30
sairaj mote
cbf9ad21a9 Integrating smart contract system 2023-04-24 01:39:52 +05:30
sairajzero
ec718a3c4e Adding bunkTransferTokens
- Added bunkTransferTokens: bulk transfer tokens to multiple receivers
- usage: floWebWallet.bunkTransferTokens(sender, privKey, token, receivers)
sender: floID of sender
privKey: private key of sender
token: token to send
receivers: an object representing receiver floID and amount
ie, {receiverID1: amount1, receiverID2: amount2....}
eg: {Fxyz: 123, Fpqr:321, Fabc: 987}
2023-04-23 23:13:21 +05:30
sairajzero
46bcadc764 Adding floTokenAPI module 2023-04-23 21:31:58 +05:30
sairajzero
1118f6e570 Adding splitUTXOs function 2023-04-23 21:13:24 +05:30
sairaj mote
fe360847e0 minor ui fix 2023-04-18 15:26:22 +05:30
Sai Raj
3bb03efa88
Merge pull request #20 from sairajzero/master
Pull updates from master
2023-04-15 00:53:18 +05:30
sairajzero
e37e808a98 floBlockchainAPI v2.5.1: updated readData
- uses readAllTxs to chain query the txs from flosight
- keeping ignoreOld option to support backward compatibility, but resolved value no longer have totalTxs.
- new option 'after': fetch after the given txid
- new option 'mempool': query mempool tx or not (options same as readAllTx, DEFAULT=false: ignore unconfirmed tx)
- the resolved value have the following structure based on options.tx
true: {lastKey, items}
false (DEFAULT}: {lastKey, data}
- Optimized the query and filter process
2023-04-15 00:43:45 +05:30
sairajzero
a296a5c986 floBlockchainAPI v2.5.0
1. Updated readTxs: from, to parameter are replaced with options parameter.
'options' available
- after: query after the given tx
- from/to: query from and to (deprecated, support for backward compatibility)
- mempool: query mempool values (true, false, only)

2. Updated readAllTxs: chain queries the data from flosight when address have too many tx
2023-04-14 03:52:39 +05:30
sairajzero
ca0d8c68f3 floBlockchainAPI v2.4.6
Improved utxo and unconfirmed-spent api fetch in send/create tx
2023-04-14 03:36:23 +05:30
sairajzero
9c0730e051 floBlockchainAPI v2.4.5: getBalance improvements
- Updated getBalance: now chain queries for addr with more than 1000 tx to get the net balance.
- (optional): can use 'after' parameter to get the balance(update) after a given txid
2023-04-13 03:15:26 +05:30
sairaj mote
851c3453ec Added option to check FLO and token balances 2023-04-10 18:51:26 +05:30
sairaj mote
c1d9a4e730 Bug fix 2023-04-09 22:14:10 +05:30
sairaj mote
326d6f8044 UX improvement
-- It is no longer required to enter the sender's FLO address, only sender's private key is required
2023-04-09 20:48:11 +05:30
sairaj mote
d8f782b128 Bug fixes 2023-04-05 02:14:42 +05:30
sairaj mote
a8f6d9d4c7 Bug fix and code refactoring 2023-03-30 02:03:55 +05:30
sairaj mote
002a4d4dff grammatical error fix 2023-03-23 18:48:46 +05:30
sairajzero
3643f310c2 floDapps v2.3.4: startUpOptions
Added startUpOptions
- cloud: (DEFAULT=true). set to false for app that doesnt require floCloudAPI module
- app_config: (DEFAULT=true). set to false for app that doesnt require configs from adminID (via blockchain)
2023-03-20 20:10:52 +05:30
sairajzero
0ab284b41b floBlockchainAPI v2.4.4
- Updated writeDataMultiple: use options (bool: preserveRatio, float: sendAmt)
- Updated default values to reduce flo spent during tx
2023-03-20 19:44:52 +05:30
sairaj mote
3f6c854dd6 Added minimum FLO when doing token transfer 2023-03-20 00:05:42 +05:30
sairaj mote
831b129cf8 Added better token transfer 2023-03-19 17:29:03 +05:30
sairaj mote
d0ec0ee79c Updating flosight links 2023-03-11 18:04:31 +05:30
sairaj mote
1e11731b10 code refactoring and UI bug fixes 2023-03-11 18:00:38 +05:30
sairajzero
b16473f982 floCrypto v2.3.6
- Added hashID(str): returns a floID based on the hash of given string
- Added rawToFloID(raw_bytes): return floID from the given raw_bytes (20 bytes)
2023-03-08 03:13:36 +05:30
sairaj mote
aeb3d4845d Merge branch 'master' of https://github.com/ranchimall/flowallet 2023-03-02 01:15:27 +05:30
sairaj mote
98e4e5097f Bug fixes 2023-03-02 01:15:11 +05:30
Sai Raj
17ee486948
Merge pull request #8 from sairajzero/master
Multisig utils and fixes
2023-02-25 15:18:38 +05:30
sairajzero
4078d24487 Update floBlockchainAPI.js 2023-02-25 15:16:51 +05:30
sairajzero
b88a713c80 Update floCrypto.js 2023-02-25 15:16:49 +05:30
sairajzero
ce4bdcd83c Update lib.js 2023-02-25 15:16:46 +05:30
Sai Raj
37408f3983
Merge pull request #19 from sairajzero/master
lib v1.4.2b: bug fix
2023-02-25 15:03:50 +05:30
sairajzero
2e24f024d1 lib v1.4.2b: bug fix
- Fixed: FLO multisig signing not working when redeemscript length is large
2023-02-25 15:01:13 +05:30
Sai Raj
948a58c901
Merge pull request #18 from sairajzero/master
testnet fixes
2023-02-24 18:51:13 +05:30
sairajzero
1a8e1abe45 Update index.html
Only for Testing purpose
- Added quick param: pass quick in url query to ignore onLoadStartup
- Added testnet param: pass testnet in url query to change blockchain to FLO_TEST (testnet FLO)
2023-02-24 18:49:22 +05:30
sairajzero
bf9e018883 lib v1.4.2a and floCrypto v2.3.5a
lib v1.4.2a
- Fixed multisig for testnet

floCrypto v2.3.5a
- Fixed: getMultisigAddress accepting requiredSignatures value greater than pubkeys array length (now it will return null instead)
2023-02-24 18:34:49 +05:30
Sai Raj
009b7e1a0d
Merge branch 'sairajzero:master' into master 2023-02-24 02:14:37 +05:30
Sai Raj
476b95c679
Create LICENCE 2023-02-24 02:12:46 +05:30
Sai Raj
ce2a0daaa5
Merge pull request #17 from sairajzero/master 2023-02-24 02:07:53 +05:30
sairajzero
9db998c176 floBlockchainAPI v2.4.3: utility fns
- Added parseTransaction: parse the given txhex
- Added Sat_to_FLO and FLO_to_Sat to .util
2023-02-24 00:46:00 +05:30
sairajzero
7b298ceb50 floBlockchainAPI v2.4.2: tx utility fns
- Added checkSigned: check if the tx is signed or not (if optional args is passed as false, returns a detailed array indicating if each input is signed or not)
- Added checkIfSameTx: check if the passed 2 tx are same or not (ie, input, output and flodata are same or not)
- Added transactionID: returns the transaction id of the tx hex
2023-02-24 00:05:18 +05:30
sairajzero
daec31c1ac btcOperator v1.1.2a: bug fix
- Fixed: checkIfSameTx loop in comparing outputs using incorrect length
2023-02-23 23:24:55 +05:30
sairajzero
09e306d312 floBlockchainAPI v2.4.1: Improvements and signTx
- Added createTx: create unsigned tx (resolves tx-hex )
- Updated createMultisigTx: resolve tx-hex instead of tx object
- Added signTx: (synchronized fn) sign the given tx (hex or object) with given private key and returns the signed txhex
2023-02-23 23:07:54 +05:30
sairajzero
24415b835c lib v1.4.2: (flo) bitjs.transaction deserialize
- pass tx_data (hex or byte array) to bitjs.transaction to deserialize the transaction
ie, `tx = bitjs.transaction(tx_data)`
- invoking without any parameter `bitjs.transaction()` will create an empty tx as before (no change)
2023-02-23 22:49:32 +05:30
sairajzero
e4fd63912c floCrypto v2.3.5: multisig address utils
- Added toMultisigFloID: converts given multisig address to FLO multisig ID

- Improved verifyPubKey: also support verifying multisig redeemScript for the multisig address

- Improved isSameAddr: supports multisig bech32
- Improved decodeAddress: supports multisig bech32
2023-02-23 02:49:42 +05:30
sairajzero
070d2198ba btcOperator v1.1.2: multisig utils
- Added decodeRedeemScript: decodes the given redeemScript and return {address, pubKeys, required}. (optional bech32; default=true. if true return bech32 address. if false returns legacy multisig address)

- Added convert.multisig2multisig: convert from one multisig address to another. (optional target_version; default=btc-multisig-version)
- Added convert.bech2multisig: converts multisig bech32 address to multisig address. (optional target_version; default=btc-multisig-version)

- Added encodeLegacy, decodeLegacy, encodeBech32, decodeBech32 to util
2023-02-23 02:13:31 +05:30
sairajzero
6288dc82d9 lib v1.4.1b: Minor fixes in coinjs multisig-addr
- pubkeys2MultisigAddressBech32: returns another value 'scripthash'
- Fixed multisigBech32Address: returning scripthash as redeemScript. (now returns both scripthash and redeemScript
2023-02-23 02:04:16 +05:30
Sai Raj
612098bc92
Merge pull request #7 from sairajzero/master
Support for FLO multisig
2023-02-20 17:20:27 +05:30
sairajzero
46e386c9ee Update stdop: FLO multisig 2023-02-20 17:18:29 +05:30
Sai Raj
6c8fe10453
Merge pull request #16 from sairajzero/master
support for FLO multisig address and transactions
2023-02-20 17:11:38 +05:30
sairajzero
9132d169d2 lib v1.4.1a: bug fix
- Fixed: bitjs.btrx.decodeRedeemScript not throwing Invalid RedeemScript error
2023-02-20 05:20:04 +05:30
sairajzero
a102f5225b floCrypto v2.3.4a: bug fix
- Fixed: verifyPrivKey incorrectly returning false when pubkey is lowercase. (pubkey hex is case-insensitive)
2023-02-20 05:02:43 +05:30
sairajzero
2e0846edc4 floBlockchainAPI v2.4.0: multisig tx
Changes:
- multisig addresses are accepted as receiver address in all send-tx fns
- multisig addresses are accepted in query fns
- sendTx: sender can be regular address only

Added 3 multisig transaction fns:
- createMultisigTx: creates unsigned tx for multisig sender
- sendMultisigTx: create signed multisig tx and broadcast it
- writeMultisigData: same as writeData(), but for multisig
2023-02-20 04:59:23 +05:30
sairajzero
dac87a8595 floCrypto v2.3.4: multisig address
- Added getMultisigAddress(pubkeys, required_sigs): returns a multisig address from given pubkey list and required signatures
- Added decodeRedeemScript (redeemScript): decodes the given redeemscript (of multisig)
- Updated validateFloID: now validates FLO regular and multisig address. optional argument regularOnly(default=false) if true validates only FLO regular address.
2023-02-20 03:10:15 +05:30
sairajzero
0031761a06 lib v1.4.1: Bitcoin.Address: FLO-multisig support
- Bitcoin.Address now supports multisg version
- new Bitcoin.Address (hex) will now assign the respective version when its regular or multisig address

- Added constants: Bitcoin.Address
  .standardVersion= 0x23
  .multisigVersion = 0x5e
  .testnetVersion = 0x73
2023-02-20 03:09:46 +05:30
sairajzero
1f670be893 lib v1.4.0: Support for FLO multisig address 2023-02-19 17:43:07 +05:30
sairajzero
7d31dec230 lib v1.3.3: Improvements to bitjs for flo
- Updated tx.addflodata: will now check if the data is valid or not
- Optimized tx.serialize: changed complex code for appending flodata to a simple one
- Added bitjs.strToBytes: converts string (ascii) to strToBytes
- Added bitjs.pubkeydecompress: decompresses the public key
- Added bitjs.verifySignature: verify the signature (of hash and pubkey)
2023-02-19 17:39:19 +05:30
sairaj mote
cc700b32e8 UI enhancements 2023-02-17 02:00:11 +05:30
sairaj mote
90a55854ef Fixed scroll to top not showing up on desktop view 2023-02-17 01:58:08 +05:30
sairaj mote
5dddaa626c larger screen specific enhancements 2023-02-17 01:48:55 +05:30
sairaj mote
6d7de287dd consistent FLO naming 2023-02-16 22:43:07 +05:30
sairaj mote
4b05084e5b app name change 2023-02-16 22:39:05 +05:30
sairaj mote
1423ebb38c Fixed textarea placeholder UI bug 2023-02-16 22:32:18 +05:30
sairaj mote
57bbdbd842 UI bug fix 2023-02-16 22:28:58 +05:30
sairaj mote
da0271d7dd error handling 2023-02-16 22:15:25 +05:30
sairaj mote
ae972d0778 routing changes and code refactoring 2023-02-16 22:14:14 +05:30
sairaj mote
c294b54444 changed title 2023-02-16 20:38:11 +05:30
sairaj mote
31a5ed936c Fixed accepting BTC address issue 2023-02-15 21:59:13 +05:30
Sai Raj
4a856090c5
Merge pull request #3 from ranchimall/master 2023-02-08 19:37:08 +05:30
Sai Raj
837f4b4a6f
Merge pull request #15 from sairajzero/master 2023-02-08 19:23:28 +05:30
sairajzero
ca0d557d94 btcOperator v1.1.1: getTx.hex
- Added getTx.hex(txid): resolves the tx hex of the txid
- Update: api responses are checked for response.ok
- Fixed: getTx giving incorrect confirmation value for unconfirmed tx
2023-01-31 02:13:37 +05:30
sairajzero
c2a94e6246 btcOperator v1.1.0: updating API provider
updating API link to blockchain.info
2023-01-31 01:21:48 +05:30
sairajzero
f89cf27826 Update flo-webwallet.js
- Wrapped flo webwallet module inside IIF.
- use strict for flo webwallet module
- moved onload fn to index.html
2022-12-30 04:16:58 +05:30
sairajzero
d4673462c0 update stdops (and split script files) 2022-12-30 03:52:12 +05:30
sairajzero
c2b836c069 Updating floSight URLs 2022-12-23 22:48:52 +05:30
sairaj mote
88c725f515 Minor UI fixes and updating components 2022-12-20 23:41:20 +05:30
sairajzero
cc4380d623 floDapps v2.3.3
- Added support: update cloud node URL
- Added support: trusted IDs (configured by adminID)
- Trusted IDs have permission to edit tag data
2022-12-18 03:44:04 +05:30
sairajzero
ea4d1f67d6 bug fix: btcOperator v1.0.14b (ignore dust-change) 2022-12-16 20:47:21 +05:30
sairaj mote
98e194245e Bug fix
-- fixed rounding error when showing sender balance
2022-12-11 18:58:55 +05:30
sairaj mote
507919c96b added balance refresh 2022-12-04 17:50:41 +05:30
sairajzero
a71c851cc2 btcOperator v1.0.14a
- Added multisig-bech32 to auto-fee calc
- Fixed: createMultiSigTx not working with bech32 sender
- Fixed: checkSigned for multisig-bech32
2022-11-27 02:47:02 +05:30
sairajzero
aebda7ec80 btcOperator v1.0.14: multisig-bech32 (p2wsh) 2022-11-24 03:25:52 +05:30
sairajzero
7a6a02f2b6 Update lib.js
- support for multisig-bech32 (p2wsh)
2022-11-24 03:25:35 +05:30
sairajzero
b7254bc3ac btcOperator v1.0.13c bug fix
Fixed: tx outputs with 0 value (such as change amount) not removed
2022-11-20 19:46:22 +05:30
sairaj mote
140a9951bd bug fixes 2022-11-18 21:46:25 +05:30
sairajzero
006ff9f0a9 btcOperator v1.0.13b: Fee from receiver
- Added: fee_from_receiver option to create transaction.
- change_address and fee_from_receiver are passed as options for createTx, createSignedTx, sendTx and createMultiSigTx
- Fixed: getTx not rejecting properly when txid is invalid
2022-11-18 17:49:03 +05:30
sairaj mote
845cfb1873 Components update and UI tweaks 2022-11-13 20:49:17 +05:30
sairajzero
663dfe2d54 floCloudAPI v2.4.3
- Fixed a rare bug where array has empty value
- now `null` is supported by objectData update (ie, objects can now have null as value)
2022-11-06 04:27:24 +05:30
sairajzero
bffb130bd4 floBlockchainAPI v2.3.3d
- renamed sender and receiver options to senders and receivers (bug fix)
2022-10-26 20:17:48 +05:30
sairajzero
d21db616da btcOperator v1.0.12
- Changed broadcastTx to coinb API to eliminate $.ajax requirement
- Set default value for fee=null (automatic fee) to createSignedTx and createMultiSigTx
2022-10-24 15:39:54 +05:30
sairajzero
87f0260fe4 btcOperator v1.0.11
- Added createSignedTx: creates a signed tx (same as sendTx, but doesnt broadcast)
- Added transactionID: returns the txid of the tx_hex (or tx-object)
2022-10-18 04:43:53 +05:30
sairajzero
c38b7257cf Minor fixes
floCrypto v2.3.3e
- Adding options args to toFloID function. options object accept std and/or bech properties. if specified only converts if given address are from specified version

floBlockchainAPI v2.3.3c
- Fixed: tx failing due to dust amount in change value
- readData: when passes tx option as true, now also gives senders and receivers (Set)

btcOperator v1.0.10b
- Fixed: minor bugs
2022-10-14 23:11:05 +05:30
sairajzero
7d84ded426 btcOperator v1.0.10a: broadcastTx resolves txid
- When broadcast is successful, txid is resolved
- sendTx also resolves txid due to the above change
2022-09-30 05:11:09 +05:30
sairajzero
084ffe10e2 btcOperator v1.0.10: parseTransaction
- Added parseTransaction: parse the given transaction
Parameters:
tx : transaction hex (or tx object from coinjs.transaction)
Resolves: parsed object
2022-09-11 22:36:50 +05:30
sairajzero
39d34f6e8c floCloudAPI v2.4.2e
- Adding generalDataset to floGlobals: returns the filtered general data set. (Parameters type and options)
2022-09-04 04:09:27 +05:30
sairajzero
04aad28600 Improved auto-fee calc
- createTx and createMultiSigTx will now resolve an object with tx_hex and other values (amount, size, etc)
2022-08-25 03:04:56 +05:30
sairajzero
77ff76d787 Replacing Math.random with securedMathRandom 2022-08-22 22:06:14 +05:30
sairajzero
7b5a5e6bfe Bug fixes and improvements
floCrypto v2.3.3b
floCloudAPI v2.4.2d
floDapps v2.3.2d
2022-08-21 21:14:29 +05:30
sairajzero
67386fd69f Update btcOperator.js
- Added checkIfSameTx(tx1, tx2): checks if the transactions is of the same
2022-08-16 20:39:49 +05:30
sairajzero
dc19a4e565 Bug fixes: floBlockchainAPI and lib.js 2022-08-16 17:30:46 +05:30
sairajzero
f0a4837222 btcOperator v1.0.7c
- Fixed: createTransaction not returning promise
- Fixed: script not correctly added for multisig inputs
- Fixed: signTx throwing syntax error
- Added checkSigned(tx, bool?): check if the tx is signed or not. (bool is optional, default=true, if true returns a boolean value, else returns a detailed array of input's length)

- Fixed minor bugs in lib.js
2022-08-16 03:24:55 +05:30
sairajzero
6e5cdbd820 floCrypto v2.3.3b
- Added floCrypto.tmpID: generates a random floID with no private key (use this only for one-time id)
- Added toFloID(address): returns equivalent floID (btc-segwit address NOT supported)
- Fixed bug: legacy addresses of length 33 not working in verifyPubKey and validateAddr
2022-08-16 03:11:24 +05:30
sairajzero
36a4067d67 bug fix 2022-08-16 00:37:38 +05:30
sairajzero
45878e6ebe Update floDapps.js
- myFloID, myPubKey, myPrivKey will now return undefined when user not logged in
2022-08-14 18:38:29 +05:30
sairajzero
91e6b82387 btcOperator v1.0.7b
- Added: signTx
- Added multiSigAddress
2022-08-10 02:58:36 +05:30
sairajzero
bc44405102 btcOperator v1.0.7a
- Adding auto fee calculation
- Optimized the code
- Fixed minor bugs
2022-08-09 03:19:56 +05:30
sairajzero
4244774635 btcOperator v1.0.7
- Added createTx: Create an unsigned tx (no privkey required) [segwit sender not supported for now as redeem-script needed]
- Added createMultiSigTx: Create an unsigned tx for multisig address
- Optimised sendTx to reuse code (no functional change)
2022-08-03 03:54:58 +05:30
sairajzero
9dd132b145 Update README.md 2022-07-28 02:45:56 +05:30
sairajzero
4bced4352d floDapps, floCloudAPI: retain blkchain id on login
floDapps login:
- login to btc address when btc private key is entered
- login to flo id when flo (or any other) private key is entered

floCloudAPI user:
- accept userID and private key for user set

Others:
- Fixed: minor bugs
2022-07-28 02:27:07 +05:30
sairajzero
f673d3f37a floCrypto v2.3.3a
floCrypto.verifyPubKey: verify public key of any blockchain address
- Parameters:
1. pubKeyHex - public key hex
2. address - blockchain address

floCrypto.getAddress: get address respective to the blockchain
- Parameters:
1. privateKeyHex - private key (WIF)
2. strict - (optional, default=false) if false returns floID when no match of privatekey prefix found.
2022-07-28 02:11:48 +05:30
sairajzero
2b8e77b5f7 Bug fixes
- floCrypto.validateAddr: bech default=true
- floCloudAPI: proxyID
- commented coinjs api vars
2022-07-26 15:16:22 +05:30
sairajzero
8a211be849 Adding btcOperator module 2022-07-24 20:33:45 +05:30
sairajzero
0526a1f29f floCloudAPI v2.4.2: cross-blockchain receiverID
- Accept any blockchain ID as receiverID and automatically convert it into floID
2022-07-24 02:34:02 +05:30
sairajzero
fa3d790c6c floDapps v2.3.2: lock privkey by default
- Removed the options for launchStartUp
- private-key is on lock mode by default
- Added utility functions that uses private-key without entering password in .user
  .sign(message): signs message
  .decrypt(data): decrypts ciphertext in asymmetric
  .encipher(message): encrypts message in symmetric
  .decipher(data): decrypts ciphertext in symmetric
2022-07-24 02:29:04 +05:30
sairaj mote
580d2a64da preventing non-numeric values in numeric fields 2022-07-23 03:25:17 +05:30
sairajzero
0a74e393ed floCrypto v2.3.2: validate any address
floCrypto.validateAddr: validate any blockchain address
- Parameters:
1. address - address to validate
2. std - checks for legacy version (optional, default=true) (true: allow any, array: list of versions, value: one version only, false: allow none)
3. bech - checks for bech version (optional, default=false) (true: allow any, array: list of versions, value: one version only, false: allow none)

- For validating only floID, use floCrypto.validateFloID(floID)
2022-07-19 21:21:06 +05:30
sairajzero
fcc5f3ce4e Edit library to accept WIF of other versions 2022-07-17 17:04:03 +05:30
sairajzero
b80bd43313 floDapps, floCloudAPI: Secure private key
- Store AES-encrypted private key in memory. (exploring memory of browser will not have raw private key)
- floDapps lock/unlock (in user): locks or unlock the private key (ie, lock= Password required, unlock= password not required in returning private key)
- floDapps.launchStartUp now accepts options object
- to lock the private key on startup, pass {lock_key: true} in options objects of launchStartUp
2022-07-17 17:02:27 +05:30
sairaj mote
3146ec4c75 minor description change 2022-07-16 23:42:48 +05:30
sairajzero
5ab0bc36f0 Update floCrypto.js
- Removing explicit use of BigInteger in signing(/verify-sign) data
2022-07-16 03:32:44 +05:30
sairajzero
cfc36b80cd Secure private key using capsule 2022-07-16 03:30:03 +05:30
Sai Raj
80b4a8b9fe
Merge pull request #9 from ranchimall/master
Update README.md
2022-07-12 19:13:20 +05:30
Sai Raj
151ea8f751
Update README.md 2022-07-01 21:55:45 +05:30
sairaj mote
efbc44890e added flosight link on transactions completion 2022-06-08 16:23:50 +05:30
sairaj mote
02f4485480 bug fixes 2022-06-03 02:27:13 +05:30
sairaj mote
51dd2b7de2 fixed iphone numpad not showing decimal point 2022-05-26 17:21:06 +05:30
sairajzero
9435592c8b floTokenAPI v1.0.3b
- floGlobals.currency serves as getter and setter for DEFAULT.currency in tokenAPI module
2022-05-25 02:45:50 +05:30
sairajzero
29e20de25b floTokenAPI v1.0.3a
check if amount is not NaN before sendToken
2022-05-24 19:41:45 +05:30
sairajzero
960aa1f52d floBlockchainAPI v2.3.3
- If API is called when serverList is empty, reset the list and try again once
2022-05-24 02:25:44 +05:30
sairajzero
0683bf7318 floTokenAPI v1.0.3
- getAllTxs: get all transactions of the given floID and token
- util.parseTxData: parse the txData resolved by getTx and getAllTxs
2022-05-24 01:32:23 +05:30
sairajzero
5d7d3bdb53 floBlockchainAPI v2.3.2a
sendTx:
- check total balance before processing utxos
- reject "Insufficient FLO: Some UTXOs are unconfirmed" when balance is there but some utxo are used/unconfimed
2022-05-21 22:19:54 +05:30
sairajzero
8603cde17e Moving all defaults/containers to resp. modules
- Removed default values from floGlobals
- Default values are now in their respective modules
- The following properties of floGlobals can be use to override the default values of respective modules: apiURL, sendAmt, fee, tokenURL, currency, SNStorageID
- Default/current values can be obtained from each module with getter properties
- Some current values can be set with setter properties
- The containers for appObjects, generalData, lastVC are now in floCloudAPI module. Also automatically adds get/set properties for them in floGlobals. Thus can be accessed from floGlobals as before
2022-05-16 21:20:21 +05:30
sairajzero
99368151d5 Adding floTokenAPI
- Token Operator to send/receive tokens via blockchain using token system API

floBlockchainAPI v2.3.1
- Added options parameter to writeData . Options can have the following properties:
 . strict_utxo : passes strict_utxo parameter to sendTx (Default: true)
 . sendAmt : amount of FLO to send (Default: floGlobals.sendAmt)
2022-05-16 18:46:22 +05:30
sairajzero
94f90807f7 Update lib.js
- Added support when floGlobals is undefined
2022-04-03 20:15:58 +05:30
sairajzero
b34ef8ca93 Merge branch 'master' of https://github.com/sairajzero/Standard_Operations 2022-04-03 20:09:06 +05:30
Sai Raj
ca243bf0e4
Update lib.js
Adding default cryptocoin as FLO
2022-04-03 19:40:01 +05:30
sairajzero
4b7f6184a3 Bug fix: floDapps
- Fixed: setCustomPrivKeyInput not working
- Added semicolon at the end of all stdop files
2022-04-02 02:06:44 +05:30
sairajzero
5bb0ee8588 Update lib.js
- Added require-support for BuildKBucket
- BuildKBucket now works with and without `new`
- Renamed instance name to KBucket
2022-03-31 22:25:22 +05:30
Sai Raj
37edbfc461
Merge pull request #8 from sairajzero/split-files
Split files
2022-03-31 21:58:54 +05:30
sairajzero
f27c8c4f03 Bug fixes
- Renamed standard_Operations.html to index.html
- Fixed some minor bugs in floCloudAPI
- Added: floCrypto.validateFloID (alias for floCrypto.validateAddr)
2022-03-31 21:54:51 +05:30
sairajzero
3d4aee6359 Move scripts to respective split files 2022-03-30 03:45:41 +05:30
sairaj mote
a173ef09dd UI fixes 2022-03-24 17:47:02 +05:30
sairajzero
a939545e31 Bug fix: floCloudAPI v2.1.3a 2022-03-23 18:10:44 +05:30
sairaj mote
29e31eae9b Added retrieve FLO ID feature 2022-03-10 15:57:06 +05:30
sairaj mote
2d5194d98a minor UI bug fix 2022-03-09 23:53:28 +05:30
sairaj mote
9748930c1c UI/UX refresh 2022-03-09 23:49:54 +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
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
Vivek Teega
36eda07925 Pulling UTXO changes into testnet wallet 2022-02-26 09:50:33 +05:30
sairaj mote
328315f8c9 Added 'allow unconfirmed UTXO' switch 2022-02-19 15:58:51 +05:30
sairajzero
5501ee1e2a Update StdOps
Major update
- Senders can send multiple tx at the same time, as long as enough utxos available
2022-02-19 02:05:25 +05:30
Sai Raj
ef0e75589a
Updating active flosight urls 2022-02-06 19:58:23 +05:30
790db7d276
Update README.md 2021-12-31 08:15:10 +05:30
1e26b5b723
Update README.md 2021-12-31 07:53:27 +05:30
e981c26e25
Update README.md 2021-12-29 19:35:46 +05:30
4fec06df0e
Update README.md 2021-12-29 18:37:18 +05:30
4824c416b5
Update README.md 2021-12-29 18:01:05 +05:30
442982f073
Update README.md 2021-12-29 17:58:54 +05:30
b85ea1cbe6
Update README.md 2021-12-29 17:28:52 +05:30
f426875692
Update README.md 2021-12-29 17:27:02 +05:30
ae82e254d2
Incomplete shares bugfix
Bugfix: Clears credentials and reloads if all shares are not present
2021-12-29 16:05:33 +05:30
822b446d18
Update README.md 2021-12-23 13:47:38 +05:30
4d5196bac4
Update README.md 2021-12-22 12:24:04 +05:30
38d1d798d5
Update README.md 2021-12-22 12:23:08 +05:30
f34bcc9374
Update README.md 2021-12-22 12:22:31 +05:30
9678176f3b
Update README.md 2021-12-22 12:08:24 +05:30
f75337c9b0
Update README.md 2021-12-22 12:06:28 +05:30
f38f9fe28d
Update README.md 2021-12-22 12:02:35 +05:30
86458d5d3c
Update README.md 2021-12-22 12:01:39 +05:30
2c5dac54b2
Update README.md 2021-12-22 12:00:46 +05:30
22f6f5ae81
Update README.md 2021-12-21 08:38:32 +05:30
420c3a7164
Update README.md 2021-12-21 08:29:50 +05:30
b66fe52f54
Update README.md 2021-12-21 08:29:05 +05:30
d34143a3dc
Update README.md 2021-12-21 08:21:46 +05:30
13007684f0
Update README.md 2021-12-21 08:12:49 +05:30
85ddbc16a5
Update README.md 2021-12-21 08:07:11 +05:30
4cb88db46f
Update README.md 2021-12-19 18:28:38 +05:30
aa7fce1c02
Update README.md 2021-12-19 18:27:22 +05:30
Sai Raj
0b42046022
Merge branch 'sairajzero:master' into master 2021-11-05 18:18:23 +05:30
sairajzero
6caa0658f6 floCloudAPI v2.1.0a (bugFix)
Fixed bug: UpdateObjectData not working correctly
2021-11-05 18:18:09 +05:30
sairajzero
2f9cdfb8cd Bug fix
- Fixed: flo-data fix not showing for new line.
- All space type char (eg. new line, tab) is converted to space
- Rest of the invalid characters are removed
2021-11-03 17:48:51 +05:30
Sai Raj
b2d77a3c2a
Merge branch 'sairajzero:master' into master 2021-09-25 16:27:30 +05:30
sairajzero
57ef8d14df floBlockchainAPI_v2.1.1a
- formatting the code
2021-09-17 02:46:48 +05:30
sairajzero
5c21a01b68 floBlockchainAPI v2.1.1
- improved sendTx to check if the utxo is already used but unconfirmed (ie, still in mempool) and ignore those utxos.
This allows users to send multiple tx from the same floID without the need to wait for confirmation of prev tx as long as enough utxos are available.

- Optional parameter: strict_utxo (boolean): Default=true (safe mode).
If false, allows unconfirmed UTXOs to be included in the txn.
This will allow users to chain send tx as long as enough balance FLO is available.
WARNING: if one tx in the chain is dropped, all next tx dependent on that tx will be dropped too.

- writeData (as it invokes sendTx) also have the above improvements
2021-09-17 02:25:16 +05:30
Vivek Teega
42874ad6b9 update: Update to the UI of testnet wallet 2021-09-03 15:20:29 +05:30
sairajzero
f8954a2532 floBlockchainAPI v2.1.0
- readData: option txid changed to tx. now resolves data with txid, time, blockheight along with flo data as an object [if option tx is true].
Note: backward not compactible when txid was passed as option
2021-08-12 21:47:02 +05:30
Sai Raj
09539c1dc6
Merge pull request #14 from sairajzero/master 2021-07-24 04:24:32 +05:30
Sai Raj
4df09c206f
Merge branch 'master' into master 2021-07-24 04:24:02 +05:30
sairajzero
b575432ace floCloudAPI_v2.1.0
- Updating to node version of SuperNodeStorage
2021-07-24 04:09:44 +05:30
Sai Raj
571499907e
Update README.md 2021-06-25 15:16:48 +05:30
ea2a586b5a
Updted Flosight list 2021-06-22 18:59:26 +05:30
sairajzero
df8df5edbc floBlockchainAPI_2.0.1e
- Adding floBlockchainAPI.util.current(): returns the current working flosight link (to be used after at least 1 API request'
2021-06-07 14:27:52 +05:30
sairajzero
25df4bbbc0 bugfix (floBlockchainAPI_v2.0.1d)
floBlockchainAPI_v2.0.1d
- fetch_retry removes incorrect uri when parallel requests are called.
2021-06-06 17:10:55 +05:30
Sai Raj
02a56a0523
bugfix: flosight 2021-06-05 13:28:24 +05:30
Sai Raj
f7fcaf12c6 Merge branch 'sairajzero:master' into master 2021-06-05 12:34:53 +05:30
Sai Raj
c7bb760ff8
bug fix: no floSight working when available 2021-06-05 12:34:01 +05:30
sairajzero
99ac3accb9 bugfix: (floBlockchainAPI v2.0.1c)
-Fixed: no Flosight working error shown even when there  are flosight(s) working
2021-06-05 12:27:32 +05:30
sairajzero
962f68c230 floBlockchainAPI v2.0.1b
Additional filter options to readData function
- receivedOnly: filters only received data
- txid: (boolean) resolve txid or not
- sender: flo-id(s) of sender
- receiver: flo-id(s) of receiver
2021-04-22 02:09:48 +05:30
sairajzero
05f110661e floCrypto_v2.0.1, floBlockchainAPI_v2.0.1a
floCrypto_v2.0.1 (ASCII fns)
- validateASCII
- convertToASCII
- revertUnicode

floBlockchainAPI_v2.0.1a
bugfix
2021-04-18 02:36:51 +05:30
Sai Raj
b24c4177cf
adding livenet.flocha.in to flosight 2021-04-02 21:42:59 +05:30
sairaj mote
c789ce2594 v2.11.6
UI: moved FLO address generation and recovery to dashboard page
2021-03-09 20:10:04 +05:30
sairaj mote
afab8170f8 v2.11.5
feat: Delete multiple saved addresses using select option

feat: Edit address name

feat: Search saved addresses using either name or FLO ID
2021-03-01 03:10:31 +05:30
sairaj mote
3e33385646 v2.8.5
feat: Add expandable search field for contacts
2021-02-26 19:08:51 +05:30
sairaj mote
64f2690c23 fix: page on mobile not taking full height of view-port 2021-02-26 03:07:19 +05:30
sairaj mote
443925e4f5 continued UI overhaul 2021-02-25 20:00:11 +05:30
sairaj mote
055b07761e Removed check FLO data button, checking automatically 2021-02-24 19:21:38 +05:30
sairaj mote
ecd003ce56 Feat: check and fix FLO data when sending FLO 2021-02-24 18:35:19 +05:30
sairaj mote
f9f276533c UI/UX refresh - ongoing 2021-02-23 01:12:23 +05:30
sairajzero
836f359cf2 floDapps_v2.0.1c
- Added verifyPin: function to verify the pin of login credentials without logging in (ie, not storing the keys in memory)
- 'pin' argument can be ignored to check if private key is secured or not.
2021-02-12 03:06:42 +05:30
sairajzero
dd59c25d73 floCloudAPI_v2.0.2e
- Fixed bug: multiple cloud connection caused issue with inactive array.
Hence replaced Array with Set
2021-01-20 22:54:38 +05:30
sairajzero
b5532444fb floCloudAPI_v2.0.2d | floDapps_v2.0.1b
floCloudAPI_v2.0.2d
- Fixed bug: syntax error in requestObjectData
 - Added closeRequest: closes the active live requests

floDapps_v2.0.1b
- minor improvements and alignment.
- Fixed: deleteAppData deletes the lastTx data of the adminID.
2021-01-02 19:11:15 +05:30
sairajzero
1a57f74704 Alignment
- Moving onLoadStartUp script tag to head
2020-12-31 23:20:51 +05:30
Sai Raj
634aa5aebd
Merge pull request #13 from sairajzero/master 2020-12-19 22:35:42 +05:30
sairajzero
fc747dae83 floBlockchainAPI v2.0.1 | floCloudAPI v2.0.2c
- Added: getTx(txid) to floBlockchainAPI. resolves the tx data of the given txid.

-
2020-12-19 22:26:00 +05:30
sairajzero
30c13ae12f compactIDB v2.0.1
- Fixed bug: database upgrade not working correctly when upgrading existing db.
- Added upgradeDB as a standalone function. (also called by initDB if upgrade is required)
- Added getDBversion: resolves the version of the db
- Improved openDB: rejects if the db is not found
2020-12-15 05:02:50 +05:30
sairajzero
b0e15d1a7f Minor bug fixes 2020-12-09 03:49:32 +05:30
Sai Raj
cafd76655e
Merge pull request #12 from sairajzero/master 2020-11-30 03:31:31 +05:30
sairajzero
99ce43c089 floCloudAPI_v2.0.2a | floDapps_v2.0.1
floCloudAPI v2.0.2a
- deleteApplicationData accepts options instead of application (to match other functions).
- Added editApplicationData
- sendGeneralData not longer stores data in IDB.
- fixed bug: Infinite callback loop in requestGeneralData and requestObjectData

floDapps v2.0.1
- added mid startup support
- added deleteUserData and deleteAppData
- replaced reactor startup logger with setCustomStartupLogger
2020-11-30 03:29:06 +05:30
Sai Raj
5a1aff68ce
Merge pull request #11 from sairajzero/master 2020-10-15 01:46:04 +05:30
Sai Raj
a650ed17a8
Merge pull request #6 from sairajzero/dev
version update (Major changes)
2020-10-15 01:43:29 +05:30
Sai Raj
50594b6bd9
Merge pull request #5 from ranchimall/master 2020-10-15 01:41:32 +05:30
sairajzero
f5f29cb620 bug fix
- Changed SNStorageID
- fixed bug: supernodes not read from blockchain
- generalData incorrectly stored
2020-10-15 01:33:19 +05:30
sairajzero
a8218630ea Contacts feature
- spliting IDB into 3 parts:
1. floDapps - common DB for all apps across all users
2. userDB - common DB for all apps for specific user floID
3. appDB - app DB across all users

- contacts, pubKeys can be stored by users in userDB
- users can send direct message across all apps using floDapps.sendMessage
- syncData can be used to sync user data between devices
2020-10-12 02:38:28 +05:30
sairajzero
cc2d4f8248 Mark feature 2020-09-27 03:21:43 +05:30
sairajzero
65f16fa14b Bug fixes
minor bug fixes
2020-09-20 13:11:07 +05:30
sairajzero
4e9af8060a stdop Improvement
STD_OP

floGlobals
- combined vectorClock (for objectData) and generalVC (for generalData) into lastVC.

init
- Bug fixed: floData of 16 character dropped by floSight.

floCrypto
- Improved getFloIDfromPubkeyHex to getFloID: return floID from either pubKey or privKey.
- verifyPrivKey, validateAddr return false if arguments are empty.

floSupernode
- Removed floSupernode module.
- Kbucket submodule moved to floCloudAPI

Kbucket (subModule)
- Improved KBucket module
- Kbucket cyclic array (SNCO) is formed (w.r.t. distance) when kBucket is launched
- nextNode, prevNode are determined by SNCO

compactIDB
- Improved searchData (accepts option parameter instead of patternEval)
	.options (lowerKey, upperKey, atKey, patternEval, lastOnly)

floCloudAPI
- Improved data signature during sending.
	.current format ( ["receiverID", "time", "application", "type", "message", "comment"])
- Adding live request:
	.requesting data now accepts option callback
	.when callback option is passed, the request becomes live request
	.ie, cloud automatically forwards new data received by the requested floID
	.callback function is called with new data is received
	.callback supported functions: requestApplicationData, requestGeneralData, requestObjectData
- Adding feature to delete from cloud.
	.data received can now be deleted from cloud
	.signature is required for verification (thus requires privKey logged in)
	.can only delete own data (received only)

floDapps
- merged manageSubAdmins and setApplicationSettings into manageAppConfig(adminPrivKey, addList, rmList, settings)
- Improved getNextGeneralData
	.getNextGeneralData can now sub-categorize comment (even when generalData is request for all comment)
	.getNextGeneralData now keeps a track pointer of previously called. [vectorClock (ie, second parameter) must be null, default is null]
2020-09-19 03:39:19 +05:30
sairaj mote
2c58bd662a
Added link for different sections 2020-09-17 13:59:05 +05:30
sairaj mote
0c342eaf2d fixed max character issue 2020-09-11 18:20:42 +05:30
Vivek Teega
e61be9f594 Fixed: floData with 16 char didnot sent on testnet
Adjusted max floData size to 1040
2020-09-11 18:13:49 +05:30
sairaj mote
7e470d520f Added FLO data character counter 2020-09-11 17:48:08 +05:30
Sai Raj
3439ea5f4a
bug fix: floData length issue
Fixed: floData with 16 char didnot sent
Adjusted max floData size to 1040
2020-09-11 17:21:27 +05:30
Vivek Teega
ac5d4805e5 Settting flosight as the reliable server for webwallet, for now. todo : undo this commit later on 2020-09-10 13:13:56 +05:30
Sai Raj
8078a83122
Merge pull request #10 from sairajzero/master 2020-08-25 18:05:57 +05:30
sairajzero
9b7dd8214d bug fix
- Fixed: Invalid private key on signing in error not working correctly and cause other bugs
2020-08-25 18:03:12 +05:30
Sai Raj
49d4377900
Merge pull request #9 from sairajzero/master 2020-08-20 17:53:05 +05:30
Vivek Teega
425f24995f renaming files for GitHub Pages hosting 2020-08-12 15:28:21 +05:30
sairajzero
5e8f0dddb5 Update README.md 2020-08-07 04:34:14 +05:30
sairajzero
fe1ce64562 minor change
-  floBlockchainAPI's readData: changing default limit option value from 1000 to no limit
2020-08-07 04:34:03 +05:30
sairajzero
58bee2e9db minor bug fix
- floBlockchainAPI.readData's option pattern ll now test for JSON key matching the pattern
- startUp fn readAppConfigFromAPI checks if the content is a object or not to prevent errors
2020-08-07 04:19:38 +05:30
sairajzero
ceecfab2b7 Merge branch 'master' of https://github.com/sairajzero/Standard_Operations 2020-08-05 14:05:37 +05:30
sairajzero
c3607aa58f Update README.md 2020-08-05 13:56:12 +05:30
Sai Raj
d4ce67033d
Merge pull request #4 from ranchimall/master 2020-08-05 13:51:17 +05:30
5b93464f42
Update README.md 2020-08-05 13:49:07 +05:30
sairajzero
f6a07b20ba Minor Improvements
- generalData now also stores sign and pubKey.
- renamed startup fn readSubAdminListFromAPI to readAppConfigFromAPI.
- readAppConfigFromAPI also loads settings from the IDB to floGlobals.
2020-08-01 18:38:10 +05:30
sairajzero
62c190567e Adding settings and encrypted generalData feature
- floDapps now reads 'settings' from blockchain
- improved manageSubAdmins: doesnot send tx if addList and rmList are empty (i.e, no changes)
- setApplicationSettings: used to set settings for the application.
Note: existing settings are overwritten (ie, not appended) if same key is used.
- sendGeneralData now supports a new option (encrypt): Encrypts the message before sending.
Note: option value can be boolean true or pubKey of a floID. Passing true will encrypt the data using the default encryptionKey (default 'encryptionKey' must be set in settings).
- getNextGeneralData now supports a new option (decrypt): Decrypts the message if possible.
Note: option value can be true, privateKey or array of privateKeys.
If boolean true is passed, decrypts using myPrivKey (loggedIn privateKey).
If privateKey (string) is passed, decrypts using the given privateKey.
If array of privateKeys are passed, decrypts the message using the suitable key from the given array. (for example, say messages A, B, C are encrypted for keys X, Y, Z respectively, passing [X, Z] will decrypt messages A and C.
2020-07-31 22:24:27 +05:30
e2d9adde07
Update README.md 2020-07-05 23:16:52 +05:30
9d909ebc8c
Update README.md 2020-07-05 23:14:32 +05:30
2edf26228a
Update README.md 2020-07-05 22:26:22 +05:30
be52706a05
Update README.md 2020-07-05 22:16:52 +05:30
9be2c5103d
Update README.md 2020-07-05 19:03:29 +05:30
f13e87dbf9
Update README.md 2020-07-05 18:18:11 +05:30
084aced9b7
Update README.md 2020-07-05 18:15:34 +05:30
70f8cd95b1
Update README.md 2020-07-05 17:15:35 +05:30
e065f688af
Update README.md 2020-07-05 17:06:15 +05:30
6c55653f2a
Update README.md 2020-07-05 14:26:54 +05:30
0050648da2
Update README.md 2020-07-05 14:24:37 +05:30
120ebcf036
Update README.md 2020-07-05 14:21:28 +05:30
5216154940
Update README.md 2020-07-05 14:14:39 +05:30
8a6a4fb1d6
Update README.md 2020-07-05 14:06:27 +05:30
4818cc410a
Update README.md 2020-07-05 13:43:32 +05:30
ec0d420ca7
Update README.md 2020-07-05 13:36:14 +05:30
beebb5795a
Update README.md 2020-07-05 13:12:16 +05:30
39a09be7d9
Update README.md 2020-07-05 11:16:08 +05:30
01b5c5f490
Update README.md 2020-07-05 10:26:00 +05:30
b6affaf6ea
Update README.md 2020-07-05 10:23:00 +05:30
863e4f465d
Update README.md 2020-06-23 20:36:11 +05:30
a33e79a8d0
Update README.md 2020-06-23 20:35:41 +05:30
8e61606de7
Update README.md 2020-06-23 20:33:29 +05:30
25424b9476
Update README.md 2020-06-23 20:21:57 +05:30
14d54c2046
Update README.md 2020-06-23 20:19:01 +05:30
754738f06f
Update README.md 2020-06-23 20:08:13 +05:30
ee26c73936
Update README.md 2020-06-23 19:59:09 +05:30
4f91a3e44e
Update README.md 2020-06-23 19:57:55 +05:30
f23dd9e6e8
Update README.md 2020-06-23 19:53:38 +05:30
33ec57cea1
Update README.md 2020-06-23 19:52:57 +05:30
e7fcd3dd0e
Update README.md 2020-06-23 19:48:38 +05:30
ee267bc31d
Update README.md 2020-06-23 19:32:49 +05:30
1925462202
Update README.md 2020-06-23 19:28:29 +05:30
Sai Raj
09569e729b
Merge pull request #8 from sairajzero/master 2020-05-22 18:53:22 +05:30
Sai Raj
7cbb0908d8
Merge pull request #3 from ranchimall/master 2020-05-22 18:52:17 +05:30
sairajzero
5e1e8a624f bug fix: new line in floData cause error
since newline char is not supported in floData, new line (\n) is replaced with space.
2020-05-22 18:50:29 +05:30
SaketAnand
57ff5ae0b9
README.md
Corrected the spelling of "retrieve" from "retrive' in floCloudAPI Section
2020-05-17 10:45:43 +05:30
5699e8dee4
Update README.md 2020-05-16 18:13:42 +05:30
aa7c5c909e
Update README.md 2020-05-16 17:55:30 +05:30
2265581971
Update README.md 2020-05-16 17:53:05 +05:30
6175ac9314
Update README.md 2020-05-16 17:47:27 +05:30
3a23206af9
Update README.md 2020-05-16 15:35:51 +05:30
cc20e28de3
Update README.md 2020-05-16 10:39:59 +05:30
afc286964f
Update README.md 2020-05-16 10:36:45 +05:30
572c559096
Update README.md 2020-05-16 10:33:04 +05:30
09490c560d
Update README.md 2020-05-16 10:14:11 +05:30
2099fa61ba
Update README.md 2020-05-16 09:37:08 +05:30
59dfc6f449
Update README.md 2020-05-16 09:35:17 +05:30
42f493b01b
Update README.md 2020-05-16 09:32:12 +05:30
3d9c763bee
Update README.md 2020-05-16 09:30:31 +05:30
aae73da57f
Update README.md 2020-05-16 09:07:07 +05:30
2f118217d9
Update README.md 2020-05-15 13:40:16 +05:30
Sai Raj
eee8e2e365
Merge pull request #7 from sairajzero/master 2020-05-14 04:00:51 +05:30
Sai Raj
aff5b927e9
Merge branch 'master' into master 2020-05-14 04:00:38 +05:30
Sai Raj
7d65c4da8e
Update README.md 2020-05-14 03:57:23 +05:30
sairajzero
fccf2fdebd Update README.md 2020-05-14 03:52:45 +05:30
sairajzero
a66c2d91c2 minor changes
-Renamed defaultDB propertyName in compactIDB
-Fixed error in writeDataMultiple comment
2020-05-14 03:52:39 +05:30
4eb9649622
Added new standard functions 2020-05-13 10:04:27 +05:30
sairajzero
32da4e28af Improved initDB
initDB also deletes objectstores on upgrade needed (version change)
2020-05-07 15:46:58 +05:30
sairajzero
489996c1b8 Improve clearCredentials
Clearing the private key, public key and floID from memory on clearCredentials
2020-05-06 19:56:31 +05:30
Sai Raj
1e6d2462af
Merge pull request #6 from sairajzero/master 2020-05-06 19:03:08 +05:30
sairajzero
d90e9f6ed4 Adding secure PrivateKey feature
floDapps.securePrivKey(pwd): replaces the stored private key with encrypted variant.
Changed made in startup function getCredentials to support securePrivateKey.

Improved and promisified clearCredentials.
2020-05-06 00:31:44 +05:30
sairajzero
0308af983f Adding clearData to CompactIDB
compactIDB.clearData clears all data in the given objectstore.
2020-05-02 18:48:02 +05:30
sairajzero
38f43d805d InitDB: add missing objectStores
InitDB now automatically adds the missing objectstore instead of rejecting
2020-05-02 18:10:47 +05:30
sairajzero
1954fc0782 Improved sendTxMultiple and writeDataMultiple
sendTxMultiple:
There are 2 modes (given send amount, preserve ratio)
- Given Send Amount: Uses the given send amount from each sender IDs. Pass the senderPrivKeys as object with amount to invoke this mode
eg. { privateKey1: sendAmt1, privateKey2: sendAmt2...}
- preserveRatio: The ratio of the balance of the senders are maintained. Pass the senderPrivKeys as array of private keys.
eg. [privatekey1, privatekey2....]
*Note: receivers must always be object of floIDs with receive amount.
eg. {receiverID1: receiveAmt1, receiver2: receiveAmt2...}

writeDataMultiple:
There are 2 modes (preserveRatio, equalContribution)
- preserveRatio: preserves the ratio of the balance of senders
- equalContribution: all senders contribute equal amount to the transaction
Note:
*senderPrivKey and receivers are arrays
eq. [privateKey1, privateKey2, ..] and [receiverID1, receiverID2...]
*sends default amount (floGlobals.sendAmt) to each receiver)
*last (4th) parameter is optional:
(default) true: invokes preserveRatio mode
false: invokes equalContibution mode
2020-04-26 01:04:12 +05:30
sairajzero
a569adcb74 Adding mergeUTXOs, sendTxMulti and writeDataMulti
mergeUTXOs: /merge all UTXOs of a given floID into a single UTXO

sendTxMulti: Send Tx from (and/or) to multiple floID

writeDataMulti: Write data into blockchain from (and/or) to multiple floID
2020-04-25 17:54:13 +05:30
sairajzero
0a6fb69349 Beautify the scripts 2020-04-23 21:16:54 +05:30
sairajzero
3d0c8883b7 Improved floCloudAPI
floCloudAPI now stores the lastCommit value of the objects via requestObjectData, resetObjectData, updateObjectData

resetObjectData and updateObjectData now takes the new and old value from floGlobals.appObjects and lastCommit respectively

Parameter changes:
resetObjectData: function(objectName, options = {})
updateObjectData: function(objectName, options = {})
2020-03-10 22:00:56 +05:30
sairajzero
8652959e54 floCrypto: errorHanding
errorHanding added to floCrypto.getPubKeyHex and floCrypto.getFloIDfromPubkeyHex
2020-03-04 03:45:50 +05:30
sairajzero
47ca6a802e moving onloadStartup to a seperate script tag 2020-02-16 02:38:51 +05:30
sairajzero
d6c4b4882e changing TEST_MODE adminID 2020-02-16 02:36:35 +05:30
sairajzero
86ea714139 adding manage subAdmin to floDapps
floDapps.manageSubAdmins() allows the user to add and/or remove subadmin list via blockchain
*Requires Admin Privatekey of the app
2020-02-16 02:34:58 +05:30
sairajzero
c3a51f44a7 bug fix 2020-02-06 14:56:12 +05:30
sairajzero
7a6a2dc9ea Custom privKeyInput is made promisified
privKeyInput now uses given key when resolved and generates random key when rejected
2020-02-06 13:38:09 +05:30
sairajzero
cdeab33c20 Login as guest feature
Entering a empty string for private Key now automatically generated a random key and logins as guest
2020-02-03 18:43:29 +05:30
Sai Raj
43afe64fbf
Merge pull request #4 from sairajzero/master 2020-01-31 22:06:52 +05:30
sairajzero
2bf166ffd1 bug fix: floSupernode module 2020-01-31 20:22:35 +05:30
sairajzero
a44fe4be72 adding custom input for privkey 2020-01-31 14:42:42 +05:30
sairajzero
e3e034ae0a bug fix: vectorClock IDB 2020-01-22 22:25:02 +05:30
sairajzero
556f4ddadd bug fix: floCloudAPI 2020-01-07 15:06:03 +05:30
Sai Raj
bbb2a4596b
Merge pull request #3 from sairajzero/master 2020-01-05 20:53:21 +05:30
sairajzero
f5f44f9415 Merge branch 'master' of https://github.com/sairajzero/Standard_Operations 2020-01-05 20:44:14 +05:30
sairajzero
efbb6fa9e2 bug fix 2020-01-05 20:44:09 +05:30
sairajzero
73965d87fc adding event listner to startup functions
startUpSuccessLog and startUpSuccessLog Events are registered to log the start up functions
2020-01-05 20:40:53 +05:30
Sai Raj
2c6b422533
Merge pull request #2 from sairajzero/master 2020-01-05 20:17:37 +05:30
Sai Raj
2b847b7a4e
Update README.md 2020-01-05 20:13:53 +05:30
sairajzero
1301caaa40 adding a dummy floID as adminID 2020-01-05 20:00:02 +05:30
Sai Raj
8dbace647f
Merge pull request #1 from sairajzero/master 2020-01-05 19:55:09 +05:30
sairajzero
e40771eb23 bug fix: some missing libraries 2020-01-05 19:43:09 +05:30
sairajzero
c473d200c0 Improving floSupernode.kBucket module
Adding getInnerNodes and getOuterNodes
getPrevSupernode, getNextSupernode and determineClosestSupernode now return an array of floIDs
2020-01-05 19:42:34 +05:30
sairajzero
5e9926b87b bug fix: floDapps 2019-12-19 22:28:43 +05:30
sairajzero
5a2b6250ca adding floDapps std_Op
This std_op contains functions for FLO Dapp startup and other useful functions for FLO Dapps
2019-12-19 22:03:53 +05:30
sairajzero
e42a972f12 floCloudAPI: moving the reactor events to util and Promisifying all canon operations 2019-12-19 21:42:02 +05:30
sairajzero
afa8714d0e bug fix 2019-12-19 20:31:30 +05:30
sairajzero
8f3ef66d15 moving KBucket library to floSupernode tag 2019-12-19 20:27:21 +05:30
sairajzero
d09ada8261 floCrypto improvement
moving non canon functions to util property
2019-12-19 20:25:14 +05:30
sairajzero
7a60c9f134 Moving libraries to init_lib 2019-12-19 20:23:24 +05:30
sairajzero
a06f455026 Moved floGlobals to to head and added id to std_op script tag 2019-12-19 20:08:11 +05:30
sairajzero
e691662c82 adding send and request general data to floCloudAPI
sendGeneralData : sends general data to the cloud
requestGeneralData : request general data from the cloud
2019-12-12 18:11:26 +05:30
sairajzero
e7a74c785e Adding Shamir's Shared Secret to floCrypto
Adding Shamir's Shared Secret to floCrypto module
createShamirsSecretShares: create the shamirs secret shares
retrieveShamirSecret: retrives the secret from shares
verifyShamirsSecret: verify the shares with secret
Also adding randInt and randString to floCrypto module
2019-12-01 11:45:00 +05:30
sairajzero
577bee4d37 Adding requestApplicationData
requestApplicationData : request any message from the supernode cloud
Fixed minor bugs
2019-11-20 20:20:39 +05:30
Sai Raj
62ac2a9371
Merge pull request #2 from ranchimall/master 2019-11-20 18:20:13 +05:30
Sai Raj
5ae3214a67
Rename index.html to standard_Operations.html 2019-11-20 18:15:34 +05:30
sairajzero
ce28df6834 adding automatic fetch for flosight API 2019-11-20 02:07:35 +05:30
sairajzero
289089d972 Adding floCloudAPI
floCloudAPI has methods to send application data, request application data, reset or update object data.
2019-11-19 20:11:32 +05:30
sairajzero
d79d54b400 Updating to match the backup node feature of SN 2019-11-19 20:09:15 +05:30
sairaj mote
10a5393373
Update README.md 2019-10-20 01:15:39 +05:30
sairaj mote
41eb1dc452
added description for floBlockchainAPI and compact IDB operations 2019-10-20 01:07:28 +05:30
Sai Raj
57d16248d9
fixing bug in initDB 2019-10-17 17:21:07 +05:30
Sai Raj
049cd5823c
changing ws:// to wss:// in supernode module 2019-10-17 15:55:24 +05:30
Sai Raj
b1c6d8c153
fixing broadcastTx not been asynchronized call 2019-10-13 03:04:28 +05:30
sairajzero
ed59eeeb65 Added removeData in compactIDB 2019-10-06 03:51:13 +05:30
sairajzero
68472cad56 floBlockchainAPI.readData will now return a object with totalTxs and data 2019-10-06 03:15:18 +05:30
sairajzero
9da3168f45 Improved Read Data from blockchain via API
Replaced floBlockchainAPI's readSentData, readDataPattern, readSentDataPattern, readDataContains, readSentDataContains with a improved version 'readData'
readData is Promisfied function that reads and resolves floData from blockchain using API
Arguments :
addr - address from which the floData should be read
options - (optional object, default = {})
Options :
limit - maximum number of filtered data (default = 1000, negative  = no limit)
ignoreOld - ignore old txs (default = 0)
sentOnly - filters only sent data
pattern - filters data that starts with a pattern
contains - filters data that contains a string
filter - custom filter funtion for floData (eg . filter: d => {return d[0] == '$'})
2019-10-06 02:52:34 +05:30
sairajzero
8fd579dc5e Removed supernode Server
Removed supernode server so that this repo can be templated directly for projects
2019-10-04 21:16:55 +05:30
sairajzero
243e3300ae Merge branch 'master' of https://github.com/ranchimall/Standard_Operations 2019-10-04 20:41:08 +05:30
sairajzero
ae71390df4 fixing bugs 2019-10-04 20:35:10 +05:30
sairajzero
9bdac8b042 fixing some bugs 2019-10-04 20:34:26 +05:30
sairajzero
2ea373ef2d improved reading floData via API 2019-10-04 20:31:56 +05:30
Sai Raj
268ffe4197
Update index.html 2019-10-03 00:20:20 +05:30
Sai Raj
e2948b1db5
Update README.md 2019-09-29 22:07:01 +05:30
Sai Raj
d7f1d215dd
Update README.md 2019-09-29 22:04:11 +05:30
sairajzero
bd52c44169 Added compactIDB operations and fixed bugs 2019-09-29 13:55:46 +05:30
sairajzero
dd402cd454 Adding files 2019-09-27 21:34:16 +05:30
sairajzero
bf24208898 Initial commit 2019-09-27 21:10:01 +05:30
19 changed files with 18244 additions and 14749 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.tmp*

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

21
LICENCE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 Sai Raj
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,73 +1,76 @@
# FLO_webWallet
# FLO Wallet
FLO Web Wallet
These are client side scripts that can generate FLO addresses, send FLO transactions to the blockchain and monitor FLO data from the blockchain
These are client-side scripts that can generate FLO addresses, send FLO transactions to the blockchain and monitor FLO data from the blockchain
NOTE : Use respective file for mainnet and testnet
NOTE: Use respective file for mainnet and testnet
### Live URL for FLO Wallet:
*https://ranchimall.github.io/flowallet/*
## Instructions to use
Note : Web wallet uses IndedxedDB for storing data, which means data is stored in respective browser you used to open web wallet.Data stored by one browser can't be accessed by other browser.
Note: Web wallet uses IndedxedDB for storing data, which means data is stored in the respective browser you used to open web wallet. Data stored by one browser can't be accessed by other browsers.
There are 4 pages in this web app :
----------------------
### Monitor FLO Data
This apge allows user to view the transactions done by the given address/es.
This app allows users to view the transactions done by the given address/es.
1. Click/Tap on the '+' floating button at bottom-right hand side, which opens a popup window.
2. Enter the FLO address that you want to monitor, You can also specify a label to that address which will be displayed as name for that address.If you left label field empty, the default label will be 'Unknown'.
2. Enter the FLO address that you want to monitor, You can also specify a label for that address which will be displayed as a name for that address. If you left the label field empty, the default label will be 'Unknown'.
3. Click/Tap on 'Ok' and the address you added will be displayed on monitoring page as a card.This address is also added to your local database.Once you add an address/label pair, It will stay there untill you clear data(Option available in Settings page).
3. Click/Tap on 'Ok' and the address you added will be displayed on the monitoring page as a card. This address is also added to your local database. Once you add an address/label pair, It will stay there until you clear data(Option available on Settings page).
4. When you hover mouse pointer on a monitoring card, three dots will appear. clicking on this allows user to edit or remove that address from monitoring list.(On mobile devices this option is always visible)
4. When you hover the mouse pointer on a monitoring card, three dots will appear. clicking on this allows the user to edit or remove that address from the monitoring list.(On mobile devices this option is always visible)
5. To see transactions done by any address, click/Tap on respective address card.It will open an follow up window, which displays transactions in messege format. consisting of data sent/received to/from, date of transaction and FLO data. Arrows on messege body indicate direction of transaction i.e. Data is sent or received.On the top of window we have option to go back to monitoring page or refresh the transaction history.
5. To see transactions done by any address, click/Tap on the respective address card. It will open a follow-up window, which displays transactions in the message format. consisting of data sent/received to/from, date of transaction, and FLO data. Arrows on the message body indicate the direction of the transaction i.e. Data is sent or received. On the top of the window, we have the option to go back to the monitoring page or refresh the transaction history.
### Send FLO Data
This page allows user to send FLO data and transactions to the blockchain.To send any data you have to check your balance first, to make sure you have enough balance as each transaction requires 0.0005 FLOs to be valid.
This page allows users to send FLO data and transactions to the blockchain. To send any data you have to check your balance first, to make sure you have enough balance as each transaction requires 0.0005 FLOs to be valid.
1. Enter the sender's address
2. Click check balance.
3. Balance of the respective address will be displayed
4. Enter the Receiver's address
5. Enter amount
5. Enter the amount
6. Enter FLO data (if required)
7. Click Send
8. Enter the private key for the address in the prompt
9. The transaction will be sent to the blockchain and returns the txid (returns error if any).
Note : Transcation fee is set to 0.0005
Note: Transaction fee is set to 0.0005
### FLO address generation/recovery page
This page can be used to generate or recover FLO address and private key pairs.This page has two buttons
#### generate new address
As the name implies this button when clicked/tapped generates new FLO address and private key pair.Also there is an one click/tap option that allows user to copy FLO address or private key.
This page can be used to generate or recover FLO addresses and private key pairs. This page has two buttons
#### generate a new address
As the name implies this button when clicked/tapped generates a new FLO address and private key pair. Also, there is a one-click/tap option that allows the user to copy the FLO address or private key.
#### recover FLO address
This button when click/tapped opens a popup, which prompts user to enter private key associated with the FLO address that has to be recovered. Once correct private key is entered corresponding FLO address is displayed again.
#### Recover FLO address
This button when click/tapped opens a popup, which prompts the user to enter private key associated with the FLO address that has to be recovered. Once the correct private key is entered corresponding FLO address is displayed again.
Note : Do not share your private key with anyone and keep it safe. Once lost a private key can't be recovered.
Note: Do not share your private key with anyone and keep it safe. Once lost a private key can't be recovered.
### Settings page
This page contains settings and information about webapp.
This page contains settings and information about Webapp.
#### Dark mode setting
This section allows user to set color scheme (light/dark) with two options, either automatic or manual.
1. Automatic - If this toggle is turned on, Dark mode is enabled automatically from 6pm to 6am(Custom timing will be added in future versions).
This section allows the user to set a color scheme (light/dark) with two options, either automatic or manual.
1. Automatic - If this toggle is turned on, Dark mode is enabled automatically from 6 pm to 6 am (Custom timing will be added in future versions).
2. Manual - Turning this toggle on/off changes color scheme and stayes in that mode unless changed by user again.
2. Manual - Turning this toggle on/off changes the color scheme and stays in that mode unless changed by the user again.
#### CLear all local data
This option clears all the data stored in IndexedDB databases from browser. This is same as clearing browser data and cache.After deleting data, it may take more time to load transactions as they are now fetched again from blockchain. Also you have to add addresses to start monitoring again.
This option clears all the data stored in IndexedDB databases from the browser. This is the same as clearing browser data and cache. After deleting data, it may take more time to load transactions as they are now fetched again from the blockchain. Also, you have to add addresses to start monitoring again.
#### About
This section contains information about version and underlying technologies.
This section contains information about the version and underlying technologies.
Note : For reducing API calls and processing time , monitored data are stored in local browser. While monitoring the same address, the data from browser database (IndexedDB) is used and only the new transactions are obtained using API.
Note: For reducing API calls and processing time, monitored data are stored in the local browser. While monitoring the same address, the data from the browser database (IndexedDB) is used and only the new transactions are obtained using API.

BIN
css/back.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

1
css/lighthouse.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 15 KiB

1416
css/main.css Normal file

File diff suppressed because it is too large Load Diff

1
css/main.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1370
css/main.scss Normal file

File diff suppressed because it is too large Load Diff

3277
index.html Normal file

File diff suppressed because it is too large Load Diff

257
scripts/compactIDB.js Normal file
View File

@ -0,0 +1,257 @@
(function (EXPORTS) { //compactIDB v2.1.2
/* Compact IndexedDB operations */
'use strict';
const compactIDB = EXPORTS;
var defaultDB;
const indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
const IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.msIDBTransaction;
const IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange || window.msIDBKeyRange;
if (!indexedDB) {
console.error("Your browser doesn't support a stable version of IndexedDB.");
return;
}
compactIDB.setDefaultDB = dbName => defaultDB = dbName;
Object.defineProperty(compactIDB, 'default', {
get: () => defaultDB,
set: dbName => defaultDB = dbName
});
function getDBversion(dbName = defaultDB) {
return new Promise((resolve, reject) => {
openDB(dbName).then(db => {
resolve(db.version)
db.close()
}).catch(error => reject(error))
})
}
function upgradeDB(dbName, createList = null, deleteList = null) {
return new Promise((resolve, reject) => {
getDBversion(dbName).then(version => {
var idb = indexedDB.open(dbName, version + 1);
idb.onerror = (event) => reject("Error in opening IndexedDB");
idb.onupgradeneeded = (event) => {
let db = event.target.result;
if (createList instanceof Object) {
if (Array.isArray(createList)) {
let tmp = {}
createList.forEach(o => tmp[o] = {})
createList = tmp
}
for (let o in createList) {
let obs = db.createObjectStore(o, createList[o].options || {});
if (createList[o].indexes instanceof Object)
for (let i in createList[o].indexes)
obs.createIndex(i, i, createList[o].indexes || {});
}
}
if (Array.isArray(deleteList))
deleteList.forEach(o => db.deleteObjectStore(o));
resolve('Database upgraded')
}
idb.onsuccess = (event) => event.target.result.close();
}).catch(error => reject(error))
})
}
compactIDB.initDB = function (dbName, objectStores = {}) {
return new Promise((resolve, reject) => {
if (!(objectStores instanceof Object))
return reject('ObjectStores must be an object or array')
defaultDB = defaultDB || dbName;
var idb = indexedDB.open(dbName);
idb.onerror = (event) => reject("Error in opening IndexedDB");
idb.onsuccess = (event) => {
var db = event.target.result;
let cList = Object.values(db.objectStoreNames);
var obs = {},
a_obs = {},
d_obs = [];
if (!Array.isArray(objectStores))
var obs = objectStores
else
objectStores.forEach(o => obs[o] = {})
let nList = Object.keys(obs)
for (let o of nList)
if (!cList.includes(o))
a_obs[o] = obs[o]
for (let o of cList)
if (!nList.includes(o))
d_obs.push(o)
if (!Object.keys(a_obs).length && !d_obs.length)
resolve("Initiated IndexedDB");
else
upgradeDB(dbName, a_obs, d_obs)
.then(result => resolve(result))
.catch(error => reject(error))
db.close();
}
});
}
const openDB = compactIDB.openDB = function (dbName = defaultDB) {
return new Promise((resolve, reject) => {
var idb = indexedDB.open(dbName);
idb.onerror = (event) => reject("Error in opening IndexedDB");
idb.onupgradeneeded = (event) => {
event.target.result.close();
deleteDB(dbName).then(_ => null).catch(_ => null).finally(_ => reject("Datebase not found"))
}
idb.onsuccess = (event) => resolve(event.target.result);
});
}
const deleteDB = compactIDB.deleteDB = function (dbName = defaultDB) {
return new Promise((resolve, reject) => {
var deleteReq = indexedDB.deleteDatabase(dbName);;
deleteReq.onerror = (event) => reject("Error deleting database!");
deleteReq.onsuccess = (event) => resolve("Database deleted successfully");
});
}
compactIDB.writeData = function (obsName, data, key = false, dbName = defaultDB) {
return new Promise((resolve, reject) => {
openDB(dbName).then(db => {
var obs = db.transaction(obsName, "readwrite").objectStore(obsName);
let writeReq = (key ? obs.put(data, key) : obs.put(data));
writeReq.onsuccess = (evt) => resolve(`Write data Successful`);
writeReq.onerror = (evt) => reject(
`Write data unsuccessful [${evt.target.error.name}] ${evt.target.error.message}`
);
db.close();
}).catch(error => reject(error));
});
}
compactIDB.addData = function (obsName, data, key = false, dbName = defaultDB) {
return new Promise((resolve, reject) => {
openDB(dbName).then(db => {
var obs = db.transaction(obsName, "readwrite").objectStore(obsName);
let addReq = (key ? obs.add(data, key) : obs.add(data));
addReq.onsuccess = (evt) => resolve(`Add data successful`);
addReq.onerror = (evt) => reject(
`Add data unsuccessful [${evt.target.error.name}] ${evt.target.error.message}`
);
db.close();
}).catch(error => reject(error));
});
}
compactIDB.removeData = function (obsName, key, dbName = defaultDB) {
return new Promise((resolve, reject) => {
openDB(dbName).then(db => {
var obs = db.transaction(obsName, "readwrite").objectStore(obsName);
let delReq = obs.delete(key);
delReq.onsuccess = (evt) => resolve(`Removed Data ${key}`);
delReq.onerror = (evt) => reject(
`Remove data unsuccessful [${evt.target.error.name}] ${evt.target.error.message}`
);
db.close();
}).catch(error => reject(error));
});
}
compactIDB.clearData = function (obsName, dbName = defaultDB) {
return new Promise((resolve, reject) => {
openDB(dbName).then(db => {
var obs = db.transaction(obsName, "readwrite").objectStore(obsName);
let clearReq = obs.clear();
clearReq.onsuccess = (evt) => resolve(`Clear data Successful`);
clearReq.onerror = (evt) => reject(`Clear data Unsuccessful`);
db.close();
}).catch(error => reject(error));
});
}
compactIDB.readData = function (obsName, key, dbName = defaultDB) {
return new Promise((resolve, reject) => {
openDB(dbName).then(db => {
var obs = db.transaction(obsName, "readonly").objectStore(obsName);
let getReq = obs.get(key);
getReq.onsuccess = (evt) => resolve(evt.target.result);
getReq.onerror = (evt) => reject(
`Read data unsuccessful [${evt.target.error.name}] ${evt.target.error.message}`
);
db.close();
}).catch(error => reject(error));
});
}
compactIDB.readAllData = function (obsName, dbName = defaultDB) {
return new Promise((resolve, reject) => {
openDB(dbName).then(db => {
var obs = db.transaction(obsName, "readonly").objectStore(obsName);
var tmpResult = {}
let curReq = obs.openCursor();
curReq.onsuccess = (evt) => {
var cursor = evt.target.result;
if (cursor) {
tmpResult[cursor.primaryKey] = cursor.value;
cursor.continue();
} else
resolve(tmpResult);
}
curReq.onerror = (evt) => reject(
`Read-All data unsuccessful [${evt.target.error.name}] ${evt.target.error.message}`
);
db.close();
}).catch(error => reject(error));
});
}
/* compactIDB.searchData = function (obsName, options = {}, dbName = defaultDB) {
return new Promise((resolve, reject) => {
openDB(dbName).then(db => {
var obs = db.transaction(obsName, "readonly").objectStore(obsName);
var filteredResult = {}
let keyRange;
if(options.lowerKey!==null && options.upperKey!==null)
keyRange = IDBKeyRange.bound(options.lowerKey, options.upperKey);
else if(options.lowerKey!==null)
keyRange = IDBKeyRange.lowerBound(options.lowerKey);
else if (options.upperKey!==null)
keyRange = IDBKeyRange.upperBound(options.upperBound);
else if (options.atKey)
let curReq = obs.openCursor(keyRange, )
}).catch(error => reject(error))
})
}*/
compactIDB.searchData = function (obsName, options = {}, dbName = defaultDB) {
options.lowerKey = options.atKey || options.lowerKey || 0
options.upperKey = options.atKey || options.upperKey || false
options.patternEval = options.patternEval || ((k, v) => true);
options.limit = options.limit || false;
options.reverse = options.reverse || false;
options.lastOnly = options.lastOnly || false
return new Promise((resolve, reject) => {
openDB(dbName).then(db => {
var obs = db.transaction(obsName, "readonly").objectStore(obsName);
var filteredResult = {}
let curReq = obs.openCursor(
options.upperKey ? IDBKeyRange.bound(options.lowerKey, options.upperKey) : IDBKeyRange.lowerBound(options.lowerKey),
options.lastOnly || options.reverse ? "prev" : "next");
curReq.onsuccess = (evt) => {
var cursor = evt.target.result;
if (!cursor || (options.limit && options.limit <= Object.keys(filteredResult).length))
return resolve(filteredResult); //reached end of key list or limit reached
else if (options.patternEval(cursor.primaryKey, cursor.value)) {
filteredResult[cursor.primaryKey] = cursor.value;
options.lastOnly ? resolve(filteredResult) : cursor.continue();
} else
cursor.continue();
}
curReq.onerror = (evt) => reject(`Search unsuccessful [${evt.target.error.name}] ${evt.target.error.message}`);
db.close();
}).catch(error => reject(error));
});
}
})(window.compactIDB = {});

13
scripts/components.js Normal file

File diff suppressed because one or more lines are too long

144
scripts/flo-webwallet.js Normal file
View File

@ -0,0 +1,144 @@
(function (EXPORTS) {
/*FLO Web Wallet operations*/
'use strict';
const floWebWallet = EXPORTS;
//generate a new Address triplet : resolves Object(floID,pubKey,privKey)
floWebWallet.generateNewAddr = function () {
return new Promise((resolve, reject) => {
try {
var triplet = floCrypto.generateNewID();
resolve(triplet);
} catch (error) {
reject(error);
}
})
}
//recover triplet from given privKey : resolves Object(floID,pubKey,privKey)
floWebWallet.recoverAddr = function (privKey) {
return new Promise((resolve, reject) => {
try {
var triplet = {}
triplet.privKey = privKey;
triplet.pubKey = floCrypto.getPubKeyHex(triplet.privKey);
triplet.floID = floCrypto.getFloID(triplet.pubKey);
resolve(triplet);
} catch (error) {
reject(error);
}
})
}
//get balance of address using API : resolves (balance)
floWebWallet.getBalance = function (address) {
return new Promise((resolve, reject) => {
floBlockchainAPI.getBalance(address)
.then(txid => resolve(txid))
.catch(error => reject(error))
})
}
//send transaction to the blockchain using API : resolves (txid)
floWebWallet.sendTransaction = function (sender, receiver, amount, floData, privKey) {
return new Promise((resolve, reject) => {
floBlockchainAPI.sendTx(sender, receiver, amount, privKey, floData)
.then(txid => resolve(txid))
.catch(error => reject(error))
})
}
function formatTx(address, tx) {
let result = {
time: tx.time,
block: tx.blockheight,
blockhash: tx.blockhash,
txid: tx.txid,
floData: tx.floData,
confirmations: tx.confirmations
}
//format receivers
let receivers = {};
for (let vout of tx.vout) {
if (vout.scriptPubKey.isAddress) {
let id = vout.scriptPubKey.addresses[0];
if (id in receivers)
receivers[id] += vout.value;
else receivers[id] = vout.value;
}
}
result.receivers = receivers;
//format senders (or mined)
if (!tx.vin[0].isAddress) { //mined (ie, coinbase)
let coinbase = tx.vin[0].coinbase;
result.mine = coinbase;
result.mined = { [coinbase]: tx.valueOut }
} else {
result.sender = tx.vin[0].addresses[0];
result.receiver = tx.vout[0].scriptPubKey.addresses[0];
result.fees = tx.fees;
let senders = {};
for (let vin of tx.vin) {
if (vin.isAddress) {
let id = vin.addresses[0];
if (id in senders)
senders[id] += vin.value;
else senders[id] = vin.value;
}
}
result.senders = senders;
//remove change amounts
for (let id in senders) {
if (id in receivers) {
if (senders[id] > receivers[id]) {
senders[id] -= receivers[id];
delete receivers[id];
} else if (senders[id] < receivers[id]) { //&& id != address
receivers[id] -= senders[id];
delete senders[id];
}
}
}
}
return result;
}
floWebWallet.listTransactions = function (address, page_options = {}) {
return new Promise((resolve, reject) => {
let options = {};
if (Number.isInteger(page_options.page))
options.page = page_options.page;
if (Number.isInteger(page_options.pageSize))
options.pageSize = page_options.pageSize;
floBlockchainAPI.readTxs(address, options).then(response => {
const result = {}
result.items = response.txs.map(tx => formatTx(address, tx));
result.page = response.page;
result.totalPages = response.totalPages;
resolve(result);
}).catch(error => reject(error))
})
}
//get address-label pairs from IDB : resolves Object(floID:label)
floWebWallet.getLabels = function () {
return new Promise((resolve, reject) => {
compactIDB.readAllData('labels')
.then(IDBresult => resolve(IDBresult))
.catch(error => reject(error))
})
}
//bulk transfer tokens
floWebWallet.bulkTransferTokens = function (sender, privKey, token, receivers) {
return new Promise((resolve, reject) => {
floTokenAPI.bulkTransferTokens(sender, privKey, token, receivers)
.then(result => resolve(result))
.catch(error => reject(error))
})
}
})(window.floWebWallet = {});

1044
scripts/floBlockchainAPI.js Normal file

File diff suppressed because it is too large Load Diff

530
scripts/floCrypto.js Normal file
View File

@ -0,0 +1,530 @@
(function (EXPORTS) { //floCrypto v2.3.6a
/* FLO Crypto Operators */
'use strict';
const floCrypto = EXPORTS;
const p = BigInteger("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", 16);
const ecparams = EllipticCurve.getSECCurveByName("secp256k1");
const ascii_alternatives = ` '\n '\n“ "\n” "\n --\n— ---\n≥ >=\n≤ <=\n≠ !=\n× *\n÷ /\n← <-\n→ ->\n↔ <->\n⇒ =>\n⇐ <=\n⇔ <=>`;
const exponent1 = () => p.add(BigInteger.ONE).divide(BigInteger("4"));
coinjs.compressed = true; //defaulting coinjs compressed to true;
function calculateY(x) {
let exp = exponent1();
// x is x value of public key in BigInteger format without 02 or 03 or 04 prefix
return x.modPow(BigInteger("3"), p).add(BigInteger("7")).mod(p).modPow(exp, p)
}
function getUncompressedPublicKey(compressedPublicKey) {
// Fetch x from compressedPublicKey
let pubKeyBytes = Crypto.util.hexToBytes(compressedPublicKey);
const prefix = pubKeyBytes.shift() // remove prefix
let prefix_modulus = prefix % 2;
pubKeyBytes.unshift(0) // add prefix 0
let x = new BigInteger(pubKeyBytes)
let xDecimalValue = x.toString()
// Fetch y
let y = calculateY(x);
let yDecimalValue = y.toString();
// verify y value
let resultBigInt = y.mod(BigInteger("2"));
let check = resultBigInt.toString() % 2;
if (prefix_modulus !== check)
yDecimalValue = y.negate().mod(p).toString();
return {
x: xDecimalValue,
y: yDecimalValue
};
}
function getSenderPublicKeyString() {
let privateKey = ellipticCurveEncryption.senderRandom();
var senderPublicKeyString = ellipticCurveEncryption.senderPublicString(privateKey);
return {
privateKey: privateKey,
senderPublicKeyString: senderPublicKeyString
}
}
function deriveSharedKeySender(receiverPublicKeyHex, senderPrivateKey) {
let receiverPublicKeyString = getUncompressedPublicKey(receiverPublicKeyHex);
var senderDerivedKey = ellipticCurveEncryption.senderSharedKeyDerivation(
receiverPublicKeyString.x, receiverPublicKeyString.y, senderPrivateKey);
return senderDerivedKey;
}
function deriveSharedKeyReceiver(senderPublicKeyString, receiverPrivateKey) {
return ellipticCurveEncryption.receiverSharedKeyDerivation(
senderPublicKeyString.XValuePublicString, senderPublicKeyString.YValuePublicString, receiverPrivateKey);
}
function getReceiverPublicKeyString(privateKey) {
return ellipticCurveEncryption.receiverPublicString(privateKey);
}
function wifToDecimal(pk_wif, isPubKeyCompressed = false) {
let pk = Bitcoin.Base58.decode(pk_wif)
pk.shift()
pk.splice(-4, 4)
//If the private key corresponded to a compressed public key, also drop the last byte (it should be 0x01).
if (isPubKeyCompressed == true) pk.pop()
pk.unshift(0)
let privateKeyDecimal = BigInteger(pk).toString()
let privateKeyHex = Crypto.util.bytesToHex(pk)
return {
privateKeyDecimal: privateKeyDecimal,
privateKeyHex: privateKeyHex
}
}
//generate a random Interger within range
floCrypto.randInt = function (min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(securedMathRandom() * (max - min + 1)) + min;
}
//generate a random String within length (options : alphaNumeric chars only)
floCrypto.randString = function (length, alphaNumeric = true) {
var result = '';
var characters = alphaNumeric ? 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' :
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_+-./*?@#&$<>=[]{}():';
for (var i = 0; i < length; i++)
result += characters.charAt(Math.floor(securedMathRandom() * characters.length));
return result;
}
//Encrypt Data using public-key
floCrypto.encryptData = function (data, receiverPublicKeyHex) {
var senderECKeyData = getSenderPublicKeyString();
var senderDerivedKey = deriveSharedKeySender(receiverPublicKeyHex, senderECKeyData.privateKey);
let senderKey = senderDerivedKey.XValue + senderDerivedKey.YValue;
let secret = Crypto.AES.encrypt(data, senderKey);
return {
secret: secret,
senderPublicKeyString: senderECKeyData.senderPublicKeyString
};
}
//Decrypt Data using private-key
floCrypto.decryptData = function (data, privateKeyHex) {
var receiverECKeyData = {};
if (typeof privateKeyHex !== "string") throw new Error("No private key found.");
let privateKey = wifToDecimal(privateKeyHex, true);
if (typeof privateKey.privateKeyDecimal !== "string") throw new Error("Failed to detremine your private key.");
receiverECKeyData.privateKey = privateKey.privateKeyDecimal;
var receiverDerivedKey = deriveSharedKeyReceiver(data.senderPublicKeyString, receiverECKeyData.privateKey);
let receiverKey = receiverDerivedKey.XValue + receiverDerivedKey.YValue;
let decryptMsg = Crypto.AES.decrypt(data.secret, receiverKey);
return decryptMsg;
}
//Sign data using private-key
floCrypto.signData = function (data, privateKeyHex) {
var key = new Bitcoin.ECKey(privateKeyHex);
var messageHash = Crypto.SHA256(data);
var messageSign = Bitcoin.ECDSA.sign(messageHash, key.priv);
var sighex = Crypto.util.bytesToHex(messageSign);
return sighex;
}
//Verify signatue of the data using public-key
floCrypto.verifySign = function (data, signatureHex, publicKeyHex) {
var msgHash = Crypto.SHA256(data);
var sigBytes = Crypto.util.hexToBytes(signatureHex);
var publicKeyPoint = ecparams.getCurve().decodePointHex(publicKeyHex);
var verify = Bitcoin.ECDSA.verify(msgHash, sigBytes, publicKeyPoint);
return verify;
}
//Generates a new flo ID and returns private-key, public-key and floID
const generateNewID = floCrypto.generateNewID = function () {
var key = new Bitcoin.ECKey(false);
key.setCompressed(true);
return {
floID: key.getBitcoinAddress(),
pubKey: key.getPubKeyHex(),
privKey: key.getBitcoinWalletImportFormat()
}
}
Object.defineProperties(floCrypto, {
newID: {
get: () => generateNewID()
},
hashID: {
value: (str) => {
let bytes = ripemd160(Crypto.SHA256(str, { asBytes: true }), { asBytes: true });
bytes.unshift(bitjs.pub);
var hash = Crypto.SHA256(Crypto.SHA256(bytes, {
asBytes: true
}), {
asBytes: true
});
var checksum = hash.slice(0, 4);
return bitjs.Base58.encode(bytes.concat(checksum));
}
},
tmpID: {
get: () => {
let bytes = Crypto.util.randomBytes(20);
bytes.unshift(bitjs.pub);
var hash = Crypto.SHA256(Crypto.SHA256(bytes, {
asBytes: true
}), {
asBytes: true
});
var checksum = hash.slice(0, 4);
return bitjs.Base58.encode(bytes.concat(checksum));
}
}
});
//Returns public-key from private-key
floCrypto.getPubKeyHex = function (privateKeyHex) {
if (!privateKeyHex)
return null;
var key = new Bitcoin.ECKey(privateKeyHex);
if (key.priv == null)
return null;
key.setCompressed(true);
return key.getPubKeyHex();
}
//Returns flo-ID from public-key or private-key
floCrypto.getFloID = function (keyHex) {
if (!keyHex)
return null;
try {
var key = new Bitcoin.ECKey(keyHex);
if (key.priv == null)
key.setPub(keyHex);
return key.getBitcoinAddress();
} catch {
return null;
}
}
floCrypto.getAddress = function (privateKeyHex, strict = false) {
if (!privateKeyHex)
return;
var key = new Bitcoin.ECKey(privateKeyHex);
if (key.priv == null)
return null;
key.setCompressed(true);
let pubKey = key.getPubKeyHex(),
version = bitjs.Base58.decode(privateKeyHex)[0];
switch (version) {
case coinjs.priv: //BTC
return coinjs.bech32Address(pubKey).address;
case bitjs.priv: //FLO
return bitjs.pubkey2address(pubKey);
default:
return strict ? false : bitjs.pubkey2address(pubKey); //default to FLO address (if strict=false)
}
}
//Verify the private-key for the given public-key or flo-ID
floCrypto.verifyPrivKey = function (privateKeyHex, pubKey_floID, isfloID = true) {
if (!privateKeyHex || !pubKey_floID)
return false;
try {
var key = new Bitcoin.ECKey(privateKeyHex);
if (key.priv == null)
return false;
key.setCompressed(true);
if (isfloID && pubKey_floID == key.getBitcoinAddress())
return true;
else if (!isfloID && pubKey_floID.toUpperCase() == key.getPubKeyHex().toUpperCase())
return true;
else
return false;
} catch {
return null;
}
}
floCrypto.getMultisigAddress = function (publicKeyList, requiredSignatures) {
if (!Array.isArray(publicKeyList) || !publicKeyList.length)
return null;
if (!Number.isInteger(requiredSignatures) || requiredSignatures < 1 || requiredSignatures > publicKeyList.length)
return null;
try {
var multisig = bitjs.pubkeys2multisig(publicKeyList, requiredSignatures);
return multisig;
} catch {
return null;
}
}
floCrypto.decodeRedeemScript = function (redeemScript) {
try {
var decoded = bitjs.transaction().decodeRedeemScript(redeemScript);
return decoded;
} catch {
return null;
}
}
//Check if the given flo-id is valid or not
floCrypto.validateFloID = function (floID, regularOnly = false) {
if (!floID)
return false;
try {
let addr = new Bitcoin.Address(floID);
if (regularOnly && addr.version != Bitcoin.Address.standardVersion)
return false;
return true;
} catch {
return false;
}
}
//Check if the given address (any blockchain) is valid or not
floCrypto.validateAddr = function (address, std = true, bech = true) {
let raw = decodeAddress(address);
if (!raw)
return false;
if (typeof raw.version !== 'undefined') { //legacy or segwit
if (std == false)
return false;
else if (std === true || (!Array.isArray(std) && std === raw.version) || (Array.isArray(std) && std.includes(raw.version)))
return true;
else
return false;
} else if (typeof raw.bech_version !== 'undefined') { //bech32
if (bech === false)
return false;
else if (bech === true || (!Array.isArray(bech) && bech === raw.bech_version) || (Array.isArray(bech) && bech.includes(raw.bech_version)))
return true;
else
return false;
} else //unknown
return false;
}
//Check the public-key (or redeem-script) for the address (any blockchain)
floCrypto.verifyPubKey = function (pubKeyHex, address) {
let raw = decodeAddress(address);
if (!raw)
return;
let pub_hash = Crypto.util.bytesToHex(ripemd160(Crypto.SHA256(Crypto.util.hexToBytes(pubKeyHex), { asBytes: true })));
if (typeof raw.bech_version !== 'undefined' && raw.bytes.length == 32) //bech32-multisig
raw.hex = Crypto.util.bytesToHex(ripemd160(raw.bytes, { asBytes: true }));
return pub_hash === raw.hex;
}
//Convert the given address (any blockchain) to equivalent floID
floCrypto.toFloID = function (address, options = null) {
if (!address)
return;
let raw = decodeAddress(address);
if (!raw)
return;
else if (options) { //if (optional) version check is passed
if (typeof raw.version !== 'undefined' && (!options.std || !options.std.includes(raw.version)))
return;
if (typeof raw.bech_version !== 'undefined' && (!options.bech || !options.bech.includes(raw.bech_version)))
return;
}
raw.bytes.unshift(bitjs.pub);
let hash = Crypto.SHA256(Crypto.SHA256(raw.bytes, {
asBytes: true
}), {
asBytes: true
});
return bitjs.Base58.encode(raw.bytes.concat(hash.slice(0, 4)));
}
//Convert raw address bytes to floID
floCrypto.rawToFloID = function (raw_bytes) {
if (typeof raw_bytes === 'string')
raw_bytes = Crypto.util.hexToBytes(raw_bytes);
if (raw_bytes.length != 20)
return null;
raw_bytes.unshift(bitjs.pub);
let hash = Crypto.SHA256(Crypto.SHA256(raw_bytes, {
asBytes: true
}), {
asBytes: true
});
return bitjs.Base58.encode(raw_bytes.concat(hash.slice(0, 4)));
}
//Convert the given multisig address (any blockchain) to equivalent multisig floID
floCrypto.toMultisigFloID = function (address, options = null) {
if (!address)
return;
let raw = decodeAddress(address);
if (!raw)
return;
else if (options) { //if (optional) version check is passed
if (typeof raw.version !== 'undefined' && (!options.std || !options.std.includes(raw.version)))
return;
if (typeof raw.bech_version !== 'undefined' && (!options.bech || !options.bech.includes(raw.bech_version)))
return;
}
if (typeof raw.bech_version !== 'undefined') {
if (raw.bytes.length != 32) return; //multisig bech address have 32 bytes
//multisig-bech:hash=SHA256 whereas multisig:hash=r160(SHA265), thus ripemd160 the bytes from multisig-bech
raw.bytes = ripemd160(raw.bytes, {
asBytes: true
});
}
raw.bytes.unshift(bitjs.multisig);
let hash = Crypto.SHA256(Crypto.SHA256(raw.bytes, {
asBytes: true
}), {
asBytes: true
});
return bitjs.Base58.encode(raw.bytes.concat(hash.slice(0, 4)));
}
//Checks if the given addresses (any blockchain) are same (w.r.t keys)
floCrypto.isSameAddr = function (addr1, addr2) {
if (!addr1 || !addr2)
return;
let raw1 = decodeAddress(addr1),
raw2 = decodeAddress(addr2);
if (!raw1 || !raw2)
return false;
else {
if (typeof raw1.bech_version !== 'undefined' && raw1.bytes.length == 32) //bech32-multisig
raw1.hex = Crypto.util.bytesToHex(ripemd160(raw1.bytes, { asBytes: true }));
if (typeof raw2.bech_version !== 'undefined' && raw2.bytes.length == 32) //bech32-multisig
raw2.hex = Crypto.util.bytesToHex(ripemd160(raw2.bytes, { asBytes: true }));
return raw1.hex === raw2.hex;
}
}
const decodeAddress = floCrypto.decodeAddr = function (address) {
if (!address)
return;
else if (address.length == 33 || address.length == 34) { //legacy encoding
let decode = bitjs.Base58.decode(address);
let bytes = decode.slice(0, decode.length - 4);
let checksum = decode.slice(decode.length - 4),
hash = Crypto.SHA256(Crypto.SHA256(bytes, {
asBytes: true
}), {
asBytes: true
});
return (hash[0] != checksum[0] || hash[1] != checksum[1] || hash[2] != checksum[2] || hash[3] != checksum[3]) ? null : {
version: bytes.shift(),
hex: Crypto.util.bytesToHex(bytes),
bytes
}
} else if (address.length == 42 || address.length == 62) { //bech encoding
let decode = coinjs.bech32_decode(address);
if (decode) {
let bytes = decode.data;
let bech_version = bytes.shift();
bytes = coinjs.bech32_convert(bytes, 5, 8, false);
return {
bech_version,
hrp: decode.hrp,
hex: Crypto.util.bytesToHex(bytes),
bytes
}
} else
return null;
}
}
//Split the str using shamir's Secret and Returns the shares
floCrypto.createShamirsSecretShares = function (str, total_shares, threshold_limit) {
try {
if (str.length > 0) {
var strHex = shamirSecretShare.str2hex(str);
var shares = shamirSecretShare.share(strHex, total_shares, threshold_limit);
return shares;
}
return false;
} catch {
return false
}
}
//Returns the retrived secret by combining the shamirs shares
const retrieveShamirSecret = floCrypto.retrieveShamirSecret = function (sharesArray) {
try {
if (sharesArray.length > 0) {
var comb = shamirSecretShare.combine(sharesArray.slice(0, sharesArray.length));
comb = shamirSecretShare.hex2str(comb);
return comb;
}
return false;
} catch {
return false;
}
}
//Verifies the shares and str
floCrypto.verifyShamirsSecret = function (sharesArray, str) {
if (!str)
return null;
else if (retrieveShamirSecret(sharesArray) === str)
return true;
else
return false;
}
const validateASCII = floCrypto.validateASCII = function (string, bool = true) {
if (typeof string !== "string")
return null;
if (bool) {
let x;
for (let i = 0; i < string.length; i++) {
x = string.charCodeAt(i);
if (x < 32 || x > 127)
return false;
}
return true;
} else {
let x, invalids = {};
for (let i = 0; i < string.length; i++) {
x = string.charCodeAt(i);
if (x < 32 || x > 127)
if (x in invalids)
invalids[string[i]].push(i)
else
invalids[string[i]] = [i];
}
if (Object.keys(invalids).length)
return invalids;
else
return true;
}
}
floCrypto.convertToASCII = function (string, mode = 'soft-remove') {
let chars = validateASCII(string, false);
if (chars === true)
return string;
else if (chars === null)
return null;
let convertor, result = string,
refAlt = {};
ascii_alternatives.split('\n').forEach(a => refAlt[a[0]] = a.slice(2));
mode = mode.toLowerCase();
if (mode === "hard-unicode")
convertor = (c) => `\\u${('000' + c.charCodeAt().toString(16)).slice(-4)}`;
else if (mode === "soft-unicode")
convertor = (c) => refAlt[c] || `\\u${('000' + c.charCodeAt().toString(16)).slice(-4)}`;
else if (mode === "hard-remove")
convertor = c => "";
else if (mode === "soft-remove")
convertor = c => refAlt[c] || "";
else
return null;
for (let c in chars)
result = result.replaceAll(c, convertor(c));
return result;
}
floCrypto.revertUnicode = function (string) {
return string.replace(/\\u[\dA-F]{4}/gi,
m => String.fromCharCode(parseInt(m.replace(/\\u/g, ''), 16)));
}
})('object' === typeof module ? module.exports : window.floCrypto = {});

166
scripts/floTokenAPI.js Normal file
View File

@ -0,0 +1,166 @@
(function (EXPORTS) { //floTokenAPI v1.0.4a
/* Token Operator to send/receive tokens via blockchain using API calls*/
'use strict';
const tokenAPI = EXPORTS;
const DEFAULT = {
apiURL: floGlobals.tokenURL || "https://ranchimallflo.duckdns.org/",
currency: floGlobals.currency || "rupee"
}
Object.defineProperties(tokenAPI, {
URL: {
get: () => DEFAULT.apiURL
},
currency: {
get: () => DEFAULT.currency,
set: currency => DEFAULT.currency = currency
}
});
if (floGlobals.currency) tokenAPI.currency = floGlobals.currency;
Object.defineProperties(floGlobals, {
currency: {
get: () => DEFAULT.currency,
set: currency => DEFAULT.currency = currency
}
});
const fetch_api = tokenAPI.fetch = function (apicall) {
return new Promise((resolve, reject) => {
console.debug(DEFAULT.apiURL + apicall);
fetch(DEFAULT.apiURL + apicall).then(response => {
if (response.ok)
response.json().then(data => resolve(data));
else
reject(response)
}).catch(error => reject(error))
})
}
const getBalance = tokenAPI.getBalance = function (floID, token = DEFAULT.currency) {
return new Promise((resolve, reject) => {
fetch_api(`api/v1.0/getFloAddressBalance?token=${token}&floAddress=${floID}`)
.then(result => resolve(result.balance || 0))
.catch(error => reject(error))
})
}
tokenAPI.getTx = function (txID) {
return new Promise((resolve, reject) => {
fetch_api(`api/v1.0/getTransactionDetails/${txID}`).then(res => {
if (res.result === "error")
reject(res.description);
else if (!res.parsedFloData)
reject("Data piece (parsedFloData) missing");
else if (!res.transactionDetails)
reject("Data piece (transactionDetails) missing");
else
resolve(res);
}).catch(error => reject(error))
})
}
tokenAPI.sendToken = function (privKey, amount, receiverID, message = "", token = DEFAULT.currency, options = {}) {
return new Promise((resolve, reject) => {
let senderID = floCrypto.getFloID(privKey);
if (typeof amount !== "number" || isNaN(amount) || amount <= 0)
return reject("Invalid amount");
getBalance(senderID, token).then(bal => {
if (amount > bal)
return reject(`Insufficient ${token}# balance`);
floBlockchainAPI.writeData(senderID, `send ${amount} ${token}# ${message}`, privKey, receiverID, options)
.then(txid => resolve(txid))
.catch(error => reject(error))
}).catch(error => reject(error))
});
}
function sendTokens_raw(privKey, receiverID, token, amount, utxo, vout, scriptPubKey) {
return new Promise((resolve, reject) => {
var trx = bitjs.transaction();
trx.addinput(utxo, vout, scriptPubKey)
trx.addoutput(receiverID, floBlockchainAPI.sendAmt);
trx.addflodata(`send ${amount} ${token}#`);
var signedTxHash = trx.sign(privKey, 1);
floBlockchainAPI.broadcastTx(signedTxHash)
.then(txid => resolve([receiverID, txid]))
.catch(error => reject([receiverID, error]))
})
}
//bulk transfer tokens
tokenAPI.bulkTransferTokens = function (sender, privKey, token, receivers) {
return new Promise((resolve, reject) => {
if (typeof receivers !== 'object')
return reject("receivers must be object in format {receiver1: amount1, receiver2:amount2...}")
let receiver_list = Object.keys(receivers), amount_list = Object.values(receivers);
let invalidReceivers = receiver_list.filter(id => !floCrypto.validateFloID(id));
let invalidAmount = amount_list.filter(val => typeof val !== 'number' || val <= 0);
if (invalidReceivers.length)
return reject(`Invalid receivers: ${invalidReceivers}`);
else if (invalidAmount.length)
return reject(`Invalid amounts: ${invalidAmount}`);
if (receiver_list.length == 0)
return reject("Receivers cannot be empty");
if (receiver_list.length == 1) {
let receiver = receiver_list[0], amount = amount_list[0];
floTokenAPI.sendToken(privKey, amount, receiver, "", token)
.then(txid => resolve({ success: { [receiver]: txid } }))
.catch(error => reject(error))
} else {
//check for token balance
floTokenAPI.getBalance(sender, token).then(token_balance => {
let total_token_amout = amount_list.reduce((a, e) => a + e, 0);
if (total_token_amout > token_balance)
return reject(`Insufficient ${token}# balance`);
//split utxos
floBlockchainAPI.splitUTXOs(sender, privKey, receiver_list.length).then(split_txid => {
//wait for the split utxo to get confirmation
floBlockchainAPI.waitForConfirmation(split_txid).then(split_tx => {
//send tokens using the split-utxo
var scriptPubKey = split_tx.vout[0].scriptPubKey.hex;
let promises = [];
for (let i in receiver_list)
promises.push(sendTokens_raw(privKey, receiver_list[i], token, amount_list[i], split_txid, i, scriptPubKey));
Promise.allSettled(promises).then(results => {
let success = Object.fromEntries(results.filter(r => r.status == 'fulfilled').map(r => r.value));
let failed = Object.fromEntries(results.filter(r => r.status == 'rejected').map(r => r.reason));
resolve({ success, failed });
})
}).catch(error => reject(error))
}).catch(error => reject(error))
}).catch(error => reject(error))
}
})
}
tokenAPI.getAllTxs = function (floID, token = DEFAULT.currency) {
return new Promise((resolve, reject) => {
fetch_api(`api/v1.0/getFloAddressTransactions?token=${token}&floAddress=${floID}`)
.then(result => resolve(result))
.catch(error => reject(error))
})
}
const util = tokenAPI.util = {};
util.parseTxData = function (txData) {
let parsedData = {};
for (let p in txData.parsedFloData)
parsedData[p] = txData.parsedFloData[p];
parsedData.sender = txData.transactionDetails.vin[0].addr;
for (let vout of txData.transactionDetails.vout)
if (vout.scriptPubKey.addresses[0] !== parsedData.sender)
parsedData.receiver = vout.scriptPubKey.addresses[0];
parsedData.time = txData.transactionDetails.time;
return parsedData;
}
})('object' === typeof module ? module.exports : window.floTokenAPI = {});

9975
scripts/lib.js Normal file

File diff suppressed because it is too large Load Diff