- Losing your Private Key means losing all the data & money attached
- to your FLO ID. Private Key once lost can NEVER be
- recovered. Please store it safely.
-
+
Settings
+
+ Losing your Private Key means losing all the data & money attached
+ to your FLO ID. Private Key once lost can NEVER be
+ recovered. Please store it safely.
+
+
+
+
+
+
Logout
+
-
-
- Go Back
-
-
-
-
- Go Back
-
+
+
+
+ Go Back
-
+
+
+
+ Go Back
+
+
+
-
+ //for cloud apps
+ subAdmins: [],
+ webAppURL: "ranchimalltimes-webappserver.duckdns.org",
+ application: "TestApp",
+ vectorClock: {},
+ appObjects: {},
+ generalData: {},
+ generalVC: {},
+ };
+
-
+
+
-
-
- //Check if the given Address is valid or not
- validateAddr: function (inpAddr) {
- try {
- var addr = new Bitcoin.Address(inpAddr);
- return true;
- } catch {
- return false;
- }
- },
-
- //Split the str using shamir's Secret and Returns the shares
- 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;
- }
- },
-
- //Verifies the shares and str
- verifyShamirsSecret: function (sharesArray, str) {
- return str && this.retrieveShamirSecret(sharesArray) === str;
- },
-
- //Returns the retrived secret by combining the shamirs shares
- 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;
- }
- },
- };
-
-
-
+
+
-
-
-
-
-
+
+
+
+
+
+
-
-
-
+
+
+ },
+
+ requestGeneralData: function (type, vectorClock = "0") {
+ if (typeof vectorClock !== "string") vectorClock.toString();
+ return new Promise((resolve, reject) => {
+ this.util
+ .requestData([
+ floGlobals.application,
+ "generalData",
+ type,
+ vectorClock,
+ ])
+ .then((result) => {
+ if (result[0]) resolve(result[1]);
+ else reject(result[1]);
+ })
+ .catch((error) => reject(error));
+ });
+ },
+
+ requestObjectData: function (keyPath) {
+ return new Promise((resolve, reject) => {
+ this.util
+ .requestData([floGlobals.application, "appObjects"].concat(keyPath))
+ .then((result) => {
+ if (result[0]) resolve(result[1]);
+ else reject(result[1]);
+ })
+ .catch((error) => reject(error));
+ });
+ },
+
+ requestSubAdminList: function () {
+ return new Promise((resolve, reject) => {
+ this.util
+ .requestData([floGlobals.application, "subAdmins"])
+ .then((result) => {
+ if (result[0]) resolve(result[1]);
+ else reject(result[1]);
+ })
+ .catch((error) => reject(error));
+ });
+ },
+ };
+
-