Skip to content

Collateral Vault operations: read Available and Reserved balances, deposit and withdraw collateral, and sign the vault authorizations that let a contract such as the LetterOfCredit reserve it.

Reach it as sdk.vault on an AnvilSDK instance, which creates the module for you.

Balances

getCollateralBalance()

getCollateralBalance(params): Promise<CollateralBalance>;

Returns the account’s CollateralBalance for one token in the Collateral Vault, split into available and reserved.

reserved is collateral committed to reserving contracts and cannot be withdrawn; available is what a new LOC or a withdrawal can draw on. Read straight from the vault contract, so it reflects chain state rather than the subgraph’s indexed view.

Parameters

ParameterTypeDescription
paramsGetVaultCollateralBalanceParamsThe token, and the account whose balance to read.
params.accountAddress?`0x${string}`Vault account to read. Defaults to the configured signer’s address.
params.collateralContractAddress?`0x${string}`Collateral Vault to read. Defaults to the profile’s current vault; name an older vault to read a balance held there.
params.tokenAddress`0x${string}`Collateral token whose vault balance to read.

Returns

Promise<CollateralBalance>

The available and reserved amounts for that token.

Example

const balance = await sdk.vault.getCollateralBalance({
tokenAddress: WETH,
});
// `reserved` is locked by reserving contracts; only `available` can be
// withdrawn
// or back a new LOC. Withdrawals pay the vault fee, so the wallet
// receives:
const feeBasisPoints = await sdk.vault.getWithdrawalFeeBasisPoints();
const fee = (balance.available * BigInt(feeBasisPoints)) / 10_000n;
const received = balance.available - fee;

Throws

InvalidArgumentError If params.tokenAddress is missing.

Throws

WalletNotConnectedError If params.accountAddress is omitted and no signer is configured to resolve a default.


getCollateralBalances()

getCollateralBalances(params, options?): Promise<CollectionPage<TokenCollateralBalance>>;

Returns every token the account holds collateral in, as a paged CollectionPage.

This one reads the subgraph rather than the vault contract, so the SDK must have been configured with a subgraph URL — it throws otherwise. For a single token, or when you need chain-truth rather than indexed data, use VaultModule.getCollateralBalance.

Parameters

ParameterTypeDescription
paramsGetVaultCollateralBalancesParamsPaging and filter options for the collection.
params.accountAddress?`0x${string}`Vault account whose per-token balances to list. Defaults to the configured signer.
params.collateralContractAddress?`0x${string}`Collateral Vault to read; defaults to the profile’s current vault.
params.cursor?string | nullThe nextCursor from the previous page, passed back unchanged. Omit it, or pass null, for the first page.
params.limit?numberMaximum number of items on the page, from 1 to 1000. Defaults to 250.
params.tokenAddressAllowlist?`0x${string}`[]Restrict results to these collateral tokens. Omit or pass [] for every token the account holds in the vault.
optionsReadExecutionOptionsCancellation controls for this page read.
options.signal?AbortSignalCancels the read and preserves the caller’s abort reason.

Returns

Promise<CollectionPage<TokenCollateralBalance>>

One entry per token the account holds collateral in.

Example

// Every token this account holds in the vault, across all pages.
const balances: TokenCollateralBalance[] = [];
let cursor: string | undefined;
do {
const page = await sdk.vault.getCollateralBalances({ cursor });
balances.push(...page.items);
cursor = page.nextCursor ?? undefined;
} while (cursor);

Throws

ConfigError If neither subgraphUrl nor the configured profile supplies a subgraph endpoint.

Throws

WalletNotConnectedError If params.accountAddress is omitted and no signer is configured to resolve a default.

Throws

ContactSupportError COLLATERAL_BALANCE_TOKEN_NOT_FOUND when an indexed balance names a token that does not resolve onchain.


getCollateralizableAllowance()

getCollateralizableAllowance(params): Promise<bigint>;

