Skip to content

Documentation / @xo-cash/engine

@xo-cash/engine ​

XO Engine

⚠️ This project is in early development phase. Use it only if you understand what you are doing and accept the risks. Do not use funds you are not willing to lose. Minor version bumps may introduce breaking changes

Installation ​

bash
npm install @xo-cash/engine

Basic Setup ​

typescript
import { Engine, XO_SUPPORTED_NETWORKS } from '@xo-cash/engine';
import { StorageType } from '@xo-cash/state';
import { p2pkhTemplate } from '@xo-cash/templates';

// Create the engine for one account. It connects to the Electrum servers of the network itself.
const engine = await Engine.create('your BIP39 mnemonic', {
    network: XO_SUPPORTED_NETWORKS.chipnet,
    storageType: StorageType.SQLITE,
    databasePath: './',
    databaseFilename: 'XO',
});

// Import a template. The result carries the template and its identifier.
const { templateIdentifier } = await engine.importTemplate(p2pkhTemplate);

// Read the actions the template can start with.
const startingActions = (await engine.getTemplate(templateIdentifier))?.start ?? [];

// Create an invitation for one of those actions.
const storedInvitation = await engine.createInvitation({
    templateIdentifier,
    actionIdentifier: 'requestSatoshis',
    intent: startingActions.find((startingAction) => startingAction.action === 'requestSatoshis'),
});

// Stop the engine to close its Electrum connections and storage, and destroy its keys.
await engine.stop();

See playground/examples/receive-satoshis.js for a full flow that funds, signs, and executes an invitation.

License ​

MIT

Engine ​

Defined in: source/engine.ts:80

Public interface of the XO engine. It holds the state, keys, network, and blockchain monitor of one account.

Accessors ​

network ​

Get Signature ​
ts
get network(): XONetwork;

Defined in: source/engine.ts:127

Network this engine instance targets.

Returns ​

XONetwork

  • Network this engine instance targets.

Methods ​

acceptInvitation() ​

ts
acceptInvitation(invitation, params?): Promise<StoredInvitation>;

Defined in: source/engine.ts:538

Accepts an invitation, an entity accepts an invitation and becomes part of the invitation.

Parameters ​
ParameterTypeDescription
invitationXOInvitationThe invitation to be accepted.
params?InvitationAcceptanceParametersOptional parameters for accepting the invitation, including the role or intent this account acts on.
Returns ​

Promise<StoredInvitation>

  • The accepted invitation as stored, including this account's entity identifier.
Throws ​

InvitationInvalidError - If the invitation does not match the XOInvitation type.

Throws ​

TemplateNotFoundInStoreError - If the template is not found.

Throws ​

TemplateActionNotFoundError - If the action is not found.

Throws ​

InvitationIntentMismatchError - If the intent names another template or another action than the invitation.

Throws ​

InvitationRoleDuplicatedError - If the role is given both directly and on the intent.

Throws ​

TemplateActionRoleNotFoundError - If the action does not define the role.

Throws ​

TemplateGeneratedVariableTypeUnsupportedError - If a variable to generate is not a private key.

Throws ​

InvitationValidationFailedError - If invitation validation fails once implemented.

Throws ​

InvitationItemFieldConflictError - If a received commit changes a value an earlier commit set.

Throws ​

RoleVariableEntityMismatchError - If a commit provides a variable of a role its entity does not hold.

Throws ​

EntityMultipleRolesWithFollowUpUnsupportedError - If a commit gives an entity more than one role with a follow up.

Throws ​

SecretDataNotFoundError - If a script hash of this account lists a secret that is not stored.

addChangeToInvitation() ​

ts
addChangeToInvitation(
   invitationIdentifier, 
   providedLockingBytecode?, 
   changeVariableValues?, 
   changeSelection?): Promise<StoredInvitation>;

Defined in: source/engine.ts:937

Adds the change to the invitation.

Leftover fungible tokens return on one change output per category. The satoshis left after those outputs and the fee return on a satoshi change output, or on the first token change output when they are below the dust limit. A change selection adds only the satoshi change and the token categories it names, and keeps the satoshis the other token categories need for their change outputs out of the satoshi change.

Parameters ​
ParameterTypeDescription
invitationIdentifierstringThe identifier of the invitation to add the change to.
providedLockingBytecode?stringLocking bytecode to send the change to, as hex.
changeVariableValues?Record<string, XOInvitationVariableValue>Values the change intent requires.
changeSelection?ChangeSelectionSatoshi change and token categories to add. Every leftover is added when omitted.
Returns ​

Promise<StoredInvitation>

  • The invitation as stored after the change output is appended.
Throws ​

InvitationNotFoundInStoreError - When the invitation is not stored.

Throws ​

TemplateNotFoundInStoreError - When the template is not stored.

Throws ​

ChangeLockingBytecodeMissingError - When no locking bytecode is provided, the template defines no change policy, and the wallet has no default change policy.

Throws ​

TemplateDefaultPolicyMissingError - When the template of the wallet default change policy does not define change.

Throws ​

TemplateOutputNotFoundError - When the change intent names an output its target template does not define.

Throws ​

IntentVariablesMissingError - When a variable the change intent requires has no value.

Throws ​

ChangeSatoshisInsufficientError - When the leftover satoshis cannot pay for the token change outputs and the fee.

Throws ​

ChangeSelectionEmptyError - When the selection names neither the satoshi change nor any token category.

Throws ​

ChangeTokenCategoriesUnavailableError - When the selection names token categories without leftover fungible tokens.

Throws ​

ChangeSatoshisBelowDustError - When only the satoshi change is added and it is below the dust limit.

appendInvitation() ​

ts
appendInvitation(invitationIdentifier, params): Promise<StoredInvitation>;

Defined in: source/engine.ts:609

Appends the invitation with the new information.

Parameters ​
ParameterTypeDescription
invitationIdentifierstringThe identifier of the invitation to append. The invitation must already exist in the store.
paramsInvitationParametersThe parameters to append the invitation with.
Returns ​

Promise<StoredInvitation>

  • The appended invitation as stored, including the local entity identifier.
Throws ​

InvitationNotFoundInStoreError - If the invitation is not found in the store.

Throws ​

AppendInvitationParametersEmptyError - When every appendable field is omitted.

Throws ​

UnspentOutputReservationExternalConflictError - If a local outpoint is already reserved by another invitation.

Throws ​

UnspentOutputReservationInternalConflictError - If this invitation already reserves or spends the outpoint.

Throws ​

TemplateOutputNotFoundError - If an output names a template output the template does not define.

Throws ​

TemplateLockingScriptRoleNotFoundError - If an output names a role its locking script does not define.

Throws ​

LockingBytecodeGenerationFailedError - If the locking bytecode of an output that names only a template output cannot be compiled.

Throws ​

LockingScriptSecretsNotFoundError - If such an output's locking script uses secrets this account has not generated for the invitation.

Throws ​

LockingScriptResolutionsMissingError - If such an output's locking script needs values the invitation does not hold yet. Use Engine.listOutputResolutions to see them and Engine.appendOwnOutputResolutions to add this account's part.

Throws ​

SecretDataNotFoundError - If a secret recorded for this invitation is not in the secret store.

appendOwnInputResolutions() ​

ts
appendOwnInputResolutions(invitationIdentifier, inputIndex): Promise<StoredInvitation>;

Defined in: source/engine.ts:744

Adds the key operations this account resolved for an invitation input, such as its signature, to that input, so the participant holding the remaining keys can complete the unlocking bytecode.

Parameters ​
ParameterTypeDescription
invitationIdentifierstringInvitation the input belongs to.
inputIndexnumberIndex of the merged input.
Returns ​

Promise<StoredInvitation>

  • The invitation as stored after the commit with the values.
Throws ​

InputOwnResolutionsNotFoundError - If this account resolved nothing the invitation does not already hold.

Throws ​

InvitationNotFoundInStoreError - If the invitation is not found in the store.

Throws ​

MergedInputCommitNotFoundError - When the input has no merged leaf to extend.

Throws ​

MergedInputOutpointMissingError - When the merged input has no outpoint.

Throws ​

InputUnspentOutputUnavailableError - When the spent output is not tracked by this account or is reserved by another invitation.

Throws ​

UnlockingBytecodeGenerationFailedError - When the unlocking script fails to compile for a reason other than a missing identifier.

Throws ​

MergedOutputLockingBytecodeMissingError - When an output has no locking bytecode and its template output defines no locking script.

Throws ​

MergedOutputLockingScriptVariablesMissingError - When an output locking script reads variables that no commit provides.

appendOwnOutputResolutions() ​

ts
appendOwnOutputResolutions(
   invitationIdentifier, 
   outputIdentifier, 
   roleIdentifier?): Promise<StoredInvitation>;

Defined in: source/engine.ts:689

Adds the key operations this account resolved for an invitation output to the invitation, so other participants can compile the same locking script.

Parameters ​
ParameterTypeDescription
invitationIdentifierstringInvitation the output belongs to.
outputIdentifierstringTemplate output whose locking script the values are for.
roleIdentifier?stringRole on the output, when one is set.
Returns ​

Promise<StoredInvitation>

  • The invitation as stored after the commit with the values.
Throws ​

OutputOwnResolutionsNotFoundError - If this account resolved nothing the invitation does not already hold.

Throws ​

InvitationNotFoundInStoreError - If the invitation is not found in the store.

Throws ​

TemplateOutputNotFoundError - If the template does not define the output.

Throws ​

TemplateLockingScriptRoleNotFoundError - If the role is not defined on the output's locking script.

Throws ​

LockingScriptSecretsNotFoundError - If the locking script uses secrets this account has not generated for the invitation.

Throws ​

LockingBytecodeGenerationFailedError - If the locking script fails to compile for a reason other than a missing identifier.

Throws ​

SecretDataNotFoundError - If a secret recorded for this invitation is not in the secret store.

archiveInvitation() ​

ts
archiveInvitation(invitationIdentifier): Promise<void>;

Defined in: source/engine.ts:473

Archives one stored invitation in local storage.

Parameters ​
ParameterTypeDescription
invitationIdentifierstringIdentifier of the invitation to archive
Returns ​

Promise<void>

  • Resolves when the invitation is archived and its reservations are cleared
Throws ​

InvitationNotFoundInStoreError - If the invitation is not in the store

Warning ​

This archives local invitation history for the identifier.

archiveTemplate() ​

ts
archiveTemplate(templateIdentifier): Promise<void>;

Defined in: source/engine.ts:270

Archives one stored template in local storage.

Parameters ​
ParameterTypeDescription
templateIdentifierstringIdentifier of the template to archive
Returns ​

Promise<void>

  • Resolves when the template is archived
Throws ​

TemplateNotFoundInStoreError - If the template is not in the store.

buildInvitationTransactionFromMergedCommit() ​

ts
buildInvitationTransactionFromMergedCommit(invitationIdentifier): Promise<BuiltInvitationTransaction>;

Defined in: source/engine.ts:791

Builds the encoded transaction for an invitation without broadcasting or persisting a hash.

Parameters ​
ParameterTypeDescription
invitationIdentifierstringStored invitation to encode.
Returns ​

Promise<BuiltInvitationTransaction>

  • Transaction hex and size metadata.
Throws ​

InvitationNotFoundInStoreError - When the invitation is missing.

Throws ​

TemplateNotFoundInStoreError - When the template is missing.

Throws ​

TemplateActionTransactionNotFoundError - When the action has no transaction definition.

Throws ​

TransactionGenerationFailedError - When libauth cannot build the transaction.

Throws ​

MergedOutputLockingBytecodeMissingError - When an output has no locking bytecode and its template output defines no locking script.

Throws ​

MergedOutputLockingScriptVariablesMissingError - When an output locking script reads variables that no commit provides.

calculateChange() ​

ts
calculateChange(invitationIdentifier): Promise<MergedInvitationChange>;

Defined in: source/engine.ts:892

Calculates the change for the invitation.

Parameters ​
ParameterTypeDescription
invitationIdentifierstringThe identifier of the invitation to calculate the change for.
Returns ​

Promise<MergedInvitationChange>

  • The calculated change.

createInvitation() ​

ts
createInvitation(params): Promise<StoredInvitation>;

Defined in: source/engine.ts:512

Creates an invitation that can be shared with other entities, user, application, etc. Invitation is the fundamental communication unit in XO, all the interactions done using the xo template are done using invitations.

Parameters ​
ParameterTypeDescription
paramsInvitationCreationParametersThe parameters for invitation creation.
Returns ​

Promise<StoredInvitation>

  • The constructed invitation as stored, including this account's entity identifier.
Throws ​

TemplateNotFoundInStoreError - If the template is not found.

Throws ​

TemplateActionNotFoundError - If the action is not found.

Throws ​

InvitationIntentMismatchError - If the intent names another template or action.

Throws ​

InvitationRoleDuplicatedError - If the role is given both directly and on the intent.

Throws ​

TemplateActionRoleNotFoundError - If the action does not define the role.

Throws ​

TemplateGeneratedVariableTypeUnsupportedError - If a variable to generate is not a private key.

Throws ​

UnspentOutputReservationExternalConflictError - If a local outpoint is already reserved by another invitation.

Throws ​

UnspentOutputReservationInternalConflictError - If a local outpoint is already reserved by this invitation.

Throws ​

SecretDataNotFoundError - If a script hash of this account lists a secret that is not stored.

Throws ​

EntityMultipleRolesWithFollowUpUnsupportedError - If the first commit gives this account more than one role with a follow up.

DANGEROUS_deleteAccountDatabase() ​

ts
DANGEROUS_deleteAccountDatabase(): Promise<void>;

Defined in: source/engine.ts:434

Permanently deletes the full local account database for this engine instance.

Returns ​

Promise<void>

  • Resolves when the local database is deleted.
Throws ​
  • If shutdown or deletion fails.
Warning ​

This permanently deletes templates, invitations, script hashes, unspent outputs, and events. Use this only when the developer fully understands the data loss impact.

estimateTransactionFee() ​

ts
estimateTransactionFee(invitationIdentifier): Promise<number>;

Defined in: source/engine.ts:908

Estimates the transaction fee for the invitation.

Parameters ​
ParameterTypeDescription
invitationIdentifierstringThe identifier of the invitation to estimate the transaction fee for.
Returns ​

Promise<number>

  • The estimated transaction fee.
Throws ​

InvitationNotFoundInStoreError - When the invitation is not stored.

Throws ​

TemplateNotFoundInStoreError - When the template is not stored.

executeAction() ​

ts
executeAction(invitationIdentifier, params): Promise<ExecuteActionResult>;

Defined in: source/engine.ts:812

Executes an action for a given invitation.

Parameters ​
ParameterTypeDescription
invitationIdentifierstringThe identifier of the invitation whose action to execute. The invitation must already exist in the store.
paramsExecuteActionParametersParameters for executing the action.
Returns ​

Promise<ExecuteActionResult>

  • Encoded transaction metadata and the persisted invitation.
Throws ​

InvitationNotFoundInStoreError - If the invitation is not found in the store.

Throws ​

TemplateNotFoundInStoreError - If the invitation's template is not found in the store.

Throws ​

TransactionResultAlreadyExistsError - If a different transaction was already recorded for the action.

Throws ​

TransactionBroadcastFailedError - If the network rejects the transaction.

Throws ​

TransactionResultNotFoundError - If the created result is missing when the broadcast is recorded.

Throws ​

MergedOutputLockingBytecodeMissingError - When an output has no locking bytecode and its template output defines no locking script.

Throws ​

MergedOutputLockingScriptVariablesMissingError - When an output locking script reads variables that no commit provides.

generateLockingBytecodeFromDefaultPolicy() ​

ts
generateLockingBytecodeFromDefaultPolicy(
   policy, 
   variableValues?, 
   invitationIdentifier?): Promise<string>;

Defined in: source/engine.ts:414

Generates a locking bytecode from a wallet default policy.

The stored policy names a template, and that template's defaults intent says which output or locking script, role, and secrets to use. Every variable from Engine.listDefaultPolicyRequiredVariables must be in variableValues, otherwise nothing is generated and no derivation index is used.

Parameters ​
ParameterTypeDescription
policykeyof WalletDefaultPoliciesDefault policy to create from, one of change, receive, or address.
variableValues?Record<string, XOInvitationVariableValue>Values for the variables the intent requires, empty when none are passed.
invitationIdentifier?stringInvitation the locking bytecode is built for. Keys this account already generated for it under the policy template are used instead of new ones.
Returns ​

Promise<string>

  • The generated locking bytecode as a hexadecimal string.
Throws ​

TemplateNotFoundInStoreError - When the policy template or the intent target template is not stored.

Throws ​

DefaultPolicyNotSetError - When the policy is not set.

Throws ​

TemplateDefaultPolicyMissingError - When its template does not define it.

Throws ​

IntentVariablesMissingError - When a required variable value is missing.

Throws ​

LockingBytecodeGenerationFailedError - When Libauth compilation fails.

Throws ​

InvitationNotFoundInStoreError - When an invitation is given and it is not stored.

Throws ​

SecretDataNotFoundError - When a secret recorded for that invitation is not in the secret store.

generateUnlockingBytecode() ​

ts
generateUnlockingBytecode(invitationIdentifier, inputIndex): Promise<GeneratedInputUnlockingBytecode>;

Defined in: source/engine.ts:1059

Compiles unlocking bytecode for one merged input without appending it to the invitation.

Parameters ​
ParameterTypeDescription
invitationIdentifierstringInvitation that owns the input.
inputIndexnumberIndex of the merged input to unlock.
Returns ​

Promise<GeneratedInputUnlockingBytecode>

  • Unlocking bytecode for that input.
Throws ​

InvitationNotFoundInStoreError - When the invitation is absent from the store.

Throws ​

MergedInputOutpointMissingError - When the merged input has no outpoint.

Throws ​

InputUnspentOutputUnavailableError - When the spent output is not tracked by this account or is reserved by another invitation.

Throws ​

ScriptHashDataNotFoundError - When the reserved output has no stored script hash.

Throws ​

UnlockingBytecodeGenerationFailedError - When Libauth compilation fails.

Throws ​

TemplateNotFoundInStoreError - When the template is absent from the store.

Throws ​

MergedOutputLockingBytecodeMissingError - When an output has no locking bytecode and its template output defines no locking script.

Throws ​

MergedOutputLockingScriptVariablesMissingError - When an output locking script reads variables that no commit provides.

getChainStatus() ​

ts
getChainStatus(): Promise<ChainStatus>;

Defined in: source/engine.ts:145

Reads the chain status the Electrum application last reported, with the reported and verified block heights.

Returns ​

Promise<ChainStatus>

  • Current height, verified height, and verified percent of the chain.

getDefaultPolicies() ​

ts
getDefaultPolicies(): Promise<WalletDefaultPolicies>;

Defined in: source/engine.ts:362

Returns the wallet default policies used for change, receive, and address generation.

Each policy is present only when it has been set with Engine.setDefaultPolicies.

Returns ​

Promise<WalletDefaultPolicies>

  • Stored default policies, or an empty object when none are stored.

getInvitation() ​

ts
getInvitation(invitationIdentifier): Promise<StoredInvitation | undefined>;

Defined in: source/engine.ts:451

Retrieves an invitation by its identifier from the state.

Parameters ​
ParameterTypeDescription
invitationIdentifierstringInvitation identifier.
Returns ​

Promise<StoredInvitation | undefined>

  • The invitation, or undefined when it is not stored.

getSecretPublicKey() ​

ts
getSecretPublicKey(secretLookupKey): Promise<string | undefined>;

Defined in: source/engine.ts:1021

Returns the public key of a secret whose value is entropy. If the value is not entropy or the secret doesn't exist, undefined is returned.

Parameters ​
ParameterTypeDescription
secretLookupKeystringLookup key the secret is stored under.
Returns ​

Promise<string | undefined>

  • The compressed public key as hex, or undefined when the secret holds no entropy.

getTemplate() ​

ts
getTemplate(templateIdentifier): Promise<XOTemplate | undefined>;

Defined in: source/engine.ts:230

Retrieves a template by its identifier from the state.

Parameters ​
ParameterTypeDescription
templateIdentifierstringTemplate identifier.
Returns ​

Promise<XOTemplate | undefined>

  • The template object.

getWalletName() ​

ts
getWalletName(): Promise<string | undefined>;

Defined in: source/engine.ts:294

Returns the stored name of this wallet.

Returns ​

Promise<string | undefined>

  • Stored wallet name, or undefined when no name has been stored.

importTemplate() ​

ts
importTemplate(untrustedJsonOrObject): Promise<{
  template: XOTemplate;
  templateIdentifier: string;
}>;

Defined in: source/engine.ts:249

Imports a template into the Engine after sanitization and validation.

Parameters ​
ParameterTypeDescription
untrustedJsonOrObjectstring | XOTemplateJSON or object containing the untrusted template to import.
Returns ​

Promise<{ template: XOTemplate; templateIdentifier: string; }>

  • The imported template and its identifier.
Throws ​

TemplateInvalidError - If the template is invalid.

Throws ​

DatabaseWriteOperationFailedError - If an unexpected database error occurs.

joinInvitationRole() ​

ts
joinInvitationRole(invitationIdentifier, roleIdentifier): Promise<StoredInvitation>;

Defined in: source/engine.ts:560

Joins an invitation this account already takes part in with another role.

The role must still have a free slot, and the keys it asks for are generated with the commit that names it.

Parameters ​
ParameterTypeDescription
invitationIdentifierstringInvitation to join with the role.
roleIdentifierstringRole to take.
Returns ​

Promise<StoredInvitation>

  • The invitation as stored after the commit that names the role.
Throws ​

InvitationNotFoundInStoreError - If the invitation is not stored.

Throws ​

InvitationRoleUnavailableError - If the role has no free slot left.

Throws ​

TemplateActionRoleNotFoundError - If the action does not define the role.

Throws ​

EntityMultipleRolesWithFollowUpUnsupportedError - If the role would give this account more than one role with a follow up.

Throws ​

TemplateNotFoundInStoreError - If the template is not found.

Throws ​

TemplateActionNotFoundError - If the action is not found.

Throws ​

TemplateGeneratedVariableTypeUnsupportedError - If a variable to generate is not a private key.

listAvailableRoles() ​

ts
listAvailableRoles(invitation): Promise<string[]>;

Defined in: source/engine.ts:826

Lists available roles for the given invitation.

Parameters ​
ParameterTypeDescription
invitationXOInvitationThe invitation to examine.
Returns ​

Promise<string[]>

  • The list of roles that still require data.
Throws ​

TemplateNotFoundInStoreError - If the template is not found.

Throws ​

TemplateActionNotFoundError - If the action is not found.

listDefaultPolicyRequiredVariables() ​

ts
listDefaultPolicyRequiredVariables(policy): Promise<string[]>;

Defined in: source/engine.ts:389

Lists the variables a caller must provide to create a locking bytecode from a wallet default policy.

These are the variables the policy template's defaults intent marks with a null value, plus any the generated locking script needs that the template constants and intent presets do not supply. Pass their values to Engine.generateLockingBytecodeFromDefaultPolicy.

Parameters ​
ParameterTypeDescription
policykeyof WalletDefaultPoliciesDefault policy to inspect, one of change, receive, or address.
Returns ​

Promise<string[]>

  • Required variable identifiers, empty when nothing needs to be provided.
Throws ​

TemplateNotFoundInStoreError - When the policy template or the intent target template is not stored.

Throws ​

DefaultPolicyNotSetError - When the policy is not set.

Throws ​

TemplateDefaultPolicyMissingError - When its template does not define it.

listElectrumConnections() ​

ts
listElectrumConnections(): ElectrumConnection[];

Defined in: source/engine.ts:136

Lists every Electrum server this engine connects to, with the state of each connection.

Returns ​

ElectrumConnection[]

  • One entry per Electrum client, empty before Electrum is initialized.

listInputResolutions() ​

ts
listInputResolutions(invitationIdentifier, inputIndex): Promise<InvitationResolutionRequirements>;

Defined in: source/engine.ts:720

Lists the key operations an invitation input's unlocking script needs from participants, without signing or adding anything.

Each operation is reported as provided when the invitation or the input holds it, as this account's own when only this account's keys resolve it, such as its signature, or as missing when another participant holds the key. The input can be signed with Engine.signInvitation once nothing is this account's own or missing.

Parameters ​
ParameterTypeDescription
invitationIdentifierstringInvitation the input belongs to.
inputIndexnumberIndex of the merged input.
Returns ​

Promise<InvitationResolutionRequirements>

  • Provided identifiers, values this account can add, and identifiers others still owe.
Throws ​

InvitationNotFoundInStoreError - If the invitation is not found in the store.

Throws ​

MergedInputOutpointMissingError - When the merged input has no outpoint.

Throws ​

InputUnspentOutputUnavailableError - When the spent output is not tracked by this account or is reserved by another invitation.

Throws ​

ScriptHashDataNotFoundError - When the spent output has no stored script hash.

Throws ​

TemplateUnlockingScriptNotFoundError - When neither the template input nor the locking script names an unlocking script.

