Skip to content

API

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

Interfaces

AbortActionArgs ListCertificatesArgs ValidInternalizeOutput
AbortActionResult ListCertificatesResult ValidListActionsArgs
AcquireCertificateArgs ListOutputsArgs ValidListCertificatesArgs
AuthenticatedResult ListOutputsResult ValidListOutputsArgs
BasketInsertion OutPoint ValidProcessActionArgs
CertificateResult ProveCertificateArgs ValidProcessActionOptions
CreateActionArgs ProveCertificateResult ValidProveCertificateArgs
CreateActionInput RelinquishCertificateArgs ValidRelinquishCertificateArgs
CreateActionOptions RelinquishCertificateResult ValidRelinquishOutputArgs
CreateActionOutput RelinquishOutputArgs ValidSignActionArgs
CreateActionResult RelinquishOutputResult ValidSignActionOptions
CreateHmacArgs RevealCounterpartyKeyLinkageArgs ValidWalletPayment
CreateHmacResult RevealCounterpartyKeyLinkageResult ValidWalletSignerArgs
CreateSignatureArgs RevealSpecificKeyLinkageArgs VerifyHmacArgs
CreateSignatureResult RevealSpecificKeyLinkageResult VerifyHmacResult
DiscoverByAttributesArgs ReviewActionResult VerifySignatureArgs
DiscoverByIdentityKeyArgs SendWithResult VerifySignatureResult
DiscoverCertificatesResult SignActionArgs WalletAction
GetHeaderArgs SignActionOptions WalletActionInput
GetHeaderResult SignActionResult WalletActionOutput
GetHeightResult SignActionSpend WalletCertificate
GetNetworkResult SignableTransaction WalletDecryptArgs
GetPublicKeyArgs ValidAbortActionArgs WalletDecryptResult
GetPublicKeyResult ValidAcquireCertificateArgs WalletEncryptArgs
GetVersionResult ValidAcquireDirectCertificateArgs WalletEncryptResult
IdentityCertificate ValidAcquireIssuanceCertificateArgs WalletEncryptionArgs
IdentityCertifier ValidBasketInsertion WalletErrorObject
InternalizeActionArgs ValidCreateActionArgs WalletInterface
InternalizeActionResult ValidCreateActionInput WalletLoggerInterface
InternalizeOutput ValidCreateActionOptions WalletLoggerLog
KeyDeriverApi ValidCreateActionOutput WalletOutput
KeyLinkageResult ValidDiscoverByAttributesArgs WalletPayment
ListActionsArgs ValidDiscoverByIdentityKeyArgs WalletWire
ListActionsResult ValidInternalizeActionArgs

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


Interface: AbortActionArgs

export interface AbortActionArgs {
    reference: Base64String;
}

See also: Base64String

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


Interface: AbortActionResult

export interface AbortActionResult {
    aborted: true;
}

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


Interface: AcquireCertificateArgs

export interface AcquireCertificateArgs {
    type: Base64String;
    certifier: PubKeyHex;
    acquisitionProtocol: AcquisitionProtocol;
    fields: Record<CertificateFieldNameUnder50Bytes, string>;
    serialNumber?: Base64String;
    revocationOutpoint?: OutpointString;
    signature?: HexString;
    certifierUrl?: string;
    keyringRevealer?: KeyringRevealer;
    keyringForSubject?: Record<CertificateFieldNameUnder50Bytes, Base64String>;
    privileged?: BooleanDefaultFalse;
    privilegedReason?: DescriptionString5to50Bytes;
}

See also: AcquisitionProtocol, Base64String, BooleanDefaultFalse, CertificateFieldNameUnder50Bytes, DescriptionString5to50Bytes, HexString, KeyringRevealer, OutpointString, PubKeyHex

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


Interface: AuthenticatedResult

export interface AuthenticatedResult {
    authenticated: true;
}

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


Interface: BasketInsertion

export interface BasketInsertion {
    basket: BasketStringUnder300Bytes;
    customInstructions?: string;
    tags?: OutputTagStringUnder300Bytes[];
}

See also: BasketStringUnder300Bytes, OutputTagStringUnder300Bytes

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


Interface: CertificateResult

export interface CertificateResult extends WalletCertificate {
    keyring?: Record<CertificateFieldNameUnder50Bytes, Base64String>;
    verifier?: string;
}

See also: Base64String, CertificateFieldNameUnder50Bytes, WalletCertificate

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


Interface: CreateActionArgs

export interface CreateActionArgs {
    description: DescriptionString5to50Bytes;
    inputBEEF?: BEEF;
    inputs?: CreateActionInput[];
    outputs?: CreateActionOutput[];
    lockTime?: PositiveIntegerOrZero;
    version?: PositiveIntegerOrZero;
    labels?: LabelStringUnder300Bytes[];
    options?: CreateActionOptions;
}

See also: BEEF, CreateActionInput, CreateActionOptions, CreateActionOutput, DescriptionString5to50Bytes, LabelStringUnder300Bytes, PositiveIntegerOrZero

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


Interface: CreateActionInput

export interface CreateActionInput {
    outpoint: OutpointString;
    inputDescription: DescriptionString5to50Bytes;
    unlockingScript?: HexString;
    unlockingScriptLength?: PositiveInteger;
    sequenceNumber?: PositiveIntegerOrZero;
}

See also: DescriptionString5to50Bytes, HexString, OutpointString, PositiveInteger, PositiveIntegerOrZero

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


Interface: CreateActionOptions

export interface CreateActionOptions {
    signAndProcess?: BooleanDefaultTrue;
    acceptDelayedBroadcast?: BooleanDefaultTrue;
    trustSelf?: TrustSelf;
    knownTxids?: TXIDHexString[];
    returnTXIDOnly?: BooleanDefaultFalse;
    noSend?: BooleanDefaultFalse;
    noSendChange?: OutpointString[];
    sendWith?: TXIDHexString[];
    randomizeOutputs?: BooleanDefaultTrue;
}

See also: BooleanDefaultFalse, BooleanDefaultTrue, OutpointString, TXIDHexString, TrustSelf

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


Interface: CreateActionOutput

export interface CreateActionOutput {
    lockingScript: HexString;
    satoshis: SatoshiValue;
    outputDescription: DescriptionString5to50Bytes;
    basket?: BasketStringUnder300Bytes;
    customInstructions?: string;
    tags?: OutputTagStringUnder300Bytes[];
}

See also: BasketStringUnder300Bytes, DescriptionString5to50Bytes, HexString, OutputTagStringUnder300Bytes, SatoshiValue

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


Interface: CreateActionResult

export interface CreateActionResult {
    txid?: TXIDHexString;
    tx?: AtomicBEEF;
    noSendChange?: OutpointString[];
    sendWithResults?: SendWithResult[];
    signableTransaction?: SignableTransaction;
}

See also: AtomicBEEF, OutpointString, SendWithResult, SignableTransaction, TXIDHexString

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


Interface: CreateHmacArgs

export interface CreateHmacArgs extends WalletEncryptionArgs {
    data: Byte[];
}

See also: Byte, WalletEncryptionArgs

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


Interface: CreateHmacResult

export interface CreateHmacResult {
    hmac: Byte[];
}

See also: Byte

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


Interface: CreateSignatureArgs

export interface CreateSignatureArgs extends WalletEncryptionArgs {
    data?: Byte[];
    hashToDirectlySign?: Byte[];
}

See also: Byte, WalletEncryptionArgs

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


Interface: CreateSignatureResult

export interface CreateSignatureResult {
    signature: Byte[];
}

See also: Byte

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


Interface: DiscoverByAttributesArgs

export interface DiscoverByAttributesArgs {
    attributes: Record<CertificateFieldNameUnder50Bytes, string>;
    limit?: PositiveIntegerDefault10Max10000;
    offset?: PositiveIntegerOrZero;
    seekPermission?: BooleanDefaultTrue;
}

See also: BooleanDefaultTrue, CertificateFieldNameUnder50Bytes, PositiveIntegerDefault10Max10000, PositiveIntegerOrZero

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


Interface: DiscoverByIdentityKeyArgs

export interface DiscoverByIdentityKeyArgs {
    identityKey: PubKeyHex;
    limit?: PositiveIntegerDefault10Max10000;
    offset?: PositiveIntegerOrZero;
    seekPermission?: BooleanDefaultTrue;
}

See also: BooleanDefaultTrue, PositiveIntegerDefault10Max10000, PositiveIntegerOrZero, PubKeyHex

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


Interface: DiscoverCertificatesResult

export interface DiscoverCertificatesResult {
    totalCertificates: PositiveIntegerOrZero;
    certificates: IdentityCertificate[];
}

See also: IdentityCertificate, PositiveIntegerOrZero

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


Interface: GetHeaderArgs

export interface GetHeaderArgs {
    height: PositiveInteger;
}

See also: PositiveInteger

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


Interface: GetHeaderResult

export interface GetHeaderResult {
    header: HexString;
}

See also: HexString

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


Interface: GetHeightResult

export interface GetHeightResult {
    height: PositiveInteger;
}

See also: PositiveInteger

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


Interface: GetNetworkResult

export interface GetNetworkResult {
    network: WalletNetwork;
}

See also: WalletNetwork

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


Interface: GetPublicKeyArgs

When identityKey is true, WalletEncryptionArgs are not used.

When identityKey is undefined, WalletEncryptionArgs are required.

export interface GetPublicKeyArgs extends Partial<WalletEncryptionArgs> {
    identityKey?: true;
    forSelf?: BooleanDefaultFalse;
}

See also: BooleanDefaultFalse, WalletEncryptionArgs

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


Interface: GetPublicKeyResult

export interface GetPublicKeyResult {
    publicKey: PubKeyHex;
}

See also: PubKeyHex

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


Interface: GetVersionResult

export interface GetVersionResult {
    version: VersionString7To30Bytes;
}

See also: VersionString7To30Bytes

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


Interface: IdentityCertificate

export interface IdentityCertificate extends WalletCertificate {
    certifierInfo: IdentityCertifier;
    publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
    decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
}

See also: Base64String, CertificateFieldNameUnder50Bytes, IdentityCertifier, WalletCertificate

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


Interface: IdentityCertifier

export interface IdentityCertifier {
    name: EntityNameStringMax100Bytes;
    iconUrl: EntityIconURLStringMax500Bytes;
    description: DescriptionString5to50Bytes;
    trust: PositiveIntegerMax10;
}

See also: DescriptionString5to50Bytes, EntityIconURLStringMax500Bytes, EntityNameStringMax100Bytes, PositiveIntegerMax10

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


Interface: InternalizeActionArgs

export interface InternalizeActionArgs {
    tx: AtomicBEEF;
    outputs: InternalizeOutput[];
    description: DescriptionString5to50Bytes;
    labels?: LabelStringUnder300Bytes[];
    seekPermission?: BooleanDefaultTrue;
}

See also: AtomicBEEF, BooleanDefaultTrue, DescriptionString5to50Bytes, InternalizeOutput, LabelStringUnder300Bytes

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


Interface: InternalizeActionResult

export interface InternalizeActionResult {
    accepted: true;
}

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


Interface: InternalizeOutput

export interface InternalizeOutput {
    outputIndex: PositiveIntegerOrZero;
    protocol: "wallet payment" | "basket insertion";
    paymentRemittance?: WalletPayment;
    insertionRemittance?: BasketInsertion;
}

See also: BasketInsertion, PositiveIntegerOrZero, WalletPayment

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


Interface: KeyDeriverApi

export interface KeyDeriverApi {
    rootKey: PrivateKey;
    identityKey: string;
    derivePublicKey: (protocolID: WalletProtocol, keyID: string, counterparty: Counterparty, forSelf?: boolean) => PublicKey;
    derivePrivateKey: (protocolID: WalletProtocol, keyID: string, counterparty: Counterparty) => PrivateKey;
    deriveSymmetricKey: (protocolID: WalletProtocol, keyID: string, counterparty: Counterparty) => SymmetricKey;
    revealCounterpartySecret: (counterparty: Counterparty) => number[];
    revealSpecificSecret: (counterparty: Counterparty, protocolID: WalletProtocol, keyID: string) => number[];
}

See also: Counterparty, PrivateKey, PublicKey, SymmetricKey, WalletProtocol

Property derivePrivateKey

Derives a private key based on protocol ID, key ID, and counterparty.

derivePrivateKey: (protocolID: WalletProtocol, keyID: string, counterparty: Counterparty) => PrivateKey
See also: Counterparty, PrivateKey, WalletProtocol

Property derivePublicKey

Derives a public key based on protocol ID, key ID, and counterparty.

derivePublicKey: (protocolID: WalletProtocol, keyID: string, counterparty: Counterparty, forSelf?: boolean) => PublicKey
See also: Counterparty, PublicKey, WalletProtocol

Property deriveSymmetricKey

Derives a symmetric key based on protocol ID, key ID, and counterparty. Note: Symmetric keys should not be derivable by everyone due to security risks.

deriveSymmetricKey: (protocolID: WalletProtocol, keyID: string, counterparty: Counterparty) => SymmetricKey
See also: Counterparty, SymmetricKey, WalletProtocol

Property identityKey

The identity of this key deriver which is normally the public key associated with the rootKey

identityKey: string

Property revealCounterpartySecret

Reveals the shared secret between the root key and the counterparty. Note: This should not be used for 'self'.

revealCounterpartySecret: (counterparty: Counterparty) => number[]
See also: Counterparty

Property revealSpecificSecret

Reveals the specific key association for a given protocol ID, key ID, and counterparty.

revealSpecificSecret: (counterparty: Counterparty, protocolID: WalletProtocol, keyID: string) => number[]
See also: Counterparty, WalletProtocol

Property rootKey

The root key from which all other keys are derived.

rootKey: PrivateKey
See also: PrivateKey

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


Interface: KeyLinkageResult

export interface KeyLinkageResult {
    encryptedLinkage: Byte[];
    encryptedLinkageProof: Byte[];
    prover: PubKeyHex;
    verifier: PubKeyHex;
    counterparty: PubKeyHex;
}

See also: Byte, PubKeyHex

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


Interface: ListActionsArgs

export interface ListActionsArgs {
    labels: LabelStringUnder300Bytes[];
    labelQueryMode?: "any" | "all";
    includeLabels?: BooleanDefaultFalse;
    includeInputs?: BooleanDefaultFalse;
    includeInputSourceLockingScripts?: BooleanDefaultFalse;
    includeInputUnlockingScripts?: BooleanDefaultFalse;
    includeOutputs?: BooleanDefaultFalse;
    includeOutputLockingScripts?: BooleanDefaultFalse;
    limit?: PositiveIntegerDefault10Max10000;
    offset?: PositiveIntegerOrZero;
    seekPermission?: BooleanDefaultTrue;
}

See also: BooleanDefaultFalse, BooleanDefaultTrue, LabelStringUnder300Bytes, PositiveIntegerDefault10Max10000, PositiveIntegerOrZero

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


Interface: ListActionsResult

export interface ListActionsResult {
    totalActions: PositiveIntegerOrZero;
    actions: WalletAction[];
}

See also: PositiveIntegerOrZero, WalletAction

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


Interface: ListCertificatesArgs

export interface ListCertificatesArgs {
    certifiers: PubKeyHex[];
    types: Base64String[];
    limit?: PositiveIntegerDefault10Max10000;
    offset?: PositiveIntegerOrZero;
    privileged?: BooleanDefaultFalse;
    privilegedReason?: DescriptionString5to50Bytes;
}

See also: Base64String, BooleanDefaultFalse, DescriptionString5to50Bytes, PositiveIntegerDefault10Max10000, PositiveIntegerOrZero, PubKeyHex

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


Interface: ListCertificatesResult

export interface ListCertificatesResult {
    totalCertificates: PositiveIntegerOrZero;
    certificates: CertificateResult[];
}

See also: CertificateResult, PositiveIntegerOrZero

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


Interface: ListOutputsArgs

export interface ListOutputsArgs {
    basket: BasketStringUnder300Bytes;
    tags?: OutputTagStringUnder300Bytes[];
    tagQueryMode?: "all" | "any";
    include?: "locking scripts" | "entire transactions";
    includeCustomInstructions?: BooleanDefaultFalse;
    includeTags?: BooleanDefaultFalse;
    includeLabels?: BooleanDefaultFalse;
    limit?: PositiveIntegerDefault10Max10000;
    offset?: number;
    seekPermission?: BooleanDefaultTrue;
}

See also: BasketStringUnder300Bytes, BooleanDefaultFalse, BooleanDefaultTrue, OutputTagStringUnder300Bytes, PositiveIntegerDefault10Max10000

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


Interface: ListOutputsResult

export interface ListOutputsResult {
    totalOutputs: PositiveIntegerOrZero;
    BEEF?: BEEF;
    outputs: WalletOutput[];
}

See also: BEEF, PositiveIntegerOrZero, WalletOutput

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


Interface: OutPoint

Identifies a unique transaction output by its txid and index vout

export interface OutPoint {
    txid: string;
    vout: number;
}

Property txid

Transaction double sha256 hash as big endian hex string

txid: string

Property vout

zero based output index within the transaction

vout: number

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


Interface: ProveCertificateArgs

export interface ProveCertificateArgs {
    certificate: Partial<WalletCertificate>;
    fieldsToReveal: CertificateFieldNameUnder50Bytes[];
    verifier: PubKeyHex;
    privileged?: BooleanDefaultFalse;
    privilegedReason?: DescriptionString5to50Bytes;
}

See also: BooleanDefaultFalse, CertificateFieldNameUnder50Bytes, DescriptionString5to50Bytes, PubKeyHex, WalletCertificate

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


Interface: ProveCertificateResult

export interface ProveCertificateResult {
    keyringForVerifier: Record<CertificateFieldNameUnder50Bytes, Base64String>;
    certificate?: WalletCertificate;
    verifier?: PubKeyHex;
}

See also: Base64String, CertificateFieldNameUnder50Bytes, PubKeyHex, WalletCertificate

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


Interface: RelinquishCertificateArgs

export interface RelinquishCertificateArgs {
    type: Base64String;
    serialNumber: Base64String;
    certifier: PubKeyHex;
}

See also: Base64String, PubKeyHex

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


Interface: RelinquishCertificateResult

export interface RelinquishCertificateResult {
    relinquished: true;
}

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


Interface: RelinquishOutputArgs

export interface RelinquishOutputArgs {
    basket: BasketStringUnder300Bytes;
    output: OutpointString;
}

See also: BasketStringUnder300Bytes, OutpointString

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


Interface: RelinquishOutputResult

