API ReferenceLOC lifecycleType Alias
RedeemLOCParams
type RedeemLOCParams = object;One redemption within RedeemLOCsParams.redemptions: which LOC, how much of its face value, where the tokens go, and — when the caller is not the Beneficiary — the Beneficiary’s signed authorization.
Properties
amount
amount: bigint;Credited-token amount to redeem, in the credited token’s smallest unit; greater than zero and at most the LOC’s remaining OutstandingLetterOfCredit.remainingCredited. Less than the full amount is a partial redemption and the LOC stays open with the remainder; the full amount completes the LOC and the contract removes it.
beneficiaryAuthorization?
optional beneficiaryAuthorization?: Bytes;EIP-712 RedeemAuthorization signed by the LOC’s Beneficiary. Build and sign it with
sdk.loc.buildRedeemAuthorizationWorkflow; it binds id, amount, the LOC’s current credited
amount, destinationAddress, and the Beneficiary’s next redeem nonce. Required when the connected
signer is not the Beneficiary, and for every entry when
RedeemLOCsParams.redemptions has more than one element. Explicit
undefined is equivalent to omission.
destinationAddress?
optional destinationAddress?: Address;Account that receives the redeemed tokens. A direct redemption defaults to the connected signer. A
delegated redemption with beneficiaryAuthorization defaults to the LOC’s Beneficiary. An explicit
value must be the address the Beneficiary signed for. Explicit undefined is equivalent to
omission.
id
id: bigint;ID of the LOC to redeem (LetterOfCreditReference.id). The LOC must not have expired.
liquidator?
optional liquidator?: Address;Contract implementing ILiquidator that converts the LOC’s collateral into the credited token, so
the redemption pays out in the credited token. Omitted, the caller liquidates the collateral
themselves: they receive the collateral (plus the liquidator incentive) rather than the credited
token, and — unless they are also the destinationAddress — must hold and have approved the
credited amount the contract pulls from them. This accepts any contract implementing ILiquidator;
the SDK binds no liquidator deployments of its own. The SDK picks none by default because the two
modes pay out different assets. Only valid on a single redemption.
liquidatorParams?
optional liquidatorParams?: Bytes;Opaque calldata forwarded verbatim to liquidator.liquidate, such as a swap route computed
offchain. Meaningless without a liquidator, and empty ('0x') when omitted. Only valid on a
single redemption.
oraclePriceUpdate?
optional oraclePriceUpdate?: OraclePriceUpdate | null;Signed Pyth price update, from sdk.pricing.getOraclePriceUpdate, priced with the LOC’s collateral
token as inputToken and its credited token as outputToken. Its fee is attached as the
transaction’s value. There are three modes for a Dynamic LOC (collateral token differs from
credited token): an update object is forwarded verbatim; undefined automatically fetches one while
the transaction is built; and null uses the price already onchain without contacting Hermes. If an
automatic fetch fails, the SDK uses the onchain price only after proving it is still fresh.
Otherwise the contract reverts with PriceUpdateStale once the price is older than its freshness
window (see
PricingModule.getMaxPriceUpdateSecondsAgo).
An object whose data is '0x' is invalid: use null for the onchain-price mode. Every mode is
ignored for a LOC that has already converted, which needs no price. Only valid on a single
redemption.