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: 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: 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: 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): 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_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" | 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)
}
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
Function: toOriginHeader
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: 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: 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
}
Links: API, Interfaces, Classes, Functions, Types, Enums, Variables