export interface RelinquishOutputResult {
    relinquished: true;
}

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


Interface: RevealCounterpartyKeyLinkageArgs

export interface RevealCounterpartyKeyLinkageArgs {
    counterparty: PubKeyHex;
    verifier: PubKeyHex;
    privileged?: BooleanDefaultFalse;
    privilegedReason?: DescriptionString5to50Bytes;
}

See also: BooleanDefaultFalse, DescriptionString5to50Bytes, PubKeyHex

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


Interface: RevealCounterpartyKeyLinkageResult

export interface RevealCounterpartyKeyLinkageResult extends KeyLinkageResult {
    revelationTime: ISOTimestampString;
}

See also: ISOTimestampString, KeyLinkageResult

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


Interface: RevealSpecificKeyLinkageArgs

export interface RevealSpecificKeyLinkageArgs {
    counterparty: WalletCounterparty;
    verifier: PubKeyHex;
    protocolID: WalletProtocol;
    keyID: KeyIDStringUnder800Bytes;
    privilegedReason?: DescriptionString5to50Bytes;
    privileged?: BooleanDefaultFalse;
}

See also: BooleanDefaultFalse, DescriptionString5to50Bytes, KeyIDStringUnder800Bytes, PubKeyHex, WalletCounterparty, WalletProtocol

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


Interface: RevealSpecificKeyLinkageResult

export interface RevealSpecificKeyLinkageResult extends KeyLinkageResult {
    protocolID: WalletProtocol;
    keyID: KeyIDStringUnder800Bytes;
    proofType: Byte;
}

See also: Byte, KeyIDStringUnder800Bytes, KeyLinkageResult, WalletProtocol

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


Interface: ReviewActionResult

export interface ReviewActionResult {
    txid: TXIDHexString;
    status: ReviewActionResultStatus;
    competingTxs?: string[];
    competingBeef?: number[];
}

See also: ReviewActionResultStatus, TXIDHexString

Property competingBeef

Merged beef of competingTxs, valid when status is 'doubleSpend'.

competingBeef?: number[]

Property competingTxs

Any competing txids reported for this txid, valid when status is 'doubleSpend'.

competingTxs?: string[]

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


Interface: SendWithResult

export interface SendWithResult {
    txid: TXIDHexString;
    status: SendWithResultStatus;
}

See also: SendWithResultStatus, TXIDHexString

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


Interface: SignActionArgs

export interface SignActionArgs {
    spends: Record<PositiveIntegerOrZero, SignActionSpend>;
    reference: Base64String;
    options?: SignActionOptions;
}

See also: Base64String, PositiveIntegerOrZero, SignActionOptions, SignActionSpend

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


Interface: SignActionOptions

export interface SignActionOptions {
    acceptDelayedBroadcast?: BooleanDefaultTrue;
    returnTXIDOnly?: BooleanDefaultFalse;
    noSend?: BooleanDefaultFalse;
    sendWith?: TXIDHexString[];
}

See also: BooleanDefaultFalse, BooleanDefaultTrue, TXIDHexString

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


Interface: SignActionResult

export interface SignActionResult {
    txid?: TXIDHexString;
    tx?: AtomicBEEF;
    sendWithResults?: SendWithResult[];
}

See also: AtomicBEEF, SendWithResult, TXIDHexString

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


Interface: SignActionSpend

export interface SignActionSpend {
    unlockingScript: HexString;
    sequenceNumber?: PositiveIntegerOrZero;
}

See also: HexString, PositiveIntegerOrZero

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


Interface: SignableTransaction

export interface SignableTransaction {
    tx: AtomicBEEF;
    reference: Base64String;
}

See also: AtomicBEEF, Base64String

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


Interface: ValidAbortActionArgs

export interface ValidAbortActionArgs extends ValidWalletSignerArgs {
    reference: Base64String;
}

See also: Base64String, ValidWalletSignerArgs

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


Interface: ValidAcquireCertificateArgs

export interface ValidAcquireCertificateArgs extends ValidWalletSignerArgs {
    acquisitionProtocol: AcquisitionProtocol;
    type: Base64String;
    serialNumber?: Base64String;
    certifier: PubKeyHex;
    revocationOutpoint?: OutpointString;
    fields: Record<CertificateFieldNameUnder50Bytes, string>;
    signature?: HexString;
    certifierUrl?: string;
    keyringRevealer?: KeyringRevealer;
    keyringForSubject?: Record<CertificateFieldNameUnder50Bytes, Base64String>;
    privileged: boolean;
    privilegedReason?: DescriptionString5to50Bytes;
}

See also: AcquisitionProtocol, Base64String, CertificateFieldNameUnder50Bytes, DescriptionString5to50Bytes, HexString, KeyringRevealer, OutpointString, PubKeyHex, ValidWalletSignerArgs

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


Interface: ValidAcquireDirectCertificateArgs

export interface ValidAcquireDirectCertificateArgs extends ValidWalletSignerArgs {
    type: Base64String;
    serialNumber: Base64String;
    certifier: PubKeyHex;
    revocationOutpoint: OutpointString;
    fields: Record<CertificateFieldNameUnder50Bytes, string>;
    signature: HexString;
    subject: PubKeyHex;
    keyringRevealer: KeyringRevealer;
    keyringForSubject: Record<CertificateFieldNameUnder50Bytes, Base64String>;
    privileged: boolean;
    privilegedReason?: DescriptionString5to50Bytes;
}

See also: Base64String, CertificateFieldNameUnder50Bytes, DescriptionString5to50Bytes, HexString, KeyringRevealer, OutpointString, PubKeyHex, ValidWalletSignerArgs

Property subject

validated to an empty string, must be provided by wallet and must match expectations of keyringForSubject

subject: PubKeyHex
See also: PubKeyHex

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


Interface: ValidAcquireIssuanceCertificateArgs

export interface ValidAcquireIssuanceCertificateArgs extends ValidWalletSignerArgs {
    type: Base64String;
    certifier: PubKeyHex;
    certifierUrl: string;
    fields: Record<CertificateFieldNameUnder50Bytes, string>;
    subject: PubKeyHex;
    privileged: boolean;
    privilegedReason?: DescriptionString5to50Bytes;
}

See also: Base64String, CertificateFieldNameUnder50Bytes, DescriptionString5to50Bytes, PubKeyHex, ValidWalletSignerArgs

Property subject

validated to an empty string, must be provided by wallet and must match expectations of keyringForSubject

subject: PubKeyHex
See also: PubKeyHex

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


Interface: ValidBasketInsertion

export interface ValidBasketInsertion {
    basket: BasketStringUnder300Bytes;
    customInstructions?: string;
    tags: BasketStringUnder300Bytes[];
}

See also: BasketStringUnder300Bytes

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


Interface: ValidCreateActionArgs

export interface ValidCreateActionArgs extends ValidProcessActionArgs {
    description: DescriptionString5to2000Bytes;
    inputBEEF?: BEEF;
    inputs: ValidCreateActionInput[];
    outputs: ValidCreateActionOutput[];
    lockTime: number;
    version: number;
    labels: string[];
    options: ValidCreateActionOptions;
    isSignAction: boolean;
    randomVals?: number[];
    includeAllSourceTransactions: boolean;
}

See also: BEEF, DescriptionString5to2000Bytes, ValidCreateActionInput, ValidCreateActionOptions, ValidCreateActionOutput, ValidProcessActionArgs

Property includeAllSourceTransactions

If true, signableTransactions will include sourceTransaction for each input, including those that do not require signature and those that were also contained in the inputBEEF.

includeAllSourceTransactions: boolean

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


Interface: ValidCreateActionInput

export interface ValidCreateActionInput {
    outpoint: OutPoint;
    inputDescription: DescriptionString5to2000Bytes;
    sequenceNumber: PositiveIntegerOrZero;
    unlockingScript?: HexString;
    unlockingScriptLength: PositiveInteger;
}

See also: DescriptionString5to2000Bytes, HexString, OutPoint, PositiveInteger, PositiveIntegerOrZero

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


Interface: ValidCreateActionOptions

export interface ValidCreateActionOptions extends ValidProcessActionOptions {
    signAndProcess: boolean;
    trustSelf?: TrustSelf;
    knownTxids: TXIDHexString[];
    noSendChange: OutPoint[];
    randomizeOutputs: boolean;
}

See also: OutPoint, TXIDHexString, TrustSelf, ValidProcessActionOptions

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


Interface: ValidCreateActionOutput

export interface ValidCreateActionOutput {
    lockingScript: HexString;
    satoshis: SatoshiValue;
    outputDescription: DescriptionString5to2000Bytes;
    basket?: BasketStringUnder300Bytes;
    customInstructions?: string;
    tags: BasketStringUnder300Bytes[];
}

See also: BasketStringUnder300Bytes, DescriptionString5to2000Bytes, HexString, SatoshiValue

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


Interface: ValidDiscoverByAttributesArgs

export interface ValidDiscoverByAttributesArgs extends ValidWalletSignerArgs {
    attributes: Record<CertificateFieldNameUnder50Bytes, string>;
    limit: PositiveIntegerDefault10Max10000;
    offset: PositiveIntegerOrZero;
    seekPermission: boolean;
}

See also: CertificateFieldNameUnder50Bytes, PositiveIntegerDefault10Max10000, PositiveIntegerOrZero, ValidWalletSignerArgs

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


Interface: ValidDiscoverByIdentityKeyArgs

export interface ValidDiscoverByIdentityKeyArgs extends ValidWalletSignerArgs {
    identityKey: PubKeyHex;
    limit: PositiveIntegerDefault10Max10000;
    offset: PositiveIntegerOrZero;
    seekPermission: boolean;
}

See also: PositiveIntegerDefault10Max10000, PositiveIntegerOrZero, PubKeyHex, ValidWalletSignerArgs

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


Interface: ValidInternalizeActionArgs

export interface ValidInternalizeActionArgs extends ValidWalletSignerArgs {
    tx: AtomicBEEF;
    outputs: InternalizeOutput[];
    description: DescriptionString5to2000Bytes;
    labels: LabelStringUnder300Bytes[];
    seekPermission: BooleanDefaultTrue;
}

See also: AtomicBEEF, BooleanDefaultTrue, DescriptionString5to2000Bytes, InternalizeOutput, LabelStringUnder300Bytes, ValidWalletSignerArgs

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


Interface: ValidInternalizeOutput

export interface ValidInternalizeOutput {
    outputIndex: PositiveIntegerOrZero;
    protocol: "wallet payment" | "basket insertion";
    paymentRemittance?: ValidWalletPayment;
    insertionRemittance?: ValidBasketInsertion;
}

See also: PositiveIntegerOrZero, ValidBasketInsertion, ValidWalletPayment

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


Interface: ValidListActionsArgs

export interface ValidListActionsArgs extends ValidWalletSignerArgs {
    labels: LabelStringUnder300Bytes[];
    labelQueryMode: "any" | "all";
    includeLabels: BooleanDefaultFalse;
    includeInputs: BooleanDefaultFalse;
    includeInputSourceLockingScripts: BooleanDefaultFalse;
    includeInputUnlockingScripts: BooleanDefaultFalse;
    includeOutputs: BooleanDefaultFalse;
    includeOutputLockingScripts: BooleanDefaultFalse;
    limit: PositiveIntegerDefault10Max10000;
    offset: PositiveIntegerOrZero;
    seekPermission: BooleanDefaultTrue;
}

See also: BooleanDefaultFalse, BooleanDefaultTrue, LabelStringUnder300Bytes, PositiveIntegerDefault10Max10000, PositiveIntegerOrZero, ValidWalletSignerArgs

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


Interface: ValidListCertificatesArgs

export interface ValidListCertificatesArgs extends ValidWalletSignerArgs {
    partial?: {
        type?: Base64String;
        serialNumber?: Base64String;
        certifier?: PubKeyHex;
        subject?: PubKeyHex;
        revocationOutpoint?: OutpointString;
        signature?: HexString;
    };
    certifiers: PubKeyHex[];
    types: Base64String[];
    limit: PositiveIntegerDefault10Max10000;
    offset: PositiveIntegerOrZero;
    privileged: BooleanDefaultFalse;
    privilegedReason?: DescriptionString5to50Bytes;
}

See also: Base64String, BooleanDefaultFalse, DescriptionString5to50Bytes, HexString, OutpointString, PositiveIntegerDefault10Max10000, PositiveIntegerOrZero, PubKeyHex, ValidWalletSignerArgs

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


Interface: ValidListOutputsArgs

export interface ValidListOutputsArgs extends ValidWalletSignerArgs {
    basket: BasketStringUnder300Bytes;
    tags: OutputTagStringUnder300Bytes[];
    tagQueryMode: "all" | "any";
    includeLockingScripts: boolean;
    includeTransactions: boolean;
    includeCustomInstructions: BooleanDefaultFalse;
    includeTags: BooleanDefaultFalse;
    includeLabels: BooleanDefaultFalse;
    limit: PositiveIntegerDefault10Max10000;
    offset: number;
    seekPermission: BooleanDefaultTrue;
    knownTxids: string[];
}

See also: BasketStringUnder300Bytes, BooleanDefaultFalse, BooleanDefaultTrue, OutputTagStringUnder300Bytes, PositiveIntegerDefault10Max10000, ValidWalletSignerArgs

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


Interface: ValidProcessActionArgs

export interface ValidProcessActionArgs extends ValidWalletSignerArgs {
    options: ValidProcessActionOptions;
    isSendWith: boolean;
    isNewTx: boolean;
    isRemixChange: boolean;
    isNoSend: boolean;
    isDelayed: boolean;
    isTestWerrReviewActions: boolean;
}

See also: ValidProcessActionOptions, ValidWalletSignerArgs

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


Interface: ValidProcessActionOptions

export interface ValidProcessActionOptions {
    acceptDelayedBroadcast: BooleanDefaultTrue;
    returnTXIDOnly: BooleanDefaultFalse;
    noSend: BooleanDefaultFalse;
    sendWith: TXIDHexString[];
}

See also: BooleanDefaultFalse, BooleanDefaultTrue, TXIDHexString

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


Interface: ValidProveCertificateArgs

export interface ValidProveCertificateArgs extends ValidWalletSignerArgs {
    type?: Base64String;
    serialNumber?: Base64String;
    certifier?: PubKeyHex;
    subject?: PubKeyHex;
    revocationOutpoint?: OutpointString;
    signature?: HexString;
    fieldsToReveal: CertificateFieldNameUnder50Bytes[];
    verifier: PubKeyHex;
    privileged: boolean;
    privilegedReason?: DescriptionString5to50Bytes;
}

See also: Base64String, CertificateFieldNameUnder50Bytes, DescriptionString5to50Bytes, HexString, OutpointString, PubKeyHex, ValidWalletSignerArgs

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


Interface: ValidRelinquishCertificateArgs

export interface ValidRelinquishCertificateArgs extends ValidWalletSignerArgs {
    type: Base64String;
    serialNumber: Base64String;
    certifier: PubKeyHex;
}

See also: Base64String, PubKeyHex, ValidWalletSignerArgs

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


Interface: ValidRelinquishOutputArgs

export interface ValidRelinquishOutputArgs extends ValidWalletSignerArgs {
    basket: BasketStringUnder300Bytes;
    output: OutpointString;
}

See also: BasketStringUnder300Bytes, OutpointString, ValidWalletSignerArgs

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


Interface: ValidSignActionArgs

export interface ValidSignActionArgs extends ValidProcessActionArgs {
    spends: Record<PositiveIntegerOrZero, SignActionSpend>;
    reference: Base64String;
    options: ValidSignActionOptions;
}

See also: Base64String, PositiveIntegerOrZero, SignActionSpend, ValidProcessActionArgs, ValidSignActionOptions

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


Interface: ValidSignActionOptions

export interface ValidSignActionOptions extends ValidProcessActionOptions {
    acceptDelayedBroadcast: boolean;
    returnTXIDOnly: boolean;
    noSend: boolean;
    sendWith: TXIDHexString[];
}

See also: TXIDHexString, ValidProcessActionOptions

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


Interface: ValidWalletPayment

export interface ValidWalletPayment {
    derivationPrefix: Base64String;
    derivationSuffix: Base64String;
    senderIdentityKey: PubKeyHex;
}

See also: Base64String, PubKeyHex

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


Interface: ValidWalletSignerArgs

export interface ValidWalletSignerArgs {
    logger?: WalletLoggerInterface;
}

See also: WalletLoggerInterface

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


Interface: VerifyHmacArgs

export interface VerifyHmacArgs extends WalletEncryptionArgs {
    data: Byte[];
    hmac: Byte[];
}

See also: Byte, WalletEncryptionArgs

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


Interface: VerifyHmacResult

export interface VerifyHmacResult {
    valid: true;
}

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


Interface: VerifySignatureArgs

export interface VerifySignatureArgs extends WalletEncryptionArgs {
    data?: Byte[];
    hashToDirectlyVerify?: Byte[];
    signature: Byte[];
    forSelf?: BooleanDefaultFalse;
}

See also: BooleanDefaultFalse, Byte, WalletEncryptionArgs

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


Interface: VerifySignatureResult

export interface VerifySignatureResult {
    valid: true;
}

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


Interface: WalletAction

export interface WalletAction {
    txid: TXIDHexString;
    satoshis: SatoshiValue;
    status: ActionStatus;
    isOutgoing: boolean;
    description: DescriptionString5to50Bytes;
    labels?: LabelStringUnder300Bytes[];
    version: PositiveIntegerOrZero;
    lockTime: PositiveIntegerOrZero;
    inputs?: WalletActionInput[];
    outputs?: WalletActionOutput[];
}

See also: ActionStatus, DescriptionString5to50Bytes, LabelStringUnder300Bytes, PositiveIntegerOrZero, SatoshiValue, TXIDHexString, WalletActionInput, WalletActionOutput

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


Interface: WalletActionInput

export interface WalletActionInput {
    sourceOutpoint: OutpointString;
    sourceSatoshis: SatoshiValue;
    sourceLockingScript?: HexString;
    unlockingScript?: HexString;
    inputDescription: DescriptionString5to50Bytes;
    sequenceNumber: PositiveIntegerOrZero;
}

See also: DescriptionString5to50Bytes, HexString, OutpointString, PositiveIntegerOrZero, SatoshiValue

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


Interface: WalletActionOutput

export interface WalletActionOutput {
    satoshis: SatoshiValue;
    lockingScript?: HexString;
    spendable: boolean;
    customInstructions?: string;
    tags: OutputTagStringUnder300Bytes[];
    outputIndex: PositiveIntegerOrZero;
    outputDescription: DescriptionString5to50Bytes;
    basket: BasketStringUnder300Bytes;
}

