####

Cancel OK

####

Cancel OK

## Send Tx

### Parameters:

sendTx sends a transaction to blockchain, resolves transaction id if the transacation was succsessful.
senderAddr - FLO address from which the data and amount has to be sent.
receiverAddr - FLO address to which has to be sent.
sendAmt - Amount of FLO coins to be sent to receiver.
PrivKey - Private key of sender to verify sender.
floData - FLO data (string, max 1040 characters) (optional, default value is empty string)
Resolves: TransactionID (String)

## SendTx Multiple

### Parameters:

sendTxMultiple sends a transaction to blockchain from multiple floIDs to multiple floIDs, resolves transaction id if the transacation was succsessful.
senderPrivKeys - Array of Private keys of the senders (or) Object of private keys with sendAmount for each floID (eg: { privateKey1: sendAmt1, privateKey2: sendAmt2...}) . Note: If passed as Array, then ratio of the balance of the senders are preserved. If passed as Object uses the amount given.
receivers - Object of receiver floIDs with receive amount (eg: {receiverID1: receiveAmt1, receiver2: receiveAmt2...})
floData - FLO data (string, max 1040 characters) (optional, default value is empty string)
Resolves: TransactionID (String)

## Merge UTXOs

### Parameters:

mergeUTXOs sends a transaction to blockchain that merges all utxos of the given floID.
floID - FLO address of which the utxos should be merged.
privKey - private key of the floID.
floData - FLO data (string, max 1040 characters) (optional, default value is empty string)
Resolves: TransactionID (String)

## Read Tx

### Parameters:

readTxs reads transactions of specified address between from and to.
addr - FLO address for which the transactions has to be read.
from - Reading transactions starts from 'from'.
to - Reading transactions ends on 'to'.
Resolves: TransactionData (Object)

## Read all Tx's

### Parameters:

readAllTxs reads all transactions of specified address(newest first).
addr - FLO address for which the transactions has to be read.
Resolves: TransactionData (Object)

## Get Balance

### Parameters:

getBalance requests balance for specified FLO address.
addr - FLO address for which balance has to be retrieved
Resolves: balance (Number)

## Read Data

### Parameters:

readData reads FLO data from transactions of specified address
addr - FLO address for which the transactions data has to be read.
options - Contains options for filter data from transactions.
limit : maximum number of filtered data (default = no limit)
ignoreOld : ignore old transactions (default = 0)
sentOnly : filters only sent data
pattern : filters data that contains pattern as an object key in the JSON string
filter : custom filter funtion for floData (eg . filter: d => {return d[0] == '$'})
Resolves: Object {totalTxs, floData (Array)}

## Write Data

### Parameters:

writeData writes data into blockchain, resolves transaction id if the transacation was succsessful.
senderAddr - FLO address from which the data and amount has to be sent.
Data - FLO data (string, max 1040 characters)
receiverAddr - FLO address to which has to be sent. (Default is specified in floGlobals.adminID)
PrivKey - Private key of sender
Resolves: TransactionID (String)

## Write Data Multiple

### Parameters:

writeDataMultiple writes data into blockchain from multiple floIDs to multiple floIDs, resolves transaction id if the transacation was succsessful.
senderPrivKeys - Array of Private keys of the senders.
Data - FLO data (string, max 1040 characters)
receivers - Array of receiver FLO Addresses. (Default is specified in floGlobals.adminID)
preserveRatio - boolean (true: preserves the ratio of the balance of senders, false: all senders contribute equal amount to the transaction) (optional, default is true)
Resolves: TransactionID (String)

### Verify Private key

#### Parameters:

- verifyPrivKey verify the private-key for the given public-key or flo-ID
- privateKey - private key in WIF format (Hex)
- pubKey_floID - public Key or flo ID
- isfloID - boolean value (true: compare as flo ID, false: compare as public key) (optional, default is true)
- Returns : boolen (true or false)

### Generate new FLO ID:

#### Parameters:

- generateNewID generates a new flo ID and returns private-key, public-key and floID
- Returns : Object { privKey , pubKey, floID }

### Calculate FLO ID

#### Parameters:

- getFloID returns flo-ID from given public-key (or) private-key
- publickey_or_privateKey - public key or private key hex value
- Returns : floID (string)

### Calculate Public Key HEX

#### Parameters:

- getPubKeyHex returns public-key from given private-key
- privateKey - private key in WIF format (Hex)
- Returns : pubKey (string)