Returns how much of one token a collateralizable contract — normally the LetterOfCredit contract — is currently allowed to reserve from the account’s vault balance.

This is the vault-side allowance, distinct from an ERC-20 approval: ERC-20 approval governs moving tokens into the vault, this governs what a contract may reserve once they are there. Raise it with VaultModule.buildModifyAllowanceAuthorizationWorkflow.

Parameters

ParameterTypeDescription
paramsGetVaultCollateralizableAllowanceParamsThe collateralizable contract, token, and account.
params.accountAddress?AddressVault account that granted the allowance. Defaults to the configured signer’s address.
params.collateralContractAddress?AddressCollateral Vault to read; defaults to the profile’s current vault.
params.collateralizableContractAddressAddressProtocol contract the account has authorized to reserve its vault collateral — for LOCs, the LetterOfCredit address (sdk.getContractAddress(AnvilContract.LetterOfCredit)).
params.tokenAddressAddressCollateral token the allowance applies to.

Returns

Promise<bigint>

The allowance in the token’s smallest units.


getCollateralReservation()

getCollateralReservation(params): Promise<CollateralReservation | undefined>;

Reads one collateral reservation straight from the vault that holds it: the account, the reserving contract, the token, and the amounts. It reports what the vault stores; it does not say whether the reservation backs a LOC or attach token metadata.

Parameters

ParameterTypeDescription
paramsGetCollateralReservationParamsThe reservation’s chain, vault, and id. Name an older vault here to read a reservation made there.
params.referenceCollateralReservationReferenceThe reservation’s chain, vault, and id. Naming the vault lets you read a reservation in an older vault on the configured chain.

Returns

Promise<CollateralReservation | undefined>

The reservation, or undefined when the vault has no reservation with that id or has already removed it.

Example

const reference = loc.origin.originatingCollateralReservation;
if (reference === null) {
// Some legacy origins cannot recover a reservation identity.
console.log('Reservation identity unavailable');
return;
}
const reservation = await sdk.vault.getCollateralReservation({
reference,
});
// The explicit reference selects the original vault. Undefined means
// its current storage is absent, even though indexed history remains.
console.log(reservation);

getCollateralReservations()

getCollateralReservations(params?, options?): Promise<CollateralReservationPage>;

Lists collateral reservations in one vault from the subgraph. Without an active filter, released reservations (whose amounts are now zero) are included. Every page of one listing reads the same indexed block. The vault defaults to the profile’s current one.

Parameters

ParameterTypeDescription
paramsGetCollateralReservationsParamsVault, account, reserving contract, token, active, and paging filters.
params.accountAddress?`0x${string}`Match the reservation owner; omission includes every account.
params.active?booleantrue for active reservations only, false for released ones only (their amounts are zero). Omit for both.
params.collateralContractAddress?`0x${string}`Collateral Vault to list; defaults to the profile’s current vault. Name an older vault to list reservations made there.
params.cursor?string | nullThe nextCursor from the previous page, passed back unchanged. Omit it, or pass null, for the first page.
params.limit?numberMaximum number of items on the page, from 1 to 1000. Defaults to 250.
params.reservingContractAddress?`0x${string}`Only reservations made by this contract (for example the LetterOfCredit contract); omit for every contract.
params.tokenAddress?`0x${string}`Match the reserved token address; omission includes every token.
optionsReadExecutionOptionsCancellation controls for the page read. Fields as listed under getCollateralBalances.

Returns

Promise<CollateralReservationPage>

One page of reservations, the indexed block it was read at, and the cursor for the next page.

Example

const filters = {
accountAddress,
collateralContractAddress,
active: true,
};
let page = await sdk.vault.getCollateralReservations(filters);
const reservations: CollateralReservation[] = [...page.items];
while (page.nextCursor !== null) {
page = await sdk.vault.getCollateralReservations({
...filters,
cursor: page.nextCursor,
});
reservations.push(...page.items);
}
// Group by chain, vault, account, token and reserving contract.
// A reserving contract's address does not by itself identify its
// product.
const allocations = deriveCollateralAllocations(reservations);
console.log(page.indexedAt, allocations);

