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.
Escrow SDK
Cross-chain escrow lifecycle — create, release, dispute, and query
Operations
| Method | Description |
|---|
lucidCreateEscrow | Create a time-locked escrow |
lucidReleaseEscrow | Release escrow with verified receipt |
lucidDisputeEscrow | Dispute an escrow |
lucidGetEscrow | Get escrow details |
Generated Reference
Overview
Cross-chain escrow lifecycle — create, release, dispute, and query
Available Operations
lucidCreateEscrow
Create a new time-locked escrow for agent-to-agent transactions on a specific chain. Funds are held until released by receipt verification or timed out.
Example Usage
import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";
const raijinLabsLucidAi = new RaijinLabsLucidAi();
async function run() {
const result = await raijinLabsLucidAi.escrow.lucidCreateEscrow({
chainId: "<id>",
beneficiary: "<value>",
token: "<value>",
amount: "398.30",
duration: 430908,
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { escrowLucidCreateEscrow } from "raijin-labs-lucid-ai/funcs/escrowLucidCreateEscrow.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 escrowLucidCreateEscrow(raijinLabsLucidAi, {
chainId: "<id>",
beneficiary: "<value>",
token: "<value>",
amount: "398.30",
duration: 430908,
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("escrowLucidCreateEscrow failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|
request | models.CreateEscrowRequest | :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<models.SuccessResponse>
Errors
| Error Type | Status Code | Content Type |
|---|
| errors.ErrorResponse | 400 | application/json |
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
lucidReleaseEscrow
Release escrowed funds to the beneficiary after verifying the associated receipt. Requires a valid receipt hash proving service delivery.
Example Usage
import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";
const raijinLabsLucidAi = new RaijinLabsLucidAi();
async function run() {
const result = await raijinLabsLucidAi.escrow.lucidReleaseEscrow({
chainId: "<id>",
escrowId: "<id>",
receiptHash: "<value>",
signature: "<value>",
signerPubkey: "<value>",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { escrowLucidReleaseEscrow } from "raijin-labs-lucid-ai/funcs/escrowLucidReleaseEscrow.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 escrowLucidReleaseEscrow(raijinLabsLucidAi, {
chainId: "<id>",
escrowId: "<id>",
receiptHash: "<value>",
signature: "<value>",
signerPubkey: "<value>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("escrowLucidReleaseEscrow failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|
request | models.ReleaseEscrowRequest | :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<models.SuccessResponse>
Errors
| Error Type | Status Code | Content Type |
|---|
| errors.ErrorResponse | 400 | application/json |
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
lucidDisputeEscrow
Dispute an active escrow, freezing the funds and initiating the arbitration process. The escrow must be in ‘active’ status to be disputed.
Example Usage
import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";
const raijinLabsLucidAi = new RaijinLabsLucidAi();
async function run() {
const result = await raijinLabsLucidAi.escrow.lucidDisputeEscrow({
chainId: "<id>",
escrowId: "<id>",
reason: "<value>",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { escrowLucidDisputeEscrow } from "raijin-labs-lucid-ai/funcs/escrowLucidDisputeEscrow.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 escrowLucidDisputeEscrow(raijinLabsLucidAi, {
chainId: "<id>",
escrowId: "<id>",
reason: "<value>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("escrowLucidDisputeEscrow failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|
request | models.DisputeEscrowRequest | :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<models.SuccessResponse>
Errors
| Error Type | Status Code | Content Type |
|---|
| errors.ErrorResponse | 400 | application/json |
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |
lucidGetEscrow
Retrieve the full details of a specific escrow by chain and escrow ID, including status, parties, amounts, timeout, and associated receipt hashes.
Example Usage
import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";
const raijinLabsLucidAi = new RaijinLabsLucidAi();
async function run() {
const result = await raijinLabsLucidAi.escrow.lucidGetEscrow({
chainId: "<id>",
escrowId: "<id>",
});
console.log(result);
}
run();
Standalone function
The standalone function version of this method:
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { escrowLucidGetEscrow } from "raijin-labs-lucid-ai/funcs/escrowLucidGetEscrow.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 escrowLucidGetEscrow(raijinLabsLucidAi, {
chainId: "<id>",
escrowId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("escrowLucidGetEscrow failed:", res.error);
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|
request | operations.LucidGetEscrowRequest | :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<models.GetEscrowResponse>
Errors
| Error Type | Status Code | Content Type |
|---|
| errors.ErrorResponse | 404 | application/json |
| errors.ErrorResponse | 500 | application/json |
| errors.RaijinLabsLucidAiDefaultError | 4XX, 5XX | */* |