Make locktime a string as well and add variable property in the action requirements
This commit is contained in:
@@ -83,13 +83,13 @@ export const satoshisSchema = z.bigint().describe('A satoshi amount expressed as
|
||||
// ============================================================
|
||||
|
||||
/** Maximum character length for name fields on view properties. */
|
||||
export const VIEW_PROPERTIES_NAME_MAX_LENGTH = 200;
|
||||
export const VIEW_PROPERTIES_NAME_MAX_LENGTH = 1000;
|
||||
|
||||
/** Maximum character length for description fields on view properties. */
|
||||
export const VIEW_PROPERTIES_DESCRIPTION_MAX_LENGTH = 5000;
|
||||
|
||||
/** Maximum character length for icon fields on view properties. */
|
||||
export const VIEW_PROPERTIES_ICON_MAX_LENGTH = 50;
|
||||
export const VIEW_PROPERTIES_ICON_MAX_LENGTH = 1000;
|
||||
|
||||
/**
|
||||
* Validation schema for view properties shared across many template elements i.e. name, description, icon.
|
||||
@@ -314,7 +314,7 @@ export const xoTemplateRoleSlotSchema = z
|
||||
* {
|
||||
* "actions": {
|
||||
* "[id]": {
|
||||
* "requirements": { "participants": [], "secrets": [] } ← this schema
|
||||
* "requirements": { "variables": [], "participants": [], "secrets": [] } ← this schema
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
@@ -322,6 +322,7 @@ export const xoTemplateRoleSlotSchema = z
|
||||
*/
|
||||
export const xoTemplateActionRequirementsSchema = z
|
||||
.object({
|
||||
variables: z.array(z.string()).optional().describe('List of variable identifiers required for this action.'),
|
||||
participants: z.array(xoTemplateRoleSlotSchema).optional().describe('The participants required for this action.'),
|
||||
secrets: z.array(z.string()).optional().describe('The secrets required for this action.'),
|
||||
})
|
||||
@@ -700,7 +701,10 @@ export const xoTemplateTransactionRoleDataSchema = xoTemplateViewPropertiesSchem
|
||||
export const xoTemplateTransactionSchema = xoTemplateViewPropertiesSchema
|
||||
.extend({
|
||||
version: z.number().optional().describe('The version of the transaction.'),
|
||||
locktime: z.number().optional().describe('The locktime for this transaction.'),
|
||||
locktime: z
|
||||
.union([ z.number(), z.string() ])
|
||||
.optional()
|
||||
.describe('The locktime for this transaction as a specific number or a CashASM expression.'),
|
||||
inputs: z.array(xoTemplateTransactionInputSchema).describe('The inputs for this transaction.'),
|
||||
outputs: z.array(xoTemplateTransactionOutputSchema).describe('The outputs for this transaction.'),
|
||||
roles: z
|
||||
|
||||
Reference in New Issue
Block a user