Throws ​

UnlockingBytecodeGenerationFailedError - When the unlocking script fails to compile for a reason other than a missing identifier.

Throws ​

MergedOutputLockingBytecodeMissingError - When an output has no locking bytecode and its template output defines no locking script.

Throws ​

MergedOutputLockingScriptVariablesMissingError - When an output locking script reads variables that no commit provides.

listInvitations() ​

ts
listInvitations(options?): Promise<StoredInvitation[]>;

Defined in: source/engine.ts:461

Lists invitations for this account.

Parameters ​
ParameterTypeDescription
options?StorageListOptionsOptional list options such as archive filter.
Returns ​

Promise<StoredInvitation[]>

  • Invitations for this account.

listMissingRequirements() ​

ts
listMissingRequirements(invitationIdentifier): Promise<InvitationMissingRequirements>;

Defined in: source/engine.ts:853

Lists all missing requirements for the provided invitation. They fall in two categories, which are requirements expected by the template but not yet provided in any commit, and inputs already committed with a real UTXO outpoint that are still missing their unlocking bytecode.

Parameters ​
ParameterTypeDescription
invitationIdentifierstringThe identifier of the invitation to analyze. The invitation must exist in the store.
Returns ​

Promise<InvitationMissingRequirements>

  • Both the template-level gaps and the unsigned input gaps.
Throws ​

InvitationNotFoundInStoreError - If the invitation is not found in the store.

Throws ​

TemplateNotFoundInStoreError - If the template is not found in the store.

Throws ​

TemplateActionNotFoundError - When the action is not on the template.

listOutputResolutions() ​

ts
listOutputResolutions(
   invitationIdentifier, 
   outputIdentifier, 
   roleIdentifier?): Promise<InvitationResolutionRequirements>;

Defined in: source/engine.ts:663

Lists the key operations an invitation output's locking script needs from participants, without adding anything.

Each operation is reported as provided when the invitation holds it, as this account's own when only this account's keys resolve it, or as missing when another participant holds the key. The output can be added once nothing is this account's own or missing.

Parameters ​
ParameterTypeDescription
invitationIdentifierstringInvitation the output belongs to.
outputIdentifierstringTemplate output to check.
roleIdentifier?stringRole on the output, when one is set.
Returns ​

Promise<InvitationResolutionRequirements>

  • Provided identifiers, values this account can add, and identifiers others still owe.
Throws ​

InvitationNotFoundInStoreError - If the invitation is not found in the store.

Throws ​

TemplateOutputNotFoundError - If the template does not define the output.

Throws ​

TemplateLockingScriptRoleNotFoundError - If the role is not defined on the output's locking script.

Throws ​

LockingScriptSecretsNotFoundError - If the locking script uses secrets this account has not generated for the invitation.

Throws ​

LockingBytecodeGenerationFailedError - If the locking script fails to compile for a reason other than a missing identifier.

Throws ​

SecretDataNotFoundError - If a secret recorded for this invitation is not in the secret store.

listOwnCommits() ​

ts
listOwnCommits(invitationIdentifier): Promise<XOInvitationCommit[]>;

Defined in: source/engine.ts:864

Returns all commits in the invitation that were made by the current entity.

Parameters ​
ParameterTypeDescription
invitationIdentifierstringThe identifier of the invitation to examine.
Returns ​

Promise<XOInvitationCommit[]>

  • Commits belonging to this engine's entity, in order.
Throws ​

InvitationNotFoundInStoreError - If the invitation is not found in the store.

listOwnInputIndexes() ​

ts
listOwnInputIndexes(invitationIdentifier): Promise<number[]>;

Defined in: source/engine.ts:878

Finds all the inputs that are reserved by the current entity.

Parameters ​
ParameterTypeDescription
invitationIdentifierstringThe identifier of the invitation to find inputs for.
Returns ​

Promise<number[]>

  • The indexes of the inputs that are reserved by the current entity.
Throws ​

InvitationNotFoundInStoreError - When the invitation is not in the store.

Throws ​

TemplateNotFoundInStoreError - When the template is not in the store.

listRequirements() ​

ts
listRequirements(invitation): Promise<InvitationRequirementIdentifierLists>;

Defined in: source/engine.ts:838

Lists requirements for the provided invitation.

Parameters ​
ParameterTypeDescription
invitationXOInvitationThe invitation to analyze requirements for.
Returns ​

Promise<InvitationRequirementIdentifierLists>

  • The requirements information.
Throws ​

TemplateNotFoundInStoreError - When the template is not in the store.

Throws ​

TemplateActionNotFoundError - When the action is not on the template.

listScriptHashData() ​

ts
listScriptHashData(query): Promise<ScriptHashData[]>;

Defined in: source/engine.ts:999

Lists script hashes via state indexed storage query.

Forwards to State.listScriptHashData. Exactly one of templateIdentifier, scriptHash, or invitationIdentifier.

Parameters ​
ParameterTypeDescription
queryScriptHashDataQueryStorage query accepted by the state package.
Returns ​

Promise<ScriptHashData[]>

  • Matching script hashes from storage.
Throws ​

QueryFieldsLimitExceededError - When more than one query field is set.

Throws ​

QueryInvalidError - When no recognized query field is set.

listScriptHashes() ​

ts
listScriptHashes(options?): Promise<ScriptHashData[]>;

Defined in: source/engine.ts:985

Lists the script hashes of every stored template. By default only the script hashes of un-archived templates are returned.

Parameters ​
ParameterTypeDescription
options?StorageListOptionsOptional list options.
Returns ​

Promise<ScriptHashData[]>

  • The script hash data of every matching template.
Throws ​

ArchiveFilterInvalidError - When the archive filter is not one of the supported filters.

listSecretData() ​

ts
listSecretData(): Promise<StoredSecretData[]>;

Defined in: source/engine.ts:1010

Lists every secret this account has generated.

Each secret holds a derivation index, not a key.

Returns ​

Promise<StoredSecretData[]>

  • The generated secrets, each with its lookup key, empty when none are stored.

listSecretsForScriptHash() ​

ts
listSecretsForScriptHash(scriptHash): Promise<SecretData[]>;

Defined in: source/engine.ts:1035

Lists the secrets stored for a script hash, in the order the script hash lists them.

Stored script hash data keeps only the lookup key of each secret, so each secret is read by its lookup key.

Parameters ​
ParameterTypeDescription
scriptHashstringScript hash of a stored locking script.
Returns ​

Promise<SecretData[]>

  • The secrets for the script hash, empty when it lists none.
Throws ​

ScriptHashDataNotFoundError - When the script hash is not stored.

Throws ​

SecretDataNotFoundError - When the script hash lists a lookup key that has no stored secret.

listSpendableUnspentOutputs() ​

ts
listSpendableUnspentOutputs(options?): Promise<UnspentOutputData[]>;

Defined in: source/engine.ts:969

Lists the unreserved unspent outputs that are free to spend.

Outputs reserved by an invitation are excluded so the same output is never offered to two invitations. When ListSpendableUnspentOutputsParameters are passed, only outputs locked by that template output and matching every provided token field are returned.

Parameters ​
ParameterTypeDescription
options?ListSpendableUnspentOutputsParametersTemplate output and token fields that every returned output must match.
Returns ​

Promise<UnspentOutputData[]>

  • The unreserved unspent outputs that match the provided options.
Throws ​

TemplateNotFoundInStoreError - When the template in the options is not stored.

Throws ​

TemplateOutputNotFoundError - When the output in the options is not defined by that template.

listTemplates() ​

ts
listTemplates(options?): Promise<StoredTemplate[]>;

Defined in: source/engine.ts:259

Lists templates for this account.

Parameters ​
ParameterTypeDescription
options?StorageListOptionsOptional list options such as archive filter.
Returns ​

Promise<StoredTemplate[]>

  • Templates for this account.

listTemplatesForDefaultPolicy() ​

ts
listTemplatesForDefaultPolicy(policy): Promise<DefaultPolicyTemplate[]>;

Defined in: source/engine.ts:372

Lists the stored templates that can back the given wallet default policy.

Parameters ​
ParameterTypeDescription
policykeyof WalletDefaultPoliciesDefault policy being chosen, one of change, receive, or address.
Returns ​

Promise<DefaultPolicyTemplate[]>

  • Matching templates with their storage identifiers.

listUnspentOutputs() ​

ts
listUnspentOutputs(query?, filter?): Promise<UnspentOutputData[]>;

Defined in: source/engine.ts:953

Lists the unspent outputs this account tracks, each with the confirmation status Electrum last reported.

Parameters ​
ParameterTypeDescription
query?UnspentOutputDataQueryTemplate, reservation, script hash, or status to select outputs by.
filter?UnspentOutputDataFilterReservation and token fields every returned output must match.
Returns ​

Promise<UnspentOutputData[]>

  • Unspent outputs matching the query and filter, or every tracked output when both are omitted.

resolveInvitationOutputLockingBytecode() ​

ts
resolveInvitationOutputLockingBytecode(
   invitationIdentifier, 
   outputIdentifier, 
   roleIdentifier?): Promise<string>;

Defined in: source/engine.ts:635

Resolves the locking bytecode an invitation output compiles to, without generating or storing anything.

The locking script compiles with the template constants, the invitation variables, and the keys this account already generated for the invitation, which is what Engine.appendInvitation uses when the output is added. The script's secrets are existing secrets and are never generated for it, so a secret the invitation does not hold fails the resolution the same way adding the output would.

Parameters ​
ParameterTypeDescription
invitationIdentifierstringInvitation the output belongs to.
outputIdentifierstringTemplate output to resolve.
roleIdentifier?stringRole on the output, when one is set.
Returns ​

Promise<string>

  • The locking bytecode as a hexadecimal string.
Throws ​

InvitationNotFoundInStoreError - If the invitation is not found in the store.

Throws ​

TemplateOutputNotFoundError - If the template does not define the output.

Throws ​

TemplateLockingScriptRoleNotFoundError - If the role is not defined on the output's locking script.

Throws ​

LockingScriptSecretsNotFoundError - If the locking script uses secrets this account has not generated for the invitation.

Throws ​

LockingBytecodeGenerationFailedError - If the locking bytecode cannot be compiled.

Throws ​

SecretDataNotFoundError - If a secret recorded for this invitation is not in the secret store.

Throws ​

CashAssemblyCompilationFailedError - If the output locking script is a CashAssembly expression that cannot be compiled.

Throws ​

LockingScriptCompilationFailedError - If the template locking script the output names cannot be compiled.

Throws ​

LockingScriptResolutionsMissingError - If the script uses key operations other participants have not resolved yet.

setDefaultPolicies() ​

ts
setDefaultPolicies(policiesToSet): Promise<void>;

Defined in: source/engine.ts:338

Sets the wallet default policies used for change, receive, and address generation.

Each policy is set independently. A policy omitted from policiesToSet keeps its stored value, so setting the change policy never clears the receive or address policy. Resolution order is override, then template defaults, then these default policies.

Parameters ​
ParameterTypeDescription
policiesToSetWalletDefaultPoliciesPolicies to set, each naming a template that defines that policy in its defaults.
Returns ​

Promise<void>

  • Resolves when the provided policies have been stored.
Throws ​

TemplateNotFoundInStoreError - When a policy names a template that is not stored.

Throws ​

TemplateDefaultPolicyMissingError - When a policy names a template whose defaults do not define that policy.

setWalletName() ​

ts
setWalletName(walletName): Promise<void>;

Defined in: source/engine.ts:314

Stores the name of this wallet.

The name is trimmed before it is stored and replaces any name stored before.

Parameters ​
ParameterTypeDescription
walletNamestringName to store.
Returns ​

Promise<void>

  • Resolves when the trimmed name has been stored.
Throws ​

WalletNameMissingError - When the name is empty or contains only whitespace.

signInvitation() ​

ts
signInvitation(invitationIdentifier, inputIndex): Promise<StoredInvitation>;

Defined in: source/engine.ts:772

Signs one input of the invitation with this account's keys and appends a commit that holds its unlocking bytecode.

An unlocking script that needs values other entities hold, such as their signatures, is only signed once the invitation holds them. Use Engine.listInputResolutions to see what the input still needs, and Engine.appendOwnInputResolutions to add this account's part.

Parameters ​
ParameterTypeDescription
invitationIdentifierstringThe identifier of the invitation to sign. The invitation must already exist in the store.
inputIndexnumberIndex of the merged input to sign.
Returns ​

Promise<StoredInvitation>

  • The invitation as stored after the unlocking commit is appended.
Throws ​

InvitationNotFoundInStoreError - If the invitation is not found in the store.

Throws ​

MergedInputCommitNotFoundError - When the compiled input has no merged leaf to extend.

Throws ​

MergedInputOutpointMissingError - When the merged input has no outpoint.

Throws ​

InputUnspentOutputUnavailableError - When the spent output is not tracked by this account or is reserved by another invitation.

Throws ​

UnlockingScriptResolutionsMissingError - When the unlocking script needs values the invitation does not hold yet.

Throws ​

UnlockingCompilationContextMissingError - When the unlocking compilation carries no context to verify against.

Throws ​

UnlockingBytecodeVerificationFailedError - When the unlocking bytecode built with other entities' values fails.

Throws ​

MergedOutputLockingBytecodeMissingError - When an output has no locking bytecode and its template output defines no locking script.

Throws ​

MergedOutputLockingScriptVariablesMissingError - When an output locking script reads variables that no commit provides.

stop() ​

ts
stop(): Promise<void>;

Defined in: source/engine.ts:210

Stops the engine instance and cleans up resources.

Returns ​

Promise<void>

  • Resolves when the engine is stopped.

unarchiveInvitation() ​

ts
unarchiveInvitation(invitationIdentifier): Promise<void>;

Defined in: source/engine.ts:484

Restores one archived invitation in local storage.

Parameters ​
ParameterTypeDescription
invitationIdentifierstringIdentifier of the invitation to restore
Returns ​

Promise<void>

  • Resolves when restoration completes
Throws ​

InvitationNotFoundInStoreError - If the invitation is not in the store

unarchiveTemplate() ​

ts
unarchiveTemplate(templateIdentifier): Promise<void>;

Defined in: source/engine.ts:281

Restores one archived template in local storage.

Parameters ​
ParameterTypeDescription
templateIdentifierstringIdentifier of the template to restore
Returns ​

Promise<void>

  • Resolves when restoration completes
Throws ​

TemplateNotFoundInStoreError - If the template is not in the store

unsetDefaultPolicies() ​

ts
unsetDefaultPolicies(policiesToRemove): Promise<void>;

Defined in: source/engine.ts:351

Removes wallet default policies so change, receive, or address generation no longer uses them.

Each policy is removed independently. A policy not listed in policiesToRemove keeps its stored value. Removing a policy that is not stored changes nothing.

Parameters ​
ParameterTypeDescription
policiesToRemovekeyof WalletDefaultPolicies[]Policies to remove, each one of change, receive, or address.
Returns ​

Promise<void>

  • Resolves when the listed policies are no longer stored.

updateInvitation() ​

ts
updateInvitation(updatedInvitation): Promise<StoredInvitation>;

Defined in: source/engine.ts:585

Updates the stored invitation with a newer version received from an external participant or through some subscription. The updated invitation should have the shared history with the stored invitation, and the invitation must already be stored.

An output another participant added that locks to one of this account's scripts is stored and tracked like a script this account built, so its funds are seen and it can be unlocked later.

Parameters ​
ParameterTypeDescription
updatedInvitationXOInvitationShared invitation to store. The local entity identifier and archive fields keep their stored values.
Returns ​

Promise<StoredInvitation>

  • The updated invitation as stored, including the local entity identifier when present.
Throws ​

InvitationInvalidError - If the updated invitation does not match the XOInvitation type.

Throws ​

InvitationNotFoundInStoreError - If the invitation is not already in the store.

Throws ​

TemplateNotFoundInStoreError - If the template is not found.

Throws ​

InvitationValidationFailedError - If the updated invitation fails validation.

Throws ​

InvitationHistoryConflictError - If a stored commit is missing, reordered, or has a different identifier or signature at its expected position in the updated invitation.

Throws ​

InvitationItemFieldConflictError - If a commit changes a value an earlier commit set.

Throws ​

RoleVariableEntityMismatchError - If a commit provides a variable of a role its entity does not hold.

Throws ​

EntityMultipleRolesWithFollowUpUnsupportedError - If a commit gives an entity more than one role with a follow up.

create() ​

ts
static create(mnemonic, options): Promise<Engine>;

Defined in: source/engine.ts:157

Initializes and creates a new XO Engine instance. Opens storage, configures Electrum, and starts the blockchain monitor.

Parameters ​
ParameterTypeDescription
mnemonicstringBIP39 mnemonic to be used for this instance of the engine.
optionsXOEngineOptionsStorage, Electrum, network, and remote state settings for this instance.
Returns ​

Promise<Engine>

  • An initialized Engine instance.

InvitationBuilder ​

Defined in: source/invitation/participation/builder.ts:57

Builder for the XOInvitation

Constructors ​

Constructor ​

ts
new InvitationBuilder(params, network): InvitationBuilder;

Defined in: @xo-cash/engine/dist/index.d.mts:3284

Create a new InvitationBuilder.

Parameters ​
ParameterTypeDescription
paramsInvitationParametersContext for invitation creation.
networkXONetworkEngine network that selects xpub or tpub for entity identifiers.
Returns ​

InvitationBuilder

Properties ​

PropertyTypeDescriptionDefined in
actionIdentifierstringThe identifier of the action for the invitation.source/invitation/participation/builder.ts:71
invitationIdentifierstringThe identifier of the current invitation.source/invitation/participation/builder.ts:61
templateIdentifierstringThe identifier of the template for the invitation.source/invitation/participation/builder.ts:66

Methods ​

addCommit() ​

ts
addCommit(commit): this;

Defined in: source/invitation/participation/builder.ts:329

Add a commit to the invitation.

Parameters ​
ParameterTypeDescription
commitXOInvitationCommitThe commit to add.
Returns ​

this

  • The builder instance.

addTransactionBroadcastedResult() ​

ts
addTransactionBroadcastedResult(transactionIdentifier, transactionResult): this;

Defined in: source/invitation/participation/builder.ts:288

Records broadcast metadata on an existing invitation transaction result.

Parameters ​
ParameterTypeDescription
transactionIdentifierstringTemplate transaction identifier for the action.
transactionResultXOInvitationTransactionBroadcastDetailsBroadcast result fields to merge into the stored transaction result.
Returns ​

this

  • Builder instance for chaining.
Throws ​

TransactionResultNotFoundError - When no created transaction result exists for this identifier.

Throws ​

InvitationResultSignatureInvalidError - When the broadcast result signature does not verify.

Throws ​
  • When a present field fails Timestamp, ExtendedPublicKey, or SchnorrSignature construction.

addTransactionCreatedResult() ​

ts
addTransactionCreatedResult(transactionIdentifier, transactionResult): this;

Defined in: source/invitation/participation/builder.ts:239

Adds one transaction result to the invitation result.

Parameters ​
ParameterTypeDescription
transactionIdentifierstringTemplate transaction identifier for the action.
transactionResultInvitationTransactionCreatedResultInputTransaction result payload to store.
Returns ​

this

  • Builder instance for chaining.
Throws ​

TransactionResultAlreadyExistsError - When a result already exists for this transaction identifier.

Throws ​

InvitationResultSignatureInvalidError - When the created result signature does not verify.

Throws ​
  • When a present field fails TransactionHash, Timestamp, ExtendedPublicKey, or SchnorrSignature construction.

build() ​

ts
build(): XOInvitation;

Defined in: source/invitation/participation/builder.ts:150

Build the invitation object to be shared.

Returns ​

XOInvitation

  • The built invitation.

createUnsignedCommit() ​

ts
createUnsignedCommit(params): Omit<XOInvitationCommit, "signature" | "entityIdentifier">;

Defined in: source/invitation/participation/builder.ts:369

Creates an unsigned commit without adding it to the invitation. This allows for atomic commit creation with signature.

Parameters ​
ParameterTypeDescription
paramsUnsignedCommitParametersParameters for creating the commit.
Returns ​

Omit<XOInvitationCommit, "signature" | "entityIdentifier">

  • The unsigned commit without signature.

getLastCommit() ​

ts
getLastCommit(): XOInvitationCommit | undefined;

Defined in: source/invitation/participation/builder.ts:351

Returns the last commit in the invitation.

Returns ​

XOInvitationCommit | undefined

  • The last commit, or undefined if there are no commits.

getLastCommitIdentifier() ​

ts
getLastCommitIdentifier(): string | undefined;

Defined in: source/invitation/participation/builder.ts:343

Returns the commit identifier of the last commit in the invitation.

Returns ​

string | undefined

  • The last commit identifier, or undefined if there are no commits.

getResult() ​

ts
getResult(): XOInvitationResult | undefined;

Defined in: source/invitation/participation/builder.ts:184

Returns the current invitation result, if any.

Returns ​

XOInvitationResult | undefined

  • Invitation result or undefined when no result is attached.

removeTransactionResult() ​

ts
removeTransactionResult(transactionIdentifier): this;

Defined in: source/invitation/participation/builder.ts:194

Removes one transaction result from the invitation result.

Parameters ​
ParameterTypeDescription
transactionIdentifierstringTemplate transaction identifier to remove.
Returns ​

this

  • Builder instance for chaining.

setResult() ​

ts
setResult(result): this;

Defined in: source/invitation/participation/builder.ts:173

Replaces the entire invitation result.

Parameters ​
ParameterTypeDescription
resultXOInvitationResultResult to attach to the invitation.
Returns ​

this

  • Builder instance for chaining.

fromInvitation() ​

ts
static fromInvitation(invitation, network): InvitationBuilder;

Defined in: source/invitation/participation/builder.ts:124

Create a builder from an existing invitation.

Parameters ​
ParameterTypeDescription
invitationXOInvitationAn existing invitation.
networkXONetworkEngine network that selects xpub or tpub for entity identifiers.
Returns ​

InvitationBuilder

  • A builder initialized from the invitation.

BuiltInvitationTransaction ​

Defined in: source/invitation/interfaces.ts:136

Encoded transaction produced from a merged invitation, including serialized size.

Properties ​

PropertyTypeDescriptionDefined in
estimatedFeeSatoshisnumberMiner fee estimate in satoshis, which is feeEstimateInputCount times DEFAULT_FEE_SATOSHIS_PER_INPUT plus feeEstimateOutputCount times DEFAULT_FEE_SATOSHIS_PER_OUTPUT. Actual network fees may differ from this estimate.source/invitation/interfaces.ts:165
feeEstimateInputCountnumberInput count used for the fee estimate (merged inputs at preview time).source/invitation/interfaces.ts:153
feeEstimateOutputCountnumberOutput count used for the fee estimate (active outputs at preview time).source/invitation/interfaces.ts:158
serializedTransactionstringFull transaction serialized as hex (two hex digits per byte).source/invitation/interfaces.ts:139
serializedTransactionCharacterCountnumberNumber of characters in serializedTransaction (twice the byte length for valid hex).source/invitation/interfaces.ts:145
transactionByteLengthnumberLength of the serialized transaction in bytes.source/invitation/interfaces.ts:142
transactionHashstringTransaction id hash from the encoded bytes.source/invitation/interfaces.ts:148

ChangeAvailability ​

Defined in: source/invitation/interfaces.ts:332

Result of checking whether a change output can be appended to the merged invitation transaction.

Properties ​

PropertyTypeDescriptionDefined in
canAddBchChangebooleanTrue when a BCH change output is included in the current change plan.source/invitation/interfaces.ts:342
canAddChangebooleanTrue when at least one BCH or fungible token change output can be appended.source/invitation/interfaces.ts:337
canAddTokenChangebooleanTrue when at least one fungible token change output is included in the current change plan.source/invitation/interfaces.ts:347
changeAmountSatoshisbigintSatoshis for the BCH change output when canAddBchChange is true. Otherwise 0, except below_dust may still report a small nonzero surplus.source/invitation/interfaces.ts:353
estimatedMinFeeSatoshisbigintMinimum fee estimate for the current input and output counts before projecting a change output. Uses DEFAULT_FEE_SATOSHIS_PER_INPUT and DEFAULT_FEE_SATOSHIS_PER_OUTPUT.source/invitation/interfaces.ts:385
fungibleTokenChangeByCategoryFungibleTokenChangeSurplus[]Fungible token categories with positive surplus that would be returned as change.source/invitation/interfaces.ts:358
hasTemplateChangePolicybooleanTrue when template.defaults.change defines how the engine builds the change output.source/invitation/interfaces.ts:369
inputTotalSatoshisbigintSum of merged input satoshis used for the surplus check.source/invitation/interfaces.ts:374
outputTotalSatoshisbigintSum of merged output satoshis used for the surplus check.source/invitation/interfaces.ts:379
reason?ChangeUnavailableReasonSet when canAddChange is false. One of merged_commit_missing, insufficient_surplus, or below_dust.source/invitation/interfaces.ts:364