See also: BasketStringUnder300Bytes, DescriptionString5to50Bytes, HexString, OutputTagStringUnder300Bytes, PositiveIntegerOrZero, SatoshiValue

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


Interface: WalletCertificate

export interface WalletCertificate {
    type: Base64String;
    subject: PubKeyHex;
    serialNumber: Base64String;
    certifier: PubKeyHex;
    revocationOutpoint: OutpointString;
    signature: HexString;
    fields: Record<CertificateFieldNameUnder50Bytes, string>;
}

See also: Base64String, CertificateFieldNameUnder50Bytes, HexString, OutpointString, PubKeyHex

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


Interface: WalletDecryptArgs

export interface WalletDecryptArgs extends WalletEncryptionArgs {
    ciphertext: Byte[];
}

See also: Byte, WalletEncryptionArgs

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


Interface: WalletDecryptResult

export interface WalletDecryptResult {
    plaintext: Byte[];
}

See also: Byte

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


Interface: WalletEncryptArgs

export interface WalletEncryptArgs extends WalletEncryptionArgs {
    plaintext: Byte[];
}

See also: Byte, WalletEncryptionArgs

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


Interface: WalletEncryptResult

export interface WalletEncryptResult {
    ciphertext: Byte[];
}

See also: Byte

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


Interface: WalletEncryptionArgs

export interface WalletEncryptionArgs {
    protocolID: WalletProtocol;
    keyID: KeyIDStringUnder800Bytes;
    counterparty?: WalletCounterparty;
    privileged?: BooleanDefaultFalse;
    privilegedReason?: DescriptionString5to50Bytes;
    seekPermission?: BooleanDefaultTrue;
}

See also: BooleanDefaultFalse, BooleanDefaultTrue, DescriptionString5to50Bytes, KeyIDStringUnder800Bytes, WalletCounterparty, WalletProtocol

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


Interface: WalletErrorObject

Every method of the Wallet interface has a return value of the form Promise<object>. When errors occur, an exception object may be thrown which must conform to the WalletErrorObject interface. Serialization layers can rely on the isError property being unique to error objects. Deserialization should rethrow WalletErrorObject conforming objects.

export interface WalletErrorObject extends Error {
    isError: true;
}

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


Interface: WalletInterface

The Wallet interface defines a wallet capable of various tasks including transaction creation and signing, encryption, decryption, identity certificate management, identity verification, and communication with applications as per the BRC standards. This interface allows applications to interact with the wallet for a range of functionalities aligned with the Babbage architectural principles.

Error Handling

Every method of the Wallet interface has a return value of the form Promise<object>. When an error occurs, an exception object may be thrown which must conform to the WalletErrorObject interface. Serialization layers can rely on the isError property being unique to error objects to deserialize and rethrow WalletErrorObject conforming objects.

