Skip to content

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

ParameterTypeDescription
ctxSDKContextThe configured SDK context.
paramsGetLetterOfCreditParamsThe profile-local LOC identity.
optionsReadExecutionOptionsCancellation 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);