npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ninja-base

v0.3.35

Published

Base level functions, classes, interfaces for Ninja

Downloads

1,845

Readme

ninja-base

Base level functions, classes, interfaces for Ninja

API

Links: API, Interfaces, Classes, Functions, Types, Variables

Interfaces

| | | | | --- | --- | --- | | CreateActionParams | NinjaGetPendingTransactionsInstructionsApi | NinjaSubmitDirectTransactionResultApi | | CreateActionResult | NinjaGetPendingTransactionsTxApi | NinjaTransactionFailedApi | | CwiCoreApi | NinjaGetTransactionOutputsResultApi | NinjaTransactionProcessedApi | | DojoExpressClientOptions | NinjaGetTransactionWithOutputsParams | NinjaTransactionWithOutputsResultApi | | DojoTxBuilderBaseOptions | NinjaGetTransactionsResultApi | NinjaTxBuilderOptions | | DojoTxBuilderInputApi | NinjaGetTransactionsTxApi | NinjaTxInputsApi | | DojoTxBuilderOptions | NinjaGetTransactionsTxInputApi | NinjaV1Params | | DojoTxBuilderOutputApi | NinjaGetTransactionsTxOutputApi | ProcessIncomingTransactionApi | | KeyPairApi | NinjaOutputToRedeemApi | ProcessIncomingTransactionInputApi | | NinjaAbortActionParams | NinjaSignActionParams | ProcessIncomingTransactionOutputApi | | NinjaAbortActionResultApi | NinjaSignActionResultApi | ProcessIncomingTransactionResultApi | | NinjaApi | NinjaSignCreatedTransactionParams | SignActionParams | | NinjaCompleteCreateTransactionWithOutputsParams | NinjaSubmitDirectTransactionApi | TxOutputApi | | NinjaCreateTransactionParams | NinjaSubmitDirectTransactionOutputApi | TxRedeemableOutputApi | | NinjaGetPendingTransactionsInputApi | NinjaSubmitDirectTransactionParams | |

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: NinjaApi

A client for creating, signing, and delivering Bitcoin transactions

export interface NinjaApi {
    dojo: DojoClientApi;
    authenticate(identityKey?: string, addIfNew?: boolean): Promise<void>;
    sync(): Promise<void>;
    setSyncDojosByConfig(syncDojoConfigs: SyncDojoConfigBaseApi[], options?: DojoSyncOptionsApi): Promise<void>;
    getSyncDojosByConfig(): Promise<{
        dojos: SyncDojoConfigBaseApi[];
        options?: DojoSyncOptionsApi;
    }>;
    getClientChangeKeyPair(): KeyPairApi;
    getPaymail(): Promise<string>;
    setPaymail(paymail: string): Promise<void>;
    getChain(): Promise<Chain>;
    getNetwork(format?: "default" | "nonet"): Promise<string>;
    findCertificates(certifiers?: string[] | object, types?: Record<string, string[]>): Promise<{
        status: "success";
        certificates: DojoCertificateApi[];
    }>;
    saveCertificate(certificate: DojoCertificateApi | object): Promise<void>;
    getTotalValue(basket?: string): Promise<{
        total: number;
    }>;
    getTotalOfAmounts(options: DojoGetTotalOfAmountsOptions): Promise<{
        total: number;
    }>;
    getNetOfAmounts(options?: DojoGetTotalOfAmountsOptions): Promise<number>;
    getAvatar(): Promise<DojoAvatarApi>;
    setAvatar(name: string, photoURL: string): Promise<void>;
    getTransactions(options?: DojoGetTransactionsOptions): Promise<NinjaGetTransactionsResultApi>;
    getTransactionOutputs(options?: DojoGetTransactionOutputsOptions): Promise<NinjaGetTransactionOutputsResultApi[]>;
    getTransactionLabels(options?: DojoGetTransactionLabelsOptions): Promise<{
        labels: DojoTxLabelApi[];
        total: number;
    }>;
    getPendingTransactions(referenceNumber?: string): Promise<DojoPendingTxApi[]>;
    updateTransactionStatus(params: {
        reference: string;
        status: DojoTransactionStatusApi;
    }): Promise<void>;
    updateOutpointStatus(params: {
        txid: string;
        vout: number;
        spendable: boolean;
    }): Promise<void>;
    processPendingTransactions(onTransactionProcessed?: NinjaTransactionProcessedHandler, onTransactionFailed?: NinjaTransactionFailedHandler): Promise<void>;
    processTransaction(params: DojoProcessTransactionParams): Promise<DojoProcessTransactionResultApi>;
    getTransactionWithOutputs(params: NinjaGetTransactionWithOutputsParams): Promise<NinjaTransactionWithOutputsResultApi>;
    createTransactionWithOutputs(params: NinjaGetTransactionWithOutputsParams): Promise<NinjaTransactionWithOutputsResultApi>;
    processTransactionWithOutputs(params: NinjaGetTransactionWithOutputsParams): Promise<NinjaTransactionWithOutputsResultApi>;
    signAction(params: NinjaSignActionParams): Promise<NinjaSignActionResultApi>;
    abortAction(params: NinjaAbortActionParams): Promise<NinjaAbortActionResultApi>;
    createTransaction(params: NinjaCreateTransactionParams): Promise<DojoCreateTransactionResultApi>;
    submitDirectTransaction(params: NinjaSubmitDirectTransactionParams): Promise<NinjaSubmitDirectTransactionResultApi>;
    deleteCertificate(partial: Partial<DojoCertificateApi>): Promise<number>;
    labelTransaction(txid: string | number | Partial<DojoTransactionApi>, label: string): Promise<void>;
    unlabelTransaction(txid: string | number | Partial<DojoTransactionApi>, label: string): Promise<void>;
    tagOutput(output: {
        txid: string;
        vout: number;
    }, tag: string): Promise<void>;
    untagOutput(output: {
        txid: string;
        vout: number;
    }, tag: string): Promise<void>;
    unbasketOutput(output: {
        txid: string;
        vout: number;
    }): Promise<void>;
    getEnvelopesOfConflictingTransactions(txid: string): Promise<EnvelopeApi[]>;
    getHeight(): Promise<number>;
    getMerkleRootForHeight(height: number): Promise<string | undefined>;
}
Property dojo

