@xo-cash/types 0.0.5 → 0.0.6-development.16436855937
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +9 -20
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +4 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -4
package/dist/index.d.mts
CHANGED
|
@@ -73,26 +73,15 @@ declare const XOTemplateLockingTypes: {
|
|
|
73
73
|
*/
|
|
74
74
|
type XOTemplateLockingType = ValueOf<typeof XOTemplateLockingTypes>;
|
|
75
75
|
/**
|
|
76
|
-
* Values for
|
|
76
|
+
* Values for primitive types declared in an XO template.
|
|
77
77
|
* Used by constants, variables, and data fields.
|
|
78
78
|
*/
|
|
79
|
-
declare const
|
|
79
|
+
declare const XOTemplatePrimitiveTypes: {
|
|
80
80
|
readonly BOOLEAN: "boolean";
|
|
81
81
|
readonly BYTES: "bytes";
|
|
82
82
|
readonly INTEGER: "integer";
|
|
83
83
|
readonly BIGINT: "bigint";
|
|
84
84
|
readonly STRING: "string";
|
|
85
|
-
};
|
|
86
|
-
/**
|
|
87
|
-
* The base types that can be declared in an XO template.
|
|
88
|
-
* Used by constants, variables, and data fields.
|
|
89
|
-
*/
|
|
90
|
-
type XOTemplateBaseType = ValueOf<typeof XOTemplateBaseTypes>;
|
|
91
|
-
/**
|
|
92
|
-
* Values for primitive types declared in an XO template.
|
|
93
|
-
* Used by constants, variables, and data fields.
|
|
94
|
-
*/
|
|
95
|
-
declare const XOTemplatePrimitiveTypes: {
|
|
96
85
|
readonly PRIVATE_KEY: "private_key";
|
|
97
86
|
readonly PUBLIC_KEY: "public_key";
|
|
98
87
|
readonly EXTENDED_PUBLIC_KEY: "extended_public_key";
|
|
@@ -597,7 +586,7 @@ type XOTemplateConstant = XOTemplateViewProperties & {
|
|
|
597
586
|
/**
|
|
598
587
|
* The data type of this constant.
|
|
599
588
|
*/
|
|
600
|
-
type:
|
|
589
|
+
type: XOTemplatePrimitiveType;
|
|
601
590
|
/**
|
|
602
591
|
* The value of this constant.
|
|
603
592
|
*/
|
|
@@ -605,7 +594,7 @@ type XOTemplateConstant = XOTemplateViewProperties & {
|
|
|
605
594
|
/**
|
|
606
595
|
* An optional hint to help apps and users understand what this constant represents.
|
|
607
596
|
*/
|
|
608
|
-
hint?:
|
|
597
|
+
hint?: unknown;
|
|
609
598
|
};
|
|
610
599
|
/**
|
|
611
600
|
* An import default value intent. Extends the base intent with optional view
|
|
@@ -620,11 +609,11 @@ type XOTemplateVariable = XOTemplateViewProperties & {
|
|
|
620
609
|
/**
|
|
621
610
|
* The data type of this variable.
|
|
622
611
|
*/
|
|
623
|
-
type?:
|
|
612
|
+
type?: XOTemplatePrimitiveType;
|
|
624
613
|
/**
|
|
625
614
|
* A hint to help users understand what value to provide.
|
|
626
615
|
*/
|
|
627
|
-
hint?:
|
|
616
|
+
hint?: unknown;
|
|
628
617
|
/**
|
|
629
618
|
* A neutral intent that the engine uses to populate the default value for this variable.
|
|
630
619
|
* View properties (name, description, icon) may contain CashASM expressions that the
|
|
@@ -641,7 +630,7 @@ type XOTemplateData = {
|
|
|
641
630
|
/**
|
|
642
631
|
* The data type of this data field.
|
|
643
632
|
*/
|
|
644
|
-
type:
|
|
633
|
+
type: XOTemplatePrimitiveType;
|
|
645
634
|
/**
|
|
646
635
|
* The value for this data field.
|
|
647
636
|
*/
|
|
@@ -649,7 +638,7 @@ type XOTemplateData = {
|
|
|
649
638
|
/**
|
|
650
639
|
* An optional hint to help apps and users understand this data field.
|
|
651
640
|
*/
|
|
652
|
-
hint?:
|
|
641
|
+
hint?: unknown;
|
|
653
642
|
};
|
|
654
643
|
/**
|
|
655
644
|
* An icon reference in the template.
|
|
@@ -1324,5 +1313,5 @@ type XOInvitation = {
|
|
|
1324
1313
|
result?: XOInvitationResult;
|
|
1325
1314
|
};
|
|
1326
1315
|
//#endregion
|
|
1327
|
-
export { BchVmVersion, BchVmVersions, FungibleTokenAmount, Satoshis, ValueOf, XOInvitation, XOInvitationActionReference, XOInvitationCommit, XOInvitationCommitData, XOInvitationCommitDataItemIndex, XOInvitationCommitIdentifier, XOInvitationDataResult, XOInvitationEntityIdentifier, XOInvitationIdentifier, XOInvitationInput, XOInvitationMemo, XOInvitationMergesWithReference, XOInvitationOutput, XOInvitationRequirements, XOInvitationResult, XOInvitationRoleRequirement, XOInvitationSignature, XOInvitationTimestamp, XOInvitationTransactionBroadcastDetails, XOInvitationTransactionHash, XOInvitationTransactionInputIndex, XOInvitationTransactionLocktime, XOInvitationTransactionOutputIndex, XOInvitationTransactionResult, XOInvitationTransactionVersion, XOInvitationVariable, XOInvitationVariableValue, XOTemplate, XOTemplateAction, XOTemplateActionIdentifier, XOTemplateActionIntent, XOTemplateActionRequirements, XOTemplateActionRole, XOTemplateActionRoleRequirements, XOTemplateAssetAmounts,
|
|
1316
|
+
export { BchVmVersion, BchVmVersions, FungibleTokenAmount, Satoshis, ValueOf, XOInvitation, XOInvitationActionReference, XOInvitationCommit, XOInvitationCommitData, XOInvitationCommitDataItemIndex, XOInvitationCommitIdentifier, XOInvitationDataResult, XOInvitationEntityIdentifier, XOInvitationIdentifier, XOInvitationInput, XOInvitationMemo, XOInvitationMergesWithReference, XOInvitationOutput, XOInvitationRequirements, XOInvitationResult, XOInvitationRoleRequirement, XOInvitationSignature, XOInvitationTimestamp, XOInvitationTransactionBroadcastDetails, XOInvitationTransactionHash, XOInvitationTransactionInputIndex, XOInvitationTransactionLocktime, XOInvitationTransactionOutputIndex, XOInvitationTransactionResult, XOInvitationTransactionVersion, XOInvitationVariable, XOInvitationVariableValue, XOTemplate, XOTemplateAction, XOTemplateActionIdentifier, XOTemplateActionIntent, XOTemplateActionRequirements, XOTemplateActionRole, XOTemplateActionRoleRequirements, XOTemplateAssetAmounts, XOTemplateConstant, XOTemplateConstantIdentifier, XOTemplateData, XOTemplateDataIdentifier, XOTemplateDefaults, XOTemplateIcon, XOTemplateIdentifier, XOTemplateImportDefaultValue, XOTemplateInput, XOTemplateInputIdentifier, XOTemplateIntent, XOTemplateLockingScript, XOTemplateLockingScriptIdentifier, XOTemplateLockingScriptIntent, XOTemplateLockingScriptRole, XOTemplateLockingType, XOTemplateLockingTypes, XOTemplateNftCapabilities, XOTemplateNftCapability, XOTemplateNonFungibleTokenDetails, XOTemplateOutput, XOTemplateOutputIdentifier, XOTemplateOutputIntent, XOTemplatePrimitiveType, XOTemplatePrimitiveTypes, XOTemplateResource, XOTemplateRoleIdentifier, XOTemplateRoleSlot, XOTemplateRoleSlotsRequirements, XOTemplateScriptIdentifier, XOTemplateSecretIdentifier, XOTemplateState, XOTemplateToken, XOTemplateTransaction, XOTemplateTransactionIdentifier, XOTemplateTransactionInput, XOTemplateTransactionOutput, XOTemplateTransactionRoleData, XOTemplateVariable, XOTemplateVariableIdentifier, XOTemplateViewProperties };
|
|
1328
1317
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../source/utilities.ts","../source/template.ts","../source/invitation.ts"],"mappings":";;;;;;AAgBA;;;;;;;;;;;;ACPA;KDOY,OAAA,MAAa,CAAA,OAAQ,CAAA;;;;;AAAjC;KCPY,QAAA;;;;KAKA,mBAAA;;;;cAKC,aAAA;EAAA;;;;;;;;;;;KAaD,YAAA,GAAe,OAAA,QAAe,aAAA;AAb1C;;;AAAA,cAkBa,yBAAA;EAAA;;;;;;;;;AALb;KAiBY,uBAAA,GAA0B,OAAA,QAAe,yBAAA;;;;cAKxC,sBAAA;EAAA;;;;;;;;KAUD,qBAAA,GAAwB,OAAA,QAAe,sBAAA;;;;;cAMtC,
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../source/utilities.ts","../source/template.ts","../source/invitation.ts"],"mappings":";;;;;;AAgBA;;;;;;;;;;;;ACPA;KDOY,OAAA,MAAa,CAAA,OAAQ,CAAA;;;;;AAAjC;KCPY,QAA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AA;AAAA;;;;;;;;;;;;;;ADmG5C;;;;;;;;;;;;;KCtEY,YAAA;ED2ER;;;ECtEA,oBAAA,EAAsB,sBAAA;EDkFR;;;EC7Ed,kBAAA,EAAoB,qBAAA;EDuFpB;;;EClFA,kBAAA,EAAoB,oBAAA;EDuFpB;;;EClFA,gBAAA,EAAkB,0BAAA;ED4FQ;;;ECvF1B,OAAA,EAAS,kBAAA;ED4FT;;;ECvFA,MAAA,GAAS,kBAAA;AAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -28,21 +28,15 @@ const XOTemplateLockingTypes = {
|
|
|
28
28
|
P2SH: "p2sh"
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
|
-
* Values for
|
|
31
|
+
* Values for primitive types declared in an XO template.
|
|
32
32
|
* Used by constants, variables, and data fields.
|
|
33
33
|
*/
|
|
34
|
-
const
|
|
34
|
+
const XOTemplatePrimitiveTypes = {
|
|
35
35
|
BOOLEAN: "boolean",
|
|
36
36
|
BYTES: "bytes",
|
|
37
37
|
INTEGER: "integer",
|
|
38
38
|
BIGINT: "bigint",
|
|
39
|
-
STRING: "string"
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Values for primitive types declared in an XO template.
|
|
43
|
-
* Used by constants, variables, and data fields.
|
|
44
|
-
*/
|
|
45
|
-
const XOTemplatePrimitiveTypes = {
|
|
39
|
+
STRING: "string",
|
|
46
40
|
PRIVATE_KEY: "private_key",
|
|
47
41
|
PUBLIC_KEY: "public_key",
|
|
48
42
|
EXTENDED_PUBLIC_KEY: "extended_public_key",
|
|
@@ -60,5 +54,5 @@ const XOTemplatePrimitiveTypes = {
|
|
|
60
54
|
};
|
|
61
55
|
|
|
62
56
|
//#endregion
|
|
63
|
-
export { BchVmVersions,
|
|
57
|
+
export { BchVmVersions, XOTemplateLockingTypes, XOTemplateNftCapabilities, XOTemplatePrimitiveTypes };
|
|
64
58
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../source/template.ts"],"sourcesContent":["import type { ValueOf } from './utilities.ts';\n\n// ============================================================\n// Base types\n// ============================================================\n\n/**\n * Type for satoshis.\n */\nexport type Satoshis = bigint;\n\n/**\n * A fungible token amount.\n */\nexport type FungibleTokenAmount = bigint;\n\n/**\n * Values for BCH VM versions that an XO template can declare support for.\n */\nexport const BchVmVersions = {\n BCH_2020_05: 'BCH_2020_05',\n BCH_2021_05: 'BCH_2021_05',\n BCH_2022_05: 'BCH_2022_05',\n BCH_2023_05: 'BCH_2023_05',\n BCH_2024_05: 'BCH_2024_05',\n BCH_2025_05: 'BCH_2025_05',\n BCH_2026_05: 'BCH_2026_05',\n} as const;\n\n/**\n * The set of BCH VM versions that an XO template can declare support for.\n */\nexport type BchVmVersion = ValueOf<typeof BchVmVersions>;\n\n/**\n * Values for NFT capability on template token fields.\n */\nexport const XOTemplateNftCapabilities = {\n NONE: 'none',\n MUTABLE: 'mutable',\n MINTING: 'minting',\n} as const;\n\n/**\n * The capability of a non-fungible token.\n * `minting` can create new NFTs of the same category.\n * `mutable` can update its own commitment data.\n * `none` means the commitment is immutable.\n */\nexport type XOTemplateNftCapability = ValueOf<typeof XOTemplateNftCapabilities>;\n\n/**\n * Values for XO template locking script types.\n */\nexport const XOTemplateLockingTypes = {\n P2S: 'p2s',\n P2PKH: 'p2pkh',\n P2SH: 'p2sh',\n} as const;\n\n/**\n * The standard locking script types supported by XO.\n *\n */\nexport type XOTemplateLockingType = ValueOf<typeof XOTemplateLockingTypes>;\n\n/**\n * Values for base types declared in an XO template.\n * Used by constants, variables, and data fields.\n */\nexport const XOTemplateBaseTypes = {\n BOOLEAN: 'boolean',\n BYTES: 'bytes',\n INTEGER: 'integer',\n BIGINT: 'bigint',\n STRING: 'string',\n} as const;\n\n/**\n * The base types that can be declared in an XO template.\n * Used by constants, variables, and data fields.\n */\nexport type XOTemplateBaseType = ValueOf<typeof XOTemplateBaseTypes>;\n\n/**\n * Values for primitive types declared in an XO template.\n * Used by constants, variables, and data fields.\n */\nexport const XOTemplatePrimitiveTypes = {\n PRIVATE_KEY: 'private_key',\n PUBLIC_KEY: 'public_key',\n EXTENDED_PUBLIC_KEY: 'extended_public_key',\n SATOSHIS: 'satoshis',\n FUNGIBLE_TOKEN_AMOUNT: 'token_amount',\n NON_FUNGIBLE_TOKEN_CAPABILITY: 'token_capability',\n NON_FUNGIBLE_TOKEN_COMMITMENT: 'token_commitment',\n TIMESTAMP: 'timestamp',\n TOKEN_CATEGORY: 'token_category',\n NFT_COMMITMENT: 'nft_commitment',\n LOCKING_SCRIPT: 'locking_script',\n TRANSACTION_HASH: 'transaction_hash',\n TEMPLATE_IDENTIFIER: 'template_identifier',\n SCHNORR_SIGNATURE: 'signature',\n} as const;\n\n/**\n * The primitive types that can be declared in an XO template.\n * Used by constants, variables, and data fields.\n */\nexport type XOTemplatePrimitiveType = ValueOf<typeof XOTemplatePrimitiveTypes>;\n\n// ============================================================\n// Identifier Types\n// ============================================================\n\n/** Identifies a role defined in the template's roles. */\nexport type XOTemplateRoleIdentifier = string;\n\n/** Identifies an action defined in the template's actions. */\nexport type XOTemplateActionIdentifier = string;\n\n/** Identifies an input defined in the template's inputs. */\nexport type XOTemplateInputIdentifier = string;\n\n/** Identifies an output defined in the template's outputs. */\nexport type XOTemplateOutputIdentifier = string;\n\n/** Identifies a locking script defined in the template's lockingScripts. */\nexport type XOTemplateLockingScriptIdentifier = string;\n\n/** Identifies a script defined in the template's scripts. */\nexport type XOTemplateScriptIdentifier = string;\n\n/** Identifies a transaction defined in the template's transactions. */\nexport type XOTemplateTransactionIdentifier = string;\n\n/** Identifies a variable defined in the template's variables. */\nexport type XOTemplateVariableIdentifier = string;\n\n/** Identifies a constant defined in the template's constants. */\nexport type XOTemplateConstantIdentifier = string;\n\n/** Identifies a data field defined in the template's data. */\nexport type XOTemplateDataIdentifier = string;\n\n/** Identifies a secret defined in a role or action's secrets list. */\nexport type XOTemplateSecretIdentifier = string;\n\n/** Identifier for an XO template. */\nexport type XOTemplateIdentifier = string;\n\n// ============================================================\n// View Properties\n// ============================================================\n\n/**\n * Human-readable display properties shared by most template elements.\n */\nexport type XOTemplateViewProperties = {\n\n /**\n * A short human-readable label for this element.\n */\n name: string;\n\n /**\n * A human-readable explanation of what this element does and when it is relevant.\n */\n description: string;\n\n /**\n * An optional icon identifier.\n */\n icon?: string;\n};\n\n// ============================================================\n// Intents\n// ============================================================\n\n/**\n * The base intent structure. Describes the common data parameters shared by all intent types\n * regardless of what they target. An optional templateIdentifier allows the intent to reference\n * a target defined in a different template.\n */\nexport type XOTemplateIntent = {\n\n /**\n * Optional identifier for the template used in this intent. If not provided, uses the current template.\n */\n templateIdentifier?: XOTemplateIdentifier;\n\n /**\n * Identifiers for items to generate when this intent is resolved (e.g. keys or secrets).\n */\n generate?: Array<string>;\n\n /**\n * Variable values to apply when this intent is resolved.\n */\n variables?: Array<Record<XOTemplateVariableIdentifier, unknown>>;\n\n /**\n * Constant values to apply when this intent is resolved.\n */\n constants?: Array<Record<XOTemplateConstantIdentifier, unknown>>;\n\n /**\n * Secret values to apply when this intent is resolved.\n */\n secrets?: Array<Record<XOTemplateSecretIdentifier, unknown>>;\n\n /**\n * Optional identifier for the role used in this intent.\n */\n role?: XOTemplateRoleIdentifier;\n};\n\n/**\n * An intent that targets a specific action.\n */\nexport type XOTemplateActionIntent = XOTemplateIntent & {\n\n /**\n * The identifier for the intended action.\n */\n action: XOTemplateActionIdentifier;\n};\n\n/**\n * An intent that targets a specific output.\n */\nexport type XOTemplateOutputIntent = XOTemplateIntent & {\n\n /**\n * The identifier for the intended output.\n */\n output: XOTemplateOutputIdentifier;\n};\n\n/**\n * An intent that targets a specific locking script.\n */\nexport type XOTemplateLockingScriptIntent = XOTemplateIntent & {\n\n /**\n * The identifier for the intended locking script.\n */\n lockingScript: XOTemplateLockingScriptIdentifier;\n};\n\n// ============================================================\n// Actions\n// ============================================================\n\n/**\n * Requirements for a specific role within an action. Describes what data or secrets\n * the role must provide when participating.\n */\nexport type XOTemplateActionRoleRequirements = {\n\n /**\n * List of variable identifiers required for this role.\n */\n variables?: Array<XOTemplateVariableIdentifier>;\n\n /**\n * List of secret identifiers required for this role.\n */\n secrets?: Array<XOTemplateSecretIdentifier>;\n};\n\n/**\n * A role specific definition within an action.\n */\nexport type XOTemplateActionRole = Partial<XOTemplateViewProperties> & {\n\n /**\n * Identifiers for data items that should be generated for this role\n * when participating in the action.\n */\n generate?: Array<string>;\n\n /**\n * The requirements for this role within this action.\n */\n requirements?: XOTemplateActionRoleRequirements;\n};\n\n/**\n * Slot configuration for a role. Declares how many participants of a given\n * role are needed to satisfy the action's requirements.\n */\nexport type XOTemplateRoleSlotsRequirements = {\n\n /**\n * Minimum number of participants required for this role.\n */\n min: number;\n\n /**\n * Maximum number of participants allowed for this role. Undefined means unlimited.\n */\n max?: number;\n};\n\n/**\n * A role entry in an action's requirements block.\n * Declares which role must participate and how many slots are needed.\n */\nexport type XOTemplateRoleSlot = {\n\n /**\n * The role identifier that this requirement applies to.\n */\n role: XOTemplateRoleIdentifier;\n\n /**\n * Slot configuration specifying how many participants of this role are required.\n */\n slots: XOTemplateRoleSlotsRequirements;\n};\n\n/**\n * Requirements for an action. Declares which roles must participate and what secrets must be available.\n */\nexport type XOTemplateActionRequirements = {\n\n /**\n * List of variable identifiers required for this action.\n */\n variables?: Array<XOTemplateVariableIdentifier>;\n\n /**\n * The participants required for this action.\n */\n participants?: Array<XOTemplateRoleSlot>;\n\n /**\n * The secrets required for this action.\n */\n secrets?: Array<XOTemplateSecretIdentifier>;\n};\n\n/**\n * An action within a template.\n */\nexport type XOTemplateAction = XOTemplateViewProperties & {\n\n /**\n * Specific context for each role participating in this action.\n */\n roles?: Record<XOTemplateRoleIdentifier, XOTemplateActionRole>;\n\n /**\n * The requirements for this action.\n */\n requirements?: XOTemplateActionRequirements;\n\n /**\n * Conditions that must be met for this action to be available.\n *\n * @todo More work needs to be done on this field.\n */\n conditions?: Array<string>;\n\n /**\n * The identifier of the transaction this action produces, referencing an entry\n * in the template's transactions.\n */\n transaction?: XOTemplateTransactionIdentifier;\n\n /**\n * The identifier of the data field this action produces, referencing an entry\n * in the template's data.\n *\n * @todo More work needs to be done on this field.\n */\n data?: XOTemplateDataIdentifier;\n};\n\n// ============================================================\n// Tokens & Amounts\n// ============================================================\n\n/**\n * Non-fungible token configuration within a token field.\n */\nexport type XOTemplateNonFungibleTokenDetails = {\n\n /**\n * The capability of the NFT. May be a known capability value or a CashASM expression resolving to a capability.\n */\n capability?: XOTemplateNftCapability | string;\n\n /**\n * The commitment data for the NFT, as a string or CashASM expression resolving to a commitment.\n */\n commitment?: string;\n};\n\n/**\n * Token configuration for outputs and inputs.\n */\nexport type XOTemplateToken = {\n\n /**\n * The category of the token, as a string or CashASM expression resolving to a category.\n */\n category?: string;\n\n /**\n * The amount of fungible tokens as a bigint, a CashASM expression resolving to a bigint, or null indicating no FT is present.\n */\n amount?: bigint | string | null;\n\n /**\n * Non-fungible token configuration. Null indicates no NFT is present.\n */\n nft?: XOTemplateNonFungibleTokenDetails | null;\n};\n\n/**\n * Asset amounts configuration. Used for balance tracking on locking scripts and their roles, and for omitting change amounts.\n * All fields are optional. Values may be literal amounts or CashASM expressions resolving to amounts.\n */\nexport type XOTemplateAssetAmounts = {\n\n /**\n * The satoshi amount.\n * - `Satoshis`: A specific bigint amount.\n * - `string`: A CashASM expression that resolves to the amount.\n * - `true`: all, i.e. the entire amount\n */\n satoshis?: Satoshis | string | true;\n\n /**\n * The fungible token amount.\n * - `FungibleTokenAmount`: A specific bigint amount.\n * - `string`: A CashASM expression that resolves to the amount.\n * - `true`: all, i.e. the entire amount\n */\n fungibleTokens?: FungibleTokenAmount | string | true;\n\n /**\n * Whether a non-fungible token is present (0 for absent, 1 for present),\n * or a CashASM expression that evaluates to 0 or 1.\n * - `true`: resolves to 1 if an NFT is present, or 0 if none is present. Use this when\n * the NFT is optional, to express that the NFT is estimated to be part of the balance\n * if present, or absent from it if not.\n * - `0`: None, i.e. nothing is expected to be included\n * - `1`: present and complete, as value > 1 does not make sense for non-fungible tokens\n * - `string`: A CashASM expression that evaluates to 0 or 1.\n */\n nonfungibleTokens?: true | 0 | 1 | string;\n};\n\n// ============================================================\n// Shared State\n// ============================================================\n\n/**\n * State configuration shared by a locking script and its individual roles.\n * Declares which variables and secrets are tracked in the on-chain state for that participant.\n */\nexport type XOTemplateState = {\n\n /**\n * List of variable identifiers to track in state.\n */\n variables?: Array<XOTemplateVariableIdentifier>;\n\n /**\n * List of secret identifiers to track in state.\n */\n secrets?: Array<XOTemplateSecretIdentifier>;\n};\n\n// ============================================================\n// Locking Scripts\n// ============================================================\n\n/**\n * A role definition within a locking script.\n */\nexport type XOTemplateLockingScriptRole = Partial<XOTemplateViewProperties> & {\n\n /**\n * List of items to track as state for this role.\n */\n state?: XOTemplateState;\n\n /**\n * List of action references available to this role.\n */\n actions?: Array<XOTemplateActionIntent>;\n\n /**\n * Estimated ownership in the optional set of asset amounts specified.\n */\n balance?: Partial<XOTemplateAssetAmounts>;\n\n /**\n * Whether outputs locked to this script should be available for coin selection.\n */\n selectable?: boolean;\n\n /**\n * Whether this output or locking script should be tracked by the engine.\n * When omitted, the engine treats this field as true.\n * - `true`: Include it.\n * - `false`: Exclude it.\n * - `string`: A CashASM expression that evaluates to a boolean relevance value.\n */\n relevant?: boolean | string;\n\n /**\n * Privacy level for outputs locked to this script.\n * - `number`: A numeric privacy level.\n * - `string`: A CashASM expression that evaluates to a privacy level.\n */\n privacy?: number | string;\n};\n\n/**\n * A locking script definition in the template.\n */\nexport type XOTemplateLockingScript = XOTemplateViewProperties & {\n\n /**\n * The type of locking mechanism. Defaults to 'p2s' if not specified.\n */\n lockingType?: XOTemplateLockingType;\n\n /**\n * The locking script bytecode.\n */\n lockingBytecode: string;\n\n /**\n * Optional default unlocking bytecode when used in automatic coin selection.\n */\n unlockingBytecode?: string;\n\n /**\n * The actions available for this locking script.\n */\n actions?: Array<XOTemplateActionIntent>;\n\n /**\n * List of items to track as state for all participants.\n */\n state?: XOTemplateState;\n\n /**\n * Estimated ownership in the optional set of asset amounts specified.\n */\n balance?: Partial<XOTemplateAssetAmounts>;\n\n /**\n * Whether outputs locked to this script should be available for coin selection.\n */\n selectable?: boolean;\n\n /**\n * Privacy level for outputs locked to this script.\n * - `number`: A numeric privacy level.\n * - `string`: A CashASM expression that evaluates to a privacy level.\n */\n privacy?: number | string;\n\n /**\n * Specific context for each role participating in this locking script.\n */\n roles?: Record<XOTemplateRoleIdentifier, XOTemplateLockingScriptRole>;\n};\n\n// ============================================================\n// Inputs\n// ============================================================\n\n/**\n * An input definition in the template.\n */\nexport type XOTemplateInput = XOTemplateViewProperties & {\n\n /**\n * The amount of satoshis for this input.\n * - `Satoshis`: A specific amount of satoshis.\n * - `string`: A CashASM expression that resolves to the satoshi amount.\n */\n valueSatoshis?: Satoshis | string;\n\n /**\n * Token configuration for this input.\n */\n token?: XOTemplateToken | null;\n\n /**\n * The sequence number of this input.\n * - `number`: A specific sequence number.\n * - `string`: A CashASM expression that resolves to the sequence number.\n */\n sequenceNumber?: number | string;\n\n /**\n * Identifier of the unlocking script to use for the UTXO provided for this input.\n */\n unlockingScript?: string;\n\n /**\n * Amount of change that should be omitted from the automatic change handling. WARNING: Setting this can result in loss of funds!\n */\n omitChangeAmounts?: XOTemplateAssetAmounts;\n};\n\n// ============================================================\n// Outputs\n// ============================================================\n\n/**\n * An output definition in the template. Inherits all fields from `XOTemplateLockingScript`\n * except `lockingType`, `lockingBytecode` and `unlockingBytecode`: outputs reference a locking script by identifier\n * rather than defining one inline, so repeating any of these fields here would create an ambiguity\n * about which declaration takes precedence.\n */\nexport type XOTemplateOutput = Omit<XOTemplateLockingScript, 'lockingType' | 'lockingBytecode' | 'unlockingBytecode'> & {\n\n /**\n * Identifier of the locking script to use for this output.\n */\n lockingScript: XOTemplateLockingScriptIdentifier;\n\n /**\n * The amount of satoshis for this output.\n * - `Satoshis`: A specific amount of satoshis.\n * - `string`: A CashASM expression that resolves to the satoshi amount.\n */\n valueSatoshis?: Satoshis | string;\n\n /**\n * Token configuration for this output.\n */\n token?: XOTemplateToken | null;\n};\n\n// ============================================================\n// Transactions\n// ============================================================\n\n/**\n * Reference to an input in a transaction definition in the template.\n */\nexport type XOTemplateTransactionInput = {\n\n /**\n * The input definition identifier.\n */\n input: XOTemplateInputIdentifier;\n\n /**\n * Optional index of this input in the transaction.\n */\n inputIndex?: number;\n};\n\n/**\n * Reference to an output in a transaction definition in the template.\n */\nexport type XOTemplateTransactionOutput = {\n\n /**\n * The output definition identifier.\n */\n output: XOTemplateOutputIdentifier;\n\n /**\n * Optional index of this output in the transaction.\n */\n outputIndex?: number;\n};\n\n/**\n * Role-specific data for a transaction within a template.\n */\nexport type XOTemplateTransactionRoleData = Partial<XOTemplateViewProperties> & {\n\n /**\n * The inputs required for this role.\n */\n inputs?: Array<XOTemplateTransactionInput>;\n\n /**\n * The outputs required for this role.\n */\n outputs?: Array<XOTemplateTransactionOutput>;\n};\n\n/**\n * A transaction template definition.\n */\nexport type XOTemplateTransaction = XOTemplateViewProperties & {\n\n /**\n * The version of the transaction.\n */\n version?: number;\n\n /**\n * The locktime for this transaction.\n * - `number`: A specific locktime value.\n * - `string`: A CashASM expression that resolves to the locktime.\n */\n locktime?: number | string;\n\n /**\n * The inputs for this transaction.\n */\n inputs: Array<XOTemplateTransactionInput>;\n\n /**\n * The outputs for this transaction.\n */\n outputs: Array<XOTemplateTransactionOutput>;\n\n /**\n * Specific context for each role participating in this transaction.\n */\n roles?: Record<XOTemplateRoleIdentifier, XOTemplateTransactionRoleData>;\n\n /**\n * Whether this transaction can be composed with other transactions.\n */\n composable?: boolean;\n};\n\n// ============================================================\n// Template Data\n// ============================================================\n\n/**\n * A constant value definition in the template.\n */\nexport type XOTemplateConstant = XOTemplateViewProperties & {\n\n /**\n * The data type of this constant.\n */\n type: XOTemplateBaseType;\n\n /**\n * The value of this constant.\n */\n value: unknown;\n\n /**\n * An optional hint to help apps and users understand what this constant represents.\n */\n hint?: XOTemplatePrimitiveType;\n};\n\n/**\n * An import default value intent. Extends the base intent with optional view\n * properties that the engine evaluates at runtime to produce human-readable output.\n * The engine overrides whatever values are set here when resolving the target for a participant.\n */\nexport type XOTemplateImportDefaultValue = XOTemplateIntent & Partial<XOTemplateViewProperties>;\n\n/**\n * A variable definition in the template.\n */\nexport type XOTemplateVariable = XOTemplateViewProperties & {\n\n /**\n * The data type of this variable.\n */\n type?: XOTemplateBaseType;\n\n /**\n * A hint to help users understand what value to provide.\n */\n hint?: XOTemplatePrimitiveType;\n\n /**\n * A neutral intent that the engine uses to populate the default value for this variable.\n * View properties (name, description, icon) may contain CashASM expressions that the\n * engine evaluates at runtime to produce human-readable output.\n */\n importDefaultValue?: XOTemplateImportDefaultValue;\n};\n\n/**\n * A data field definition in the template.\n *\n * @todo More work needs to be done on this type.\n */\nexport type XOTemplateData = {\n\n /**\n * The data type of this data field.\n */\n type: XOTemplateBaseType;\n\n /**\n * The value for this data field.\n */\n value: unknown;\n\n /**\n * An optional hint to help apps and users understand this data field.\n */\n hint?: XOTemplatePrimitiveType;\n};\n\n// ============================================================\n// Template Resources\n// ============================================================\n\n/**\n * An icon reference in the template.\n */\nexport type XOTemplateIcon = {\n\n /**\n * A name for this icon.\n */\n name: string;\n\n /**\n * The identifier of the icon.\n */\n hash: string;\n};\n\n/**\n * A resource reference attached to a template. Extends view properties with a URL\n * pointing to external documentation or tooling.\n */\nexport type XOTemplateResource = XOTemplateViewProperties & {\n\n /**\n * The URL for this resource.\n */\n url: string;\n};\n\n// ============================================================\n// Template\n// ============================================================\n\n/**\n * Default settings applied across the template when no explicit per-action overrides are given.\n */\nexport type XOTemplateDefaults = {\n\n /**\n * Instructions for how to construct automated change output.\n */\n change?: XOTemplateOutputIntent;\n};\n\n/**\n * The XO Template.\n */\nexport type XOTemplate = XOTemplateViewProperties & {\n\n /**\n * The URI that identifies the JSON Schema used by this template.\n * This enables documentation, autocompletion, and validation in JSON documents.\n */\n $schema: string;\n\n /**\n * A string identifying the version of this template.\n */\n version?: string;\n\n /**\n * The BCH VM versions that this template supports. At least one version is required.\n */\n supported: Array<BchVmVersion>;\n\n /**\n * Optional default settings used in this template.\n */\n defaults?: XOTemplateDefaults;\n\n /**\n * The roles defined in this template.\n */\n roles: Record<XOTemplateRoleIdentifier, XOTemplateViewProperties>;\n\n /**\n * A list of entry points defining which actions are available at the start.\n */\n start: Array<XOTemplateActionIntent>;\n\n /**\n * The actions defined in this template.\n */\n actions: Record<XOTemplateActionIdentifier, XOTemplateAction>;\n\n /**\n * The data fields defined in this template.\n */\n data?: Record<XOTemplateDataIdentifier, XOTemplateData>;\n\n /**\n * The transaction templates defined in this template.\n */\n transactions?: Record<XOTemplateTransactionIdentifier, XOTemplateTransaction>;\n\n /**\n * The inputs defined in this template.\n */\n inputs: Record<XOTemplateInputIdentifier, XOTemplateInput>;\n\n /**\n * The outputs defined in this template.\n */\n outputs: Record<XOTemplateOutputIdentifier, XOTemplateOutput>;\n\n /**\n * The locking script templates defined in this template.\n */\n lockingScripts: Record<XOTemplateLockingScriptIdentifier, XOTemplateLockingScript>;\n\n /**\n * The scripts used in this template, The keys are identifiers of the scripts and\n * the values are the bytecode or cashASM expressions.\n */\n scripts: Record<XOTemplateScriptIdentifier, string>;\n\n /**\n * The constants defined in this template.\n */\n constants?: Record<XOTemplateConstantIdentifier, XOTemplateConstant>;\n\n /**\n * The variables that must be provided for use in the template's scripts.\n */\n variables?: Record<XOTemplateVariableIdentifier, XOTemplateVariable>;\n\n /**\n * Resource references providing external documentation or tooling links.\n */\n resources?: Array<XOTemplateResource>;\n\n /**\n * The icons available for use throughout the template.\n */\n icons?: Array<XOTemplateIcon>;\n\n /**\n * The scenarios defined in this template.\n */\n scenarios?: unknown;\n};\n"],"mappings":";;;;AAmBA,MAAa,gBAAgB;CACzB,aAAa;CACb,aAAa;CACb,aAAa;CACb,aAAa;CACb,aAAa;CACb,aAAa;CACb,aAAa;CAChB;;;;AAUD,MAAa,4BAA4B;CACrC,MAAM;CACN,SAAS;CACT,SAAS;CACZ;;;;AAaD,MAAa,yBAAyB;CAClC,KAAK;CACL,OAAO;CACP,MAAM;CACT;;;;;AAYD,MAAa,sBAAsB;CAC/B,SAAS;CACT,OAAO;CACP,SAAS;CACT,QAAQ;CACR,QAAQ;CACX;;;;;AAYD,MAAa,2BAA2B;CACpC,aAAa;CACb,YAAY;CACZ,qBAAqB;CACrB,UAAU;CACV,uBAAuB;CACvB,+BAA+B;CAC/B,+BAA+B;CAC/B,WAAW;CACX,gBAAgB;CAChB,gBAAgB;CAChB,gBAAgB;CAChB,kBAAkB;CAClB,qBAAqB;CACrB,mBAAmB;CACtB"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../source/template.ts"],"sourcesContent":["import type { ValueOf } from './utilities.ts';\n\n// ============================================================\n// Base types\n// ============================================================\n\n/**\n * Type for satoshis.\n */\nexport type Satoshis = bigint;\n\n/**\n * A fungible token amount.\n */\nexport type FungibleTokenAmount = bigint;\n\n/**\n * Values for BCH VM versions that an XO template can declare support for.\n */\nexport const BchVmVersions = {\n BCH_2020_05: 'BCH_2020_05',\n BCH_2021_05: 'BCH_2021_05',\n BCH_2022_05: 'BCH_2022_05',\n BCH_2023_05: 'BCH_2023_05',\n BCH_2024_05: 'BCH_2024_05',\n BCH_2025_05: 'BCH_2025_05',\n BCH_2026_05: 'BCH_2026_05',\n} as const;\n\n/**\n * The set of BCH VM versions that an XO template can declare support for.\n */\nexport type BchVmVersion = ValueOf<typeof BchVmVersions>;\n\n/**\n * Values for NFT capability on template token fields.\n */\nexport const XOTemplateNftCapabilities = {\n NONE: 'none',\n MUTABLE: 'mutable',\n MINTING: 'minting',\n} as const;\n\n/**\n * The capability of a non-fungible token.\n * `minting` can create new NFTs of the same category.\n * `mutable` can update its own commitment data.\n * `none` means the commitment is immutable.\n */\nexport type XOTemplateNftCapability = ValueOf<typeof XOTemplateNftCapabilities>;\n\n/**\n * Values for XO template locking script types.\n */\nexport const XOTemplateLockingTypes = {\n P2S: 'p2s',\n P2PKH: 'p2pkh',\n P2SH: 'p2sh',\n} as const;\n\n/**\n * The standard locking script types supported by XO.\n *\n */\nexport type XOTemplateLockingType = ValueOf<typeof XOTemplateLockingTypes>;\n\n/**\n * Values for primitive types declared in an XO template.\n * Used by constants, variables, and data fields.\n */\nexport const XOTemplatePrimitiveTypes = {\n BOOLEAN: 'boolean',\n BYTES: 'bytes',\n INTEGER: 'integer',\n BIGINT: 'bigint',\n STRING: 'string',\n PRIVATE_KEY: 'private_key',\n PUBLIC_KEY: 'public_key',\n EXTENDED_PUBLIC_KEY: 'extended_public_key',\n SATOSHIS: 'satoshis',\n FUNGIBLE_TOKEN_AMOUNT: 'token_amount',\n NON_FUNGIBLE_TOKEN_CAPABILITY: 'token_capability',\n NON_FUNGIBLE_TOKEN_COMMITMENT: 'token_commitment',\n TIMESTAMP: 'timestamp',\n TOKEN_CATEGORY: 'token_category',\n NFT_COMMITMENT: 'nft_commitment',\n LOCKING_SCRIPT: 'locking_script',\n TRANSACTION_HASH: 'transaction_hash',\n TEMPLATE_IDENTIFIER: 'template_identifier',\n SCHNORR_SIGNATURE: 'signature',\n} as const;\n\n/**\n * The primitive types that can be declared in an XO template.\n * Used by constants, variables, and data fields.\n */\nexport type XOTemplatePrimitiveType = ValueOf<typeof XOTemplatePrimitiveTypes>;\n\n// ============================================================\n// Identifier Types\n// ============================================================\n\n/** Identifies a role defined in the template's roles. */\nexport type XOTemplateRoleIdentifier = string;\n\n/** Identifies an action defined in the template's actions. */\nexport type XOTemplateActionIdentifier = string;\n\n/** Identifies an input defined in the template's inputs. */\nexport type XOTemplateInputIdentifier = string;\n\n/** Identifies an output defined in the template's outputs. */\nexport type XOTemplateOutputIdentifier = string;\n\n/** Identifies a locking script defined in the template's lockingScripts. */\nexport type XOTemplateLockingScriptIdentifier = string;\n\n/** Identifies a script defined in the template's scripts. */\nexport type XOTemplateScriptIdentifier = string;\n\n/** Identifies a transaction defined in the template's transactions. */\nexport type XOTemplateTransactionIdentifier = string;\n\n/** Identifies a variable defined in the template's variables. */\nexport type XOTemplateVariableIdentifier = string;\n\n/** Identifies a constant defined in the template's constants. */\nexport type XOTemplateConstantIdentifier = string;\n\n/** Identifies a data field defined in the template's data. */\nexport type XOTemplateDataIdentifier = string;\n\n/** Identifies a secret defined in a role or action's secrets list. */\nexport type XOTemplateSecretIdentifier = string;\n\n/** Identifier for an XO template. */\nexport type XOTemplateIdentifier = string;\n\n// ============================================================\n// View Properties\n// ============================================================\n\n/**\n * Human-readable display properties shared by most template elements.\n */\nexport type XOTemplateViewProperties = {\n\n /**\n * A short human-readable label for this element.\n */\n name: string;\n\n /**\n * A human-readable explanation of what this element does and when it is relevant.\n */\n description: string;\n\n /**\n * An optional icon identifier.\n */\n icon?: string;\n};\n\n// ============================================================\n// Intents\n// ============================================================\n\n/**\n * The base intent structure. Describes the common data parameters shared by all intent types\n * regardless of what they target. An optional templateIdentifier allows the intent to reference\n * a target defined in a different template.\n */\nexport type XOTemplateIntent = {\n\n /**\n * Optional identifier for the template used in this intent. If not provided, uses the current template.\n */\n templateIdentifier?: XOTemplateIdentifier;\n\n /**\n * Identifiers for items to generate when this intent is resolved (e.g. keys or secrets).\n */\n generate?: Array<string>;\n\n /**\n * Variable values to apply when this intent is resolved.\n */\n variables?: Array<Record<XOTemplateVariableIdentifier, unknown>>;\n\n /**\n * Constant values to apply when this intent is resolved.\n */\n constants?: Array<Record<XOTemplateConstantIdentifier, unknown>>;\n\n /**\n * Secret values to apply when this intent is resolved.\n */\n secrets?: Array<Record<XOTemplateSecretIdentifier, unknown>>;\n\n /**\n * Optional identifier for the role used in this intent.\n */\n role?: XOTemplateRoleIdentifier;\n};\n\n/**\n * An intent that targets a specific action.\n */\nexport type XOTemplateActionIntent = XOTemplateIntent & {\n\n /**\n * The identifier for the intended action.\n */\n action: XOTemplateActionIdentifier;\n};\n\n/**\n * An intent that targets a specific output.\n */\nexport type XOTemplateOutputIntent = XOTemplateIntent & {\n\n /**\n * The identifier for the intended output.\n */\n output: XOTemplateOutputIdentifier;\n};\n\n/**\n * An intent that targets a specific locking script.\n */\nexport type XOTemplateLockingScriptIntent = XOTemplateIntent & {\n\n /**\n * The identifier for the intended locking script.\n */\n lockingScript: XOTemplateLockingScriptIdentifier;\n};\n\n// ============================================================\n// Actions\n// ============================================================\n\n/**\n * Requirements for a specific role within an action. Describes what data or secrets\n * the role must provide when participating.\n */\nexport type XOTemplateActionRoleRequirements = {\n\n /**\n * List of variable identifiers required for this role.\n */\n variables?: Array<XOTemplateVariableIdentifier>;\n\n /**\n * List of secret identifiers required for this role.\n */\n secrets?: Array<XOTemplateSecretIdentifier>;\n};\n\n/**\n * A role specific definition within an action.\n */\nexport type XOTemplateActionRole = Partial<XOTemplateViewProperties> & {\n\n /**\n * Identifiers for data items that should be generated for this role\n * when participating in the action.\n */\n generate?: Array<string>;\n\n /**\n * The requirements for this role within this action.\n */\n requirements?: XOTemplateActionRoleRequirements;\n};\n\n/**\n * Slot configuration for a role. Declares how many participants of a given\n * role are needed to satisfy the action's requirements.\n */\nexport type XOTemplateRoleSlotsRequirements = {\n\n /**\n * Minimum number of participants required for this role.\n */\n min: number;\n\n /**\n * Maximum number of participants allowed for this role. Undefined means unlimited.\n */\n max?: number;\n};\n\n/**\n * A role entry in an action's requirements block.\n * Declares which role must participate and how many slots are needed.\n */\nexport type XOTemplateRoleSlot = {\n\n /**\n * The role identifier that this requirement applies to.\n */\n role: XOTemplateRoleIdentifier;\n\n /**\n * Slot configuration specifying how many participants of this role are required.\n */\n slots: XOTemplateRoleSlotsRequirements;\n};\n\n/**\n * Requirements for an action. Declares which roles must participate and what secrets must be available.\n */\nexport type XOTemplateActionRequirements = {\n\n /**\n * List of variable identifiers required for this action.\n */\n variables?: Array<XOTemplateVariableIdentifier>;\n\n /**\n * The participants required for this action.\n */\n participants?: Array<XOTemplateRoleSlot>;\n\n /**\n * The secrets required for this action.\n */\n secrets?: Array<XOTemplateSecretIdentifier>;\n};\n\n/**\n * An action within a template.\n */\nexport type XOTemplateAction = XOTemplateViewProperties & {\n\n /**\n * Specific context for each role participating in this action.\n */\n roles?: Record<XOTemplateRoleIdentifier, XOTemplateActionRole>;\n\n /**\n * The requirements for this action.\n */\n requirements?: XOTemplateActionRequirements;\n\n /**\n * Conditions that must be met for this action to be available.\n *\n * @todo More work needs to be done on this field.\n */\n conditions?: Array<string>;\n\n /**\n * The identifier of the transaction this action produces, referencing an entry\n * in the template's transactions.\n */\n transaction?: XOTemplateTransactionIdentifier;\n\n /**\n * The identifier of the data field this action produces, referencing an entry\n * in the template's data.\n *\n * @todo More work needs to be done on this field.\n */\n data?: XOTemplateDataIdentifier;\n};\n\n// ============================================================\n// Tokens & Amounts\n// ============================================================\n\n/**\n * Non-fungible token configuration within a token field.\n */\nexport type XOTemplateNonFungibleTokenDetails = {\n\n /**\n * The capability of the NFT. May be a known capability value or a CashASM expression resolving to a capability.\n */\n capability?: XOTemplateNftCapability | string;\n\n /**\n * The commitment data for the NFT, as a string or CashASM expression resolving to a commitment.\n */\n commitment?: string;\n};\n\n/**\n * Token configuration for outputs and inputs.\n */\nexport type XOTemplateToken = {\n\n /**\n * The category of the token, as a string or CashASM expression resolving to a category.\n */\n category?: string;\n\n /**\n * The amount of fungible tokens as a bigint, a CashASM expression resolving to a bigint, or null indicating no FT is present.\n */\n amount?: bigint | string | null;\n\n /**\n * Non-fungible token configuration. Null indicates no NFT is present.\n */\n nft?: XOTemplateNonFungibleTokenDetails | null;\n};\n\n/**\n * Asset amounts configuration. Used for balance tracking on locking scripts and their roles, and for omitting change amounts.\n * All fields are optional. Values may be literal amounts or CashASM expressions resolving to amounts.\n */\nexport type XOTemplateAssetAmounts = {\n\n /**\n * The satoshi amount.\n * - `Satoshis`: A specific bigint amount.\n * - `string`: A CashASM expression that resolves to the amount.\n * - `true`: all, i.e. the entire amount\n */\n satoshis?: Satoshis | string | true;\n\n /**\n * The fungible token amount.\n * - `FungibleTokenAmount`: A specific bigint amount.\n * - `string`: A CashASM expression that resolves to the amount.\n * - `true`: all, i.e. the entire amount\n */\n fungibleTokens?: FungibleTokenAmount | string | true;\n\n /**\n * Whether a non-fungible token is present (0 for absent, 1 for present),\n * or a CashASM expression that evaluates to 0 or 1.\n * - `true`: resolves to 1 if an NFT is present, or 0 if none is present. Use this when\n * the NFT is optional, to express that the NFT is estimated to be part of the balance\n * if present, or absent from it if not.\n * - `0`: None, i.e. nothing is expected to be included\n * - `1`: present and complete, as value > 1 does not make sense for non-fungible tokens\n * - `string`: A CashASM expression that evaluates to 0 or 1.\n */\n nonfungibleTokens?: true | 0 | 1 | string;\n};\n\n// ============================================================\n// Shared State\n// ============================================================\n\n/**\n * State configuration shared by a locking script and its individual roles.\n * Declares which variables and secrets are tracked in the on-chain state for that participant.\n */\nexport type XOTemplateState = {\n\n /**\n * List of variable identifiers to track in state.\n */\n variables?: Array<XOTemplateVariableIdentifier>;\n\n /**\n * List of secret identifiers to track in state.\n */\n secrets?: Array<XOTemplateSecretIdentifier>;\n};\n\n// ============================================================\n// Locking Scripts\n// ============================================================\n\n/**\n * A role definition within a locking script.\n */\nexport type XOTemplateLockingScriptRole = Partial<XOTemplateViewProperties> & {\n\n /**\n * List of items to track as state for this role.\n */\n state?: XOTemplateState;\n\n /**\n * List of action references available to this role.\n */\n actions?: Array<XOTemplateActionIntent>;\n\n /**\n * Estimated ownership in the optional set of asset amounts specified.\n */\n balance?: Partial<XOTemplateAssetAmounts>;\n\n /**\n * Whether outputs locked to this script should be available for coin selection.\n */\n selectable?: boolean;\n\n /**\n * Whether this output or locking script should be tracked by the engine.\n * When omitted, the engine treats this field as true.\n * - `true`: Include it.\n * - `false`: Exclude it.\n * - `string`: A CashASM expression that evaluates to a boolean relevance value.\n */\n relevant?: boolean | string;\n\n /**\n * Privacy level for outputs locked to this script.\n * - `number`: A numeric privacy level.\n * - `string`: A CashASM expression that evaluates to a privacy level.\n */\n privacy?: number | string;\n};\n\n/**\n * A locking script definition in the template.\n */\nexport type XOTemplateLockingScript = XOTemplateViewProperties & {\n\n /**\n * The type of locking mechanism. Defaults to 'p2s' if not specified.\n */\n lockingType?: XOTemplateLockingType;\n\n /**\n * The locking script bytecode.\n */\n lockingBytecode: string;\n\n /**\n * Optional default unlocking bytecode when used in automatic coin selection.\n */\n unlockingBytecode?: string;\n\n /**\n * The actions available for this locking script.\n */\n actions?: Array<XOTemplateActionIntent>;\n\n /**\n * List of items to track as state for all participants.\n */\n state?: XOTemplateState;\n\n /**\n * Estimated ownership in the optional set of asset amounts specified.\n */\n balance?: Partial<XOTemplateAssetAmounts>;\n\n /**\n * Whether outputs locked to this script should be available for coin selection.\n */\n selectable?: boolean;\n\n /**\n * Privacy level for outputs locked to this script.\n * - `number`: A numeric privacy level.\n * - `string`: A CashASM expression that evaluates to a privacy level.\n */\n privacy?: number | string;\n\n /**\n * Specific context for each role participating in this locking script.\n */\n roles?: Record<XOTemplateRoleIdentifier, XOTemplateLockingScriptRole>;\n};\n\n// ============================================================\n// Inputs\n// ============================================================\n\n/**\n * An input definition in the template.\n */\nexport type XOTemplateInput = XOTemplateViewProperties & {\n\n /**\n * The amount of satoshis for this input.\n * - `Satoshis`: A specific amount of satoshis.\n * - `string`: A CashASM expression that resolves to the satoshi amount.\n */\n valueSatoshis?: Satoshis | string;\n\n /**\n * Token configuration for this input.\n */\n token?: XOTemplateToken | null;\n\n /**\n * The sequence number of this input.\n * - `number`: A specific sequence number.\n * - `string`: A CashASM expression that resolves to the sequence number.\n */\n sequenceNumber?: number | string;\n\n /**\n * Identifier of the unlocking script to use for the UTXO provided for this input.\n */\n unlockingScript?: string;\n\n /**\n * Amount of change that should be omitted from the automatic change handling. WARNING: Setting this can result in loss of funds!\n */\n omitChangeAmounts?: XOTemplateAssetAmounts;\n};\n\n// ============================================================\n// Outputs\n// ============================================================\n\n/**\n * An output definition in the template. Inherits all fields from `XOTemplateLockingScript`\n * except `lockingType`, `lockingBytecode` and `unlockingBytecode`: outputs reference a locking script by identifier\n * rather than defining one inline, so repeating any of these fields here would create an ambiguity\n * about which declaration takes precedence.\n */\nexport type XOTemplateOutput = Omit<XOTemplateLockingScript, 'lockingType' | 'lockingBytecode' | 'unlockingBytecode'> & {\n\n /**\n * Identifier of the locking script to use for this output.\n */\n lockingScript: XOTemplateLockingScriptIdentifier;\n\n /**\n * The amount of satoshis for this output.\n * - `Satoshis`: A specific amount of satoshis.\n * - `string`: A CashASM expression that resolves to the satoshi amount.\n */\n valueSatoshis?: Satoshis | string;\n\n /**\n * Token configuration for this output.\n */\n token?: XOTemplateToken | null;\n};\n\n// ============================================================\n// Transactions\n// ============================================================\n\n/**\n * Reference to an input in a transaction definition in the template.\n */\nexport type XOTemplateTransactionInput = {\n\n /**\n * The input definition identifier.\n */\n input: XOTemplateInputIdentifier;\n\n /**\n * Optional index of this input in the transaction.\n */\n inputIndex?: number;\n};\n\n/**\n * Reference to an output in a transaction definition in the template.\n */\nexport type XOTemplateTransactionOutput = {\n\n /**\n * The output definition identifier.\n */\n output: XOTemplateOutputIdentifier;\n\n /**\n * Optional index of this output in the transaction.\n */\n outputIndex?: number;\n};\n\n/**\n * Role-specific data for a transaction within a template.\n */\nexport type XOTemplateTransactionRoleData = Partial<XOTemplateViewProperties> & {\n\n /**\n * The inputs required for this role.\n */\n inputs?: Array<XOTemplateTransactionInput>;\n\n /**\n * The outputs required for this role.\n */\n outputs?: Array<XOTemplateTransactionOutput>;\n};\n\n/**\n * A transaction template definition.\n */\nexport type XOTemplateTransaction = XOTemplateViewProperties & {\n\n /**\n * The version of the transaction.\n */\n version?: number;\n\n /**\n * The locktime for this transaction.\n * - `number`: A specific locktime value.\n * - `string`: A CashASM expression that resolves to the locktime.\n */\n locktime?: number | string;\n\n /**\n * The inputs for this transaction.\n */\n inputs: Array<XOTemplateTransactionInput>;\n\n /**\n * The outputs for this transaction.\n */\n outputs: Array<XOTemplateTransactionOutput>;\n\n /**\n * Specific context for each role participating in this transaction.\n */\n roles?: Record<XOTemplateRoleIdentifier, XOTemplateTransactionRoleData>;\n\n /**\n * Whether this transaction can be composed with other transactions.\n */\n composable?: boolean;\n};\n\n// ============================================================\n// Template Data\n// ============================================================\n\n/**\n * A constant value definition in the template.\n */\nexport type XOTemplateConstant = XOTemplateViewProperties & {\n\n /**\n * The data type of this constant.\n */\n type: XOTemplatePrimitiveType;\n\n /**\n * The value of this constant.\n */\n value: unknown;\n\n /**\n * An optional hint to help apps and users understand what this constant represents.\n */\n hint?: unknown;\n};\n\n/**\n * An import default value intent. Extends the base intent with optional view\n * properties that the engine evaluates at runtime to produce human-readable output.\n * The engine overrides whatever values are set here when resolving the target for a participant.\n */\nexport type XOTemplateImportDefaultValue = XOTemplateIntent & Partial<XOTemplateViewProperties>;\n\n/**\n * A variable definition in the template.\n */\nexport type XOTemplateVariable = XOTemplateViewProperties & {\n\n /**\n * The data type of this variable.\n */\n type?: XOTemplatePrimitiveType;\n\n /**\n * A hint to help users understand what value to provide.\n */\n hint?: unknown;\n\n /**\n * A neutral intent that the engine uses to populate the default value for this variable.\n * View properties (name, description, icon) may contain CashASM expressions that the\n * engine evaluates at runtime to produce human-readable output.\n */\n importDefaultValue?: XOTemplateImportDefaultValue;\n};\n\n/**\n * A data field definition in the template.\n *\n * @todo More work needs to be done on this type.\n */\nexport type XOTemplateData = {\n\n /**\n * The data type of this data field.\n */\n type: XOTemplatePrimitiveType;\n\n /**\n * The value for this data field.\n */\n value: unknown;\n\n /**\n * An optional hint to help apps and users understand this data field.\n */\n hint?: unknown;\n};\n\n// ============================================================\n// Template Resources\n// ============================================================\n\n/**\n * An icon reference in the template.\n */\nexport type XOTemplateIcon = {\n\n /**\n * A name for this icon.\n */\n name: string;\n\n /**\n * The identifier of the icon.\n */\n hash: string;\n};\n\n/**\n * A resource reference attached to a template. Extends view properties with a URL\n * pointing to external documentation or tooling.\n */\nexport type XOTemplateResource = XOTemplateViewProperties & {\n\n /**\n * The URL for this resource.\n */\n url: string;\n};\n\n// ============================================================\n// Template\n// ============================================================\n\n/**\n * Default settings applied across the template when no explicit per-action overrides are given.\n */\nexport type XOTemplateDefaults = {\n\n /**\n * Instructions for how to construct automated change output.\n */\n change?: XOTemplateOutputIntent;\n};\n\n/**\n * The XO Template.\n */\nexport type XOTemplate = XOTemplateViewProperties & {\n\n /**\n * The URI that identifies the JSON Schema used by this template.\n * This enables documentation, autocompletion, and validation in JSON documents.\n */\n $schema: string;\n\n /**\n * A string identifying the version of this template.\n */\n version?: string;\n\n /**\n * The BCH VM versions that this template supports. At least one version is required.\n */\n supported: Array<BchVmVersion>;\n\n /**\n * Optional default settings used in this template.\n */\n defaults?: XOTemplateDefaults;\n\n /**\n * The roles defined in this template.\n */\n roles: Record<XOTemplateRoleIdentifier, XOTemplateViewProperties>;\n\n /**\n * A list of entry points defining which actions are available at the start.\n */\n start: Array<XOTemplateActionIntent>;\n\n /**\n * The actions defined in this template.\n */\n actions: Record<XOTemplateActionIdentifier, XOTemplateAction>;\n\n /**\n * The data fields defined in this template.\n */\n data?: Record<XOTemplateDataIdentifier, XOTemplateData>;\n\n /**\n * The transaction templates defined in this template.\n */\n transactions?: Record<XOTemplateTransactionIdentifier, XOTemplateTransaction>;\n\n /**\n * The inputs defined in this template.\n */\n inputs: Record<XOTemplateInputIdentifier, XOTemplateInput>;\n\n /**\n * The outputs defined in this template.\n */\n outputs: Record<XOTemplateOutputIdentifier, XOTemplateOutput>;\n\n /**\n * The locking script templates defined in this template.\n */\n lockingScripts: Record<XOTemplateLockingScriptIdentifier, XOTemplateLockingScript>;\n\n /**\n * The scripts used in this template, The keys are identifiers of the scripts and\n * the values are the bytecode or cashASM expressions.\n */\n scripts: Record<XOTemplateScriptIdentifier, string>;\n\n /**\n * The constants defined in this template.\n */\n constants?: Record<XOTemplateConstantIdentifier, XOTemplateConstant>;\n\n /**\n * The variables that must be provided for use in the template's scripts.\n */\n variables?: Record<XOTemplateVariableIdentifier, XOTemplateVariable>;\n\n /**\n * Resource references providing external documentation or tooling links.\n */\n resources?: Array<XOTemplateResource>;\n\n /**\n * The icons available for use throughout the template.\n */\n icons?: Array<XOTemplateIcon>;\n\n /**\n * The scenarios defined in this template.\n */\n scenarios?: unknown;\n};\n"],"mappings":";;;;AAmBA,MAAa,gBAAgB;CACzB,aAAa;CACb,aAAa;CACb,aAAa;CACb,aAAa;CACb,aAAa;CACb,aAAa;CACb,aAAa;CAChB;;;;AAUD,MAAa,4BAA4B;CACrC,MAAM;CACN,SAAS;CACT,SAAS;CACZ;;;;AAaD,MAAa,yBAAyB;CAClC,KAAK;CACL,OAAO;CACP,MAAM;CACT;;;;;AAYD,MAAa,2BAA2B;CACpC,SAAS;CACT,OAAO;CACP,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,aAAa;CACb,YAAY;CACZ,qBAAqB;CACrB,UAAU;CACV,uBAAuB;CACvB,+BAA+B;CAC/B,+BAA+B;CAC/B,WAAW;CACX,gBAAgB;CAChB,gBAAgB;CAChB,gBAAgB;CAChB,kBAAkB;CAClB,qBAAqB;CACrB,mBAAmB;CACtB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xo-cash/types",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6-development.16436855937",
|
|
4
4
|
"description": "XO type definitions and interfaces",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.mts",
|
|
@@ -46,11 +46,12 @@
|
|
|
46
46
|
},
|
|
47
47
|
"overrides": {
|
|
48
48
|
"echarts": "6.1.0",
|
|
49
|
-
"minimatch": "10.2.6"
|
|
49
|
+
"minimatch": "10.2.6",
|
|
50
|
+
"qs": "6.16.0"
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
53
|
"@generalprotocols/cspell-dictionary": "^1.0.1",
|
|
53
|
-
"@vitest/coverage-v8": "^4.
|
|
54
|
+
"@vitest/coverage-v8": "^4.1.11",
|
|
54
55
|
"@viz-kit/esbuild-analyzer": "^1.0.0",
|
|
55
56
|
"@xo-cash/eslint-config": "1.0.1",
|
|
56
57
|
"cspell": "^9.6.0",
|
|
@@ -60,6 +61,6 @@
|
|
|
60
61
|
"typedoc": "^0.28.16",
|
|
61
62
|
"typedoc-plugin-coverage": "^4.0.2",
|
|
62
63
|
"typescript": "^5.3.2",
|
|
63
|
-
"vitest": "^4.
|
|
64
|
+
"vitest": "^4.1.11"
|
|
64
65
|
}
|
|
65
66
|
}
|