ExecuteActionParameters ​

Defined in: source/invitation/interfaces.ts:125

Parameters for executing an action.

Properties ​

PropertyTypeDescriptionDefined in
broadcastTransactionbooleanWhether to broadcast the transaction to the blockchain.source/invitation/interfaces.ts:130

ExecuteActionResult ​

Defined in: source/invitation/interfaces.ts:171

Result of executing an invitation action, including the persisted invitation state.

Properties ​

PropertyTypeDescriptionDefined in
builtTransactionBuiltInvitationTransactionEncoded transaction metadata produced from the merged invitation.source/invitation/interfaces.ts:174
storedInvitationStoredInvitationInvitation stored after transaction results are written.source/invitation/interfaces.ts:177

InvitationInputMissingSignature ​

Defined in: source/invitation/interfaces.ts:197

An input committed to the invitation that carries a real UTXO outpoint but no unlocking bytecode yet. This means the input has been reserved but not yet signed by its committing entity.

Properties ​

PropertyTypeDescriptionDefined in
entityIdentifierstring | undefinedIdentifier of the entity that committed this input, or undefined when the source commit has none.source/invitation/interfaces.ts:212
inputIdentifierstring | undefinedThe identifier assigned to this input, or undefined if no identifier was given.source/invitation/interfaces.ts:202
outpointIndexnumberOutput index of the reserved UTXO in its parent transaction.source/invitation/interfaces.ts:227
outpointTransactionHashstringParent transaction hash for the reserved UTXO, as lowercase hex.source/invitation/interfaces.ts:222
roleIdentifierstring | undefinedRole identifier this input belongs to, or undefined if it is not role-specific.source/invitation/interfaces.ts:217
sourceCommitIdentifierstringIdentifier of the commit that originally introduced this input to the invitation.source/invitation/interfaces.ts:207

InvitationMissingRequirements ​

Defined in: source/invitation/interfaces.ts:282

Combined result from listing missing requirements for an invitation. Covers both gaps at the template level (data not yet provided) and at the invitation level (data provided but not yet complete, such as unsigned inputs).

Properties ​

PropertyTypeDescriptionDefined in
inputsMissingSignaturesInvitationInputMissingSignature[]Inputs committed with a real UTXO outpoint that are still missing their unlocking bytecode.source/invitation/interfaces.ts:292
participantsInvitationMissingParticipant[]Roles that still need an entity to join the invitation with them.source/invitation/interfaces.ts:297
templateRequirementsInvitationRequirementIdentifierListsRequirements expected by the template that have not been provided in any commit yet.source/invitation/interfaces.ts:287

InvitationParameters ​

Defined in: source/invitation/interfaces.ts:40

Parameters required for creating a new XO invitation.

Properties ​

PropertyTypeDescriptionDefined in
actionIdentifierstringIdentifier of the action within the template to initiate.source/invitation/interfaces.ts:50
expiresAtTimestamp?numberOptional expiration timestamp.source/invitation/interfaces.ts:90
inputs?XOInvitationInput[]Optional array of inputs.source/invitation/interfaces.ts:65
locktime?numberOptional transaction locktime.source/invitation/interfaces.ts:60
outputs?XOInvitationOutput[]Optional array of outputs.source/invitation/interfaces.ts:70
resolutions?XOInvitationResolution[]Optional array of key operations resolved by the entity holding the key, such as a public key or a data signature.source/invitation/interfaces.ts:80
roleIdentifier?stringOptional role the committing entity takes with this commit.source/invitation/interfaces.ts:85
templateIdentifierstringIdentifier of the template to use for this invitation.source/invitation/interfaces.ts:45
variables?XOInvitationVariable[]Optional array of variables.source/invitation/interfaces.ts:75
version?numberOptional transaction version.source/invitation/interfaces.ts:55

ListSpendableUnspentOutputsParameters ​

Defined in: source/interfaces.ts:56

Parameters for finding spendable inputs.

Properties ​

PropertyTypeDescriptionDefined in
lockingScriptIdentifier?stringIdentifier of the locking script within the template.source/interfaces.ts:71
outputIdentifier?stringIdentifier of the output within the template.source/interfaces.ts:66
templateIdentifierstringIdentifier of the template to use for resource selection.source/interfaces.ts:61
tokenAmount?stringKeep only UTXOs whose fungible token amount equals this value.source/interfaces.ts:81
tokenCategory?stringKeep only UTXOs whose CashToken category equals this value.source/interfaces.ts:76
tokenNftCapability?XOTemplateNftCapabilityKeep only UTXOs whose NFT capability equals this value.source/interfaces.ts:86
tokenNftCommitment?stringKeep only UTXOs whose NFT commitment equals this value.source/interfaces.ts:91

WalletDefaultPolicies ​

Defined in: source/interfaces.ts:99

Default policies used when generating change, address and other locking bytecodes.

Resolution order for locking bytecode generation is manual override, then template defaults, then these default policies.


XOEngineOptions ​

Defined in: source/interfaces.ts:15

Configuration options for the XO Engine.

Properties ​

PropertyTypeDescriptionDefined in
databaseFilename?stringFilename of the database file.source/interfaces.ts:35
databasePath?stringDirectory path where the database will be stored.source/interfaces.ts:30
electrumApplicationIdentifier?stringThe Electrum application identifier to use.source/interfaces.ts:45
electrumServers?ElectrumServersWithBlockchainElectrum servers to connect to, each with the blockchain checkpoint and consensus parameters of the target network.source/interfaces.ts:40
network?XONetworkNetwork this engine instance targets.source/interfaces.ts:20
remoteEncryptedStateServers?string[]Remote encrypted state servers to use.source/interfaces.ts:50
storageType?StorageTypeThe storage type to use.source/interfaces.ts:25

AccountContext ​

ts
type AccountContext = object;

Defined in: source/invitation/interfaces.ts:31

Account pieces an invitation function may read. Each function requires the fields it uses.


AppendInvitationParameters ​

ts
type AppendInvitationParameters = Partial<InvitationParameters>;

Defined in: source/invitation/interfaces.ts:120

Parameters for appending to an existing invitation. All fields are optional.


ChangeSelection ​

ts
type ChangeSelection = object;

Defined in: source/invitation/interfaces.ts:308

Change outputs to add to an invitation, chosen from its leftover satoshis and fungible tokens.

Properties ​

includeSatoshiChange ​

ts
includeSatoshiChange: boolean;

Defined in: source/invitation/interfaces.ts:311

True to add a change output for the leftover satoshis.


ChangeUnavailableReason ​

ts
type ChangeUnavailableReason = "merged_commit_missing" | "insufficient_surplus" | "below_dust";

Defined in: source/invitation/interfaces.ts:303

Why a merged invitation transaction cannot accept a change output right now.


DefaultPolicyTemplate ​

ts
type DefaultPolicyTemplate = object;

Defined in: source/interfaces.ts:114

A stored template that can back a wallet default policy, with the identifier it is stored under.

Properties ​

template ​

ts
template: XOTemplate;

Defined in: source/interfaces.ts:124

Template whose defaults define the policy.

templateIdentifier ​

ts
templateIdentifier: XOTemplateIdentifier;

Defined in: source/interfaces.ts:119

Identifier to pass as the policy template identifier.


ElectrumConnection ​

ts
type ElectrumConnection = object;

Defined in: source/network/electrum.ts:47

One Electrum server the engine connects to and the state of that connection.

Properties ​

chainHeight? ​

ts
optional chainHeight?: number;

Defined in: source/network/electrum.ts:72

Chain height the server reports.

hostIdentifier ​

ts
hostIdentifier: string;

Defined in: source/network/electrum.ts:52

Host and port of the server, such as electrum.imaginary.cash:50004.

isEncrypted ​

ts
isEncrypted: boolean;

Defined in: source/network/electrum.ts:57

Whether the connection uses TLS.

software? ​

ts
optional software?: string;

Defined in: source/network/electrum.ts:67

Name and version of the server software.

status ​

ts
status: ElectrumConnectionStatus;

Defined in: source/network/electrum.ts:62

State of the connection.


ElectrumConnectionStatus ​

ts
type ElectrumConnectionStatus = ValueOf<typeof ELECTRUM_CONNECTION_STATUSES>;

Defined in: source/network/electrum.ts:30

State of one Electrum connection.


EntityRolesMultipleEntry ​

ts
type EntityRolesMultipleEntry = object;

Defined in: source/errors/invitation.ts:76

One entity that holds more than one role with a follow up in an invitation.

Properties ​

entityIdentifier ​

ts
entityIdentifier: XOInvitationEntityIdentifier;

Defined in: source/errors/invitation.ts:81

Entity that takes the roles.

roleIdentifiers ​

ts
roleIdentifiers: XOTemplateRoleIdentifier[];

Defined in: source/errors/invitation.ts:86

Every role with a follow up the entity holds, in the order its commits take them.


FungibleTokenChangeSurplus ​

ts
type FungibleTokenChangeSurplus = object;

Defined in: source/invitation/interfaces.ts:320

One fungible token category with surplus that can be returned as change.

Properties ​

tokenCategory ​

ts
tokenCategory: string;

Defined in: source/invitation/interfaces.ts:323

Normalized lowercase token category hex.


InvitationAcceptanceParameters ​

ts
type InvitationAcceptanceParameters = Omit<InvitationCreationParameters, "templateIdentifier" | "actionIdentifier">;

Defined in: source/invitation/interfaces.ts:115

Parameters for accepting an invitation. The template and action come from the invitation itself.


InvitationCommitHistoryComparison ​

ts
type InvitationCommitHistoryComparison = object;

Defined in: source/invitation/helpers/commits.ts:6

Comparison between the locally stored invitation and incoming shared invitation JSON.


InvitationCreationParameters ​

ts
type InvitationCreationParameters = InvitationParameters & object;

Defined in: source/invitation/interfaces.ts:96

Parameters for creating an invitation, including the role the creating entity takes in the action.

Type Declaration ​

NameTypeDescriptionDefined in
intent?XOTemplateActionIntentIntent this account acted on, such as a start entry, a follow up offered by a locking script, or a default. It must name the invitation's action. Its role is the role this account takes, and the keys in its generate list are generated as well as the ones the action role lists.source/invitation/interfaces.ts:109
roleIdentifier?XOTemplateRoleIdentifierRole this account takes in the action, when no intent names it. The keys the role lists in its generate list are generated for this account.source/invitation/interfaces.ts:102

InvitationInputSpentOutputFields ​

ts
type InvitationInputSpentOutputFields = object;

Defined in: source/invitation/merge/types.ts:20

Spent output value and token fields that may be recorded on an invitation input at runtime.

Kept in the engine package rather than on XOInvitationInput in @xo-cash/types.


InvitationInputWithSpentOutputFields ​

ts
type InvitationInputWithSpentOutputFields = XOInvitationInput & InvitationInputSpentOutputFields;

Defined in: source/invitation/merge/types.ts:28

Invitation input that may also carry spent output value and token metadata.


InvitationItemFieldConflict ​

ts
type InvitationItemFieldConflict = object;

Defined in: source/errors/invitation.ts:19

One field that a later commit tried to set after an earlier commit already committed a value for it.

Properties ​

earlierCommitIdentifier ​

ts
earlierCommitIdentifier: XOInvitationCommitIdentifier;

Defined in: source/errors/invitation.ts:39

Commit that set the field first.

fieldName ​

ts
fieldName: string;

Defined in: source/errors/invitation.ts:29

Name of the conflicting field.

fundingItemKey ​

ts
fundingItemKey: string;

Defined in: source/errors/invitation.ts:34

Commit identifier and position of the funding item that introduced the input or output.

itemType ​

ts
itemType: "input" | "output";

Defined in: source/errors/invitation.ts:24

Whether the conflicting field belongs to an input or an output.

laterCommitIdentifier ​

ts
laterCommitIdentifier: XOInvitationCommitIdentifier;

Defined in: source/errors/invitation.ts:44

Commit that tried to set the field again.


InvitationMissingParticipant ​

ts
type InvitationMissingParticipant = object;

Defined in: source/invitation/interfaces.ts:254

A role of the action that fewer entities have taken than the action requires.

Properties ​

filledSlots ​

ts
filledSlots: number;

Defined in: source/invitation/interfaces.ts:264

Number of entities that have taken the role so far.

maximumSlots ​

ts
maximumSlots: number | undefined;

Defined in: source/invitation/interfaces.ts:274

Maximum number of entities the role takes, or undefined when it takes any number.

minimumSlots ​

ts
minimumSlots: number;

Defined in: source/invitation/interfaces.ts:269

Minimum number of entities the action requires for the role.

roleIdentifier ​

ts
roleIdentifier: XOTemplateRoleIdentifier;

Defined in: source/invitation/interfaces.ts:259

Role that is waiting for an entity to join the invitation with it.


InvitationRequirementFieldName ​

ts
type InvitationRequirementFieldName = ValueOf<typeof INVITATION_REQUIREMENT_FIELD_NAMES>;

Defined in: source/defaults.ts:99

Union of requirement field name strings on an invitation requirements object.


InvitationRequirementIdentifierLists ​

ts
type InvitationRequirementIdentifierLists = InvitationRoleRequirementIdentifierLists & object;

Defined in: source/invitation/interfaces.ts:401

Identifier lists for invitation requirements. Template and invitation listing APIs compare by identifier strings, not full commit items.

Type Declaration ​

NameTypeDefined in
roles?Record<XOTemplateRoleIdentifier, InvitationRoleRequirementIdentifierLists>source/invitation/interfaces.ts:402

InvitationResolutionRequirements ​

ts
type InvitationResolutionRequirements = object;

Defined in: source/invitation/interfaces.ts:233

The key operations a script needs from participants, grouped by who still has to provide them.

Properties ​

missingIdentifiers ​

ts
missingIdentifiers: XOInvitationResolutionIdentifier[];

Defined in: source/invitation/interfaces.ts:248

Identifiers other participants have not provided yet.

ownResolutions ​

ts
ownResolutions: XOInvitationResolution[];

Defined in: source/invitation/interfaces.ts:243

Values resolved from this account's keys that the invitation does not hold yet.

providedIdentifiers ​

ts
providedIdentifiers: XOInvitationResolutionIdentifier[];

Defined in: source/invitation/interfaces.ts:238

Identifiers the invitation already holds a value for.


InvitationRoleRequirementIdentifierLists ​

ts
type InvitationRoleRequirementIdentifierLists = object;

Defined in: source/invitation/interfaces.ts:391

Identifier lists for a single role's invitation requirements.


InvitationTransactionBroadcastedResultInput ​

ts
type InvitationTransactionBroadcastedResultInput = XOInvitationTransactionBroadcastDetails;

Defined in: source/invitation/interfaces.ts:191

Fields accepted when recording that an invitation transaction was broadcast.


InvitationTransactionCreatedResultInput ​

ts
type InvitationTransactionCreatedResultInput = Pick<XOInvitationTransactionResult, 
  | "transactionHash"
  | "createdAtTimestamp"
  | "createdByEntityIdentifier"
  | "createdBySignature">;

Defined in: source/invitation/interfaces.ts:183

Fields accepted when recording that an invitation transaction was created.


MergedInvitation ​

ts
type MergedInvitation = object;

Defined in: source/invitation/merge/types.ts:45

The final resultant of merging invitation commits. Each input and output carries the identifier of the commit that last wrote it.


MergedInvitationChange ​

ts
type MergedInvitationChange = object;

Defined in: source/invitation/change/derive.ts:26

Leftover satoshi and fungible tokens.

Properties ​

tokens ​

ts
tokens: OutputToken[];

Defined in: source/invitation/change/derive.ts:36

Leftover fungible tokens.

valueSatoshis ​

ts
valueSatoshis: bigint;

Defined in: source/invitation/change/derive.ts:31

Leftover satoshis. This remainder is the fee until a change output takes part of it.


MergedInvitationInput ​

ts
type MergedInvitationInput = InvitationInputWithSpentOutputFields & object;

Defined in: source/invitation/merge/types.ts:34

A merged input enriched with the identifier of the commit that last wrote to it. When a later commit extends an earlier one via mergesWith, the extending commit's identifier is used.

Type Declaration ​

NameTypeDefined in
sourceCommitIdentifierXOInvitationCommitIdentifiersource/invitation/merge/types.ts:34

MergedInvitationOutput ​

ts
type MergedInvitationOutput = XOInvitationOutput & object;

Defined in: source/invitation/merge/types.ts:39

A merged output enriched with the identifier of the commit that last wrote to it.

Type Declaration ​

NameTypeDefined in
sourceCommitIdentifierXOInvitationCommitIdentifiersource/invitation/merge/types.ts:39

RoleVariableEntityMismatch ​

ts
type RoleVariableEntityMismatch = object;

Defined in: source/errors/invitation.ts:50

One variable a commit provides for roles its entity does not hold.

Properties ​

commitIdentifier ​

ts
commitIdentifier: XOInvitationCommitIdentifier;

Defined in: source/errors/invitation.ts:55

Commit that provides the variable.

entityIdentifier ​

ts
entityIdentifier: XOInvitationEntityIdentifier;

Defined in: source/errors/invitation.ts:60

Entity that made the commit.

roleIdentifiers ​

ts
roleIdentifiers: XOTemplateRoleIdentifier[];

Defined in: source/errors/invitation.ts:70

Roles the variable belongs to, each taken by other entities.

variableIdentifier ​

ts
variableIdentifier: XOTemplateVariableIdentifier;

Defined in: source/errors/invitation.ts:65

Variable the commit provides.


XONetwork ​

ts
type XONetwork = ValueOf<typeof XO_SUPPORTED_NETWORKS>;

Defined in: source/defaults.ts:122

One supported network.


appendOwnOutputResolutions ​

ts
const appendOwnOutputResolutions: (context, invitationIdentifier, outputIdentifier, roleIdentifier?) => Promise<StoredInvitation>;

Defined in: source/invitation/generation/locking-bytecode.ts:190

Adds the key operations this account resolved for an invitation output to the invitation, so other participants can compile the same locking script.

Only values the invitation does not hold yet are added, in one commit. Use listOutputResolutions first to check that there is something to add.

Parameters ​

ParameterTypeDescription
contextRequired<AccountContext>State, signing, and network for this account.
invitationIdentifierXOInvitationIdentifierInvitation the output belongs to.
outputIdentifierXOTemplateOutputIdentifierTemplate output whose locking script the values are for.
roleIdentifier?XOTemplateRoleIdentifierRole on the output, when one is set.

Returns ​

Promise<StoredInvitation>

  • The invitation as stored after the commit with the values.

Throws ​

OutputOwnResolutionsNotFoundError - If this account resolved nothing the invitation does not already hold.

Throws ​

InvitationNotFoundInStoreError - If the invitation is not found in the store.

Throws ​

TemplateOutputNotFoundError - If the template does not define the output.

Throws ​

TemplateLockingScriptRoleNotFoundError - If the role is not defined on the output's locking script.

Throws ​

LockingScriptSecretsNotFoundError - If the locking script uses secrets this account has not generated for the invitation.

Throws ​

LockingBytecodeGenerationFailedError - If the locking script fails to compile for a reason other than a missing identifier.

Throws ​

SecretDataNotFoundError - If a secret recorded for this invitation is not in the secret store.


applyInvitationTransactionResultToInvitation ​

ts
const applyInvitationTransactionResultToInvitation: (invitation, transactionIdentifier, transactionResult) => XOInvitation;

Defined in: source/invitation/helpers/transaction-result.ts:70

Attaches one transaction result to an invitation under result.transactions.

Parameters ​

ParameterTypeDescription
invitationXOInvitationInvitation to update.
transactionIdentifierXOTemplateTransactionIdentifierTemplate transaction identifier for the action.
transactionResultXOInvitationTransactionResultTransaction result to store.

Returns ​

XOInvitation

  • Invitation with the transaction result merged into result.

assertCommitsDoNotChangeCommittedFields ​

ts
const assertCommitsDoNotChangeCommittedFields: (invitation) => void;

Defined in: source/invitation/validation/committed-fields.ts:127

Checks that no commit changes a value an earlier commit already set on the same input or output.

The merge keeps the earliest value and ignores a changed one, so a changed value never takes effect. Rejecting it before the commit is stored surfaces the defect, and keeps an invitation free of commits whose values are ignored. A later commit may still fill an unset field or repeat a value that is already set.

Parameters ​

ParameterTypeDescription
invitationXOInvitationInvitation whose commits are checked in stored order, including the commit being added.

Returns ​

void

Throws ​

CommitIdentifierDuplicatedError - When a commit identifier appears more than once.

Throws ​

ParentCommitNotFoundError - When a commit names a previous commit that is not in the invitation.

Throws ​

CommitChainOrderInvalidError - When a commit does not name the commit stored before it.

Throws ​

MergesWithCommitNotFoundError - When a mergesWith reference names a missing commit.

Throws ​

MergesWithCommitNotEarlierError - When a mergesWith reference names the same commit or a later one.

Throws ​

CommitItemNotFoundError - When a mergesWith reference points at an item that does not exist.

Throws ​

InvitationItemFieldConflictError - When any commit changes a value an earlier commit set.


assertEntityFollowUpRoles ​

ts
const assertEntityFollowUpRoles: (invitation, template) => void;

Defined in: source/invitation/validation/follow-up-roles.ts:21

Checks that no entity in an invitation holds more than one role with a follow up.

Any role identifier in a commit means its entity joins as that role, whether the commit names the role in its data or tags a variable, input, output, or resolution with it. An entity may hold several roles, but at most one of them may have a follow up in the outputs the action produces, so every produced output has one role that decides what happens with it next.

Allowing a single account to hold more than one role with a follow up is not supported yet.

Parameters ​

ParameterTypeDescription
invitationXOInvitationInvitation whose commits are checked, including the commits being added.
templateXOTemplateTemplate that defines the invitation action and the locking scripts of its outputs.

Returns ​

void

Throws ​

TemplateActionNotFoundError - When the template does not define the invitation action.

Throws ​

EntityMultipleRolesWithFollowUpUnsupportedError - When an entity holds more than one role with a follow up.


assertRoleVariablesProvidedByRoleEntities ​

ts
const assertRoleVariablesProvidedByRoleEntities: (invitation, template) => void;

Defined in: source/invitation/validation/role-variables.ts:20

Checks that every variable of a role is provided by an entity holding that role.

A variable belongs to the role it is tagged with. An untagged variable belongs to every role whose requirements in the action list it. Roles are taken in commit order, and a role holds at most the maximum number of entities its slots allow, so an entity that tries to take a full role does not hold it. A commit may provide a variable of a role only when its entity holds one of the variable's roles. A variable that belongs to no role may be provided by anyone.

Parameters ​

ParameterTypeDescription
invitationXOInvitationInvitation whose commits are checked, including the commits being added.
templateXOTemplateTemplate that defines the invitation action, its roles, and their slots.

Returns ​

void

Throws ​

TemplateActionNotFoundError - When the template does not define the invitation action.

Throws ​

RoleVariableEntityMismatchError - When a commit provides a variable of a role its entity does not hold.


buildAccountDatabaseName ​

ts
const buildAccountDatabaseName: (mnemonic, network, databaseFilename?) => string;

Defined in: source/network/helper.ts:80

Builds the database name used for one mnemonic on one network.

Parameters ​

ParameterTypeDescription
mnemonicstringBIP39 mnemonic for the account.
networkXONetworkEngine network.
databaseFilename?stringOptional name that already replaces XO.

Returns ​

string

  • Full database name including account hash.

buildCompilerBytecodeDataFromCompilationVariables ​

ts
const buildCompilerBytecodeDataFromCompilationVariables: (template, compilationVariables) => Record<
  | XOTemplateVariableIdentifier
  | XOTemplateConstantIdentifier, Uint8Array>;

Defined in: source/compilation/template-locking-bytecode.ts:143

Builds the libauth data.bytecode map from invitation and template constant values.

Parameters ​

ParameterTypeDescription
templateXOTemplateImported template definition.
compilationVariablesRecord< | XOTemplateVariableIdentifier | XOTemplateConstantIdentifier, XOInvitationVariableValue>Map built by mergeTemplateConstantsWithInvitationVariables.

Returns ​

Record< | XOTemplateVariableIdentifier | XOTemplateConstantIdentifier, Uint8Array>

  • Bytecode map keyed by template variable identifiers.

buildElectrumCacheDatabaseFilename ​

ts
const buildElectrumCacheDatabaseFilename: (network, accountHash, databaseFilename?) => string;

Defined in: source/network/helper.ts:97

Builds the Electrum cache database filename for one account on one network.

The name always includes Electrum, so it never matches the account database name built from the same database filename.

Parameters ​

ParameterTypeDescription
networkXONetworkEngine network.
accountHashstringAccount hash for this mnemonic.
databaseFilename?stringOptional name included before Electrum.

Returns ​

string

  • Cache database filename.

buildInvitationTransactionFromMergedCommit ​

ts
const buildInvitationTransactionFromMergedCommit: (mergedCommit, template, actionIdentifier) => BuiltInvitationTransaction;