getWithdrawalFeeBasisPoints()

getWithdrawalFeeBasisPoints(params?): Promise<number>;

Returns the Collateral Vault’s current withdrawal fee, in basis points (200 means 2%).

The fee is taken out of the amount withdrawn, so a withdrawal returns less than it asks for. Quote it to the user before they sign.

Parameters

ParameterTypeDescription
paramsGetVaultWithdrawalFeeBasisPointsParamsOptional owning vault; defaults to the profile’s current vault.
params.collateralContractAddress?`0x${string}`Collateral Vault whose fee to read. Defaults to the profile’s current vault; name an older vault when withdrawing a balance held there.

Returns

Promise<number>

The withdrawal fee in basis points.

Deposit and withdraw

buildDepositWorkflow()

buildDepositWorkflow(params): Promise<WalletOperationWorkflow>;

Builds the workflow that deposits tokens into the Collateral Vault.

The workflow is assembled from current chain state: one ERC-20 approve step per token whose existing approval is short, followed by a single deposit step covering every token. A fully approved single-token deposit is therefore one operation, and nothing about the shape is fixed — inspect workflow.operations to show the user what they are about to sign, then call workflow.execute().

Call VaultModule.validateDeposit for early form feedback. Building does not imply validity; execute() repeats full validation against fresh state before its first prompt.

Parameters

ParameterTypeDescription
paramsDepositToVaultParamsThe token and amount to deposit.
params.collateralContractAddress?AddressCollateral Vault to deposit into; defaults to the profile’s current vault.
params.collateralizableToApprove?AddressProtocol contract (normally the LetterOfCredit address from sdk.getContractAddress(AnvilContract.LetterOfCredit)) whose collateralizable allowance should grow by the deposited amounts in the same transaction, so a following LOC creation needs no separate allowance signature. Cannot be combined with a non-sender toAccount. Explicit undefined is equivalent to omission.
params.toAccount?AddressVault account to credit; defaults to the transaction sender, and setting it deposits on another account’s behalf (funds still come from the sender’s wallet). Cannot be combined with collateralizableToApprove when it differs from the sender, because the vault has no single call that does both. Explicit undefined is equivalent to omission.
params.tokenAmountsTokenAmount[]One or more ERC-20 amounts to move from the sender’s wallet into the Collateral Vault, in each token’s smallest unit. Each token must be an enabled collateral token (CollateralToken.enabled). The workflow adds an ERC-20 approve step for any token whose approval to the vault is short. Deposits land in the account’s Available balance (CollateralBalance.available).

Returns

Promise<WalletOperationWorkflow>

The workflow to present and execute.

Throws

WorkflowSignerChangedError If the SDK’s configured accountAddress and the connected wallet’s account disagree, or if the signer observed while executing differs from the one observed while building. Rebuild the workflow for the currently connected signer; re-executing the same workflow succeeds only if the original signer reconnects.


buildWithdrawWorkflow()

buildWithdrawWorkflow(params): Promise<WalletOperationWorkflow>;

Builds the workflow that withdraws tokens from the Collateral Vault back to the account’s wallet.

Only available collateral can be withdrawn; anything reserved against an open LOC has to be released first by redeeming or canceling that LOC. The vault’s withdrawal fee (VaultModule.getWithdrawalFeeBasisPoints) is deducted from the amount.

Parameters

