API ReferenceLOC lifecycleFunction
getOutstandingLetterOfCredit()
function getOutstandingLetterOfCredit(ctx, params): Promise<OutstandingLetterOfCredit | undefined>;Reads current contract-resident LOC state, including expired unresolved LOCs.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | SDKContext | SDK context selecting the chain and LOC proxy. |
params | GetOutstandingLetterOfCreditParams | Profile-local LOC ID. |
Returns
Promise< | OutstandingLetterOfCredit |
undefined>
Outstanding state, or undefined after resolution or for an unknown ID.
Throws
InvalidArgumentError for an ID outside uint96; ConfigError when the live chain differs from the profile; provider errors when the read fails.
Example
const loc = await getOutstandingLetterOfCredit(ctx, { id: 42n });console.log(loc?.remainingCredited.amount);