Defined in: source/invitation/generation/transaction.ts:122

Encodes the merged invitation commit as a transaction and returns hex plus size metadata.

Parameters ​

ParameterTypeDescription
mergedCommitMergedInvitationMerged inputs and outputs from the invitation.
templateXOTemplateTemplate that defines the action transaction shape.
actionIdentifierXOTemplateActionIdentifierAction used to validate that a transaction is defined.

Returns ​

BuiltInvitationTransaction

  • Serialized transaction hex, byte length, and hash.

Throws ​

TemplateActionTransactionNotFoundError - When the action has no transaction definition.

Throws ​

MergedOutputLockingBytecodeMissingError - When an output has no locking bytecode and its template output defines no locking script.

Throws ​

MergedOutputLockingScriptVariablesMissingError - When an output locking script reads variables that no commit provides.

Throws ​

TransactionGenerationFailedError - When libauth cannot build the transaction.


buildNetworkDatabaseFilename ​

ts
const buildNetworkDatabaseFilename: (network, databaseFilename?) => string;

Defined in: source/network/helper.ts:68

Builds the database filename for a network.

Every network appends the network name to the provided database filename, or to XO when none is provided.

Parameters ​

ParameterTypeDescription
networkXONetworkEngine network.
databaseFilename?stringOptional name included before the network name.

Returns ​

string

  • Database filename for the network.

combineResolutions ​

ts
const combineResolutions: (earlierResolutions, laterResolutions) => XOInvitationResolution[];

Defined in: source/resolutions/combine.ts:39

Combines two versions of one input's resolutions into one list.

Each entity extends the input with its own resolutions, so the later list adds the operations the earlier list does not resolve. An operation both lists resolve keeps the earlier value.

Parameters ​

ParameterTypeDescription
earlierResolutionsXOInvitationResolution[]Resolutions of the earlier version.
laterResolutionsXOInvitationResolution[]Resolutions of the later version.

Returns ​

XOInvitationResolution[]

  • Every operation either list resolves, earlier resolutions first.

compareInvitationCommitHistories ​

ts
const compareInvitationCommitHistories: (storedInvitation, incomingInvitation) => InvitationCommitHistoryComparison;

Defined in: source/invitation/helpers/commits.ts:22

Compares stored and incoming commit chains for shared prefix history and appended commits.

Parameters ​

ParameterTypeDescription
storedInvitationXOInvitationInvitation currently in local storage.
incomingInvitationXOInvitationInvitation from shared JSON or remote sync.

Returns ​

InvitationCommitHistoryComparison

  • Diff of the shared commit prefix and the commits that were appended.

compileLockingBytecodeFromTemplateLockingScriptIdentifier ​

ts
const compileLockingBytecodeFromTemplateLockingScriptIdentifier: (template, lockingScriptIdentifier, compilationVariables) => Uint8Array;

Defined in: source/compilation/template-locking-bytecode.ts:270

Compiles locking bytecode from a template locking script definition and invitation variable context.

Used when an output references a locking script by identifier rather than a CashAssembly expression on the output itself.

Parameters ​

ParameterTypeDescription
templateXOTemplateTemplate whose locking scripts are compiled.
lockingScriptIdentifierXOTemplateLockingScriptIdentifierLocking script identifier from the template output definition.
compilationVariablesRecord< | XOTemplateVariableIdentifier | XOTemplateConstantIdentifier, XOInvitationVariableValue>Variable map including template constants and commit variables.

Returns ​

Uint8Array

  • Compiled locking bytecode bytes for the merged output.

Throws ​

LockingScriptCompilationFailedError - When Libauth compilation of the locking script fails.


completeMergedInput ​

ts
const completeMergedInput: (input, template?, actionIdentifier?) => InvitationInputWithSpentOutputFields;

Defined in: source/invitation/merge/complete.ts:78

Completes one merged input with the values its commits left unset.

The transaction index comes from the template when the input fills a template input. Libauth reads the sequence number and the unlocking script length of every input, so a missing sequence number becomes DEFAULT_SEQUENCE_NUMBER, meaning no relative locktime, and a missing unlocking script becomes PLACEHOLDER_UNLOCKING_BYTECODE, so the transaction can be built before that signature exists.

Parameters ​

ParameterTypeDescription
inputInvitationInputWithSpentOutputFieldsMerged input.
template?XOTemplateTemplate used to resolve the transaction index from inputIndex.
actionIdentifier?stringInvitation action whose transaction definition supplies inputIndex.

Returns ​

InvitationInputWithSpentOutputFields

  • Input with the template transaction index and the defaults applied.

completeMergedOutput ​

ts
const completeMergedOutput: (output, outputIndex, variables, template, actionIdentifier) => XOInvitationOutput;

Defined in: source/invitation/merge/complete.ts:158

Completes one merged output with the values its commits left unset.

Outputs without an output identifier keep the fields already on the commit, and only their token is completed. When an identifier is present, the locking bytecode, value, token, and transaction index the commits left unset are taken from the template and the merged variables. When the template locking script reads a variable that no commit provides yet, the locking bytecode stays unset.

Parameters ​

ParameterTypeDescription
outputMergedInvitationOutputMerged output, including an output that only names a template slot.
outputIndexnumberPosition of the output in the merged output list.
variablesXOInvitationVariable[]Merged invitation variables used to evaluate CashAssembly.
templateXOTemplateTemplate that defines output locking scripts.
actionIdentifierstringInvitation action whose transaction definition supplies the output index.

Returns ​

XOInvitationOutput

  • Output with the template values and a complete token applied.

Throws ​

CommitTokenCategoryMissingError - When a token the commit supplies has no category.

Throws ​

CommitTokenNftCapabilityMissingError - When an NFT the commit supplies has no capability.


DEFAULT_ACCOUNT_DATABASE_FILENAME ​

ts
const DEFAULT_ACCOUNT_DATABASE_FILENAME: "XO" = "XO";

Defined in: source/defaults.ts:132

Base database name matching State when databaseFilename is omitted.


DEFAULT_COMMIT_EXPIRATION_IN_MILLISECONDS ​

ts
const DEFAULT_COMMIT_EXPIRATION_IN_MILLISECONDS: number;

Defined in: source/defaults.ts:12

When an entity opts to participate in an invitation, it reserves resources (e.g., UTXOs) that would otherwise be available to other invitations. To prevent resources from remaining locked indefinitely, each reservation requires an expiration time, after which the resources can be released.

By default, the expiration time is set to 5 hour.


DEFAULT_ELECTRUM_APPLICATION_IDENTIFIER ​

ts
const DEFAULT_ELECTRUM_APPLICATION_IDENTIFIER: "xo" = "xo";

Defined in: source/defaults.ts:54

The default electrum application identifier.


DEFAULT_ELECTRUM_CACHE_DATABASE_FILENAME ​

ts
const DEFAULT_ELECTRUM_CACHE_DATABASE_FILENAME: "Electrum" = "Electrum";

Defined in: source/defaults.ts:137

Name that sets the Electrum cache database apart from the account database.


DEFAULT_FEE_SATOSHIS_PER_INPUT ​

ts
const DEFAULT_FEE_SATOSHIS_PER_INPUT: 160 = 160;

Defined in: source/defaults.ts:69

Default value of per input fee to help in estimation of the transaction fee.


DEFAULT_FEE_SATOSHIS_PER_OUTPUT ​

ts
const DEFAULT_FEE_SATOSHIS_PER_OUTPUT: 120 = 120;

Defined in: source/defaults.ts:74

Default value of per output fee to help in estimation of the transaction fee.


DEFAULT_LOCKTIME ​

ts
const DEFAULT_LOCKTIME: 0 = 0;

Defined in: source/defaults.ts:27

The default locktime is 0, which means the transaction is valid in any block and has no absolute locktime constraint.


DEFAULT_SEQUENCE_NUMBER ​

ts
const DEFAULT_SEQUENCE_NUMBER: 0 = 0;

Defined in: source/defaults.ts:22

The default sequence number is 0, which disables relative locktime on the input.


DEFAULT_STORAGE_TYPE ​

ts
const DEFAULT_STORAGE_TYPE: INDEXEDDB = StorageType.INDEXEDDB;

Defined in: source/defaults.ts:17

The default storage backend is IndexedDB.


DEFAULT_VERSION ​

ts
const DEFAULT_VERSION: 2 = 2;

Defined in: source/defaults.ts:32

The default transaction version is 2.


DEFAULT_XO_NETWORK ​

ts
const DEFAULT_XO_NETWORK: XONetwork;

Defined in: source/defaults.ts:127

Network used when XOEngineOptions.network is omitted.


DUST_LIMIT_SATOSHIS ​

ts
const DUST_LIMIT_SATOSHIS: 546 = 546;

Defined in: source/defaults.ts:59

Minimum output value the engine treats as spendable change (BCH dust limit).


ELECTRUM_CONNECTION_STATUSES ​

ts
const ELECTRUM_CONNECTION_STATUSES: object;

Defined in: source/network/electrum.ts:18

Names of the states an Electrum connection can be in.

Type Declaration ​

NameTypeDefined in
connected"connected"@xo-cash/engine/dist/index.d.mts:503
connecting"connecting"@xo-cash/engine/dist/index.d.mts:505
disconnected"disconnected"source/network/electrum.ts:18
disconnecting"disconnecting"@xo-cash/engine/dist/index.d.mts:504
reconnecting"reconnecting"@xo-cash/engine/dist/index.d.mts:506
unrecoverable"unrecoverable"@xo-cash/engine/dist/index.d.mts:507

EMPTY_BYTECODE ​

ts
const EMPTY_BYTECODE: Uint8Array<ArrayBuffer>;

Defined in: source/defaults.ts:37

Empty bytecode used when a token category, NFT commitment, unlocking placeholder, or similar byte field has no value yet.


encodeMergedInvitationTransaction ​

ts
const encodeMergedInvitationTransaction: (mergedCommit, template, actionIdentifier) => Uint8Array;

Defined in: source/invitation/generation/transaction.ts:39

Encodes the merged invitation as a libauth transaction for size and hash measurement.

Parameters ​

ParameterTypeDescription
mergedCommitMergedInvitationMerged commit whose inputs and outputs are encoded.
templateXOTemplateTemplate that defines the action.
actionIdentifierXOTemplateActionIdentifierAction the transaction is built for, used to complete outputs without locking bytecode.

Returns ​

Uint8Array

  • Serialized transaction bytes.

Throws ​

TemplateActionNotFoundError - When the action is not on the template.

Throws ​

TemplateActionTransactionNotFoundError - When the action has no transaction definition.

Throws ​

MergedOutputLockingBytecodeMissingError - When an output has no locking bytecode and its template output defines no locking script.

Throws ​

MergedOutputLockingScriptVariablesMissingError - When an output locking script reads variables that no commit provides.

Throws ​

TransactionGenerationFailedError - When libauth cannot build the transaction.


executeAction ​

ts
const executeAction: (context, invitationIdentifier, params) => Promise<ExecuteActionResult>;

Defined in: source/invitation/participation/execute.ts:198

Executes an action for a given invitation.

Parameters ​

ParameterTypeDescription
contextRequired<AccountContext>State, signing, and network for this account.
invitationIdentifierXOInvitationIdentifierThe identifier of the invitation whose action to execute.
paramsExecuteActionParametersParameters for executing the action.

Returns ​

Promise<ExecuteActionResult>

  • Encoded transaction metadata and the persisted invitation.

Throws ​

InvitationNotFoundInStoreError - If the invitation is not found in the store.

Throws ​

TemplateNotFoundInStoreError - If the invitation's template is not found in the store.

Throws ​

TransactionResultAlreadyExistsError - If a different transaction was already recorded for the action.

Throws ​

TransactionBroadcastFailedError - If the network rejects the transaction.

Throws ​

TransactionResultNotFoundError - If the created result is missing when the broadcast is recorded.

Throws ​

MergedOutputLockingBytecodeMissingError - When an output has no locking bytecode and its template output defines no locking script.

Throws ​

MergedOutputLockingScriptVariablesMissingError - When an output locking script reads variables that no commit provides.


fetchDecodedTransactionOutput ​

ts
const fetchDecodedTransactionOutput: (transactionHash, outputIndex) => Promise<Output>;

Defined in: source/network/electrum.ts:83

Decodes one output from a transaction loaded through Electrum.

Parameters ​

ParameterTypeDescription
transactionHashTransactionHashParent transaction id in Electrum hex form.
outputIndexnumberOutput index in the decoded transaction.

Returns ​

Promise<Output>

  • Decoded libauth output.

Throws ​

TransactionOutputNotFoundError - When the output index is missing.


fetchScriptHashUnspentOutputs ​

ts
const fetchScriptHashUnspentOutputs: (scriptHash) => Promise<ScriptHashListUnspentResponse>;

Defined in: source/network/electrum.ts:158

Fetches unspent outputs for a script hash, including CashToken unspent outputs.

Parameters ​

ParameterTypeDescription
scriptHashstringScript hash to query.

Returns ​

Promise<ScriptHashListUnspentResponse>

  • Unspent outputs for the script hash.

fetchUnspentOutputsForLockingBytecode ​

ts
const fetchUnspentOutputsForLockingBytecode: (lockingBytecode, templateIdentifier) => Promise<UnspentOutputData[]>;

Defined in: source/network/electrum.ts:175

Fetches unspent outputs for a locking bytecode from Electrum.

Results are not stored. Tracking a locking script still goes through registration with a real template output identifier.

Parameters ​

ParameterTypeDescription
lockingBytecodestringLocking bytecode as hexadecimal.
templateIdentifierXOTemplateIdentifierTemplate that produced the locking bytecode.

Returns ​

Promise<UnspentOutputData[]>

  • Unspent outputs for the locking bytecode.

findEntityLockingScriptRole ​

ts
const findEntityLockingScriptRole: (invitation, template, entityIdentifier, lockingScriptIdentifier) => 
  | XOTemplateRoleIdentifier
  | undefined;

Defined in: source/invitation/helpers/roles.ts:171

Finds the role an entity holds in an invitation that a locking script declares.

An output added without a role is built for the role its entity already holds, when the output's locking script declares exactly one of the entity's roles. That role decides the keys the script is built with and the follow up stored for it.

Parameters ​

ParameterTypeDescription
invitationXOInvitationInvitation whose commits give the entity its roles.
templateXOTemplateTemplate that defines the invitation action and the locking script.
entityIdentifierXOInvitationEntityIdentifierEntity whose role is looked up.
lockingScriptIdentifierXOTemplateLockingScriptIdentifierLocking script whose declared roles are read.

Returns ​

| XOTemplateRoleIdentifier | undefined

  • The one role the entity holds that the locking script declares, or undefined when there is none or more than one.

Throws ​

TemplateActionNotFoundError - When the template does not define the invitation action.


findRootCommitIdentifierInInvitation ​

ts
const findRootCommitIdentifierInInvitation: (invitation, entityIdentifier) => 
  | XOInvitationCommitIdentifier
  | undefined;

Defined in: source/invitation/helpers/commits.ts:68

Finds the root commit identifier for a given entity in an invitation. The root commit is the first commit the entity added to the invitation.

Parameters ​

ParameterTypeDescription
invitationXOInvitationThe invitation whose commits are searched.
entityIdentifierXOInvitationEntityIdentifierThe entity identifier to search for among the invitation commits.

Returns ​

| XOInvitationCommitIdentifier | undefined

  • The root commit identifier if the entity has a commit in the invitation, otherwise undefined.

generateCommitIdentifier ​

ts
const generateCommitIdentifier: () => XOInvitationCommitIdentifier;

Defined in: source/invitation/helpers/identifiers.ts:27

Generates a random commit identifier from COMMIT_IDENTIFIER_BYTE_LENGTH random bytes.

Returns ​

XOInvitationCommitIdentifier

  • The generated commit identifier as a hex string.

Throws ​

CommitIdentifierAllZeroesError - If the random bytes are all zeroes.

Throws ​

CommitIdentifierMaximumError - If the random bytes are all 0xFF.

Throws ​

  • If generateRandomBytes rejects the environment cryptographically secure pseudo-random number generator.

generateInvitationIdentifier ​

ts
const generateInvitationIdentifier: () => XOInvitationIdentifier;

Defined in: source/invitation/helpers/identifiers.ts:13

Generates a random invitation identifier from INVITATION_IDENTIFIER_BYTE_LENGTH random bytes.

Returns ​

XOInvitationIdentifier

  • The generated invitation identifier as a hex string.

Throws ​

InvitationIdentifierAllZeroesError - If the random bytes are all zeroes.

Throws ​

InvitationIdentifierMaximumError - If the random bytes are all 0xFF.

Throws ​

  • If generateRandomBytes rejects the environment cryptographically secure pseudo-random number generator.

getInvitationTransactionHash ​

ts
const getInvitationTransactionHash: (invitation, transactionIdentifier) => 
  | XOInvitationTransactionHash
  | undefined;

Defined in: source/invitation/helpers/transaction-result.ts:23

Reads the persisted transaction hash for one template transaction.

Write paths construct TransactionHash before persist, so a stored hash is already valid.

Parameters ​

ParameterTypeDescription
invitationXOInvitationInvitation that may store the hash under result.transactions.
transactionIdentifierXOTemplateTransactionIdentifierTemplate transaction identifier for the action.

Returns ​

| XOInvitationTransactionHash | undefined

  • Transaction hash when present, otherwise undefined.

getTemplateActionOrThrow ​

ts
const getTemplateActionOrThrow: (template, actionIdentifier) => XOTemplateAction;

Defined in: source/template.ts:170

Returns an action definition by identifier.

Parameters ​

ParameterTypeDescription
templateXOTemplateTemplate whose actions are searched.
actionIdentifierXOTemplateActionIdentifierAction identifier to look up.

Returns ​

XOTemplateAction

  • Action definition for that identifier.

Throws ​

TemplateActionNotFoundError - When the action is absent from the template.


getTemplateActionTransactionIdentifierOrThrow ​

ts
const getTemplateActionTransactionIdentifierOrThrow: (template, actionIdentifier) => XOTemplateTransactionIdentifier;

Defined in: source/template.ts:191

Returns the transaction identifier an action names.

Parameters ​

ParameterTypeDescription
templateXOTemplateTemplate that defines the action.
actionIdentifierXOTemplateActionIdentifierAction whose transaction is read.

Returns ​

XOTemplateTransactionIdentifier

  • Transaction identifier the action names.

Throws ​

TemplateActionNotFoundError - When the action is absent from the template.

Throws ​

TemplateActionTransactionNotFoundError - When the action names no transaction.


getTemplateLockingScriptIdentifierOrThrow ​

ts
const getTemplateLockingScriptIdentifierOrThrow: (template, outputIdentifier) => XOTemplateLockingScriptIdentifier;

Defined in: source/template.ts:58

Returns the locking script identifier declared on an output.

Parameters ​

ParameterTypeDescription
templateXOTemplateTemplate whose outputs are searched.
outputIdentifierXOTemplateOutputIdentifierOutput whose locking script is read.

Returns ​

XOTemplateLockingScriptIdentifier

  • Locking script identifier on that output.

Throws ​

TemplateOutputNotFoundError - When the output is absent from the template.

Throws ​

TemplateOutputLockingScriptNotFoundError - When the output has no locking script reference.


getTemplateLockingScriptOrThrow ​

ts
const getTemplateLockingScriptOrThrow: (template, lockingScriptIdentifier) => XOTemplateLockingScript;

Defined in: source/template.ts:83

Returns a locking script definition by identifier.

Parameters ​

ParameterTypeDescription
templateXOTemplateTemplate whose locking scripts are searched.
lockingScriptIdentifierXOTemplateLockingScriptIdentifierLocking script identifier to look up.

Returns ​

XOTemplateLockingScript

  • Locking script definition for that identifier.

Throws ​

TemplateLockingScriptNotFoundError - When the locking script is absent from the template.

Throws ​

TemplateLockingScriptTypeNotFoundError - When the locking script omits lockingType.


getTemplateOutputOrThrow ​

ts
const getTemplateOutputOrThrow: (template, outputIdentifier) => XOTemplateOutput;

Defined in: source/template.ts:38

Returns an output definition by identifier.

Parameters ​

ParameterTypeDescription
templateXOTemplateTemplate whose outputs are searched.
outputIdentifierXOTemplateOutputIdentifierOutput identifier to look up.

Returns ​

XOTemplateOutput

  • Output definition for that identifier.

Throws ​

TemplateOutputNotFoundError - When the output is absent from the template.


getTemplateRoleOrThrow ​

ts
const getTemplateRoleOrThrow: (template, lockingScriptIdentifier, roleIdentifier) => XOTemplateLockingScriptRole;

Defined in: source/template.ts:112

Returns a role definition on a locking script.

Parameters ​

ParameterTypeDescription
templateXOTemplateTemplate whose locking scripts are searched.
lockingScriptIdentifierXOTemplateLockingScriptIdentifierLocking script that owns the role.
roleIdentifierXOTemplateRoleIdentifierRole identifier to look up.

Returns ​

XOTemplateLockingScriptRole

  • Role definition on that locking script.

Throws ​

TemplateLockingScriptNotFoundError - When the locking script is absent from the template.

Throws ​

TemplateLockingScriptRoleNotFoundError - When the role is absent from the locking script.


getTemplateTransactionOrThrow ​

ts
const getTemplateTransactionOrThrow: (template, transactionIdentifier) => XOTemplateTransaction;

Defined in: source/template.ts:237

Returns a transaction definition by identifier.

Parameters ​

ParameterTypeDescription
templateXOTemplateTemplate whose transactions are searched.
transactionIdentifierXOTemplateTransactionIdentifierTransaction identifier to look up.

Returns ​

XOTemplateTransaction

  • Transaction definition for that identifier.

Throws ​

TemplateTransactionNotFoundError - When the transaction is absent from the template.


INVITATION_REQUIREMENT_FIELD_NAME_LIST ​

ts
const INVITATION_REQUIREMENT_FIELD_NAME_LIST: readonly InvitationRequirementFieldName[];

Defined in: source/defaults.ts:104

Requirement field names in iteration order for template and commit requirement scans.


INVITATION_REQUIREMENT_FIELD_NAMES ​

ts
const INVITATION_REQUIREMENT_FIELD_NAMES: object;

Defined in: source/defaults.ts:90

Requirement field names on an invitation requirements object. Used to iterate over variables, inputs, and outputs in a consistent order.

Type Declaration ​

NameTypeDefined in
inputs"inputs"@xo-cash/engine/dist/index.d.mts:84
outputs"outputs"@xo-cash/engine/dist/index.d.mts:85
variables"variables"source/defaults.ts:90

isInvitationTransactionCreatedResultComplete ​

ts
const isInvitationTransactionCreatedResultComplete: (invitationIdentifier, transactionResult) => boolean;

Defined in: source/invitation/helpers/transaction-result.ts:38

Returns true when a stored transaction created result has a verifiable Schnorr signature.

Parameters ​

ParameterTypeDescription
invitationIdentifierXOInvitationIdentifierInvitation that owns the transaction result.
transactionResultXOInvitationTransactionResultTransaction result to inspect.

Returns ​

boolean

  • Whether the created result is complete enough to treat as persisted execution output.

isInvitationTransactionHashOnlyUpdate ​

ts
const isInvitationTransactionHashOnlyUpdate: (storedInvitation, incomingInvitation, template, invitationCommitHistoryComparison) => boolean;

Defined in: source/invitation/helpers/transaction-result.ts:96

Returns true when an update changes only the persisted transaction hash and leaves commit history unchanged.

Parameters ​

ParameterTypeDescription
storedInvitationXOInvitationInvitation currently in local storage.
incomingInvitationXOInvitationInvitation from shared JSON or remote sync.
templateXOTemplateTemplate that defines the action transaction key.
invitationCommitHistoryComparisonInvitationCommitHistoryComparisonCommit history diff from compareInvitationCommitHistories.

Returns ​

boolean

  • Whether validation can be skipped for a hash only write.

isLibauthKeyTemplateVariable ​

ts
const isLibauthKeyTemplateVariable: (variableIdentifier, templateSecretIdentifiers, variableDefinition?) => boolean;

Defined in: source/compilation/libauth-utils.ts:119

Returns whether a template variable should compile as a Libauth Key.

Prefers an explicit private_key type. Also treats locking script secrets as Key so older stored templates without a type still unlock with data.keys instead of WalletData bytecode.

Parameters ​

ParameterTypeDescription
variableIdentifierstringVariable or secret identifier.
templateSecretIdentifiersSet<string>Secrets from listTemplateSecretIdentifiers.
variableDefinition?XOTemplateVariableTemplate variable when present.

Returns ​

boolean

  • True when Libauth must resolve this identifier through private keys.

isUnlockingBytecodeMissingOrPlaceholder ​

ts
const isUnlockingBytecodeMissingOrPlaceholder: (unlockingBytecode) => boolean;

Defined in: source/invitation/merge/merge-commits.ts:120