### Generate Random Integer

#### Parameters:

- randInt returns a randomly generated integer in a given range.
- min - minimum value of the range
- max - maximum value of the range
- Returns : randomNum (Integer)

### Generate Random String

#### Parameters:

- randString returns a randomly generated string of given length.
- length - length of the string to be generated
- alphaNumeric - boolean (true: generated string will only contain alphabets and digits,
  false: generated string will also have symbols) (optional, default value is false)
- Returns : randomString (String)

#### Options:

Set "TRUE" if you wish to generate a alphanumeric string, Set "FALSE" if you wish to generate a string without numbers.

### Sign Data

#### Parameters:

- signData signs the data using the private key
- data - data to sign
- privateKey - private key of the signer

### Verify Private Key

#### Parameters:

- verifyPrivKey verify the private-key for the given public-key or flo-ID
- privateKey - private key in WIF format (Hex)
- pubKey_floID - public Key or flo ID
- isfloID - boolean value (true: compare as flo ID, false: compare as public key) (optional, default is true)
- Returns : boolen (true or false)

### Validate FLO Id

#### Parameters:

- validateAddr check if the given Address is valid or not
- floID - flo ID to validate
- Returns : boolen (true or false)

### Verify Signature

#### Parameters:

- verifySign verifies signatue of the data using public-key
- data - data of the given signature
- signature - signature of the data
- publicKey - public key of the signer
- Returns : boolen (true or false)

### Create Shamir's Secret shares

#### Parameters:

- str - string to be split
- total_shares - total number of shares to be split into
- threshold_limit - minimum number of shares required to reconstruct the secret str
- Returns : Shares (Array of string)

### Retrieve Shamir's Secret

#### Parameters:

- retrieveShamirSecret reconstructs the secret from the shares.
- sharesArray - Array of shares
- Returns : retrivedData (String)

### Verify Shamir's Secret

#### Parameters:

- verifyShamirsSecret verfies the validity of the created shares.
- sharesArray - Array of shares
- str - originalData (string).
- Returns : boolen (true or false)

### Data Encryption

#### Parameters:

- encryptData encrypts the given data using public-key
- data - data to encrypt (String)
- publicKey - public key of the recipient
- Returns : Encrypted data (Object)

### Decrypt Data

#### Parameters:

- decryptData decrypts the given data using private-key
- data - encrypted data to decrypt (Object that was returned from encryptData)
- privateKey - private key of the recipient
- Returns : Decrypted Data (String)

### sendGeneralData

- Parameters

- message - data to be sent
- type - type of the data
- options -this parameter is optional
- Options

- receiverID - receiver of the data
- application - name of the application sending the general data
- comment - user comment for the data

Never use senderIDs in SEND GENERAL DATA options. The system automatically picks the FLO ID of the sender from FLO Globals. Its a common mistake developers make.

Type is mandatory in SEND GENERAL DATA because without at least one data identifier like TYPE, the message cannot be retrieved back.

Application field is used by the Cloud to judge whether this message should be deleted after 7 days, or stored permanently. Developers should be careful not to change value of application field if the default value enables the message to be stored permanently. Currently messages sent from subadmins to any receiverID for applications notified by the cloud in the FLO Blockchain are stored permanently. So do not change application field as a caution. Use the comment field.

### requestGeneralData

The results are available in floGlobals.generalData after the request promise has been resolved

floDapps.getNextGeneralData should be used to retrieve the output in the client browser where the retrieval from floGlobals.generalData has been simplified.

Type is mandatory in REQUEST GENERAL DATA. So every TYPE of general data must be requested individually and separately. If you want to use requests to give results from all types at one go, use Application Data.

Application field is used by the Cloud to judge whether this message should be deleted after 7 days, or stored permanently. Developers should be careful not to change value of application field if the default value enables the message to be stored permanently. Currently messages sent from subadmins to any receiverID for applications notified by the cloud in the FLO Blockchain are stored permanently. So do not change application field as a caution. Use the comment field.

### resetObjectData

- Parameters
- "objectName" - Name of the objectData to be updated. Quotes are must.
- options -this parameter is optional
- Options

1. receiverID - receiver of the data
2. application - name of the application sending the general data
3. comment - user comment for the data

Note: The object data corresponding with Object Name must be defined in floGlobals.appObjects[objectName] before a reset or update can be done.

