Function createSimpleArvoContract

Creates an ArvoContract with standardized naming conventions and a simplified event pattern. Use this to create contracts with one emit type only.

If any of the validations in ArvoContract or createArvoContract fail

const contract = createSimpleArvoContract({
uri: 'api.example/contracts/user',
type: 'user.create',
description: 'User creation contract',
versions: {
'1.0.0': {
accepts: z.object({
name: z.string(),
email: z.string().email()
}),
emits: z.object({
userId: z.string(),
timestamp: z.date()
})
}
}
});

Provides a simplified contract creation pattern with standardized conventions:

  • Automatically prefixes accept types with "com."
  • Creates a single emit type with "evt." prefix and ".success" suffix
  • Adds standard metadata identifying it as a SimpleArvoContract