The dojo user wallet database supporting this api.

isAuthenticated must be true.

dojo: DojoClientApi
Method abortAction

Abort a transaction with status unsigned previously started by a call to createAction with parameters meant to be completed by a call to signAction.

abortAction(params: NinjaAbortActionParams): Promise<NinjaAbortActionResultApi>
Method authenticate

Authenticates with configured dojo, if necessary.

authenticate(identityKey?: string, addIfNew?: boolean): Promise<void>

Argument Details

  • identityKey
    • Optional. The user's public identity key. Must be authorized to act on behalf of this user.
  • addIfNew
    • Optional. Create new user records if identityKey is unknown.
Method createTransaction

Creates a new transaction that must be processed with processTransaction after you sign it

createTransaction(params: NinjaCreateTransactionParams): Promise<DojoCreateTransactionResultApi>

Returns

The template you need to sign and process

Method createTransactionWithOutputs

This method is equivalent to getTransactionWithOutputs with params.autoProcess false. This function ignores params.autoProcess

Creates and signs a transaction with specified outputs.

It can be processed later with processTransaction.

This is a higher-level wrapper around createTransaction so that you do not need to manually handle signing, when you are not providing any non-Dojo inputs.

Use this by default, and fall back to createTransaction if you need more customization.

createTransactionWithOutputs(params: NinjaGetTransactionWithOutputsParams): Promise<NinjaTransactionWithOutputsResultApi>
Method deleteCertificate

Soft deletes a certificate.

deleteCertificate(partial: Partial<DojoCertificateApi>): Promise<number>

Argument Details

  • partial
    • The partial certificate data identifying the certificate to soft delete.
Method findCertificates

Use this endpoint to retrieve certificates.

findCertificates(certifiers?: string[] | object, types?: Record<string, string[]>): Promise<{
    status: "success";
    certificates: DojoCertificateApi[];
}>

Returns

A success object with status: "success" and any found certificates

Argument Details

  • obj
    • All parameters are given in an object
Method getAvatar

Returns the name and photo URL of the user

getAvatar(): Promise<DojoAvatarApi>

Returns

The avatar of the user

Method getChain

Returns which BSV network we are using (main or test)

getChain(): Promise<Chain>
Method getClientChangeKeyPair

Return the private / public keypair used by the Ninja client for change UTXOs

getClientChangeKeyPair(): KeyPairApi
Method getEnvelopesOfConflictingTransactions

Returns array of Everett Style envelopes for transactions that spend one or more of the inputs to transaction with txid, which must exist in Dojo.

This method supports double spend resolution.

getEnvelopesOfConflictingTransactions(txid: string): Promise<EnvelopeApi[]>

Argument Details

  • txid
    • double hash of raw transaction as hex string
Method getHeight

Returns the current chain height of the network

getHeight(): Promise<number>

Returns

The current chain height

Method getMerkleRootForHeight

A method to verify the validity of a Merkle root for a given block height.

getMerkleRootForHeight(height: number): Promise<string | undefined>

Returns

merkle root for the given height or undefined, if height doesn't have a known merkle root or is invalid.

Method getNetOfAmounts

Returns the net sum of transaction amounts belonging to authenticated user, incoming minus outgoing, and optionally matching conditions in options.

getNetOfAmounts(options?: DojoGetTotalOfAmountsOptions): Promise<number>
Method getNetwork

Returns which BSV network we are using (mainnet or testnet)

getNetwork(format?: "default" | "nonet"): Promise<string>

Returns

The current BSV network formatted as requested.

Argument Details

  • format
    • for the returned string. Either with (default) or without (nonet) a 'net' suffix.
Method getPaymail

Returns the current Paymail handle

getPaymail(): Promise<string>
Method getPendingTransactions

Returns a set of all transactions that need to be signed and submitted, or canceled

getPendingTransactions(referenceNumber?: string): Promise<DojoPendingTxApi[]>
Method getSyncDojosByConfig

Gets the currently configured syncDojos and sync options.

If syncDojos are not being managed by setSyncDojosByConfig the returned configurations may include a 'dojoType' of ''.

getSyncDojosByConfig(): Promise<{
    dojos: SyncDojoConfigBaseApi[];
    options?: DojoSyncOptionsApi;
}>
Method getTotalOfAmounts

Returns the sum of transaction amounts belonging to authenticated user, matching the given direction (which must be specified), and optionally matching remaining conditions in options.

getTotalOfAmounts(options: DojoGetTotalOfAmountsOptions): Promise<{
    total: number;
}>
Method getTotalValue

Returns the total of unspent outputs in satoshis. A non-negative integer.

getTotalValue(basket?: string): Promise<{
    total: number;
}>

Argument Details

  • basket
    • defaults to 'default' if undefined
Method getTransactionLabels

Returns transaction labels matching options and total matching count available.

getTransactionLabels(options?: DojoGetTransactionLabelsOptions): Promise<{
    labels: DojoTxLabelApi[];
    total: number;
}>

Argument Details

  • options
    • limit defaults to 25, offset defaults to 0, order defaults to 'descending'
Method getTransactionOutputs

Returns a set of transaction outputs that Dojo has tracked

getTransactionOutputs(options?: DojoGetTransactionOutputsOptions): Promise<NinjaGetTransactionOutputsResultApi[]>
Method getTransactionWithOutputs

Creates and signs a transaction with specified outputs and (by default) processes it.

By setting params.autoProcess to false, it can be processed later with processTransaction.

If params.autoProcess is true (the default), processTransaction is called automatically and merged results are returned.

This is a higher-level wrapper around createTransaction so that you do not need to manually handle signing, when you are not providing any non-Dojo inputs.

Consider using either createTransactionWithOutputs or processTransactionWithOutputs when params.autoProcess does not need to change at runtime.

Use this by default, and fall back to createTransaction if you need more customization.

getTransactionWithOutputs(params: NinjaGetTransactionWithOutputsParams): Promise<NinjaTransactionWithOutputsResultApi>
Method getTransactions

