MindLake
Last updated
Last updated
Connect to Mind Lake while ensuring that all encryption keys are prepared and available. Prior to making any function calls within the SDK, execute this function as it serves as the entry point.
appKey
- string
: used for authorization, allowing users of your application to gain access to Mind Lake. As a developer, you can apply for APP Keys from Mind Scan.
chainId
- string|number
: the ID of the supported chain.
An object of Promise<
>
. For more information.
Wallet Interaction
During the 'Connect' procedure, the wallet will prompt the user 2-3 times as follows:
Sign a nonce for login authentication.
If the user's account keys are already on the chain:
Decrypt the user's account keys using the wallet's private key.
If the user's account keys do not exist yet:
Obtain the public key of the wallet, which is used to encrypt the randomly generated account keys.
Sign the transaction to upload the encrypted key ciphers to the smart contract on the chain.
Every method call in the Mind Lake SDK returns an object of ResultType.
code
- number
: The return code of the method call. A return value of 0 indicates success, while non-zero values represent a specific error code.
message
- string
: If the return code is non-zero, an error message will be provided to describe the specific error encountered during the method call.
result
- any
: If a method call returns a result, it will be stored in the result
field.
The DataType
enum defines a comprehensive range of supported data types. This enum can be used in conjunction with the MindLake.DataLake.Column
class, which represents a single column in a table, to specify the data type of the column. By utilizing the DataType
enum, you can ensure that your data is stored in the appropriate format and can be processed correctly by the system.
int4
int8
float4
float8
decimal
text
timestamp