export interface WalletInterface {
    getPublicKey: (args: GetPublicKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<GetPublicKeyResult>;
    revealCounterpartyKeyLinkage: (args: RevealCounterpartyKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<RevealCounterpartyKeyLinkageResult>;
    revealSpecificKeyLinkage: (args: RevealSpecificKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<RevealSpecificKeyLinkageResult>;
    encrypt: (args: WalletEncryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<WalletEncryptResult>;
    decrypt: (args: WalletDecryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<WalletDecryptResult>;
    createHmac: (args: CreateHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<CreateHmacResult>;
    verifyHmac: (args: VerifyHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<VerifyHmacResult>;
    createSignature: (args: CreateSignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<CreateSignatureResult>;
    verifySignature: (args: VerifySignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<VerifySignatureResult>;
    createAction: (args: CreateActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<CreateActionResult>;
    signAction: (args: SignActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<SignActionResult>;
    abortAction: (args: AbortActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<AbortActionResult>;
    listActions: (args: ListActionsArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<ListActionsResult>;
    internalizeAction: (args: InternalizeActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<InternalizeActionResult>;
    listOutputs: (args: ListOutputsArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<ListOutputsResult>;
    relinquishOutput: (args: RelinquishOutputArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<RelinquishOutputResult>;
    acquireCertificate: (args: AcquireCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<WalletCertificate>;
    listCertificates: (args: ListCertificatesArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<ListCertificatesResult>;
    proveCertificate: (args: ProveCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<ProveCertificateResult>;
    relinquishCertificate: (args: RelinquishCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<RelinquishCertificateResult>;
    discoverByIdentityKey: (args: DiscoverByIdentityKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<DiscoverCertificatesResult>;
    discoverByAttributes: (args: DiscoverByAttributesArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<DiscoverCertificatesResult>;
    isAuthenticated: (args: object, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<AuthenticatedResult>;
    waitForAuthentication: (args: object, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<AuthenticatedResult>;
    getHeight: (args: object, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<GetHeightResult>;
    getHeaderForHeight: (args: GetHeaderArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<GetHeaderResult>;
    getNetwork: (args: object, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<GetNetworkResult>;
    getVersion: (args: object, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<GetVersionResult>;
}

See also: AbortActionArgs, AbortActionResult, AcquireCertificateArgs, AuthenticatedResult, CreateActionArgs, CreateActionResult, CreateHmacArgs, CreateHmacResult, CreateSignatureArgs, CreateSignatureResult, DiscoverByAttributesArgs, DiscoverByIdentityKeyArgs, DiscoverCertificatesResult, GetHeaderArgs, GetHeaderResult, GetHeightResult, GetNetworkResult, GetPublicKeyArgs, GetPublicKeyResult, GetVersionResult, InternalizeActionArgs, InternalizeActionResult, ListActionsArgs, ListActionsResult, ListCertificatesArgs, ListCertificatesResult, ListOutputsArgs, ListOutputsResult, OriginatorDomainNameStringUnder250Bytes, ProveCertificateArgs, ProveCertificateResult, RelinquishCertificateArgs, RelinquishCertificateResult, RelinquishOutputArgs, RelinquishOutputResult, RevealCounterpartyKeyLinkageArgs, RevealCounterpartyKeyLinkageResult, RevealSpecificKeyLinkageArgs, RevealSpecificKeyLinkageResult, SignActionArgs, SignActionResult, VerifyHmacArgs, VerifyHmacResult, VerifySignatureArgs, VerifySignatureResult, WalletCertificate, WalletDecryptArgs, WalletDecryptResult, WalletEncryptArgs, WalletEncryptResult, decrypt, encrypt

Property abortAction

Aborts a transaction that is in progress and has not yet been finalized or sent to the network.

abortAction: (args: AbortActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<AbortActionResult>
See also: AbortActionArgs, AbortActionResult, OriginatorDomainNameStringUnder250Bytes

Property acquireCertificate

Acquires an identity certificate, whether by acquiring one from the certifier or by directly receiving it.

acquireCertificate: (args: AcquireCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<WalletCertificate>
See also: AcquireCertificateArgs, OriginatorDomainNameStringUnder250Bytes, WalletCertificate

Property createAction

Creates a new Bitcoin transaction based on the provided inputs, outputs, labels, locks, and other options.

createAction: (args: CreateActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<CreateActionResult>
See also: CreateActionArgs, CreateActionResult, OriginatorDomainNameStringUnder250Bytes

Property createHmac

Creates an HMAC (Hash-based Message Authentication Code) based on the provided data, protocol, key ID, counterparty, and other factors.

createHmac: (args: CreateHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<CreateHmacResult>
See also: CreateHmacArgs, CreateHmacResult, OriginatorDomainNameStringUnder250Bytes

Property createSignature

Creates a digital signature for the provided data or hash using a specific protocol, key, and optionally considering privilege and counterparty.

createSignature: (args: CreateSignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<CreateSignatureResult>
See also: CreateSignatureArgs, CreateSignatureResult, OriginatorDomainNameStringUnder250Bytes

Property decrypt

Decrypts the provided ciphertext using derived keys, based on the protocol ID, key ID, counterparty, and other factors.

decrypt: (args: WalletDecryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<WalletDecryptResult>
See also: OriginatorDomainNameStringUnder250Bytes, WalletDecryptArgs, WalletDecryptResult

Property discoverByAttributes

Discovers identity certificates belonging to other users, where the documents contain specific attributes, issued by a trusted entity.

discoverByAttributes: (args: DiscoverByAttributesArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<DiscoverCertificatesResult>
See also: DiscoverByAttributesArgs, DiscoverCertificatesResult, OriginatorDomainNameStringUnder250Bytes

Property discoverByIdentityKey

Discovers identity certificates, issued to a given identity key by a trusted entity.

discoverByIdentityKey: (args: DiscoverByIdentityKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<DiscoverCertificatesResult>
See also: DiscoverByIdentityKeyArgs, DiscoverCertificatesResult, OriginatorDomainNameStringUnder250Bytes

Property encrypt

Encrypts the provided plaintext data using derived keys, based on the protocol ID, key ID, counterparty, and other factors.

encrypt: (args: WalletEncryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<WalletEncryptResult>
See also: OriginatorDomainNameStringUnder250Bytes, WalletEncryptArgs, WalletEncryptResult

Property getHeaderForHeight

Retrieves the block header of a block at a specified height.

getHeaderForHeight: (args: GetHeaderArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<GetHeaderResult>
See also: GetHeaderArgs, GetHeaderResult, OriginatorDomainNameStringUnder250Bytes

Property getHeight

Retrieves the current height of the blockchain.

getHeight: (args: object, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<GetHeightResult>
See also: GetHeightResult, OriginatorDomainNameStringUnder250Bytes

Property getNetwork

Retrieves the Bitcoin network the client is using (mainnet or testnet).

getNetwork: (args: object, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<GetNetworkResult>
See also: GetNetworkResult, OriginatorDomainNameStringUnder250Bytes

Property getPublicKey

Retrieves a derived or identity public key based on the requested protocol, key ID, counterparty, and other factors.

getPublicKey: (args: GetPublicKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<GetPublicKeyResult>
See also: GetPublicKeyArgs, GetPublicKeyResult, OriginatorDomainNameStringUnder250Bytes

Property getVersion

Retrieves the current version string of the wallet.

getVersion: (args: object, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<GetVersionResult>
See also: GetVersionResult, OriginatorDomainNameStringUnder250Bytes

Property internalizeAction

Submits a transaction to be internalized and optionally labeled, outputs paid to the wallet balance, inserted into baskets, and/or tagged.

internalizeAction: (args: InternalizeActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<InternalizeActionResult>
See also: InternalizeActionArgs, InternalizeActionResult, OriginatorDomainNameStringUnder250Bytes

Property isAuthenticated

Checks the authentication status of the user.

isAuthenticated: (args: object, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<AuthenticatedResult>
See also: AuthenticatedResult, OriginatorDomainNameStringUnder250Bytes

Property listActions

Lists all transactions matching the specified labels.

listActions: (args: ListActionsArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<ListActionsResult>
See also: ListActionsArgs, ListActionsResult, OriginatorDomainNameStringUnder250Bytes

Property listCertificates

Lists identity certificates belonging to the user, filtered by certifier(s) and type(s).

listCertificates: (args: ListCertificatesArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<ListCertificatesResult>
See also: ListCertificatesArgs, ListCertificatesResult, OriginatorDomainNameStringUnder250Bytes

Property listOutputs

Lists the spendable outputs kept within a specific basket, optionally tagged with specific labels.

listOutputs: (args: ListOutputsArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<ListOutputsResult>
See also: ListOutputsArgs, ListOutputsResult, OriginatorDomainNameStringUnder250Bytes

Property proveCertificate

Proves select fields of an identity certificate, as specified, when requested by a verifier.

proveCertificate: (args: ProveCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<ProveCertificateResult>
See also: OriginatorDomainNameStringUnder250Bytes, ProveCertificateArgs, ProveCertificateResult

Property relinquishCertificate

Relinquishes an identity certificate, removing it from the wallet regardless of whether the revocation outpoint has become spent.

relinquishCertificate: (args: RelinquishCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<RelinquishCertificateResult>
See also: OriginatorDomainNameStringUnder250Bytes, RelinquishCertificateArgs, RelinquishCertificateResult

Property relinquishOutput

Relinquish an output out of a basket, removing it from tracking without spending it.

relinquishOutput: (args: RelinquishOutputArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<RelinquishOutputResult>
See also: OriginatorDomainNameStringUnder250Bytes, RelinquishOutputArgs, RelinquishOutputResult

Property revealCounterpartyKeyLinkage

Reveals the key linkage between ourselves and a counterparty, to a particular verifier, across all interactions with the counterparty.

revealCounterpartyKeyLinkage: (args: RevealCounterpartyKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<RevealCounterpartyKeyLinkageResult>
See also: OriginatorDomainNameStringUnder250Bytes, RevealCounterpartyKeyLinkageArgs, RevealCounterpartyKeyLinkageResult

Property revealSpecificKeyLinkage

Reveals the key linkage between ourselves and a counterparty, to a particular verifier, with respect to a specific interaction.

revealSpecificKeyLinkage: (args: RevealSpecificKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<RevealSpecificKeyLinkageResult>
See also: OriginatorDomainNameStringUnder250Bytes, RevealSpecificKeyLinkageArgs, RevealSpecificKeyLinkageResult

Property signAction

Signs a transaction previously created using createAction.

signAction: (args: SignActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<SignActionResult>
See also: OriginatorDomainNameStringUnder250Bytes, SignActionArgs, SignActionResult

Property verifyHmac

Verifies an HMAC (Hash-based Message Authentication Code) based on the provided data, protocol, key ID, counterparty, and other factors.

verifyHmac: (args: VerifyHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<VerifyHmacResult>
See also: OriginatorDomainNameStringUnder250Bytes, VerifyHmacArgs, VerifyHmacResult

Property verifySignature

Verifies a digital signature for the provided data or hash using a specific protocol, key, and optionally considering privilege and counterparty.

verifySignature: (args: VerifySignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<VerifySignatureResult>
See also: OriginatorDomainNameStringUnder250Bytes, VerifySignatureArgs, VerifySignatureResult

Property waitForAuthentication

Continuously waits until the user is authenticated, returning the result once confirmed.

waitForAuthentication: (args: object, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<AuthenticatedResult>
See also: AuthenticatedResult, OriginatorDomainNameStringUnder250Bytes

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


Interface: WalletLoggerInterface

A console-like interface for logging within wallet operations.

Intended to reflect a subset of standard Console interface methods used by Wallet

export interface WalletLoggerInterface {
    group: (...label: any[]) => void;
    groupEnd: () => void;
    log: (message?: any, ...optionalParams: any[]) => void;
    error: (message?: any, ...optionalParams: any[]) => void;
    flush?: () => object | undefined;
    merge?: (log: WalletLoggerInterface) => void;
    level?: "error" | "warn" | "info" | "debug" | "trace";
    indent?: number;
    isOrigin?: boolean;
    isError?: boolean;
    logs?: WalletLoggerLog[];
}

See also: WalletLoggerLog

Property error

Log an error message.

error: (message?: any, ...optionalParams: any[]) => void

Property flush

Loggers may accumulate data instead of immediately handling it.

Loggers that do not accumulate should not implement this method.

flush?: () => object | undefined

Property group

Increases indentation of subsequent lines.

If one or more labels are provided, those are printed first without the additional indentation.

group: (...label: any[]) => void

Property groupEnd

Decreases indentation of subsequent lines.

groupEnd: () => void

Property indent

Valid if an accumulating logger. Count of group calls without matching groupEnd.

indent?: number

Property isError

True if this is an accumulating logger and an error was logged.

isError?: boolean

Property isOrigin

True if this is an accumulating logger and the logger belongs to the object servicing the initial request.

isOrigin?: boolean

Property level

Optional. Logging levels that may influence what is logged.

'error' Only requests resulting in an exception should be logged. 'warn' Also log requests that succeed but with an abnormal condition. 'info' Also log normal successful requests. 'debug' Add input parm and result details where possible. 'trace' Instead of adding debug details, focus on execution path and timing.

level?: "error" | "warn" | "info" | "debug" | "trace"

Property log

Log a message.

log: (message?: any, ...optionalParams: any[]) => void

Property logs

Optional array of accumulated logged data and errors.

logs?: WalletLoggerLog[]
See also: WalletLoggerLog

Property merge

Merge log data from another logger.

Typically used to merge log data from network request.

merge?: (log: WalletLoggerInterface) => void
See also: WalletLoggerInterface

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


Interface: WalletLoggerLog

export interface WalletLoggerLog {
    when: number;
    indent: number;
    log: string;
    isError?: boolean;
    isBegin?: boolean;
    isEnd?: boolean;
}

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


Interface: WalletOutput

export interface WalletOutput {
    satoshis: SatoshiValue;
    lockingScript?: HexString;
    spendable: boolean;
    customInstructions?: string;
    tags?: OutputTagStringUnder300Bytes[];
    outpoint: OutpointString;
    labels?: LabelStringUnder300Bytes[];
}

See also: HexString, LabelStringUnder300Bytes, OutpointString, OutputTagStringUnder300Bytes, SatoshiValue

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


Interface: WalletPayment

export interface WalletPayment {
    derivationPrefix: Base64String;
    derivationSuffix: Base64String;
    senderIdentityKey: PubKeyHex;
}

See also: Base64String, PubKeyHex

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


Interface: WalletWire

A Wallet Wire is an abstraction over a raw transport medium where binary data can be sent to and subsequently received from a wallet.

export default interface WalletWire {
    transmitToWallet: (message: number[]) => Promise<number[]>;
}

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


Classes

CachedKeyDeriver WERR_REVIEW_ACTIONS
HTTPWalletJSON WalletClient
HTTPWalletWire WalletError
KeyDeriver WalletWireProcessor
ProtoWallet WalletWireTransceiver
ReactNativeWebView WindowCWISubstrate
WERR_INSUFFICIENT_FUNDS XDMSubstrate
WERR_INVALID_PARAMETER

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


Class: CachedKeyDeriver

A cached version of KeyDeriver that caches the results of key derivation methods. This is useful for optimizing performance when the same keys are derived multiple times. It supports configurable cache size with sane defaults and maintains cache entries using LRU (Least Recently Used) eviction policy.

export default class CachedKeyDeriver implements KeyDeriverApi {
    rootKey: PrivateKey;
    identityKey: string;
    constructor(rootKey: PrivateKey | "anyone", options?: {
        maxCacheSize?: number;
    }) 
    derivePublicKey(protocolID: WalletProtocol, keyID: string, counterparty: Counterparty, forSelf: boolean = false): PublicKey 
    derivePrivateKey(protocolID: WalletProtocol, keyID: string, counterparty: Counterparty): PrivateKey 
    deriveSymmetricKey(protocolID: WalletProtocol, keyID: string, counterparty: Counterparty): SymmetricKey 
    revealCounterpartySecret(counterparty: Counterparty): number[] 
    revealSpecificSecret(counterparty: Counterparty, protocolID: WalletProtocol, keyID: string): number[] 
}

See also: Counterparty, KeyDeriverApi, PrivateKey, PublicKey, SymmetricKey, WalletProtocol

Constructor

Initializes the CachedKeyDeriver instance with a root private key and optional cache settings.

constructor(rootKey: PrivateKey | "anyone", options?: {
    maxCacheSize?: number;
}) 
See also: PrivateKey

Argument Details

  • rootKey
  • The root private key or the string 'anyone'.
  • options
  • Optional settings for the cache.

Property identityKey

The identity of this key deriver which is normally the public key associated with the rootKey

identityKey: string

Property rootKey

The root key from which all other keys are derived.

rootKey: PrivateKey
See also: PrivateKey

Method derivePrivateKey

Derives a private key based on protocol ID, key ID, and counterparty. Caches the result for future calls with the same parameters.

derivePrivateKey(protocolID: WalletProtocol, keyID: string, counterparty: Counterparty): PrivateKey 
See also: Counterparty, PrivateKey, WalletProtocol

Returns

  • The derived private key.

Argument Details

  • protocolID
  • The protocol ID including a security level and protocol name.
  • keyID
  • The key identifier.
  • counterparty
  • The counterparty's public key or a predefined value ('self' or 'anyone').

Method derivePublicKey

Derives a public key based on protocol ID, key ID, and counterparty. Caches the result for future calls with the same parameters.

derivePublicKey(protocolID: WalletProtocol, keyID: string, counterparty: Counterparty, forSelf: boolean = false): PublicKey 
See also: Counterparty, PublicKey, WalletProtocol

Returns

  • The derived public key.

Argument Details

  • protocolID
  • The protocol ID including a security level and protocol name.
  • keyID
  • The key identifier.
  • counterparty
  • The counterparty's public key or a predefined value ('self' or 'anyone').
  • forSelf
  • Whether deriving for self.

Method deriveSymmetricKey

Derives a symmetric key based on protocol ID, key ID, and counterparty. Caches the result for future calls with the same parameters.

deriveSymmetricKey(protocolID: WalletProtocol, keyID: string, counterparty: Counterparty): SymmetricKey 
See also: Counterparty, SymmetricKey, WalletProtocol

Returns

  • The derived symmetric key.

Argument Details

  • protocolID
  • The protocol ID including a security level and protocol name.
  • keyID
  • The key identifier.
  • counterparty
  • The counterparty's public key or a predefined value ('self' or 'anyone').

Throws

  • Throws an error if attempting to derive a symmetric key for 'anyone'.

Method revealCounterpartySecret

Reveals the shared secret between the root key and the counterparty. Caches the result for future calls with the same parameters.

revealCounterpartySecret(counterparty: Counterparty): number[] 
See also: Counterparty

Returns

  • The shared secret as a number array.

Argument Details

  • counterparty
  • The counterparty's public key or a predefined value ('self' or 'anyone').

Throws

  • Throws an error if attempting to reveal a shared secret for 'self'.

Method revealSpecificSecret

Reveals the specific key association for a given protocol ID, key ID, and counterparty. Caches the result for future calls with the same parameters.

revealSpecificSecret(counterparty: Counterparty, protocolID: WalletProtocol, keyID: string): number[] 
See also: Counterparty, WalletProtocol

Returns

  • The specific key association as a number array.

Argument Details

  • counterparty
  • The counterparty's public key or a predefined value ('self' or 'anyone').
  • protocolID
  • The protocol ID including a security level and protocol name.
  • keyID
  • The key identifier.

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


Class: HTTPWalletJSON

export default class HTTPWalletJSON implements WalletInterface {
    baseUrl: string;
    httpClient: typeof fetch;
    originator: OriginatorDomainNameStringUnder250Bytes | undefined;
    api: (call: string, args: object) => Promise<unknown>;
    constructor(originator: OriginatorDomainNameStringUnder250Bytes | undefined, baseUrl: string = "http://localhost:3321", httpClient = fetch) 
    async createAction(args: CreateActionArgs): Promise<CreateActionResult> 
    async signAction(args: SignActionArgs): Promise<SignActionResult> 
    async abortAction(args: {
        reference: Base64String;
    }): Promise<{
        aborted: true;
    }> 
    async listActions(args: ListActionsArgs): Promise<ListActionsResult> 
    async internalizeAction(args: InternalizeActionArgs): Promise<{
        accepted: true;
    }> 
    async listOutputs(args: ListOutputsArgs): Promise<ListOutputsResult> 
    async relinquishOutput(args: {
        basket: BasketStringUnder300Bytes;
        output: OutpointString;
    }): Promise<{
        relinquished: true;
    }> 
    async getPublicKey(args: {
        seekPermission?: BooleanDefaultTrue;
        identityKey?: true;
        protocolID?: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID?: KeyIDStringUnder800Bytes;
        privileged?: BooleanDefaultFalse;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        forSelf?: BooleanDefaultFalse;
    }): Promise<{
        publicKey: PubKeyHex;
    }> 
    async revealCounterpartyKeyLinkage(args: {
        counterparty: PubKeyHex;
        verifier: PubKeyHex;
        privilegedReason?: DescriptionString5to50Bytes;
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        prover: PubKeyHex;
        verifier: PubKeyHex;
        counterparty: PubKeyHex;
        revelationTime: ISOTimestampString;
        encryptedLinkage: Byte[];
        encryptedLinkageProof: number[];
    }> 
    async revealSpecificKeyLinkage(args: {
        counterparty: PubKeyHex;
        verifier: PubKeyHex;
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        prover: PubKeyHex;
        verifier: PubKeyHex;
        counterparty: PubKeyHex;
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        encryptedLinkage: Byte[];
        encryptedLinkageProof: Byte[];
        proofType: Byte;
    }> 
    async encrypt(args: {
        seekPermission?: BooleanDefaultTrue;
        plaintext: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        ciphertext: Byte[];
    }> 
    async decrypt(args: {
        seekPermission?: BooleanDefaultTrue;
        ciphertext: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        plaintext: Byte[];
    }> 
    async createHmac(args: {
        seekPermission?: BooleanDefaultTrue;
        data: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        hmac: Byte[];
    }> 
    async verifyHmac(args: {
        seekPermission?: BooleanDefaultTrue;
        data: Byte[];
        hmac: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        valid: true;
    }> 
    async createSignature(args: {
        seekPermission?: BooleanDefaultTrue;
        data?: Byte[];
        hashToDirectlySign?: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        signature: Byte[];
    }> 
    async verifySignature(args: {
        seekPermission?: BooleanDefaultTrue;
        data?: Byte[];
        hashToDirectlyVerify?: Byte[];
        signature: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        forSelf?: BooleanDefaultFalse;
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        valid: true;
    }> 
    async acquireCertificate(args: AcquireCertificateArgs): Promise<AcquireCertificateResult> 
    async listCertificates(args: {
        certifiers: PubKeyHex[];
        types: Base64String[];
        limit?: PositiveIntegerDefault10Max10000;
        offset?: PositiveIntegerOrZero;
        privileged?: BooleanDefaultFalse;
        privilegedReason?: DescriptionString5to50Bytes;
    }): Promise<ListCertificatesResult> 
    async proveCertificate(args: ProveCertificateArgs): Promise<ProveCertificateResult> 
    async relinquishCertificate(args: {
        type: Base64String;
        serialNumber: Base64String;
        certifier: PubKeyHex;
    }): Promise<{
        relinquished: true;
    }> 
    async discoverByIdentityKey(args: {
        seekPermission?: BooleanDefaultTrue;
        identityKey: PubKeyHex;
        limit?: PositiveIntegerDefault10Max10000;
        offset?: PositiveIntegerOrZero;
    }): Promise<DiscoverCertificatesResult> 
    async discoverByAttributes(args: {
        seekPermission?: BooleanDefaultTrue;
        attributes: Record<CertificateFieldNameUnder50Bytes, string>;
        limit?: PositiveIntegerDefault10Max10000;
        offset?: PositiveIntegerOrZero;
    }): Promise<DiscoverCertificatesResult> 
    async isAuthenticated(args: object): Promise<{
        authenticated: true;
    }> 
    async waitForAuthentication(args: object): Promise<{
        authenticated: true;
    }> 
    async getHeight(args: object): Promise<{
        height: PositiveInteger;
    }> 
    async getHeaderForHeight(args: {
        height: PositiveInteger;
    }): Promise<{
        header: HexString;
    }> 
    async getNetwork(args: object): Promise<{
        network: "mainnet" | "testnet";
    }> 
    async getVersion(args: object): Promise<{
        version: VersionString7To30Bytes;
    }> 
}

See also: AcquireCertificateArgs, AcquireCertificateResult, Base64String, BasketStringUnder300Bytes, BooleanDefaultFalse, BooleanDefaultTrue, Byte, CertificateFieldNameUnder50Bytes, CreateActionArgs, CreateActionResult, DescriptionString5to50Bytes, DiscoverCertificatesResult, HexString, ISOTimestampString, InternalizeActionArgs, KeyIDStringUnder800Bytes, ListActionsArgs, ListActionsResult, ListCertificatesResult, ListOutputsArgs, ListOutputsResult, OriginatorDomainNameStringUnder250Bytes, OutpointString, PositiveInteger, PositiveIntegerDefault10Max10000, PositiveIntegerOrZero, ProtocolString5To400Bytes, ProveCertificateArgs, ProveCertificateResult, PubKeyHex, SecurityLevel, SignActionArgs, SignActionResult, VersionString7To30Bytes, WalletInterface, decrypt, encrypt

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


Class: HTTPWalletWire

export default class HTTPWalletWire implements WalletWire {
    baseUrl: string;
    httpClient: typeof fetch;
    originator: string | undefined;
    constructor(originator: string | undefined, baseUrl: string = "http://localhost:3301", httpClient = fetch) 
    async transmitToWallet(message: number[]): Promise<number[]> 
}

See also: WalletWire

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


Class: KeyDeriver

Class responsible for deriving various types of keys using a root private key. It supports deriving public and private keys, symmetric keys, and revealing key linkages.

export class KeyDeriver implements KeyDeriverApi {
    rootKey: PrivateKey;
    identityKey: string;
    constructor(rootKey: PrivateKey | "anyone", private readonly cacheSharedSecret?: ((priv: PrivateKey, pub: Point, point: Point) => void), private readonly retrieveCachedSharedSecret?: ((priv: PrivateKey, pub: Point) => (Point | undefined))) 
    derivePublicKey(protocolID: WalletProtocol, keyID: string, counterparty: Counterparty, forSelf: boolean = false): PublicKey 
    derivePrivateKey(protocolID: WalletProtocol, keyID: string, counterparty: Counterparty): PrivateKey 
    deriveSymmetricKey(protocolID: WalletProtocol, keyID: string, counterparty: Counterparty): SymmetricKey 
    revealCounterpartySecret(counterparty: Counterparty): number[] 
    revealSpecificSecret(counterparty: Counterparty, protocolID: WalletProtocol, keyID: string): number[] 
}

See also: Counterparty, KeyDeriverApi, Point, PrivateKey, PublicKey, SymmetricKey, WalletProtocol

Constructor

Initializes the KeyDeriver instance with a root private key.

constructor(rootKey: PrivateKey | "anyone", private readonly cacheSharedSecret?: ((priv: PrivateKey, pub: Point, point: Point) => void), private readonly retrieveCachedSharedSecret?: ((priv: PrivateKey, pub: Point) => (Point | undefined))) 
See also: Point, PrivateKey

Argument Details

  • rootKey
  • The root private key or the string 'anyone'.

Method derivePrivateKey

Derives a private key based on protocol ID, key ID, and counterparty.

derivePrivateKey(protocolID: WalletProtocol, keyID: string, counterparty: Counterparty): PrivateKey 
See also: Counterparty, PrivateKey, WalletProtocol

Returns

  • The derived private key.

Argument Details

  • protocolID
  • The protocol ID including a security level and protocol name.
  • keyID
  • The key identifier.
  • counterparty
  • The counterparty's public key or a predefined value ('self' or 'anyone').

Method derivePublicKey

Derives a public key based on protocol ID, key ID, and counterparty.

derivePublicKey(protocolID: WalletProtocol, keyID: string, counterparty: Counterparty, forSelf: boolean = false): PublicKey 
See also: Counterparty, PublicKey, WalletProtocol

Returns

  • The derived public key.

Argument Details

  • protocolID
  • The protocol ID including a security level and protocol name.
  • keyID
  • The key identifier.
  • counterparty
  • The counterparty's public key or a predefined value ('self' or 'anyone').
  • forSelf
  • Whether deriving for self.

Method deriveSymmetricKey

Derives a symmetric key based on protocol ID, key ID, and counterparty. Note: Symmetric keys should not be derivable by everyone due to security risks.

deriveSymmetricKey(protocolID: WalletProtocol, keyID: string, counterparty: Counterparty): SymmetricKey 
See also: Counterparty, SymmetricKey, WalletProtocol

Returns

  • The derived symmetric key.

Argument Details

  • protocolID
  • The protocol ID including a security level and protocol name.
  • keyID
  • The key identifier.
  • counterparty
  • The counterparty's public key or a predefined value ('self' or 'anyone').

Method revealCounterpartySecret

Reveals the shared secret between the root key and the counterparty. Note: This should not be used for 'self'.

revealCounterpartySecret(counterparty: Counterparty): number[] 
See also: Counterparty

Returns

  • The shared secret as a number array.

Argument Details

  • counterparty
  • The counterparty's public key or a predefined value ('self' or 'anyone').

Throws

  • Throws an error if attempting to reveal a shared secret for 'self'.

Method revealSpecificSecret

Reveals the specific key association for a given protocol ID, key ID, and counterparty.

revealSpecificSecret(counterparty: Counterparty, protocolID: WalletProtocol, keyID: string): number[] 
See also: Counterparty, WalletProtocol

Returns

  • The specific key association as a number array.

Argument Details

  • counterparty
  • The counterparty's public key or a predefined value ('self' or 'anyone').
  • protocolID
  • The protocol ID including a security level and protocol name.
  • keyID
  • The key identifier.

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


Class: ProtoWallet

A ProtoWallet is precursor to a full wallet, capable of performing all foundational cryptographic operations. It can derive keys, create signatures, facilitate encryption and HMAC operations, and reveal key linkages.

However, ProtoWallet does not create transactions, manage outputs, interact with the blockchain, enable the management of identity certificates, or store any data. It is also not concerned with privileged keys.

export class ProtoWallet {
    keyDeriver?: KeyDeriverApi;
    constructor(rootKeyOrKeyDeriver?: PrivateKey | "anyone" | KeyDeriverApi) 
    async getPublicKey(args: GetPublicKeyArgs): Promise<{
        publicKey: PubKeyHex;
    }> 
    async revealCounterpartyKeyLinkage(args: RevealCounterpartyKeyLinkageArgs): Promise<RevealCounterpartyKeyLinkageResult> 
    async revealSpecificKeyLinkage(args: RevealSpecificKeyLinkageArgs): Promise<RevealSpecificKeyLinkageResult> 
    async encrypt(args: WalletEncryptArgs): Promise<WalletEncryptResult> 
    async decrypt(args: WalletDecryptArgs, originator?: string): Promise<WalletDecryptResult> 
    async createHmac(args: CreateHmacArgs): Promise<CreateHmacResult> 
    async verifyHmac(args: VerifyHmacArgs): Promise<VerifyHmacResult> 
    async createSignature(args: CreateSignatureArgs): Promise<CreateSignatureResult> 
    async verifySignature(args: VerifySignatureArgs): Promise<VerifySignatureResult> 
}

See also: CreateHmacArgs, CreateHmacResult, CreateSignatureArgs, CreateSignatureResult, GetPublicKeyArgs, KeyDeriverApi, PrivateKey, PubKeyHex, RevealCounterpartyKeyLinkageArgs, RevealCounterpartyKeyLinkageResult, RevealSpecificKeyLinkageArgs, RevealSpecificKeyLinkageResult, VerifyHmacArgs, VerifyHmacResult, VerifySignatureArgs, VerifySignatureResult, WalletDecryptArgs, WalletDecryptResult, WalletEncryptArgs, WalletEncryptResult, decrypt, encrypt

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


Class: ReactNativeWebView

Facilitates wallet operations over cross-document messaging.

export default class ReactNativeWebView implements WalletInterface {
    constructor(domain: string = "*") 
    async invoke(call: CallType, args: any): Promise<any> 
    async createAction(args: {
        description: DescriptionString5to50Bytes;
        inputs?: Array<{
            tx?: BEEF;
            outpoint: OutpointString;
            unlockingScript?: HexString;
            unlockingScriptLength?: PositiveInteger;
            inputDescription: DescriptionString5to50Bytes;
            sequenceNumber?: PositiveIntegerOrZero;
        }>;
        outputs?: Array<{
            lockingScript: HexString;
            satoshis: SatoshiValue;
            outputDescription: DescriptionString5to50Bytes;
            basket?: BasketStringUnder300Bytes;
            customInstructions?: string;
            tags?: OutputTagStringUnder300Bytes[];
        }>;
        lockTime?: PositiveIntegerOrZero;
        version?: PositiveIntegerOrZero;
        labels?: LabelStringUnder300Bytes[];
        options?: {
            signAndProcess?: BooleanDefaultTrue;
            acceptDelayedBroadcast?: BooleanDefaultTrue;
            trustSelf?: "known";
            knownTxids?: TXIDHexString[];
            returnTXIDOnly?: BooleanDefaultFalse;
            noSend?: BooleanDefaultFalse;
            noSendChange?: OutpointString[];
            sendWith?: TXIDHexString[];
        };
    }): Promise<{
        txid?: TXIDHexString;
        tx?: BEEF;
        noSendChange?: OutpointString[];
        sendWithResults?: Array<{
            txid: TXIDHexString;
            status: "unproven" | "sending" | "failed";
        }>;
        signableTransaction?: {
            tx: BEEF;
            reference: Base64String;
        };
    }> 
    async signAction(args: {
        spends: Record<PositiveIntegerOrZero, {
            unlockingScript: HexString;
            sequenceNumber?: PositiveIntegerOrZero;
        }>;
        reference: Base64String;
        options?: {
            acceptDelayedBroadcast?: BooleanDefaultTrue;
            returnTXIDOnly?: BooleanDefaultFalse;
            noSend?: BooleanDefaultFalse;
            noSendChange?: OutpointString[];
            sendWith: TXIDHexString[];
        };
    }): Promise<{
        txid?: TXIDHexString;
        tx?: BEEF;
        noSendChange?: OutpointString[];
        sendWithResults?: Array<{
            txid: TXIDHexString;
            status: "unproven" | "sending" | "failed";
        }>;
    }> 
    async abortAction(args: {
        reference: Base64String;
    }): Promise<{
        aborted: true;
    }> 
    async listActions(args: {
        labels: LabelStringUnder300Bytes[];
        labelQueryMode?: "any" | "all";
        includeLabels?: BooleanDefaultFalse;
        includeInputs?: BooleanDefaultFalse;
        includeInputSourceLockingScripts?: BooleanDefaultFalse;
        includeInputUnlockingScripts?: BooleanDefaultFalse;
        includeOutputs?: BooleanDefaultFalse;
        includeOutputLockingScripts?: BooleanDefaultFalse;
        limit?: PositiveIntegerDefault10Max10000;
        offset?: PositiveIntegerOrZero;
    }): Promise<{
        totalActions: PositiveIntegerOrZero;
        actions: Array<{
            txid: TXIDHexString;
            satoshis: SatoshiValue;
            status: "completed" | "unprocessed" | "sending" | "unproven" | "unsigned" | "nosend" | "nonfinal";
            isOutgoing: boolean;
            description: DescriptionString5to50Bytes;
            labels?: LabelStringUnder300Bytes[];
            version: PositiveIntegerOrZero;
            lockTime: PositiveIntegerOrZero;
            inputs?: Array<{
                sourceOutpoint: OutpointString;
                sourceSatoshis: SatoshiValue;
                sourceLockingScript?: HexString;
                unlockingScript?: HexString;
                inputDescription: DescriptionString5to50Bytes;
                sequenceNumber: PositiveIntegerOrZero;
            }>;
            outputs?: Array<{
                outputIndex: PositiveIntegerOrZero;
                satoshis: SatoshiValue;
                lockingScript?: HexString;
                spendable: boolean;
                outputDescription: DescriptionString5to50Bytes;
                basket: BasketStringUnder300Bytes;
                tags: OutputTagStringUnder300Bytes[];
                customInstructions?: string;
            }>;
        }>;
    }> 
    async internalizeAction(args: {
        tx: BEEF;
        outputs: Array<{
            outputIndex: PositiveIntegerOrZero;
            protocol: "wallet payment" | "basket insertion";
            paymentRemittance?: {
                derivationPrefix: Base64String;
                derivationSuffix: Base64String;
                senderIdentityKey: PubKeyHex;
            };
            insertionRemittance?: {
                basket: BasketStringUnder300Bytes;
                customInstructions?: string;
                tags?: OutputTagStringUnder300Bytes[];
            };
        }>;
        description: DescriptionString5to50Bytes;
        labels?: LabelStringUnder300Bytes[];
    }): Promise<{
        accepted: true;
    }> 
    async listOutputs(args: {
        basket: BasketStringUnder300Bytes;
        tags?: OutputTagStringUnder300Bytes[];
        tagQueryMode?: "all" | "any";
        include?: "locking scripts" | "entire transactions";
        includeCustomInstructions?: BooleanDefaultFalse;
        includeTags?: BooleanDefaultFalse;
        includeLabels?: BooleanDefaultFalse;
        limit?: PositiveIntegerDefault10Max10000;
        offset?: PositiveIntegerOrZero;
    }): Promise<{
        totalOutputs: PositiveIntegerOrZero;
        outputs: Array<{
            outpoint: OutpointString;
            satoshis: SatoshiValue;
            lockingScript?: HexString;
            tx?: BEEF;
            spendable: boolean;
            customInstructions?: string;
            tags?: OutputTagStringUnder300Bytes[];
            labels?: LabelStringUnder300Bytes[];
        }>;
    }> 
    async relinquishOutput(args: {
        basket: BasketStringUnder300Bytes;
        output: OutpointString;
    }): Promise<{
        relinquished: true;
    }> 
    async getPublicKey(args: {
        identityKey?: true;
        protocolID?: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID?: KeyIDStringUnder800Bytes;
        privileged?: BooleanDefaultFalse;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        forSelf?: BooleanDefaultFalse;
    }): Promise<{
        publicKey: PubKeyHex;
    }> 
    async revealCounterpartyKeyLinkage(args: {
        counterparty: PubKeyHex;
        verifier: PubKeyHex;
        privilegedReason?: DescriptionString5to50Bytes;
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        prover: PubKeyHex;
        verifier: PubKeyHex;
        counterparty: PubKeyHex;
        revelationTime: ISOTimestampString;
        encryptedLinkage: Byte[];
        encryptedLinkageProof: Byte[];
    }> 
    async revealSpecificKeyLinkage(args: {
        counterparty: PubKeyHex;
        verifier: PubKeyHex;
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        prover: PubKeyHex;
        verifier: PubKeyHex;
        counterparty: PubKeyHex;
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        encryptedLinkage: Byte[];
        encryptedLinkageProof: Byte[];
        proofType: Byte;
    }> 
    async encrypt(args: {
        plaintext: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        ciphertext: Byte[];
    }> 
    async decrypt(args: {
        ciphertext: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        plaintext: Byte[];
    }> 
    async createHmac(args: {
        data: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        hmac: Byte[];
    }> 
    async verifyHmac(args: {
        data: Byte[];
        hmac: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        valid: true;
    }> 
    async createSignature(args: {
        data?: Byte[];
        hashToDirectlySign?: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        signature: Byte[];
    }> 
    async verifySignature(args: {
        data?: Byte[];
        hashToDirectlyVerify?: Byte[];
        signature: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        forSelf?: BooleanDefaultFalse;
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        valid: true;
    }> 
    async acquireCertificate(args: {
        type: Base64String;
        subject: PubKeyHex;
        serialNumber: Base64String;
        revocationOutpoint: OutpointString;
        signature: HexString;
        fields: Record<CertificateFieldNameUnder50Bytes, string>;
        certifier: PubKeyHex;
        keyringRevealer: PubKeyHex | "certifier";
        keyringForSubject: Record<CertificateFieldNameUnder50Bytes, Base64String>;
        acquisitionProtocol: "direct" | "issuance";
        certifierUrl?: string;
    }): Promise<{
        type: Base64String;
        subject: PubKeyHex;
        serialNumber: Base64String;
        certifier: PubKeyHex;
        revocationOutpoint: OutpointString;
        signature: HexString;
        fields: Record<CertificateFieldNameUnder50Bytes, string>;
    }> 
    async listCertificates(args: {
        certifiers: PubKeyHex[];
        types: Base64String[];
        limit?: PositiveIntegerDefault10Max10000;
        offset?: PositiveIntegerOrZero;
        privileged?: BooleanDefaultFalse;
        privilegedReason?: DescriptionString5to50Bytes;
    }): Promise<{
        totalCertificates: PositiveIntegerOrZero;
        certificates: Array<{
            type: Base64String;
            subject: PubKeyHex;
            serialNumber: Base64String;
            certifier: PubKeyHex;
            revocationOutpoint: OutpointString;
            signature: HexString;
            fields: Record<CertificateFieldNameUnder50Bytes, string>;
        }>;
    }> 
    async proveCertificate(args: {
        certificate: {
            type: Base64String;
            subject: PubKeyHex;
            serialNumber: Base64String;
            certifier: PubKeyHex;
            revocationOutpoint: OutpointString;
            signature: HexString;
            fields: Record<CertificateFieldNameUnder50Bytes, string>;
        };
        fieldsToReveal: CertificateFieldNameUnder50Bytes[];
        verifier: PubKeyHex;
        privileged?: BooleanDefaultFalse;
        privilegedReason?: DescriptionString5to50Bytes;
    }): Promise<{
        keyringForVerifier: Record<CertificateFieldNameUnder50Bytes, Base64String>;
    }> 
    async relinquishCertificate(args: {
        type: Base64String;
        serialNumber: Base64String;
        certifier: PubKeyHex;
    }): Promise<{
        relinquished: true;
    }> 
    async discoverByIdentityKey(args: {
        identityKey: PubKeyHex;
        limit?: PositiveIntegerDefault10Max10000;
        offset?: PositiveIntegerOrZero;
    }): Promise<{
        totalCertificates: PositiveIntegerOrZero;
        certificates: Array<{
            type: Base64String;
            subject: PubKeyHex;
            serialNumber: Base64String;
            certifier: PubKeyHex;
            revocationOutpoint: OutpointString;
            signature: HexString;
            fields: Record<CertificateFieldNameUnder50Bytes, Base64String>;
            certifierInfo: {
                name: EntityNameStringMax100Bytes;
                iconUrl: EntityIconURLStringMax500Bytes;
                description: DescriptionString5to50Bytes;
                trust: PositiveIntegerMax10;
            };
            publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
            decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
        }>;
    }> 
    async discoverByAttributes(args: {
        attributes: Record<CertificateFieldNameUnder50Bytes, string>;
        limit?: PositiveIntegerDefault10Max10000;
        offset?: PositiveIntegerOrZero;
    }): Promise<{
        totalCertificates: PositiveIntegerOrZero;
        certificates: Array<{
            type: Base64String;
            subject: PubKeyHex;
            serialNumber: Base64String;
            certifier: PubKeyHex;
            revocationOutpoint: OutpointString;
            signature: HexString;
            fields: Record<CertificateFieldNameUnder50Bytes, Base64String>;
            certifierInfo: {
                name: EntityNameStringMax100Bytes;
                iconUrl: EntityIconURLStringMax500Bytes;
                description: DescriptionString5to50Bytes;
                trust: PositiveIntegerMax10;
            };
            publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
            decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
        }>;
    }> 
    async isAuthenticated(args: {}): Promise<{
        authenticated: true;
    }> 
    async waitForAuthentication(args: {}): Promise<{
        authenticated: true;
    }> 
    async getHeight(args: {}): Promise<{
        height: PositiveInteger;
    }> 
    async getHeaderForHeight(args: {
        height: PositiveInteger;
    }): Promise<{
        header: HexString;
    }> 
    async getNetwork(args: {}): Promise<{
        network: "mainnet" | "testnet";
    }> 
    async getVersion(args: {}): Promise<{
        version: VersionString7To30Bytes;
    }> 
}

See also: BEEF, Base64String, BasketStringUnder300Bytes, BooleanDefaultFalse, BooleanDefaultTrue, Byte, CallType, CertificateFieldNameUnder50Bytes, DescriptionString5to50Bytes, EntityIconURLStringMax500Bytes, EntityNameStringMax100Bytes, HexString, ISOTimestampString, KeyIDStringUnder800Bytes, LabelStringUnder300Bytes, OutpointString, OutputTagStringUnder300Bytes, PositiveInteger, PositiveIntegerDefault10Max10000, PositiveIntegerMax10, PositiveIntegerOrZero, ProtocolString5To400Bytes, PubKeyHex, SatoshiValue, SecurityLevel, TXIDHexString, VersionString7To30Bytes, WalletInterface, decrypt, encrypt

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


Class: WERR_INSUFFICIENT_FUNDS

Insufficient funds in the available inputs to cover the cost of the required outputs and the transaction fee (${moreSatoshisNeeded} more satoshis are needed, for a total of ${totalSatoshisNeeded}), plus whatever would be required in order to pay the fee to unlock and spend the outputs used to provide the additional satoshis.

export class WERR_INSUFFICIENT_FUNDS extends Error {
    code: number;
    isError: boolean = true;
    constructor(public totalSatoshisNeeded: number, public moreSatoshisNeeded: number) 
}

Constructor

constructor(public totalSatoshisNeeded: number, public moreSatoshisNeeded: number) 

Argument Details

  • totalSatoshisNeeded
  • Total satoshis required to fund transactions after net of required inputs and outputs.
  • moreSatoshisNeeded
  • Shortfall on total satoshis required to fund transactions after net of required inputs and outputs.

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


Class: WERR_INVALID_PARAMETER

The ${parameter} parameter is invalid.

This is an example of an error object with a custom property parameter and templated message.

export class WERR_INVALID_PARAMETER extends Error {
    code: number;
    isError: boolean = true;
    constructor(public parameter: string, mustBe?: string) 
}

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


Class: WERR_REVIEW_ACTIONS

When a createAction or signAction is completed in undelayed mode (acceptDelayedBroadcast: false), any unsucccessful result will return the results by way of this exception to ensure attention is paid to processing errors.

export class WERR_REVIEW_ACTIONS extends Error {
    code: number;
    isError: boolean = true;
    constructor(public reviewActionResults: ReviewActionResult[], public sendWithResults: SendWithResult[], public txid?: TXIDHexString, public tx?: AtomicBEEF, public noSendChange?: OutpointString[]) 
}

See also: AtomicBEEF, OutpointString, ReviewActionResult, SendWithResult, TXIDHexString

Constructor

All parameters correspond to their comparable createAction or signSction results with the exception of reviewActionResults; which contains more details, particularly for double spend results.

constructor(public reviewActionResults: ReviewActionResult[], public sendWithResults: SendWithResult[], public txid?: TXIDHexString, public tx?: AtomicBEEF, public noSendChange?: OutpointString[]) 
See also: AtomicBEEF, OutpointString, ReviewActionResult, SendWithResult, TXIDHexString

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


Class: WalletClient

The SDK is how applications communicate with wallets over a communications substrate.

export default class WalletClient implements WalletInterface {
    public substrate: "auto" | WalletInterface;
    originator?: OriginatorDomainNameStringUnder250Bytes;
    constructor(substrate: "auto" | "Cicada" | "XDM" | "window.CWI" | "json-api" | "react-native" | "secure-json-api" | WalletInterface = "auto", originator?: OriginatorDomainNameStringUnder250Bytes) 
    async connectToSubstrate(): Promise<void> 
    async createAction(args: CreateActionArgs): Promise<CreateActionResult> 
    async signAction(args: SignActionArgs): Promise<SignActionResult> 
    async abortAction(args: {
        reference: Base64String;
    }): Promise<{
        aborted: true;
    }> 
    async listActions(args: ListActionsArgs): Promise<ListActionsResult> 
    async internalizeAction(args: InternalizeActionArgs): Promise<{
        accepted: true;
    }> 
    async listOutputs(args: ListOutputsArgs): Promise<ListOutputsResult> 
    async relinquishOutput(args: {
        basket: BasketStringUnder300Bytes;
        output: OutpointString;
    }): Promise<{
        relinquished: true;
    }> 
    async getPublicKey(args: {
        identityKey?: true;
        protocolID?: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID?: KeyIDStringUnder800Bytes;
        privileged?: BooleanDefaultFalse;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        forSelf?: BooleanDefaultFalse;
    }): Promise<{
        publicKey: PubKeyHex;
    }> 
    async revealCounterpartyKeyLinkage(args: {
        counterparty: PubKeyHex;
        verifier: PubKeyHex;
        privilegedReason?: DescriptionString5to50Bytes;
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        prover: PubKeyHex;
        verifier: PubKeyHex;
        counterparty: PubKeyHex;
        revelationTime: ISOTimestampString;
        encryptedLinkage: Byte[];
        encryptedLinkageProof: Byte[];
    }> 
    async revealSpecificKeyLinkage(args: {
        counterparty: PubKeyHex;
        verifier: PubKeyHex;
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        prover: PubKeyHex;
        verifier: PubKeyHex;
        counterparty: PubKeyHex;
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        encryptedLinkage: Byte[];
        encryptedLinkageProof: Byte[];
        proofType: Byte;
    }> 
    async encrypt(args: {
        plaintext: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        ciphertext: Byte[];
    }> 
    async decrypt(args: {
        ciphertext: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        plaintext: Byte[];
    }> 
    async createHmac(args: {
        data: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        hmac: Byte[];
    }> 
    async verifyHmac(args: {
        data: Byte[];
        hmac: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        valid: true;
    }> 
    async createSignature(args: {
        data?: Byte[];
        hashToDirectlySign?: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        signature: Byte[];
    }> 
    async verifySignature(args: {
        data?: Byte[];
        hashToDirectlyVerify?: Byte[];
        signature: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        forSelf?: BooleanDefaultFalse;
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        valid: true;
    }> 
    async acquireCertificate(args: AcquireCertificateArgs): Promise<AcquireCertificateResult> 
    async listCertificates(args: {
        certifiers: PubKeyHex[];
        types: Base64String[];
        limit?: PositiveIntegerDefault10Max10000;
        offset?: PositiveIntegerOrZero;
        privileged?: BooleanDefaultFalse;
        privilegedReason?: DescriptionString5to50Bytes;
    }): Promise<ListCertificatesResult> 
    async proveCertificate(args: ProveCertificateArgs): Promise<ProveCertificateResult> 
    async relinquishCertificate(args: {
        type: Base64String;
        serialNumber: Base64String;
        certifier: PubKeyHex;
    }): Promise<{
        relinquished: true;
    }> 
    async discoverByIdentityKey(args: {
        identityKey: PubKeyHex;
        limit?: PositiveIntegerDefault10Max10000;
        offset?: PositiveIntegerOrZero;
    }): Promise<DiscoverCertificatesResult> 
    async discoverByAttributes(args: {
        attributes: Record<CertificateFieldNameUnder50Bytes, string>;
        limit?: PositiveIntegerDefault10Max10000;
        offset?: PositiveIntegerOrZero;
    }): Promise<DiscoverCertificatesResult> 
    async isAuthenticated(args: object = {}): Promise<AuthenticatedResult> 
    async waitForAuthentication(args: object = {}): Promise<{
        authenticated: true;
    }> 
    async getHeight(args: object = {}): Promise<{
        height: PositiveInteger;
    }> 
    async getHeaderForHeight(args: {
        height: PositiveInteger;
    }): Promise<{
        header: HexString;
    }> 
    async getNetwork(args: object = {}): Promise<{
        network: "mainnet" | "testnet";
    }> 
    async getVersion(args: object = {}): Promise<{
        version: VersionString7To30Bytes;
    }> 
}

See also: AcquireCertificateArgs, AcquireCertificateResult, AuthenticatedResult, Base64String, BasketStringUnder300Bytes, BooleanDefaultFalse, Byte, CertificateFieldNameUnder50Bytes, CreateActionArgs, CreateActionResult, DescriptionString5to50Bytes, DiscoverCertificatesResult, HexString, ISOTimestampString, InternalizeActionArgs, KeyIDStringUnder800Bytes, ListActionsArgs, ListActionsResult, ListCertificatesResult, ListOutputsArgs, ListOutputsResult, OriginatorDomainNameStringUnder250Bytes, OutpointString, PositiveInteger, PositiveIntegerDefault10Max10000, PositiveIntegerOrZero, ProtocolString5To400Bytes, ProveCertificateArgs, ProveCertificateResult, PubKeyHex, SecurityLevel, SignActionArgs, SignActionResult, VersionString7To30Bytes, WalletInterface, decrypt, encrypt

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


Class: WalletError

export class WalletError extends Error {
    code: number;
    isError: boolean = true;
    constructor(message: string, code = 1, stack?: string) 
    static unknownToJson(error: any): string 
}

Method unknownToJson

Safely serializes a WalletError (including special cases), Error or unknown error to JSON.

Safely means avoiding deep, large, circular issues.

Example deserialization can be found in HTTPWalletJSON.ts of bsv ts-sdk.

static unknownToJson(error: any): string 

Returns

stringified JSON representation of the error such that it can be deserialized to a WalletError.

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


Class: WalletWireProcessor

Processes incoming wallet calls received over a wallet wire, with a given wallet.

export default class WalletWireProcessor implements WalletWire {
    wallet: WalletInterface;
    constructor(wallet: WalletInterface) 
    async transmitToWallet(message: number[]): Promise<number[]> 
}

See also: WalletInterface, WalletWire

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


Class: WalletWireTransceiver

A way to make remote calls to a wallet over a wallet wire.

export default class WalletWireTransceiver implements WalletInterface {
    wire: WalletWire;
    constructor(wire: WalletWire) 
    async createAction(args: CreateActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateActionResult> 
    async signAction(args: SignActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<SignActionResult> 
    async abortAction(args: {
        reference: Base64String;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        aborted: true;
    }> 
    async listActions(args: ListActionsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListActionsResult> 
    async internalizeAction(args: InternalizeActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        accepted: true;
    }> 
    async listOutputs(args: ListOutputsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListOutputsResult> 
    async relinquishOutput(args: {
        basket: BasketStringUnder300Bytes;
        output: OutpointString;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        relinquished: true;
    }> 
    async getPublicKey(args: {
        seekPermission?: BooleanDefaultTrue;
        identityKey?: true;
        protocolID?: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID?: KeyIDStringUnder800Bytes;
        privileged?: BooleanDefaultFalse;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        forSelf?: BooleanDefaultFalse;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        publicKey: PubKeyHex;
    }> 
    async revealCounterpartyKeyLinkage(args: {
        counterparty: PubKeyHex;
        verifier: PubKeyHex;
        privilegedReason?: DescriptionString5to50Bytes;
        privileged?: BooleanDefaultFalse;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        prover: PubKeyHex;
        verifier: PubKeyHex;
        counterparty: PubKeyHex;
        revelationTime: ISOTimestampString;
        encryptedLinkage: Byte[];
        encryptedLinkageProof: number[];
    }> 
    async revealSpecificKeyLinkage(args: {
        counterparty: PubKeyHex;
        verifier: PubKeyHex;
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        privileged?: BooleanDefaultFalse;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        prover: PubKeyHex;
        verifier: PubKeyHex;
        counterparty: PubKeyHex;
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        encryptedLinkage: Byte[];
        encryptedLinkageProof: Byte[];
        proofType: Byte;
    }> 
    async encrypt(args: {
        seekPermission?: BooleanDefaultTrue;
        plaintext: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        ciphertext: Byte[];
    }> 
    async decrypt(args: {
        seekPermission?: BooleanDefaultTrue;
        ciphertext: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        plaintext: Byte[];
    }> 
    async createHmac(args: {
        seekPermission?: BooleanDefaultTrue;
        data: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        hmac: Byte[];
    }> 
    async verifyHmac(args: {
        seekPermission?: BooleanDefaultTrue;
        data: Byte[];
        hmac: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        valid: true;
    }> 
    async createSignature(args: {
        seekPermission?: BooleanDefaultTrue;
        data?: Byte[];
        hashToDirectlySign?: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        signature: Byte[];
    }> 
    async verifySignature(args: {
        seekPermission?: BooleanDefaultTrue;
        data?: Byte[];
        hashToDirectlyVerify?: Byte[];
        signature: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        forSelf?: BooleanDefaultFalse;
        privileged?: BooleanDefaultFalse;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        valid: true;
    }> 
    async acquireCertificate(args: AcquireCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AcquireCertificateResult> 
    async listCertificates(args: {
        certifiers: PubKeyHex[];
        types: Base64String[];
        limit?: PositiveIntegerDefault10Max10000;
        offset?: PositiveIntegerOrZero;
        privileged?: BooleanDefaultFalse;
        privilegedReason?: DescriptionString5to50Bytes;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListCertificatesResult> 
    async proveCertificate(args: ProveCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ProveCertificateResult> 
    async relinquishCertificate(args: {
        type: Base64String;
        serialNumber: Base64String;
        certifier: PubKeyHex;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        relinquished: true;
    }> 
    async discoverByIdentityKey(args: {
        seekPermission?: BooleanDefaultTrue;
        identityKey: PubKeyHex;
        limit?: PositiveIntegerDefault10Max10000;
        offset?: PositiveIntegerOrZero;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<DiscoverCertificatesResult> 
    async discoverByAttributes(args: {
        seekPermission?: BooleanDefaultTrue;
        attributes: Record<CertificateFieldNameUnder50Bytes, string>;
        limit?: PositiveIntegerDefault10Max10000;
        offset?: PositiveIntegerOrZero;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<DiscoverCertificatesResult> 
    async isAuthenticated(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        authenticated: true;
    }> 
    async waitForAuthentication(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        authenticated: true;
    }> 
    async getHeight(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        height: PositiveInteger;
    }> 
    async getHeaderForHeight(args: {
        height: PositiveInteger;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        header: HexString;
    }> 
    async getNetwork(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        network: "mainnet" | "testnet";
    }> 
    async getVersion(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        version: VersionString7To30Bytes;
    }> 
}

See also: AcquireCertificateArgs, AcquireCertificateResult, Base64String, BasketStringUnder300Bytes, BooleanDefaultFalse, BooleanDefaultTrue, Byte, CertificateFieldNameUnder50Bytes, CreateActionArgs, CreateActionResult, DescriptionString5to50Bytes, DiscoverCertificatesResult, HexString, ISOTimestampString, InternalizeActionArgs, KeyIDStringUnder800Bytes, ListActionsArgs, ListActionsResult, ListCertificatesResult, ListOutputsArgs, ListOutputsResult, OriginatorDomainNameStringUnder250Bytes, OutpointString, PositiveInteger, PositiveIntegerDefault10Max10000, PositiveIntegerOrZero, ProtocolString5To400Bytes, ProveCertificateArgs, ProveCertificateResult, PubKeyHex, SecurityLevel, SignActionArgs, SignActionResult, VersionString7To30Bytes, WalletInterface, WalletWire, decrypt, encrypt

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


Class: WindowCWISubstrate

Facilitates wallet operations over the window.CWI interface.

export default class WindowCWISubstrate implements WalletInterface {
    constructor() 
    async createAction(args: {
        description: DescriptionString5to50Bytes;
        inputs?: Array<{
            tx?: BEEF;
            outpoint: OutpointString;
            unlockingScript?: HexString;
            unlockingScriptLength?: PositiveInteger;
            inputDescription: DescriptionString5to50Bytes;
            sequenceNumber?: PositiveIntegerOrZero;
        }>;
        outputs?: Array<{
            lockingScript: HexString;
            satoshis: SatoshiValue;
            outputDescription: DescriptionString5to50Bytes;
            basket?: BasketStringUnder300Bytes;
            customInstructions?: string;
            tags?: OutputTagStringUnder300Bytes[];
        }>;
        lockTime?: PositiveIntegerOrZero;
        version?: PositiveIntegerOrZero;
        labels?: LabelStringUnder300Bytes[];
        options?: {
            signAndProcess?: BooleanDefaultTrue;
            acceptDelayedBroadcast?: BooleanDefaultTrue;
            trustSelf?: "known";
            knownTxids?: TXIDHexString[];
            returnTXIDOnly?: BooleanDefaultFalse;
            noSend?: BooleanDefaultFalse;
            noSendChange?: OutpointString[];
            sendWith?: TXIDHexString[];
        };
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        txid?: TXIDHexString;
        tx?: BEEF;
        noSendChange?: OutpointString[];
        sendWithResults?: Array<{
            txid: TXIDHexString;
            status: "unproven" | "sending" | "failed";
        }>;
        signableTransaction?: {
            tx: BEEF;
            reference: Base64String;
        };
    }> 
    async signAction(args: {
        spends: Record<PositiveIntegerOrZero, {
            unlockingScript: HexString;
            sequenceNumber?: PositiveIntegerOrZero;
        }>;
        reference: Base64String;
        options?: {
            acceptDelayedBroadcast?: BooleanDefaultTrue;
            returnTXIDOnly?: BooleanDefaultFalse;
            noSend?: BooleanDefaultFalse;
            noSendChange?: OutpointString[];
            sendWith: TXIDHexString[];
        };
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        txid?: TXIDHexString;
        tx?: BEEF;
        noSendChange?: OutpointString[];
        sendWithResults?: Array<{
            txid: TXIDHexString;
            status: "unproven" | "sending" | "failed";
        }>;
    }> 
    async abortAction(args: {
        reference: Base64String;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        aborted: true;
    }> 
    async listActions(args: {
        labels: LabelStringUnder300Bytes[];
        labelQueryMode?: "any" | "all";
        includeLabels?: BooleanDefaultFalse;
        includeInputs?: BooleanDefaultFalse;
        includeInputSourceLockingScripts?: BooleanDefaultFalse;
        includeInputUnlockingScripts?: BooleanDefaultFalse;
        includeOutputs?: BooleanDefaultFalse;
        includeOutputLockingScripts?: BooleanDefaultFalse;
        limit?: PositiveIntegerDefault10Max10000;
        offset?: PositiveIntegerOrZero;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        totalActions: PositiveIntegerOrZero;
        actions: Array<{
            txid: TXIDHexString;
            satoshis: SatoshiValue;
            status: "completed" | "unprocessed" | "sending" | "unproven" | "unsigned" | "nosend" | "nonfinal" | "failed";
            isOutgoing: boolean;
            description: DescriptionString5to50Bytes;
            labels?: LabelStringUnder300Bytes[];
            version: PositiveIntegerOrZero;
            lockTime: PositiveIntegerOrZero;
            inputs?: Array<{
                sourceOutpoint: OutpointString;
                sourceSatoshis: SatoshiValue;
                sourceLockingScript?: HexString;
                unlockingScript?: HexString;
                inputDescription: DescriptionString5to50Bytes;
                sequenceNumber: PositiveIntegerOrZero;
            }>;
            outputs?: Array<{
                outputIndex: PositiveIntegerOrZero;
                satoshis: SatoshiValue;
                lockingScript?: HexString;
                spendable: boolean;
                outputDescription: DescriptionString5to50Bytes;
                basket: BasketStringUnder300Bytes;
                tags: OutputTagStringUnder300Bytes[];
                customInstructions?: string;
            }>;
        }>;
    }> 
    async internalizeAction(args: {
        tx: BEEF;
        outputs: Array<{
            outputIndex: PositiveIntegerOrZero;
            protocol: "wallet payment" | "basket insertion";
            paymentRemittance?: {
                derivationPrefix: Base64String;
                derivationSuffix: Base64String;
                senderIdentityKey: PubKeyHex;
            };
            insertionRemittance?: {
                basket: BasketStringUnder300Bytes;
                customInstructions?: string;
                tags?: OutputTagStringUnder300Bytes[];
            };
        }>;
        description: DescriptionString5to50Bytes;
        labels?: LabelStringUnder300Bytes[];
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        accepted: true;
    }> 
    async listOutputs(args: {
        basket: BasketStringUnder300Bytes;
        tags?: OutputTagStringUnder300Bytes[];
        tagQueryMode?: "all" | "any";
        include?: "locking scripts" | "entire transactions";
        includeCustomInstructions?: BooleanDefaultFalse;
        includeTags?: BooleanDefaultFalse;
        includeLabels?: BooleanDefaultFalse;
        limit?: PositiveIntegerDefault10Max10000;
        offset?: PositiveIntegerOrZero;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        totalOutputs: PositiveIntegerOrZero;
        outputs: Array<{
            outpoint: OutpointString;
            satoshis: SatoshiValue;
            lockingScript?: HexString;
            tx?: BEEF;
            spendable: boolean;
            customInstructions?: string;
            tags?: OutputTagStringUnder300Bytes[];
            labels?: LabelStringUnder300Bytes[];
        }>;
    }> 
    async relinquishOutput(args: {
        basket: BasketStringUnder300Bytes;
        output: OutpointString;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        relinquished: true;
    }> 
    async getPublicKey(args: {
        identityKey?: true;
        protocolID?: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID?: KeyIDStringUnder800Bytes;
        privileged?: BooleanDefaultFalse;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        forSelf?: BooleanDefaultFalse;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        publicKey: PubKeyHex;
    }> 
    async revealCounterpartyKeyLinkage(args: {
        counterparty: PubKeyHex;
        verifier: PubKeyHex;
        privilegedReason?: DescriptionString5to50Bytes;
        privileged?: BooleanDefaultFalse;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        prover: PubKeyHex;
        verifier: PubKeyHex;
        counterparty: PubKeyHex;
        revelationTime: ISOTimestampString;
        encryptedLinkage: Byte[];
        encryptedLinkageProof: Byte[];
    }> 
    async revealSpecificKeyLinkage(args: {
        counterparty: PubKeyHex;
        verifier: PubKeyHex;
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        privileged?: BooleanDefaultFalse;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        prover: PubKeyHex;
        verifier: PubKeyHex;
        counterparty: PubKeyHex;
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        encryptedLinkage: Byte[];
        encryptedLinkageProof: Byte[];
        proofType: Byte;
    }> 
    async encrypt(args: {
        plaintext: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        ciphertext: Byte[];
    }> 
    async decrypt(args: {
        ciphertext: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        plaintext: Byte[];
    }> 
    async createHmac(args: {
        data: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        hmac: Byte[];
    }> 
    async verifyHmac(args: {
        data: Byte[];
        hmac: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        valid: true;
    }> 
    async createSignature(args: {
        data?: Byte[];
        hashToDirectlySign?: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        signature: Byte[];
    }> 
    async verifySignature(args: {
        data?: Byte[];
        hashToDirectlyVerify?: Byte[];
        signature: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        forSelf?: BooleanDefaultFalse;
        privileged?: BooleanDefaultFalse;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        valid: true;
    }> 
    async acquireCertificate(args: {
        type: Base64String;
        subject: PubKeyHex;
        serialNumber: Base64String;
        revocationOutpoint: OutpointString;
        signature: HexString;
        fields: Record<CertificateFieldNameUnder50Bytes, string>;
        certifier: PubKeyHex;
        keyringRevealer: PubKeyHex | "certifier";
        keyringForSubject: Record<CertificateFieldNameUnder50Bytes, Base64String>;
        acquisitionProtocol: "direct" | "issuance";
        certifierUrl?: string;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        type: Base64String;
        subject: PubKeyHex;
        serialNumber: Base64String;
        certifier: PubKeyHex;
        revocationOutpoint: OutpointString;
        signature: HexString;
        fields: Record<CertificateFieldNameUnder50Bytes, string>;
    }> 
    async listCertificates(args: {
        certifiers: PubKeyHex[];
        types: Base64String[];
        limit?: PositiveIntegerDefault10Max10000;
        offset?: PositiveIntegerOrZero;
        privileged?: BooleanDefaultFalse;
        privilegedReason?: DescriptionString5to50Bytes;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        totalCertificates: PositiveIntegerOrZero;
        certificates: Array<{
            type: Base64String;
            subject: PubKeyHex;
            serialNumber: Base64String;
            certifier: PubKeyHex;
            revocationOutpoint: OutpointString;
            signature: HexString;
            fields: Record<CertificateFieldNameUnder50Bytes, string>;
        }>;
    }> 
    async proveCertificate(args: {
        certificate: {
            type: Base64String;
            subject: PubKeyHex;
            serialNumber: Base64String;
            certifier: PubKeyHex;
            revocationOutpoint: OutpointString;
            signature: HexString;
            fields: Record<CertificateFieldNameUnder50Bytes, string>;
        };
        fieldsToReveal: CertificateFieldNameUnder50Bytes[];
        verifier: PubKeyHex;
        privileged?: BooleanDefaultFalse;
        privilegedReason?: DescriptionString5to50Bytes;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        keyringForVerifier: Record<CertificateFieldNameUnder50Bytes, Base64String>;
    }> 
    async relinquishCertificate(args: {
        type: Base64String;
        serialNumber: Base64String;
        certifier: PubKeyHex;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        relinquished: true;
    }> 
    async discoverByIdentityKey(args: {
        identityKey: PubKeyHex;
        limit?: PositiveIntegerDefault10Max10000;
        offset?: PositiveIntegerOrZero;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        totalCertificates: PositiveIntegerOrZero;
        certificates: Array<{
            type: Base64String;
            subject: PubKeyHex;
            serialNumber: Base64String;
            certifier: PubKeyHex;
            revocationOutpoint: OutpointString;
            signature: HexString;
            fields: Record<CertificateFieldNameUnder50Bytes, Base64String>;
            certifierInfo: {
                name: EntityNameStringMax100Bytes;
                iconUrl: EntityIconURLStringMax500Bytes;
                description: DescriptionString5to50Bytes;
                trust: PositiveIntegerMax10;
            };
            publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
            decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
        }>;
    }> 
    async discoverByAttributes(args: {
        attributes: Record<CertificateFieldNameUnder50Bytes, string>;
        limit?: PositiveIntegerDefault10Max10000;
        offset?: PositiveIntegerOrZero;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        totalCertificates: PositiveIntegerOrZero;
        certificates: Array<{
            type: Base64String;
            subject: PubKeyHex;
            serialNumber: Base64String;
            certifier: PubKeyHex;
            revocationOutpoint: OutpointString;
            signature: HexString;
            fields: Record<CertificateFieldNameUnder50Bytes, Base64String>;
            certifierInfo: {
                name: EntityNameStringMax100Bytes;
                iconUrl: EntityIconURLStringMax500Bytes;
                description: DescriptionString5to50Bytes;
                trust: PositiveIntegerMax10;
            };
            publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
            decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
        }>;
    }> 
    async isAuthenticated(args: object, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        authenticated: true;
    }> 
    async waitForAuthentication(args: object, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        authenticated: true;
    }> 
    async getHeight(args: object, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        height: PositiveInteger;
    }> 
    async getHeaderForHeight(args: {
        height: PositiveInteger;
    }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        header: HexString;
    }> 
    async getNetwork(args: object, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        network: "mainnet" | "testnet";
    }> 
    async getVersion(args: object, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
        version: VersionString7To30Bytes;
    }> 
}

See also: BEEF, Base64String, BasketStringUnder300Bytes, BooleanDefaultFalse, BooleanDefaultTrue, Byte, CertificateFieldNameUnder50Bytes, DescriptionString5to50Bytes, EntityIconURLStringMax500Bytes, EntityNameStringMax100Bytes, HexString, ISOTimestampString, KeyIDStringUnder800Bytes, LabelStringUnder300Bytes, OriginatorDomainNameStringUnder250Bytes, OutpointString, OutputTagStringUnder300Bytes, PositiveInteger, PositiveIntegerDefault10Max10000, PositiveIntegerMax10, PositiveIntegerOrZero, ProtocolString5To400Bytes, PubKeyHex, SatoshiValue, SecurityLevel, TXIDHexString, VersionString7To30Bytes, WalletInterface, decrypt, encrypt

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


Class: XDMSubstrate

Facilitates wallet operations over cross-document messaging.

export default class XDMSubstrate implements WalletInterface {
    constructor(domain: string = "*") 
    async invoke(call: CallType, args: any): Promise<any> 
    async createAction(args: {
        description: DescriptionString5to50Bytes;
        inputs?: Array<{
            tx?: BEEF;
            outpoint: OutpointString;
            unlockingScript?: HexString;
            unlockingScriptLength?: PositiveInteger;
            inputDescription: DescriptionString5to50Bytes;
            sequenceNumber?: PositiveIntegerOrZero;
        }>;
        outputs?: Array<{
            lockingScript: HexString;
            satoshis: SatoshiValue;
            outputDescription: DescriptionString5to50Bytes;
            basket?: BasketStringUnder300Bytes;
            customInstructions?: string;
            tags?: OutputTagStringUnder300Bytes[];
        }>;
        lockTime?: PositiveIntegerOrZero;
        version?: PositiveIntegerOrZero;
        labels?: LabelStringUnder300Bytes[];
        options?: {
            signAndProcess?: BooleanDefaultTrue;
            acceptDelayedBroadcast?: BooleanDefaultTrue;
            trustSelf?: "known";
            knownTxids?: TXIDHexString[];
            returnTXIDOnly?: BooleanDefaultFalse;
            noSend?: BooleanDefaultFalse;
            noSendChange?: OutpointString[];
            sendWith?: TXIDHexString[];
        };
    }): Promise<{
        txid?: TXIDHexString;
        tx?: BEEF;
        noSendChange?: OutpointString[];
        sendWithResults?: Array<{
            txid: TXIDHexString;
            status: "unproven" | "sending" | "failed";
        }>;
        signableTransaction?: {
            tx: BEEF;
            reference: Base64String;
        };
    }> 
    async signAction(args: {
        spends: Record<PositiveIntegerOrZero, {
            unlockingScript: HexString;
            sequenceNumber?: PositiveIntegerOrZero;
        }>;
        reference: Base64String;
        options?: {
            acceptDelayedBroadcast?: BooleanDefaultTrue;
            returnTXIDOnly?: BooleanDefaultFalse;
            noSend?: BooleanDefaultFalse;
            noSendChange?: OutpointString[];
            sendWith: TXIDHexString[];
        };
    }): Promise<{
        txid?: TXIDHexString;
        tx?: BEEF;
        noSendChange?: OutpointString[];
        sendWithResults?: Array<{
            txid: TXIDHexString;
            status: "unproven" | "sending" | "failed";
        }>;
    }> 
    async abortAction(args: {
        reference: Base64String;
    }): Promise<{
        aborted: true;
    }> 
    async listActions(args: {
        labels: LabelStringUnder300Bytes[];
        labelQueryMode?: "any" | "all";
        includeLabels?: BooleanDefaultFalse;
        includeInputs?: BooleanDefaultFalse;
        includeInputSourceLockingScripts?: BooleanDefaultFalse;
        includeInputUnlockingScripts?: BooleanDefaultFalse;
        includeOutputs?: BooleanDefaultFalse;
        includeOutputLockingScripts?: BooleanDefaultFalse;
        limit?: PositiveIntegerDefault10Max10000;
        offset?: PositiveIntegerOrZero;
    }): Promise<{
        totalActions: PositiveIntegerOrZero;
        actions: Array<{
            txid: TXIDHexString;
            satoshis: SatoshiValue;
            status: "completed" | "unprocessed" | "sending" | "unproven" | "unsigned" | "nosend" | "nonfinal";
            isOutgoing: boolean;
            description: DescriptionString5to50Bytes;
            labels?: LabelStringUnder300Bytes[];
            version: PositiveIntegerOrZero;
            lockTime: PositiveIntegerOrZero;
            inputs?: Array<{
                sourceOutpoint: OutpointString;
                sourceSatoshis: SatoshiValue;
                sourceLockingScript?: HexString;
                unlockingScript?: HexString;
                inputDescription: DescriptionString5to50Bytes;
                sequenceNumber: PositiveIntegerOrZero;
            }>;
            outputs?: Array<{
                outputIndex: PositiveIntegerOrZero;
                satoshis: SatoshiValue;
                lockingScript?: HexString;
                spendable: boolean;
                outputDescription: DescriptionString5to50Bytes;
                basket: BasketStringUnder300Bytes;
                tags: OutputTagStringUnder300Bytes[];
                customInstructions?: string;
            }>;
        }>;
    }> 
    async internalizeAction(args: {
        tx: BEEF;
        outputs: Array<{
            outputIndex: PositiveIntegerOrZero;
            protocol: "wallet payment" | "basket insertion";
            paymentRemittance?: {
                derivationPrefix: Base64String;
                derivationSuffix: Base64String;
                senderIdentityKey: PubKeyHex;
            };
            insertionRemittance?: {
                basket: BasketStringUnder300Bytes;
                customInstructions?: string;
                tags?: OutputTagStringUnder300Bytes[];
            };
        }>;
        description: DescriptionString5to50Bytes;
        labels?: LabelStringUnder300Bytes[];
    }): Promise<{
        accepted: true;
    }> 
    async listOutputs(args: {
        basket: BasketStringUnder300Bytes;
        tags?: OutputTagStringUnder300Bytes[];
        tagQueryMode?: "all" | "any";
        include?: "locking scripts" | "entire transactions";
        includeCustomInstructions?: BooleanDefaultFalse;
        includeTags?: BooleanDefaultFalse;
        includeLabels?: BooleanDefaultFalse;
        limit?: PositiveIntegerDefault10Max10000;
        offset?: PositiveIntegerOrZero;
    }): Promise<{
        totalOutputs: PositiveIntegerOrZero;
        outputs: Array<{
            outpoint: OutpointString;
            satoshis: SatoshiValue;
            lockingScript?: HexString;
            tx?: BEEF;
            spendable: boolean;
            customInstructions?: string;
            tags?: OutputTagStringUnder300Bytes[];
            labels?: LabelStringUnder300Bytes[];
        }>;
    }> 
    async relinquishOutput(args: {
        basket: BasketStringUnder300Bytes;
        output: OutpointString;
    }): Promise<{
        relinquished: true;
    }> 
    async getPublicKey(args: {
        identityKey?: true;
        protocolID?: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID?: KeyIDStringUnder800Bytes;
        privileged?: BooleanDefaultFalse;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        forSelf?: BooleanDefaultFalse;
    }): Promise<{
        publicKey: PubKeyHex;
    }> 
    async revealCounterpartyKeyLinkage(args: {
        counterparty: PubKeyHex;
        verifier: PubKeyHex;
        privilegedReason?: DescriptionString5to50Bytes;
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        prover: PubKeyHex;
        verifier: PubKeyHex;
        counterparty: PubKeyHex;
        revelationTime: ISOTimestampString;
        encryptedLinkage: Byte[];
        encryptedLinkageProof: Byte[];
    }> 
    async revealSpecificKeyLinkage(args: {
        counterparty: PubKeyHex;
        verifier: PubKeyHex;
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        prover: PubKeyHex;
        verifier: PubKeyHex;
        counterparty: PubKeyHex;
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        encryptedLinkage: Byte[];
        encryptedLinkageProof: Byte[];
        proofType: Byte;
    }> 
    async encrypt(args: {
        plaintext: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        ciphertext: Byte[];
    }> 
    async decrypt(args: {
        ciphertext: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        plaintext: Byte[];
    }> 
    async createHmac(args: {
        data: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        hmac: Byte[];
    }> 
    async verifyHmac(args: {
        data: Byte[];
        hmac: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        valid: true;
    }> 
    async createSignature(args: {
        data?: Byte[];
        hashToDirectlySign?: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        signature: Byte[];
    }> 
    async verifySignature(args: {
        data?: Byte[];
        hashToDirectlyVerify?: Byte[];
        signature: Byte[];
        protocolID: [
            SecurityLevel,
            ProtocolString5To400Bytes
        ];
        keyID: KeyIDStringUnder800Bytes;
        privilegedReason?: DescriptionString5to50Bytes;
        counterparty?: PubKeyHex | "self" | "anyone";
        forSelf?: BooleanDefaultFalse;
        privileged?: BooleanDefaultFalse;
    }): Promise<{
        valid: true;
    }> 
    async acquireCertificate(args: {
        type: Base64String;
        subject: PubKeyHex;
        serialNumber: Base64String;
        revocationOutpoint: OutpointString;
        signature: HexString;
        fields: Record<CertificateFieldNameUnder50Bytes, string>;
        certifier: PubKeyHex;
        keyringRevealer: PubKeyHex | "certifier";
        keyringForSubject: Record<CertificateFieldNameUnder50Bytes, Base64String>;
        acquisitionProtocol: "direct" | "issuance";
        certifierUrl?: string;
    }): Promise<{
        type: Base64String;
        subject: PubKeyHex;
        serialNumber: Base64String;
        certifier: PubKeyHex;
        revocationOutpoint: OutpointString;
        signature: HexString;
        fields: Record<CertificateFieldNameUnder50Bytes, string>;
    }> 
    async listCertificates(args: {
        certifiers: PubKeyHex[];
        types: Base64String[];
        limit?: PositiveIntegerDefault10Max10000;
        offset?: PositiveIntegerOrZero;
        privileged?: BooleanDefaultFalse;
        privilegedReason?: DescriptionString5to50Bytes;
    }): Promise<{
        totalCertificates: PositiveIntegerOrZero;
        certificates: Array<{
            type: Base64String;
            subject: PubKeyHex;
            serialNumber: Base64String;
            certifier: PubKeyHex;
            revocationOutpoint: OutpointString;
            signature: HexString;
            fields: Record<CertificateFieldNameUnder50Bytes, string>;
        }>;
    }> 
    async proveCertificate(args: {
        certificate: {
            type: Base64String;
            subject: PubKeyHex;
            serialNumber: Base64String;
            certifier: PubKeyHex;
            revocationOutpoint: OutpointString;
            signature: HexString;
            fields: Record<CertificateFieldNameUnder50Bytes, string>;
        };
        fieldsToReveal: CertificateFieldNameUnder50Bytes[];
        verifier: PubKeyHex;
        privileged?: BooleanDefaultFalse;
        privilegedReason?: DescriptionString5to50Bytes;
    }): Promise<{
        keyringForVerifier: Record<CertificateFieldNameUnder50Bytes, Base64String>;
    }> 
    async relinquishCertificate(args: {
        type: Base64String;
        serialNumber: Base64String;
        certifier: PubKeyHex;
    }): Promise<{
        relinquished: true;
    }> 
    async discoverByIdentityKey(args: {
        identityKey: PubKeyHex;
        limit?: PositiveIntegerDefault10Max10000;
        offset?: PositiveIntegerOrZero;
    }): Promise<{
        totalCertificates: PositiveIntegerOrZero;
        certificates: Array<{
            type: Base64String;
            subject: PubKeyHex;
            serialNumber: Base64String;
            certifier: PubKeyHex;
            revocationOutpoint: OutpointString;
            signature: HexString;
            fields: Record<CertificateFieldNameUnder50Bytes, Base64String>;
            certifierInfo: {
                name: EntityNameStringMax100Bytes;
                iconUrl: EntityIconURLStringMax500Bytes;
                description: DescriptionString5to50Bytes;
                trust: PositiveIntegerMax10;
            };
            publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
            decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
        }>;
    }> 
    async discoverByAttributes(args: {
        attributes: Record<CertificateFieldNameUnder50Bytes, string>;
        limit?: PositiveIntegerDefault10Max10000;
        offset?: PositiveIntegerOrZero;
    }): Promise<{
        totalCertificates: PositiveIntegerOrZero;
        certificates: Array<{
            type: Base64String;
            subject: PubKeyHex;
            serialNumber: Base64String;
            certifier: PubKeyHex;
            revocationOutpoint: OutpointString;
            signature: HexString;
            fields: Record<CertificateFieldNameUnder50Bytes, Base64String>;
            certifierInfo: {
                name: EntityNameStringMax100Bytes;
                iconUrl: EntityIconURLStringMax500Bytes;
                description: DescriptionString5to50Bytes;
                trust: PositiveIntegerMax10;
            };
            publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
            decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
        }>;
    }> 
    async isAuthenticated(args: {}): Promise<{
        authenticated: true;
    }> 
    async waitForAuthentication(args: {}): Promise<{
        authenticated: true;
    }> 
    async getHeight(args: {}): Promise<{
        height: PositiveInteger;
    }> 
    async getHeaderForHeight(args: {
        height: PositiveInteger;
    }): Promise<{
        header: HexString;
    }> 
    async getNetwork(args: {}): Promise<{
        network: "mainnet" | "testnet";
    }> 
    async getVersion(args: {}): Promise<{
        version: VersionString7To30Bytes;
    }> 
}

See also: BEEF, Base64String, BasketStringUnder300Bytes, BooleanDefaultFalse, BooleanDefaultTrue, Byte, CallType, CertificateFieldNameUnder50Bytes, DescriptionString5to50Bytes, EntityIconURLStringMax500Bytes, EntityNameStringMax100Bytes, HexString, ISOTimestampString, KeyIDStringUnder800Bytes, LabelStringUnder300Bytes, OutpointString, OutputTagStringUnder300Bytes, PositiveInteger, PositiveIntegerDefault10Max10000, PositiveIntegerMax10, PositiveIntegerOrZero, ProtocolString5To400Bytes, PubKeyHex, SatoshiValue, SecurityLevel, TXIDHexString, VersionString7To30Bytes, WalletInterface, decrypt, encrypt

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


Functions

isHexString validateCreateActionOutput validateOriginator
parseWalletOutpoint validateDiscoverByAttributesArgs validateOutpointString
toOriginHeader validateDiscoverByIdentityKeyArgs validatePositiveIntegerOrZero
validateAbortActionArgs validateInteger validateProveCertificateArgs
validateAcquireDirectCertificateArgs validateInternalizeActionArgs validateRelinquishCertificateArgs
validateAcquireIssuanceCertificateArgs validateInternalizeOutput validateRelinquishOutputArgs
validateBase64String validateListActionsArgs validateSatoshis
validateBasketInsertion validateListCertificatesArgs validateSignActionArgs
validateCreateActionArgs validateListOutputsArgs validateSignActionOptions
validateCreateActionInput validateOptionalInteger validateStringLength
validateCreateActionOptions validateOptionalOutpointString validateWalletPayment

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


Function: isHexString

Check whether a string is a valid hex string (even length and hex characters).

export function isHexString(s: string): boolean 

Returns

true when s is a valid hex string

Argument Details

  • s
  • input string

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


Function: parseWalletOutpoint

export function parseWalletOutpoint(outpoint: string): {
    txid: string;
    vout: number;
} 

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


Function: toOriginHeader

export function toOriginHeader(originator: string, fallbackScheme = "http"): string | undefined 

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


Function: validateAbortActionArgs

Validate AbortActionArgs (ensures reference is a valid base64 string).

export function validateAbortActionArgs(args: AbortActionArgs): ValidAbortActionArgs 

See also: AbortActionArgs, ValidAbortActionArgs

Returns

ValidAbortActionArgs

Argument Details

  • args
  • AbortActionArgs

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


Function: validateAcquireDirectCertificateArgs

Validate direct-acquisition-specific acquire certificate args.

export function validateAcquireDirectCertificateArgs(args: AcquireCertificateArgs): ValidAcquireDirectCertificateArgs 

See also: AcquireCertificateArgs, ValidAcquireDirectCertificateArgs

Returns

ValidAcquireDirectCertificateArgs

Argument Details

  • args
  • AcquireCertificateArgs with acquisitionProtocol === 'direct'

Throws

when args contain fields invalid for direct acquisition

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


Function: validateAcquireIssuanceCertificateArgs

Validate issuance-specific acquire certificate args.

export function validateAcquireIssuanceCertificateArgs(args: AcquireCertificateArgs): ValidAcquireIssuanceCertificateArgs 

See also: AcquireCertificateArgs, ValidAcquireIssuanceCertificateArgs

Returns

ValidAcquireIssuanceCertificateArgs

Argument Details

  • args
  • AcquireCertificateArgs with acquisitionProtocol === 'issuance'

Throws

when args contain fields invalid for issuance

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


Function: validateBase64String

Validate a Base64 string (structure and decoded size).

export function validateBase64String(s: string, name: string, min?: number, max?: number): string 

Returns

validated base64 string

Argument Details

  • s
  • base64 string
  • name
  • parameter name used in error messages
  • min
  • optional minimum decoded byte length
  • max
  • optional maximum decoded byte length

Throws

WERR_INVALID_PARAMETER when invalid

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


Function: validateBasketInsertion

Validate a BasketInsertion structure (basket, custom instructions, tags).

export function validateBasketInsertion(args?: BasketInsertion): ValidBasketInsertion | undefined 

See also: BasketInsertion, ValidBasketInsertion

Returns

ValidBasketInsertion or undefined

Argument Details

  • args
  • BasketInsertion or undefined

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


Function: validateCreateActionArgs

Validate the arguments for creating a new action.

export function validateCreateActionArgs(args: CreateActionArgs, logger?: WalletLoggerInterface): ValidCreateActionArgs 

See also: CreateActionArgs, ValidCreateActionArgs, WalletLoggerInterface

Returns

validated arguments

Throws

primarily WERR_INVALID_PARAMETER if args are invalid.

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


Function: validateCreateActionInput

Validate a CreateActionInput structure.

Ensures either unlockingScript or unlockingScriptLength is provided and consistent, validates outpoint, description length, and sequence number.

export function validateCreateActionInput(i: CreateActionInput): ValidCreateActionInput 

See also: CreateActionInput, ValidCreateActionInput

Returns

ValidCreateActionInput

Argument Details

  • i
  • CreateActionInput to validate

Throws

WERR_INVALID_PARAMETER when invalid

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


Function: validateCreateActionOptions

Normalize and validate CreateActionOptions, applying defaults for booleans/numbers/arrays.

export function validateCreateActionOptions(options?: CreateActionOptions): ValidCreateActionOptions 

See also: CreateActionOptions, ValidCreateActionOptions

Returns

ValidCreateActionOptions with defaults applied

Argument Details

  • options
  • CreateActionOptions or undefined

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


Function: validateCreateActionOutput

Validate CreateActionOutput fields: locking script, satoshis, description, basket, tags.

export function validateCreateActionOutput(o: CreateActionOutput): ValidCreateActionOutput 

See also: CreateActionOutput, ValidCreateActionOutput

Returns

ValidCreateActionOutput

Argument Details

  • o
  • CreateActionOutput to validate

Throws

WERR_INVALID_PARAMETER when invalid

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


Function: validateDiscoverByAttributesArgs

Validate DiscoverByAttributesArgs: attributes, limit, offset, and permission flag.

export function validateDiscoverByAttributesArgs(args: DiscoverByAttributesArgs): ValidDiscoverByAttributesArgs 

See also: DiscoverByAttributesArgs, ValidDiscoverByAttributesArgs

Returns

ValidDiscoverByAttributesArgs

Argument Details

  • args
  • DiscoverByAttributesArgs

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


Function: validateDiscoverByIdentityKeyArgs

Validate DiscoverByIdentityKeyArgs, enforcing identity key length and defaults.

export function validateDiscoverByIdentityKeyArgs(args: DiscoverByIdentityKeyArgs): ValidDiscoverByIdentityKeyArgs 

See also: DiscoverByIdentityKeyArgs, ValidDiscoverByIdentityKeyArgs

Returns

ValidDiscoverByIdentityKeyArgs

Argument Details

  • args
  • DiscoverByIdentityKeyArgs

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


Function: validateInteger

Validate an integer, applying an optional default.

export function validateInteger(v: number | undefined, name: string, defaultValue?: number, min?: number, max?: number): number 

Returns

validated integer

Argument Details

  • v
  • value to validate (may be undefined)
  • name
  • parameter name used in error messages
  • defaultValue
  • value to return when v is undefined
  • min
  • optional minimum allowed value
  • max
  • optional maximum allowed value

Throws

WERR_INVALID_PARAMETER when invalid

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


Function: validateInternalizeActionArgs

Validate InternalizeActionArgs: tx, outputs, description, labels, permission flag.

export function validateInternalizeActionArgs(args: InternalizeActionArgs): ValidInternalizeActionArgs 

See also: InternalizeActionArgs, ValidInternalizeActionArgs

Returns

ValidInternalizeActionArgs

Argument Details

  • args
  • InternalizeActionArgs to validate

Throws

WERR_INVALID_PARAMETER when invalid

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


Function: validateInternalizeOutput

Validate an InternalizeOutput entry.

export function validateInternalizeOutput(args: InternalizeOutput): ValidInternalizeOutput 

See also: InternalizeOutput, ValidInternalizeOutput

Returns

ValidInternalizeOutput

Argument Details

  • args
  • InternalizeOutput to validate

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


Function: validateListActionsArgs

export function validateListActionsArgs(args: ListActionsArgs): ValidListActionsArgs 

See also: ListActionsArgs, ValidListActionsArgs

Argument Details

  • args.labels
  • An array of labels used to filter actions.
  • args.labelQueryMode
  • Optional. Specifies how to match labels (default is any which matches any of the labels).
  • args.includeLabels
  • Optional. Whether to include transaction labels in the result set.
  • args.includeInputs
  • Optional. Whether to include input details in the result set.
  • args.includeInputSourceLockingScripts
  • Optional. Whether to include input source locking scripts in the result set.
  • args.includeInputUnlockingScripts
  • Optional. Whether to include input unlocking scripts in the result set.
  • args.includeOutputs
  • Optional. Whether to include output details in the result set.
  • args.includeOutputLockingScripts
  • Optional. Whether to include output locking scripts in the result set.
  • args.limit
  • Optional. The maximum number of transactions to retrieve.
  • args.offset
  • Optional. Number of transactions to skip before starting to return the results.
  • args.seekPermission
  • — Optional. Whether to seek permission from the user for this operation if required. Default true, will return an error rather than proceed if set to false.

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


Function: validateListCertificatesArgs

Validate ListCertificatesArgs: certifiers, types, paging, and optional privileged reason.

export function validateListCertificatesArgs(args: ListCertificatesArgs): ValidListCertificatesArgs 

See also: ListCertificatesArgs, ValidListCertificatesArgs

Returns

ValidListCertificatesArgs

Argument Details

  • args
  • ListCertificatesArgs

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


Function: validateListOutputsArgs

export function validateListOutputsArgs(args: ListOutputsArgs): ValidListOutputsArgs 

See also: ListOutputsArgs, ValidListOutputsArgs

Argument Details

  • args.basket
  • Required. The associated basket name whose outputs should be listed.
  • args.tags
  • Optional. Filter outputs based on these tags.
  • args.tagQueryMode
  • Optional. Filter mode, defining whether all or any of the tags must match. By default, any tag can match.
  • args.include
  • Optional. Whether to include locking scripts (with each output) or entire transactions (as aggregated BEEF, at the top level) in the result. By default, unless specified, neither are returned.
  • args.includeEntireTransactions
  • Optional. Whether to include the entire transaction(s) in the result.
  • args.includeCustomInstructions
  • Optional. Whether custom instructions should be returned in the result.
  • args.includeTags
  • Optional. Whether the tags associated with the output should be returned.
  • args.includeLabels
  • Optional. Whether the labels associated with the transaction containing the output should be returned.
  • args.limit
  • Optional limit on the number of outputs to return.
  • args.offset
  • If positive or zero: Number of outputs to skip before starting to return results, oldest first. If negative: Outputs are returned newest first and offset of -1 is the newest output. When using negative offsets, caution is required as new outputs may be added between calls, potentially causing outputs to be duplicated across calls.
  • args.seekPermission
  • — Optional. Whether to seek permission from the user for this operation if required. Default true, will return an error rather than proceed if set to false.

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


Function: validateOptionalInteger

Validate an optional integer. Returns undefined or the validated integer.

export function validateOptionalInteger(v: number | undefined, name: string, min?: number, max?: number): number | undefined 

Returns

validated integer or undefined

Argument Details

  • v
  • value to validate (may be undefined)
  • name
  • parameter name used in error messages
  • min
  • optional minimum value
  • max
  • optional maximum value

Throws

WERR_INVALID_PARAMETER when invalid

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


Function: validateOptionalOutpointString

Validate an optional outpoint string (txid.vout).

export function validateOptionalOutpointString(outpoint: string | undefined, name: string): string | undefined 

Returns

validated outpoint string or undefined

Argument Details

  • outpoint
  • outpoint string or undefined
  • name
  • parameter name used in error messages

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


Function: validateOriginator

Validate originator string (trim/lowercase and part length checks).

export function validateOriginator(s?: string): string | undefined 

Returns

normalized originator or undefined

Argument Details

  • s
  • originator string or undefined

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


Function: validateOutpointString

Validate an outpoint string of the form txid.vout.

export function validateOutpointString(outpoint: string, name: string): string 

Returns

normalized outpoint string (validated txid and vout)

Argument Details

  • outpoint
  • outpoint string
  • name
  • parameter name used in error messages

Throws

WERR_INVALID_PARAMETER when invalid

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


Function: validatePositiveIntegerOrZero

Validate a non-negative integer (zero allowed).

export function validatePositiveIntegerOrZero(v: number, name: string): number 

Returns

validated integer

Argument Details

  • v
  • value to validate
  • name
  • parameter name used in error messages

Throws

WERR_INVALID_PARAMETER when invalid

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


Function: validateProveCertificateArgs

Validate ProveCertificateArgs including optional certificate fields and reveal list.

export function validateProveCertificateArgs(args: ProveCertificateArgs): ValidProveCertificateArgs 

See also: ProveCertificateArgs, ValidProveCertificateArgs

Returns

ValidProveCertificateArgs

Argument Details

  • args
  • ProveCertificateArgs

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


Function: validateRelinquishCertificateArgs

Validate RelinquishCertificateArgs (type, serialNumber, certifier).

export function validateRelinquishCertificateArgs(args: RelinquishCertificateArgs): ValidRelinquishCertificateArgs 

See also: RelinquishCertificateArgs, ValidRelinquishCertificateArgs

Returns

ValidRelinquishCertificateArgs

Argument Details

  • args
  • RelinquishCertificateArgs

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


Function: validateRelinquishOutputArgs

Validate RelinquishOutputArgs (basket and output).

export function validateRelinquishOutputArgs(args: RelinquishOutputArgs): ValidRelinquishOutputArgs 

See also: RelinquishOutputArgs, ValidRelinquishOutputArgs

Returns

ValidRelinquishOutputArgs

Argument Details

  • args
  • RelinquishOutputArgs

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


Function: validateSatoshis

Validate a satoshi amount.

export function validateSatoshis(v: number | undefined, name: string, min?: number): number 

Returns

validated satoshi number

Argument Details

  • v
  • value to validate (integer number of satoshis)
  • name
  • parameter name used in error messages
  • min
  • optional minimum allowed satoshi value

Throws

WERR_INVALID_PARAMETER when invalid

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


Function: validateSignActionArgs

Validate SignActionArgs and apply defaults/flags.

export function validateSignActionArgs(args: SignActionArgs): ValidSignActionArgs 

See also: SignActionArgs, ValidSignActionArgs

Returns

ValidSignActionArgs

Argument Details

  • args
  • SignActionArgs to validate

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


Function: validateSignActionOptions

Set all default true/false booleans to true or false if undefined. Set all possibly undefined numbers to their default values. Set all possibly undefined arrays to empty arrays. Convert string outpoints to { txid: string, vout: number }

export function validateSignActionOptions(options?: SignActionOptions): ValidSignActionOptions 

See also: SignActionOptions, ValidSignActionOptions

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


Function: validateStringLength

Validate string length in bytes for UTF-8 encoded string.

export function validateStringLength(s: string, name: string, min?: number, max?: number): string 

Returns

the original string when valid

Argument Details

  • s
  • string to validate
  • name
  • parameter name used in error messages
  • min
  • optional minimum byte length
  • max
  • optional maximum byte length

Throws

WERR_INVALID_PARAMETER when invalid

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


Function: validateWalletPayment

Validate wallet payment remittance structure.

export function validateWalletPayment(args?: WalletPayment): ValidWalletPayment | undefined 

See also: ValidWalletPayment, WalletPayment

Returns

ValidWalletPayment or undefined

Argument Details

  • args
  • WalletPayment or undefined

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


Types

AcquireCertificateResult EntityIconURLStringMax500Bytes PositiveIntegerMax10
AcquisitionProtocol EntityNameStringMax100Bytes PositiveIntegerOrZero
ActionStatus ErrorCodeString10To40Bytes ProtocolString5To400Bytes
AtomicBEEF ErrorDescriptionString20To200Bytes PubKeyHex
BEEF HexString ReviewActionResultStatus
Base64String ISOTimestampString SatoshiValue
BasketStringUnder300Bytes KeyIDStringUnder800Bytes SecurityLevel
BooleanDefaultFalse KeyringRevealer SendWithResultStatus
BooleanDefaultTrue LabelStringUnder300Bytes TXIDHexString
Byte MakeWalletLogger TrustSelf
CallType OriginatorDomainNameStringUnder250Bytes VersionString7To30Bytes
CertificateFieldNameUnder50Bytes OutpointString WalletCounterparty
Counterparty OutputTagStringUnder300Bytes WalletErrorCode
DescriptionString5to2000Bytes PositiveInteger WalletNetwork
DescriptionString5to50Bytes PositiveIntegerDefault10Max10000 WalletProtocol

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


Type: AcquireCertificateResult

export type AcquireCertificateResult = WalletCertificate

See also: WalletCertificate

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


Type: AcquisitionProtocol

export type AcquisitionProtocol = "direct" | "issuance"

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


Type: ActionStatus

export type ActionStatus = "completed" | "unprocessed" | "sending" | "unproven" | "unsigned" | "nosend" | "nonfinal" | "failed"

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


Type: AtomicBEEF

export type AtomicBEEF = Byte[]

See also: Byte

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


Type: BEEF

export type BEEF = Byte[]

See also: Byte

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


Type: Base64String

export type Base64String = string

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


Type: BasketStringUnder300Bytes

export type BasketStringUnder300Bytes = string

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


Type: BooleanDefaultFalse

export type BooleanDefaultFalse = boolean

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


Type: BooleanDefaultTrue

export type BooleanDefaultTrue = boolean

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


Type: Byte

export type Byte = number

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


Type: CallType

export type CallType = keyof typeof calls

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


Type: CertificateFieldNameUnder50Bytes

export type CertificateFieldNameUnder50Bytes = string

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


Type: Counterparty

export type Counterparty = PublicKey | PubKeyHex | "self" | "anyone"

See also: PubKeyHex, PublicKey

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


Type: DescriptionString5to2000Bytes

DescriptionString5to2000Bytes alias type (documented).

export type DescriptionString5to2000Bytes = string

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


Type: DescriptionString5to50Bytes

export type DescriptionString5to50Bytes = string

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


Type: EntityIconURLStringMax500Bytes

export type EntityIconURLStringMax500Bytes = string

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


Type: EntityNameStringMax100Bytes

export type EntityNameStringMax100Bytes = string

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


Type: ErrorCodeString10To40Bytes

export type ErrorCodeString10To40Bytes = string

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


Type: ErrorDescriptionString20To200Bytes

export type ErrorDescriptionString20To200Bytes = string

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


Type: HexString

export type HexString = string

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


Type: ISOTimestampString

export type ISOTimestampString = string

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


Type: KeyIDStringUnder800Bytes

export type KeyIDStringUnder800Bytes = string

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


Type: KeyringRevealer

export type KeyringRevealer = PubKeyHex | "certifier"

See also: PubKeyHex

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


Type: LabelStringUnder300Bytes

export type LabelStringUnder300Bytes = string

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


Type: MakeWalletLogger

export type MakeWalletLogger = (log?: string | WalletLoggerInterface) => WalletLoggerInterface

See also: WalletLoggerInterface

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


Type: OriginatorDomainNameStringUnder250Bytes

export type OriginatorDomainNameStringUnder250Bytes = string

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


Type: OutpointString

export type OutpointString = string

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


Type: OutputTagStringUnder300Bytes

export type OutputTagStringUnder300Bytes = string

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


Type: PositiveInteger

export type PositiveInteger = number

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


Type: PositiveIntegerDefault10Max10000

export type PositiveIntegerDefault10Max10000 = number

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


Type: PositiveIntegerMax10

export type PositiveIntegerMax10 = number

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


Type: PositiveIntegerOrZero

export type PositiveIntegerOrZero = number

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


Type: ProtocolString5To400Bytes

export type ProtocolString5To400Bytes = string

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


Type: PubKeyHex

export type PubKeyHex = HexString

See also: HexString

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


Type: ReviewActionResultStatus

Indicates status of a new Action following a createAction or signAction in immediate mode: When acceptDelayedBroadcast is falses.

'success': The action has been broadcast and accepted by the bitcoin processing network. 'doulbeSpend': The action has been confirmed to double spend one or more inputs, and by the "first-seen-rule" is the loosing transaction. 'invalidTx': The action was rejected by the processing network as an invalid bitcoin transaction. 'serviceError': The broadcast services are currently unable to reach the bitcoin network. The action is now queued for delayed retries.

export type ReviewActionResultStatus = "success" | "doubleSpend" | "serviceError" | "invalidTx"

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


Type: SatoshiValue

export type SatoshiValue = number

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


Type: SecurityLevel

SecurityLevel for protocols. 0 = Silently grants the request with no user interation. 1 = Requires user approval for every application. 2 = Requires user approval per counterparty per application.

export type SecurityLevel = 0 | 1 | 2

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


Type: SendWithResultStatus

export type SendWithResultStatus = "unproven" | "sending" | "failed"

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


Type: TXIDHexString

export type TXIDHexString = HexString

See also: HexString

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


Type: TrustSelf

Controls behavior of input BEEF validation.

If known, input transactions may omit supporting validity proof data for all TXIDs known to this wallet.

If undefined, input BEEFs must be complete and valid.

export type TrustSelf = "known"

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


Type: VersionString7To30Bytes

export type VersionString7To30Bytes = string

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


Type: WalletCounterparty

export type WalletCounterparty = PubKeyHex | "self" | "anyone"

See also: PubKeyHex

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


Type: WalletErrorCode

export type WalletErrorCode = keyof typeof walletErrors

See also: walletErrors

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


Type: WalletNetwork

export type WalletNetwork = "mainnet" | "testnet"

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


Type: WalletProtocol

export type WalletProtocol = [
    SecurityLevel,
    ProtocolString5To400Bytes
]

See also: ProtocolString5To400Bytes, SecurityLevel

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


Enums

SecurityLevels
walletErrors

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


Enum: SecurityLevels

export enum SecurityLevels {
    Silent = 0,
    App = 1,
    Counterparty = 2
}

See also: Counterparty

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


Enum: walletErrors

export enum walletErrors {
    unknownError = 1,
    unsupportedAction = 2,
    invalidHmac = 3,
    invalidSignature = 4,
    reviewActions = 5,
    invalidParameter = 6,
    insufficientFunds = 7
}

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


Variables

Variable: specOpThrowReviewActions

specOpThrowReviewActions = "a496e747fc3ad5fabdd4ae8f91184e71f87539bd3d962aa2548942faaaf0047a"

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