Skip to content

API ReferenceLOC lifecycleType Alias

CreateStaticLOCParams

type CreateStaticLOCParams = object;

Parameters for creating a static LOC — one collateralized 1:1 in the same token it credits, so it needs no oracle price and can never be liquidated. Pass to sdk.loc.validateCreateStatic to pre-check, then to sdk.loc.buildCreateStaticWorkflow for a wallet workflow that deposits and approves collateral as needed before the creation transaction.

Example

const params: CreateStaticLOCParams = {
beneficiary: '0x1111111111111111111111111111111111111111',
// 1,000 USDC (6 decimals): face value and, for a static LOC,
// collateral.
tokenAmount: {
tokenAddress: testnetProfile.contracts.USDC.address,
amount: 1_000_000_000n,
},
expirationTimestampSeconds: dateToEthereumTimestamp(
await sdk.loc.getMaxDate()
),
};
// Validate before touching the wallet; an empty array means valid
// params.
const issues = await sdk.loc.validateCreateStatic(params);
if (issues.length > 0) throw new Error(JSON.stringify(issues));
// Deposit, approve, and allowance steps appear only if the vault is
// short.
const workflow = await sdk.loc.buildCreateStaticWorkflow(params);
await workflow.execute(operations => {
console.log(operations.map(operation => operation.status));
});

Properties

beneficiary

beneficiary: Address;

Account entitled to redeem the credited value before expiration, and the only party (besides a caller holding its signed authorization) that can cancel the LOC before it expires. If LOCConfig.locBeneficiaryAllowList is configured, must be one of its entries.


creator?

optional creator?: Address;

The LOC’s creator. Defaults to the connected signer’s address if empty. If set, must equal the connected signer’s address — the contract binds the creator to msg.sender, so a mismatched value is rejected rather than threaded through.


expirationTimestampSeconds

expirationTimestampSeconds: bigint;

Unix-seconds instant at which the LOC expires — expired at, not after, this second. Must be in the future and no further out than the deployment’s maximum duration; getMinLOCDate and getMaxLOCDate give the SDK’s padded bounds. After expiration the beneficiary can no longer redeem and anyone may cancel to release the collateral.


locAllowanceSignature?

optional locAllowanceSignature?: Bytes;

Signature to modify the LOC contract’s allowance within the CollateralVault to allow for this LOC’s creation.


tag?

optional tag?: Bytes;

Optional off-chain reference (e.g. an invoice or document hash) recorded in the creation event and surfaced by the subgraph as LetterOfCreditOrigin.tag; never stored in contract state. 0x-prefixed hex of at most 512 bytes.


tokenAmount

tokenAmount: TokenAmount;

The LOC’s face value: the token credited to the beneficiary and, because a static LOC is 1:1, also the collateral, in the token’s smallest unit. The vault reserves the amount plus its withdrawal fee so the full face value is redeemable; the workflow tops the vault up to that figure. If LOCConfig.staticLOCTokenAddressAllowlist is configured, tokenAddress must be one of its entries.