Returns true when unlocking bytecode is absent or still the merge placeholder.

Parameters ​

ParameterTypeDescription
unlockingBytecodeMergedInvitationInput["unlockingBytecode"]Unlocking script on a merged input.

Returns ​

boolean

  • True when the input is not signed yet.

isXOSupportedNetwork ​

ts
const isXOSupportedNetwork: (value) => value is XONetwork;

Defined in: source/network/helper.ts:17

Returns true when the value is a supported network.

Parameters ​

ParameterTypeDescription
valuestringNetwork name to test.

Returns ​

value is XONetwork


listAvailableRolesForInvitation ​

ts
const listAvailableRolesForInvitation: (invitation, action) => XOTemplateRoleIdentifier[];

Defined in: source/invitation/requirements/roles.ts:55

Lists role identifiers for roles that still have capacity for additional participants. A role is considered available if the number of distinct entities that have filled it is less than the role's maximum slot count. If max is undefined, the role has unlimited capacity.

Parameters ​

ParameterTypeDescription
invitationXOInvitationThe invitation object to check for available roles.
actionXOTemplateActionThe template action being analyzed to determine which roles are expected.

Returns ​

XOTemplateRoleIdentifier[]

  • Role identifiers for roles that can still accept participants. Returns an empty array if no roles are defined in the action.

listCommitRoleIdentifiers ​

ts
const listCommitRoleIdentifiers: (commit) => Set<XOTemplateRoleIdentifier>;

Defined in: source/invitation/helpers/roles.ts:23

Lists the roles a commit takes for its entity.

A commit takes a role when it names the role in its data, or when it tags a variable, input, output, or resolution with the role. This is the same rule the slot count of a role uses.

Parameters ​

ParameterTypeDescription
commitXOInvitationCommitCommit whose roles are read.

Returns ​

Set<XOTemplateRoleIdentifier>

  • Every role the commit takes.

listCommitsForEntity ​

ts
const listCommitsForEntity: (invitation, entityIdentifier) => XOInvitationCommit[];

Defined in: source/invitation/helpers/commits.ts:91

Finds all commits in the invitation that were made by the specified entity. The returned array preserves the original commit order.

Parameters ​

ParameterTypeDescription
invitationXOInvitationThe invitation to examine.
entityIdentifierXOInvitationEntityIdentifierThe entity whose commits should be returned.

Returns ​

XOInvitationCommit[]

  • Commits that belong to the entity, in the order they appear in the invitation.

listElectrumConnections ​

ts
const listElectrumConnections: () => ElectrumConnection[];

Defined in: source/network/electrum.ts:203

Lists every Electrum server the engine connects to, with the state of each connection.

Returns ​

ElectrumConnection[]

  • One entry per Electrum client, empty before Electrum is initialized.

listFollowUpRoleIdentifiers ​

ts
const listFollowUpRoleIdentifiers: (template, actionIdentifier) => Set<XOTemplateRoleIdentifier>;

Defined in: source/invitation/helpers/roles.ts:132

Lists the roles that have a follow up in the outputs an action produces.

A locking script names, for each role it declares, what that role does with an output locked to it, such as the state it saves, the actions it can take next, and how the output counts toward its balance. A role has a follow up when the locking script of any output in the action's transaction declares it. An output whose locking script is a CashAssembly expression declares no roles.

Parameters ​

ParameterTypeDescription
templateXOTemplateTemplate that defines the action, its transaction, outputs, and locking scripts.
actionIdentifierXOTemplateActionIdentifierAction whose produced outputs are read.

Returns ​

Set<XOTemplateRoleIdentifier>

  • Roles declared by a locking script of the action's outputs.

Throws ​

TemplateActionNotFoundError - When the template does not define the action.


listInputsMissingSignatures ​

ts
const listInputsMissingSignatures: (invitation, template) => InvitationInputMissingSignature[];

Defined in: source/invitation/requirements/signatures.ts:18

Lists inputs that have a real UTXO outpoint committed to the invitation but no unlocking bytecode yet. These inputs have been reserved by their committing entity but have not been signed.

Detection uses the merged invitation state. An input is considered unsigned when its unlocking bytecode in the merged result is absent or is the placeholder (an empty Uint8Array). Attribution is taken directly from the sourceCommitIdentifier on each merged input.

Parameters ​

ParameterTypeDescription
invitationXOInvitationThe invitation to examine.
templateXOTemplateThe template for this invitation, required by the merger.

Returns ​

InvitationInputMissingSignature[]

  • Descriptors for each unsigned input, including which entity committed it.

listIntentRequiredVariableIdentifiers ​

ts
const listIntentRequiredVariableIdentifiers: (template, intent, lockingScriptIdentifier) => XOTemplateVariableIdentifier[];

Defined in: source/compilation/intent-variables.ts:144

Lists every variable a caller must provide to create a locking bytecode from an intent.

These are the variables the intent marks with a null value, plus any the target locking script needs that neither the template constants nor the intent presets supply.

Parameters ​

ParameterTypeDescription
templateXOTemplateTemplate that defines the intent target.
intentXOTemplateIntentIntent from the template defaults.
lockingScriptIdentifierXOTemplateLockingScriptIdentifierLocking script the intent generates.

Returns ​

XOTemplateVariableIdentifier[]

  • Required variable identifiers, intent variables first.

Throws ​

TemplateLockingScriptNotFoundError - When the locking script is not defined by the template.


listInvitationContentValidationIssues ​

ts
const listInvitationContentValidationIssues: (invitation, network) => Error[];

Defined in: source/invitation/validation/invitation.ts:397

Runs every invitation content validation and returns all discovered errors.

Parameters ​

ParameterTypeDescription
invitationXOInvitationThe built invitation object to validate.
networkXONetworkEngine network that selects xpub or tpub for entity identifiers.

Returns ​

Error[]

  • Every validation error found. An empty array means the invitation content is valid.

listInvitationResolutions ​

ts
const listInvitationResolutions: (commits) => Record<XOInvitationResolutionIdentifier, Uint8Array>;

Defined in: source/resolutions/combine.ts:12

Collects the resolutions every commit of an invitation provides in its commit data, keyed by the key operation.

These are the public keys and data signatures participants shared. When two commits resolve one operation, the earlier value is kept, the same way an earlier commit's input and output fields are kept.

Parameters ​

ParameterTypeDescription
commitsreadonly XOInvitationCommit[]Invitation commits in stored order.

Returns ​

Record<XOInvitationResolutionIdentifier, Uint8Array>

  • The resolved value of each key operation.

listInvitationScriptHashesToTrack ​

ts
const listInvitationScriptHashesToTrack: (context, storedInvitation) => Promise<ScriptHashData[]>;

Defined in: source/invitation/helpers/outputs.ts:114

Lists the outputs of an invitation that this account should start tracking.

Every participant adds outputs to an invitation in their own commits. An output another participant added can still pay to a locking script built with keys of this account. This account then has to track the script hash of that output, or it never learns about the unspent outputs the output receives and cannot spend them later. This function finds those outputs and returns their script hash data. trackInvitationScriptHashes saves and subscribes what it returns.

Every output in the data.outputs of every commit goes through the checks below, in this order. The output is returned only when it passes all of them, and the first check it fails skips it.

  1. The output names its template output and carries its locking bytecode. Both outputIdentifier and lockingBytecode are set on the commit output. Without both there is no script hash to track and no template locking script to compare with.
  2. The output belongs to the action of the invitation. The transaction of invitation.actionIdentifier names outputIdentifier, either in its own outputs or in the outputs of one of its roles, as isActionTransactionOutput checks. An output the action does not name passes only when this account added it itself, meaning commit.entityIdentifier equals this account entityIdentifier. An extra output another participant appended stays with that participant.
  3. The template output locks to a template locking script. template.outputs[outputIdentifier].lockingScript names one of the locking scripts of the template. When it is a CashAssembly expression instead, such as $(<someVariable>), the output is skipped, because that script is built from variables alone and is never locked to keys of this account.
  4. This account does not track the script hash yet. The script hash of lockingBytecode is not saved already, and an earlier commit output in this same call has not listed it, so each script hash is returned once. A script this account already tracks, such as one it built itself, is skipped.
  5. The template marks the output as relevant for the role that added it. isLockingOutputRelevantForRole reads the relevant flag for the roleIdentifier of the output, both on the template output and on the same role of the locking script. Only a boolean false in either place skips the output. A missing flag, or an output without roleIdentifier, passes.
  6. This account rebuilds exactly the same locking bytecode. compileLockingScript compiles the template locking script with the keys this account holds for the invitation and the values other participants published as resolutions, and the result must equal lockingBytecode. When the compile cannot finish yet, because a resolution is still missing (LockingScriptResolutionsMissingError) or the bytecode cannot be generated (LockingBytecodeGenerationFailedError), the output is skipped, and a later call checks it again. Any other compile error is thrown.

Parameters ​

ParameterTypeDescription
contextPick<Required<AccountContext>, "state" | "crypto">State for the invitation and crypto that compiles a locking script.
storedInvitationStoredInvitationInvitation whose outputs are checked.

Returns ​

Promise<ScriptHashData[]>

  • Script hash data of every output relevant to this account that is not stored yet.

Throws ​

TemplateNotFoundInStoreError - If the invitation template is not stored.

Throws ​

SecretDataNotFoundError - If a secret recorded for this invitation is not in the secret store.

Throws ​

InvitationResolutionIdentifierInvalidError - If a resolution is not an operation on a template key.

Throws ​

TemplateLockingScriptNotFoundError - If the output names a locking script that is not in the template.

Throws ​

TemplateLockingScriptBytecodeNotFoundError - If the locking script has no locking bytecode.

Throws ​

TemplateLockingScriptTypeNotFoundError - If the locking script has no locking type.

Throws ​

TemplateRoleRelevantCashAssemblyUnsupportedError - If relevant is a CashASM string.

Throws ​

TemplateActionNotFoundError - If the invitation action is not in the template.


listInvitationValidationIssues ​

ts
const listInvitationValidationIssues: (invitation, template, network) => Error[];

Defined in: source/invitation/validation/invitation.ts:417

Resolves the template action and collects every validation error for an invitation.

Parameters ​

ParameterTypeDescription
invitationXOInvitationThe invitation to validate.
templateXOTemplateThe template to validate against.
networkXONetworkEngine network that selects xpub or tpub for entity identifiers.

Returns ​

Error[]

  • Every validation error found. An empty array means the invitation content is valid.

listInvitationVariablesFromCommits ​

ts
const listInvitationVariablesFromCommits: (commits, additionalVariables?) => XOInvitationVariable[];

Defined in: source/compilation/template-locking-bytecode.ts:71

Collects invitation variables from stored commits and optional append parameters.

Parameters ​

ParameterTypeDescription
commitsreadonly XOInvitationCommit[]Invitation commits to read variables from.
additionalVariables?XOInvitationVariable[]Extra variables mixed with variables already on commits.

Returns ​

XOInvitationVariable[]

  • Flat list of variables in commit order.

listMissingParticipants ​

ts
const listMissingParticipants: (invitation, action) => InvitationMissingParticipant[];

Defined in: source/invitation/requirements/roles.ts:85

Lists the roles of an action that fewer entities have taken than the action requires.

Each role in the action's participants needs at least its minimum number of entities before the action can complete, so a role below its minimum is waiting for someone to join the invitation with it.

Parameters ​

ParameterTypeDescription
invitationXOInvitationThe invitation whose participants are counted.
actionXOTemplateActionThe template action that declares the participants.

Returns ​

InvitationMissingParticipant[]

  • Every role below its minimum, in the order the action lists them.

listOutputResolutions ​

ts
const listOutputResolutions: (context, invitationIdentifier, outputIdentifier, roleIdentifier?) => Promise<InvitationResolutionRequirements>;

Defined in: source/invitation/generation/locking-bytecode.ts:149

Lists the key operations an invitation output's locking script needs from participants, without adding anything.

The output compiles with the same variables, keys, and resolutions as when it is added. Each operation is reported as provided when the invitation holds it, as this account's own when only this account's keys resolve it, or as missing when another participant holds the key. An output whose locking script is a CashAssembly expression uses no keys.

Parameters ​

ParameterTypeDescription
contextPick<Required<AccountContext>, "state" | "crypto">State that stores the invitation and crypto that compiles with its keys.
invitationIdentifierXOInvitationIdentifierInvitation the output belongs to.
outputIdentifierXOTemplateOutputIdentifierTemplate output to check.
roleIdentifier?XOTemplateRoleIdentifierRole on the output, when one is set.

Returns ​

Promise<InvitationResolutionRequirements>

  • Provided identifiers, values this account can add, and identifiers others still owe.

Throws ​

InvitationNotFoundInStoreError - If the invitation is not found in the store.

Throws ​

TemplateOutputNotFoundError - If the template does not define the output.

Throws ​

TemplateLockingScriptRoleNotFoundError - If the role is not defined on the output's locking script.

Throws ​

LockingScriptSecretsNotFoundError - If the locking script uses secrets this account has not generated for the invitation.

Throws ​

LockingBytecodeGenerationFailedError - If the locking script fails to compile for a reason other than a missing identifier.

Throws ​

SecretDataNotFoundError - If a secret recorded for this invitation is not in the secret store.


listPopulatedRequirementsInInvitation ​

ts
const listPopulatedRequirementsInInvitation: (invitation) => InvitationRequirementIdentifierLists;

Defined in: source/invitation/requirements/template.ts:334

Lists all requirements that have been populated in the invitation by examining all commits. Extracts variable, input, and output identifiers from all commits in the invitation and organizes them into top-level and role-specific requirements.

Parameters ​

ParameterTypeDescription
invitationXOInvitationThe invitation object to analyze for populated requirements.

Returns ​

InvitationRequirementIdentifierLists

  • An object containing all populated requirements found in the invitation's commits, including top-level requirements and role-specific requirements. Only includes roles that have at least one requirement populated.

listRequirementIdentifiersAcrossRoles ​

ts
const listRequirementIdentifiersAcrossRoles: (requirements, requirementFieldName) => InvitationRequirementIdentifier[];

Defined in: source/invitation/requirements/template.ts:52

Unions requirement identifiers from the top level and every role for one field kind.

Template actions may list a requirement at the top level while commits store it under a role bucket. Missing requirement checks and unexpected requirement checks both need the same union so populated ids are recognized when they appear anywhere in the structure.

Parameters ​

ParameterTypeDescription
requirementsInvitationRequirementIdentifierListsRequirement lists from the template or from populated commits.
requirementFieldNameInvitationRequirementFieldNameWhich requirement list to union (variables, inputs, or outputs).

Returns ​

InvitationRequirementIdentifier[]

  • De duplicated identifiers from the top level list and every role list.

listRequirementsFromTemplate ​

ts
const listRequirementsFromTemplate: (template, action) => InvitationRequirementIdentifierLists;

Defined in: source/invitation/requirements/template.ts:144

Extracts and lists all requirements from the template and action for an invitation. Analyzes the template action to determine what variables, inputs, outputs, and role-specific requirements are needed to fulfill the action.

Parameters ​

ParameterTypeDescription
templateXOTemplateThe template.
actionXOTemplateActionThe action that has requirements.

Returns ​

InvitationRequirementIdentifierLists

  • An object containing all the requirements.

Todo ​

Support minimum and maximum role slots.


listRoleHolderEntities ​

ts
const listRoleHolderEntities: (invitation, template) => Record<XOTemplateRoleIdentifier, XOInvitationEntityIdentifier[]>;

Defined in: source/invitation/helpers/roles.ts:99

Lists the entities holding each role of an invitation's action.

Roles are taken in commit order, by naming the role in the commit data or by tagging an item with it, and a role holds at most the maximum number of entities its slots allow. This is who may provide each role's variables.

Parameters ​

ParameterTypeDescription
invitationXOInvitationInvitation whose commits take the roles.
templateXOTemplateTemplate that defines the invitation action and its slots.

Returns ​

Record<XOTemplateRoleIdentifier, XOInvitationEntityIdentifier[]>

  • Entities holding each taken role, in the order they took it.

Throws ​

TemplateActionNotFoundError - When the template does not define the invitation action.


listTemplateActionIntents ​

ts
const listTemplateActionIntents: (template) => XOTemplateActionIntent[];

Defined in: source/template.ts:215

Lists one action intent for every action the template defines.

Each intent names only its action. It carries no role, constants, variables, or generate list.

Parameters ​

ParameterTypeDescription
templateXOTemplateTemplate whose actions are listed.

Returns ​

XOTemplateActionIntent[]

  • One intent per action identifier, in the order the template declares them.

listTemplateSecretIdentifiers ​

ts
const listTemplateSecretIdentifiers: (template) => Set<string>;

Defined in: source/compilation/libauth-utils.ts:88

Collects every secret identifier declared on locking scripts and their roles.

Template variable type is optional. Secrets listed under locking script state still identify Key material for Libauth even when private_key was never stored on the variable.

Parameters ​

ParameterTypeDescription
templateXOTemplateTemplate whose locking script secrets are read.

Returns ​

Set<string>

  • Deduplicated secret identifiers from locking script state.

listTemplateSecrets ​

ts
const listTemplateSecrets: (template, lockingScriptIdentifier, roleIdentifier?) => string[];

Defined in: source/template.ts:142

Returns secret identifiers tracked for a locking script or one of its roles.

Parameters ​

ParameterTypeDescription
templateXOTemplateTemplate whose locking scripts are searched.
lockingScriptIdentifierXOTemplateLockingScriptIdentifierLocking script whose secrets are read.
roleIdentifier?XOTemplateRoleIdentifierRole whose secrets are used when provided.

Returns ​

string[]

  • Secret identifiers from the role or from the locking script.

Throws ​

TemplateLockingScriptNotFoundError - When the locking script is absent from the template.

Throws ​

TemplateLockingScriptRoleNotFoundError - When a role is provided but is absent.


listUnfilledRequirements ​

ts
const listUnfilledRequirements: (invitation, template, action) => InvitationRequirementIdentifierLists;

Defined in: source/invitation/requirements/template.ts:397

Lists all missing requirements for the invitation that have not yet been supplied. Compares the requirements expected from the template with what has been populated in the invitation to determine what is still needed.

The missing requirements are the template requirements that the invitation has not populated.

Parameters ​

ParameterTypeDescription
invitationXOInvitationThe invitation object to check for missing requirements.
templateXOTemplateThe template defining what requirements are expected.
actionXOTemplateActionThe template action being analyzed to determine required requirements.

Returns ​

InvitationRequirementIdentifierLists

  • An object containing all missing requirements, including top-level missing requirements and role-specific missing requirements. Only includes roles that have at least one missing requirement.

listVariableIdentifiersToGenerate ​

ts
const listVariableIdentifiersToGenerate: (template, actionIdentifier, roleIdentifier?, intentGenerate?) => XOTemplateVariableIdentifier[];

Defined in: source/template.ts:271

Lists the variables to generate for an entity that takes part in an action.

Combines the generate list of an intent with the generate list of the action role. A variable in both, or listed twice, is one variable. The action role's list comes from the template, so an intent can add variables but never drop one the action needs.

Every variable is checked, and all variables that are not declared as private keys are reported together as private_key type is the only supported type.

Parameters ​

ParameterTypeDescription
templateXOTemplateTemplate that defines the action and declares the variables.
actionIdentifierXOTemplateActionIdentifierAction the entity takes part in.
roleIdentifier?XOTemplateRoleIdentifierRole the entity takes, when it takes one.
intentGenerate?XOTemplateVariableIdentifier[]Generate list of an intent, when one is given.

Returns ​

XOTemplateVariableIdentifier[]

  • Variables to generate, each listed once, empty when nothing is asked for.

Throws ​

TemplateActionNotFoundError - When the template does not define the action.

Throws ​

TemplateActionRoleNotFoundError - When the action does not define the role.

Throws ​

TemplateGeneratedVariableTypeUnsupportedError - When a listed variable is not declared as a private key.


mergeInvitationCommits ​

ts
const mergeInvitationCommits: (invitation, template) => MergedInvitation;

Defined in: source/invitation/merge/merge-commits.ts:275

Merges invitation commits and transforms it into MergedInvitation structure.

Parameters ​

ParameterTypeDescription
invitationXOInvitationThe invitation containing commits to merge.
templateXOTemplateThe template used for resolving output identifiers.

Returns ​

MergedInvitation

  • Merged invitation structure.

Throws ​

CommitIdentifierDuplicatedError - When a commit identifier appears more than once.

Throws ​

ParentCommitNotFoundError - When a commit names a previous commit that is not in the invitation.

Throws ​

CommitChainOrderInvalidError - When a commit does not name the commit stored before it.

Throws ​

InvitationVariableIdentifierInvalidError - When any variable identifier contains a dot.

Throws ​

TransactionVersionDuplicatedError - When more than one commit sets the transaction version.

Throws ​

TransactionLocktimeDuplicatedError - When more than one commit sets the transaction locktime.

Throws ​

MergesWithCommitNotFoundError - When a mergesWith reference names a missing commit.

Throws ​

MergesWithCommitNotEarlierError - When a mergesWith reference names the same commit or a later one.

Throws ​

CommitItemNotFoundError - When a mergesWith reference points at an item that does not exist.

Throws ​

TransactionIndexDuplicatedError - When two merged inputs or two merged outputs claim the same transactionIndex.

Todo ​

Handle different variables with the same identifier according to the minimum and maximum the template sets.


mergeInvitationTransactionHashOnlyUpdate ​

ts
const mergeInvitationTransactionHashOnlyUpdate: (storedInvitation, incomingInvitation, template) => XOInvitation;

Defined in: source/invitation/helpers/transaction-result.ts:142

Merges an incoming hash only update into the stored invitation result while preserving other result metadata.

A hash is written only onto an existing created result. Incomplete entity or signature placeholders are never synthesized.

Parameters ​

ParameterTypeDescription
storedInvitationXOInvitationShared invitation currently in local storage.
incomingInvitationXOInvitationShared invitation carrying the new hash.
templateXOTemplateTemplate that defines the action transaction key.

Returns ​

XOInvitation

  • Shared invitation ready for persistence with the updated transaction hash.

Throws ​

  • When the incoming hash fails TransactionHash construction.

mergeTemplateConstantsWithInvitationVariables ​

ts
const mergeTemplateConstantsWithInvitationVariables: (template, invitationVariables) => Record<
  | XOTemplateVariableIdentifier
  | XOTemplateConstantIdentifier, XOInvitationVariableValue>;

Defined in: source/compilation/template-locking-bytecode.ts:34

Builds the variable map used to evaluate template CashAssembly and compile locking bytecode.

Template constant defaults are applied first. Invitation commit variables overwrite constants when identifiers collide. A constant whose value is not a string, number, bigint, or boolean is left out of the map.

Parameters ​

ParameterTypeDescription
templateXOTemplateImported template definition.
invitationVariablesXOInvitationVariable[]Variables collected from invitation commits.

Returns ​

Record< | XOTemplateVariableIdentifier | XOTemplateConstantIdentifier, XOInvitationVariableValue>

  • Map from identifier to value for compilation.

PLACEHOLDER_UNLOCKING_BYTECODE ​

ts
const PLACEHOLDER_UNLOCKING_BYTECODE: Uint8Array<ArrayBuffer>;

Defined in: source/defaults.ts:49

An empty unlocking bytecode used as a placeholder for inputs (unlockingBytecode) within an invitation. This placeholder is used when the entities responsible for signing those inputs have not yet provided their signatures for the resulting transaction.

Using a placeholder unlocking bytecode enables the engine to construct transaction structures for the libauth compiler when working on template actions, even before all participant signatures are available. This is especially helpful when invitation commits are merged, as it allows the transaction to be built and it's parts can be validated before all unlocking scripts have been provided.


readIntentVariableRequirements ​

ts
const readIntentVariableRequirements: (intent) => IntentVariableRequirements;

Defined in: source/compilation/intent-variables.ts:44

Reads the variables an intent declares.

An intent lists variables as single entry objects. A null value marks a variable the caller must provide when something is created from the intent. Any other value is a preset used as is.

Parameters ​

ParameterTypeDescription
intentXOTemplateIntentIntent from the template defaults.

Returns ​

IntentVariableRequirements

  • Preset values and the identifiers the caller must provide.

resolveElectrumServersForNetwork ​

ts
const resolveElectrumServersForNetwork: (network) => ElectrumServersWithBlockchain;

Defined in: source/network/helper.ts:46

Resolves default Electrum hosts for a network.

Each host carries the blockchain checkpoint and consensus parameters of that network.

Parameters ​

ParameterTypeDescription
networkXONetworkEngine network.

Returns ​

ElectrumServersWithBlockchain

  • Server list for that network.

resolveHdKeyNetwork ​

ts
const resolveHdKeyNetwork: (network) => HdKeyNetwork;

Defined in: source/network/helper.ts:29

Maps an engine network to the libauth HD key network used for the purpose path and xpub or tpub encoding.

Libauth HdKeyNetwork is only mainnet or testnet. Chipnet and testnet4 are not members of that type, so both use testnet.

