Epochs SDK
Epoch lifecycle — creation, finalization, on-chain anchoring, and retryOperations
| Method | Description |
|---|---|
getCurrent | Get current epoch |
list | List epochs |
create | Create epoch |
get | Get epoch |
retry | Retry failed epoch |
verify | Verify epoch anchor |
getTransaction | Get epoch anchoring transaction |
commitRoot | Commit epoch root |
commitRootsBatch | Commit multiple epoch roots |
getAnchoringHealth | Anchoring service health |
listReady | Get epochs ready for finalization |
getStats | Epoch statistics |
Generated Reference
Overview
Epoch lifecycle — creation, finalization, on-chain anchoring, and retryAvailable Operations
- getCurrent - Get current epoch
- list - List epochs
- create - Create epoch
- get - Get epoch
- retry - Retry failed epoch
- verify - Verify epoch anchor
- getTransaction - Get epoch anchoring transaction
- commitRoot - Commit epoch root
- commitRootsBatch - Commit multiple epoch roots
- getAnchoringHealth - Anchoring service health
- listReady - Get epochs ready for finalization
- getStats - Epoch statistics
getCurrent
Retrieve the current open epoch, optionally filtered by project_id. Returns epoch metadata including MMR root, leaf count, status, and timestamps.Example Usage
Standalone function
The standalone function version of this method:Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.LucidGetCurrentEpochRequest | :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 | :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 | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.LucidGetCurrentEpochResponse>Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
list
Retrieve a paginated list of epochs with optional filtering by project_id and status (open, anchoring, anchored, failed). Defaults to page 1, 20 results per page.Example Usage
Standalone function
The standalone function version of this method:Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.LucidListEpochsRequest | :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 | :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 | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.LucidListEpochsResponse>Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
create
Create a new epoch, optionally scoped to a project_id. The epoch starts in ‘open’ status with an empty MMR root and zero leaf count.Example Usage
Standalone function
The standalone function version of this method:Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.LucidCreateEpochRequest | :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 | :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 | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.LucidCreateEpochResponse>Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
get
Retrieve a single epoch by its epoch_id, including the MMR root, leaf count, status, and on-chain anchoring details.Example Usage
Standalone function
The standalone function version of this method:Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.LucidGetEpochRequest | :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 | :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 | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.LucidGetEpochResponse>Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorResponse | 404 | application/json |
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
retry
Retry the on-chain anchoring for an epoch that previously failed. The epoch must be in ‘failed’ status. Resets the status and re-submits the Solana transaction.Example Usage
Standalone function
The standalone function version of this method:Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.LucidRetryEpochRequest | :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 | :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 | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.LucidRetryEpochResponse>Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorResponse | 400 | application/json |
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
verify
Verify an epoch’s on-chain anchor by comparing the committed MMR root on Solana with the expected off-chain root. Returns the comparison result and transaction signature.Example Usage
Standalone function
The standalone function version of this method:Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.LucidVerifyEpochRequest | :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 | :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 | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.LucidVerifyEpochResponse>Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
getTransaction
Retrieve the Solana transaction details for an epoch’s on-chain anchoring, including the transaction signature, slot number, and block time.Example Usage
Standalone function
The standalone function version of this method:Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.LucidGetEpochTransactionRequest | :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 | :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 | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.LucidGetEpochTransactionResponse>Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorResponse | 404 | application/json |
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
commitRoot
Finalize the current epoch and commit its MMR root to Solana via the thought_epoch program. Optionally force-commit even if the epoch threshold has not been reached.Example Usage
Standalone function
The standalone function version of this method:Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.LucidCommitEpochRootRequest | :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 | :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 | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.LucidCommitEpochRootResponse>Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorResponse | 400 | application/json |
| errors.ErrorResponse | 500, 503 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
commitRootsBatch
Commit multiple epoch roots to Solana in a single batch operation. Returns per-epoch success/failure results with transaction signatures. Uses the batch commit instruction for gas efficiency.Example Usage
Standalone function
The standalone function version of this method:Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.LucidCommitEpochRootsBatchRequest | :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 | :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 | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.LucidCommitEpochRootsBatchResponse>Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorResponse | 400 | application/json |
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
getAnchoringHealth
Check the health of the on-chain anchoring service, including Solana connection status, network type, authority address, and whether mock mode is active.Example Usage
Standalone function
The standalone function version of this method:Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :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 | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.LucidGetAnchoringHealthResponse>Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorResponse | 500, 503 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
listReady
List all epochs that have met the finalization threshold (more than 100 receipts or older than 1 hour) and are ready to be committed on-chain.Example Usage
Standalone function
The standalone function version of this method:Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :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 | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.EpochsReadyResponse>Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
getStats
Retrieve aggregate epoch statistics including total count, counts by status, average receipts per epoch, and anchoring success rate.Example Usage
Standalone function
The standalone function version of this method:Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :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 | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<models.EpochStatsResponse>Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
.png?fit=max&auto=format&n=VsjUqn6fLqEhBiuI&q=85&s=8b4c7e6431e9a6af1ef23b77bb4ff5fd)
.png?fit=max&auto=format&n=VsjUqn6fLqEhBiuI&q=85&s=d5651a45e4bfbabc33f74e146af3f94a)