Note: Never use senderIDs in RESET and UPDATE. The system automatically picks the FLO ID of the sender from FLO Globals. Its a common mistake developers make.

Note: Type field is never used in RESET, UPDATE or REQUEST operations in Object Data. Type field is internally blocked for Object Data.

### Request Object Data

- Parameters
- "objectName" - Name of the objectData to be requested. Quotes are must.
- options -this parameter is optional
- Options
- receiverID - receiver of the data
- senderIDs - array of senderIDs. This must be in an array even if a single senderID is requested
- application - name of the application sending the general data
- comment - user comment for the data
- lowerVectorClock - VC from which the data is to be requested
- upperVectorClock - VC till which the data is to be requested
- atVectorClock - VC at which the data is to requested
- mostRecent - boolean (true: request only the recent data matching the pattern. Just the last one.)

The output is available in floGlobals.appObjects[objectName] after request Object Data promise is resolved.

Type field is never used while RESET, UPDATE or REQUEST operations in Object Data. Type field is internally blocked for Object Data.

Application field is used by the Cloud to judge whether this message should be deleted after 7 days, or stored permanently. Developers should be careful not to change value of application field if the default value enables the message to be stored permanently. Currently messages sent from subadmins to any receiverID for applications notified by the cloud in the FLO Blockchain are stored permanently. So do not change application field as a caution. Use the comment field.

### sendApplicationData

- Parameters:
- message - data to be sent
- type - type of the data
- options -this parameter is optional
- Options:
- receiverID - receiver of the data
- application - name of the application sending the general data
- comment - user comment for the data

Results will be available in promise.resolve(requestApplicationData(..)), and user will have to handle the response himself.

TYPE is mandatory while SEND APPLICATION DATA but not in REQUEST APPLICATION DATA. This enables a single Application Data request to fetch across all TYPES

We recommend developers to use either objectData or GeneralData as we provide inbuilt data synchronization with cloud in them. If developer wants to receive response across all TYPES, or he is interested in doing request response management of the promise himself, he should use Application Data.

Application Data results are not stored in local IndexedDB by Standard Operations Framework. If a blank REQUEST APPLICATION DATA is made, then cloud will give all application data at the admin ID of the application.

Application field is used by the Cloud to judge whether this message should be deleted after 7 days, or stored permanently. Developers should be careful not to change value of application field if the default value enables the message to be stored permanently. Currently messages sent from subadmins to any receiverID for applications notified by the cloud in the FLO Blockchain are stored permanently. So do not change application field as a caution. Use the comment field.

### Request Application Data

- Parameters:
- options -this parameter is optional
- Options:
- receiverID - receiver FLO ID of the data. ReceiverID is always a single value in our cloud design.
- Type: User defined type (retrieves all data of that type which the sender might have used in SEND DATA phase)
- senderIDs - array of senderIDs. This must be in an array even if a single senderID is requested
- application - name of the application that sent the general data
- comment - user comment for the data
- lowerVectorClock - VC from which the data is to be requested
- upperVectorClock - VC till which the data is to be requested
- atVectorClock - VC at which the data is to requested
- mostRecent - boolean (true: request only the recent data matching the pattern. Just the last one)

Important: Never use senderIDs in SEND DATA options. The system automatically picks the FLO ID of the sender from FLO Globals. Its a common mistake developers make.

Type is mandatory in SEND APPLICATION DATA because without at least one data identifier like TYPE, the message cannot be retrieved back

Application field is used by the Cloud to judge whether this message should be deleted after 7 days, or stored permanently. Developers should be careful not to change value of application field if the default value enables the message to be stored permanently. Currently messages sent from subadmins to any receiverID for applications notified by the cloud in the FLO Blockchain are stored permanently. So do not change application field as a caution. Use the comment field.

##### RanchiMall

#### FLO Operations

Blockchain API Operations Crypto Operations Cloud Operations

### FLO Blockchain API Operations

In this page we have, Transactions, Read and Write sections.

Transactions Read Write

### SendTx

It is used to send a transaction to blockchain, resolves transaction id if the transacation was succsessful.

### SendTx multiple

It is used to send a transaction to blockchain from multiple floIDs to multiple FLO Id's.

### Merge UTXOs

It is used to send a transaction to blockchain that merges all utxos of the given FLO Id.

### ReadTx

It is used to read transactions of specified address between from and to.

### ReadallTx

It is used to read all transactions of specified address(newest first).

### Send Tx

