API ReferenceLOC lifecycleFunction
getLetterOfCredit()
function getLetterOfCredit(ctx, params, options?): Promise<LetterOfCredit | undefined>;Reads a canonical indexed LOC, including resolved entities, at one indexed block. Creation evidence and lifecycle facts remain available after outstanding state is deleted.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | SDKContext | The configured SDK context. |
params | GetLetterOfCreditParams | The profile-local LOC identity. |
options | ReadExecutionOptions | Cancellation controls for the complete read. |
Returns
Promise<LetterOfCredit | undefined>
The indexed LOC, or undefined when the compatible index has no such entity.
Throws
SubgraphCompatibilityError If required canonical facts or indexed provenance are unavailable.
Throws
InvalidArgumentError If the id is outside uint256.
Throws
ConfigError If no subgraph endpoint is configured.
Example
const loc = await getLetterOfCredit(sdk, { id: 7n });console.log(loc?.origin.credited, loc?.lifecycle.resolution);