> For the complete documentation index, see [llms.txt](https://docs.mindnetwork.xyz/mind-lake-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mindnetwork.xyz/mind-lake-sdk/python-api-reference/mindlake.md).

# 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.

```python
mindlakesdk.connect(walletPrivateKey: str, appKey: str, chainID: str, gateWay: str = None) -> MindLake
MindLake(walletPrivateKey: str, appKey: str, chainID: str, gateWay: str = None) -> MindLake
```

### Parameters

1. `walletPrivateKey` - `str`: the private key of your wallet
2. `chainID` - `str`: the ID of the supported chain.
3. `appKey` - `str`: 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.

### Returns

An object of [`ResultType`](#user-content-fn-1)[^1]. [For more information](#2.-resulttype-type).

### Example

<pre class="language-python"><code class="lang-python"><strong># '5' is example of Goerli Testnet chainID
</strong><strong>chainID = '5'
</strong><strong>mind = mindlakesdk.connect("YOUR_OWN_WALLET_PRIVATEKEY", "YOUR_OWN_APP_KEY", chainID)
</strong>assert mind, mind.message
</code></pre>

## 2. MindLake.ResultType

Every method call in the Mind Lake SDK returns an object of ResultType.

```python
class ResultType:
    def __init__(self, code: int, message: str = None, data = None):
        self.code = code
        self.message = message
        self.data = data

    def __bool__(self):
        return self.code == 0
```

* `code` - `int`: The return code of the method call. A return value of 0 indicates success, while non-zero values represent a specific error code.
* `message` - `str`: If the return code is non-zero, an error message will be provided to describe the specific error encountered during the method call.
* `data` - `any`: If a method call returns a result, it will be stored in the `data` 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

1. int4
2. int8
3. float4
4. float8
5. decimal
6. text
7. timestamp

[^1]: ```python
    class ResultType:
        def __init__(self, code: int, message: str = None, data = None):
            self.code = code
            self.message = message
            self.data = data
                
        def __bool__(self):
            return self.code == 0
    ```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mindnetwork.xyz/mind-lake-sdk/python-api-reference/mindlake.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