It is used to send a transaction to blockchain, resolves transaction id if the transacation was succsessful.

Syntax: floBlockchainAPI.sendTx(senderAddr, receiverAddr, sendAmt, PrivKey, floData = '')
Read more about SendTx>>>

SEND

### Send Tx Multiple

It is used to send a transaction to blockchain from multiple floIDs to multiple FLO Id's.

Syntax: floBlockchainAPI.sendTxMultiple(senderPrivKeys, receivers, floData = '')
Read more about SendTx Multiple>>>

ADD CLEAR ADD CLEAR
SEND

### MergeUTXO's

It is used to send a transaction to blockchain that merges all utxos of the given FLO Id.

Syntax: floBlockchainAPI.mergeUTXOs(floID, privKey, floData = '')
Read more about Merge UTXO's>>>

MERGE

### Read Tx

It is used to read transactions of specified address between from and to.

Syntax: floBlockchainAPI.readTxs(addr, from, to)
Read more about ReadTx>>>

READ

### Read all Tx's

It is used to read all transactions of specified address(newest first).

Syntax: floBlockchainAPI.readTxs(addr)
Read more about ReadallTx's>>>

READ

### Get Balance

It is used to fetch the Balance of an FLO Id.

### Read Data

It is used to read FLO data from transactions of specified address.

### Get Balance

It is used to fetch the Balance of an FLO Id.

Syntax: floBlockchainAPI.getBalance(addr)
Read more about Get Balance>>>

REQUEST

### Read Data

It is used to read FLO data from transactions of specified address.

Syntax: floBlockchainAPI.readData(addr, options = {})
Read more about Read Data>>>

--------OPTIONS--------

READ

### Write Data

It is used to write data into blockchain, resolves transaction id if the transacation was succsessful.

### Write Data Multiple

It is used to writes data into blockchain from multiple FLO ID's to multiple FLO ID's, resolves transaction id if the transacation was succsessful.

### Write Data

It is used to write data into blockchain, resolves transaction id if the transacation was succsessful.

Syntax: floBlockchainAPI.writeData(senderAddr, Data, PrivKey, receiverAddr = floGlobals.adminID)
Read more about Write Data>>>

WRITE

### Write Data Multiple

It is used to writes data into blockchain from multiple FLO ID's to multiple FLO ID's, resolves transaction id if the transacation was succsessful.

Syntax: floBlockchainAPI.writeDataMultiple(senderPrivKeys, data, receivers = [floGlobals.adminID], preserveRatio = true)
Read more about Write Data Multiple>>>

PUSH CLEAR PUSH CLEAR
WRITE

### FLO Crypto Operations

In this page we have, Generate, Verify, Shamir's Secret Shares and Encrypt & Decrypt sections.

Generate Verify Shamir's Secret Encrypt&Decrypt

### Generate FLO ID

To generate a new set of FLO ID,private key, Public key.

### Calculate FLO ID

To calculate FLO ID using Private or Public key.

### Calculate Public key

To Calculate Public key using private key.

### Random Integer

To Generate a Random Integer by providing minimum and maximum values.

### Random String

To Generate Random String by its length.

### Sign Data

To sign data using Private key.

### Generate new FLO ID:

To generate new set of FLO ID, click the GENERATE button.

Syntax: floCrypto.generateNewID()
Read more about Generate new FLO ID>>>

GENERATE

### Calculate FLO ID

To get FLO ID using your Private key or Public key,click on CALCULATE button.

Syntax: floCrypto.getFloID(publickey_or_privateKey)
Read more about Calculate FLO ID>>>

CALCULATE

### Calculate Public Key HEX

To get the Public key using your Private key, click the CALCULATE button.

Syntax: floCrypto.getPubKeyHex(privateKey)
Read more about Calculate Public Key Hex>>>

CALCULATE

### Generate Random Integer

To Generate Random integer click on, GENERATE button.

Syntax: floCrypto.randInt(min, max)
Read more about Generate Random Integer>>>

GENERATE

### Generate Random String

To Generate Random string click on, GENERATE button.

Syntax: floCrypto.randString(length, alphaNumeric)
Read more about Generate Random String>>>

GENERATE

### Sign Data

To Sign the data, click on SIGN button.

Syntax: floCrypto.signData(data, privateKey)
Read more about Sign Data>>>

SIGN

### Verify Private Key

To Verify Private key using Public key or FLO Id.

