API ReferenceLOC lifecycleType Alias
ConvertLOCParams
type ConvertLOCParams = object;Parameters for permissionlessly converting an unexpired, unhealthy dynamic LOC into its credited
token. Build with sdk.loc.buildConvertWorkflow.
Example
const params: ConvertLOCParams = { id: 42n, // Any ILiquidator is valid; the SDK does not choose one for you. liquidator, liquidatorParams, // Omitted: fetch a fresh Pyth update when the transaction is built.};
const issues = await sdk.loc.validateConvert(params);if (issues.length > 0) throw new Error(JSON.stringify(issues));
// Healthy LOCs still revert for every caller. Conversion is// permissionless// only after the current pair's liquidation threshold is reached.const workflow = await sdk.loc.buildConvertWorkflow(params);await workflow.execute();Properties
id
id: bigint;ID of the dynamic LOC to convert (LetterOfCreditReference.id).
liquidator?
optional liquidator?: Address;Contract implementing ILiquidator. Omit it or pass the zero address for self-liquidation, where
the caller supplies approved credited tokens and receives collateral plus the liquidator incentive.
Core selects no Anvil-operated liquidator. Explicit undefined is equivalent to omission.
liquidatorParams?
optional liquidatorParams?: Bytes;Opaque calldata forwarded to the external liquidator. It must be empty or omitted for
self-liquidation. Explicit undefined is equivalent to omission.
oraclePriceUpdate?
optional oraclePriceUpdate?: OraclePriceUpdate | null;Signed Pyth update for the collateral/credited pair. A non-empty update object is forwarded verbatim
and its fee is attached as transaction value. Omit it to fetch automatically when the transaction is
built; if that fetch fails, the SDK uses the on-chain price only after proving it is still fresh and
otherwise preserves the price-service failure. Pass null to deliberately skip the fetch and use
the current on-chain price. An object whose data is '0x' is invalid; use null for
on-chain-price mode.