Returns a set of transactions that match the criteria

getTransactions(options?: DojoGetTransactionsOptions): Promise<NinjaGetTransactionsResultApi>

Argument Details

  • options
    • limit defaults to 25, offset defaults to 0, addLabels defaults to true, order defaults to 'descending'
Method labelTransaction

Labels a transaction

Validates user is authenticated, txid matches an exsiting user transaction, and label value.

Creates new label if necessary.

Adds label to transaction if not already labeled. Note: previously if transaction was already labeled, an error was thrown.

labelTransaction(txid: string | number | Partial<DojoTransactionApi>, label: string): Promise<void>

Argument Details

  • txid
    • unique transaction identifier, either transactionId, txid, or a partial pattern.
  • label
    • the label to be added, will be created if it doesn't already exist
Method processPendingTransactions

Signs and processes all pending transactions, useful when recovering from an error or crash, or on startup. If a transaction fails to process, marks it as failed.

processPendingTransactions(onTransactionProcessed?: NinjaTransactionProcessedHandler, onTransactionFailed?: NinjaTransactionFailedHandler): Promise<void>
Method processTransaction

After a transaction is created (with createTransaction or with getTransactionWithOutputs), submit the serialized raw transaction to transaction processors for processing.

processTransaction(params: DojoProcessTransactionParams): Promise<DojoProcessTransactionResultApi>

Returns

DojoProcessTransactionResultApi with txid and status of 'completed' or 'unknown'

Method processTransactionWithOutputs

This method is equivalent to getTransactionWithOutputs with params.autoProcess true. This function ignores params.autoProcess

Creates and signs a transaction with specified outputs and processes it.

This is a higher-level wrapper around createTransaction and processTransaction so that you do not need to manually handle signing, when you are not providing any non-Dojo inputs. Use this by default, and fall back to createTransaction if you need more customization.

processTransactionWithOutputs(params: NinjaGetTransactionWithOutputsParams): Promise<NinjaTransactionWithOutputsResultApi>
Method saveCertificate

Use this endpoint to store an incoming certificate.

saveCertificate(certificate: DojoCertificateApi | object): Promise<void>

Returns

A success object with status: "success"

Argument Details

  • obj
    • All parameters are given in an object
Method setAvatar

Sets a new name and photo URL

setAvatar(name: string, photoURL: string): Promise<void>

Argument Details

  • name
    • A new name
  • photoURL
    • A new UHRP or HTTPS URL to a photo of the user
Method setPaymail

Changes the Paymail handle of the user.

NOTE that the old handle will be available for others to use.

NOTE that to prevent span, you may only do this if there is at least one unspent output under Dojo management.

setPaymail(paymail: string): Promise<void>
Method setSyncDojosByConfig

Sets the syncDojo's to be used by all users by the sync() function.

Each syncDojo config has the following properties:

'dojoType' one of 'Cloud URL' | 'Sqlite File' | 'MySql Connection' 'dojoIdentityKey' the identity key of the syncDojo. 'dojoName' the name of the syncDojo.

Currently supports three syncDojo configurations, each identified by its dojoType:

'Sqlite File' The derived SyncDojoConfigSqliteFile interface adds: 'filename' will be passed to Knex Sqlite3 to configure a locally accessible, single user Sqlite database. If the database exists, it must already be configured with matching dojoIdentityKey. If the database does not exist and can be created, it will be configured with the specified dojoIdentityKey.

'MySql Connection' The derived SyncDojoConfigMySqlConnection interface adds: 'connection', a stringified MySql connection object, will be passed to Knex MySql to access a network accessible, possibly shared, MySql database. The database must exists and must already be configured with matching dojoIdentityKey.

'Cloud URL' The derived SyncDojoConfigCloudUrl interface adds: 'url' the service URL of the cloud dojo with which to sync 'clientPrivateKey' should be set to the string value 'true' to enable automatic use of Authrite as the authenticated user. 'useIdentityKey' may be set to true instead of using 'clientPrivateKey' if the cloud dojo does not use Authrite for access control. The cloud dojo must exists and must already be configured with matching dojoIdentityKey.

setSyncDojosByConfig(syncDojoConfigs: SyncDojoConfigBaseApi[], options?: DojoSyncOptionsApi): Promise<void>

Argument Details

  • syncDojoConfigs
    • array of syncDojos to be used. May be empty.
  • options
    • place holder for future synchronization control options.

Throws

ERR_BAD_REQUEST if dojo's syncDojos are managed directly, e.g. DojoExpressClient

ERR_BAD_REQUEST if an attempt to set a <custom> sync dojo.

Method signAction

Complete a transaction with status unsigned previously started by a call to createAction with parameters meant to be completed by a call to signAction.

signAction(params: NinjaSignActionParams): Promise<NinjaSignActionResultApi>
Method submitDirectTransaction

This endpoint allows a recipient to submit a transactions that was directly given to them by a sender. Saves the inputs and key derivation information, allowing the UTXOs to be redeemed in the future. Sets the transaction to completed and marks the outputs as spendable.

submitDirectTransaction(params: NinjaSubmitDirectTransactionParams): Promise<NinjaSubmitDirectTransactionResultApi>
Method sync

Sync's the dojo's state for the authenticated user with all of the configured syncDojos

This method should only be called when either a local or remote state change occurs, or may have occurred.

User state changes are propagated across all configured syncDojos.

sync(): Promise<void>
Method tagOutput

Tags an output

Validates user is authenticated, partial identifies a single output, and tag value.

Creates new tag if necessary.

Adds tag to output if not already tagged.

tagOutput(output: {
    txid: string;
    vout: number;
}, tag: string): Promise<void>

Argument Details

  • partial
    • unique output identifier as a partial pattern.
  • tag
    • the tag to add, will be created if it doesn't already exist
Method unbasketOutput

Removes the uniquely identified output's basket assignment.

The output will no longer belong to any basket.

This is typically only useful for outputs that are no longer usefull.

unbasketOutput(output: {
    txid: string;
    vout: number;
}): Promise<void>
Method unlabelTransaction

Removes a label from a transaction

Validates user is authenticated, txid matches an exsiting user transaction, and label already exits.

