@xo-cash/templates 0.0.8 → 0.0.9-development.16914550855
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.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -819,7 +819,7 @@ const p2pkhTemplate = {
|
|
|
819
819
|
scripts: {
|
|
820
820
|
lockP2PKH: "OP_DUP OP_HASH160 <$(<ownerKey.public_key> OP_HASH160)> OP_EQUALVERIFY OP_CHECKSIG",
|
|
821
821
|
unlockP2PKH: "<ownerKey.schnorr_signature.all_outputs> <ownerKey.public_key>",
|
|
822
|
-
lockToRecipient: "<recipientLockingscript>"
|
|
822
|
+
lockToRecipient: "$(<recipientLockingscript>)"
|
|
823
823
|
},
|
|
824
824
|
constants: {
|
|
825
825
|
dustLimit: {
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../source/p2pkh.ts","../source/wrapped_cash.ts","../source/faucet_cash.ts"],"sourcesContent":["import type { XOTemplate } from '@xo-cash/types';\n\nexport const p2pkhTemplate: XOTemplate = {\n $schema: 'https://libauth.org/schemas/wallet-template-v0.schema.json',\n\n // Name for this template.\n name: 'Wallet (P2PKH)',\n\n // Description for this template.\n description: 'A standard single-factor wallet template that uses Pay-to-Public-Key-Hash (P2PKH) locking scripts.',\n\n // Icon for this template.\n icon: 'wallet',\n\n // Version number for this template.\n version: '1',\n\n // List of VM versions that can be used to run this template.\n supported: [ 'BCH_2023_05', 'BCH_2024_05', 'BCH_2025_05', 'BCH_2026_05' ],\n\n // Sets optional default values to be used with this template.\n defaults: {\n // Configures a default intent structure for creating change outputs and locking scripts.\n // NOTE: This is used when the engine needs to make change for an output created by\n // this template and there is no other policy provided elsewhere that takes precedence.\n // NOTE: It is recommended that templates that create outputs with the 'selectable' property\n // either provides a change policy here, or a comment that explain that they\n // intentionally omit the change policy and why.\n change: {\n output: 'changeOutput',\n role: 'receiver',\n generate: [ 'ownerKey' ],\n },\n\n // Configure the default intent structure for creating receiving addresses / locking scripts.\n address: {\n lockingScript: 'receivingLockingScript',\n role: 'receiver',\n generate: [ 'ownerKey' ],\n },\n\n // Configure the default intent structure for creating receive outputs and locking scripts.\n receive: {\n output: 'receiveOutput',\n role: 'receiver',\n generate: [ 'ownerKey' ],\n },\n },\n\n // Describe a list of roles that are used in this template.\n // NOTE: Template roles are held only for the duration of one specific action/invitation.\n // For example, the same entity that acts as 'receiver' when creating/receiving an output\n // can later act as 'sender' (or 'owner') when performing a follow-up action.\n roles: {\n owner: {\n name: 'Wallet Owner',\n description: 'The party who can spend from this wallet.',\n icon: 'owner',\n },\n receiver: {\n name: 'Receiver',\n description: 'A party that is receiving value.',\n icon: 'receiver',\n },\n sender: {\n name: 'Sender',\n description: 'A party that is sending value.',\n icon: 'sender',\n },\n },\n\n // Define a list of entrypoints supported by this template.\n start: [\n {\n action: 'receive',\n role: 'receiver',\n generate: [ 'ownerKey' ],\n },\n {\n action: 'requestSatoshis',\n role: 'receiver',\n generate: [ 'ownerKey' ],\n },\n {\n action: 'requestFungibleTokens',\n role: 'receiver',\n generate: [ 'ownerKey' ],\n },\n {\n action: 'requestNonfungibleTokens',\n role: 'receiver',\n generate: [ 'ownerKey' ],\n },\n ],\n\n // Define a list of actions that can be taken by this template.\n // NOTE: There is no action to generate an address, but a wallet can create an invitation to a receive action and\n // extract the generated lockscript as needed as the engine will track all lockscripts it generates.\n actions: {\n receive: {\n // TODO: Consider rewriting to be generic/role-less.\n name: 'Receive',\n description: 'Receive an unspecified amount of cash and/or tokens from one or more senders.',\n icon: 'receive',\n\n roles: {\n receiver: {\n name: 'Receive',\n description: 'Receive an unspecified amount of cash and/or tokens from one or more senders.',\n icon: 'receive',\n\n requirements: {\n secrets: [ 'ownerKey' ],\n },\n },\n sender: {\n name: 'Send',\n description: 'Send an unspecified amount of cash and/or tokens to the provided receiver.',\n icon: 'send',\n\n requirements: {\n variables: [ 'transferredSatoshis' ],\n },\n },\n },\n\n requirements: {\n participants: [\n {\n role: 'receiver',\n slots: { min: 1, max: 1 },\n },\n {\n role: 'sender',\n slots: { min: 1, max: undefined },\n },\n ],\n },\n\n transaction: 'receiveTransaction',\n },\n requestSatoshis: {\n // TODO: Consider rewriting to be generic/role-less.\n name: 'Request Satoshis',\n description: 'Requests a specific amount of Bitcoin Cash from one or more senders.',\n icon: 'request',\n\n roles: {\n receiver: {\n name: 'Request Satoshis',\n description: 'Requests a specific amount of Bitcoin Cash from one or more senders.',\n icon: 'request',\n\n requirements: {\n secrets: [ 'ownerKey' ],\n variables: [ 'requestedSatoshis' ],\n },\n },\n sender: {\n name: 'Send',\n description: 'Send a specific amount of Bitcoin Cash to the provided receiver.',\n icon: 'send',\n\n // The sender only need to provide blockchain-level requirements.\n // NOTE: This field is not required when empty, but shown here for illustrative purposes.\n requirements: {},\n },\n },\n\n requirements: {\n participants: [\n {\n role: 'receiver',\n slots: { min: 1, max: 1 },\n },\n {\n role: 'sender',\n slots: { min: 1, max: undefined },\n },\n ],\n },\n\n transaction: 'requestSatoshisTransaction',\n },\n requestFungibleTokens: {\n // TODO: Consider rewriting to be generic/role-less.\n name: 'Request Fungible Tokens',\n description: 'Requests a specific amount of a fungible tokens from one or more senders.',\n icon: 'request',\n\n roles: {\n receiver: {\n name: 'Request Fungible Tokens',\n description: 'Requests a specific amount of a fungible tokens from one or more senders.',\n icon: 'request',\n\n requirements: {\n secrets: [ 'ownerKey' ],\n variables: [ 'requestedTokenCategory', 'requestedTokenAmount' ],\n },\n },\n sender: {\n name: 'Send',\n description: 'Send a specific amount of fungible tokens to the provided receiver.',\n icon: 'send',\n\n // The sender only need to provide blockchain-level requirements.\n // NOTE: This field is not required when empty, but shown here for illustrative purposes.\n requirements: {},\n },\n },\n\n requirements: {\n participants: [\n {\n role: 'receiver',\n slots: { min: 1, max: 1 },\n },\n {\n role: 'sender',\n slots: { min: 1, max: undefined },\n },\n ],\n },\n\n transaction: 'requestFungibleTokensTransaction',\n },\n requestNonfungibleTokens: {\n // TODO: Consider rewriting to be generic/role-less.\n name: 'Request a Non-fungible Token',\n description: 'Requests a non-fungible token from one or more senders.',\n icon: 'request',\n\n roles: {\n receiver: {\n name: 'Request a Non-fungible Token',\n description: 'Requests a non-fungible token from one or more senders.',\n icon: 'request',\n\n requirements: {\n secrets: [ 'ownerKey' ],\n variables: [ 'requestedTokenCategory', 'requestedTokenCapability', 'requestedTokenCommitment' ],\n },\n },\n sender: {\n name: 'Send',\n description: 'Send a non-fungible token to the provided receiver.',\n icon: 'send',\n\n // The sender only need to provide blockchain-level requirements.\n // NOTE: This field is not required when empty, but shown here for illustrative purposes.\n requirements: {},\n },\n },\n\n requirements: {\n participants: [\n {\n role: 'receiver',\n slots: { min: 1, max: 1 },\n },\n {\n role: 'sender',\n slots: { min: 1, max: undefined },\n },\n ],\n },\n\n transaction: 'requestNonfungibleTokensTransaction',\n },\n\n // NOTE: Sending value can be done without explicit template support.\n // NOTE: This feature is explicitly defined in this template to demonstrate how versatile templates can be, and\n // to ensure the feature is discoverable by the user from outputs that hold value.\n sendSatoshis: {\n name: 'Send Satoshis',\n description: 'Sends a specific amount of Bitcoin Cash to a given recipient.',\n icon: 'send',\n\n roles: {\n sender: {\n requirements: {\n variables: [ 'transferredSatoshis', 'recipientLockingscript' ],\n secrets: [ 'ownerKey' ],\n },\n },\n },\n\n requirements: {\n participants: [\n {\n role: 'sender',\n slots: { min: 1, max: 1 },\n },\n ],\n },\n\n // Sending is only available for outputs that have sufficient satoshis on them.\n // NOTE: Dust is enforced here according to standardness rules.\n conditions: [ '$(OP_INPUTINDEX OP_UTXOVALUE <dustLimit> OP_GREATERTHAN)' ],\n\n transaction: 'transferSatoshisTransaction',\n },\n sendFungibleTokens: {\n name: 'Send Fungible Tokens',\n description: 'Send a specific amount of a fungible token to a given recipient.',\n icon: 'send',\n\n roles: {\n sender: {\n requirements: {\n variables: [ 'transferredTokenCategory', 'transferredTokenAmount', 'recipientLockingscript' ],\n secrets: [ 'ownerKey' ],\n },\n },\n },\n\n requirements: {\n participants: [\n {\n role: 'sender',\n slots: { min: 1, max: 1 },\n },\n ],\n },\n\n // Sending is only available for outputs that have fungible tokens on them.\n conditions: [ '$(OP_INPUTINDEX OP_UTXOTOKENAMOUNT <0> OP_GREATERTHAN)' ],\n\n transaction: 'transferFungibleTokensTransaction',\n },\n sendNonfungibleTokens: {\n name: 'Send a Non-fungible Token',\n description: 'Send a non-fungible token to a given recipient.',\n icon: 'send',\n\n roles: {\n sender: {\n requirements: {\n variables: [ 'transferredTokenCategory', 'transferredTokenCapability', 'transferredTokenCommitment', 'recipientLockingscript' ],\n secrets: [ 'ownerKey' ],\n },\n },\n },\n\n requirements: {\n participants: [\n {\n role: 'sender',\n slots: { min: 1, max: 1 },\n },\n ],\n },\n\n // Sending is only available for outputs that have a non-fungible token on them.\n conditions: [ '$(OP_INPUTINDEX OP_UTXOTOKENCATEGORY OP_SIZE OP_NIP <32> OP_GREATERTHAN)' ],\n\n transaction: 'transferNonfungibleTokensTransaction',\n },\n\n // NOTE: Burning tokens can be done without explicit template support.\n // NOTE: This feature is explicitly defined in this template to demonstrate how versatile templates can be, and\n // to ensure the feature is discoverable by the user from outputs that hold tokens.\n burnFungibleTokens: {\n name: 'Delete Fungible Tokens',\n description: 'Permanently and irreversibly deletes one or more fungible tokens.',\n icon: 'burn',\n\n roles: {\n owner: {\n requirements: {\n variables: [ 'burnedTokenCategory', 'burnedTokenAmount' ],\n secrets: [ 'ownerKey' ],\n },\n },\n },\n\n requirements: {\n participants: [\n {\n role: 'owner',\n slots: { min: 1, max: 1 },\n },\n ],\n },\n\n // Burning is only available for outputs that have fungible tokens on them.\n conditions: [ '$(OP_INPUTINDEX OP_UTXOTOKENAMOUNT <0> OP_GREATERTHAN)' ],\n\n transaction: 'burnFungibleTokensTransaction',\n },\n burnNonfungibleTokens: {\n name: 'Delete a Non-fungible Token',\n description: 'Permanently and irreversibly deletes one non-fungible token.',\n icon: 'burn',\n\n roles: {\n owner: {\n requirements: {\n variables: [ 'burnedTokenCategory', 'burnedTokenCapability', 'burnedTokenCommitment' ],\n secrets: [ 'ownerKey' ],\n },\n },\n },\n\n requirements: {\n participants: [\n {\n role: 'owner',\n slots: { min: 1, max: 1 },\n },\n ],\n },\n\n // Burning is only available for outputs that have non-fungible tokens on them.\n conditions: [ '$(OP_INPUTINDEX OP_UTXOTOKENCATEGORY OP_SIZE OP_NIP <32> OP_GREATERTHAN)' ],\n\n transaction: 'burnNonfungibleTokenTransaction',\n },\n\n sign: {\n name: 'Sign Message',\n description: 'Signs a provided message using the Bitcoin message signing protocol.',\n icon: 'sign',\n\n roles: {\n owner: {\n requirements: {\n variables: [ 'messageToSign' ],\n secrets: [ 'ownerKey' ],\n },\n },\n },\n\n requirements: {\n participants: [\n {\n role: 'owner',\n slots: { min: 1, max: 1 },\n },\n ],\n },\n\n data: 'messageSignature',\n },\n verify: {\n name: 'Verify Message Signature',\n description: 'Verifies a provided message signature according to the Bitcoin message signing protocol.',\n icon: 'verify',\n\n roles: {\n owner: {\n requirements: {\n variables: [ 'messageSignature', 'messageToVerify' ],\n secrets: [ 'ownerKey' ],\n },\n },\n },\n\n requirements: {\n participants: [\n {\n role: 'owner',\n slots: { min: 1, max: 1 },\n },\n ],\n },\n\n data: 'messageSignatureValidity',\n },\n },\n\n // Define a set of data that can be used in this template.\n data: {\n messageSignature: {\n // Evaluate CashASM expression to get the signature needed.\n // NOTE: Pushes the prefix and message, then concatenates them together to form the data to sign.\n // NOTE: In libauth today, it seems that this is done by defining the signature as a variable, and tying it to the key and message,\n // and so this is different\n // TODO: Check with Jason and see if there is any reason why this cannot be done like this.\n value: '$(<messagePrefix> <message> OP_CAT <ownerKey.data_signature.top_stack_element>)',\n type: 'signature',\n },\n messageSignatureValidity: {\n // Evaluate the validity of the message with the owners public key.\n value: '$(<messageSignature> <messagePrefix> <message> OP_CAT <ownerKey.public_key> OP_CHECKDATASIG)',\n type: 'integer',\n },\n },\n\n // Define a set of transactions that can be used in this template.\n transactions: {\n receiveTransaction: {\n name: 'Transfer Completed',\n description: 'Transferred an unspecified amount of cash and/or tokens.',\n icon: 'request',\n\n roles: {\n receiver: {\n name: 'Received',\n description: 'Received an unspecified amount of cash and/or tokens.',\n icon: 'receive',\n },\n sender: {\n name: 'Sent',\n description: 'Sent an unspecified amount of cash and/or tokens.',\n icon: 'send',\n },\n },\n\n // Inputs and outputs that must exist in the transaction.\n // NOTE: There is no inputs required, but the engine should detect that there is not sufficient input value to\n // match the output and thus generate an invitation to participate in this action.\n // When the invitation is shared, the other parties can add as many inputs and change outputs as needed.\n inputs: [],\n outputs: [\n {\n output: 'receiveOutput',\n outputIndex: undefined,\n },\n ],\n\n // Standard transaction without a locktime.\n version: 2,\n locktime: 0,\n\n // ...\n composable: true,\n },\n requestSatoshisTransaction: {\n name: 'Satoshis Transferred',\n description: 'Transferred $(<requestedSatoshis>) satoshis.',\n icon: 'request',\n\n roles: {\n receiver: {\n name: 'Received',\n description: 'Received $(<requestedSatoshis>) satoshis.',\n icon: 'receive',\n },\n sender: {\n name: 'Sent',\n description: 'Sent $(<requestedSatoshis>) satoshis.',\n icon: 'send',\n },\n },\n\n // Inputs and outputs that must exist in the transaction.\n // NOTE: There is no inputs required, but the engine should detect that there is not sufficient input value to\n // match the output and thus generate an invitation to participate in this action.\n // When the invitation is shared, the other party can add as many inputs and outputs as needed since this transaction is composable.\n inputs: [],\n outputs: [\n {\n output: 'requestSatoshisOutput',\n outputIndex: undefined,\n },\n ],\n\n // Standard transaction without a locktime.\n version: 2,\n locktime: 0,\n\n // ...\n composable: true,\n },\n requestFungibleTokensTransaction: {\n name: 'Fungible Tokens Transferred',\n description:\n 'Transferred $(<requestedTokenAmount> <requestedTokenCategory.decimalsFactor> OP_DIV).$(<requestedTokenAmount> <requestedTokenCategory.decimalsFactor> OP_MOD) $(<requestedTokenCategory.symbol>) tokens.',\n icon: 'request',\n\n roles: {\n receiver: {\n name: 'Received',\n description:\n 'Received $(<requestedTokenAmount> <requestedTokenCategory.decimalsFactor> OP_DIV).$(<requestedTokenAmount> <requestedTokenCategory.decimalsFactor> OP_MOD) $(<requestedTokenCategory.symbol>) tokens.',\n icon: 'receive',\n },\n sender: {\n name: 'Sent',\n description:\n 'Sent $(<requestedTokenAmount> <requestedTokenCategory.decimalsFactor> OP_DIV).$(<requestedTokenAmount> <requestedTokenCategory.decimalsFactor> OP_MOD) $(<requestedTokenCategory.symbol>) tokens.',\n icon: 'send',\n },\n },\n\n // Inputs and outputs that must exist in the transaction.\n // NOTE: There is no inputs required, but the engine should detect that there is not sufficient input value to\n // match the output and thus generate an invitation to participate in this action.\n // When the invitation is shared, the other party can add as many inputs and outputs as needed since this transaction is composable.\n inputs: [],\n outputs: [\n {\n output: 'requestFungibleTokensOutput',\n outputIndex: undefined,\n },\n ],\n\n // Standard transaction without a locktime.\n version: 2,\n locktime: 0,\n\n // ...\n composable: true,\n },\n requestNonfungibleTokensTransaction: {\n name: 'Non-Fungible Token Transferred',\n description:\n 'Transferred one non-fungible $(<requestedTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <requestedTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) (<requestedTokenCategory.symbol>) token, with $(<requestedTokenCommitment>) commitment.',\n icon: 'request',\n\n roles: {\n receiver: {\n name: 'Received',\n description:\n 'Received one non-fungible $(<requestedTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <requestedTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) (<requestedTokenCategory.symbol>) token, with $(<requestedTokenCommitment>) commitment.',\n icon: 'receive',\n },\n sender: {\n name: 'Sent',\n description:\n 'Sent the requested non-fungible $(<requestedTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <requestedTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) (<requestedTokenCategory.symbol>) token, with $(<requestedTokenCommitment>) commitment.',\n icon: 'send',\n },\n },\n\n // Inputs and outputs that must exist in the transaction.\n // NOTE: There is no inputs required, but the engine should detect that there is not sufficient input value to\n // match the output and thus generate an invitation to participate in this action.\n // When the invitation is shared, the other party can add as many inputs and outputs as needed since this transaction is composable.\n inputs: [],\n outputs: [\n {\n output: 'requestNonfungibleTokensOutput',\n outputIndex: undefined,\n },\n ],\n\n // Standard transaction without a locktime.\n version: 2,\n locktime: 0,\n\n // ...\n composable: true,\n },\n\n transferSatoshisTransaction: {\n name: 'Satoshis Transferred',\n description: '$(<transferredSatoshis>) satoshis were transferred to a recipient.',\n icon: 'send',\n\n roles: {\n receiver: {\n name: 'Received',\n description: 'Received $(<transferredSatoshis>) satoshis.',\n icon: 'receive',\n },\n sender: {\n name: 'Sent',\n description: 'Sent $(<transferredSatoshis>) satoshis.',\n icon: 'send',\n },\n },\n\n // Enforce the inputs and outputs required by the transaction.\n // NOTE: The input is provided from the action since it is only available on outputs with satoshis.\n inputs: [],\n outputs: [\n {\n output: 'transferSatoshisOutput',\n outputIndex: undefined,\n },\n ],\n\n // Standard transaction without a locktime.\n version: 2,\n locktime: 0,\n\n // ...\n composable: true,\n },\n transferFungibleTokensTransaction: {\n name: 'Fungible Tokens Transferred',\n description:\n '$(<transferredTokenAmount> <transferredTokenCategory.decimalsFactor> OP_DIV).$(<transferredTokenAmount> <transferredTokenCategory.decimalsFactor> OP_MOD) $(<transferredTokenCategory.symbol>) tokens were transferred to a recipient.',\n icon: 'send',\n\n roles: {\n receiver: {\n name: 'Received',\n description:\n 'Received $(<transferredTokenAmount> <transferredTokenCategory.decimalsFactor> OP_DIV).$(<transferredTokenAmount> <transferredTokenCategory.decimalsFactor> OP_MOD) $(<transferredTokenCategory.symbol>) tokens.',\n icon: 'receive',\n },\n sender: {\n name: 'Sent',\n description:\n 'Sent $(<transferredTokenAmount> <transferredTokenCategory.decimalsFactor> OP_DIV).$(<transferredTokenAmount> <transferredTokenCategory.decimalsFactor> OP_MOD) $(<transferredTokenCategory.symbol>) tokens.',\n icon: 'send',\n },\n },\n\n // Enforce the inputs and outputs required by the transaction.\n // NOTE: The input is provided from the action since it is only available on outputs with fungible tokens.\n inputs: [],\n outputs: [\n {\n output: 'transferFungibleTokensOutput',\n outputIndex: undefined,\n },\n ],\n\n // Standard transaction without a locktime.\n version: 2,\n locktime: 0,\n\n // ...\n composable: true,\n },\n transferNonfungibleTokensTransaction: {\n name: 'Non-fungible Token Transferred',\n description:\n 'One non-fungible $(<transferredTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <transferredTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) $(<transferredTokenCategory.symbol>) token was transferred to a recipient, with $(<transferredTokenCommitment>) commitment.',\n icon: 'send',\n\n roles: {\n receiver: {\n name: 'Received',\n description:\n 'Received one non-fungible $(<transferredTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <transferredTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) (<transferredTokenCategory.symbol>) token, with $(<transferredTokenCommitment>) commitment.',\n icon: 'receive',\n },\n sender: {\n name: 'Sent',\n description:\n 'Sent one non-fungible $(<transferredTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <transferredTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) (<transferredTokenCategory.symbol>) token, with $(<transferredTokenCommitment>) commitment.',\n icon: 'send',\n },\n },\n\n // Enforce the inputs and outputs required by the transaction.\n // NOTE: The input is provided from the action since it is only available on outputs with a non-fungible token.\n inputs: [],\n outputs: [\n {\n output: 'transferNonfungibleTokenOutput',\n outputIndex: undefined,\n },\n ],\n\n // Standard transaction without a locktime.\n version: 2,\n locktime: 0,\n\n // ...\n composable: true,\n },\n\n burnFungibleTokensTransaction: {\n name: 'Deleted fungible tokens',\n description:\n 'Permanently and irreversibly deleted $(<burnedTokenAmount> <burnedTokenCategory.decimalsFactor> OP_DIV).$(<burnedTokenAmount> <burnedTokenCategory.decimalsFactor> OP_MOD) $(<burnedTokenCategory.symbol>) tokens.',\n icon: 'burn',\n\n // Inputs and outputs that must exist in the transaction.\n // NOTE: There is no defined outputs as any non-burned value is automatically returned as change.\n inputs: [\n {\n input: 'burnFungibleTokensInput',\n inputIndex: undefined,\n },\n ],\n\n outputs: [],\n\n // Standard transaction without a locktime.\n version: 2,\n locktime: 0,\n\n // ...\n composable: true,\n },\n burnNonfungibleTokenTransaction: {\n name: 'Deleted non fungible token',\n description:\n 'Permanently and irreversibly deleted a non-fungible $(<burnedTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <burnedTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) (<burnedTokenCategory.symbol>) token, with $(<burnedTokenCommitment>) commitment.',\n icon: 'burn',\n\n // Inputs and outputs that must exist in the transaction.\n // NOTE: There is no defined outputs as any non-burned value is automatically returned as change.\n inputs: [\n {\n input: 'burnNonfungibleTokenInput',\n inputIndex: undefined,\n },\n ],\n outputs: [],\n\n // Standard transaction without a locktime.\n version: 2,\n locktime: 0,\n\n // ...\n composable: true,\n },\n },\n\n // Define a set of outputs that can be used within transactions in this template.\n outputs: {\n changeOutput: {\n name: 'Change',\n description: 'Funds returned as change.',\n icon: 'receive',\n\n // Defines how the requested funds should be locked.\n lockingScript: 'receivingLockingScript',\n },\n receiveOutput: {\n name: 'Recipient output',\n description: 'Transferred an unspecified amount of cash and/or tokens to a recipient.',\n icon: 'receive',\n\n roles: {\n receiver: {\n name: 'Received',\n description: 'Received an unspecified amount of cash and/or tokens.',\n },\n sender: {\n name: 'Sent',\n description: 'Sent an unspecified amount of cash and/or tokens.',\n },\n },\n\n // Defines how the requested funds should be locked.\n lockingScript: 'receivingLockingScript',\n\n // Set the amount of cash and/or tokens to transfer.\n valueSatoshis: '$(<transferredSatoshis>)',\n token: null,\n },\n requestSatoshisOutput: {\n name: 'Satoshis',\n description: '$(<requestedSatoshis>) satoshis.',\n icon: 'request',\n\n roles: {\n receiver: {\n name: 'Satoshis Received',\n description: 'Received $(<requestedSatoshis>) satoshis.',\n },\n sender: {\n name: 'Satoshis Sent',\n description: 'Sent $(<requestedSatoshis>) satoshis.',\n },\n },\n\n // Defines how the requested funds should be locked.\n lockingScript: 'receivingLockingScript',\n\n // Require the specified number of satoshis and no tokens.\n valueSatoshis: '$(<requestedSatoshis>)',\n token: null,\n },\n requestFungibleTokensOutput: {\n name: 'Fungible $(<requestedTokenCategory.symbol>) Tokens',\n description:\n '$(<requestedTokenAmount> <requestedTokenCategory.decimalsFactor> OP_DIV).$(<requestedTokenAmount> <requestedTokenCategory.decimalsFactor> OP_MOD) $(<requestedTokenCategory.symbol>) tokens.',\n icon: 'request',\n\n roles: {\n receiver: {\n name: 'Fungible $(<requestedTokenCategory.symbol>) Tokens Received',\n description:\n 'Received $(<requestedTokenAmount> <requestedTokenCategory.decimalsFactor> OP_DIV).$(<requestedTokenAmount> <requestedTokenCategory.decimalsFactor> OP_MOD) $(<requestedTokenCategory.symbol>) tokens.',\n },\n sender: {\n name: 'Fungible $(<requestedTokenCategory.symbol>) Tokens Sent',\n description:\n 'Sent $(<requestedTokenAmount> <requestedTokenCategory.decimalsFactor> OP_DIV).$(<requestedTokenAmount> <requestedTokenCategory.decimalsFactor> OP_MOD) $(<requestedTokenCategory.symbol>) tokens.',\n },\n },\n\n // Defines how the requested funds should be locked.\n lockingScript: 'receivingLockingScript',\n\n // Require a flat 1000 satoshis to ensure the fungible tokens remains transferrable.\n valueSatoshis: '1000',\n\n // Require only the specified amount and type of fungible tokens.\n // NOTE: This can be composed with a request for a non-fungible token, but will always result in two separate outputs.\n token: {\n category: '$(<requestedTokenCategory>)',\n amount: '$(<requestedTokenAmount>)',\n nft: null,\n },\n },\n requestNonfungibleTokensOutput: {\n name: 'Non-fungible $(<requestedTokenCategory.symbol>) Token',\n description:\n 'Transferred one non-fungible $(<requestedTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <requestedTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) $(<requestedTokenCategory.symbol>) token to a recipient, with $(<requestedTokenCommitment>) commitment.',\n icon: 'request',\n\n roles: {\n receiver: {\n name: 'Non-fungible $(<requestedTokenCategory.symbol>) Token Received',\n description:\n 'Received one non-fungible $(<requestedTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <requestedTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) $(<requestedTokenCategory.symbol>) token, with $(<requestedTokenCommitment>) commitment.',\n },\n sender: {\n name: 'Non-fungible $(<requestedTokenCategory.symbol>) Token Sent',\n description:\n 'Sent the requested non-fungible $(<requestedTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <requestedTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) $(<requestedTokenCategory.symbol>) token, with $(<requestedTokenCommitment>) commitment.',\n },\n },\n\n // Defines how the requested funds should be locked.\n lockingScript: 'receivingLockingScript',\n\n // Require a flat 1000 satoshis to ensure the non-fungible token remains transferrable.\n valueSatoshis: '1000',\n\n // Require only an NFT with specified category, capability and commitment.\n // NOTE: This can be composed with a request for fungible token amounts, but will always result in two separate outputs.\n token: {\n category: '$(<requestedTokenCategory>)',\n amount: null,\n nft: {\n capability: '$(<requestedTokenCapability>)',\n commitment: '$(<requestedTokenCommitment>)',\n },\n },\n },\n\n transferSatoshisOutput: {\n name: 'Recipient output',\n description: 'Transferred $(<transferredSatoshis>) satoshis to a recipient.',\n icon: 'send',\n\n roles: {\n receiver: {\n name: 'Received',\n description: 'Received $(<transferredSatoshis>) satoshis.',\n },\n sender: {\n name: 'Sent',\n description: 'Sent $(<transferredSatoshis>) satoshis.',\n },\n },\n\n // Use the recipients lockscript.\n lockingScript: 'sendingLockingscript',\n\n // Set the amount of satoshis to transfer.\n valueSatoshis: '$(<transferredSatoshis>)',\n },\n transferFungibleTokensOutput: {\n name: 'Recipient output',\n description:\n 'Transferred $(<transferredTokenAmount> <transferredTokenCategory.decimalsFactor> OP_DIV).$(<transferredTokenAmount> <transferredTokenCategory.decimalsFactor> OP_MOD) $(<transferredTokenCategory.symbol>) tokens to a recipient.',\n icon: 'send',\n\n roles: {\n receiver: {\n name: 'Received',\n description:\n 'Received $(<transferredTokenAmount> <transferredTokenCategory.decimalsFactor> OP_DIV).$(<transferredTokenAmount> <transferredTokenCategory.decimalsFactor> OP_MOD) $(<transferredTokenCategory.symbol>) tokens.',\n },\n sender: {\n name: 'Sent',\n description:\n 'Sent $(<transferredTokenAmount> <transferredTokenCategory.decimalsFactor> OP_DIV).$(<transferredTokenAmount> <transferredTokenCategory.decimalsFactor> OP_MOD) $(<transferredTokenCategory.symbol>) tokens.',\n },\n },\n\n // Use the recipients lockscript.\n lockingScript: 'sendingLockingscript',\n\n // Set the amount of fungible tokens to transfer.\n token: {\n category: '$(<transferredTokenCategory>)',\n amount: '$(<transferredTokenAmount>)',\n },\n },\n transferNonfungibleTokenOutput: {\n name: 'Recipient output',\n description:\n 'Transferred one non-fungible $(<transferredTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <transferredTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) $(<transferredTokenCategory.symbol>) token to a recipient, with $(<transferredTokenCommitment>) commitment.',\n icon: 'send',\n\n roles: {\n receiver: {\n name: 'Received',\n description:\n 'Received one non-fungible $(<transferredTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <transferredTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) $(<transferredTokenCategory.symbol>) token, with $(<transferredTokenCommitment>) commitment.',\n },\n sender: {\n name: 'Sent',\n description:\n 'Sent one non-fungible $(<transferredTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <transferredTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) $(<transferredTokenCategory.symbol>) token, with $(<transferredTokenCommitment>) commitment.',\n },\n },\n\n // Use the recipients lockscript.\n lockingScript: 'sendingLockingscript',\n\n // Set the non-fungible token to transfer.\n token: {\n category: '$(<transferredTokenCategory>)',\n nft: {\n capability: '$(<transferredTokenCapability>)',\n commitment: '$(<transferredTokenCommitment>)',\n },\n },\n },\n },\n\n inputs: {\n burnFungibleTokensInput: {\n name: 'Deleted fungible tokens',\n description: 'Permanently and irreversibly deleted $(<burnedTokenAmount>) $(<burnedTokenCategory>).',\n icon: 'burn',\n\n // Define which unlocking script unlocks this input.\n unlockingScript: 'unlockP2PKH',\n\n // Require a fungible token of the requested token category, with an amount larger than or equal to the requested amount to burn.\n token: {\n category: '$(<burnedTokenCategory>)',\n amount: '$(<this.fungibleTokenAmount> <burnedTokenAmount> OP_GREATERTHANOREQUAL OP_IF <this.fungibleTokens> OP_ENDIF)',\n },\n\n // Ignore the burned token amount when determining change for this output.\n // NOTE: The engine must check that this does not exceed the input value.\n omitChangeAmounts: {\n fungibleTokens: '$(<burnedTokenAmount>)',\n },\n },\n burnNonfungibleTokenInput: {\n name: 'Deleted non-fungible token',\n description:\n 'Permanently and irreversibly burned one non-fungible $(<burnedTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <burnedTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) token of category $(<burnedTokenCategory>), with a $(<burnedTokenCommitment>) commitment.',\n icon: 'burn',\n\n // Define which unlocking script unlocks this input.\n unlockingScript: 'unlockP2PKH',\n\n // Require a non-fungible token of the specified category, capability and commitment to burn.\n token: {\n category: '$(<burnedTokenCategory>)',\n nft: {\n capability: '$(<burnedTokenCapability>)',\n commitment: '$(<burnedTokenCommitment>)',\n },\n },\n\n // Ignore the burned token when determining change for this output.\n // NOTE: The engine must check that this does not exceed the input value.\n omitChangeAmounts: {\n nonfungibleTokens: 1,\n },\n },\n },\n\n // Define locking scripts used by this template.\n // NOTE: Template supported wallets should automatically track all generated lockscripts for on-chain events.\n lockingScripts: {\n sendingLockingscript: {\n // TODO: This currently describes outputs locked to this script, but all actions creating such outputs already have descriptions.\n // This can either be dropped, or maybe more importantly, should be disambiguated so that lockscripts can provide separate\n // descriptions for their script and the outputs that are locked to them. Leaving as a TODO for now and will address later.\n name: 'Sent',\n description: 'Funds sent to an external recipient',\n icon: 'address',\n\n // ...\n lockingType: 'p2pkh',\n lockingBytecode: 'lockToRecipient',\n\n // Indicate that the sent output does not belong to the initiating user.\n // NOTE: These values default to false/empty, but added here for additional clarity.\n actions: [],\n state: { variables: [], secrets: [] },\n balance: {},\n selectable: false,\n },\n receivingLockingScript: {\n // NOTE: Outputs to this lockscript by external actors defaults to this description when detected on-chain.\n name: 'Received',\n description: 'Funds received without wallet coordination.',\n icon: 'address',\n\n // Defines how spending future received funds should be locked.\n lockingType: 'p2pkh',\n lockingBytecode: 'lockP2PKH',\n\n // Define a default unlocking script to be used when no action provided script is present.\n unlockingBytecode: 'unlockP2PKH',\n\n // Participants without a role or observers cannot take any further actions.\n // NOTE: This is not required but shown here for illustrative purposes.\n actions: [],\n\n roles: {\n receiver: {\n // The only state that is required to be persisted when receiving funds is the owners private key.\n // NOTE: This is defined as a secret to not leak when creating invitations for others to participate in request or send actions.\n state: {\n variables: [],\n secrets: [ 'ownerKey' ],\n },\n\n // List actions that can be taken with the ownerKey for each address/lockscript.\n actions: [\n {\n action: 'sign',\n role: 'owner',\n secrets: [{ ownerKey: null }],\n },\n {\n action: 'verify',\n role: 'owner',\n secrets: [{ ownerKey: null }],\n },\n {\n action: 'sendSatoshis',\n role: 'sender',\n secrets: [{ ownerKey: null }],\n },\n {\n action: 'sendFungibleTokens',\n role: 'sender',\n secrets: [{ ownerKey: null }],\n },\n {\n action: 'sendNonfungibleTokens',\n role: 'sender',\n secrets: [{ ownerKey: null }],\n },\n {\n action: 'burnFungibleTokens',\n role: 'sender',\n secrets: [{ ownerKey: null }],\n },\n {\n action: 'burnNonfungibleTokens',\n role: 'sender',\n secrets: [{ ownerKey: null }],\n },\n ],\n\n // Indicates how much of received funds should be part of a wallets total balance.\n // NOTE: Evaluates in the context of the source transaction, with the current outputs technical data available under this.output.*\n // NOTE: A CashASM expression of '1' means include 100% of this asset in the balance.\n // NOTE: Since we know that the owner controls all assets, we short-cut the evaluations by setting 1 directly.\n balance: {\n satoshis: true,\n fungibleTokens: true,\n nonfungibleTokens: true,\n },\n\n // Indicate when received funds should be considered in automatic coin selection to meet input requirements of other transactions.\n // NOTE: Evaluates in the context of the source transaction, with the current outputs technical data available under this.output.*\n // NOTE: This evaluates to a boolean. If non-true, the output should not be considered for automatic coin selection.\n // NOTE: Since we know that the secret key exist for the owner, this template short-cuts the evaluation by setting true directly.\n selectable: true,\n },\n },\n },\n },\n\n // Define a set of scripts that can be used in this template.\n scripts: {\n lockP2PKH: 'OP_DUP OP_HASH160 <$(<ownerKey.public_key> OP_HASH160)> OP_EQUALVERIFY OP_CHECKSIG',\n unlockP2PKH: '<ownerKey.schnorr_signature.all_outputs> <ownerKey.public_key>',\n lockToRecipient: '<recipientLockingscript>',\n },\n\n // TODO: Add icons\n constants: {\n dustLimit: {\n name: 'Dust Limit',\n description: 'Standard required minimum satoshis for Pay to Public Key Hash outputs.',\n type: 'integer',\n value: 546,\n },\n\n // Define a message prefix for use in arbitrary message signing.\n messagePrefix: {\n name: 'Message Prefix',\n description: 'Standard message prefix used in the bitcoin signed message protocol.',\n type: 'bytes',\n\n // Value is enforced to the bitcoin signing magic string:\n // \"\\x18Bitcoin Signed Message:\\n\"\n value: '0x18426974636f696e205369676e6564204d6573736167653a0a',\n },\n },\n\n // TODO: Add icons\n variables: {\n // Describe the secret private key.\n ownerKey: {\n name: 'Owners Private Key',\n description: 'The private key used to authorize spending of received funds.',\n type: 'private_key',\n },\n\n recipientLockingscript: {\n name: 'Recipient Locking Script',\n description: 'The locking script that receives the transferred value.',\n type: 'locking_script',\n },\n\n messageToSign: {\n name: 'Message',\n description: 'The text message to sign.',\n type: 'string',\n },\n messageToVerify: {\n name: 'Message',\n description: 'The text message to verify.',\n type: 'string',\n },\n messageSignature: {\n name: 'Message Signature',\n description: 'The signature for the message.',\n type: 'signature',\n },\n\n // Describe the parameters used when requesting value.\n requestedSatoshis: {\n name: 'Requested Amount',\n description: 'The Bitcoin Cash amount requested',\n type: 'satoshis',\n },\n transferredSatoshis: {\n name: 'Transferred Amount',\n description: 'The Bitcoin Cash amount transferred',\n type: 'satoshis',\n },\n requestedTokenCategory: {\n name: 'Requested Token Category',\n description: 'The token category requested',\n type: 'token_category',\n },\n requestedTokenAmount: {\n name: 'Requested Token Amount',\n description: 'The fungible token amount requested',\n type: 'token_amount',\n },\n requestedTokenCapability: {\n name: 'Requested Token Capability',\n description: 'The non-fungible token capability requested',\n type: 'token_capability',\n },\n requestedTokenCommitment: {\n name: 'Requested Token Commitment',\n description: 'The non-fungible token commitment requested',\n type: 'token_commitment',\n },\n transferredTokenCategory: {\n name: 'Sending Token Category',\n description: 'The token category of the token(s) to send',\n type: 'token_category',\n },\n transferredTokenAmount: {\n name: 'Sending Token Amount',\n description: 'The fungible token amount to send',\n type: 'token_amount',\n },\n transferredTokenCapability: {\n name: 'Sending Token Capability',\n description: 'The token capability for the non-fungible token to send',\n type: 'token_capability',\n },\n transferredTokenCommitment: {\n name: 'Sending Token Commitment',\n description: 'The token commitment for the non-fungible token to send',\n type: 'token_commitment',\n },\n burnedTokenCategory: {\n name: 'Deleted Token Category',\n description: 'The token category of the token(s) to delete',\n type: 'token_category',\n },\n burnedTokenAmount: {\n name: 'Deleted Token Amount',\n description: 'The fungible token amount to delete',\n type: 'token_amount',\n },\n burnedTokenCapability: {\n name: 'Deleted Token Capability',\n description: 'The token capability for the non-fungible token to delete',\n type: 'token_capability',\n },\n burnedTokenCommitment: {\n name: 'Deleted Token Commitment',\n description: 'The token commitment for the non-fungible token to delete',\n type: 'token_commitment',\n },\n },\n\n // Define a list of re-usable icons that can be used as part of metadata.\n // NOTE: the actual icons are not embedded in the template but only referenced by hashes here,\n // and can be distributed either as an asset pack or looked up through something like IPFS.\n icons: [\n {\n name: 'wallet',\n hash: '0000000000000000000000',\n },\n {\n name: 'owner',\n hash: '0000000000000000000000',\n },\n {\n name: 'sender',\n hash: '0000000000000000000000',\n },\n {\n name: 'address',\n hash: '0000000000000000000000',\n },\n {\n name: 'receive',\n hash: '0000000000000000000000',\n },\n {\n name: 'request',\n hash: '0000000000000000000000',\n },\n {\n name: 'send',\n hash: '0000000000000000000000',\n },\n {\n name: 'burn',\n hash: '0000000000000000000000',\n },\n {\n name: 'sign',\n hash: '0000000000000000000000',\n },\n {\n name: 'verify',\n hash: '0000000000000000000000',\n },\n ],\n\n scenarios: [\n {\n name: 'requesting satoshis',\n description: 'happy-path evaluation for requesting satoshis.',\n\n // The action being run in the scenario.\n action: 'requestSatoshis',\n\n // List of roles taken in this scenario, and the resources they provided.\n roles: [\n {\n role: 'receiver',\n values: {\n generated: {\n ownerKey: 'KyRQa5pEXuzVcDwnXRLpYAascjchQW5DoxVRMbj4DTxS83573mz8',\n },\n variables: {\n requestedSatoshis: 2000,\n },\n secrets: {\n // This scenario does not carry any secrets.\n },\n inputs: [],\n outputs: [\n {\n lockingBytecode: '76a91475c715ecb74178fe87933e57e947e5e92d904b8188ac',\n valueSatoshis: 2000,\n },\n ],\n },\n },\n {\n role: 'sender',\n values: {\n // The sender provides no raw data to the action.\n generated: {},\n variables: {},\n secrets: {},\n\n // The sender does provide input and change.\n inputs: [\n {\n outpointTransactionHash: '4ef28553a31a266719e66ba97fee3aeecd6d1788f7ff6ab12f8ebceda49660c0',\n outpointIndex: 0,\n sequenceNumber: 0,\n unlockingBytecode:\n '41226b2be7c2890c8bbde2f79e79640e56d866843f2e822ec51c469019d13db04a422c9ee49f5eefd26fee24e91910edbbb032b90cc54c34da80a61e69b0ee3d22412103e7ab26c36a7c7f45b2c26f33c08b0fa43a633268700f47216646d4cb37ae5696',\n },\n ],\n outputs: [\n {\n lockingBytecode: '76a91475c715ecb74178fe87933e57e947e5e92d904b8188ac',\n valueSatoshis: 2000,\n },\n ],\n },\n },\n ],\n\n // List of resources provided outside the context of a role.\n values: {\n generated: {\n // This scenario does not have any non-role generated values.\n },\n variables: {\n // This scenario does not have any non-role variables.\n },\n secrets: {\n // This scenario does not have any non-role secrets.\n },\n },\n\n // Outcomes provides the set of resulting values created from the action.\n outcome: {\n roles: {\n receiver: {\n name: 'Request',\n description: 'Requested a specific amount of satoshis from one or more senders.',\n icon: 'request',\n },\n sender: {\n name: 'Send',\n description: 'Sent a specific amount of satoshis to the provided receiver.',\n icon: 'send',\n },\n },\n\n transactions: [\n {\n transaction:\n '0200000001c06096a4edbc8e2fb16afff788176dcdee3aee7fa96be61967261aa35385f24e000000006441226b2be7c2890c8bbde2f79e79640e56d866843f2e822ec51c469019d13db04a422c9ee49f5eefd26fee24e91910edbbb032b90cc54c34da80a61e69b0ee3d22412103e7ab26c36a7c7f45b2c26f33c08b0fa43a633268700f47216646d4cb37ae5696000000000267530300000000001976a91475c715ecb74178fe87933e57e947e5e92d904b8188acd0070000000000001976a91475c715ecb74178fe87933e57e947e5e92d904b8188ac00000000',\n value: '',\n },\n ],\n },\n },\n ],\n};\n","import type { XOTemplate } from '@xo-cash/types';\n\n/**\n * Encodes the user parts of the https://wrapped.cash/ use case as an XO template.\n *\n * The bootstrap ceremony is not encoded in this template, but the final categoryId\n * is properly encoded here and ensure we are operating with the correct token.\n */\nexport const wrapBCHTemplate: XOTemplate = {\n $schema: 'https://libauth.org/schemas/wallet-template-v0.schema.json',\n\n name: 'Wrapped BCH',\n description: 'Convert between BCH and wBCH tokens.',\n icon: 'logo',\n\n version: '1',\n supported: [ 'BCH_2023_05', 'BCH_2024_05', 'BCH_2025_05', 'BCH_2026_05' ],\n\n resources: [\n {\n name: 'Official Website',\n description: 'Official homepage for the wBCH token.',\n\n url: 'https://wrapped.cash/',\n },\n ],\n\n roles: {\n wrapper: {\n name: 'Wrapper',\n description: 'The person wrapping BCH into wBCH.',\n icon: 'user',\n },\n unwrapper: {\n name: 'Unwrapper',\n description: 'The person unwrapping wBCH into BCH.',\n icon: 'user',\n },\n service: {\n name: 'Provider',\n description: 'The application providing the wrapping service.',\n icon: 'contract',\n },\n },\n\n // The engine has no knowledge of the covenant UTXOs and therefore cannot initiate wrap/unwrap, so the starting actions have been omitted.\n start: [],\n\n actions: {\n wrap: {\n name: 'Wrap BCH',\n description: 'Convert BCH into wBCH tokens.',\n icon: 'wrap',\n\n roles: {\n service: {\n requirements: {\n variables: [ 'direction', 'poolSatoshis', 'poolTokens', 'amountToWrap', 'amountToUnwrap' ],\n },\n },\n wrapper: {\n requirements: {\n variables: [ 'recipientLockingScript' ],\n },\n },\n },\n\n requirements: {\n participants: [\n { role: 'service', slots: { min: 1, max: 1 } },\n { role: 'wrapper', slots: { min: 1, max: 1 } },\n ],\n },\n\n transaction: 'wrapTransaction',\n },\n\n unwrap: {\n name: 'Unwrap wBCH',\n description: 'Convert wBCH tokens back into BCH.',\n icon: 'unwrap',\n\n roles: {\n service: {\n requirements: {\n variables: [ 'direction', 'poolSatoshis', 'poolTokens', 'amountToWrap', 'amountToUnwrap' ],\n },\n },\n unwrapper: {\n requirements: {\n variables: [ 'recipientLockingScript' ],\n },\n },\n },\n\n requirements: {\n participants: [\n { role: 'service', slots: { min: 1, max: 1 } },\n { role: 'unwrapper', slots: { min: 1, max: 1 } },\n ],\n },\n\n transaction: 'unwrapTransaction',\n },\n },\n\n transactions: {\n wrapTransaction: {\n name: 'Wrapped BCH',\n description: 'Wrapped $(<amountToWrap> <satoshisPerBCH> OP_DIV).$(<amountToWrap> <satoshisPerBCH> OP_MOD) BCH into wBCH tokens.',\n icon: 'wrap',\n\n inputs: [{ input: 'covenantInput', inputIndex: 0 }],\n outputs: [\n { output: 'covenantOutput', outputIndex: 0 },\n { output: 'wrappedTokensOutput', outputIndex: undefined },\n ],\n },\n\n unwrapTransaction: {\n name: 'Unwrapped wBCH',\n description:\n 'Unwrapped $(<amountToUnwrap> <satoshisPerBCH> OP_DIV).$(<amountToUnwrap> <satoshisPerBCH> OP_MOD) wBCH tokens back into BCH.',\n icon: 'unwrap',\n\n inputs: [{ input: 'covenantInput', inputIndex: 0 }],\n outputs: [\n { output: 'covenantOutput', outputIndex: 0 },\n { output: 'unwrappedSatoshisOutput', outputIndex: undefined },\n ],\n },\n },\n\n inputs: {\n covenantInput: {\n name: 'wBCH Covenant',\n description: 'The covenant being updated.',\n icon: 'contract',\n\n valueSatoshis: '$(<poolSatoshis>)',\n token: {\n category: '$(<wbchTokenCategory>)',\n amount: '$(<poolTokens>)',\n nft: null,\n },\n\n // NOTE: This should be named unlockingBytecode, as it refers to raw script and not an unlocking script entry.\n // TODO: Rename after: https://gitlab.com/GeneralProtocols/xo/templates/-/work_items/31\n unlockingScript: 'wrapBCHUnlockingBytecode',\n },\n },\n\n outputs: {\n covenantOutput: {\n name: 'wBCH Covenant',\n description: 'Holds BCH and wBCH tokens that can be freely converted.',\n icon: 'contract',\n\n lockingScript: 'wrapBCHLockingScript',\n\n valueSatoshis: '$(covenantChangeSatoshis)',\n token: {\n category: '$(<wbchTokenCategory>)',\n amount: '$(covenantChangeTokens)',\n nft: null,\n },\n\n roles: {\n // Indicate that users should not index this output.\n wrapper: { relevant: false },\n unwrapper: { relevant: false },\n\n // Define how the service provider can interact with this output.\n service: {\n // Define wrap and unwrap actions that the service provider can initialize.\n // TODO: Restore this functionality if needed in the future.\n // actions: [\n // {\n // action: 'wrap',\n // role: 'service',\n // variables: [\n // { direction: '$(<\"wrap\">)' },\n // { poolSatoshis: '$(XO_OUTPUTVALUE)' },\n // { poolTokens: '$(XO_OUTPUTTOKENAMOUNT)' },\n // ],\n // },\n // {\n // action: 'unwrap',\n // role: 'service',\n // variables: [\n // { direction: '$(<\"unwrap\">)' },\n // { poolSatoshis: '$(XO_OUTPUTVALUE)' },\n // { poolTokens: '$(XO_OUTPUTTOKENAMOUNT)' },\n // ],\n // },\n // ],\n\n // Mark balance as unavailable, since the service provider cannot spend from the contract.\n balance: {\n satoshis: 0n,\n fungibleTokens: 0n,\n },\n\n // Mark output as not selectable, since the service provider cannot spend from the contract.\n selectable: false,\n },\n },\n },\n\n wrappedTokensOutput: {\n name: 'Wrapped wBCH',\n description: 'Wrapped $(<amountToWrap> <satoshisPerBCH> OP_DIV).$(<amountToWrap> <satoshisPerBCH> OP_MOD) wBCH tokens.',\n icon: 'receive',\n\n valueSatoshis: '$(<tokenDust>)',\n token: {\n category: '$(<wbchTokenCategory>)',\n amount: '$(<amountToWrap>)',\n nft: null,\n },\n\n // NOTE: This should be named lockingBytecode, so that the engine does not need to create and track this locking script from here.\n // TODO: Rename after: https://gitlab.com/GeneralProtocols/xo/templates/-/work_items/36\n lockingScript: '$(<recipientLockingScript>)',\n },\n\n unwrappedSatoshisOutput: {\n name: 'Unwrapped BCH',\n description: 'Unwrapped $(<amountToUnwrap> <satoshisPerBCH> OP_DIV).$(<amountToUnwrap> <satoshisPerBCH> OP_MOD) BCH.',\n icon: 'receive',\n\n valueSatoshis: '$(<amountToUnwrap>)',\n token: null,\n\n // NOTE: This should be named lockingBytecode, so that the engine does not need to create and track this locking script from here.\n // TODO: Rename after: https://gitlab.com/GeneralProtocols/xo/templates/-/work_items/36\n lockingScript: '$(<recipientLockingScript>)',\n },\n },\n\n lockingScripts: {\n wrapBCHLockingScript: {\n name: 'wBCH Covenant',\n description: 'Holds BCH and wBCH tokens that can be freely converted.',\n icon: 'contract',\n\n lockingType: 'p2sh',\n lockingBytecode: 'wrapBCHLockingBytecode',\n\n // All outputs on the covenant are covenant outputs.\n // TODO: Add this defaultOutput after: https://gitlab.com/GeneralProtocols/xo/templates/-/work_items/33\n // defaultOutput: 'covenantOutput',\n\n // Indicate that users should not index this locking script.\n roles: {\n wrapper: { relevant: false },\n unwrapper: { relevant: false },\n },\n },\n },\n\n scripts: {\n // Utility to check if we are doing a wrap or unwrap.\n checkIfWrapping: '<direction> <\"wrap\"> OP_EQUAL',\n\n // Utilities to calculate the covenant change satoshis.\n wrappedChangeSatoshis: '<poolSatoshis> <amountToWrap> OP_ADD',\n unwrappedChangeSatoshis: '<poolSatoshis> <amountToUnwrap> OP_SUB',\n covenantChangeSatoshis: 'checkIfWrapping OP_IF wrappedChangeSatoshis OP_ELSE unwrappedChangeSatoshis OP_ENDIF',\n\n // Utilities to calculate the covenant change tokens.\n wrappedChangeTokens: '<poolTokens> <amountToWrap> OP_SUB',\n unwrappedChangeTokens: '<poolTokens> <amountToUnwrap> OP_ADD',\n covenantChangeTokens: 'checkIfWrapping OP_IF wrappedChangeTokens OP_ELSE unwrappedChangeTokens OP_ENDIF',\n\n // NOTE: This is the wrapped.cash covenant and so this bytecode cannot be updated.\n // NOTE: This covenant only ensure the security of its own funds, leaving user protection to be done in user space.\n enforceCovenantPersists: 'OP_INPUTINDEX OP_OUTPUTBYTECODE OP_INPUTINDEX OP_UTXOBYTECODE OP_EQUALVERIFY',\n enforceTokenCategoryPreserved: 'OP_INPUTINDEX OP_OUTPUTTOKENCATEGORY OP_INPUTINDEX OP_UTXOTOKENCATEGORY OP_EQUALVERIFY',\n enforceValueTokenSumConserved:\n 'OP_INPUTINDEX OP_UTXOTOKENAMOUNT OP_INPUTINDEX OP_UTXOVALUE OP_ADD OP_INPUTINDEX OP_OUTPUTTOKENAMOUNT OP_INPUTINDEX OP_OUTPUTVALUE OP_ADD OP_NUMEQUAL',\n\n // The final lock and unlocking bytecode.\n wrapBCHLockingBytecode: 'enforceCovenantPersists enforceTokenCategoryPreserved enforceValueTokenSumConserved',\n wrapBCHUnlockingBytecode: '<wrapBCHLockingBytecode>',\n },\n\n constants: {\n wbchTokenCategory: {\n name: 'wBCH Token Category',\n description: 'The official token category for Wrapped BCH.',\n type: 'bytes',\n value: 'ff4d6e4b90aa8158d39c5dc874fd9411af1ac3b5ed6f354755e8362a0d02c6b3',\n },\n satoshisPerBCH: {\n name: 'Satoshis per BCH',\n description: 'Used to display amounts in BCH with decimals.',\n type: 'integer',\n value: 100000000,\n },\n tokenDust: {\n name: 'Token Dust Limit',\n description: 'Minimal satoshis required for a token-bearing output.',\n type: 'integer',\n value: 1000,\n },\n },\n\n variables: {\n // Internal variables to be provided by the service provider application.\n direction: {\n name: 'Wrap or Unwrap',\n description: 'Internal variable used to determine if we are wrapping or unwrapping.',\n type: 'string',\n },\n amountToWrap: {\n name: 'Amount to Wrap',\n description: 'How much BCH to convert to wBCH (in satoshis).',\n type: 'satoshis',\n },\n amountToUnwrap: {\n name: 'Amount to Unwrap',\n description: 'How much wBCH to convert back to BCH (in satoshis).',\n type: 'satoshis',\n },\n poolSatoshis: {\n name: 'Initial Pool Satoshis',\n description: 'Internal variable used to determine how much satoshis to keep on the covenant.',\n type: 'integer',\n },\n poolTokens: {\n name: 'Initial Pool Tokens',\n description: 'Internal variable used to determine how much fungible tokens to keep on the covenant.',\n type: 'integer',\n },\n\n // The receiving locking script provided by the user.\n recipientLockingScript: {\n name: 'Destination',\n description: 'Where to receive your BCH or wBCH tokens.',\n type: 'locking_script',\n },\n },\n\n icons: [\n { name: 'logo', hash: 'c9fc99d9a819fcf35ee757f7358585838f3265e5e3cfdfc9de748656d44c5b8d' },\n { name: 'wrap', hash: 'db38e42a31bb522a0c3808547382c112366c03154d2b9c472ce81b82aae8023a' },\n { name: 'unwrap', hash: '635737592d8dce787b05956d9670c27db7a90f810eaf2c3b499a4392c3b91ff7' },\n { name: 'user', hash: '664914219d38a18caf0acd08701016b2c1f67adac7f498530820f6989cb2a66f' },\n { name: 'contract', hash: '4c00dd6692b2e2ea65ca288db7cfd84862dc22958d673595b5ab1cd83e452946' },\n { name: 'receive', hash: 'bfefd05d851968f7d205ee7eab2659460a36b95a2c04aa09a1b10542695bd3c6 ' },\n ],\n};\n","import type { XOTemplate } from '@xo-cash/types';\n\nexport const faucetCashTemplate: XOTemplate = {\n $schema: 'https://libauth.org/schemas/wallet-template-v0.schema.json',\n\n name: 'faucet.cash',\n description: 'A public Bitcoin Cash faucet with on-chain rate limits.',\n icon: 'faucet',\n\n version: '1',\n supported: [ 'BCH_2023_05', 'BCH_2024_05', 'BCH_2025_05', 'BCH_2026_05' ],\n\n resources: [\n {\n name: 'Original faucet contract',\n description: 'The original bitcoin-cash-faucet contract by 2qx that this template implements.',\n url: 'https://github.com/2qx/bitcoin-cash-faucet',\n },\n ],\n\n roles: {\n recipient: {\n name: 'Recipient',\n description: 'Someone receiving a funds from the faucet.',\n icon: 'recipient',\n },\n service: {\n name: 'Provider',\n description: 'Selects the faucet coin and fills in its value so the payout can be built.',\n icon: 'faucet',\n },\n },\n\n // The engine cannot discover faucet UTXOs on its own.\n // A service provide is expected to choose faucet variables and provide the input to pay out from.\n start: [],\n\n actions: {\n claim: {\n name: 'Receive from faucet',\n description: 'Receive a small amount of satoshis from a faucet.',\n icon: 'drip',\n\n roles: {\n service: {\n requirements: {\n variables: [ 'faucetIndex', 'periodBlocks', 'payoutSatoshis', 'faucetSatoshis' ],\n },\n },\n recipient: {\n requirements: {\n variables: [ 'payoutLockingScript' ],\n },\n },\n },\n\n requirements: {\n participants: [\n { role: 'service', slots: { min: 1, max: 1 } },\n { role: 'recipient', slots: { min: 1, max: 1 } },\n ],\n },\n\n transaction: 'claimTransaction',\n },\n },\n\n transactions: {\n claimTransaction: {\n name: 'Received from faucet',\n description: 'Received $(<faucetSatoshis>) satoshis from a faucet.',\n icon: 'drip',\n\n inputs: [\n { input: 'faucetInput', inputIndex: 0 },\n ],\n outputs: [\n { output: 'faucetOutput', outputIndex: 0 },\n { output: 'payoutOutput', outputIndex: undefined },\n ],\n },\n },\n\n inputs: {\n faucetInput: {\n name: 'Faucet funds',\n description: 'The faucet funds used for the payout.',\n icon: 'faucet',\n\n // Set the expected satoshis on the faucet output to spend.\n // NOTE: This is only validated by the engine, but is needed so that we can calculate the remaining satoshis after a payout.\n valueSatoshis: '$(<faucetSatoshis>)',\n token: null,\n\n // Set a relative lock-time preventing this input from being spent until it has reached this age.\n // NOTE: This only restricts an input created with this, the contract will later verify this as part of the spending constraints.\n sequenceNumber: '$(<periodBlocks>)',\n\n // Set the unlocking script to use for the faucets input.\n unlockingScript: 'faucetP2SH20UnlockingBytecode',\n },\n },\n\n outputs: {\n faucetOutput: {\n name: 'Faucet funds',\n description: 'The faucet funds remaining after the payout.',\n icon: 'faucet',\n\n // Set the faucets locking script.\n lockingScript: 'faucetContract',\n\n // Enforce that all funds not disbursed is returned to the faucet.\n valueSatoshis: '$(remainingFaucetSatoshis)',\n token: null,\n\n // Contract coins should not be used in automatic coin selection.\n selectable: false,\n\n // The balance on the faucet contract does not belong to anyone.\n balance: {\n satoshis: 0n,\n fungibleTokens: 0n,\n nonfungibleTokens: 0,\n },\n\n // Tracking of the faucet locking script is not relevant for recipients\n roles: {\n recipient: {\n relevant: false,\n },\n },\n },\n\n payoutOutput: {\n name: 'Faucet payout',\n description: '$(<faucetSatoshis>) satoshis paid out from the faucet.',\n icon: 'drip',\n\n // NOTE: the locking script is not enforced by the original contract, but is handled by template policy here.\n lockingScript: '$(<payoutLockingScript>)',\n valueSatoshis: '$(<payoutSatoshis> <minerFeeSatoshis> OP_SUB)',\n token: null,\n },\n },\n\n lockingScripts: {\n faucetContract: {\n name: 'The faucet.cash contract',\n description: 'Locking script that enforces the faucet.cash rules.',\n icon: 'faucet',\n\n // The faucets locking script.\n // NOTE: This is defined as p2s here, since XO only supports P2SH32 and the faucet is using the older P2SH20 construction.\n lockingType: 'p2s',\n lockingBytecode: 'faucetP2SH20LockingBytecode',\n\n // The faucet contract does not need to carry any state outside the on-chain data.\n state: { variables: [], secrets: [] },\n\n // Contract coins should not be used in automatic coin selection.\n selectable: false,\n\n // The balance on the faucet contract does not belong to anyone.\n balance: {\n satoshis: 0n,\n fungibleTokens: 0n,\n nonfungibleTokens: 0,\n },\n\n // Tracking of the faucet locking script is not relevant for recipients\n roles: {\n recipient: {\n relevant: false,\n },\n },\n },\n },\n\n scripts: {\n // Utility function used to calculate the remaining satoshis that must be on the faucet contract after payout.\n remainingFaucetSatoshis: '<faucetSatoshis> <payoutSatoshis> OP_SUB',\n\n // NOTE: This is the faucet.cash covenant and so this bytecode cannot be updated.\n // NOTE: This covenant only ensure the security of its own funds, leaving user protection to be done in user space.\n // NOTE: This covenant allows multiple faucet inputs (at any index) to validate against a single faucet output (at index 0),\n // which results in users being able to claim larger than intended drips when combining inputs.\n // This could be fixed by limiting the number of inputs, but this template encodes the existing contract without modifications.\n enforcePeriod: 'OP_CHECKSEQUENCEVERIFY OP_DROP',\n enforceIndexInScript: 'OP_SWAP OP_0 OP_GREATERTHANOREQUAL OP_VERIFY',\n enforceFaucetReturnsToSelf: 'OP_0 OP_OUTPUTBYTECODE <0xA914> OP_ACTIVEBYTECODE OP_HASH160 OP_CAT <0x87> OP_CAT OP_EQUALVERIFY',\n enforceReturnedValue: 'OP_INPUTINDEX OP_UTXOVALUE OP_SWAP OP_SUB OP_0 OP_OUTPUTVALUE OP_LESSTHANOREQUAL',\n\n // Set up the faucets redeem bytecode and locking script construction as the old pay (20) to script hash construct rather than the new (32).\n faucetRedeemBytecode: '<faucetIndex> <payoutSatoshis> <periodBlocks> enforcePeriod enforceIndexInScript enforceFaucetReturnsToSelf enforceReturnedValue',\n\n // The final lock and unlocking bytecode working with pay to script hash 20.\n faucetP2SH20LockingBytecode: 'OP_HASH160 <$(<faucetRedeemBytecode> OP_HASH160)> OP_EQUAL',\n faucetP2SH20UnlockingBytecode: '<faucetRedeemBytecode>',\n },\n\n constants: {\n minerFeeSatoshis: {\n name: 'Transaction Fee',\n description: 'Fixed number of satoshis required to pay the on-chain transaction fee.',\n type: 'satoshis',\n value: 400n,\n },\n },\n variables: {\n // Service provider variables that identifies which faucet to use.\n periodBlocks: {\n name: 'Blocks between payouts',\n description: 'How many blocks a faucet coin must wait before it can pay again.',\n type: 'integer',\n },\n payoutSatoshis: {\n name: 'Payout allowance',\n description: 'Satoshis taken from the faucet coin on each claim. Covers the user payout and the miner fee.',\n type: 'satoshis',\n },\n faucetIndex: {\n name: 'Faucet number',\n description: 'A number that makes this faucet address unique if several share the same wait time and payout amount.',\n type: 'integer',\n },\n\n // Service provider variable that is required to calculate the remaining faucet satoshis after a payout.\n faucetSatoshis: {\n name: 'Faucet satoshis',\n description: 'Amount of satoshis on the specific input the provider selected for this payout.',\n type: 'satoshis',\n },\n\n // User provided variable that determines where the faucet payout funds go.\n payoutLockingScript: {\n name: 'Recipient',\n description: 'The address that should receive the faucet payout.',\n type: 'locking_script',\n },\n },\n\n icons: [\n { name: 'drip', hash: '0000000000000000000000' },\n { name: 'faucet', hash: '0000000000000000000000' },\n { name: 'recipient', hash: '0000000000000000000000' },\n ],\n};\n"],"mappings":";AAEA,MAAa,gBAA4B;CACrC,SAAS;CAGT,MAAM;CAGN,aAAa;CAGb,MAAM;CAGN,SAAS;CAGT,WAAW;EAAE;EAAe;EAAe;EAAe;CAAc;CAGxE,UAAU;EAON,QAAQ;GACJ,QAAQ;GACR,MAAM;GACN,UAAU,CAAE,UAAW;EAC3B;EAGA,SAAS;GACL,eAAe;GACf,MAAM;GACN,UAAU,CAAE,UAAW;EAC3B;EAGA,SAAS;GACL,QAAQ;GACR,MAAM;GACN,UAAU,CAAE,UAAW;EAC3B;CACJ;CAMA,OAAO;EACH,OAAO;GACH,MAAM;GACN,aAAa;GACb,MAAM;EACV;EACA,UAA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,iBAAiB;GACb,MAAM;GACN,aAAa;GACb,MAAM;EACV;EACA,kBAAkB;GACd,MAAM;GACN,aAAa;GACb,MAAM;EACV;EAGA,mBAAmB;GACf,MAAM;GACN,aAAa;GACb,MAAM;EACV;EACA,qBAAqB;GACjB,MAAM;GACN,aAAa;GACb,MAAM;EACV;EACA,wBAAwB;GACpB,MAAM;GACN,aAAa;GACb,MAAM;EACV;EACA,sBAAsB;GAClB,MAAM;GACN,aAAa;GACb,MAAM;EACV;EACA,0BAA0B;GACtB,MAAM;GACN,aAAa;GACb,MAAM;EACV;EACA,0BAA0B;GACtB,MAAM;GACN,aAAa;GACb,MAAM;EACV;EACA,0BAA0B;GACtB,MAAM;GACN,aAAa;GACb,MAAM;EACV;EACA,wBAAwB;GACpB,MAAM;GACN,aAAa;GACb,MAAM;EACV;EACA,4BAA4B;GACxB,MAAM;GACN,aAAa;GACb,MAAM;EACV;EACA,4BAA4B;GACxB,MAAM;GACN,aAAa;GACb,MAAM;EACV;EACA,qBAAqB;GACjB,MAAM;GACN,aAAa;GACb,MAAM;EACV;EACA,mBAAmB;GACf,MAAM;GACN,aAAa;GACb,MAAM;EACV;EACA,uBAAuB;GACnB,MAAM;GACN,aAAa;GACb,MAAM;EACV;EACA,uBAAuB;GACnB,MAAM;GACN,aAAa;GACb,MAAM;EACV;CACJ;CAKA,OAAO;EACH;GACI,MAAM;GACN,MAAM;EACV;EACA;GACI,MAAM;GACN,MAAM;EACV;EACA;GACI,MAAM;GACN,MAAM;EACV;EACA;GACI,MAAM;GACN,MAAM;EACV;EACA;GACI,MAAM;GACN,MAAM;EACV;EACA;GACI,MAAM;GACN,MAAM;EACV;EACA;GACI,MAAM;GACN,MAAM;EACV;EACA;GACI,MAAM;GACN,MAAM;EACV;EACA;GACI,MAAM;GACN,MAAM;EACV;EACA;GACI,MAAM;GACN,MAAM;EACV;CACJ;CAEA,WAAW,CACP;EACI,MAAM;EACN,aAAa;EAGb,QAAQ;EAGR,OAAO,CACH;GACI,M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;EAGA,qBAAqB;GACjB,MAAM;GACN,aAAa;GACb,MAAM;EACV;CACJ;CAEA,OAAO;EACH;GAAE,MAAM;GAAQ,MAAM;EAAyB;EAC/C;GAAE,MAAM;GAAU,MAAM;EAAyB;EACjD;GAAE,MAAM;GAAa,MAAM;EAAyB;CACxD;AACJ"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../source/p2pkh.ts","../source/wrapped_cash.ts","../source/faucet_cash.ts"],"sourcesContent":["import type { XOTemplate } from '@xo-cash/types';\n\nexport const p2pkhTemplate: XOTemplate = {\n $schema: 'https://libauth.org/schemas/wallet-template-v0.schema.json',\n\n // Name for this template.\n name: 'Wallet (P2PKH)',\n\n // Description for this template.\n description: 'A standard single-factor wallet template that uses Pay-to-Public-Key-Hash (P2PKH) locking scripts.',\n\n // Icon for this template.\n icon: 'wallet',\n\n // Version number for this template.\n version: '1',\n\n // List of VM versions that can be used to run this template.\n supported: [ 'BCH_2023_05', 'BCH_2024_05', 'BCH_2025_05', 'BCH_2026_05' ],\n\n // Sets optional default values to be used with this template.\n defaults: {\n // Configures a default intent structure for creating change outputs and locking scripts.\n // NOTE: This is used when the engine needs to make change for an output created by\n // this template and there is no other policy provided elsewhere that takes precedence.\n // NOTE: It is recommended that templates that create outputs with the 'selectable' property\n // either provides a change policy here, or a comment that explain that they\n // intentionally omit the change policy and why.\n change: {\n output: 'changeOutput',\n role: 'receiver',\n generate: [ 'ownerKey' ],\n },\n\n // Configure the default intent structure for creating receiving addresses / locking scripts.\n address: {\n lockingScript: 'receivingLockingScript',\n role: 'receiver',\n generate: [ 'ownerKey' ],\n },\n\n // Configure the default intent structure for creating receive outputs and locking scripts.\n receive: {\n output: 'receiveOutput',\n role: 'receiver',\n generate: [ 'ownerKey' ],\n },\n },\n\n // Describe a list of roles that are used in this template.\n // NOTE: Template roles are held only for the duration of one specific action/invitation.\n // For example, the same entity that acts as 'receiver' when creating/receiving an output\n // can later act as 'sender' (or 'owner') when performing a follow-up action.\n roles: {\n owner: {\n name: 'Wallet Owner',\n description: 'The party who can spend from this wallet.',\n icon: 'owner',\n },\n receiver: {\n name: 'Receiver',\n description: 'A party that is receiving value.',\n icon: 'receiver',\n },\n sender: {\n name: 'Sender',\n description: 'A party that is sending value.',\n icon: 'sender',\n },\n },\n\n // Define a list of entrypoints supported by this template.\n start: [\n {\n action: 'receive',\n role: 'receiver',\n generate: [ 'ownerKey' ],\n },\n {\n action: 'requestSatoshis',\n role: 'receiver',\n generate: [ 'ownerKey' ],\n },\n {\n action: 'requestFungibleTokens',\n role: 'receiver',\n generate: [ 'ownerKey' ],\n },\n {\n action: 'requestNonfungibleTokens',\n role: 'receiver',\n generate: [ 'ownerKey' ],\n },\n ],\n\n // Define a list of actions that can be taken by this template.\n // NOTE: There is no action to generate an address, but a wallet can create an invitation to a receive action and\n // extract the generated lockscript as needed as the engine will track all lockscripts it generates.\n actions: {\n receive: {\n // TODO: Consider rewriting to be generic/role-less.\n name: 'Receive',\n description: 'Receive an unspecified amount of cash and/or tokens from one or more senders.',\n icon: 'receive',\n\n roles: {\n receiver: {\n name: 'Receive',\n description: 'Receive an unspecified amount of cash and/or tokens from one or more senders.',\n icon: 'receive',\n\n requirements: {\n secrets: [ 'ownerKey' ],\n },\n },\n sender: {\n name: 'Send',\n description: 'Send an unspecified amount of cash and/or tokens to the provided receiver.',\n icon: 'send',\n\n requirements: {\n variables: [ 'transferredSatoshis' ],\n },\n },\n },\n\n requirements: {\n participants: [\n {\n role: 'receiver',\n slots: { min: 1, max: 1 },\n },\n {\n role: 'sender',\n slots: { min: 1, max: undefined },\n },\n ],\n },\n\n transaction: 'receiveTransaction',\n },\n requestSatoshis: {\n // TODO: Consider rewriting to be generic/role-less.\n name: 'Request Satoshis',\n description: 'Requests a specific amount of Bitcoin Cash from one or more senders.',\n icon: 'request',\n\n roles: {\n receiver: {\n name: 'Request Satoshis',\n description: 'Requests a specific amount of Bitcoin Cash from one or more senders.',\n icon: 'request',\n\n requirements: {\n secrets: [ 'ownerKey' ],\n variables: [ 'requestedSatoshis' ],\n },\n },\n sender: {\n name: 'Send',\n description: 'Send a specific amount of Bitcoin Cash to the provided receiver.',\n icon: 'send',\n\n // The sender only need to provide blockchain-level requirements.\n // NOTE: This field is not required when empty, but shown here for illustrative purposes.\n requirements: {},\n },\n },\n\n requirements: {\n participants: [\n {\n role: 'receiver',\n slots: { min: 1, max: 1 },\n },\n {\n role: 'sender',\n slots: { min: 1, max: undefined },\n },\n ],\n },\n\n transaction: 'requestSatoshisTransaction',\n },\n requestFungibleTokens: {\n // TODO: Consider rewriting to be generic/role-less.\n name: 'Request Fungible Tokens',\n description: 'Requests a specific amount of a fungible tokens from one or more senders.',\n icon: 'request',\n\n roles: {\n receiver: {\n name: 'Request Fungible Tokens',\n description: 'Requests a specific amount of a fungible tokens from one or more senders.',\n icon: 'request',\n\n requirements: {\n secrets: [ 'ownerKey' ],\n variables: [ 'requestedTokenCategory', 'requestedTokenAmount' ],\n },\n },\n sender: {\n name: 'Send',\n description: 'Send a specific amount of fungible tokens to the provided receiver.',\n icon: 'send',\n\n // The sender only need to provide blockchain-level requirements.\n // NOTE: This field is not required when empty, but shown here for illustrative purposes.\n requirements: {},\n },\n },\n\n requirements: {\n participants: [\n {\n role: 'receiver',\n slots: { min: 1, max: 1 },\n },\n {\n role: 'sender',\n slots: { min: 1, max: undefined },\n },\n ],\n },\n\n transaction: 'requestFungibleTokensTransaction',\n },\n requestNonfungibleTokens: {\n // TODO: Consider rewriting to be generic/role-less.\n name: 'Request a Non-fungible Token',\n description: 'Requests a non-fungible token from one or more senders.',\n icon: 'request',\n\n roles: {\n receiver: {\n name: 'Request a Non-fungible Token',\n description: 'Requests a non-fungible token from one or more senders.',\n icon: 'request',\n\n requirements: {\n secrets: [ 'ownerKey' ],\n variables: [ 'requestedTokenCategory', 'requestedTokenCapability', 'requestedTokenCommitment' ],\n },\n },\n sender: {\n name: 'Send',\n description: 'Send a non-fungible token to the provided receiver.',\n icon: 'send',\n\n // The sender only need to provide blockchain-level requirements.\n // NOTE: This field is not required when empty, but shown here for illustrative purposes.\n requirements: {},\n },\n },\n\n requirements: {\n participants: [\n {\n role: 'receiver',\n slots: { min: 1, max: 1 },\n },\n {\n role: 'sender',\n slots: { min: 1, max: undefined },\n },\n ],\n },\n\n transaction: 'requestNonfungibleTokensTransaction',\n },\n\n // NOTE: Sending value can be done without explicit template support.\n // NOTE: This feature is explicitly defined in this template to demonstrate how versatile templates can be, and\n // to ensure the feature is discoverable by the user from outputs that hold value.\n sendSatoshis: {\n name: 'Send Satoshis',\n description: 'Sends a specific amount of Bitcoin Cash to a given recipient.',\n icon: 'send',\n\n roles: {\n sender: {\n requirements: {\n variables: [ 'transferredSatoshis', 'recipientLockingscript' ],\n secrets: [ 'ownerKey' ],\n },\n },\n },\n\n requirements: {\n participants: [\n {\n role: 'sender',\n slots: { min: 1, max: 1 },\n },\n ],\n },\n\n // Sending is only available for outputs that have sufficient satoshis on them.\n // NOTE: Dust is enforced here according to standardness rules.\n conditions: [ '$(OP_INPUTINDEX OP_UTXOVALUE <dustLimit> OP_GREATERTHAN)' ],\n\n transaction: 'transferSatoshisTransaction',\n },\n sendFungibleTokens: {\n name: 'Send Fungible Tokens',\n description: 'Send a specific amount of a fungible token to a given recipient.',\n icon: 'send',\n\n roles: {\n sender: {\n requirements: {\n variables: [ 'transferredTokenCategory', 'transferredTokenAmount', 'recipientLockingscript' ],\n secrets: [ 'ownerKey' ],\n },\n },\n },\n\n requirements: {\n participants: [\n {\n role: 'sender',\n slots: { min: 1, max: 1 },\n },\n ],\n },\n\n // Sending is only available for outputs that have fungible tokens on them.\n conditions: [ '$(OP_INPUTINDEX OP_UTXOTOKENAMOUNT <0> OP_GREATERTHAN)' ],\n\n transaction: 'transferFungibleTokensTransaction',\n },\n sendNonfungibleTokens: {\n name: 'Send a Non-fungible Token',\n description: 'Send a non-fungible token to a given recipient.',\n icon: 'send',\n\n roles: {\n sender: {\n requirements: {\n variables: [ 'transferredTokenCategory', 'transferredTokenCapability', 'transferredTokenCommitment', 'recipientLockingscript' ],\n secrets: [ 'ownerKey' ],\n },\n },\n },\n\n requirements: {\n participants: [\n {\n role: 'sender',\n slots: { min: 1, max: 1 },\n },\n ],\n },\n\n // Sending is only available for outputs that have a non-fungible token on them.\n conditions: [ '$(OP_INPUTINDEX OP_UTXOTOKENCATEGORY OP_SIZE OP_NIP <32> OP_GREATERTHAN)' ],\n\n transaction: 'transferNonfungibleTokensTransaction',\n },\n\n // NOTE: Burning tokens can be done without explicit template support.\n // NOTE: This feature is explicitly defined in this template to demonstrate how versatile templates can be, and\n // to ensure the feature is discoverable by the user from outputs that hold tokens.\n burnFungibleTokens: {\n name: 'Delete Fungible Tokens',\n description: 'Permanently and irreversibly deletes one or more fungible tokens.',\n icon: 'burn',\n\n roles: {\n owner: {\n requirements: {\n variables: [ 'burnedTokenCategory', 'burnedTokenAmount' ],\n secrets: [ 'ownerKey' ],\n },\n },\n },\n\n requirements: {\n participants: [\n {\n role: 'owner',\n slots: { min: 1, max: 1 },\n },\n ],\n },\n\n // Burning is only available for outputs that have fungible tokens on them.\n conditions: [ '$(OP_INPUTINDEX OP_UTXOTOKENAMOUNT <0> OP_GREATERTHAN)' ],\n\n transaction: 'burnFungibleTokensTransaction',\n },\n burnNonfungibleTokens: {\n name: 'Delete a Non-fungible Token',\n description: 'Permanently and irreversibly deletes one non-fungible token.',\n icon: 'burn',\n\n roles: {\n owner: {\n requirements: {\n variables: [ 'burnedTokenCategory', 'burnedTokenCapability', 'burnedTokenCommitment' ],\n secrets: [ 'ownerKey' ],\n },\n },\n },\n\n requirements: {\n participants: [\n {\n role: 'owner',\n slots: { min: 1, max: 1 },\n },\n ],\n },\n\n // Burning is only available for outputs that have non-fungible tokens on them.\n conditions: [ '$(OP_INPUTINDEX OP_UTXOTOKENCATEGORY OP_SIZE OP_NIP <32> OP_GREATERTHAN)' ],\n\n transaction: 'burnNonfungibleTokenTransaction',\n },\n\n sign: {\n name: 'Sign Message',\n description: 'Signs a provided message using the Bitcoin message signing protocol.',\n icon: 'sign',\n\n roles: {\n owner: {\n requirements: {\n variables: [ 'messageToSign' ],\n secrets: [ 'ownerKey' ],\n },\n },\n },\n\n requirements: {\n participants: [\n {\n role: 'owner',\n slots: { min: 1, max: 1 },\n },\n ],\n },\n\n data: 'messageSignature',\n },\n verify: {\n name: 'Verify Message Signature',\n description: 'Verifies a provided message signature according to the Bitcoin message signing protocol.',\n icon: 'verify',\n\n roles: {\n owner: {\n requirements: {\n variables: [ 'messageSignature', 'messageToVerify' ],\n secrets: [ 'ownerKey' ],\n },\n },\n },\n\n requirements: {\n participants: [\n {\n role: 'owner',\n slots: { min: 1, max: 1 },\n },\n ],\n },\n\n data: 'messageSignatureValidity',\n },\n },\n\n // Define a set of data that can be used in this template.\n data: {\n messageSignature: {\n // Evaluate CashASM expression to get the signature needed.\n // NOTE: Pushes the prefix and message, then concatenates them together to form the data to sign.\n // NOTE: In libauth today, it seems that this is done by defining the signature as a variable, and tying it to the key and message,\n // and so this is different\n // TODO: Check with Jason and see if there is any reason why this cannot be done like this.\n value: '$(<messagePrefix> <message> OP_CAT <ownerKey.data_signature.top_stack_element>)',\n type: 'signature',\n },\n messageSignatureValidity: {\n // Evaluate the validity of the message with the owners public key.\n value: '$(<messageSignature> <messagePrefix> <message> OP_CAT <ownerKey.public_key> OP_CHECKDATASIG)',\n type: 'integer',\n },\n },\n\n // Define a set of transactions that can be used in this template.\n transactions: {\n receiveTransaction: {\n name: 'Transfer Completed',\n description: 'Transferred an unspecified amount of cash and/or tokens.',\n icon: 'request',\n\n roles: {\n receiver: {\n name: 'Received',\n description: 'Received an unspecified amount of cash and/or tokens.',\n icon: 'receive',\n },\n sender: {\n name: 'Sent',\n description: 'Sent an unspecified amount of cash and/or tokens.',\n icon: 'send',\n },\n },\n\n // Inputs and outputs that must exist in the transaction.\n // NOTE: There is no inputs required, but the engine should detect that there is not sufficient input value to\n // match the output and thus generate an invitation to participate in this action.\n // When the invitation is shared, the other parties can add as many inputs and change outputs as needed.\n inputs: [],\n outputs: [\n {\n output: 'receiveOutput',\n outputIndex: undefined,\n },\n ],\n\n // Standard transaction without a locktime.\n version: 2,\n locktime: 0,\n\n // ...\n composable: true,\n },\n requestSatoshisTransaction: {\n name: 'Satoshis Transferred',\n description: 'Transferred $(<requestedSatoshis>) satoshis.',\n icon: 'request',\n\n roles: {\n receiver: {\n name: 'Received',\n description: 'Received $(<requestedSatoshis>) satoshis.',\n icon: 'receive',\n },\n sender: {\n name: 'Sent',\n description: 'Sent $(<requestedSatoshis>) satoshis.',\n icon: 'send',\n },\n },\n\n // Inputs and outputs that must exist in the transaction.\n // NOTE: There is no inputs required, but the engine should detect that there is not sufficient input value to\n // match the output and thus generate an invitation to participate in this action.\n // When the invitation is shared, the other party can add as many inputs and outputs as needed since this transaction is composable.\n inputs: [],\n outputs: [\n {\n output: 'requestSatoshisOutput',\n outputIndex: undefined,\n },\n ],\n\n // Standard transaction without a locktime.\n version: 2,\n locktime: 0,\n\n // ...\n composable: true,\n },\n requestFungibleTokensTransaction: {\n name: 'Fungible Tokens Transferred',\n description:\n 'Transferred $(<requestedTokenAmount> <requestedTokenCategory.decimalsFactor> OP_DIV).$(<requestedTokenAmount> <requestedTokenCategory.decimalsFactor> OP_MOD) $(<requestedTokenCategory.symbol>) tokens.',\n icon: 'request',\n\n roles: {\n receiver: {\n name: 'Received',\n description:\n 'Received $(<requestedTokenAmount> <requestedTokenCategory.decimalsFactor> OP_DIV).$(<requestedTokenAmount> <requestedTokenCategory.decimalsFactor> OP_MOD) $(<requestedTokenCategory.symbol>) tokens.',\n icon: 'receive',\n },\n sender: {\n name: 'Sent',\n description:\n 'Sent $(<requestedTokenAmount> <requestedTokenCategory.decimalsFactor> OP_DIV).$(<requestedTokenAmount> <requestedTokenCategory.decimalsFactor> OP_MOD) $(<requestedTokenCategory.symbol>) tokens.',\n icon: 'send',\n },\n },\n\n // Inputs and outputs that must exist in the transaction.\n // NOTE: There is no inputs required, but the engine should detect that there is not sufficient input value to\n // match the output and thus generate an invitation to participate in this action.\n // When the invitation is shared, the other party can add as many inputs and outputs as needed since this transaction is composable.\n inputs: [],\n outputs: [\n {\n output: 'requestFungibleTokensOutput',\n outputIndex: undefined,\n },\n ],\n\n // Standard transaction without a locktime.\n version: 2,\n locktime: 0,\n\n // ...\n composable: true,\n },\n requestNonfungibleTokensTransaction: {\n name: 'Non-Fungible Token Transferred',\n description:\n 'Transferred one non-fungible $(<requestedTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <requestedTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) (<requestedTokenCategory.symbol>) token, with $(<requestedTokenCommitment>) commitment.',\n icon: 'request',\n\n roles: {\n receiver: {\n name: 'Received',\n description:\n 'Received one non-fungible $(<requestedTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <requestedTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) (<requestedTokenCategory.symbol>) token, with $(<requestedTokenCommitment>) commitment.',\n icon: 'receive',\n },\n sender: {\n name: 'Sent',\n description:\n 'Sent the requested non-fungible $(<requestedTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <requestedTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) (<requestedTokenCategory.symbol>) token, with $(<requestedTokenCommitment>) commitment.',\n icon: 'send',\n },\n },\n\n // Inputs and outputs that must exist in the transaction.\n // NOTE: There is no inputs required, but the engine should detect that there is not sufficient input value to\n // match the output and thus generate an invitation to participate in this action.\n // When the invitation is shared, the other party can add as many inputs and outputs as needed since this transaction is composable.\n inputs: [],\n outputs: [\n {\n output: 'requestNonfungibleTokensOutput',\n outputIndex: undefined,\n },\n ],\n\n // Standard transaction without a locktime.\n version: 2,\n locktime: 0,\n\n // ...\n composable: true,\n },\n\n transferSatoshisTransaction: {\n name: 'Satoshis Transferred',\n description: '$(<transferredSatoshis>) satoshis were transferred to a recipient.',\n icon: 'send',\n\n roles: {\n receiver: {\n name: 'Received',\n description: 'Received $(<transferredSatoshis>) satoshis.',\n icon: 'receive',\n },\n sender: {\n name: 'Sent',\n description: 'Sent $(<transferredSatoshis>) satoshis.',\n icon: 'send',\n },\n },\n\n // Enforce the inputs and outputs required by the transaction.\n // NOTE: The input is provided from the action since it is only available on outputs with satoshis.\n inputs: [],\n outputs: [\n {\n output: 'transferSatoshisOutput',\n outputIndex: undefined,\n },\n ],\n\n // Standard transaction without a locktime.\n version: 2,\n locktime: 0,\n\n // ...\n composable: true,\n },\n transferFungibleTokensTransaction: {\n name: 'Fungible Tokens Transferred',\n description:\n '$(<transferredTokenAmount> <transferredTokenCategory.decimalsFactor> OP_DIV).$(<transferredTokenAmount> <transferredTokenCategory.decimalsFactor> OP_MOD) $(<transferredTokenCategory.symbol>) tokens were transferred to a recipient.',\n icon: 'send',\n\n roles: {\n receiver: {\n name: 'Received',\n description:\n 'Received $(<transferredTokenAmount> <transferredTokenCategory.decimalsFactor> OP_DIV).$(<transferredTokenAmount> <transferredTokenCategory.decimalsFactor> OP_MOD) $(<transferredTokenCategory.symbol>) tokens.',\n icon: 'receive',\n },\n sender: {\n name: 'Sent',\n description:\n 'Sent $(<transferredTokenAmount> <transferredTokenCategory.decimalsFactor> OP_DIV).$(<transferredTokenAmount> <transferredTokenCategory.decimalsFactor> OP_MOD) $(<transferredTokenCategory.symbol>) tokens.',\n icon: 'send',\n },\n },\n\n // Enforce the inputs and outputs required by the transaction.\n // NOTE: The input is provided from the action since it is only available on outputs with fungible tokens.\n inputs: [],\n outputs: [\n {\n output: 'transferFungibleTokensOutput',\n outputIndex: undefined,\n },\n ],\n\n // Standard transaction without a locktime.\n version: 2,\n locktime: 0,\n\n // ...\n composable: true,\n },\n transferNonfungibleTokensTransaction: {\n name: 'Non-fungible Token Transferred',\n description:\n 'One non-fungible $(<transferredTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <transferredTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) $(<transferredTokenCategory.symbol>) token was transferred to a recipient, with $(<transferredTokenCommitment>) commitment.',\n icon: 'send',\n\n roles: {\n receiver: {\n name: 'Received',\n description:\n 'Received one non-fungible $(<transferredTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <transferredTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) (<transferredTokenCategory.symbol>) token, with $(<transferredTokenCommitment>) commitment.',\n icon: 'receive',\n },\n sender: {\n name: 'Sent',\n description:\n 'Sent one non-fungible $(<transferredTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <transferredTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) (<transferredTokenCategory.symbol>) token, with $(<transferredTokenCommitment>) commitment.',\n icon: 'send',\n },\n },\n\n // Enforce the inputs and outputs required by the transaction.\n // NOTE: The input is provided from the action since it is only available on outputs with a non-fungible token.\n inputs: [],\n outputs: [\n {\n output: 'transferNonfungibleTokenOutput',\n outputIndex: undefined,\n },\n ],\n\n // Standard transaction without a locktime.\n version: 2,\n locktime: 0,\n\n // ...\n composable: true,\n },\n\n burnFungibleTokensTransaction: {\n name: 'Deleted fungible tokens',\n description:\n 'Permanently and irreversibly deleted $(<burnedTokenAmount> <burnedTokenCategory.decimalsFactor> OP_DIV).$(<burnedTokenAmount> <burnedTokenCategory.decimalsFactor> OP_MOD) $(<burnedTokenCategory.symbol>) tokens.',\n icon: 'burn',\n\n // Inputs and outputs that must exist in the transaction.\n // NOTE: There is no defined outputs as any non-burned value is automatically returned as change.\n inputs: [\n {\n input: 'burnFungibleTokensInput',\n inputIndex: undefined,\n },\n ],\n\n outputs: [],\n\n // Standard transaction without a locktime.\n version: 2,\n locktime: 0,\n\n // ...\n composable: true,\n },\n burnNonfungibleTokenTransaction: {\n name: 'Deleted non fungible token',\n description:\n 'Permanently and irreversibly deleted a non-fungible $(<burnedTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <burnedTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) (<burnedTokenCategory.symbol>) token, with $(<burnedTokenCommitment>) commitment.',\n icon: 'burn',\n\n // Inputs and outputs that must exist in the transaction.\n // NOTE: There is no defined outputs as any non-burned value is automatically returned as change.\n inputs: [\n {\n input: 'burnNonfungibleTokenInput',\n inputIndex: undefined,\n },\n ],\n outputs: [],\n\n // Standard transaction without a locktime.\n version: 2,\n locktime: 0,\n\n // ...\n composable: true,\n },\n },\n\n // Define a set of outputs that can be used within transactions in this template.\n outputs: {\n changeOutput: {\n name: 'Change',\n description: 'Funds returned as change.',\n icon: 'receive',\n\n // Defines how the requested funds should be locked.\n lockingScript: 'receivingLockingScript',\n },\n receiveOutput: {\n name: 'Recipient output',\n description: 'Transferred an unspecified amount of cash and/or tokens to a recipient.',\n icon: 'receive',\n\n roles: {\n receiver: {\n name: 'Received',\n description: 'Received an unspecified amount of cash and/or tokens.',\n },\n sender: {\n name: 'Sent',\n description: 'Sent an unspecified amount of cash and/or tokens.',\n },\n },\n\n // Defines how the requested funds should be locked.\n lockingScript: 'receivingLockingScript',\n\n // Set the amount of cash and/or tokens to transfer.\n valueSatoshis: '$(<transferredSatoshis>)',\n token: null,\n },\n requestSatoshisOutput: {\n name: 'Satoshis',\n description: '$(<requestedSatoshis>) satoshis.',\n icon: 'request',\n\n roles: {\n receiver: {\n name: 'Satoshis Received',\n description: 'Received $(<requestedSatoshis>) satoshis.',\n },\n sender: {\n name: 'Satoshis Sent',\n description: 'Sent $(<requestedSatoshis>) satoshis.',\n },\n },\n\n // Defines how the requested funds should be locked.\n lockingScript: 'receivingLockingScript',\n\n // Require the specified number of satoshis and no tokens.\n valueSatoshis: '$(<requestedSatoshis>)',\n token: null,\n },\n requestFungibleTokensOutput: {\n name: 'Fungible $(<requestedTokenCategory.symbol>) Tokens',\n description:\n '$(<requestedTokenAmount> <requestedTokenCategory.decimalsFactor> OP_DIV).$(<requestedTokenAmount> <requestedTokenCategory.decimalsFactor> OP_MOD) $(<requestedTokenCategory.symbol>) tokens.',\n icon: 'request',\n\n roles: {\n receiver: {\n name: 'Fungible $(<requestedTokenCategory.symbol>) Tokens Received',\n description:\n 'Received $(<requestedTokenAmount> <requestedTokenCategory.decimalsFactor> OP_DIV).$(<requestedTokenAmount> <requestedTokenCategory.decimalsFactor> OP_MOD) $(<requestedTokenCategory.symbol>) tokens.',\n },\n sender: {\n name: 'Fungible $(<requestedTokenCategory.symbol>) Tokens Sent',\n description:\n 'Sent $(<requestedTokenAmount> <requestedTokenCategory.decimalsFactor> OP_DIV).$(<requestedTokenAmount> <requestedTokenCategory.decimalsFactor> OP_MOD) $(<requestedTokenCategory.symbol>) tokens.',\n },\n },\n\n // Defines how the requested funds should be locked.\n lockingScript: 'receivingLockingScript',\n\n // Require a flat 1000 satoshis to ensure the fungible tokens remains transferrable.\n valueSatoshis: '1000',\n\n // Require only the specified amount and type of fungible tokens.\n // NOTE: This can be composed with a request for a non-fungible token, but will always result in two separate outputs.\n token: {\n category: '$(<requestedTokenCategory>)',\n amount: '$(<requestedTokenAmount>)',\n nft: null,\n },\n },\n requestNonfungibleTokensOutput: {\n name: 'Non-fungible $(<requestedTokenCategory.symbol>) Token',\n description:\n 'Transferred one non-fungible $(<requestedTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <requestedTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) $(<requestedTokenCategory.symbol>) token to a recipient, with $(<requestedTokenCommitment>) commitment.',\n icon: 'request',\n\n roles: {\n receiver: {\n name: 'Non-fungible $(<requestedTokenCategory.symbol>) Token Received',\n description:\n 'Received one non-fungible $(<requestedTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <requestedTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) $(<requestedTokenCategory.symbol>) token, with $(<requestedTokenCommitment>) commitment.',\n },\n sender: {\n name: 'Non-fungible $(<requestedTokenCategory.symbol>) Token Sent',\n description:\n 'Sent the requested non-fungible $(<requestedTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <requestedTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) $(<requestedTokenCategory.symbol>) token, with $(<requestedTokenCommitment>) commitment.',\n },\n },\n\n // Defines how the requested funds should be locked.\n lockingScript: 'receivingLockingScript',\n\n // Require a flat 1000 satoshis to ensure the non-fungible token remains transferrable.\n valueSatoshis: '1000',\n\n // Require only an NFT with specified category, capability and commitment.\n // NOTE: This can be composed with a request for fungible token amounts, but will always result in two separate outputs.\n token: {\n category: '$(<requestedTokenCategory>)',\n amount: null,\n nft: {\n capability: '$(<requestedTokenCapability>)',\n commitment: '$(<requestedTokenCommitment>)',\n },\n },\n },\n\n transferSatoshisOutput: {\n name: 'Recipient output',\n description: 'Transferred $(<transferredSatoshis>) satoshis to a recipient.',\n icon: 'send',\n\n roles: {\n receiver: {\n name: 'Received',\n description: 'Received $(<transferredSatoshis>) satoshis.',\n },\n sender: {\n name: 'Sent',\n description: 'Sent $(<transferredSatoshis>) satoshis.',\n },\n },\n\n // Use the recipients lockscript.\n lockingScript: 'sendingLockingscript',\n\n // Set the amount of satoshis to transfer.\n valueSatoshis: '$(<transferredSatoshis>)',\n },\n transferFungibleTokensOutput: {\n name: 'Recipient output',\n description:\n 'Transferred $(<transferredTokenAmount> <transferredTokenCategory.decimalsFactor> OP_DIV).$(<transferredTokenAmount> <transferredTokenCategory.decimalsFactor> OP_MOD) $(<transferredTokenCategory.symbol>) tokens to a recipient.',\n icon: 'send',\n\n roles: {\n receiver: {\n name: 'Received',\n description:\n 'Received $(<transferredTokenAmount> <transferredTokenCategory.decimalsFactor> OP_DIV).$(<transferredTokenAmount> <transferredTokenCategory.decimalsFactor> OP_MOD) $(<transferredTokenCategory.symbol>) tokens.',\n },\n sender: {\n name: 'Sent',\n description:\n 'Sent $(<transferredTokenAmount> <transferredTokenCategory.decimalsFactor> OP_DIV).$(<transferredTokenAmount> <transferredTokenCategory.decimalsFactor> OP_MOD) $(<transferredTokenCategory.symbol>) tokens.',\n },\n },\n\n // Use the recipients lockscript.\n lockingScript: 'sendingLockingscript',\n\n // Set the amount of fungible tokens to transfer.\n token: {\n category: '$(<transferredTokenCategory>)',\n amount: '$(<transferredTokenAmount>)',\n },\n },\n transferNonfungibleTokenOutput: {\n name: 'Recipient output',\n description:\n 'Transferred one non-fungible $(<transferredTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <transferredTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) $(<transferredTokenCategory.symbol>) token to a recipient, with $(<transferredTokenCommitment>) commitment.',\n icon: 'send',\n\n roles: {\n receiver: {\n name: 'Received',\n description:\n 'Received one non-fungible $(<transferredTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <transferredTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) $(<transferredTokenCategory.symbol>) token, with $(<transferredTokenCommitment>) commitment.',\n },\n sender: {\n name: 'Sent',\n description:\n 'Sent one non-fungible $(<transferredTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <transferredTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) $(<transferredTokenCategory.symbol>) token, with $(<transferredTokenCommitment>) commitment.',\n },\n },\n\n // Use the recipients lockscript.\n lockingScript: 'sendingLockingscript',\n\n // Set the non-fungible token to transfer.\n token: {\n category: '$(<transferredTokenCategory>)',\n nft: {\n capability: '$(<transferredTokenCapability>)',\n commitment: '$(<transferredTokenCommitment>)',\n },\n },\n },\n },\n\n inputs: {\n burnFungibleTokensInput: {\n name: 'Deleted fungible tokens',\n description: 'Permanently and irreversibly deleted $(<burnedTokenAmount>) $(<burnedTokenCategory>).',\n icon: 'burn',\n\n // Define which unlocking script unlocks this input.\n unlockingScript: 'unlockP2PKH',\n\n // Require a fungible token of the requested token category, with an amount larger than or equal to the requested amount to burn.\n token: {\n category: '$(<burnedTokenCategory>)',\n amount: '$(<this.fungibleTokenAmount> <burnedTokenAmount> OP_GREATERTHANOREQUAL OP_IF <this.fungibleTokens> OP_ENDIF)',\n },\n\n // Ignore the burned token amount when determining change for this output.\n // NOTE: The engine must check that this does not exceed the input value.\n omitChangeAmounts: {\n fungibleTokens: '$(<burnedTokenAmount>)',\n },\n },\n burnNonfungibleTokenInput: {\n name: 'Deleted non-fungible token',\n description:\n 'Permanently and irreversibly burned one non-fungible $(<burnedTokenCapability> <0x02> OP_EQUAL OP_IF <\"minting\"> OP_ELSE <burnedTokenCapability> <0x01> OP_EQUAL OP_IF <\"mutable\"> OP_ELSE <\"immutable\"> OP_ENDIF OP_ENDIF) token of category $(<burnedTokenCategory>), with a $(<burnedTokenCommitment>) commitment.',\n icon: 'burn',\n\n // Define which unlocking script unlocks this input.\n unlockingScript: 'unlockP2PKH',\n\n // Require a non-fungible token of the specified category, capability and commitment to burn.\n token: {\n category: '$(<burnedTokenCategory>)',\n nft: {\n capability: '$(<burnedTokenCapability>)',\n commitment: '$(<burnedTokenCommitment>)',\n },\n },\n\n // Ignore the burned token when determining change for this output.\n // NOTE: The engine must check that this does not exceed the input value.\n omitChangeAmounts: {\n nonfungibleTokens: 1,\n },\n },\n },\n\n // Define locking scripts used by this template.\n // NOTE: Template supported wallets should automatically track all generated lockscripts for on-chain events.\n lockingScripts: {\n sendingLockingscript: {\n // TODO: This currently describes outputs locked to this script, but all actions creating such outputs already have descriptions.\n // This can either be dropped, or maybe more importantly, should be disambiguated so that lockscripts can provide separate\n // descriptions for their script and the outputs that are locked to them. Leaving as a TODO for now and will address later.\n name: 'Sent',\n description: 'Funds sent to an external recipient',\n icon: 'address',\n\n // ...\n lockingType: 'p2pkh',\n lockingBytecode: 'lockToRecipient',\n\n // Indicate that the sent output does not belong to the initiating user.\n // NOTE: These values default to false/empty, but added here for additional clarity.\n actions: [],\n state: { variables: [], secrets: [] },\n balance: {},\n selectable: false,\n },\n receivingLockingScript: {\n // NOTE: Outputs to this lockscript by external actors defaults to this description when detected on-chain.\n name: 'Received',\n description: 'Funds received without wallet coordination.',\n icon: 'address',\n\n // Defines how spending future received funds should be locked.\n lockingType: 'p2pkh',\n lockingBytecode: 'lockP2PKH',\n\n // Define a default unlocking script to be used when no action provided script is present.\n unlockingBytecode: 'unlockP2PKH',\n\n // Participants without a role or observers cannot take any further actions.\n // NOTE: This is not required but shown here for illustrative purposes.\n actions: [],\n\n roles: {\n receiver: {\n // The only state that is required to be persisted when receiving funds is the owners private key.\n // NOTE: This is defined as a secret to not leak when creating invitations for others to participate in request or send actions.\n state: {\n variables: [],\n secrets: [ 'ownerKey' ],\n },\n\n // List actions that can be taken with the ownerKey for each address/lockscript.\n actions: [\n {\n action: 'sign',\n role: 'owner',\n secrets: [{ ownerKey: null }],\n },\n {\n action: 'verify',\n role: 'owner',\n secrets: [{ ownerKey: null }],\n },\n {\n action: 'sendSatoshis',\n role: 'sender',\n secrets: [{ ownerKey: null }],\n },\n {\n action: 'sendFungibleTokens',\n role: 'sender',\n secrets: [{ ownerKey: null }],\n },\n {\n action: 'sendNonfungibleTokens',\n role: 'sender',\n secrets: [{ ownerKey: null }],\n },\n {\n action: 'burnFungibleTokens',\n role: 'sender',\n secrets: [{ ownerKey: null }],\n },\n {\n action: 'burnNonfungibleTokens',\n role: 'sender',\n secrets: [{ ownerKey: null }],\n },\n ],\n\n // Indicates how much of received funds should be part of a wallets total balance.\n // NOTE: Evaluates in the context of the source transaction, with the current outputs technical data available under this.output.*\n // NOTE: A CashASM expression of '1' means include 100% of this asset in the balance.\n // NOTE: Since we know that the owner controls all assets, we short-cut the evaluations by setting 1 directly.\n balance: {\n satoshis: true,\n fungibleTokens: true,\n nonfungibleTokens: true,\n },\n\n // Indicate when received funds should be considered in automatic coin selection to meet input requirements of other transactions.\n // NOTE: Evaluates in the context of the source transaction, with the current outputs technical data available under this.output.*\n // NOTE: This evaluates to a boolean. If non-true, the output should not be considered for automatic coin selection.\n // NOTE: Since we know that the secret key exist for the owner, this template short-cuts the evaluation by setting true directly.\n selectable: true,\n },\n },\n },\n },\n\n // Define a set of scripts that can be used in this template.\n scripts: {\n lockP2PKH: 'OP_DUP OP_HASH160 <$(<ownerKey.public_key> OP_HASH160)> OP_EQUALVERIFY OP_CHECKSIG',\n unlockP2PKH: '<ownerKey.schnorr_signature.all_outputs> <ownerKey.public_key>',\n lockToRecipient: '$(<recipientLockingscript>)',\n },\n\n // TODO: Add icons\n constants: {\n dustLimit: {\n name: 'Dust Limit',\n description: 'Standard required minimum satoshis for Pay to Public Key Hash outputs.',\n type: 'integer',\n value: 546,\n },\n\n // Define a message prefix for use in arbitrary message signing.\n messagePrefix: {\n name: 'Message Prefix',\n description: 'Standard message prefix used in the bitcoin signed message protocol.',\n type: 'bytes',\n\n // Value is enforced to the bitcoin signing magic string:\n // \"\\x18Bitcoin Signed Message:\\n\"\n value: '0x18426974636f696e205369676e6564204d6573736167653a0a',\n },\n },\n\n // TODO: Add icons\n variables: {\n // Describe the secret private key.\n ownerKey: {\n name: 'Owners Private Key',\n description: 'The private key used to authorize spending of received funds.',\n type: 'private_key',\n },\n\n recipientLockingscript: {\n name: 'Recipient Locking Script',\n description: 'The locking script that receives the transferred value.',\n type: 'locking_script',\n },\n\n messageToSign: {\n name: 'Message',\n description: 'The text message to sign.',\n type: 'string',\n },\n messageToVerify: {\n name: 'Message',\n description: 'The text message to verify.',\n type: 'string',\n },\n messageSignature: {\n name: 'Message Signature',\n description: 'The signature for the message.',\n type: 'signature',\n },\n\n // Describe the parameters used when requesting value.\n requestedSatoshis: {\n name: 'Requested Amount',\n description: 'The Bitcoin Cash amount requested',\n type: 'satoshis',\n },\n transferredSatoshis: {\n name: 'Transferred Amount',\n description: 'The Bitcoin Cash amount transferred',\n type: 'satoshis',\n },\n requestedTokenCategory: {\n name: 'Requested Token Category',\n description: 'The token category requested',\n type: 'token_category',\n },\n requestedTokenAmount: {\n name: 'Requested Token Amount',\n description: 'The fungible token amount requested',\n type: 'token_amount',\n },\n requestedTokenCapability: {\n name: 'Requested Token Capability',\n description: 'The non-fungible token capability requested',\n type: 'token_capability',\n },\n requestedTokenCommitment: {\n name: 'Requested Token Commitment',\n description: 'The non-fungible token commitment requested',\n type: 'token_commitment',\n },\n transferredTokenCategory: {\n name: 'Sending Token Category',\n description: 'The token category of the token(s) to send',\n type: 'token_category',\n },\n transferredTokenAmount: {\n name: 'Sending Token Amount',\n description: 'The fungible token amount to send',\n type: 'token_amount',\n },\n transferredTokenCapability: {\n name: 'Sending Token Capability',\n description: 'The token capability for the non-fungible token to send',\n type: 'token_capability',\n },\n transferredTokenCommitment: {\n name: 'Sending Token Commitment',\n description: 'The token commitment for the non-fungible token to send',\n type: 'token_commitment',\n },\n burnedTokenCategory: {\n name: 'Deleted Token Category',\n description: 'The token category of the token(s) to delete',\n type: 'token_category',\n },\n burnedTokenAmount: {\n name: 'Deleted Token Amount',\n description: 'The fungible token amount to delete',\n type: 'token_amount',\n },\n burnedTokenCapability: {\n name: 'Deleted Token Capability',\n description: 'The token capability for the non-fungible token to delete',\n type: 'token_capability',\n },\n burnedTokenCommitment: {\n name: 'Deleted Token Commitment',\n description: 'The token commitment for the non-fungible token to delete',\n type: 'token_commitment',\n },\n },\n\n // Define a list of re-usable icons that can be used as part of metadata.\n // NOTE: the actual icons are not embedded in the template but only referenced by hashes here,\n // and can be distributed either as an asset pack or looked up through something like IPFS.\n icons: [\n {\n name: 'wallet',\n hash: '0000000000000000000000',\n },\n {\n name: 'owner',\n hash: '0000000000000000000000',\n },\n {\n name: 'sender',\n hash: '0000000000000000000000',\n },\n {\n name: 'address',\n hash: '0000000000000000000000',\n },\n {\n name: 'receive',\n hash: '0000000000000000000000',\n },\n {\n name: 'request',\n hash: '0000000000000000000000',\n },\n {\n name: 'send',\n hash: '0000000000000000000000',\n },\n {\n name: 'burn',\n hash: '0000000000000000000000',\n },\n {\n name: 'sign',\n hash: '0000000000000000000000',\n },\n {\n name: 'verify',\n hash: '0000000000000000000000',\n },\n ],\n\n scenarios: [\n {\n name: 'requesting satoshis',\n description: 'happy-path evaluation for requesting satoshis.',\n\n // The action being run in the scenario.\n action: 'requestSatoshis',\n\n // List of roles taken in this scenario, and the resources they provided.\n roles: [\n {\n role: 'receiver',\n values: {\n generated: {\n ownerKey: 'KyRQa5pEXuzVcDwnXRLpYAascjchQW5DoxVRMbj4DTxS83573mz8',\n },\n variables: {\n requestedSatoshis: 2000,\n },\n secrets: {\n // This scenario does not carry any secrets.\n },\n inputs: [],\n outputs: [\n {\n lockingBytecode: '76a91475c715ecb74178fe87933e57e947e5e92d904b8188ac',\n valueSatoshis: 2000,\n },\n ],\n },\n },\n {\n role: 'sender',\n values: {\n // The sender provides no raw data to the action.\n generated: {},\n variables: {},\n secrets: {},\n\n // The sender does provide input and change.\n inputs: [\n {\n outpointTransactionHash: '4ef28553a31a266719e66ba97fee3aeecd6d1788f7ff6ab12f8ebceda49660c0',\n outpointIndex: 0,\n sequenceNumber: 0,\n unlockingBytecode:\n '41226b2be7c2890c8bbde2f79e79640e56d866843f2e822ec51c469019d13db04a422c9ee49f5eefd26fee24e91910edbbb032b90cc54c34da80a61e69b0ee3d22412103e7ab26c36a7c7f45b2c26f33c08b0fa43a633268700f47216646d4cb37ae5696',\n },\n ],\n outputs: [\n {\n lockingBytecode: '76a91475c715ecb74178fe87933e57e947e5e92d904b8188ac',\n valueSatoshis: 2000,\n },\n ],\n },\n },\n ],\n\n // List of resources provided outside the context of a role.\n values: {\n generated: {\n // This scenario does not have any non-role generated values.\n },\n variables: {\n // This scenario does not have any non-role variables.\n },\n secrets: {\n // This scenario does not have any non-role secrets.\n },\n },\n\n // Outcomes provides the set of resulting values created from the action.\n outcome: {\n roles: {\n receiver: {\n name: 'Request',\n description: 'Requested a specific amount of satoshis from one or more senders.',\n icon: 'request',\n },\n sender: {\n name: 'Send',\n description: 'Sent a specific amount of satoshis to the provided receiver.',\n icon: 'send',\n },\n },\n\n transactions: [\n {\n transaction:\n '0200000001c06096a4edbc8e2fb16afff788176dcdee3aee7fa96be61967261aa35385f24e000000006441226b2be7c2890c8bbde2f79e79640e56d866843f2e822ec51c469019d13db04a422c9ee49f5eefd26fee24e91910edbbb032b90cc54c34da80a61e69b0ee3d22412103e7ab26c36a7c7f45b2c26f33c08b0fa43a633268700f47216646d4cb37ae5696000000000267530300000000001976a91475c715ecb74178fe87933e57e947e5e92d904b8188acd0070000000000001976a91475c715ecb74178fe87933e57e947e5e92d904b8188ac00000000',\n value: '',\n },\n ],\n },\n },\n ],\n};\n","import type { XOTemplate } from '@xo-cash/types';\n\n/**\n * Encodes the user parts of the https://wrapped.cash/ use case as an XO template.\n *\n * The bootstrap ceremony is not encoded in this template, but the final categoryId\n * is properly encoded here and ensure we are operating with the correct token.\n */\nexport const wrapBCHTemplate: XOTemplate = {\n $schema: 'https://libauth.org/schemas/wallet-template-v0.schema.json',\n\n name: 'Wrapped BCH',\n description: 'Convert between BCH and wBCH tokens.',\n icon: 'logo',\n\n version: '1',\n supported: [ 'BCH_2023_05', 'BCH_2024_05', 'BCH_2025_05', 'BCH_2026_05' ],\n\n resources: [\n {\n name: 'Official Website',\n description: 'Official homepage for the wBCH token.',\n\n url: 'https://wrapped.cash/',\n },\n ],\n\n roles: {\n wrapper: {\n name: 'Wrapper',\n description: 'The person wrapping BCH into wBCH.',\n icon: 'user',\n },\n unwrapper: {\n name: 'Unwrapper',\n description: 'The person unwrapping wBCH into BCH.',\n icon: 'user',\n },\n service: {\n name: 'Provider',\n description: 'The application providing the wrapping service.',\n icon: 'contract',\n },\n },\n\n // The engine has no knowledge of the covenant UTXOs and therefore cannot initiate wrap/unwrap, so the starting actions have been omitted.\n start: [],\n\n actions: {\n wrap: {\n name: 'Wrap BCH',\n description: 'Convert BCH into wBCH tokens.',\n icon: 'wrap',\n\n roles: {\n service: {\n requirements: {\n variables: [ 'direction', 'poolSatoshis', 'poolTokens', 'amountToWrap', 'amountToUnwrap' ],\n },\n },\n wrapper: {\n requirements: {\n variables: [ 'recipientLockingScript' ],\n },\n },\n },\n\n requirements: {\n participants: [\n { role: 'service', slots: { min: 1, max: 1 } },\n { role: 'wrapper', slots: { min: 1, max: 1 } },\n ],\n },\n\n transaction: 'wrapTransaction',\n },\n\n unwrap: {\n name: 'Unwrap wBCH',\n description: 'Convert wBCH tokens back into BCH.',\n icon: 'unwrap',\n\n roles: {\n service: {\n requirements: {\n variables: [ 'direction', 'poolSatoshis', 'poolTokens', 'amountToWrap', 'amountToUnwrap' ],\n },\n },\n unwrapper: {\n requirements: {\n variables: [ 'recipientLockingScript' ],\n },\n },\n },\n\n requirements: {\n participants: [\n { role: 'service', slots: { min: 1, max: 1 } },\n { role: 'unwrapper', slots: { min: 1, max: 1 } },\n ],\n },\n\n transaction: 'unwrapTransaction',\n },\n },\n\n transactions: {\n wrapTransaction: {\n name: 'Wrapped BCH',\n description: 'Wrapped $(<amountToWrap> <satoshisPerBCH> OP_DIV).$(<amountToWrap> <satoshisPerBCH> OP_MOD) BCH into wBCH tokens.',\n icon: 'wrap',\n\n inputs: [{ input: 'covenantInput', inputIndex: 0 }],\n outputs: [\n { output: 'covenantOutput', outputIndex: 0 },\n { output: 'wrappedTokensOutput', outputIndex: undefined },\n ],\n },\n\n unwrapTransaction: {\n name: 'Unwrapped wBCH',\n description:\n 'Unwrapped $(<amountToUnwrap> <satoshisPerBCH> OP_DIV).$(<amountToUnwrap> <satoshisPerBCH> OP_MOD) wBCH tokens back into BCH.',\n icon: 'unwrap',\n\n inputs: [{ input: 'covenantInput', inputIndex: 0 }],\n outputs: [\n { output: 'covenantOutput', outputIndex: 0 },\n { output: 'unwrappedSatoshisOutput', outputIndex: undefined },\n ],\n },\n },\n\n inputs: {\n covenantInput: {\n name: 'wBCH Covenant',\n description: 'The covenant being updated.',\n icon: 'contract',\n\n valueSatoshis: '$(<poolSatoshis>)',\n token: {\n category: '$(<wbchTokenCategory>)',\n amount: '$(<poolTokens>)',\n nft: null,\n },\n\n // NOTE: This should be named unlockingBytecode, as it refers to raw script and not an unlocking script entry.\n // TODO: Rename after: https://gitlab.com/GeneralProtocols/xo/templates/-/work_items/31\n unlockingScript: 'wrapBCHUnlockingBytecode',\n },\n },\n\n outputs: {\n covenantOutput: {\n name: 'wBCH Covenant',\n description: 'Holds BCH and wBCH tokens that can be freely converted.',\n icon: 'contract',\n\n lockingScript: 'wrapBCHLockingScript',\n\n valueSatoshis: '$(covenantChangeSatoshis)',\n token: {\n category: '$(<wbchTokenCategory>)',\n amount: '$(covenantChangeTokens)',\n nft: null,\n },\n\n roles: {\n // Indicate that users should not index this output.\n wrapper: { relevant: false },\n unwrapper: { relevant: false },\n\n // Define how the service provider can interact with this output.\n service: {\n // Define wrap and unwrap actions that the service provider can initialize.\n // TODO: Restore this functionality if needed in the future.\n // actions: [\n // {\n // action: 'wrap',\n // role: 'service',\n // variables: [\n // { direction: '$(<\"wrap\">)' },\n // { poolSatoshis: '$(XO_OUTPUTVALUE)' },\n // { poolTokens: '$(XO_OUTPUTTOKENAMOUNT)' },\n // ],\n // },\n // {\n // action: 'unwrap',\n // role: 'service',\n // variables: [\n // { direction: '$(<\"unwrap\">)' },\n // { poolSatoshis: '$(XO_OUTPUTVALUE)' },\n // { poolTokens: '$(XO_OUTPUTTOKENAMOUNT)' },\n // ],\n // },\n // ],\n\n // Mark balance as unavailable, since the service provider cannot spend from the contract.\n balance: {\n satoshis: 0n,\n fungibleTokens: 0n,\n },\n\n // Mark output as not selectable, since the service provider cannot spend from the contract.\n selectable: false,\n },\n },\n },\n\n wrappedTokensOutput: {\n name: 'Wrapped wBCH',\n description: 'Wrapped $(<amountToWrap> <satoshisPerBCH> OP_DIV).$(<amountToWrap> <satoshisPerBCH> OP_MOD) wBCH tokens.',\n icon: 'receive',\n\n valueSatoshis: '$(<tokenDust>)',\n token: {\n category: '$(<wbchTokenCategory>)',\n amount: '$(<amountToWrap>)',\n nft: null,\n },\n\n // NOTE: This should be named lockingBytecode, so that the engine does not need to create and track this locking script from here.\n // TODO: Rename after: https://gitlab.com/GeneralProtocols/xo/templates/-/work_items/36\n lockingScript: '$(<recipientLockingScript>)',\n },\n\n unwrappedSatoshisOutput: {\n name: 'Unwrapped BCH',\n description: 'Unwrapped $(<amountToUnwrap> <satoshisPerBCH> OP_DIV).$(<amountToUnwrap> <satoshisPerBCH> OP_MOD) BCH.',\n icon: 'receive',\n\n valueSatoshis: '$(<amountToUnwrap>)',\n token: null,\n\n // NOTE: This should be named lockingBytecode, so that the engine does not need to create and track this locking script from here.\n // TODO: Rename after: https://gitlab.com/GeneralProtocols/xo/templates/-/work_items/36\n lockingScript: '$(<recipientLockingScript>)',\n },\n },\n\n lockingScripts: {\n wrapBCHLockingScript: {\n name: 'wBCH Covenant',\n description: 'Holds BCH and wBCH tokens that can be freely converted.',\n icon: 'contract',\n\n lockingType: 'p2sh',\n lockingBytecode: 'wrapBCHLockingBytecode',\n\n // All outputs on the covenant are covenant outputs.\n // TODO: Add this defaultOutput after: https://gitlab.com/GeneralProtocols/xo/templates/-/work_items/33\n // defaultOutput: 'covenantOutput',\n\n // Indicate that users should not index this locking script.\n roles: {\n wrapper: { relevant: false },\n unwrapper: { relevant: false },\n },\n },\n },\n\n scripts: {\n // Utility to check if we are doing a wrap or unwrap.\n checkIfWrapping: '<direction> <\"wrap\"> OP_EQUAL',\n\n // Utilities to calculate the covenant change satoshis.\n wrappedChangeSatoshis: '<poolSatoshis> <amountToWrap> OP_ADD',\n unwrappedChangeSatoshis: '<poolSatoshis> <amountToUnwrap> OP_SUB',\n covenantChangeSatoshis: 'checkIfWrapping OP_IF wrappedChangeSatoshis OP_ELSE unwrappedChangeSatoshis OP_ENDIF',\n\n // Utilities to calculate the covenant change tokens.\n wrappedChangeTokens: '<poolTokens> <amountToWrap> OP_SUB',\n unwrappedChangeTokens: '<poolTokens> <amountToUnwrap> OP_ADD',\n covenantChangeTokens: 'checkIfWrapping OP_IF wrappedChangeTokens OP_ELSE unwrappedChangeTokens OP_ENDIF',\n\n // NOTE: This is the wrapped.cash covenant and so this bytecode cannot be updated.\n // NOTE: This covenant only ensure the security of its own funds, leaving user protection to be done in user space.\n enforceCovenantPersists: 'OP_INPUTINDEX OP_OUTPUTBYTECODE OP_INPUTINDEX OP_UTXOBYTECODE OP_EQUALVERIFY',\n enforceTokenCategoryPreserved: 'OP_INPUTINDEX OP_OUTPUTTOKENCATEGORY OP_INPUTINDEX OP_UTXOTOKENCATEGORY OP_EQUALVERIFY',\n enforceValueTokenSumConserved:\n 'OP_INPUTINDEX OP_UTXOTOKENAMOUNT OP_INPUTINDEX OP_UTXOVALUE OP_ADD OP_INPUTINDEX OP_OUTPUTTOKENAMOUNT OP_INPUTINDEX OP_OUTPUTVALUE OP_ADD OP_NUMEQUAL',\n\n // The final lock and unlocking bytecode.\n wrapBCHLockingBytecode: 'enforceCovenantPersists enforceTokenCategoryPreserved enforceValueTokenSumConserved',\n wrapBCHUnlockingBytecode: '<wrapBCHLockingBytecode>',\n },\n\n constants: {\n wbchTokenCategory: {\n name: 'wBCH Token Category',\n description: 'The official token category for Wrapped BCH.',\n type: 'bytes',\n value: 'ff4d6e4b90aa8158d39c5dc874fd9411af1ac3b5ed6f354755e8362a0d02c6b3',\n },\n satoshisPerBCH: {\n name: 'Satoshis per BCH',\n description: 'Used to display amounts in BCH with decimals.',\n type: 'integer',\n value: 100000000,\n },\n tokenDust: {\n name: 'Token Dust Limit',\n description: 'Minimal satoshis required for a token-bearing output.',\n type: 'integer',\n value: 1000,\n },\n },\n\n variables: {\n // Internal variables to be provided by the service provider application.\n direction: {\n name: 'Wrap or Unwrap',\n description: 'Internal variable used to determine if we are wrapping or unwrapping.',\n type: 'string',\n },\n amountToWrap: {\n name: 'Amount to Wrap',\n description: 'How much BCH to convert to wBCH (in satoshis).',\n type: 'satoshis',\n },\n amountToUnwrap: {\n name: 'Amount to Unwrap',\n description: 'How much wBCH to convert back to BCH (in satoshis).',\n type: 'satoshis',\n },\n poolSatoshis: {\n name: 'Initial Pool Satoshis',\n description: 'Internal variable used to determine how much satoshis to keep on the covenant.',\n type: 'integer',\n },\n poolTokens: {\n name: 'Initial Pool Tokens',\n description: 'Internal variable used to determine how much fungible tokens to keep on the covenant.',\n type: 'integer',\n },\n\n // The receiving locking script provided by the user.\n recipientLockingScript: {\n name: 'Destination',\n description: 'Where to receive your BCH or wBCH tokens.',\n type: 'locking_script',\n },\n },\n\n icons: [\n { name: 'logo', hash: 'c9fc99d9a819fcf35ee757f7358585838f3265e5e3cfdfc9de748656d44c5b8d' },\n { name: 'wrap', hash: 'db38e42a31bb522a0c3808547382c112366c03154d2b9c472ce81b82aae8023a' },\n { name: 'unwrap', hash: '635737592d8dce787b05956d9670c27db7a90f810eaf2c3b499a4392c3b91ff7' },\n { name: 'user', hash: '664914219d38a18caf0acd08701016b2c1f67adac7f498530820f6989cb2a66f' },\n { name: 'contract', hash: '4c00dd6692b2e2ea65ca288db7cfd84862dc22958d673595b5ab1cd83e452946' },\n { name: 'receive', hash: 'bfefd05d851968f7d205ee7eab2659460a36b95a2c04aa09a1b10542695bd3c6 ' },\n ],\n};\n","import type { XOTemplate } from '@xo-cash/types';\n\nexport const faucetCashTemplate: XOTemplate = {\n $schema: 'https://libauth.org/schemas/wallet-template-v0.schema.json',\n\n name: 'faucet.cash',\n description: 'A public Bitcoin Cash faucet with on-chain rate limits.',\n icon: 'faucet',\n\n version: '1',\n supported: [ 'BCH_2023_05', 'BCH_2024_05', 'BCH_2025_05', 'BCH_2026_05' ],\n\n resources: [\n {\n name: 'Original faucet contract',\n description: 'The original bitcoin-cash-faucet contract by 2qx that this template implements.',\n url: 'https://github.com/2qx/bitcoin-cash-faucet',\n },\n ],\n\n roles: {\n recipient: {\n name: 'Recipient',\n description: 'Someone receiving a funds from the faucet.',\n icon: 'recipient',\n },\n service: {\n name: 'Provider',\n description: 'Selects the faucet coin and fills in its value so the payout can be built.',\n icon: 'faucet',\n },\n },\n\n // The engine cannot discover faucet UTXOs on its own.\n // A service provide is expected to choose faucet variables and provide the input to pay out from.\n start: [],\n\n actions: {\n claim: {\n name: 'Receive from faucet',\n description: 'Receive a small amount of satoshis from a faucet.',\n icon: 'drip',\n\n roles: {\n service: {\n requirements: {\n variables: [ 'faucetIndex', 'periodBlocks', 'payoutSatoshis', 'faucetSatoshis' ],\n },\n },\n recipient: {\n requirements: {\n variables: [ 'payoutLockingScript' ],\n },\n },\n },\n\n requirements: {\n participants: [\n { role: 'service', slots: { min: 1, max: 1 } },\n { role: 'recipient', slots: { min: 1, max: 1 } },\n ],\n },\n\n transaction: 'claimTransaction',\n },\n },\n\n transactions: {\n claimTransaction: {\n name: 'Received from faucet',\n description: 'Received $(<faucetSatoshis>) satoshis from a faucet.',\n icon: 'drip',\n\n inputs: [\n { input: 'faucetInput', inputIndex: 0 },\n ],\n outputs: [\n { output: 'faucetOutput', outputIndex: 0 },\n { output: 'payoutOutput', outputIndex: undefined },\n ],\n },\n },\n\n inputs: {\n faucetInput: {\n name: 'Faucet funds',\n description: 'The faucet funds used for the payout.',\n icon: 'faucet',\n\n // Set the expected satoshis on the faucet output to spend.\n // NOTE: This is only validated by the engine, but is needed so that we can calculate the remaining satoshis after a payout.\n valueSatoshis: '$(<faucetSatoshis>)',\n token: null,\n\n // Set a relative lock-time preventing this input from being spent until it has reached this age.\n // NOTE: This only restricts an input created with this, the contract will later verify this as part of the spending constraints.\n sequenceNumber: '$(<periodBlocks>)',\n\n // Set the unlocking script to use for the faucets input.\n unlockingScript: 'faucetP2SH20UnlockingBytecode',\n },\n },\n\n outputs: {\n faucetOutput: {\n name: 'Faucet funds',\n description: 'The faucet funds remaining after the payout.',\n icon: 'faucet',\n\n // Set the faucets locking script.\n lockingScript: 'faucetContract',\n\n // Enforce that all funds not disbursed is returned to the faucet.\n valueSatoshis: '$(remainingFaucetSatoshis)',\n token: null,\n\n // Contract coins should not be used in automatic coin selection.\n selectable: false,\n\n // The balance on the faucet contract does not belong to anyone.\n balance: {\n satoshis: 0n,\n fungibleTokens: 0n,\n nonfungibleTokens: 0,\n },\n\n // Tracking of the faucet locking script is not relevant for recipients\n roles: {\n recipient: {\n relevant: false,\n },\n },\n },\n\n payoutOutput: {\n name: 'Faucet payout',\n description: '$(<faucetSatoshis>) satoshis paid out from the faucet.',\n icon: 'drip',\n\n // NOTE: the locking script is not enforced by the original contract, but is handled by template policy here.\n lockingScript: '$(<payoutLockingScript>)',\n valueSatoshis: '$(<payoutSatoshis> <minerFeeSatoshis> OP_SUB)',\n token: null,\n },\n },\n\n lockingScripts: {\n faucetContract: {\n name: 'The faucet.cash contract',\n description: 'Locking script that enforces the faucet.cash rules.',\n icon: 'faucet',\n\n // The faucets locking script.\n // NOTE: This is defined as p2s here, since XO only supports P2SH32 and the faucet is using the older P2SH20 construction.\n lockingType: 'p2s',\n lockingBytecode: 'faucetP2SH20LockingBytecode',\n\n // The faucet contract does not need to carry any state outside the on-chain data.\n state: { variables: [], secrets: [] },\n\n // Contract coins should not be used in automatic coin selection.\n selectable: false,\n\n // The balance on the faucet contract does not belong to anyone.\n balance: {\n satoshis: 0n,\n fungibleTokens: 0n,\n nonfungibleTokens: 0,\n },\n\n // Tracking of the faucet locking script is not relevant for recipients\n roles: {\n recipient: {\n relevant: false,\n },\n },\n },\n },\n\n scripts: {\n // Utility function used to calculate the remaining satoshis that must be on the faucet contract after payout.\n remainingFaucetSatoshis: '<faucetSatoshis> <payoutSatoshis> OP_SUB',\n\n // NOTE: This is the faucet.cash covenant and so this bytecode cannot be updated.\n // NOTE: This covenant only ensure the security of its own funds, leaving user protection to be done in user space.\n // NOTE: This covenant allows multiple faucet inputs (at any index) to validate against a single faucet output (at index 0),\n // which results in users being able to claim larger than intended drips when combining inputs.\n // This could be fixed by limiting the number of inputs, but this template encodes the existing contract without modifications.\n enforcePeriod: 'OP_CHECKSEQUENCEVERIFY OP_DROP',\n enforceIndexInScript: 'OP_SWAP OP_0 OP_GREATERTHANOREQUAL OP_VERIFY',\n enforceFaucetReturnsToSelf: 'OP_0 OP_OUTPUTBYTECODE <0xA914> OP_ACTIVEBYTECODE OP_HASH160 OP_CAT <0x87> OP_CAT OP_EQUALVERIFY',\n enforceReturnedValue: 'OP_INPUTINDEX OP_UTXOVALUE OP_SWAP OP_SUB OP_0 OP_OUTPUTVALUE OP_LESSTHANOREQUAL',\n\n // Set up the faucets redeem bytecode and locking script construction as the old pay (20) to script hash construct rather than the new (32).\n faucetRedeemBytecode: '<faucetIndex> <payoutSatoshis> <periodBlocks> enforcePeriod enforceIndexInScript enforceFaucetReturnsToSelf enforceReturnedValue',\n\n // The final lock and unlocking bytecode working with pay to script hash 20.\n faucetP2SH20LockingBytecode: 'OP_HASH160 <$(<faucetRedeemBytecode> OP_HASH160)> OP_EQUAL',\n faucetP2SH20UnlockingBytecode: '<faucetRedeemBytecode>',\n },\n\n constants: {\n minerFeeSatoshis: {\n name: 'Transaction Fee',\n description: 'Fixed number of satoshis required to pay the on-chain transaction fee.',\n type: 'satoshis',\n value: 400n,\n },\n },\n variables: {\n // Service provider variables that identifies which faucet to use.\n periodBlocks: {\n name: 'Blocks between payouts',\n description: 'How many blocks a faucet coin must wait before it can pay again.',\n type: 'integer',\n },\n payoutSatoshis: {\n name: 'Payout allowance',\n description: 'Satoshis taken from the faucet coin on each claim. Covers the user payout and the miner fee.',\n type: 'satoshis',\n },\n faucetIndex: {\n name: 'Faucet number',\n description: 'A number that makes this faucet address unique if several share the same wait time and payout amount.',\n type: 'integer',\n },\n\n // Service provider variable that is required to calculate the remaining faucet satoshis after a payout.\n faucetSatoshis: {\n name: 'Faucet satoshis',\n description: 'Amount of satoshis on the specific input the provider selected for this payout.',\n type: 'satoshis',\n },\n\n // User provided variable that determines where the faucet payout funds go.\n payoutLockingScript: {\n name: 'Recipient',\n description: 'The address that should receive the faucet payout.',\n type: 'locking_script',\n },\n },\n\n icons: [\n { name: 'drip', hash: '0000000000000000000000' },\n { name: 'faucet', hash: '0000000000000000000000' },\n { name: 'recipient', hash: '0000000000000000000000' },\n ],\n};\n"],"mappings":";AAEA,MAAa,gBAA4B;CACrC,SAAS;CAGT,MAAM;CAGN,aAAa;CAGb,MAAM;CAGN,SAAS;CAGT,WAAW;EAAE;EAAe;EAAe;EAAe;CAAc;CAGxE,UAAU;EAON,QAAQ;GACJ,QAAQ;GACR,MAAM;GACN,UAAU,CAAE,UAAW;EAC3B;EAGA,SAAS;GACL,eAAe;GACf,MAAM;GACN,UAAU,CAAE,UAAW;EAC3B;EAGA,SAAS;GACL,QAAQ;GACR,MAAM;GACN,UAAU,CAAE,UAAW;EAC3B;CACJ;CAMA,OAAO;EACH,OAAO;GACH,MAAM;GACN,aAAa;GACb,MAAM;EACV;EACA,UAAU;GACN,MAAM;GACN,aAAa;GACb,MAAM;EACV;EACA,QAAQ;GACJ,MAAM;GACN,aAAa;GACb,MAAM;EACV;CACJ;CAGA,OAAO;EACH;GACI,QAAQ;GACR,MAAM;GACN,UAAU,CAAE,UAAW;EAC3B;EACA;GACI,QAAQ;GACR,MAAM;GACN,UAAU,CAAE,UAAW;EAC3B;EACA;GACI,QAAQ;GACR,MAAM;GACN,UAAU,CAAE,UAAW;EAC3B;EACA;GACI,QAAQ;GACR,MAAM;GACN,UAAU,CAAE,UAAW;EAC3B;CACJ;CAKA,SAAS;EACL,SAAS;GAEL,MAAM;GACN,aAAa;G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GACb,MAAM;EACV;EACA,0BAA0B;GACtB,MAAM;GACN,aAAa;GACb,MAAM;EACV;EACA,wBAAwB;GACpB,MAAM;GACN,aAAa;GACb,MAAM;EACV;EACA,4BAA4B;GACxB,MAAM;GACN,aAAa;GACb,MAAM;EACV;EACA,4BAA4B;GACxB,MAAM;GACN,aAAa;GACb,MAAM;EACV;EACA,qBAAqB;GACjB,MAAM;GACN,aAAa;GACb,MAAM;EACV;EACA,mBAAmB;GACf,MAAM;GACN,aAAa;GACb,MAAM;EACV;EACA,uBAAuB;GACnB,MAAM;GACN,aAAa;GACb,MAAM;EACV;EACA,uBAAuB;GACnB,MAAM;GACN,aAAa;GACb,MAAM;EACV;CACJ;CAKA,OAAO;EACH;GACI,MAAM;GACN,MAAM;EACV;EACA;GACI,MAAM;GACN,MAAM;EACV;EACA;GACI,MAAM;GACN,MAAM;EACV;EACA;GACI,MAAM;GACN,MAAM;EACV;EACA;GACI,MAAM;GACN,MAAM;EACV;EACA;GACI,MAAM;GACN,MAAM;EACV;EACA;GACI,MAAM;GACN,MAAM;EACV;EACA;GACI,MAAM;GACN,MAAM;EACV;EACA;GACI,MAAM;GACN,MAAM;EACV;EACA;GACI,MAAM;GACN,MAAM;EACV;CACJ;CAEA,WAAW,CACP;EACI,MAAM;EACN,aAAa;EAGb,QAAQ;EAGR,OAAO,CACH;GACI,MAAM;GACN,QAAQ;IACJ,WAAW,EACP,UAAU,uDACd;IACA,WAAW,EACP,mBAAmB,IACvB;IACA,SAAS,CAET;IACA,QAAQ,CAAC;IACT,SAAS,CACL;KACI,iBAAiB;KACjB,eAAe;IACnB,CACJ;GACJ;EACJ,GACA;GACI,MAAM;GACN,QAAQ;IAEJ,WAAW,CAAC;IACZ,WAAW,CAAC;IACZ,SAAS,CAAC;IAGV,QAAQ,CACJ;KACI,yBAAyB;KACzB,eAAe;KACf,gBAAgB;KAChB,mBACI;IACR,CACJ;IACA,SAAS,CACL;KACI,iBAAiB;KACjB,eAAe;IACnB,CACJ;G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