@kagamidigital/salt-sdk-mirror
    Preparing search index...

    Class PolicyBreachError

    Thrown when a transaction is rejected by one or more account policies before signing begins. The rejectedPolicies array contains the specific policies that blocked the transaction.

    import { Salt, PolicyBreachError } from 'salt-sdk';
    import { parseEther } from 'viem';

    try {
    const tx = await salt.submitTx({
    accountId: '0a1b2c3d4e5f',
    to: '0xRecipientAddress',
    value: parseEther('0.1'),
    chainId: 11155111,
    userAddress: account.address,
    walletClient,
    publicClient,
    });
    await tx.wait();
    } catch (err) {
    if (err instanceof PolicyBreachError) {
    for (const policy of err.rejectedPolicies) {
    console.error(`Blocked by: ${policy.id} (${policy.type})`);
    }
    }
    }

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    cause?: Error
    data?: unknown

    Optional structured data attached to the failure (e.g. on-chain receipt).

    message: string
    name: string
    rejectedPolicies: Policy[]

    The policies that rejected the transaction.

    stack?: string