@lifi/composer-sdk
Version:
Public Composer SDK for building and submitting flows
26 lines (21 loc) • 905 B
text/typescript
// AUTO-GENERATED from manifest.json — do not edit by hand.
// Regenerate with: yarn workspace @lifi/composer-sdk generate
import type { TypedGuard } from '../types.js';
import type {
CoreNumericInvariantGuardConfig,
SlippageGuardConfig,
} from './config.generated.js';
/** Assert that output amounts are within a slippage tolerance in basis points */
export const slippage = <P extends string>(
config: Omit<SlippageGuardConfig, 'port'> & { port: P },
): TypedGuard<P> => ({
kind: 'slippage',
...config,
});
/** 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. */
export const coreNumericInvariant = <P extends string>(
config: Omit<CoreNumericInvariantGuardConfig, 'port'> & { port: P },
): TypedGuard<P> => ({
kind: 'core.numericInvariant',
...config,
});