### Validate FLO ID

To Validate FLO ID is correct or not.

### Verify Signature

To Verify Signature using the Public key.

### Verify Private key

To verify the Private key using Public or FLO ID, click on VERIFY button.

Syntax: floCrypto.verifyPrivKey(privateKey, pubKey_floID, *isfloID)
Read more about Verify Private Key>>>

VERIFY

### Validate FLO Id

To Validate FLO ID click on, VALIDATE button.

Syntax: floCrypto.validateAddr(floID)
Read more about Validate FLO ID>>>

VALIDATE

### Verify Signature

To Verify Signature ,click on VERIFY button.

Syntax: floCrypto.verifySign(data, signature, publicKey)
Read more about Verify Signature>>>

VERIFY

### Create Shamir's Secret Shares

To Create Shamir's Secret Shares By providing the number of shares and threshold limit.

### Retrieve Shamir's Secret

To retrieve Shamir's secret by providing Shares created.

### Verify shamir's Secret

To Verify Shamirs Secret shares by providing the shares and the original strig.

### Create Shamir's Secret shares

To Create Shamir's Secret click on, CREATE button.

Syntax: floCrypto.createShamirsSecretShares(str, total_shares, threshold_limit)
Read more about Create Shamir's Secret>>>

CREATE

### Retrieve Shamir's Secret

To Retrieve Shamir's Secret shares click on, RETRIEVE button.

Syntax: floCrypto.retrieveShamirSecret(sharesArray)
Read more about Retrieve Shamir's Secret>>>

PUSH
RETRIEVE RESET

### Verify Shamir's Secret

To Verify Shamir's Secret shares click on, VERIFY button.

Syntax: floCrypto.verifyShamirsSecret(sharesArray, str)
Read more about Verify Shamir's Secret>>>

PUSH
VERIFY RESET

### Encrypt Data

To Encrypt the data using Public key.

### Decrypt Data

To Decrypt the data using Private key.

### Data Encryption

To Encrypt the data, click on ENCRYPT button.

Syntax: floCrypto.encryptData(data, publicKey)
Read more about Data Encryption>>>

ENCRYPT

### Decrypt Data

To Decrypt data click on, DECRYPT button.

Syntax: floCrypto.decryptData(data, privateKey)
Read more about Decrypt Data>>>

DECRYPT

### FLO Cloud Operations

In this page we have, Application Data, General Data and Object Data sections.

Application Data General Data Object Data

### Send Application Data

To Send Application Data sends
data to the cloud.

### Request Application Data

Request Application Data requests the
application data from the cloud.

### Send Application Data

Send Application Data sends application data to the cloud.
Read more about Send Application Data>>>

Syntax:floCloudAPI.sendApplicationData(message, type, options = {})

------SET OPTIONS------

SEND

### Request Application Data

Request Application Data requests application data from the cloud.
Read more about Request Application Data>>>

Syntax:floCloudAPI.requestApplicationData(options = {})

------SET OPTIONS------

REQUEST

### Send General Data

Send General Data sends
general data to the cloud.

### Request General Data

Request General Data requests
application data from the cloud.

### Send General Data

Send General Data sends general data to the cloud.
Read more about sendGeneralData>>>

Syntax : floCloudAPI.sendGeneralData(message, type, options = {})

------SET OPTIONS------

SEND

### Request General Data

Request General Data requests application data from the cloud.
Read more about Request General Data>>>

Syntax : floCloudAPI.requestGeneralData(type, options = {})

------SET OPTIONS------

REQUEST

### Reset Object Data

resetObjectData resets the objectData to cloud

### Update Object Data

updateObjectData updates the objectData to cloud.

### Request Object Data

requestObjectData requests application data from the cloud.

### Reset Object Data

Reset Object Data resets the objectData to cloud.
Read more about resetObjectData>>>

Syntax : floCloudAPI.resetObjectData("objectName", options = {})

#### Key-Value Pairs

+

------SET OPTIONS------

RESET

### Update Object Data

Update Object Data updates the objectData to cloud.
Read more about updateObjectData>>>

Syntax : floCloudAPI.updateObjectData("objectName", options = {})

#### Key-Value Pairs

+

------SET OPTIONS------

Update

### Request Object Data

Request Object Data requests application data from the cloud. Read more about requestObjectData>>>

Syntax : floCloudAPI.requestObjectData("objectName", options = {})

------SET OPTIONS------

REQUEST