From a41a3f478701d03f58886ffe371e5667aafeacab Mon Sep 17 00:00:00 2001 From: Kuldeep Date: Sun, 24 May 2026 08:00:54 +0000 Subject: [PATCH] Make locktime a string as well and add variable property in the action requirements --- package-lock.json | 30 +++++++++++++++--------------- source/template/schemas.ts | 12 ++++++++---- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/package-lock.json b/package-lock.json index f780fe0..c375ee2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3396,9 +3396,9 @@ } }, "node_modules/body-parser": { - "version": "1.20.4", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.4.tgz", - "integrity": "sha512-ZTgYYLMOXY9qKU/57FAo8F+HA2dGX7bqGc71txDRC1rS4frdFI5R7NhluHxH6M0YItAP0sHB4uqAOcYKxO6uGA==", + "version": "1.20.5", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.5.tgz", + "integrity": "sha512-3grm+/2tUOvu2cjJkvsIxrv/wVpfXQW4PsQHYm7yk4vfpu7Ekl6nEsYBoJUL6qDwZUx8wUhQ8tR2qz+ad9c9OA==", "dev": true, "license": "MIT", "dependencies": { @@ -3410,7 +3410,7 @@ "http-errors": "~2.0.1", "iconv-lite": "~0.4.24", "on-finished": "~2.4.1", - "qs": "~6.14.0", + "qs": "~6.15.1", "raw-body": "~2.5.3", "type-is": "~1.6.18", "unpipe": "~1.0.0" @@ -3464,9 +3464,9 @@ } }, "node_modules/brace-expansion": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz", - "integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", + "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", "dev": true, "license": "MIT", "dependencies": { @@ -5686,15 +5686,15 @@ } }, "node_modules/express": { - "version": "4.22.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.22.1.tgz", - "integrity": "sha512-F2X8g9P1X7uCPZMA3MVf9wcTqlyNp7IhH5qPCI0izhaOIYXaW9L535tGA3qmjRzpH+bZczqq7hVKxTR4NWnu+g==", + "version": "4.22.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.22.2.tgz", + "integrity": "sha512-IuL+Elrou2ZvCFHs18/CIzy2Nzvo25nZ1/D2eIZlz7c+QUayAcYoiM2BthCjs+EBHVpjYjcuLDAiCWgeIX3X1Q==", "dev": true, "license": "MIT", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "~1.20.3", + "body-parser": "~1.20.5", "content-disposition": "~0.5.4", "content-type": "~1.0.4", "cookie": "~0.7.1", @@ -5713,7 +5713,7 @@ "parseurl": "~1.3.3", "path-to-regexp": "~0.1.12", "proxy-addr": "~2.0.7", - "qs": "~6.14.0", + "qs": "~6.15.1", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", "send": "~0.19.0", @@ -8318,9 +8318,9 @@ } }, "node_modules/qs": { - "version": "6.14.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.2.tgz", - "integrity": "sha512-V/yCWTTF7VJ9hIh18Ugr2zhJMP01MY7c5kh4J870L7imm6/DIzBsNLTXzMwUA3yZ5b/KBqLx8Kp3uRvd7xSe3Q==", + "version": "6.15.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.2.tgz", + "integrity": "sha512-Rzq0KEyX/w/tEybncDgdkZrJgVUsUMk3xjh3t5bv3S1HTAtg+uOYt72+ZfwiQwKdysThkTBdL/rTi6HDmX9Ddw==", "dev": true, "license": "BSD-3-Clause", "dependencies": { diff --git a/source/template/schemas.ts b/source/template/schemas.ts index 747675e..28913f8 100644 --- a/source/template/schemas.ts +++ b/source/template/schemas.ts @@ -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