API
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interfaces
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interface: AbortActionArgs
See also: Base64String
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interface: AbortActionResult
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
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
See also: Byte, WalletEncryptionArgs
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interface: CreateHmacResult
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
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
See also: PositiveInteger
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interface: GetHeaderResult
See also: HexString
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interface: GetHeightResult
See also: PositiveInteger
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interface: GetNetworkResult
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
See also: PubKeyHex
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interface: GetVersionResult
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
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
Property derivePublicKey
Derives a public key based on protocol ID, key ID, and counterparty.
derivePublicKey: (protocolID: WalletProtocol, keyID: string, counterparty: Counterparty, forSelf?: boolean) => PublicKey
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
Property identityKey
The identity of this key deriver which is normally the public key associated with the rootKey
Property revealCounterpartySecret
Reveals the shared secret between the root key and the counterparty. Note: This should not be used for 'self'.
See also: CounterpartyProperty revealSpecificSecret
Reveals the specific key association for a given protocol ID, key ID, and counterparty.
revealSpecificSecret: (counterparty: Counterparty, protocolID: WalletProtocol, keyID: string) => number[]
Property rootKey
The root key from which all other keys are derived.
See also: PrivateKeyLinks: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interface: KeyLinkageResult
export interface KeyLinkageResult {
encryptedLinkage: Byte[];
encryptedLinkageProof: Byte[];
prover: PubKeyHex;
verifier: PubKeyHex;
counterparty: 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
Property txid
Transaction double sha256 hash as big endian hex string
Property vout
zero based output index within the transaction
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
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
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'.
Property competingTxs
Any competing txids reported for this txid, valid when status is 'doubleSpend'.
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interface: SendWithResult
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
See also: AtomicBEEF, Base64String
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interface: ValidAbortActionArgs
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
See also: PubKeyHexLinks: 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
See also: PubKeyHexLinks: 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.
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
See also: WalletLoggerInterface
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interface: VerifyHmacArgs
See also: Byte, WalletEncryptionArgs
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interface: VerifyHmacResult
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
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
See also: Byte, WalletEncryptionArgs
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interface: WalletDecryptResult
See also: Byte
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interface: WalletEncryptArgs
See also: Byte, WalletEncryptionArgs
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Interface: WalletEncryptResult
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.
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>
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>
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>
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>
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>
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>
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>
Property discoverByIdentityKey
Discovers identity certificates, issued to a given identity key by a trusted entity.
discoverByIdentityKey: (args: DiscoverByIdentityKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<DiscoverCertificatesResult>
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>
Property getHeaderForHeight
Retrieves the block header of a block at a specified height.
getHeaderForHeight: (args: GetHeaderArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<GetHeaderResult>
Property getHeight
Retrieves the current height of the blockchain.
getHeight: (args: object, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<GetHeightResult>
Property getNetwork
Retrieves the Bitcoin network the client is using (mainnet or testnet).
getNetwork: (args: object, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<GetNetworkResult>
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>
Property getVersion
Retrieves the current version string of the wallet.
getVersion: (args: object, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<GetVersionResult>
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>
Property isAuthenticated
Checks the authentication status of the user.
isAuthenticated: (args: object, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<AuthenticatedResult>
Property listActions
Lists all transactions matching the specified labels.
listActions: (args: ListActionsArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<ListActionsResult>
Property listCertificates
Lists identity certificates belonging to the user, filtered by certifier(s) and type(s).
listCertificates: (args: ListCertificatesArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<ListCertificatesResult>
Property listOutputs
Lists the spendable outputs kept within a specific basket, optionally tagged with specific labels.
listOutputs: (args: ListOutputsArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<ListOutputsResult>
Property proveCertificate
Proves select fields of an identity certificate, as specified, when requested by a verifier.
proveCertificate: (args: ProveCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<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>
Property relinquishOutput
Relinquish an output out of a basket, removing it from tracking without spending it.
relinquishOutput: (args: RelinquishOutputArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<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>
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>
Property signAction
Signs a transaction previously created using createAction.
signAction: (args: SignActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<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>
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>
Property waitForAuthentication
Continuously waits until the user is authenticated, returning the result once confirmed.
waitForAuthentication: (args: object, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<AuthenticatedResult>
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.
Property flush
Loggers may accumulate data instead of immediately handling it.
Loggers that do not accumulate should not implement this method.
Property group
Increases indentation of subsequent lines.
If one or more labels are provided, those are printed first without the additional indentation.
Property groupEnd
Decreases indentation of subsequent lines.
Property indent
Valid if an accumulating logger. Count of group calls without matching groupEnd.
Property isError
True if this is an accumulating logger and an error was logged.
Property isOrigin
True if this is an accumulating logger and the logger belongs to the object servicing the initial request.
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.
Property log
Log a message.
Property logs
Optional array of accumulated logged data and errors.
See also: WalletLoggerLogProperty merge
Merge log data from another logger.
Typically used to merge log data from network request.
See also: WalletLoggerInterfaceLinks: 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.
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Classes
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.
See also: PrivateKeyArgument 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
Property rootKey
The root key from which all other keys are derived.
See also: PrivateKeyMethod derivePrivateKey
Derives a private key based on protocol ID, key ID, and counterparty. Caches the result for future calls with the same parameters.
See also: Counterparty, PrivateKey, WalletProtocolReturns
- 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
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
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.
See also: CounterpartyReturns
- 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[]
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)))
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.
See also: Counterparty, PrivateKey, WalletProtocolReturns
- 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
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
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'.
See also: CounterpartyReturns
- 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[]
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
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[])
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.
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
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Function: isHexString
Check whether a string is a valid hex string (even length and hex characters).
Returns
true when s is a valid hex string
Argument Details
- s
- input string
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Function: parseWalletOutpoint
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Function: toOriginHeader
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Function: validateAbortActionArgs
Validate AbortActionArgs (ensures reference is a valid base64 string).
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).
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).
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.
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.
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.
See also: InternalizeOutput, ValidInternalizeOutput
Returns
ValidInternalizeOutput
Argument Details
- args
- InternalizeOutput to validate
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Function: validateListActionsArgs
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.
See also: ListCertificatesArgs, ValidListCertificatesArgs
Returns
ValidListCertificatesArgs
Argument Details
- args
- ListCertificatesArgs
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Function: validateListOutputsArgs
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).
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.
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).
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.
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).
See also: RelinquishOutputArgs, ValidRelinquishOutputArgs
Returns
ValidRelinquishOutputArgs
Argument Details
- args
- RelinquishOutputArgs
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Function: validateSatoshis
Validate a satoshi amount.
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.
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 }
See also: SignActionOptions, ValidSignActionOptions
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Function: validateStringLength
Validate string length in bytes for UTF-8 encoded 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.
See also: ValidWalletPayment, WalletPayment
Returns
ValidWalletPayment or undefined
Argument Details
- args
- WalletPayment or undefined
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Types
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: AcquireCertificateResult
See also: WalletCertificate
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: AcquisitionProtocol
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
See also: Byte
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: BEEF
See also: Byte
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: Base64String
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: BasketStringUnder300Bytes
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: BooleanDefaultFalse
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: BooleanDefaultTrue
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: Byte
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: CallType
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: CertificateFieldNameUnder50Bytes
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: Counterparty
See also: PubKeyHex, PublicKey
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: DescriptionString5to2000Bytes
DescriptionString5to2000Bytes alias type (documented).
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: DescriptionString5to50Bytes
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: EntityIconURLStringMax500Bytes
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: EntityNameStringMax100Bytes
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: ErrorCodeString10To40Bytes
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: ErrorDescriptionString20To200Bytes
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: HexString
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: ISOTimestampString
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: KeyIDStringUnder800Bytes
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: KeyringRevealer
See also: PubKeyHex
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: LabelStringUnder300Bytes
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: MakeWalletLogger
See also: WalletLoggerInterface
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: OriginatorDomainNameStringUnder250Bytes
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: OutpointString
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: OutputTagStringUnder300Bytes
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: PositiveInteger
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: PositiveIntegerDefault10Max10000
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: PositiveIntegerMax10
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: PositiveIntegerOrZero
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: ProtocolString5To400Bytes
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: PubKeyHex
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.
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: SatoshiValue
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.
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: SendWithResultStatus
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: TXIDHexString
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.
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: VersionString7To30Bytes
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: WalletCounterparty
See also: PubKeyHex
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: WalletErrorCode
See also: walletErrors
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: WalletNetwork
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables
Type: WalletProtocol
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
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
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables