Skip to content

API ReferenceLOC lifecycleType Alias

CancelLOCsAndWithdrawParams

type CancelLOCsAndWithdrawParams = object &
| {
cancelCalls: CancelLOCParams[];
locIDs?: never;
}
| {
cancelCalls?: never;
locIDs: bigint[];
};

Parameters for cancelling one or more LOCs and then withdrawing the released collateral from the CollateralVault in a sequential two-transaction workflow. Build with sdk.loc.buildCancelAndWithdrawWorkflow.

Type Declaration

collateralContractAddress?

optional collateralContractAddress?: Address;

Vault to withdraw from after cancellation; defaults to the current profile vault.

toAccount?

optional toAccount?: Address;

If not provided, the configured signer’s address will be used

tokenAddress

tokenAddress: Address;

Vault token to withdraw after the cancellations release collateral. Validation caps withdrawalAmount at the signer’s available balance plus collateral from already-expired, signer-owned reservations in the selected vault in the listed LOCs. Mutable unexpired, converted, and other-vault LOCs do not increase that explicit bound.

withdrawalAmount?

optional withdrawalAmount?: bigint;

If not provided, the withdrawal transaction resolves and withdraws the signer’s full execution-time available balance after cancellation.

Remarks

Multicall is the immediate caller of each cancellation. Therefore every unexpired LOC needs beneficiary authorization, even when the transaction signer is the beneficiary. Use cancelCalls for that canonical path; locIDs is retained as expired-LOC shorthand. The batched cancellations are atomic with one another, but the later vault withdrawal is a separate transaction and can still be rejected or fail after cancellation has confirmed.