Parameters ​

ParameterTypeDescription
networkXONetworkEngine network.

Returns ​

HdKeyNetwork

  • Mainnet encoding, or testnet encoding for chipnet and testnet4.

resolveInvitationOutputLockingBytecode ​

ts
const resolveInvitationOutputLockingBytecode: (context, invitationIdentifier, outputIdentifier, roleIdentifier?) => Promise<string>;

Defined in: source/invitation/generation/locking-bytecode.ts:103

Resolves the locking bytecode an invitation output compiles to, without generating or storing anything.

The locking script compiles with the template constants, the invitation variables, and the keys this account already generated for the invitation, which is what appending the output uses. It is the keyed counterpart of resolving a template output from variables alone. The script's secrets are existing secrets and are never generated for it, so a secret the invitation does not hold fails the resolution the same way adding the output would.

Parameters ​

ParameterTypeDescription
contextPick<Required<AccountContext>, "state" | "crypto">State that stores the invitation and crypto that compiles with its keys.
invitationIdentifierXOInvitationIdentifierInvitation the output belongs to.
outputIdentifierXOTemplateOutputIdentifierTemplate output to resolve.
roleIdentifier?XOTemplateRoleIdentifierRole on the output, when one is set.

Returns ​

Promise<string>

  • The locking bytecode as a hexadecimal string.

Throws ​

InvitationNotFoundInStoreError - If the invitation is not found in the store.

Throws ​

TemplateOutputNotFoundError - If the template does not define the output.

Throws ​

TemplateLockingScriptRoleNotFoundError - If the role is not defined on the output's locking script.

Throws ​

LockingScriptSecretsNotFoundError - If the locking script uses secrets this account has not generated for the invitation.

Throws ​

LockingScriptResolutionsMissingError - If the script uses key operations other participants have not resolved yet.

Throws ​

LockingBytecodeGenerationFailedError - If the locking bytecode cannot be compiled.

Throws ​

SecretDataNotFoundError - If a secret recorded for this invitation is not in the secret store.

Throws ​

CashAssemblyCompilationFailedError - If the output locking script is a CashAssembly expression that cannot be compiled.

Throws ​

LockingScriptCompilationFailedError - If the template locking script the output names cannot be compiled.


resolveMergedItemMergeTarget ​

ts
const resolveMergedItemMergeTarget: (invitation, mergedCommit, itemType, mergedItemIndex) => 
  | XOInvitationMergesWithReference
  | undefined;

Defined in: source/invitation/merge/merge-targets.ts:132

Resolves the mergesWith target for one merged input or output.

Parameters ​

ParameterTypeDescription
invitationXOInvitationInvitation that contains source commits.
mergedCommitMergedInvitationFull merged transaction.
itemType"input" | "output"Whether the item is a merged input or a merged output.
mergedItemIndexnumberPosition in mergedCommit.inputs or mergedCommit.outputs.

Returns ​

| XOInvitationMergesWithReference | undefined

  • Merge target for the merged item, or undefined when the item cannot be matched.

resolveTemplateOutputLockingBytecode ​

ts
const resolveTemplateOutputLockingBytecode: (template, outputIdentifier, invitationVariables) => Uint8Array;

Defined in: source/compilation/template-locking-bytecode.ts:313

Resolves locking bytecode for a template output from invitation variables and template constants.

Parameters ​

ParameterTypeDescription
templateXOTemplateTemplate for the invitation.
outputIdentifierXOTemplateOutputIdentifierTemplate output identifier.
invitationVariablesXOInvitationVariable[]Variables from merged commits and the current append.

Returns ​

Uint8Array

  • Locking bytecode bytes for the output.

Throws ​

TemplateOutputNotFoundError - When the output is absent from the template.

Throws ​

TemplateOutputLockingScriptNotFoundError - When the template output has no locking script reference.

Throws ​

CashAssemblyCompilationFailedError - When a CashAssembly expression fails to compile.

Throws ​

LockingScriptCompilationFailedError - When the template locking script fails to compile.

Throws ​

TemplateLockingScriptTypeNotFoundError - When the locking script definition is incomplete.

Throws ​

TemplateOutputLockingScriptReferenceInvalidError - When a locking script or script the output references is not in the template.


resolveTemplateTransactionItemIndex ​

ts
const resolveTemplateTransactionItemIndex: (template, actionIdentifier, itemType, itemIdentifier) => number | undefined;

Defined in: source/resolutions/transaction-index.ts:52

Resolves the transaction index declared for one template input or output slot on the active action transaction.

Parameters ​

ParameterTypeDescription
templateXOTemplateImported template for the invitation.
actionIdentifierXOTemplateActionIdentifierAction on the invitation.
itemType"input" | "output"Whether the slot is an input or an output.
itemIdentifier| XOTemplateInputIdentifier | XOTemplateOutputIdentifierTemplate input or output slot being provided.

Returns ​

number | undefined

  • Input or output index from the transaction definition when present.

TOKEN_BEARING_OUTPUT_MINIMUM_SATOSHIS ​

ts
const TOKEN_BEARING_OUTPUT_MINIMUM_SATOSHIS: 800 = 800;

Defined in: source/defaults.ts:64

Minimum satoshis on a CashToken bearing output so the token remains standard and spendable.


UNDEFINED_TRANSACTION_INDEX_SORT_VALUE ​

ts
const UNDEFINED_TRANSACTION_INDEX_SORT_VALUE: number;

Defined in: source/defaults.ts:84

Sort key used when a merged input or output has no transactionIndex so unordered items follow indexed items.


updateInvitation ​

ts
const updateInvitation: (context, receivedInvitation) => Promise<StoredInvitation>;

Defined in: source/invitation/participation/update.ts:33

Updates the stored invitation with a newer version received from an external participant or through some subscription. The updated invitation should have the shared history with the stored invitation.

An output another participant added that locks to one of this account's scripts is stored and tracked like a script this account built, so its funds are seen and it can be unlocked later.

Parameters ​

ParameterTypeDescription
contextRequired<AccountContext>State, signing, and network for this account.
receivedInvitationXOInvitationShared invitation to store. The local entity identifier and archive fields keep their stored values.

Returns ​

Promise<StoredInvitation>

  • The updated invitation as stored, including the local entity identifier when present.

Throws ​

InvitationNotFoundInStoreError - If the invitation is not already in the store.

Throws ​

TemplateNotFoundInStoreError - If the template is not found.

Throws ​

InvitationInvalidError - If the updated invitation does not match the XOInvitation type.

Throws ​

InvitationValidationFailedError - If the updated invitation fails validation.

Throws ​

InvitationHistoryConflictError - If a stored commit is missing, reordered, or differs at its expected position.

Throws ​

InvitationItemFieldConflictError - If a commit changes a value an earlier commit set.

Throws ​

RoleVariableEntityMismatchError - If a commit provides a variable of a role its entity does not hold.

Throws ​

EntityMultipleRolesWithFollowUpUnsupportedError - If a commit gives an entity more than one role with a follow up.


validateInvitation ​

ts
const validateInvitation: (invitation, template, network) => void;

Defined in: source/invitation/validation/invitation.ts:451

Validates an invitation against a template and throws when any check fails.

Parameters ​

ParameterTypeDescription
invitationXOInvitationThe invitation to validate.
templateXOTemplateThe template to validate against.
networkXONetworkEngine network that selects xpub or tpub for entity identifiers.

Returns ​

void

Throws ​

InvitationValidationFailedError - If one or more validation checks fail.


XO_SUPPORTED_NETWORKS ​

ts
const XO_SUPPORTED_NETWORKS: object;

Defined in: source/defaults.ts:113

Supported networks by the engine.

Type Declaration ​

NameTypeDefined in
chipnet"chipnet"@xo-cash/engine/dist/index.d.mts:100
mainnet"mainnet"source/defaults.ts:113
testnet4"testnet4"@xo-cash/engine/dist/index.d.mts:101

ZERO_FUNGIBLE_TOKEN_AMOUNT ​

ts
const ZERO_FUNGIBLE_TOKEN_AMOUNT: 0n = 0n;

Defined in: source/defaults.ts:79

Zero fungible token amount used when a token bearing output has no amount yet.


ChainStatus ​

Defined in: @electrum-cash/application/dist/index.d.mts:369

Emitted when additional block headers have been verified to be a part of the current longest chain.

Properties ​

PropertyTypeDescriptionDefined in
currentHeightnumbernumber of blocks that have been reported to be part of the block chain.source/invitation/interfaces.ts:269
verifiedHeightnumbernumber of blocks that have been verified to be part of the block chain.@electrum-cash/application/dist/index.d.mts:373
verifiedPercentstringpercentage of blocks that have been verified to be included in the chain.source/invitation/interfaces.ts:274

AppendInvitationParametersEmptyError ​

Defined in: source/errors/invitation.ts:148

Thrown when append invitation parameters omit every appendable field.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new AppendInvitationParametersEmptyError(): AppendInvitationParametersEmptyError;

Defined in: source/errors/invitation.ts:148

Returns ​

AppendInvitationParametersEmptyError

Overrides ​
ts
Error.constructor

CashAssemblyVariableNotIntegerError ​

Defined in: source/errors/compilation.ts:20

Thrown when a number variable value is not a valid integer for CashAssembly compilation.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new CashAssemblyVariableNotIntegerError(variableName, value): CashAssemblyVariableNotIntegerError;

Defined in: @xo-cash/engine/dist/index.d.mts:2583

Parameters ​
ParameterType
variableNamestring
valuenumber
Returns ​

CashAssemblyVariableNotIntegerError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
valuereadonlynumberNumeric value that was not an integer.source/errors/compilation.ts:29
variableNamereadonlystringVariable name whose value was rejected.source/errors/compilation.ts:24

ChangeLockingBytecodeMissingError ​

Defined in: source/errors/invitation.ts:1058

Thrown when change is added to an invitation but no locking bytecode was provided, the template defines no change policy, and the wallet has no default change policy.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new ChangeLockingBytecodeMissingError(invitationIdentifier, templateIdentifier): ChangeLockingBytecodeMissingError;

Defined in: @xo-cash/engine/dist/index.d.mts:2371

Parameters ​
ParameterType
invitationIdentifierstring
templateIdentifierstring
Returns ​

ChangeLockingBytecodeMissingError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
invitationIdentifierreadonlystringInvitation the change was added to.source/errors/invitation.ts:1062
templateIdentifierreadonlystringTemplate of the invitation, which defines no change policy.source/errors/invitation.ts:1067

ChangeSatoshisBelowDustError ​

Defined in: source/errors/invitation.ts:1378

Thrown when the satoshi change is selected alone and the satoshis left after the fee and the token change outputs are below the dust limit, so no change output can hold them.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new ChangeSatoshisBelowDustError(
   invitationIdentifier, 
   satoshiChange, 
   dustLimitSatoshis): ChangeSatoshisBelowDustError;

Defined in: @xo-cash/engine/dist/index.d.mts:2565

Parameters ​
ParameterType
invitationIdentifierstring
satoshiChangebigint
dustLimitSatoshisbigint
Returns ​

ChangeSatoshisBelowDustError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
dustLimitSatoshisreadonlybigintSmallest amount an output may hold, in satoshis.source/errors/invitation.ts:1392
invitationIdentifierreadonlystringInvitation the change was added to.source/errors/invitation.ts:1382
satoshiChangereadonlybigintSatoshis left for the satoshi change output.source/errors/invitation.ts:1387

ChangeSatoshisInsufficientError ​

Defined in: source/errors/invitation.ts:1086

Thrown when change is added to an invitation with leftover fungible tokens, but the leftover satoshis cannot pay for the token change outputs and the estimated fee.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new ChangeSatoshisInsufficientError(
   invitationIdentifier, 
   requiredSatoshis, 
   availableSatoshis): ChangeSatoshisInsufficientError;

Defined in: @xo-cash/engine/dist/index.d.mts:2392

Parameters ​
ParameterType
invitationIdentifierstring
requiredSatoshisbigint
availableSatoshisbigint
Returns ​

ChangeSatoshisInsufficientError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
availableSatoshisreadonlybigintSatoshis the inputs hold beyond the outputs.source/errors/invitation.ts:1100
invitationIdentifierreadonlystringInvitation the change was added to.source/errors/invitation.ts:1090
requiredSatoshisreadonlybigintSatoshis the token change outputs and the estimated fee need.source/errors/invitation.ts:1095

ChangeSelectionEmptyError ​

Defined in: source/errors/invitation.ts:1331

Thrown when change is added to an invitation with a selection that names neither the satoshi change nor any token category.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new ChangeSelectionEmptyError(invitationIdentifier): ChangeSelectionEmptyError;

Defined in: @xo-cash/engine/dist/index.d.mts:2528

Parameters ​
ParameterType
invitationIdentifierstring
Returns ​

ChangeSelectionEmptyError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
invitationIdentifierreadonlystringInvitation the change was added to.source/errors/invitation.ts:1335

ChangeTokenCategoriesUnavailableError ​

Defined in: source/errors/invitation.ts:1350

Thrown when change is added to an invitation with token categories that have no leftover fungible tokens.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new ChangeTokenCategoriesUnavailableError(invitationIdentifier, tokenCategories): ChangeTokenCategoriesUnavailableError;

Defined in: @xo-cash/engine/dist/index.d.mts:2544

Parameters ​
ParameterType
invitationIdentifierstring
tokenCategoriesstring[]
Returns ​

ChangeTokenCategoriesUnavailableError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
invitationIdentifierreadonlystringInvitation the change was added to.source/errors/invitation.ts:1354
tokenCategoriesreadonlystring[]Selected token categories without leftover fungible tokens, as hex.source/errors/invitation.ts:1359

CommitChainOrderInvalidError ​

Defined in: source/errors/invitation.ts:717

Thrown when a commit does not name the commit stored immediately before it as its previous commit.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new CommitChainOrderInvalidError(
   commitIdentifier, 
   expectedPreviousCommitIdentifier?, 
   receivedPreviousCommitIdentifier?): CommitChainOrderInvalidError;

Defined in: @xo-cash/engine/dist/index.d.mts:2178

Parameters ​
ParameterType
commitIdentifierstring
expectedPreviousCommitIdentifier?string
receivedPreviousCommitIdentifier?string
Returns ​

CommitChainOrderInvalidError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
commitIdentifierreadonlystringCommit whose previous commit identifier breaks the chain.source/errors/invitation.ts:721
expectedPreviousCommitIdentifierreadonlystring | undefinedIdentifier of the commit stored immediately before it, or undefined for the first commit.source/errors/invitation.ts:726
receivedPreviousCommitIdentifierreadonlystring | undefinedPrevious commit identifier the commit actually carries.source/errors/invitation.ts:731

CommitIdentifierDuplicatedError ​

Defined in: source/errors/invitation.ts:698

Thrown when the same commit identifier appears more than once in an invitation.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new CommitIdentifierDuplicatedError(commitIdentifiers): CommitIdentifierDuplicatedError;

Defined in: @xo-cash/engine/dist/index.d.mts:2158

Parameters ​
ParameterType
commitIdentifiersstring[]
Returns ​

CommitIdentifierDuplicatedError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
commitIdentifiersreadonlystring[]Commit identifiers that appear more than once.source/errors/invitation.ts:702

CommitItemNotFoundError ​

Defined in: source/errors/invitation.ts:483

Thrown when an input or output at a given index is absent from a commit.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new CommitItemNotFoundError(
   itemType, 
   itemIndex, 
   commitIdentifier): CommitItemNotFoundError;

Defined in: @xo-cash/engine/dist/index.d.mts:2042

Parameters ​
ParameterType
itemType"input" | "output"
itemIndexnumber
commitIdentifierstring
Returns ​

CommitItemNotFoundError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
commitIdentifierreadonlystringCommit that was searched.source/errors/invitation.ts:497
itemIndexreadonlynumberIndex that was looked up in the commit.source/errors/invitation.ts:492
itemTypereadonly"input" | "output"Whether the missing item is an input or an output.source/errors/invitation.ts:487

CommitSignatureInvalidError ​

Defined in: source/errors/invitation.ts:215

Collected during invitation validation when a commit signature does not verify or verification throws.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new CommitSignatureInvalidError(commitIdentifier, cause?): CommitSignatureInvalidError;

Defined in: @xo-cash/engine/dist/index.d.mts:1888

Parameters ​
ParameterType
commitIdentifierstring
cause?Error
Returns ​

CommitSignatureInvalidError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionOverridesDefined in
cause?readonlyErrorError thrown by signature verification, when verification threw.Error.causesource/errors/invitation.ts:224
commitIdentifierreadonlystringIdentifier of the commit whose signature failed.-source/errors/invitation.ts:219

CommitTokenCategoryMissingError ​

Defined in: source/errors/invitation.ts:1281

Thrown when a token a commit supplies on an output has no category.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new CommitTokenCategoryMissingError(commitIdentifier, outputIndex): CommitTokenCategoryMissingError;

Defined in: @xo-cash/engine/dist/index.d.mts:2500

Parameters ​
ParameterType
commitIdentifierstring
outputIndexnumber
Returns ​

CommitTokenCategoryMissingError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
commitIdentifierreadonlystringCommit that last wrote the output.source/errors/invitation.ts:1285
outputIndexreadonlynumberPosition of the output in the merged output list.source/errors/invitation.ts:1290

CommitTokenNftCapabilityMissingError ​

Defined in: source/errors/invitation.ts:1306

Thrown when an NFT a commit supplies on an output has no capability.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new CommitTokenNftCapabilityMissingError(commitIdentifier, outputIndex): CommitTokenNftCapabilityMissingError;

Defined in: @xo-cash/engine/dist/index.d.mts:2516

Parameters ​
ParameterType
commitIdentifierstring
outputIndexnumber
Returns ​

CommitTokenNftCapabilityMissingError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
commitIdentifierreadonlystringCommit that last wrote the output.source/errors/invitation.ts:1310
outputIndexreadonlynumberPosition of the output in the merged output list.source/errors/invitation.ts:1315

DataResultSignatureInvalidError ​

Defined in: source/errors/invitation.ts:321

Collected during invitation validation when a data result signature does not verify or verification throws.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new DataResultSignatureInvalidError(dataIdentifier, cause?): DataResultSignatureInvalidError;

Defined in: @xo-cash/engine/dist/index.d.mts:1948

Parameters ​
ParameterType
dataIdentifierstring
cause?Error
Returns ​

DataResultSignatureInvalidError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionOverridesDefined in
cause?readonlyErrorError thrown by signature verification, when verification threw.Error.causesource/errors/invitation.ts:330
dataIdentifierreadonlystringTemplate data identifier of the result whose signature failed.-source/errors/invitation.ts:325

DefaultPolicyNotSetError ​

Defined in: source/errors/wallet.ts:10

Thrown when a wallet default policy is used before it has been set.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new DefaultPolicyNotSetError(policy): DefaultPolicyNotSetError;

Defined in: @xo-cash/engine/dist/index.d.mts:2956

Parameters ​
ParameterType
policykeyof WalletDefaultPolicies
Returns ​

DefaultPolicyNotSetError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
policyreadonlykeyof WalletDefaultPoliciesDefault policy that was looked up.source/errors/wallet.ts:14

EntityMultipleRolesWithFollowUpUnsupportedError ​

Defined in: source/errors/invitation.ts:943

Thrown when an entity holds more than one role with a follow up action.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new EntityMultipleRolesWithFollowUpUnsupportedError(entities): EntityMultipleRolesWithFollowUpUnsupportedError;

Defined in: @xo-cash/engine/dist/index.d.mts:2302

Parameters ​
ParameterType
entitiesEntityRolesMultipleEntry[]
Returns ​

EntityMultipleRolesWithFollowUpUnsupportedError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
entitiesreadonlyEntityRolesMultipleEntry[]Every entity that holds more than one role with a follow up, with those roles.source/errors/invitation.ts:947

InputOwnResolutionsNotFoundError ​

Defined in: source/errors/compilation.ts:432

Thrown when this account is asked to add its own resolutions for an input, but it resolved none that the invitation does not already hold.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new InputOwnResolutionsNotFoundError(invitationIdentifier, inputIndex): InputOwnResolutionsNotFoundError;

Defined in: @xo-cash/engine/dist/index.d.mts:2810

Parameters ​
ParameterType
invitationIdentifierstring
inputIndexnumber
Returns ​

InputOwnResolutionsNotFoundError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
inputIndexreadonlynumberMerged input the resolutions were asked for.source/errors/compilation.ts:441
invitationIdentifierreadonlystringInvitation the input belongs to.source/errors/compilation.ts:436

InputUnspentOutputUnavailableError ​

Defined in: source/errors/invitation.ts:605

Thrown when the output a merged input spends is not tracked by this account, or is reserved by another invitation.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new InputUnspentOutputUnavailableError(
   invitationIdentifier, 
   inputIndex, 
   outpointTransactionHash, 
   outpointIndex, 
   reservedBy?): InputUnspentOutputUnavailableError;

Defined in: @xo-cash/engine/dist/index.d.mts:2126

Parameters ​
ParameterType
invitationIdentifierstring
inputIndexnumber
outpointTransactionHashstring
outpointIndexnumber
reservedBy?string
Returns ​

InputUnspentOutputUnavailableError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
inputIndexreadonlynumberPosition of the input in the merged input list.source/errors/invitation.ts:614
invitationIdentifierreadonlystringInvitation that owns the input.source/errors/invitation.ts:609
outpointIndexreadonlynumberIndex of the spent output in that transaction.source/errors/invitation.ts:624
outpointTransactionHashreadonlystringHash of the transaction that holds the spent output, as hexadecimal.source/errors/invitation.ts:619
reservedByreadonlystring | undefinedInvitation that reserves the output, undefined when this account does not track the output.source/errors/invitation.ts:629

IntentVariablesMissingError ​

Defined in: source/errors/compilation.ts:492

Thrown when variables an intent requires are missing from the provided values.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new IntentVariablesMissingError(
   templateIdentifier, 
   lockingScriptIdentifier, 
   variableIdentifiers): IntentVariablesMissingError;

Defined in: @xo-cash/engine/dist/index.d.mts:2850

Parameters ​
ParameterType
templateIdentifierstring
lockingScriptIdentifierstring
variableIdentifiersstring[]
Returns ​

IntentVariablesMissingError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
lockingScriptIdentifierreadonlystringLocking script the intent generates.source/errors/compilation.ts:501
templateIdentifierreadonlystringTemplate that defines the intent.source/errors/compilation.ts:496
variableIdentifiersreadonlystring[]Variables the intent requires that have no provided value.source/errors/compilation.ts:506

InvitationFieldInvalidError ​

Defined in: source/errors/invitation.ts:191

Collected during invitation validation when an invitation field does not construct a valid primitive.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new InvitationFieldInvalidError(path, cause): InvitationFieldInvalidError;

Defined in: @xo-cash/engine/dist/index.d.mts:1872

Parameters ​
ParameterType
pathreadonly (string | number)[]
causeError
Returns ​

InvitationFieldInvalidError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionOverridesDefined in
causereadonlyErrorError thrown by the primitive that rejected the field value.Error.causesource/errors/invitation.ts:200
pathreadonlyreadonly (string | number)[]Location of the field inside the invitation, as object keys and array indexes.-source/errors/invitation.ts:195

InvitationHistoryConflictError ​

Defined in: source/errors/invitation.ts:121

Thrown when an updated invitation diverges from the commit history already stored locally.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new InvitationHistoryConflictError(invitationIdentifier, commitIdentifier): InvitationHistoryConflictError;

Defined in: @xo-cash/engine/dist/index.d.mts:1831

Parameters ​
ParameterType
invitationIdentifierstring
commitIdentifierstring
Returns ​

InvitationHistoryConflictError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
commitIdentifierreadonlystringStored commit at which the histories diverged.source/errors/invitation.ts:130
invitationIdentifierreadonlystringInvitation whose stored and updated histories diverge.source/errors/invitation.ts:125

InvitationIntentMismatchError ​

Defined in: source/errors/invitation.ts:835

Thrown when an intent passed with an invitation names a different template or action than the invitation.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new InvitationIntentMismatchError(
   field, 
   invitationValue, 
   intentValue): InvitationIntentMismatchError;

Defined in: @xo-cash/engine/dist/index.d.mts:2248

Parameters ​
ParameterType
field"templateIdentifier" | "action"
invitationValuestring
intentValuestring
Returns ​

InvitationIntentMismatchError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
fieldreadonly"templateIdentifier" | "action"Intent field that does not match the invitation.source/errors/invitation.ts:839
intentValuereadonlystringValue the intent has for the field.source/errors/invitation.ts:849
invitationValuereadonlystringValue the invitation has for the field.source/errors/invitation.ts:844

InvitationItemFieldConflictError ​

Defined in: source/errors/invitation.ts:810

Thrown when a later commit sets an input or output field that an earlier commit already set, even to the same value.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new InvitationItemFieldConflictError(conflicts): InvitationItemFieldConflictError;

Defined in: @xo-cash/engine/dist/index.d.mts:2228