Does nothing if transaction is not labeled.

unlabelTransaction(txid: string | number | Partial<DojoTransactionApi>, label: string): Promise<void>

Argument Details

  • txid
    • unique transaction identifier, either transactionId, txid, or a partial pattern.
  • label
    • the label to be removed
Method untagOutput

Removes a tag from an output

Validates user is authenticated, partial identifies a single output, and tag already exits.

Does nothing if output is not tagged.

untagOutput(output: {
    txid: string;
    vout: number;
}, tag: string): Promise<void>

Argument Details

  • partial
    • unique output identifier as a partial pattern.
  • tag
    • the tag to be removed from the output
Method updateOutpointStatus

Use this endpoint to update the status of one of your outputs, given as the TXID of a transaction and the vout (output index) in that transaction. This is useful for flagging transaction outpoints as spent if they were inadvertantly broadcasted or used without properly submitting them to the Dojo, or to undo the spending of an output if it was never actually spent.

updateOutpointStatus(params: {
    txid: string;
    vout: number;
    spendable: boolean;
}): Promise<void>

Argument Details

  • params.txid
    • The TXID of the transaction that created the output
  • params.vout
    • The index of the output in the transaction
  • params.spendable
    • The true spendability status of this outpoint
Method updateTransactionStatus

Use this endpoint to update the status of a transaction. This is useful for flagging incomplete transactions as aborted or reverting a completed transaction back into a pending status if it never got confirmed. Setting the status to "completed" or "unproven" will make any input UTXOs unavailable for spending, while any other status value will free up the UTXOs for use in other transactions.

updateTransactionStatus(params: {
    reference: string;
    status: DojoTransactionStatusApi;
}): Promise<void>

Argument Details

  • params.reference
    • The Dojo reference number for the transaction
  • params.status
    • The new status of the transaction

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: NinjaCreateTransactionParams

Input parameters to createTransaction method.

export interface NinjaCreateTransactionParams {
    inputs: Record<string, DojoTxInputsApi>;
    inputSelection?: DojoTxInputSelectionApi;
    outputs: DojoCreateTxOutputApi[];
    outputGeneration?: DojoOutputGenerationApi;
    fee?: DojoFeeModelApi;
    labels: string[];
    note?: string;
    recipient?: string;
}
Property fee

When the fee model is "sat/kb", this is the number of satoshis per kilobyte of block space that the transaction will pay.

fee?: DojoFeeModelApi
Property inputSelection

If Dojo needs to select more inputs beyond what you provided in the inputs parameter, this parameter describes which kinds of inputs can be selected, and from where.

inputSelection?: DojoTxInputSelectionApi
Property inputs

Specify any additional inputs to the transaction (if any) that are not to be provided by the Dojo. If you do not provide inputs here, or if they are insufficient, Dojo will select additional inputs for you to sign. To control this input selection behavior, see the inputSelection parameter. This inputs parameter is an object whose keys are TXIDs of input transactions, and whose values are their associated SPV envelopes.

inputs: Record<string, DojoTxInputsApi>
Property labels

The labels to affix to this transaction

labels: string[]
Property note

A numan-readable note describing the transaction

note?: string
Property outputGeneration

If Dojo needs to generate additional outputs for the transaction beyond what was specified, this object describes what kind of outputs to generate, and where they should be kept.

The method used to generate outputs. "auto" selects the amount and types of generated outputs based on the selected basket's configuration for how many of each type to keep on hand, then uses Benford's law to distribute the satoshis across them. "single" just uses one output, randomly selected from the available types, that contains all the satoshis.

outputGeneration?: DojoOutputGenerationApi
Property outputs

External outputs that you will include when you create this transaction. These outputs can contain custom scripts as specified by recipients. If the inputs to the transaction go beyond what is needed to fund these outputs (plus the transaction fee), additional Dojo-managed UTXOs will be generated to collect the remainder (see the outputGeneration parameter for more on this).

outputs: DojoCreateTxOutputApi[]
Property recipient

The Paymail handle for the recipient of the transaction

recipient?: string

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: NinjaTransactionFailedApi

export interface NinjaTransactionFailedApi {
    inputs: Record<string, DojoPendingTxInputApi>;
    isOutgoing: boolean;
    reference: string;
    error: CwiError;
}

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: NinjaTransactionProcessedApi

export interface NinjaTransactionProcessedApi {
    inputs: Record<string, DojoPendingTxInputApi>;
    outputs: DojoPendingTxOutputApi[];
    isOutgoing: boolean;
    reference: string;
    txid: string;
    amount: number;
    hex: string;
    derivationPrefix?: string;
    senderIdentityKey?: string;
}

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: NinjaOutputToRedeemApi

export interface NinjaOutputToRedeemApi {
    index: number;
    unlockingScript: string | number;
    spendingDescription?: string;
    sequenceNumber?: number;
}
Property index

Zero based output index within its transaction to spend.

index: number
Property sequenceNumber

Sequence number to use when spending

sequenceNumber?: number
Property unlockingScript

Hex scriptcode that unlocks the satoshis or the maximum script length (in bytes) if using signAction.

When supplying a signed unlock script, it should use SIGHASH_NONE | ANYONECANPAY (or similar) so additional Dojo outputs can added if necessary without invalidating the signature.

unlockingScript: string | number

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: NinjaTxInputsApi

export interface NinjaTxInputsApi extends EnvelopeEvidenceApi {
    outputsToRedeem: NinjaOutputToRedeemApi[];
}

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: KeyPairApi

export interface KeyPairApi {
    privateKey: string;
    publicKey: string;
}

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: NinjaGetTransactionsTxApi

export interface NinjaGetTransactionsTxApi extends ListActionsTransaction {
    txid: string;
    amount: number;
    status: TransactionStatusApi;
    senderPaymail: string;
    recipientPaymail: string;
    isOutgoing: boolean;
    note: string;
    created_at: string;
    referenceNumber: string;
    labels: string[];
    inputs?: NinjaGetTransactionsTxInputApi[];
    outputs?: NinjaGetTransactionsTxOutputApi[];
}
Property amount

