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})`); } }} Copy
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})`); } }}
Optional
Readonly
Optional structured data attached to the failure (e.g. on-chain receipt).
The policies that rejected the transaction.
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.
Example: Checking which policies blocked a transaction