ParameterTypeDescription
paramsWithdrawFromVaultParamsThe token and amount to withdraw.
params.collateralContractAddress?AddressCollateral Vault to withdraw from; defaults to the profile’s current vault.
params.toAccount?AddressWallet address that receives the tokens (net of the withdrawal fee). Defaults to the transaction sender. Explicit undefined is equivalent to omission.
params.tokenAddressAddressCollateral token to withdraw. Only the account’s Available balance for this token can be withdrawn; the Reserved balance stays in the vault until its LOC releases it.
params.withdrawalAmount?bigintAmount to debit from the account’s available balance, in the token’s smallest unit; must not exceed CollateralBalance.available, and the vault deducts its withdrawal fee (VaultModule.getWithdrawalFeeBasisPoints) before transferring, so the recipient receives less than this. Omit to withdraw the full Available balance; an explicit 0n reverts onchain. Explicit undefined is equivalent to omission.

Returns

Promise<WalletOperationWorkflow>

The workflow to present and execute.

Throws

WorkflowSignerChangedError If the SDK’s configured accountAddress and the connected wallet’s account disagree, or if the signer observed while executing differs from the one observed while building. Rebuild the workflow for the currently connected signer; re-executing the same workflow succeeds only if the original signer reconnects.


validateDeposit()

validateDeposit(params, signal?): Promise<ValidationIssue[]>;

Validates deposit parameters without touching the wallet: token address and amount format, and that the wallet holds the total being deposited.

ERC-20 approval is deliberately not checked. The workflow builder adds an approve step when one is needed, so failing validation on it would block a submission that would have succeeded.

Parameters

ParameterTypeDescription
paramsPartial<DepositToVaultParams>The partial deposit parameters to check. Fields as listed under buildDepositWorkflow, each optional here.
signal?AbortSignalAborts the validation’s onchain reads; the call then rejects with the signal’s reason.

Returns

Promise<ValidationIssue[]>

The issues found. An empty array means every rule ran and passed; a rule whose required field is missing reports FieldRequired instead of being skipped. An infrastructure failure rejects rather than returning a partial list.

Throws

When validation itself cannot run: a typed SDK error passes through unchanged, a provider failure becomes ProviderConnectionError, any other failure becomes ContactSupportError, and an abort rejects with the signal’s reason.


validateWithdraw()

validateWithdraw(params, signal?): Promise<ValidationIssue[]>;

Validates withdrawal parameters without touching the wallet: token address format, a non-negative amount when one is given, and destination address format when one is given. Zero is not rejected — it is a well-formed request for a withdrawal of nothing.

It does not check that the amount is actually available rather than held by a reserving contract — compare against VaultModule.getCollateralBalance yourself before submitting.

Parameters

ParameterTypeDescription
paramsPartial<WithdrawFromVaultParams>The partial withdrawal parameters to check. Fields as listed under buildWithdrawWorkflow, each optional here.
signal?AbortSignalAborts the validation’s onchain reads; the call then rejects with the signal’s reason.

Returns

Promise<ValidationIssue[]>

The issues found. An empty array means every rule ran and passed; a rule whose required field is missing reports FieldRequired instead of being skipped. An infrastructure failure rejects rather than returning a partial list.

Throws

When validation itself cannot run: a typed SDK error passes through unchanged, a provider failure becomes ProviderConnectionError, any other failure becomes ContactSupportError, and an abort rejects with the signal’s reason.

Signed authorizations

buildDepositAuthorization()

buildDepositAuthorization(params): Promise<VaultDepositAuthorizationDefinition>;

Builds the exact EIP-712 CollateralizableDepositApproval definition without signing it.

Three parties are involved. The account holder signs: the wallet whose tokens will move. The collateralizable contract named in collateralizableAddress submits: it passes the signature to the vault’s depositFromAccount, and no other caller can use it because the vault binds msg.sender into the digest. The vault verifies: it accepts an EOA signature or an ERC-1271 contract signer, consumes the signer’s next deposit-approval nonce, pulls exactly depositAmount of the token from the signer’s wallet, and raises the collateralizable’s vault allowance to cover it. The signer still needs an ERC-20 approval to the vault for that transfer.

The signature carries no deadline. It stays usable until the vault consumes its nonce or the signer invalidates it with VaultModule.buildInvalidateNoncesWorkflow.