The number of satoshis added or removed from Dojo by this transaction

amount: number
Property created_at

The time the transaction was registered with the Dojo

created_at: string
Property isOutgoing

Whether or not the transaction was created with createTransaction

isOutgoing: boolean
Property labels

A set of all the labels affixed to the transaction

labels: string[]
Property note

The human-readable tag for the transaction, provided by the person who initiated it

note: string
Property recipientPaymail

The Paymail handle of the person who received the transaction

recipientPaymail: string
Property referenceNumber

The Dojo reference number for the transaction

referenceNumber: string
Property senderPaymail

The Paymail handle of the person who sent the transaction

senderPaymail: string
Property status

The current state of the transaction. Common statuses are completed and unproven.

status: TransactionStatusApi
Property txid

The transaction ID

txid: string

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: NinjaGetTransactionsTxInputApi

export interface NinjaGetTransactionsTxInputApi extends ListActionsTransactionInput {
    txid: string;
    vout: number;
    amount: number;
    outputScript: string;
    type: string;
    spendable: boolean;
    spendingDescription?: string;
    basket?: string;
    tags?: string[];
}
Property amount

Number of satoshis in the output

amount: number
Property basket

Optionally included basket assignment.

basket?: string
Property outputScript

Hex representation of output locking script

outputScript: string
Property spendable

Whether this output is free to be spent

spendable: boolean
Property spendingDescription

Spending description for this transaction input

spendingDescription?: string
Property tags

Optionally included tag assignments.

tags?: string[]
Property txid

Transaction ID of transaction that created the output

txid: string
Property type

The type of output, for example "P2PKH" or "P2RPH"

type: string
Property vout

Index in the transaction of the output

vout: number

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: NinjaGetTransactionsTxOutputApi

export interface NinjaGetTransactionsTxOutputApi extends ListActionsTransactionOutput {
    txid: string;
    vout: number;
    amount: number;
    outputScript: string;
    type: string;
    spendable: boolean;
    description?: string;
    basket?: string;
    tags?: string[];
}
Property amount

Number of satoshis in the output

amount: number
Property basket

Optionally included basket assignment.

basket?: string
Property description

Output description

description?: string
Property outputScript

Hex representation of output locking script

outputScript: string
Property spendable

Whether this output is free to be spent

spendable: boolean
Property tags

Optionally included tag assignments.

tags?: string[]
Property txid

Transaction ID of transaction that created the output

txid: string
Property type

The type of output, for example "P2PKH" or "P2RPH"

type: string
Property vout

Index in the transaction of the output

vout: number

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: NinjaGetTransactionsResultApi

export interface NinjaGetTransactionsResultApi {
    totalTransactions: number;
    transactions: NinjaGetTransactionsTxApi[];
}
Property totalTransactions

The number of transactions in the complete set

totalTransactions: number
Property transactions

The specific transactions from the set that were requested, based on limit and offset

transactions: NinjaGetTransactionsTxApi[]

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: NinjaTransactionWithOutputsResultApi

export interface NinjaTransactionWithOutputsResultApi {
    signActionRequired?: boolean;
    createResult?: DojoCreateTransactionResultApi;
    rawTx?: string;
    txid?: string;
    amount: number;
    inputs: Record<string, EnvelopeEvidenceApi>;
    note?: string;
    referenceNumber: string;
    outputMap?: Record<string, number>;
    mapiResponses?: MapiResponseApi[];
    log?: string;
}
Property amount

The amount of the transaction

amount: number
Property createResult

if signActionRequired, the dojo createTransaction results to be forwarded to signAction

createResult?: DojoCreateTransactionResultApi
Property inputs

This is the fully-formed inputs field of this transaction, as per the SPV Envelope specification.

inputs: Record<string, EnvelopeEvidenceApi>
Property log

Optional transaction processing history

log?: string
Property mapiResponses

If processed, array of acceptance responses from mapi transaction processors.

Only valid if signActionRequired !== true

mapiResponses?: MapiResponseApi[]
Property outputMap

Map of change output derivationSuffix values to transaction vout indices

Only valid if signActionRequired !== true

outputMap?: Record<string, number>
Property rawTx

The serialized, signed transaction that is ready for broadcast, or has been broadcast.

Only valid if signActionRequired !== true

rawTx?: string
Property referenceNumber

