Skip to content

API ReferenceTransactions, wallets, and signaturesType Alias

ModifyVaultAllowanceSignatureParams

type ModifyVaultAllowanceSignatureParams = object;

Inputs for an EIP-712 CollateralizableTokenAllowanceAdjustment signature that lets a collateralizable contract reserve the signer’s vault-held collateral without a separate transaction.

Remarks

LOC creation and collateral-modification workflows request one of these automatically when the current allowance is short. Build one directly via sdk.vault.buildModifyAllowanceAuthorizationWorkflow to pre-authorize, and pass the resulting bytes as CreateStaticLOCParams.locAllowanceSignature (or the dynamic equivalent). The vault saturates rather than reverting on modifyAmount: increases cap at 2^256-1, decreases floor at 0, so -(2n ** 255n) is a safe “revoke all”.

Example

// Pre-authorize the LOC contract to reserve 5,000 vault-held USDC, then
// reuse the signature on LOC creation so the user is not prompted again.
const vault = sdk.vault;
const allowedContract = await sdk.getContractAddress(
AnvilContract.LetterOfCredit
);
const workflow = await vault.buildModifyAllowanceAuthorizationWorkflow({
allowedContract,
tokenAddress: USDC,
modifyAmount: 5_000_000_000n, // signed: a negative value revokes
});
// Available before execution for consent UI or audit logging.
console.log(workflow.operations[0]?.authorization?.typedData);
const execution = await workflow.execute();
if (execution.status !== 'executed') {
throw new Error(`allowance preflight ended as ${execution.status}`);
}
const [op] = execution.operations;
if (
op?.status !== WalletOperationStatus.Signed ||
op.signature === undefined
) {
throw new Error('signature not obtained');
}
return op.signature; // -> CreateStaticLOCParams.locAllowanceSignature

Properties

allowedContract

allowedContract: Address;

The collateralizable contract (in practice the LetterOfCredit contract) being allowed to reserve the signer’s vault-held tokenAddress balance. Positive adjustments revert on-chain unless this address is protocol-approved; resolve it with sdk.getContractAddress(AnvilContract.LetterOfCredit) rather than hard-coding.


collateralContractAddress?

optional collateralContractAddress?: Address;

Explicit compatible vault; defaults to the profile’s current vault.


expectedSigner?

optional expectedSigner?: Address;

Account whose authorization is being built. Defaults to the signer.


modifyAmount

modifyAmount: bigint;

Signed delta applied to the current allowance, in the token’s smallest unit: a positive value grants more, a negative value revokes. Encoded on-chain as an int256, not a uint.


nonce?

optional nonce?: bigint;

CollateralVault signature nonce to bind the signature to. Defaults to the signer’s current nonce for AnvilSignatureType.VaultCollateralizableAllowanceAdjustment via getSignatureNonce; supply it only when pre-signing several allowance adjustments in sequence. Explicit undefined is equivalent to omission.


tokenAddress

tokenAddress: Address;

The ERC-20 whose vault-held balance the allowance covers. Allowances are tracked per (account, collateralizable contract, token), so one signature adjusts exactly one token.