@lifi/composer-sdk
Version:
Public Composer SDK for building and submitting flows
1 lines • 1.52 kB
Source Map (JSON)
{"version":3,"file":"guards.generated.cjs","names":[],"sources":["../../src/generated/guards.generated.ts"],"sourcesContent":["// AUTO-GENERATED from manifest.json — do not edit by hand.\n// Regenerate with: yarn workspace @lifi/composer-sdk generate\n\nimport type { TypedGuard } from '../types.js';\n\nimport type {\n BandGuardConfig,\n CoreNumericInvariantGuardConfig,\n SlippageGuardConfig,\n} from './config.generated.js';\n\n/** Assert that output amounts are within a slippage tolerance in basis points */\nexport const slippage = <P extends string>(\n config: Omit<SlippageGuardConfig, 'port'> & { port: P },\n): TypedGuard<P> => ({\n kind: 'slippage',\n ...config,\n});\n\n/** Assert a numeric (uint256) handle output of the target op satisfies a comparison against a constant threshold. Emits one IR1 binary invariant; reverts the run on violation. */\nexport const coreNumericInvariant = <P extends string>(\n config: Omit<CoreNumericInvariantGuardConfig, 'port'> & { port: P },\n): TypedGuard<P> => ({\n kind: 'core.numericInvariant',\n ...config,\n});\n\n/** Assert that an output stays within a tolerance in basis points of its simulated value, in both directions */\nexport const band = <P extends string>(\n config: Omit<BandGuardConfig, 'port'> & { port: P },\n): TypedGuard<P> => ({\n kind: 'band',\n ...config,\n});\n"],"mappings":";;;;;;;;AAYA,MAAa,YACX,YACmB;CACnB,MAAM;CACN,GAAG;AACL;;AAGA,MAAa,wBACX,YACmB;CACnB,MAAM;CACN,GAAG;AACL;;AAGA,MAAa,QACX,YACmB;CACnB,MAAM;CACN,GAAG;AACL"}