Skip to content

API ReferenceReact provider and hooksFunction

useInvalidateVaultNoncesWorkflow()

function useInvalidateVaultNoncesWorkflow(): UseInvalidateVaultNoncesWorkflowResult;

Validates and prepares the transaction that burns CollateralVault authorization nonces.

Every nonce up to and including upToAndIncludingNonce is consumed for the named signature namespace, so any authorization signed against one of them and not yet submitted stops working. This is the revocation path for useVaultDepositAuthorizationWorkflow and useModifyVaultAllowanceAuthorizationWorkflow.

Returns

UseInvalidateVaultNoncesWorkflowResult

The canonical preparation envelope. validate reports a verdict without building anything; prepareWorkflow validates and then builds, resolving to prepared, invalid, failed, or cancelled; workflow, issues, error, and isPreparing mirror the latest request; and reset discards it. No wallet is prompted until workflow.execute().

Throws

Error when rendered outside <AnvilProvider>, by way of useAnvilSDK. Nothing else throws: a rejected validation or build is reported as a failed result, not as an exception.

Example

export function RevokeAuthorizationsButton({ nonce }: { nonce: bigint }) {
const { prepareWorkflow, error } = useInvalidateVaultNoncesWorkflow();
async function revoke() {
// Burns every nonce up to and including this one for that signature
// namespace, so any unsubmitted authorization below it stops working.
const result = await prepareWorkflow({
signatureType: AnvilSignatureType.VaultDepositApproval,
upToAndIncludingNonce: nonce,
});
if (result.status === 'prepared') await result.workflow.execute();
}
return (
<>
<button onClick={revoke}>Revoke deposit authorizations</button>
{error && <p>{error.message}</p>}
</>
);
}