@xo-cash/types 0.0.6-development.16436855937 → 0.0.7-development.16733540562

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 CHANGED
@@ -671,6 +671,14 @@ type XOTemplateDefaults = {
671
671
  * Instructions for how to construct automated change output.
672
672
  */
673
673
  change?: XOTemplateOutputIntent;
674
+ /**
675
+ * Configure the default intent structure for creating receiving addresses / locking scripts.
676
+ */
677
+ address?: XOTemplateLockingScriptIntent;
678
+ /**
679
+ * Configure the default intent structure for creating receive outputs.
680
+ */
681
+ receive?: XOTemplateOutputIntent;
674
682
  };
675
683
  /**
676
684
  * The XO Template.
@@ -984,6 +992,41 @@ type XOInvitationInput = Partial<Input> & {
984
992
  */
985
993
  mergesWith?: XOInvitationMergesWithReference;
986
994
  };
995
+ /**
996
+ * The token fields of an output.
997
+ */
998
+ type OutputToken = NonNullable<Output['token']>;
999
+ /**
1000
+ * The NFT fields of an output.
1001
+ */
1002
+ type OutputNft = NonNullable<OutputToken['nft']>;
1003
+ /**
1004
+ * A commit may supply any subset of the following fields, hence not using the Output type or
1005
+ * Output['token'] type.
1006
+ */
1007
+ type XOInvitationToken = {
1008
+ /**
1009
+ * Fungible token amount. Omitted until a commit supplies it.
1010
+ */
1011
+ amount?: OutputToken['amount'];
1012
+ /**
1013
+ * Token category bytes. Omitted until a commit supplies them.
1014
+ */
1015
+ category?: OutputToken['category'];
1016
+ /**
1017
+ * NFT fields. Omitted when the output carries fungible tokens only.
1018
+ */
1019
+ nft?: {
1020
+ /**
1021
+ * NFT capability. Omitted until a commit supplies it.
1022
+ */
1023
+ capability?: OutputNft['capability'];
1024
+ /**
1025
+ * NFT commitment bytes. Omitted until a commit supplies them.
1026
+ */
1027
+ commitment?: OutputNft['commitment'];
1028
+ };
1029
+ };
987
1030
  /**
988
1031
  * A transaction output provided in a commit.
989
1032
  *
@@ -1009,7 +1052,11 @@ type XOInvitationInput = Partial<Input> & {
1009
1052
  * }
1010
1053
  * ```
1011
1054
  */
1012
- type XOInvitationOutput = Partial<Output> & {
1055
+ type XOInvitationOutput = Omit<Partial<Output>, 'token'> & {
1056
+ /**
1057
+ * CashToken fields. Any field may be optional until a later commit supplies it.
1058
+ */
1059
+ token?: XOInvitationToken;
1013
1060
  /**
1014
1061
  * The identifier of this output.
1015
1062
  */
@@ -1313,5 +1360,5 @@ type XOInvitation = {
1313
1360
  result?: XOInvitationResult;
1314
1361
  };
1315
1362
  //#endregion
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 };
1363
+ export { BchVmVersion, BchVmVersions, FungibleTokenAmount, OutputNft, OutputToken, Satoshis, ValueOf, XOInvitation, XOInvitationActionReference, XOInvitationCommit, XOInvitationCommitData, XOInvitationCommitDataItemIndex, XOInvitationCommitIdentifier, XOInvitationDataResult, XOInvitationEntityIdentifier, XOInvitationIdentifier, XOInvitationInput, XOInvitationMemo, XOInvitationMergesWithReference, XOInvitationOutput, XOInvitationRequirements, XOInvitationResult, XOInvitationRoleRequirement, XOInvitationSignature, XOInvitationTimestamp, XOInvitationToken, 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 };
1317
1364
  //# sourceMappingURL=index.d.mts.map
@@ -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,wBAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;KA0BD,uBAAA,GAA0B,OAAA,QAAe,wBAAA;;KAOzC,wBAAA;;KAGA,0BAAA;;KAGA,yBAAA;;KAGA,0BAAA;;KAGA,iCAAA;;KAGA,0BAAA;;KAGA,+BAAA;;KAGA,4BAAA;;KAGA,4BAAA;AAxBZ;AAAA,KA2BY,wBAAA;;KAGA,0BAAA;;KAGA,oBAAA;;;;KASA,wBAAA;EApCA;;;EAyCR,IAAA;EAzCiC;AAGrC;;EA2CI,WAAA;EA3CkC;;AAGtC;EA6CI,IAAA;AAAA;;;AA1CJ;;;KAsDY,gBAAA;EAtD0B;AAGtC;;EAwDI,kBAAA,GAAqB,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;;;;;;;;;;ADyFxB;;;;;;;;;;;;;;KC/DY,kBAAA;ED2ER;;;;;ECpEA,YAAA,GAAe,MAAA,CAAO,+BAAA,EAAiC,6BAAA;ED8ExC;;;ECzEf,IAAA,GAAO,MAAA,CAAO,wBAAA,EAA0B,sBAAA;AAAA;;;;AD6F5C;;;;;;;;;;;AAuBA;;;;;;;;;;;;KCvFY,YAAA;ED4FA;;;ECvFR,oBAAA,EAAsB,sBAAA;ED4Ff;;;ECvFP,kBAAA,EAAoB,qBAAA;EDkFS;;;EC7E7B,kBAAA,EAAoB,oBAAA;ED8FpB;;;ECzFA,gBAAA,EAAkB,0BAAA;EDiGV;;;EC5FR,OAAA,EAAS,kBAAA;EDiGT;;;EC5FA,MAAA,GAAS,kBAAA;AAAA"}
@@ -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 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"}
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 * Configure the default intent structure for creating receiving addresses / locking scripts.\n */\n address?: XOTemplateLockingScriptIntent;\n\n /**\n * Configure the default intent structure for creating receive outputs.\n */\n receive?: 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.6-development.16436855937",
3
+ "version": "0.0.7-development.16733540562",
4
4
  "description": "XO type definitions and interfaces",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.mts",