MindLake
1. connect() Method
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.
const mindLake = await MindLake.getInstance(appKey);
const res = await mindLake.connect(chainId);
Parameters
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.
Returns
An object of Promise<
>
. For more information.
Example
const mindLake = await MindLake.getInstance("YOUR_OWN_APP_KEY");
//"5" is example of Goerli Testnet chainId
const chainId = "5"
const res = await mindLake.connect(chainId);
2. MindLake.ResultType
Every method call in the Mind Lake SDK returns an object of ResultType.
type ResultType = {
code: number,
message?: string,
result?: any
}
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 theresult
field.
3. MindLake.DataType
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.
Members
int4
int8
float4
float8
decimal
text
timestamp
Last updated