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

# Shares SDK

> Share token launch and revenue airdrop for fractional AI asset ownership

# Shares SDK

Share token launch and revenue airdrop for fractional AI asset ownership

## Operations

| Method                       | Description                                     |
| ---------------------------- | ----------------------------------------------- |
| `lucidLaunchShareToken`      | Launch a share token for a passport             |
| `lucidGetShareToken`         | Get share token info for a passport             |
| `lucidTriggerRevenueAirdrop` | Trigger revenue airdrop for share token holders |

## Generated Reference

### Overview

Share token launch and revenue airdrop for fractional AI asset ownership

#### Available Operations

* [lucidLaunchShareToken](#lucidlaunchsharetoken) - Launch a share token for a passport
* [lucidGetShareToken](#lucidgetsharetoken) - Get share token info for a passport
* [lucidTriggerRevenueAirdrop](#lucidtriggerrevenueairdrop) - Trigger revenue airdrop for share token holders

### lucidLaunchShareToken

Create and launch an SPL Token-2022 share token for fractional ownership of an AI asset. Configurable name, symbol, initial supply, and decimals. Requires the passport to exist and not already have a share token.

#### Example Usage

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

const raijinLabsLucidAi = new RaijinLabsLucidAi();

async function run() {
  const result = await raijinLabsLucidAi.shares.lucidLaunchShareToken({
    passportId: "<id>",
    body: {
      name: "Mistral 7B Share",
      symbol: "M7BS",
      totalSupply: 39757,
      decimals: 9,
    },
  });

  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 { sharesLucidLaunchShareToken } from "raijin-labs-lucid-ai/funcs/sharesLucidLaunchShareToken.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 sharesLucidLaunchShareToken(raijinLabsLucidAi, {
    passportId: "<id>",
    body: {
      name: "Mistral 7B Share",
      symbol: "M7BS",
      totalSupply: 63424,
      decimals: 9,
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("sharesLucidLaunchShareToken failed:", res.error);
  }
}

run();
```

#### Parameters

| Parameter              | Type                                                                                                                                                             | Required             | Description                                                                                                                                                                    |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request`              | [operations.LucidLaunchShareTokenRequest](https://github.com/lucid-fdn/lucid-ai-sdk/blob/main/typescript/docs/models/operations/lucidlaunchsharetokenrequest.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.TokenLaunchResponse](https://github.com/lucid-fdn/lucid-ai-sdk/blob/main/typescript/docs/models/tokenlaunchresponse.md)>**

#### Errors

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

### lucidGetShareToken

Retrieve share token information for a passport including the SPL mint address, total supply, decimals, and current holder count. Returns 404 if no share token has been launched.

#### Example Usage

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

const raijinLabsLucidAi = new RaijinLabsLucidAi();

async function run() {
  const result = await raijinLabsLucidAi.shares.lucidGetShareToken({
    passportId: "<id>",
  });

  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 { sharesLucidGetShareToken } from "raijin-labs-lucid-ai/funcs/sharesLucidGetShareToken.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 sharesLucidGetShareToken(raijinLabsLucidAi, {
    passportId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("sharesLucidGetShareToken failed:", res.error);
  }
}

run();
```

#### Parameters

| Parameter              | Type                                                                                                                                                       | Required             | Description                                                                                                                                                                    |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request`              | [operations.LucidGetShareTokenRequest](https://github.com/lucid-fdn/lucid-ai-sdk/blob/main/typescript/docs/models/operations/lucidgetsharetokenrequest.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.TokenInfo](https://github.com/lucid-fdn/lucid-ai-sdk/blob/main/typescript/docs/models/tokeninfo.md)>**

#### Errors

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

### lucidTriggerRevenueAirdrop

Snapshot all current share token holders and distribute accumulated SOL revenue proportionally based on each holder's token balance. Requires the passport to have a launched share token with accumulated revenue.

#### Example Usage

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

const raijinLabsLucidAi = new RaijinLabsLucidAi();

async function run() {
  const result = await raijinLabsLucidAi.shares.lucidTriggerRevenueAirdrop({
    passportId: "<id>",
    body: {
      amountLamports: 453116,
    },
  });

  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 { sharesLucidTriggerRevenueAirdrop } from "raijin-labs-lucid-ai/funcs/sharesLucidTriggerRevenueAirdrop.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 sharesLucidTriggerRevenueAirdrop(raijinLabsLucidAi, {
    passportId: "<id>",
    body: {
      amountLamports: 453116,
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("sharesLucidTriggerRevenueAirdrop failed:", res.error);
  }
}

run();
```

#### Parameters

| Parameter              | Type                                                                                                                                                                       | Required             | Description                                                                                                                                                                    |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request`              | [operations.LucidTriggerRevenueAirdropRequest](https://github.com/lucid-fdn/lucid-ai-sdk/blob/main/typescript/docs/models/operations/lucidtriggerrevenueairdroprequest.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.AirdropResponse](https://github.com/lucid-fdn/lucid-ai-sdk/blob/main/typescript/docs/models/airdropresponse.md)>**

#### Errors

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