The reference number that should now be provided back to processTransaction (or updateTransactionStatus`)

referenceNumber: string
Property signActionRequired

true if at least one input's outputsToRedeem uses numeric max script byte length for unlockingScript

If true, in-process transaction will have status unsigned. An unsigned transaction must be completed by signing all remaining unsigned inputs and calling signAction. Failure to complete the process in a timely manner will cause the transaction to transition to failed.

If false or undefined, completed transaction will have status of sending or unproven, depending on acceptDelayedBroadcast being true or false.

signActionRequired?: boolean
Property txid

rawTx hash as hex string

Only valid if signActionRequired !== true

txid?: string

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: NinjaGetPendingTransactionsInstructionsApi

export interface NinjaGetPendingTransactionsInstructionsApi {
    type: string;
    derivationPrefix: string | null;
    derivationSuffix: string | null;
    paymailHandle: string | null;
    senderIdentityKey: string | null;
    customInstructions: string | null;
}
Property customInstructions

max length of 2500

customInstructions: string | null
Property derivationPrefix

max length of 32 base64 encoded

derivationPrefix: string | null
Property derivationSuffix

max length of 32 base64 encoded

derivationSuffix: string | null
Property paymailHandle

max length of 64

paymailHandle: string | null
Property senderIdentityKey

max length of 130 hex encoded

senderIdentityKey: string | null
Property type

max length of 50 e.g. P2PKH, custom

type: string

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: NinjaGetPendingTransactionsInputApi

export interface NinjaGetPendingTransactionsInputApi extends EnvelopeEvidenceApi {
    outputsToRedeem: number[];
    instructions: Record<number, NinjaGetPendingTransactionsInstructionsApi>;
}

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: NinjaGetPendingTransactionsTxApi

export interface NinjaGetPendingTransactionsTxApi {
    transactionId: number;
    created_at: string;
    provenTxId?: number | null;
    status: DojoTransactionStatusApi;
    isOutgoing: boolean;
    amount: number;
    senderPaymail: string | undefined | null;
    referenceNumber: string;
    truncatedExternalInputs: string | null;
    rawTransaction: Buffer | null;
    inputs?: Record<string, NinjaGetPendingTransactionsInputApi>;
}
Property amount

The number of satoshis added or removed from Dojo by this transaction

amount: number
Property created_at

The time the transaction was registered with the Dojo

created_at: string
Property inputs

parsed truncatedExternalInputs

inputs?: Record<string, NinjaGetPendingTransactionsInputApi>
Property provenTxId

Is valid when transaction proof record exists in DojoProvenTxApi table.

provenTxId?: number | null
Property referenceNumber

The Dojo reference number for the transaction

referenceNumber: string
Property senderPaymail

The Paymail handle of the person who sent the transaction

senderPaymail: string | undefined | null
Property status

max length of 64 e.g. unprocessed, unsigned

status: DojoTransactionStatusApi

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: TxRedeemableOutputApi

export interface TxRedeemableOutputApi {
    index: number;
    unlockingScriptLength: number;
}
Property index

The index of the output to redeem in the transaction

index: number
Property unlockingScriptLength

The byte length of the unlocking script you intend to use to unlock this output

unlockingScriptLength: number

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: TxOutputApi

export interface TxOutputApi {
    satoshis: number;
    script: string;
}
Property satoshis

The amount of satoshis that will be in the output

satoshis: number
Property script

The hex string representing the output locking script

script: string

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: NinjaGetTransactionOutputsResultApi

export interface NinjaGetTransactionOutputsResultApi extends GetTransactionOutputResult {
    txid: string;
    vout: number;
    amount: number;
    outputScript: string;
    type: string;
    spendable: boolean;
    envelope?: EnvelopeApi;
    customInstructions?: string;
    basket?: string;
    tags?: string[];
}
Property amount

Number of satoshis in the output

amount: number
Property basket

If includeBasket option is true, name of basket to which this output belongs.

basket?: string
Property customInstructions

When envelope requested, any custom instructions associated with this output.

customInstructions?: string
Property envelope

When requested and available, output validity support envelope.

envelope?: EnvelopeApi
Property outputScript

Hex representation of output locking script

outputScript: string
Property spendable

Whether this output is free to be spent

spendable: boolean
Property tags

If includeTags option is true, tags assigned to this output.

tags?: string[]
Property txid

Transaction ID of transaction that created the output

txid: string
Property type

The type of output, for example "P2PKH" or "P2RPH"

type: string
Property vout

Index in the transaction of the output

vout: number

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: NinjaSubmitDirectTransactionOutputApi

export interface NinjaSubmitDirectTransactionOutputApi extends SubmitDirectTransactionOutput {
    vout: number;
    satoshis: number;
    basket?: string;
    derivationPrefix?: string;
    derivationSuffix?: string;
    customInstructions?: string;
    senderIdentityKey?: string;
    tags?: string[];
}

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: NinjaSubmitDirectTransactionApi

Transaction input parameter to submitDirectTransaction method.

export interface NinjaSubmitDirectTransactionApi extends SubmitDirectTransaction {
    rawTx: string;
    txid?: string;
    inputs?: Record<string, EnvelopeEvidenceApi>;
    mapiResponses?: MapiResponseApi[];
    proof?: TscMerkleProofApi;
    outputs: NinjaSubmitDirectTransactionOutputApi[];
    referenceNumber?: string;
}
Property outputs

sparse array of outputs of interest where indices match vout numbers.

outputs: NinjaSubmitDirectTransactionOutputApi[]

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: NinjaSubmitDirectTransactionParams

Input parameters to submitDirectTransaction method.

export interface NinjaSubmitDirectTransactionParams {
    protocol?: string;
    transaction: NinjaSubmitDirectTransactionApi;
    senderIdentityKey: string;
    note: string;
    labels?: string[];
    derivationPrefix?: string;
    amount?: number;
}
Property derivationPrefix

A derivation prefix used for all outputs. If provided, derivation prefixes on all outputs are optional.

derivationPrefix?: string
Property labels

Labels to assign to transaction.

labels?: string[]
Property note

Human-readable description for the transaction

note: string
Property protocol

Specify the transaction submission payment protocol to use. Currently, the only supported protocol is that with BRFC ID "3241645161d8"

protocol?: string
Property senderIdentityKey

Provide the identity key for the person who sent the transaction

senderIdentityKey: string
Property transaction

The transaction envelope to submit, including key derivation information.

transaction.outputs is an array of outputs, each containing: vout, satoshis, derivationSuffix, and (optionally), derivationPrefix.

If a global derivationPrefix is used (recommended), output-specific derivation prefixes should be omitted.

transaction: NinjaSubmitDirectTransactionApi

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: NinjaSubmitDirectTransactionResultApi

export interface NinjaSubmitDirectTransactionResultApi extends SubmitDirectTransactionResult {
    transactionId: number;
    referenceNumber: string;
}

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: NinjaSignCreatedTransactionParams

export interface NinjaSignCreatedTransactionParams {
    inputs: Record<string, NinjaTxInputsApi>;
    createResult: DojoCreateTransactionResultApi;
}
Property inputs

Input scripts to spend as part of this transaction.

This is an object whose keys are TXIDs and whose values are Everett-style transaction envelopes that contain an additional field called outputsToRedeem.

This is an array of objects, each containing index and unlockingScript properties.

The index property is the output number in the transaction you are spending, and unlockingScript is the hex scriptcode that unlocks the satoshis.

Note that you should create any signatures with SIGHASH_NONE | ANYONECANPAY or similar so that the additional Dojo outputs can be added afterward without invalidating your signature.

inputs: Record<string, NinjaTxInputsApi>

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: NinjaGetTransactionWithOutputsParams

Input parameters to getTransactionWithOutputs method.

export interface NinjaGetTransactionWithOutputsParams {
    outputs: DojoCreateTxOutputApi[];
    labels?: string[];
    inputs?: Record<string, NinjaTxInputsApi>;
    note?: string;
    lockTime?: number;
    version?: number;
    recipient?: string;
    autoProcess?: boolean;
    feePerKb?: number;
    feeModel?: DojoFeeModelApi;
    acceptDelayedBroadcast?: boolean;
    log?: string;
}
Property acceptDelayedBroadcast

Set to true for normal, high performance operation and offline operation if running locally.

Always validates submittedTransaction and remaining inputs.

If true, creates a self-signed MapiResponse for the transaction and queues it for repeated broadcast attempts and proof validation. The status of the transaction will be set to unproven.

If not true, attempts one broadcast and fails the transaction if it is not accepted by at least one external transaction processor. If it is accepted, status is set to `unproven'. The transaction may still fail at a later time if a merkle proof is not confirmed.

The transaction status will be set to completed or failed depending on the success or failure of broadcast attempts and Chaintracks validation of a merkle proof.

When status is set to unproven or completed:

  • Inputs are confirmed to be spendable false, spentBy this transaction.
  • Outputs are set to spendable true unless already spent (spentBy is non-null).

If the transaction fails, status is set to failed:

  • Inputs are returned to spendable true, spentBy null
  • Outputs are set to spendable false
  • If spentBy is non-null, failure propagates to that transaction.
acceptDelayedBroadcast?: boolean
Property autoProcess

Whether the transaction should be processed automatically with processTransaction. Note that this will return mapiResponses and note instead of referenceNumber

default true

autoProcess?: boolean
Property feeModel

Optional. The fee model used by this transaction.

If both feeModel and feePerKb are specified, feeModel takes precendence

feeModel?: DojoFeeModelApi
Property feePerKb

Optional. The number of satoshis to pay per KB of block space used by this transaction.

If both feeModel and feePerKb are specified, feeModel takes precendence

feePerKb?: number
Property inputs

Input scripts to spend as part of this transaction.

This is an object whose keys are TXIDs and whose values are Everett-style transaction envelopes that contain an additional field called outputsToRedeem.

This is an array of objects, each containing index and unlockingScript properties.

The index property is the output number in the transaction you are spending, and unlockingScript is the hex scriptcode that unlocks the satoshis or the maximum script length for signActionRequired.

Note that you should create any signatures with SIGHASH_NONE | ANYONECANPAY or similar so that the additional Dojo outputs can be added afterward without invalidating your signature.

inputs?: Record<string, NinjaTxInputsApi>
Property labels

A set of label strings to affix to the transaction

labels?: string[]
Property lockTime

Optional. Default is zero. When the transaction can be processed into a block:

= 500,000,000 values are interpreted as minimum required unix time stamps in seconds < 500,000,000 values are interpreted as minimum required block height

lockTime?: number
Property log

Optional transaction processing log

log?: string
Property note

A note about the transaction

note?: string
Property outputs

A set of outputs to include, each with script and satoshis.

outputs: DojoCreateTxOutputApi[]
Property recipient

Paymail recipient for transaction

recipient?: string
Property version

Optional. Transaction version number, default is current standard transaction version value.

version?: number

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: NinjaCompleteCreateTransactionWithOutputsParams

export interface NinjaCompleteCreateTransactionWithOutputsParams {
    inputs?: Record<string, NinjaTxInputsApi>;
    note?: string;
    createResult: DojoCreateTransactionResultApi;
}
Property inputs

Input scripts to spend as part of this transaction.

This is an object whose keys are TXIDs and whose values are Everett-style transaction envelopes that contain an additional field called outputsToRedeem.

This is an array of objects, each containing index and unlockingScript properties.

The index property is the output number in the transaction you are spending, and unlockingScript is the hex scriptcode that unlocks the satoshis.

Note that you should create any signatures with SIGHASH_NONE | ANYONECANPAY or similar so that the additional Dojo outputs can be added afterward without invalidating your signature.

inputs?: Record<string, NinjaTxInputsApi>

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: NinjaSignActionParams

export interface NinjaSignActionParams extends NinjaSignCreatedTransactionParams {
    inputs: Record<string, NinjaTxInputsApi>;
    createResult: DojoCreateTransactionResultApi;
    acceptDelayedBroadcast?: boolean;
}
Property acceptDelayedBroadcast

Must match original value passed to createAction.

acceptDelayedBroadcast?: boolean
Property createResult

The dojo createTransaction results returned from createAction.

createResult: DojoCreateTransactionResultApi
Property inputs

Input scripts to spend as part of this transaction.

This is an object whose keys are TXIDs and whose values are Everett-style transaction envelopes that contain an additional field called outputsToRedeem.

This is an array of objects, each containing index and unlockingScript properties.

The index property is the output number in the transaction you are spending, and unlockingScript is the hex scriptcode that unlocks the satoshis.

Note that you should create any signatures with SIGHASH_NONE | ANYONECANPAY or similar so that the additional Dojo outputs can be added afterward without invalidating your signature.

inputs: Record<string, NinjaTxInputsApi>

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: NinjaSignActionResultApi

export interface NinjaSignActionResultApi extends NinjaTransactionWithOutputsResultApi {
    rawTx?: string;
    txid?: string;
    amount: number;
    inputs: Record<string, EnvelopeEvidenceApi>;
    note?: string;
    referenceNumber: string;
    outputMap?: Record<string, number>;
    mapiResponses?: MapiResponseApi[];
    log?: string;
}
Property amount

The amount of the transaction

amount: number
Property inputs

This is the fully-formed inputs field of this transaction, as per the SPV Envelope specification.

inputs: Record<string, EnvelopeEvidenceApi>
Property log

Optional transaction processing history

log?: string
Property mapiResponses

If processed, array of acceptance responses from mapi transaction processors.

Only valid if signActionRequired !== true

mapiResponses?: MapiResponseApi[]
Property outputMap

Map of change output derivationSuffix values to transaction vout indices

Only valid if signActionRequired !== true

outputMap?: Record<string, number>
Property rawTx

The serialized, signed transaction that is ready for broadcast, or has been broadcast.

Only valid if signActionRequired !== true

rawTx?: string
Property referenceNumber

The reference number that should now be provided back to processTransaction (or updateTransactionStatus`)

referenceNumber: string
Property txid

rawTx hash as hex string

Only valid if signActionRequired !== true

txid?: string

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: NinjaAbortActionParams

export interface NinjaAbortActionParams {
    referenceNumber: string;
    log: string | undefined;
}
Property log

Optional operational and performance logging prior data.

log: string | undefined
Property referenceNumber

unique transaction identifier previously returned by createAction when at least one unlockingScript was specified by max script byte length.

The status of the transaction identified by referenceNumber must be unsigned.

referenceNumber: string

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: NinjaAbortActionResultApi

export interface NinjaAbortActionResultApi {
    referenceNumber: string;
    log: string | undefined;
}
Property log

operational and performance logging if enabled.

log: string | undefined
Property referenceNumber

The unique transaction identifier that was processed.

referenceNumber: string

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: CwiCoreApi

Starting point for cwi-core's typescript api.

Supports design and testing.

export interface CwiCoreApi {
    createAction(params: CreateActionParams): Promise<CreateActionResult>;
}

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: CreateActionParams

export interface CreateActionParams {
    description: string;
    inputs: Record<string, NinjaTxInputsApi>;
    outputs: DojoCreateTxOutputApi[];
    lockTime?: number;
    version?: number;
    labels?: string[];
    originator?: string;
    acceptDelayedBroadcast?: boolean;
    log?: string;
}
Property acceptDelayedBroadcast

true if local validation and self-signed mapi response is sufficient. Upon return, transaction will have sending status. Watchman will proceed to send the transaction asynchronously.

false if a valid mapi response from the bitcoin transaction processing network is required. Upon return, transaction will have unproven status. Watchman will proceed to prove transaction.

default true

acceptDelayedBroadcast?: boolean
Property description

Human readable string giving the purpose of this transaction. Value will be encrypted prior to leaving this device. Encrypted length limit is 500 characters.

description: string
Property inputs

each input's outputsToRedeem:

  • satoshis must be greater than zero, must match output's value.
  • spendingDescription length limit is 50, values are encrypted before leaving this device
  • unlockingScript is max byte length for signActionRequired mode, otherwise hex string.
inputs: Record<string, NinjaTxInputsApi>
Property labels

transaction labels to apply to this transaction default []

labels?: string[]
Property lockTime

Optional. Default is zero. When the transaction can be processed into a block:

= 500,000,000 values are interpreted as minimum required unix time stamps in seconds < 500,000,000 values are interpreted as minimum required block height

lockTime?: number
Property log

Optional operational and performance logging prior data.

log?: string
Property originator

Reserved Admin originators 'projectbabbage.com' 'staging-satoshiframe.babbage.systems' 'satoshiframe.babbage.systems'

originator?: string
Property outputs

each output:

  • description length limit is 50, values are encrypted before leaving this device
outputs: DojoCreateTxOutputApi[]
Property version

Optional. Transaction version number, default is current standard transaction version value.

version?: number

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: CreateActionResult

export interface CreateActionResult {
    signActionRequired?: boolean;
    createResult?: DojoCreateTransactionResultApi;
    txid?: string;
    rawTx?: string;
    inputs: Record<string, EnvelopeEvidenceApi>;
    mapiResponses?: MapiResponseApi[];
    log?: string;
}
Property createResult

if signActionRequired, the dojo createTransaction results to be forwarded to signAction

createResult?: DojoCreateTransactionResultApi
Property inputs

This is the fully-formed inputs field of this transaction, as per the SPV Envelope specification.

inputs: Record<string, EnvelopeEvidenceApi>
Property log

operational and performance logging if enabled.

log?: string
Property mapiResponses

If not signActionRequired, at least one valid mapi response. may be a self-signed response if acceptDelayedBroadcast is true.

If signActionRequired, empty array.

mapiResponses?: MapiResponseApi[]
Property rawTx

if not signActionRequired, fully signed transaction as LE hex string

if signActionRequired:

  • All length specified unlocking scripts are zero bytes
  • All SABPPP template unlocking scripts have zero byte signatures
  • All custom provided unlocking scripts fully copied.
rawTx?: string
Property signActionRequired

true if at least one input's outputsToRedeem uses numeric max script byte length for unlockingScript

If true, in-process transaction will have status unsigned. An unsigned transaction must be completed by signing all remaining unsigned inputs and calling signAction. Failure to complete the process in a timely manner will cause the transaction to transition to failed.

If false or undefined, completed transaction will have status of sending or unproven, depending on acceptDelayedBroadcast being true or false.

signActionRequired?: boolean
Property txid

if not signActionRequired, signed transaction hash (double SHA256 BE hex string)

txid?: string

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: SignActionParams

export interface SignActionParams {
    inputs: Record<string, NinjaTxInputsApi>;
    createResult?: NinjaTransactionWithOutputsResultApi;
    originator?: string;
    acceptDelayedBroadcast?: boolean;
    log?: string;
}
Property acceptDelayedBroadcast

true if local validation and self-signed mapi response is sufficient. Upon return, transaction will have sending status. Watchman will proceed to send the transaction asynchronously.

false if a valid mapi response from the bitcoin transaction processing network is required. Upon return, transaction will have unproven status. Watchman will proceed to prove transaction.

Must match CreateActionParams value.

default true

acceptDelayedBroadcast?: boolean
Property createResult

the dojo createTransaction results returned from createAction to be forwarded to signAction

createResult?: NinjaTransactionWithOutputsResultApi
Property inputs

each input's outputsToRedeem:

  • satoshis must be greater than zero, must match output's value.
  • spendingDescription length limit is 50, values are encrypted before leaving this device
  • unlockingScript must all be hex string.

Must match CreateActionParams with the exception of fully resolved unlockingScript values.

inputs: Record<string, NinjaTxInputsApi>
Property log

Optional operational and performance logging prior data.

log?: string
Property originator

Reserved Admin originators 'projectbabbage.com' 'staging-satoshiframe.babbage.systems' 'satoshiframe.babbage.systems'

originator?: string

Links: API, Interfaces, Classes, Functions, Types, Variables


Interface: ProcessIncomingTransactionInputApi

export interface Pro