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;The Beneficiary: the 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, it must be one of its entries.
creator?
optional creator?: Address;The LOC’s Creator. Defaults to the connected signer’s address. If set, it must equal the connected signer’s address, because the contract records the transaction sender as the Creator; a different value is rejected.
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; LOCModule.getMinDate and LOCModule.getMaxDate 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;Vault allowance signature letting the LetterOfCredit contract reserve this LOC’s collateral, from VaultModule.buildModifyAllowanceAuthorizationWorkflow. When it is omitted and the allowance is short, the workflow asks the wallet to sign one.
tag?
optional tag?: Bytes;Optional reference data (for example an invoice number or document hash) recorded in the creation
event and returned as origin.tag on LetterOfCredit; it is not
stored in contract state. 0x-prefixed hex of at most 512 bytes
(LOCModule.getCreateTagByteLimit).
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.