- generalData now also stores sign and pubKey.
- renamed startup fn readSubAdminListFromAPI to readAppConfigFromAPI.
- readAppConfigFromAPI also loads settings from the IDB to floGlobals.
- 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.
floDapps.securePrivKey(pwd): replaces the stored private key with encrypted variant.
Changed made in startup function getCredentials to support securePrivateKey.
Improved and promisified clearCredentials.
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
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
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 = {})
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