> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lucid.foundation/llms.txt
> Use this file to discover all available pages before exploring further.

# Modules SDK

> ERC-7579 module management — install, uninstall, and configure policy/payout modules

# Modules SDK

ERC-7579 module management — install, uninstall, and configure policy/payout modules

## Operations

| Method                       | Description                         |
| ---------------------------- | ----------------------------------- |
| `lucidInstallModule`         | Install module on smart account     |
| `lucidUninstallModule`       | Uninstall module from smart account |
| `lucidConfigurePolicyModule` | Configure policy module             |
| `lucidConfigurePayoutModule` | Configure payout module             |
| `lucidListModules`           | List installed modules              |

## Generated Reference

### Overview

ERC-7579 module management — install, uninstall, and configure policy/payout modules

#### Available Operations

* [lucidInstallModule](#lucidinstallmodule) - Install module on smart account
* [lucidUninstallModule](#luciduninstallmodule) - Uninstall module from smart account
* [lucidConfigurePolicyModule](#lucidconfigurepolicymodule) - Configure policy module
* [lucidConfigurePayoutModule](#lucidconfigurepayoutmodule) - Configure payout module
* [lucidListModules](#lucidlistmodules) - List installed modules

### lucidInstallModule

Install an ERC-7579 module (policy, payout, or receipt) on a smart account. The module type and initialization data must be provided in the request body.

#### Example Usage

```typescript theme={null}
import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";

const raijinLabsLucidAi = new RaijinLabsLucidAi();

async function run() {
  const result = await raijinLabsLucidAi.modules.lucidInstallModule({
    chainId: "<id>",
    account: "81158790",
    moduleType: "<value>",
    moduleAddress: "<value>",
  });

  console.log(result);
}

run();
```

#### Standalone function

The standalone function version of this method:

```typescript theme={null}
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { modulesLucidInstallModule } from "raijin-labs-lucid-ai/funcs/modulesLucidInstallModule.js";

// Use `RaijinLabsLucidAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raijinLabsLucidAi = new RaijinLabsLucidAiCore();

async function run() {
  const res = await modulesLucidInstallModule(raijinLabsLucidAi, {
    chainId: "<id>",
    account: "81158790",
    moduleType: "<value>",
    moduleAddress: "<value>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("modulesLucidInstallModule failed:", res.error);
  }
}

run();
```

#### Parameters

| Parameter              | Type                                                                                                                              | Required             | Description                                                                                                                                                                    |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request`              | [models.InstallModuleRequest](https://github.com/lucid-fdn/lucid-ai-sdk/blob/main/typescript/docs/models/installmodulerequest.md) | :heavy\_check\_mark: | The request object to use for the request.                                                                                                                                     |
| `options`              | RequestOptions                                                                                                                    | :heavy\_minus\_sign: | Used to set various options for making HTTP requests.                                                                                                                          |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options)                                           | :heavy\_minus\_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries`      | [RetryConfig](https://github.com/lucid-fdn/lucid-ai-sdk/blob/main/typescript/docs/lib/utils/retryconfig.md)                       | :heavy\_minus\_sign: | Enables retrying HTTP requests under certain failure conditions.                                                                                                               |

#### Response

**Promise\<[models.SuccessResponse](https://github.com/lucid-fdn/lucid-ai-sdk/blob/main/typescript/docs/models/successresponse.md)>**

#### Errors

| Error Type                           | Status Code | Content Type     |
| ------------------------------------ | ----------- | ---------------- |
| errors.ErrorResponse                 | 400         | application/json |
| errors.ErrorResponse                 | 500         | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX    | \*/\*            |

### lucidUninstallModule

Uninstall an ERC-7579 module from a smart account. Requires the module address and type to identify which module to remove.

#### Example Usage

```typescript theme={null}
import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";

const raijinLabsLucidAi = new RaijinLabsLucidAi();

async function run() {
  const result = await raijinLabsLucidAi.modules.lucidUninstallModule({
    chainId: "<id>",
    account: "31674046",
    moduleType: "<value>",
    moduleAddress: "<value>",
  });

  console.log(result);
}

run();
```

#### Standalone function

The standalone function version of this method:

```typescript theme={null}
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { modulesLucidUninstallModule } from "raijin-labs-lucid-ai/funcs/modulesLucidUninstallModule.js";

// Use `RaijinLabsLucidAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raijinLabsLucidAi = new RaijinLabsLucidAiCore();

async function run() {
  const res = await modulesLucidUninstallModule(raijinLabsLucidAi, {
    chainId: "<id>",
    account: "31674046",
    moduleType: "<value>",
    moduleAddress: "<value>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("modulesLucidUninstallModule failed:", res.error);
  }
}

run();
```

#### Parameters

| Parameter              | Type                                                                                                                                  | Required             | Description                                                                                                                                                                    |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request`              | [models.UninstallModuleRequest](https://github.com/lucid-fdn/lucid-ai-sdk/blob/main/typescript/docs/models/uninstallmodulerequest.md) | :heavy\_check\_mark: | The request object to use for the request.                                                                                                                                     |
| `options`              | RequestOptions                                                                                                                        | :heavy\_minus\_sign: | Used to set various options for making HTTP requests.                                                                                                                          |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options)                                               | :heavy\_minus\_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries`      | [RetryConfig](https://github.com/lucid-fdn/lucid-ai-sdk/blob/main/typescript/docs/lib/utils/retryconfig.md)                           | :heavy\_minus\_sign: | Enables retrying HTTP requests under certain failure conditions.                                                                                                               |

#### Response

**Promise\<[models.SuccessResponse](https://github.com/lucid-fdn/lucid-ai-sdk/blob/main/typescript/docs/models/successresponse.md)>**

#### Errors

| Error Type                           | Status Code | Content Type     |
| ------------------------------------ | ----------- | ---------------- |
| errors.ErrorResponse                 | 400         | application/json |
| errors.ErrorResponse                 | 500         | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX    | \*/\*            |

### lucidConfigurePolicyModule

Configure allowed policy hashes on the LucidPolicyModule. Only transactions matching an allowed policy hash will be permitted by the module.

#### Example Usage

```typescript theme={null}
import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";

const raijinLabsLucidAi = new RaijinLabsLucidAi();

async function run() {
  const result = await raijinLabsLucidAi.modules.lucidConfigurePolicyModule({
    chainId: "<id>",
    account: "04622028",
    policyHashes: [],
  });

  console.log(result);
}

run();
```

#### Standalone function

The standalone function version of this method:

```typescript theme={null}
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { modulesLucidConfigurePolicyModule } from "raijin-labs-lucid-ai/funcs/modulesLucidConfigurePolicyModule.js";

// Use `RaijinLabsLucidAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raijinLabsLucidAi = new RaijinLabsLucidAiCore();

async function run() {
  const res = await modulesLucidConfigurePolicyModule(raijinLabsLucidAi, {
    chainId: "<id>",
    account: "04622028",
    policyHashes: [],
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("modulesLucidConfigurePolicyModule failed:", res.error);
  }
}

run();
```

#### Parameters

| Parameter              | Type                                                                                                                                  | Required             | Description                                                                                                                                                                    |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request`              | [models.ConfigurePolicyRequest](https://github.com/lucid-fdn/lucid-ai-sdk/blob/main/typescript/docs/models/configurepolicyrequest.md) | :heavy\_check\_mark: | The request object to use for the request.                                                                                                                                     |
| `options`              | RequestOptions                                                                                                                        | :heavy\_minus\_sign: | Used to set various options for making HTTP requests.                                                                                                                          |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options)                                               | :heavy\_minus\_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries`      | [RetryConfig](https://github.com/lucid-fdn/lucid-ai-sdk/blob/main/typescript/docs/lib/utils/retryconfig.md)                           | :heavy\_minus\_sign: | Enables retrying HTTP requests under certain failure conditions.                                                                                                               |

#### Response

**Promise\<[models.SuccessResponse](https://github.com/lucid-fdn/lucid-ai-sdk/blob/main/typescript/docs/models/successresponse.md)>**

#### Errors

| Error Type                           | Status Code | Content Type     |
| ------------------------------------ | ----------- | ---------------- |
| errors.ErrorResponse                 | 400         | application/json |
| errors.ErrorResponse                 | 500         | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX    | \*/\*            |

### lucidConfigurePayoutModule

Configure the revenue split percentages on the LucidPayoutModule. Sets the basis-point allocations for compute, model, and protocol recipients.

#### Example Usage

```typescript theme={null}
import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";

const raijinLabsLucidAi = new RaijinLabsLucidAi();

async function run() {
  const result = await raijinLabsLucidAi.modules.lucidConfigurePayoutModule({
    chainId: "<id>",
    account: "86222423",
    recipients: [
      "<value 1>",
      "<value 2>",
    ],
    basisPoints: [
      122328,
    ],
  });

  console.log(result);
}

run();
```

#### Standalone function

The standalone function version of this method:

```typescript theme={null}
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { modulesLucidConfigurePayoutModule } from "raijin-labs-lucid-ai/funcs/modulesLucidConfigurePayoutModule.js";

// Use `RaijinLabsLucidAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raijinLabsLucidAi = new RaijinLabsLucidAiCore();

async function run() {
  const res = await modulesLucidConfigurePayoutModule(raijinLabsLucidAi, {
    chainId: "<id>",
    account: "86222423",
    recipients: [
      "<value 1>",
      "<value 2>",
    ],
    basisPoints: [
      122328,
    ],
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("modulesLucidConfigurePayoutModule failed:", res.error);
  }
}

run();
```

#### Parameters

| Parameter              | Type                                                                                                                                  | Required             | Description                                                                                                                                                                    |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request`              | [models.ConfigurePayoutRequest](https://github.com/lucid-fdn/lucid-ai-sdk/blob/main/typescript/docs/models/configurepayoutrequest.md) | :heavy\_check\_mark: | The request object to use for the request.                                                                                                                                     |
| `options`              | RequestOptions                                                                                                                        | :heavy\_minus\_sign: | Used to set various options for making HTTP requests.                                                                                                                          |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options)                                               | :heavy\_minus\_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries`      | [RetryConfig](https://github.com/lucid-fdn/lucid-ai-sdk/blob/main/typescript/docs/lib/utils/retryconfig.md)                           | :heavy\_minus\_sign: | Enables retrying HTTP requests under certain failure conditions.                                                                                                               |

#### Response

**Promise\<[models.SuccessResponse](https://github.com/lucid-fdn/lucid-ai-sdk/blob/main/typescript/docs/models/successresponse.md)>**

#### Errors

| Error Type                           | Status Code | Content Type     |
| ------------------------------------ | ----------- | ---------------- |
| errors.ErrorResponse                 | 400         | application/json |
| errors.ErrorResponse                 | 500         | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX    | \*/\*            |

### lucidListModules

List all ERC-7579 modules installed on a smart account, including module type, address, and configuration status for each.

#### Example Usage

```typescript theme={null}
import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";

const raijinLabsLucidAi = new RaijinLabsLucidAi();

async function run() {
  const result = await raijinLabsLucidAi.modules.lucidListModules({
    chainId: "<id>",
    account: "00461751",
  });

  console.log(result);
}

run();
```

#### Standalone function

The standalone function version of this method:

```typescript theme={null}
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { modulesLucidListModules } from "raijin-labs-lucid-ai/funcs/modulesLucidListModules.js";

// Use `RaijinLabsLucidAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raijinLabsLucidAi = new RaijinLabsLucidAiCore();

async function run() {
  const res = await modulesLucidListModules(raijinLabsLucidAi, {
    chainId: "<id>",
    account: "00461751",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("modulesLucidListModules failed:", res.error);
  }
}

run();
```

#### Parameters

| Parameter              | Type                                                                                                                                                   | Required             | Description                                                                                                                                                                    |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request`              | [operations.LucidListModulesRequest](https://github.com/lucid-fdn/lucid-ai-sdk/blob/main/typescript/docs/models/operations/lucidlistmodulesrequest.md) | :heavy\_check\_mark: | The request object to use for the request.                                                                                                                                     |
| `options`              | RequestOptions                                                                                                                                         | :heavy\_minus\_sign: | Used to set various options for making HTTP requests.                                                                                                                          |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options)                                                                | :heavy\_minus\_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries`      | [RetryConfig](https://github.com/lucid-fdn/lucid-ai-sdk/blob/main/typescript/docs/lib/utils/retryconfig.md)                                            | :heavy\_minus\_sign: | Enables retrying HTTP requests under certain failure conditions.                                                                                                               |

#### Response

**Promise\<[models.ListModulesResponse](https://github.com/lucid-fdn/lucid-ai-sdk/blob/main/typescript/docs/models/listmodulesresponse.md)>**

#### Errors

| Error Type                           | Status Code | Content Type     |
| ------------------------------------ | ----------- | ---------------- |
| errors.ErrorResponse                 | 400         | application/json |
| errors.ErrorResponse                 | 500         | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX    | \*/\*            |