Parameters ​
ParameterType
conflictsInvitationItemFieldConflict[]
Returns ​

InvitationItemFieldConflictError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
conflictsreadonlyInvitationItemFieldConflict[]Every conflicting field with the commits involved.source/errors/invitation.ts:814

InvitationResolutionIdentifierInvalidError ​

Defined in: source/errors/invitation.ts:894

Thrown when a resolution names something other than an operation on a template key, since only key operations can be resolved by the participant holding the key.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new InvitationResolutionIdentifierInvalidError(resolutionIdentifiers): InvitationResolutionIdentifierInvalidError;

Defined in: @xo-cash/engine/dist/index.d.mts:2277

Parameters ​
ParameterType
resolutionIdentifiersstring[]
Returns ​

InvitationResolutionIdentifierInvalidError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
resolutionIdentifiersreadonlystring[]Identifiers that are not operations on a template key.source/errors/invitation.ts:898

InvitationResultSignatureInvalidError ​

Defined in: source/errors/invitation.ts:661

Thrown when an invitation result signature fails verification.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new InvitationResultSignatureInvalidError(
   invitationIdentifier, 
   resultKind, 
   resultIdentifier): InvitationResultSignatureInvalidError;

Defined in: @xo-cash/engine/dist/index.d.mts:2146

Parameters ​
ParameterType
invitationIdentifierstring
resultKind"data" | "transaction_created" | "transaction_broadcasted"
resultIdentifierstring
Returns ​

InvitationResultSignatureInvalidError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
invitationIdentifierreadonlystringInvitation whose result signature failed.source/errors/invitation.ts:665
resultIdentifierreadonlystringResult identifier whose signature failed.source/errors/invitation.ts:675
resultKindreadonly"data" | "transaction_created" | "transaction_broadcasted"Kind of invitation result that was verified.source/errors/invitation.ts:670

InvitationRoleDuplicatedError ​

Defined in: source/errors/invitation.ts:866

Thrown when the role an entity takes is given both directly and on the intent.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new InvitationRoleDuplicatedError(roleIdentifier, intentRoleIdentifier): InvitationRoleDuplicatedError;

Defined in: @xo-cash/engine/dist/index.d.mts:2264

Parameters ​
ParameterType
roleIdentifierstring
intentRoleIdentifierstring
Returns ​

InvitationRoleDuplicatedError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
intentRoleIdentifierreadonlystringRole given on the intent.source/errors/invitation.ts:875
roleIdentifierreadonlystringRole given directly.source/errors/invitation.ts:870

InvitationRoleUnavailableError ​

Defined in: source/errors/invitation.ts:970

Thrown when an entity tries to join an invitation with a role that has no free slot left.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new InvitationRoleUnavailableError(
   invitationIdentifier, 
   roleIdentifier, 
   availableRoleIdentifiers): InvitationRoleUnavailableError;

Defined in: @xo-cash/engine/dist/index.d.mts:2322

Parameters ​
ParameterType
invitationIdentifierstring
roleIdentifierstring
availableRoleIdentifiersstring[]
Returns ​

InvitationRoleUnavailableError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
availableRoleIdentifiersreadonlystring[]Roles that still have a free slot.source/errors/invitation.ts:984
invitationIdentifierreadonlystringInvitation the entity tries to join.source/errors/invitation.ts:974
roleIdentifierreadonlystringRole that has no free slot.source/errors/invitation.ts:979

InvitationTemplateMismatchError ​

Defined in: source/errors/invitation.ts:553

Thrown when a provided template identifier does not match the invitation template identifier.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new InvitationTemplateMismatchError(expectedTemplateIdentifier, receivedTemplateIdentifier): InvitationTemplateMismatchError;

Defined in: @xo-cash/engine/dist/index.d.mts:2082

Parameters ​
ParameterType
expectedTemplateIdentifierstring
receivedTemplateIdentifierstring
Returns ​

InvitationTemplateMismatchError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
expectedTemplateIdentifierreadonlystringTemplate identifier stored on the invitation.source/errors/invitation.ts:557
receivedTemplateIdentifierreadonlystringTemplate identifier that was supplied for validation.source/errors/invitation.ts:562

InvitationValidationFailedError ​

Defined in: source/errors/invitation.ts:163

Thrown when one or more invitation validation checks fail. Holds one error for each failed check, in the order the checks ran.

Extends ​

  • AggregateError

Constructors ​

Constructor ​

ts
new InvitationValidationFailedError(invitationIdentifier, errors): InvitationValidationFailedError;

Defined in: @xo-cash/engine/dist/index.d.mts:1856

Parameters ​
ParameterType
invitationIdentifierstring
errorsError[]
Returns ​

InvitationValidationFailedError

Overrides ​
ts
AggregateError.constructor

Properties ​

PropertyModifierTypeDescriptionOverridesDefined in
errorsreadonlyError[]Validation errors collected before the throw.AggregateError.errorssource/errors/invitation.ts:172
invitationIdentifierreadonlystringInvitation that failed validation.-source/errors/invitation.ts:167

InvitationVariableIdentifierInvalidError ​

Defined in: source/errors/invitation.ts:785

Thrown when invitation commits carry variable identifiers that contain a dot.

The compiler reads a dotted identifier as an operation on a variable, such as someKey.public_key, and looks that identifier up in the same bytecode map as variable values. A dotted variable would replace the value that operation derives from a key.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new InvitationVariableIdentifierInvalidError(invalidVariables): InvitationVariableIdentifierInvalidError;

Defined in: @xo-cash/engine/dist/index.d.mts:2213

Parameters ​
ParameterType
invalidVariablesobject[]
Returns ​

InvitationVariableIdentifierInvalidError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
invalidVariablesreadonlyobject[]Each invalid variable identifier with the commit that supplied it.source/errors/invitation.ts:789

LockingBytecodeGenerationFailedError ​

Defined in: source/errors/compilation.ts:82

Thrown when a locking script stops compiling before it produces bytecode.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new LockingBytecodeGenerationFailedError(
   templateIdentifier, 
   lockingScriptIdentifier, 
   incompleteCompilation): LockingBytecodeGenerationFailedError;

Defined in: @xo-cash/engine/dist/index.d.mts:2631

Parameters ​
ParameterType
templateIdentifierstring
lockingScriptIdentifierstring
incompleteCompilationIncompleteScriptCompilation
Returns ​

LockingBytecodeGenerationFailedError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
compilationErrorsreadonlyScriptCompilationErrorDetail[]Every error the compiler reported, with its source range.source/errors/compilation.ts:106
compilationStagereadonly"parse" | "reduce" | "resolve"Compiler stage that stopped.source/errors/compilation.ts:101
lockingScriptIdentifierreadonlystringLocking script that failed to compile.source/errors/compilation.ts:91
scriptIdreadonlystringScript the compiler was compiling.source/errors/compilation.ts:96
templateIdentifierreadonlystringTemplate that defines the locking script.source/errors/compilation.ts:86

LockingScriptCompilationFailedError ​

Defined in: source/errors/compilation.ts:45

Thrown when a template locking script compiled from variables alone fails to compile.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new LockingScriptCompilationFailedError(
   templateIdentifier, 
   lockingScriptIdentifier, 
   compilationErrorMessages): LockingScriptCompilationFailedError;

Defined in: @xo-cash/engine/dist/index.d.mts:2603

Parameters ​
ParameterType
templateIdentifierstring
lockingScriptIdentifierstring
compilationErrorMessagesstring[]
Returns ​

LockingScriptCompilationFailedError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
compilationErrorMessagesreadonlystring[]Every error message the compiler reported.source/errors/compilation.ts:59
lockingScriptIdentifierreadonlystringLocking script that failed to compile.source/errors/compilation.ts:54
templateIdentifierreadonlystringTemplate that defines the locking script.source/errors/compilation.ts:49

LockingScriptResolutionsMissingError ​

Defined in: source/errors/compilation.ts:247

Thrown when a locking script cannot be compiled yet because the compiler reports identifiers missing from the compilation data, such as a public key of a key another entity holds. The operations the compiler resolved from this account's keys are carried so they can be provided to the invitation.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new LockingScriptResolutionsMissingError(
   lockingScriptIdentifier, 
   missingIdentifiers, 
   resolvedKeyOperations, 
   compilationErrors): LockingScriptResolutionsMissingError;

Defined in: @xo-cash/engine/dist/index.d.mts:2710

Parameters ​
ParameterType
lockingScriptIdentifierstring
missingIdentifiersstring[]
resolvedKeyOperationsRecord<XOInvitationResolutionIdentifier, Uint8Array>
compilationErrorsScriptCompilationErrorDetail[]
Returns ​

LockingScriptResolutionsMissingError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
compilationErrorsreadonlyScriptCompilationErrorDetail[]Compiler errors with their source position, missing identifier, and owning entity.source/errors/compilation.ts:266
lockingScriptIdentifierreadonlystringLocking script that could not be compiled.source/errors/compilation.ts:251
missingIdentifiersreadonlystring[]Identifiers the compiler reports as missing.source/errors/compilation.ts:256
resolvedKeyOperationsreadonlyRecord<XOInvitationResolutionIdentifier, Uint8Array>Operations on this account's keys the compiler resolved, keyed by their full identifier.source/errors/compilation.ts:261

LockingScriptSecretsNotFoundError ​

Defined in: source/errors/compilation.ts:184

Thrown when a locking script uses existing secrets that this account has not generated for the invitation it is built for. Only a generate list creates a secret, so a secret the script expects to exist is never generated in its place.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new LockingScriptSecretsNotFoundError(
   templateIdentifier, 
   lockingScriptIdentifier, 
   secretIdentifiers, 
   roleIdentifier?, 
   invitationIdentifier?): LockingScriptSecretsNotFoundError;

Defined in: @xo-cash/engine/dist/index.d.mts:2684

Parameters ​
ParameterType
templateIdentifierstring
lockingScriptIdentifierstring
secretIdentifiersstring[]
roleIdentifier?string
invitationIdentifier?string
Returns ​

LockingScriptSecretsNotFoundError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
invitationIdentifierreadonlystring | undefinedInvitation whose secrets were searched, when it is known.source/errors/compilation.ts:208
lockingScriptIdentifierreadonlystringLocking script that uses the secrets.source/errors/compilation.ts:193
roleIdentifierreadonlystring | undefinedRole the locking script was built for, when one was given.source/errors/compilation.ts:203
secretIdentifiersreadonlystring[]Secrets the locking script uses that the invitation does not hold.source/errors/compilation.ts:198
templateIdentifierreadonlystringTemplate that defines the locking script.source/errors/compilation.ts:188

MergedInputCommitNotFoundError ​

Defined in: source/errors/invitation.ts:94

Thrown when no commit in the invitation introduced a merged input, so there is no commit for a new commit to extend.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new MergedInputCommitNotFoundError(invitationIdentifier, inputIndex): MergedInputCommitNotFoundError;

Defined in: @xo-cash/engine/dist/index.d.mts:1815

Parameters ​
ParameterType
invitationIdentifierstring
inputIndexnumber
Returns ​

MergedInputCommitNotFoundError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
inputIndexreadonlynumberPosition of the input in the merged input list.source/errors/invitation.ts:103
invitationIdentifierreadonlystringInvitation whose commits were searched.source/errors/invitation.ts:98

MergedInputNotFoundError ​

Defined in: source/errors/invitation.ts:1032

Thrown when the merged invitation has no input at the index asked to be unlocked.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new MergedInputNotFoundError(invitationIdentifier, inputIndex): MergedInputNotFoundError;

Defined in: @xo-cash/engine/dist/index.d.mts:2354

Parameters ​
ParameterType
invitationIdentifierstring
inputIndexnumber
Returns ​

MergedInputNotFoundError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
inputIndexreadonlynumberPosition in the merged input list that has no input.source/errors/invitation.ts:1041
invitationIdentifierreadonlystringInvitation whose merged inputs were searched.source/errors/invitation.ts:1036

MergedInputOutpointMissingError ​

Defined in: source/errors/invitation.ts:578

Thrown when a merged input to unlock has no outpoint, so there is no output for it to spend.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new MergedInputOutpointMissingError(invitationIdentifier, inputIndex): MergedInputOutpointMissingError;

Defined in: @xo-cash/engine/dist/index.d.mts:2098

Parameters ​
ParameterType
invitationIdentifierstring
inputIndexnumber
Returns ​

MergedInputOutpointMissingError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
inputIndexreadonlynumberPosition of the input in the merged input list.source/errors/invitation.ts:587
invitationIdentifierreadonlystringInvitation that owns the input.source/errors/invitation.ts:582

MergedItemTokenIncompleteError ​

Defined in: source/errors/invitation.ts:1250

Thrown when the token on a merged input or output is missing its category or amount.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new MergedItemTokenIncompleteError(
   itemType, 
   itemIndex, 
   commitIdentifier): MergedItemTokenIncompleteError;

Defined in: @xo-cash/engine/dist/index.d.mts:2484

Parameters ​
ParameterType
itemType"input" | "output"
itemIndexnumber
commitIdentifierstring
Returns ​

MergedItemTokenIncompleteError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
commitIdentifierreadonlystringCommit that last wrote the item.source/errors/invitation.ts:1264
itemIndexreadonlynumberPosition of the item in the merged input or output list.source/errors/invitation.ts:1259
itemTypereadonly"input" | "output"Whether the item is a merged input or a merged output.source/errors/invitation.ts:1254

MergedItemValueSatoshisMissingError ​

Defined in: source/errors/invitation.ts:1119

Thrown when a merged input has neither valueSatoshis nor an outpoint, or a merged output has no valueSatoshis.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new MergedItemValueSatoshisMissingError(
   itemType, 
   itemIndex, 
   commitIdentifier): MergedItemValueSatoshisMissingError;

Defined in: @xo-cash/engine/dist/index.d.mts:2412

Parameters ​
ParameterType
itemType"input" | "output"
itemIndexnumber
commitIdentifierstring
Returns ​

MergedItemValueSatoshisMissingError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
commitIdentifierreadonlystringCommit that last wrote the item.source/errors/invitation.ts:1133
itemIndexreadonlynumberPosition of the item in the merged input or output list.source/errors/invitation.ts:1128
itemTypereadonly"input" | "output"Whether the item is a merged input or a merged output.source/errors/invitation.ts:1123

MergedOutputLockingBytecodeMissingError ​

Defined in: source/errors/invitation.ts:1150

Thrown when a merged output names a template output that defines no locking script and the commit that last wrote it provides no locking bytecode.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new MergedOutputLockingBytecodeMissingError(
   outputIdentifier, 
   outputIndex, 
   transactionIndex, 
   commitIdentifier, 
   templateIdentifier): MergedOutputLockingBytecodeMissingError;

Defined in: @xo-cash/engine/dist/index.d.mts:2440

Parameters ​
ParameterType
outputIdentifierstring
outputIndexnumber
transactionIndexnumber | undefined
commitIdentifierstring
templateIdentifierstring
Returns ​

MergedOutputLockingBytecodeMissingError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
commitIdentifierreadonlystringCommit that last wrote the output.source/errors/invitation.ts:1169
outputIdentifierreadonlystringTemplate output the merged output names.source/errors/invitation.ts:1154
outputIndexreadonlynumberPosition of the output in the merged output list.source/errors/invitation.ts:1159
templateIdentifierreadonlystringTemplate whose output defines no locking script.source/errors/invitation.ts:1174
transactionIndexreadonlynumber | undefinedPosition of the output in the transaction when the commit or the template action sets it.source/errors/invitation.ts:1164

MergedOutputLockingScriptVariablesMissingError ​

Defined in: source/errors/invitation.ts:1206

Thrown when a merged output has no locking bytecode because its template locking script reads variables that no commit provides.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new MergedOutputLockingScriptVariablesMissingError(
   outputIdentifier, 
   outputIndex, 
   variableIdentifiers, 
   templateIdentifier): MergedOutputLockingScriptVariablesMissingError;

Defined in: @xo-cash/engine/dist/index.d.mts:2464

Parameters ​
ParameterType
outputIdentifierstring
outputIndexnumber
variableIdentifiersstring[]
templateIdentifierstring
Returns ​

MergedOutputLockingScriptVariablesMissingError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
outputIdentifierreadonlystringTemplate output the merged output names.source/errors/invitation.ts:1210
outputIndexreadonlynumberPosition of the output in the merged output list.source/errors/invitation.ts:1215
templateIdentifierreadonlystringTemplate that defines the output locking script.source/errors/invitation.ts:1225
variableIdentifiersreadonlystring[]Variables the locking script reads that no commit provides.source/errors/invitation.ts:1220

MergesWithCommitNotEarlierError ​

Defined in: source/errors/invitation.ts:754

Thrown when a mergesWith reference points at the same commit or a later commit instead of an earlier one.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new MergesWithCommitNotEarlierError(mergesWithCommitIdentifier, currentCommitIdentifier): MergesWithCommitNotEarlierError;

Defined in: @xo-cash/engine/dist/index.d.mts:2194

Parameters ​
ParameterType
mergesWithCommitIdentifierstring
currentCommitIdentifierstring
Returns ​

MergesWithCommitNotEarlierError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
currentCommitIdentifierreadonlystringCommit that contains the mergesWith reference.source/errors/invitation.ts:763
mergesWithCommitIdentifierreadonlystringCommit identifier that mergesWith pointed at.source/errors/invitation.ts:758

MergesWithCommitNotFoundError ​

Defined in: source/errors/invitation.ts:443

Thrown when a mergesWith commit identifier is absent from the invitation.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new MergesWithCommitNotFoundError(
   invitationIdentifier, 
   mergesWithCommitIdentifier, 
   currentCommitIdentifier?): MergesWithCommitNotFoundError;

Defined in: @xo-cash/engine/dist/index.d.mts:2022

Parameters ​
ParameterType
invitationIdentifierstring
mergesWithCommitIdentifierstring
currentCommitIdentifier?string
Returns ​

MergesWithCommitNotFoundError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
currentCommitIdentifierreadonlystring | undefinedCommit that referenced the missing mergesWith commit, undefined when that commit is still being built.source/errors/invitation.ts:457
invitationIdentifierreadonlystringInvitation whose commits were searched.source/errors/invitation.ts:447
mergesWithCommitIdentifierreadonlystringCommit identifier that mergesWith pointed at.source/errors/invitation.ts:452

OutputLockingBytecodeNotProvidedError ​

Defined in: source/errors/invitation.ts:1005

Thrown when an output appended to an invitation names a template output but carries no locking bytecode.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new OutputLockingBytecodeNotProvidedError(invitationIdentifier, outputIdentifier): OutputLockingBytecodeNotProvidedError;

Defined in: @xo-cash/engine/dist/index.d.mts:2338

Parameters ​
ParameterType
invitationIdentifierstring
outputIdentifierstring
Returns ​

OutputLockingBytecodeNotProvidedError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
invitationIdentifierreadonlystringInvitation the output is appended to.source/errors/invitation.ts:1009
outputIdentifierreadonlystringTemplate output that has no locking bytecode.source/errors/invitation.ts:1014

OutputOwnResolutionsNotFoundError ​

Defined in: source/errors/compilation.ts:404

Thrown when this account is asked to add its own resolutions for an output, but it resolved none that the invitation does not already hold.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new OutputOwnResolutionsNotFoundError(invitationIdentifier, outputIdentifier): OutputOwnResolutionsNotFoundError;

Defined in: @xo-cash/engine/dist/index.d.mts:2793

Parameters ​
ParameterType
invitationIdentifierstring
outputIdentifierstring
Returns ​

OutputOwnResolutionsNotFoundError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
invitationIdentifierreadonlystringInvitation the output belongs to.source/errors/compilation.ts:408
outputIdentifierreadonlystringTemplate output the resolutions were asked for.source/errors/compilation.ts:413

ParentCommitNotFoundError ​

Defined in: source/errors/invitation.ts:377

Thrown when a parent commit identifier is absent from the invitation.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new ParentCommitNotFoundError(parentCommitIdentifier, commitIdentifier): ParentCommitNotFoundError;

Defined in: @xo-cash/engine/dist/index.d.mts:1980

Parameters ​
ParameterType
parentCommitIdentifierstring
commitIdentifierstring
Returns ​

ParentCommitNotFoundError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
commitIdentifierreadonlystringCommit that referenced the missing parent.source/errors/invitation.ts:386
parentCommitIdentifierreadonlystringParent commit identifier that was looked up.source/errors/invitation.ts:381

RoleVariableEntityMismatchError ​

Defined in: source/errors/invitation.ts:916

Thrown when a commit provides a variable that belongs to a role its entity does not hold, since only an entity holding the role may provide its variables.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new RoleVariableEntityMismatchError(mismatches): RoleVariableEntityMismatchError;

Defined in: @xo-cash/engine/dist/index.d.mts:2290

Parameters ​
ParameterType
mismatchesRoleVariableEntityMismatch[]
Returns ​

RoleVariableEntityMismatchError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
mismatchesreadonlyRoleVariableEntityMismatch[]Every variable provided by an entity that does not hold its role.source/errors/invitation.ts:920

RootCommitNotFoundError ​

Defined in: source/errors/invitation.ts:350

Thrown when the root commit for an entity cannot be found in the invitation.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new RootCommitNotFoundError(invitationIdentifier, entityIdentifier): RootCommitNotFoundError;

Defined in: @xo-cash/engine/dist/index.d.mts:1964

Parameters ​
ParameterType
invitationIdentifierstring
entityIdentifierstring
Returns ​

RootCommitNotFoundError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
entityIdentifierreadonlystringEntity whose root commit was searched.source/errors/invitation.ts:359
invitationIdentifierreadonlystringInvitation identifier that was searched.source/errors/invitation.ts:354

SecretIdentifierTypeInvalidError ​

Defined in: source/errors/compilation.ts:459

Thrown when a secret used to derive a key is declared in the template with a type other than private_key.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new SecretIdentifierTypeInvalidError(
   templateIdentifier, 
   secretIdentifier, 
   declaredType?): SecretIdentifierTypeInvalidError;

Defined in: @xo-cash/engine/dist/index.d.mts:2830

Parameters ​
ParameterType
templateIdentifierstring
secretIdentifierstring
declaredType?string
Returns ​

SecretIdentifierTypeInvalidError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
declaredTypereadonlystring | undefinedType the template declares for the secret, undefined when the template does not declare it.source/errors/compilation.ts:473
secretIdentifierreadonlystringSecret identifier whose template variable is not a private key.source/errors/compilation.ts:468
templateIdentifierreadonlystringTemplate that declares the secret.source/errors/compilation.ts:463

TemplateActionNotFoundError ​

Defined in: source/errors/template.ts:19

Thrown when an action identifier is absent from the template.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TemplateActionNotFoundError(templateIdentifier, actionIdentifier): TemplateActionNotFoundError;

Defined in: @xo-cash/engine/dist/index.d.mts:1388

Parameters ​
ParameterType
templateIdentifierstring
actionIdentifierstring
Returns ​

TemplateActionNotFoundError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
actionIdentifierreadonlystringAction identifier that is missing.source/errors/template.ts:28
templateIdentifierreadonlystringTemplate whose action is missing.source/errors/template.ts:23

TemplateActionRoleNotFoundError ​

Defined in: source/errors/template.ts:425

Thrown when a role is not defined on the template action an entity tries to take.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TemplateActionRoleNotFoundError(
   templateIdentifier, 
   actionIdentifier, 
   roleIdentifier): TemplateActionRoleNotFoundError;

Defined in: @xo-cash/engine/dist/index.d.mts:1642

Parameters ​
ParameterType
templateIdentifierstring
actionIdentifierstring
roleIdentifierstring
Returns ​

TemplateActionRoleNotFoundError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
actionIdentifierreadonlystringAction whose role is missing.source/errors/template.ts:434
roleIdentifierreadonlystringRole that is missing.source/errors/template.ts:439
templateIdentifierreadonlystringTemplate that defines the action.source/errors/template.ts:429

TemplateActionTransactionNotFoundError ​

Defined in: source/errors/template.ts:144

Thrown when a template action names no transaction.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TemplateActionTransactionNotFoundError(templateIdentifier, actionIdentifier): TemplateActionTransactionNotFoundError;

Defined in: @xo-cash/engine/dist/index.d.mts:1468

Parameters ​
ParameterType
templateIdentifierstring
actionIdentifierstring
Returns ​

TemplateActionTransactionNotFoundError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
actionIdentifierreadonlystringAction identifier whose transaction is missing.source/errors/template.ts:153
templateIdentifierreadonlystringTemplate that defines the action.source/errors/template.ts:148

TemplateDefaultPolicyMissingError ​

Defined in: source/errors/template.ts:509

Thrown when a wallet default policy names a template whose defaults do not define that policy.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TemplateDefaultPolicyMissingError(templateIdentifier, policy): TemplateDefaultPolicyMissingError;

Defined in: @xo-cash/engine/dist/index.d.mts:1686

Parameters ​
ParameterType
templateIdentifierstring
policykeyof WalletDefaultPolicies
Returns ​