Any contract the vault has approved as a collateralizable can be named; nothing here is specific to Letters of Credit.

Parameters

ParameterTypeDescription
paramsBuildVaultDepositAuthorizationParamsThe collateralizable, token, and exact amount to bind.
params.collateralContractAddress?`0x${string}`Collateral Vault whose nonce and EIP-712 domain the authorization binds. Defaults to the profile’s current vault.
params.collateralizableAddress`0x${string}`Collateralizable contract that will submit the signature to the vault’s depositFromAccount; no other caller can use it.
params.depositAmountbigintPositive uint256 token amount. The vault verifies this exact amount; a smaller or larger deposit fails verification.
params.expectedSigner?`0x${string}`Account that must sign the authorization. Defaults to the SDK’s signer.
params.nonce?bigintExact uint256 nonce to bind. Defaults to the signer’s next onchain nonce when the definition or workflow is built; rebuild a long-held workflow if that nonce is consumed before signing.
params.tokenAddress`0x${string}`Token the authorization permits depositing.

Returns

Promise<VaultDepositAuthorizationDefinition>

The inspectable definition: chain, vault, signer, nonce, payload, and wallet-ready typed data.

Throws

InvalidArgumentError If an address is zero or malformed, or an amount or nonce does not fit its EIP-712 integer width.


buildDepositAuthorizationWorkflow()

buildDepositAuthorizationWorkflow(params): Promise<WalletOperationWorkflow>;

Builds a one-step workflow that signs a vault deposit authorization.

The connected account signs; the collateralizable contract submits the resulting bytes to the vault’s depositFromAccount, where the vault verifies them. See VaultModule.buildDepositAuthorization for what the signature permits and how long it stays usable.

Parameters

ParameterTypeDescription
paramsBuildVaultDepositAuthorizationParamsThe collateralizable, token, and exact amount to bind. Fields as listed under buildDepositAuthorization.

Returns

Promise<WalletOperationWorkflow>

A workflow whose single operation yields the signature.

Example

// The account holder signs. The collateralizable contract submits the
// bytes to `depositFromAccount`, and the vault verifies them there.
const workflow = await sdk.vault.buildDepositAuthorizationWorkflow({
collateralizableAddress: collateralizable,
tokenAddress: USDC,
depositAmount: 5_000_000_000n, // exact: the vault rejects any other
});
// Chain, vault, signer, nonce, and typed data, before the wallet prompt.
console.log(workflow.operations[0]?.authorization);
const execution = await workflow.execute();
if (execution.status !== 'executed') {
throw new Error(`deposit 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; // -> the collateralizable's deposit entry point

Throws

WorkflowSignerChangedError If the SDK’s configured accountAddress and the connected wallet’s account disagree, or if the signer observed while executing differs from the one observed while building. Rebuild the workflow for the currently connected signer; re-executing the same workflow succeeds only if the original signer reconnects.


buildInvalidateNoncesWorkflow()

buildInvalidateNoncesWorkflow(params): Promise<WalletOperationWorkflow>;

Builds the transaction workflow that revokes vault signatures you have handed out but that have not been used yet. It marks every nonce of one signature type, up to and including the one you name, as used, so no signature carrying those nonces can be submitted.

Parameters

ParameterTypeDescription
paramsInvalidateVaultNoncesParamsThe signature type and the highest nonce to revoke.
params.signatureTypeVaultAuthorizationSignatureTypeWhich kind of vault signature to revoke: AnvilSignatureType.VaultCollateralizableAllowanceAdjustment (allowance changes) or AnvilSignatureType.VaultDepositApproval (deposit approvals).
params.upToAndIncludingNoncebigintHighest nonce to mark as used. Every nonce from the account’s next nonce up to and including this one is revoked. It cannot be below the next nonce, and the vault caps how many nonces one call may revoke.

Returns

Promise<WalletOperationWorkflow>

The workflow to present and execute.

Throws

WorkflowSignerChangedError If the SDK’s configured accountAddress and the connected wallet’s account disagree, or if the signer observed while executing differs from the one observed while building. Rebuild the workflow for the currently connected signer; re-executing the same workflow succeeds only if the original signer reconnects.


buildModifyAllowanceAuthorization()

buildModifyAllowanceAuthorization(params): Promise<ModifyVaultAllowanceAuthorizationDefinition>;

Builds the exact EIP-712 vault allowance authorization without signing it: a signed change to how much a collateralizable contract (normally the LetterOfCredit contract) may reserve from the account’s vault balance. Use it to inspect the typed data or to sign it with your own tooling.

Parameters

ParameterTypeDescription
paramsBuildModifyVaultAllowanceAuthorizationParamsThe vault, token, contract, and signed allowance change, plus optional signer and nonce overrides.
params.allowedContract`0x${string}`Collateralizable contract whose allowance will change.
params.collateralContractAddress?`0x${string}`Collateral Vault whose nonce and EIP-712 domain the authorization binds. Defaults to the profile’s current vault.
params.expectedSigner?`0x${string}`Account that must sign the authorization. Defaults to the SDK’s signer.
params.modifyAmountbigintint256 allowance delta; negative values revoke allowance.
params.nonce?bigintExact uint256 nonce to bind. Defaults to the signer’s next onchain nonce when the definition or workflow is built; rebuild a long-held workflow if that nonce is consumed before signing.
params.tokenAddress`0x${string}`Vault-held token whose collateralizable allowance will change.

Returns

Promise<ModifyVaultAllowanceAuthorizationDefinition>

The chain, vault, signer, nonce, and wallet-ready typed data.


buildModifyAllowanceAuthorizationWorkflow()

buildModifyAllowanceAuthorizationWorkflow(params): Promise<WalletOperationWorkflow>;

Builds a one-step workflow that signs a vault allowance authorization. Pass the signature to LOC creation as locAllowanceSignature so the create flow needs no separate allowance prompt.

The definition captures the chain, vault address, signer, and nonce when this method is called. If the workflow is held while the wallet changes chain or signer, execution refuses to sign. If another authorization uses the captured nonce first, rebuild the workflow to resolve the next nonce.

Parameters

ParameterTypeDescription
paramsBuildModifyVaultAllowanceAuthorizationParamsThe vault, token, contract, and signed allowance change, plus optional signer and nonce overrides. Fields as listed under buildModifyAllowanceAuthorization.

Returns

Promise<WalletOperationWorkflow>

A workflow whose single operation yields the signature.

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

Throws

WorkflowSignerChangedError If the SDK’s configured accountAddress and the connected wallet’s account disagree, or if the signer observed while executing differs from the one observed while building. Rebuild the workflow for the currently connected signer; re-executing the same workflow succeeds only if the original signer reconnects.


validateAllowance()

validateAllowance(params, signal?): Promise<ValidationIssue[]>;

Validates that the vault’s collateralizable allowance already covers a required token amount.

Unlike the other validate* methods this one does not gate a matching build*Workflow call. It is the allowance-sufficiency check that vault and LOC workflows compose internally, exposed here so a headless caller can run it standalone — for example to decide whether a create flow will need an allowance signature before it starts.

Parameters

ParameterTypeDescription
paramsPartial<VaultAllowanceValidationParams>The contract, token, and amount that must be covered.
signal?AbortSignalAborts the validation’s onchain reads; the call then rejects with the signal’s reason.

Returns

Promise<ValidationIssue[]>

The issues found. An empty array means every rule ran and passed; a rule whose required field is missing reports FieldRequired instead of being skipped. An infrastructure failure rejects rather than returning a partial list.

Throws

When validation itself cannot run: a typed SDK error passes through unchanged, a provider failure becomes ProviderConnectionError, any other failure becomes ContactSupportError, and an abort rejects with the signal’s reason.


validateDepositAuthorization()

validateDepositAuthorization(params, signal?): Promise<ValidationIssue[]>;

Validates the inputs of a vault deposit authorization before the SDK reads its nonce or asks the wallet to sign.

Parameters

ParameterTypeDescription
paramsPartial<BuildVaultDepositAuthorizationParams>The partial authorization parameters to check. Fields as listed under buildDepositAuthorization, each optional here.
signal?AbortSignalAborts the validation’s onchain reads; the call then rejects with the signal’s reason.

Returns

Promise<ValidationIssue[]>

The issues found. An empty array means every rule ran and passed; a rule whose required field is missing reports FieldRequired instead of being skipped. An infrastructure failure rejects rather than returning a partial list.

Throws

When validation itself cannot run: a typed SDK error passes through unchanged, a provider failure becomes ProviderConnectionError, any other failure becomes ContactSupportError, and an abort rejects with the signal’s reason.


validateInvalidateNonces()

validateInvalidateNonces(params, signal?): Promise<ValidationIssue[]>;

Validates a nonce revocation before building it: the signature type is a vault authorization type, and the target nonce is not below the account’s next nonce and is within the vault’s per-call revocation limit.

Parameters

ParameterTypeDescription
paramsPartial<InvalidateVaultNoncesParams>The partial revocation parameters to check. Fields as listed under buildInvalidateNoncesWorkflow, each optional here.
signal?AbortSignalAborts the validation’s onchain reads; the call then rejects with the signal’s reason.

Returns

Promise<ValidationIssue[]>

The issues found. An empty array means every rule ran and passed; a rule whose required field is missing reports FieldRequired instead of being skipped. An infrastructure failure rejects rather than returning a partial list.

Throws

When validation itself cannot run: a typed SDK error passes through unchanged, a provider failure becomes ProviderConnectionError, any other failure becomes ContactSupportError, and an abort rejects with the signal’s reason.


validateModifyAllowanceAuthorization()

validateModifyAllowanceAuthorization(params, signal?): Promise<ValidationIssue[]>;

Validates the inputs of a vault allowance authorization before the SDK reads its nonce or asks the wallet to sign.

Parameters

ParameterTypeDescription
paramsPartial<BuildModifyVaultAllowanceAuthorizationParams>The partial authorization parameters to check. Fields as listed under buildModifyAllowanceAuthorization, each optional here.
signal?AbortSignalAborts the validation’s onchain reads; the call then rejects with the signal’s reason.

Returns

Promise<ValidationIssue[]>

The issues found. An empty array means every rule ran and passed; a rule whose required field is missing reports FieldRequired instead of being skipped. An infrastructure failure rejects rather than returning a partial list.

Throws

When validation itself cannot run: a typed SDK error passes through unchanged, a provider failure becomes ProviderConnectionError, any other failure becomes ContactSupportError, and an abort rejects with the signal’s reason.


validateModifyAllowanceSignature()

validateModifyAllowanceSignature(params, signal?): Promise<ValidationIssue[]>;

Validates the parameters of an allowance-signature request before prompting the user to sign. collateralContractAddress selects the vault that owns both the nonce and EIP-712 domain; omission selects the profile vault. Pass the original vault explicitly when validating a historical vault authorization after the profile has moved.

Parameters

ParameterTypeDescription
paramsPartial<VaultAllowanceSignatureValidationParams>The partial signature parameters to check.
signal?AbortSignalAborts the validation’s onchain reads; the call then rejects with the signal’s reason.

Returns

Promise<ValidationIssue[]>

The issues found. An empty array means every rule ran and passed; a rule whose required field is missing reports FieldRequired instead of being skipped. An infrastructure failure rejects rather than returning a partial list.

Throws

When validation itself cannot run: a typed SDK error passes through unchanged, a provider failure becomes ProviderConnectionError, any other failure becomes ContactSupportError, and an abort rejects with the signal’s reason.