TemplateDefaultPolicyMissingError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
policyreadonlykeyof WalletDefaultPoliciesDefault policy that is missing.source/errors/template.ts:518
templateIdentifierreadonlystringTemplate whose default policy is missing.source/errors/template.ts:513

TemplateGeneratedVariableTypeUnsupportedError ​

Defined in: source/errors/template.ts:456

Thrown when a template action role asks the engine to generate variables that are not private keys.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TemplateGeneratedVariableTypeUnsupportedError(
   templateIdentifier, 
   actionIdentifier, 
   variableIdentifiers, 
   variableTypes, 
   roleIdentifier?): TemplateGeneratedVariableTypeUnsupportedError;

Defined in: @xo-cash/engine/dist/index.d.mts:1670

Parameters ​
ParameterType
templateIdentifierstring
actionIdentifierstring
variableIdentifiersstring[]
variableTypes(string | undefined)[]
roleIdentifier?string
Returns ​

TemplateGeneratedVariableTypeUnsupportedError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
actionIdentifierreadonlystringAction the variables are generated for.source/errors/template.ts:465
roleIdentifierreadonlystring | undefinedRole the entity takes in the action, when it takes one.source/errors/template.ts:470
templateIdentifierreadonlystringTemplate that defines the variables.source/errors/template.ts:460
variableIdentifiersreadonlystring[]Generated variables that are not defined as private keys.source/errors/template.ts:475
variableTypesreadonly(string | undefined)[]Defined type of each of those variables, undefined when the template does not define the variable.source/errors/template.ts:480

TemplateLockingScriptBytecodeNotFoundError ​

Defined in: source/errors/template.ts:559

Thrown when a template locking script omits its locking bytecode.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TemplateLockingScriptBytecodeNotFoundError(templateIdentifier, lockingScriptIdentifier): TemplateLockingScriptBytecodeNotFoundError;

Defined in: @xo-cash/engine/dist/index.d.mts:1718

Parameters ​
ParameterType
templateIdentifierstring
lockingScriptIdentifierstring
Returns ​

TemplateLockingScriptBytecodeNotFoundError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
lockingScriptIdentifierreadonlystringLocking script that has no locking bytecode.source/errors/template.ts:568
templateIdentifierreadonlystringTemplate that defines the locking script.source/errors/template.ts:563

TemplateLockingScriptNotFoundError ​

Defined in: source/errors/template.ts:69

Thrown when a locking script identifier is absent from the template.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TemplateLockingScriptNotFoundError(templateIdentifier, lockingScriptIdentifier): TemplateLockingScriptNotFoundError;

Defined in: @xo-cash/engine/dist/index.d.mts:1420

Parameters ​
ParameterType
templateIdentifierstring
lockingScriptIdentifierstring
Returns ​

TemplateLockingScriptNotFoundError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
lockingScriptIdentifierreadonlystringLocking script identifier that is missing.source/errors/template.ts:78
templateIdentifierreadonlystringTemplate whose locking script is missing.source/errors/template.ts:73

TemplateLockingScriptRoleNotFoundError ​

Defined in: source/errors/template.ts:194

Thrown when a locking script role identifier is absent from the template.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TemplateLockingScriptRoleNotFoundError(
   templateIdentifier, 
   lockingScriptIdentifier, 
   roleIdentifier): TemplateLockingScriptRoleNotFoundError;

Defined in: @xo-cash/engine/dist/index.d.mts:1504

Parameters ​
ParameterType
templateIdentifierstring
lockingScriptIdentifierstring
roleIdentifierstring
Returns ​

TemplateLockingScriptRoleNotFoundError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
lockingScriptIdentifierreadonlystringLocking script identifier that was searched.source/errors/template.ts:203
roleIdentifierreadonlystringRole identifier that is missing.source/errors/template.ts:208
templateIdentifierreadonlystringTemplate that defines the locking script.source/errors/template.ts:198

TemplateLockingScriptTypeNotFoundError ​

Defined in: source/errors/template.ts:534

Thrown when a template locking script omits its locking type.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TemplateLockingScriptTypeNotFoundError(templateIdentifier, lockingScriptIdentifier): TemplateLockingScriptTypeNotFoundError;

Defined in: @xo-cash/engine/dist/index.d.mts:1702

Parameters ​
ParameterType
templateIdentifierstring
lockingScriptIdentifierstring
Returns ​

TemplateLockingScriptTypeNotFoundError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
lockingScriptIdentifierreadonlystringLocking script that has no locking type.source/errors/template.ts:543
templateIdentifierreadonlystringTemplate that defines the locking script.source/errors/template.ts:538

TemplateOutputLockingScriptNotFoundError ​

Defined in: source/errors/template.ts:169

Thrown when a template output has no locking script.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TemplateOutputLockingScriptNotFoundError(templateIdentifier, outputIdentifier): TemplateOutputLockingScriptNotFoundError;

Defined in: @xo-cash/engine/dist/index.d.mts:1484

Parameters ​
ParameterType
templateIdentifierstring
outputIdentifierstring
Returns ​

TemplateOutputLockingScriptNotFoundError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
outputIdentifierreadonlystringOutput identifier whose locking script is missing.source/errors/template.ts:178
templateIdentifierreadonlystringTemplate that defines the output.source/errors/template.ts:173

TemplateOutputLockingScriptReferenceInvalidError ​

Defined in: source/errors/template.ts:584

Thrown when a template output names a locking script, or a locking script names a script, that the template does not define.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TemplateOutputLockingScriptReferenceInvalidError(
   templateIdentifier, 
   outputIdentifier, 
   lockingScriptReference): TemplateOutputLockingScriptReferenceInvalidError;

Defined in: @xo-cash/engine/dist/index.d.mts:1738

Parameters ​
ParameterType
templateIdentifierstring
outputIdentifierstring
lockingScriptReferencestring
Returns ​

TemplateOutputLockingScriptReferenceInvalidError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
lockingScriptReferencereadonlystringLocking script or script identifier the template does not define.source/errors/template.ts:598
outputIdentifierreadonlystringTemplate output whose locking script definition holds the reference.source/errors/template.ts:593
templateIdentifierreadonlystringTemplate that defines the output.source/errors/template.ts:588

TemplateOutputNotFoundError ​

Defined in: source/errors/template.ts:44

Thrown when an output identifier is absent from the template.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TemplateOutputNotFoundError(templateIdentifier, outputIdentifier): TemplateOutputNotFoundError;

Defined in: @xo-cash/engine/dist/index.d.mts:1404

Parameters ​
ParameterType
templateIdentifierstring
outputIdentifierstring
Returns ​

TemplateOutputNotFoundError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
outputIdentifierreadonlystringOutput identifier that is missing.source/errors/template.ts:53
templateIdentifierreadonlystringTemplate whose output is missing.source/errors/template.ts:48

TemplateRoleRelevantCashAssemblyUnsupportedError ​

Defined in: source/errors/template.ts:229

Thrown when a role sets relevant to CashAssembly that the engine cannot evaluate yet.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TemplateRoleRelevantCashAssemblyUnsupportedError(
   templateIdentifier, 
   outputIdentifier, 
   roleIdentifier, 
   relevantExpression): TemplateRoleRelevantCashAssemblyUnsupportedError;

Defined in: @xo-cash/engine/dist/index.d.mts:1528

Parameters ​
ParameterType
templateIdentifierstring
outputIdentifierstring
roleIdentifierstring
relevantExpressionstring
Returns ​

TemplateRoleRelevantCashAssemblyUnsupportedError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
outputIdentifierreadonlystringOutput whose role declared the unsupported expression.source/errors/template.ts:238
relevantExpressionreadonlystringCashAssembly expression from the role relevant field.source/errors/template.ts:248
roleIdentifierreadonlystringRole whose relevant field is a CashAssembly string.source/errors/template.ts:243
templateIdentifierreadonlystringTemplate that defines the role.source/errors/template.ts:233

TemplateTokenAmountInvalidError ​

Defined in: source/errors/template.ts:392

Thrown when a template output token amount does not resolve to a valid fungible token amount.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TemplateTokenAmountInvalidError(
   templateIdentifier, 
   outputIdentifier, 
   tokenAmount): TemplateTokenAmountInvalidError;

Defined in: @xo-cash/engine/dist/index.d.mts:1622

Parameters ​
ParameterType
templateIdentifierstring
outputIdentifierstring
tokenAmountstring
Returns ​

TemplateTokenAmountInvalidError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
outputIdentifierreadonlystringOutput identifier whose token amount could not be resolved.source/errors/template.ts:401
templateIdentifierreadonlystringTemplate that defines the output.source/errors/template.ts:396
tokenAmountreadonlystringTemplate amount, or the value its CashAssembly expression evaluated to.source/errors/template.ts:406

TemplateTokenCategoryMissingError ​

Defined in: source/errors/template.ts:273

Thrown when a template output token omits a category.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TemplateTokenCategoryMissingError(templateIdentifier, outputIdentifier): TemplateTokenCategoryMissingError;

Defined in: @xo-cash/engine/dist/index.d.mts:1544

Parameters ​
ParameterType
templateIdentifierstring
outputIdentifierstring
Returns ​

TemplateTokenCategoryMissingError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
outputIdentifierreadonlystringOutput whose token omits the category.source/errors/template.ts:282
templateIdentifierreadonlystringTemplate that defines the output.source/errors/template.ts:277

TemplateTokenNftCapabilityInvalidError ​

Defined in: source/errors/template.ts:323

Thrown when a template output NFT capability is not recognized.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TemplateTokenNftCapabilityInvalidError(
   templateIdentifier, 
   outputIdentifier, 
   capabilityValue): TemplateTokenNftCapabilityInvalidError;

Defined in: @xo-cash/engine/dist/index.d.mts:1580

Parameters ​
ParameterType
templateIdentifierstring
outputIdentifierstring
capabilityValuestring
Returns ​

TemplateTokenNftCapabilityInvalidError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
capabilityValuereadonlystringCapability value that was rejected.source/errors/template.ts:337
outputIdentifierreadonlystringOutput whose NFT capability was rejected.source/errors/template.ts:332
templateIdentifierreadonlystringTemplate that defines the output.source/errors/template.ts:327

TemplateTokenNftCapabilityMissingError ​

Defined in: source/errors/template.ts:298

Thrown when a template output NFT omits capability.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TemplateTokenNftCapabilityMissingError(templateIdentifier, outputIdentifier): TemplateTokenNftCapabilityMissingError;

Defined in: @xo-cash/engine/dist/index.d.mts:1560

Parameters ​
ParameterType
templateIdentifierstring
outputIdentifierstring
Returns ​

TemplateTokenNftCapabilityMissingError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
outputIdentifierreadonlystringOutput whose NFT omits the capability.source/errors/template.ts:307
templateIdentifierreadonlystringTemplate that defines the output.source/errors/template.ts:302

TemplateTransactionNotFoundError ​

Defined in: source/errors/template.ts:119

Thrown when a transaction identifier is absent from the template.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TemplateTransactionNotFoundError(templateIdentifier, transactionIdentifier): TemplateTransactionNotFoundError;

Defined in: @xo-cash/engine/dist/index.d.mts:1452

Parameters ​
ParameterType
templateIdentifierstring
transactionIdentifierstring
Returns ​

TemplateTransactionNotFoundError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
templateIdentifierreadonlystringTemplate whose transaction is missing.source/errors/template.ts:123
transactionIdentifierreadonlystringTransaction identifier that is missing.source/errors/template.ts:128

TemplateUnlockingScriptNotFoundError ​

Defined in: source/errors/template.ts:94

Thrown when the template defines no unlocking script for a locking script.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TemplateUnlockingScriptNotFoundError(templateIdentifier, lockingScriptIdentifier): TemplateUnlockingScriptNotFoundError;

Defined in: @xo-cash/engine/dist/index.d.mts:1436

Parameters ​
ParameterType
templateIdentifierstring
lockingScriptIdentifierstring
Returns ​

TemplateUnlockingScriptNotFoundError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
lockingScriptIdentifierreadonlystringLocking script that has no unlocking script.source/errors/template.ts:103
templateIdentifierreadonlystringTemplate whose unlocking script is missing.source/errors/template.ts:98

TemplateValueSatoshisInvalidError ​

Defined in: source/errors/template.ts:356

Thrown when a template output valueSatoshis string is neither CashAssembly nor a decimal integer.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TemplateValueSatoshisInvalidError(
   templateIdentifier, 
   outputIdentifier, 
   templateValueSatoshis, 
   options?): TemplateValueSatoshisInvalidError;

Defined in: @xo-cash/engine/dist/index.d.mts:1600

Parameters ​
ParameterType
templateIdentifierstring
outputIdentifierstring
templateValueSatoshisstring
options?{ cause?: unknown; }
options.cause?unknown
Returns ​

TemplateValueSatoshisInvalidError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
outputIdentifierreadonlystringOutput identifier whose valueSatoshis could not be resolved.source/errors/template.ts:365
templateIdentifierreadonlystringTemplate that defines the output.source/errors/template.ts:360
templateValueSatoshisreadonlystringPassed valueSatoshis string.source/errors/template.ts:370

TransactionBroadcastFailedError ​

Defined in: source/errors/transaction.ts:116

Thrown when a built invitation transaction cannot be broadcast to the network.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TransactionBroadcastFailedError(
   invitationIdentifier, 
   transactionHash, 
   reason, 
   options?): TransactionBroadcastFailedError;

Defined in: @xo-cash/engine/dist/index.d.mts:2940

Parameters ​
ParameterType
invitationIdentifierstring
transactionHashstring
reasonstring
options?{ cause?: unknown; }
options.cause?unknown
Returns ​

TransactionBroadcastFailedError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
invitationIdentifierreadonlystringInvitation the transaction was built from.source/errors/transaction.ts:120
reasonreadonlystringReason the Electrum servers reported for rejecting the transaction.source/errors/transaction.ts:130
transactionHashreadonlystringHash of the transaction that was broadcast.source/errors/transaction.ts:125

TransactionBroadcastMetadataIncompleteError ​

Defined in: source/errors/invitation.ts:302

Collected during invitation validation when a transaction result has some but not all broadcast fields.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TransactionBroadcastMetadataIncompleteError(transactionIdentifier): TransactionBroadcastMetadataIncompleteError;

Defined in: @xo-cash/engine/dist/index.d.mts:1932

Parameters ​
ParameterType
transactionIdentifierstring
Returns ​

TransactionBroadcastMetadataIncompleteError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
transactionIdentifierreadonlystringTemplate transaction identifier of the result with incomplete broadcast fields.source/errors/invitation.ts:306

TransactionBroadcastSignatureInvalidError ​

Defined in: source/errors/invitation.ts:273

Collected during invitation validation when a transaction result broadcast signature does not verify or verification throws.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TransactionBroadcastSignatureInvalidError(transactionIdentifier, cause?): TransactionBroadcastSignatureInvalidError;

Defined in: @xo-cash/engine/dist/index.d.mts:1920

Parameters ​
ParameterType
transactionIdentifierstring
cause?Error
Returns ​

TransactionBroadcastSignatureInvalidError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionOverridesDefined in
cause?readonlyErrorError thrown by signature verification, when verification threw.Error.causesource/errors/invitation.ts:282
transactionIdentifierreadonlystringTemplate transaction identifier of the result whose signature failed.-source/errors/invitation.ts:277

TransactionCreatedSignatureInvalidError ​

Defined in: source/errors/invitation.ts:244

Collected during invitation validation when a transaction result created signature does not verify or verification throws.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TransactionCreatedSignatureInvalidError(transactionIdentifier, cause?): TransactionCreatedSignatureInvalidError;

Defined in: @xo-cash/engine/dist/index.d.mts:1904

Parameters ​
ParameterType
transactionIdentifierstring
cause?Error
Returns ​

TransactionCreatedSignatureInvalidError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionOverridesDefined in
cause?readonlyErrorError thrown by signature verification, when verification threw.Error.causesource/errors/invitation.ts:253
transactionIdentifierreadonlystringTemplate transaction identifier of the result whose signature failed.-source/errors/invitation.ts:248

TransactionGenerationFailedError ​

Defined in: source/errors/transaction.ts:35

Thrown when transaction generation fails.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TransactionGenerationFailedError(
   templateIdentifier, 
   actionIdentifier, 
   reason): TransactionGenerationFailedError;

Defined in: @xo-cash/engine/dist/index.d.mts:2888

Parameters ​
ParameterType
templateIdentifierstring
actionIdentifierstring
reasonstring
Returns ​

TransactionGenerationFailedError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
actionIdentifierreadonlystringAction whose transaction failed to generate.source/errors/transaction.ts:44
reasonreadonlystringGeneration failure reported by Libauth.source/errors/transaction.ts:49
templateIdentifierreadonlystringTemplate that defines the action.source/errors/transaction.ts:39

TransactionIndexDuplicatedError ​

Defined in: source/errors/invitation.ts:402

Thrown when two or more merged inputs or outputs share the same transactionIndex.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TransactionIndexDuplicatedError(itemType, duplicateGroups): TransactionIndexDuplicatedError;

Defined in: @xo-cash/engine/dist/index.d.mts:1999

Parameters ​
ParameterType
itemType"input" | "output"
duplicateGroupsobject[]
Returns ​

TransactionIndexDuplicatedError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
duplicateGroupsreadonlyobject[]Groups of merged array positions that share one transactionIndex.source/errors/invitation.ts:411
itemTypereadonly"input" | "output"Whether the conflict is among inputs or outputs.source/errors/invitation.ts:406

TransactionLocktimeDuplicatedError ​

Defined in: source/errors/invitation.ts:534

Thrown when transaction locktime is defined in more than one commit.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TransactionLocktimeDuplicatedError(commitIdentifiers): TransactionLocktimeDuplicatedError;

Defined in: @xo-cash/engine/dist/index.d.mts:2066

Parameters ​
ParameterType
commitIdentifiersstring[]
Returns ​

TransactionLocktimeDuplicatedError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
commitIdentifiersreadonlystring[]Commit identifiers that each defined transaction locktime.source/errors/invitation.ts:538

TransactionOutputNotFoundError ​

Defined in: source/errors/transaction.ts:10

Thrown when a parent transaction has no output at the requested index.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TransactionOutputNotFoundError(transactionHash, outputIndex): TransactionOutputNotFoundError;

Defined in: @xo-cash/engine/dist/index.d.mts:2868

Parameters ​
ParameterType
transactionHashstring
outputIndexnumber
Returns ​

TransactionOutputNotFoundError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
outputIndexreadonlynumberOutput index that was looked up.source/errors/transaction.ts:19
transactionHashreadonlystringParent transaction hash that was searched.source/errors/transaction.ts:14

TransactionResultAlreadyExistsError ​

Defined in: source/errors/transaction.ts:66

Thrown when a transaction result already exists for the given template transaction identifier.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TransactionResultAlreadyExistsError(invitationIdentifier, transactionIdentifier): TransactionResultAlreadyExistsError;

Defined in: @xo-cash/engine/dist/index.d.mts:2904

Parameters ​
ParameterType
invitationIdentifierstring
transactionIdentifierstring
Returns ​

TransactionResultAlreadyExistsError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
invitationIdentifierreadonlystringInvitation that already has the result.source/errors/transaction.ts:70
transactionIdentifierreadonlystringTemplate transaction identifier that already has a result.source/errors/transaction.ts:75

TransactionResultNotFoundError ​

Defined in: source/errors/transaction.ts:91

Thrown when a transaction result is absent for the given template transaction identifier.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TransactionResultNotFoundError(invitationIdentifier, transactionIdentifier): TransactionResultNotFoundError;

Defined in: @xo-cash/engine/dist/index.d.mts:2920

Parameters ​
ParameterType
invitationIdentifierstring
transactionIdentifierstring
Returns ​

TransactionResultNotFoundError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
invitationIdentifierreadonlystringInvitation that was searched.source/errors/transaction.ts:95
transactionIdentifierreadonlystringTemplate transaction identifier whose result was missing.source/errors/transaction.ts:100

TransactionVersionDuplicatedError ​

Defined in: source/errors/invitation.ts:515

Thrown when transaction version is defined in more than one commit.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new TransactionVersionDuplicatedError(commitIdentifiers): TransactionVersionDuplicatedError;

Defined in: @xo-cash/engine/dist/index.d.mts:2054

Parameters ​
ParameterType
commitIdentifiersstring[]
Returns ​

TransactionVersionDuplicatedError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
commitIdentifiersreadonlystring[]Commit identifiers that each defined transaction version.source/errors/invitation.ts:519

UnlockingBytecodeGenerationFailedError ​

Defined in: source/errors/compilation.ts:138

Thrown when an unlocking script stops compiling before it produces bytecode.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new UnlockingBytecodeGenerationFailedError(inputIndex, incompleteCompilation): UnlockingBytecodeGenerationFailedError;

Defined in: @xo-cash/engine/dist/index.d.mts:2655

Parameters ​
ParameterType
inputIndexnumber
incompleteCompilationIncompleteScriptCompilation
Returns ​

UnlockingBytecodeGenerationFailedError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
compilationErrorsreadonlyScriptCompilationErrorDetail[]Every error the compiler reported, with its source range.source/errors/compilation.ts:157
compilationStagereadonly"parse" | "reduce" | "resolve"Compiler stage that stopped.source/errors/compilation.ts:152
inputIndexreadonlynumberMerged input whose unlocking script failed to compile.source/errors/compilation.ts:142
scriptIdreadonlystringScript the compiler was compiling.source/errors/compilation.ts:147

UnlockingBytecodeVerificationFailedError ​

Defined in: source/errors/compilation.ts:337

Thrown when an unlocking bytecode built with values other participants provided does not unlock the output it spends.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new UnlockingBytecodeVerificationFailedError(
   inputIndex, 
   outpointTransactionHash, 
   outpointIndex, 
   reason): UnlockingBytecodeVerificationFailedError;

Defined in: @xo-cash/engine/dist/index.d.mts:2760

Parameters ​
ParameterType
inputIndexnumber
outpointTransactionHashstring
outpointIndexnumber
reasonstring
Returns ​

UnlockingBytecodeVerificationFailedError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
inputIndexreadonlynumberMerged input whose unlocking bytecode failed.source/errors/compilation.ts:341
outpointIndexreadonlynumberIndex of the spent output in that transaction.source/errors/compilation.ts:351
outpointTransactionHashreadonlystringHash of the transaction that holds the spent output, as hexadecimal.source/errors/compilation.ts:346
reasonreadonlystringFailure reported by the virtual machine.source/errors/compilation.ts:356

UnlockingCompilationContextMissingError ​

Defined in: source/errors/compilation.ts:376

Thrown when the unlocking compilation of a merged input carries no compilation context to verify the unlocking bytecode against.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new UnlockingCompilationContextMissingError(invitationIdentifier, inputIndex): UnlockingCompilationContextMissingError;

Defined in: @xo-cash/engine/dist/index.d.mts:2776

Parameters ​
ParameterType
invitationIdentifierstring
inputIndexnumber
Returns ​

UnlockingCompilationContextMissingError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
inputIndexreadonlynumberMerged input whose compilation has no context.source/errors/compilation.ts:385
invitationIdentifierreadonlystringInvitation that owns the input.source/errors/compilation.ts:380

UnlockingScriptResolutionsMissingError ​

Defined in: source/errors/compilation.ts:293

Thrown when an input's unlocking script cannot be compiled yet because the compiler reports identifiers missing from the compilation data, such as a signature of a key another entity holds. The operations the compiler resolved from this account's keys are carried so they can be provided to the invitation.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new UnlockingScriptResolutionsMissingError(
   inputIndex, 
   missingIdentifiers, 
   resolvedKeyOperations, 
   compilationErrors): UnlockingScriptResolutionsMissingError;

Defined in: @xo-cash/engine/dist/index.d.mts:2736

Parameters ​
ParameterType
inputIndexnumber
missingIdentifiersstring[]
resolvedKeyOperationsRecord<XOInvitationResolutionIdentifier, Uint8Array>
compilationErrorsScriptCompilationErrorDetail[]
Returns ​

UnlockingScriptResolutionsMissingError

Overrides ​
ts
Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
compilationErrorsreadonlyScriptCompilationErrorDetail[]Compiler errors with their source position, missing identifier, and owning entity.source/errors/compilation.ts:312
inputIndexreadonlynumberMerged input whose unlocking script could not be compiled.source/errors/compilation.ts:297
missingIdentifiersreadonlystring[]Identifiers the compiler reports as missing.source/errors/compilation.ts:302
resolvedKeyOperationsreadonlyRecord<XOInvitationResolutionIdentifier, Uint8Array>Operations on this account's keys the compiler resolved, keyed by their full identifier.source/errors/compilation.ts:307

WalletNameMissingError ​

Defined in: source/errors/wallet.ts:29

Thrown when a wallet name is empty or contains only whitespace.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new WalletNameMissingError(): WalletNameMissingError;

Defined in: source/errors/wallet.ts:29

Returns ​

WalletNameMissingError

Overrides ​
ts
Error.constructor