@bsv/sdk 1.3.3 → 1.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/src/auth/certificates/Certificate.js.map +1 -1
- package/dist/cjs/src/auth/certificates/MasterCertificate.js.map +1 -1
- package/dist/cjs/src/auth/utils/certificateHelpers.js +2 -2
- package/dist/cjs/src/auth/utils/certificateHelpers.js.map +1 -1
- package/dist/cjs/src/wallet/CachedKeyDeriver.js +11 -14
- package/dist/cjs/src/wallet/CachedKeyDeriver.js.map +1 -1
- package/dist/cjs/src/wallet/KeyDeriver.js +14 -11
- package/dist/cjs/src/wallet/KeyDeriver.js.map +1 -1
- package/dist/cjs/src/wallet/ProtoWallet.js +53 -111
- package/dist/cjs/src/wallet/ProtoWallet.js.map +1 -1
- package/dist/cjs/src/wallet/WalletClient.js.map +1 -1
- package/dist/cjs/src/wallet/index.js +2 -3
- package/dist/cjs/src/wallet/index.js.map +1 -1
- package/dist/cjs/src/wallet/substrates/WalletWireTransceiver.js +1 -0
- package/dist/cjs/src/wallet/substrates/WalletWireTransceiver.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/src/auth/certificates/Certificate.js.map +1 -1
- package/dist/esm/src/auth/certificates/MasterCertificate.js.map +1 -1
- package/dist/esm/src/auth/utils/certificateHelpers.js +2 -2
- package/dist/esm/src/auth/utils/certificateHelpers.js.map +1 -1
- package/dist/esm/src/wallet/CachedKeyDeriver.js +10 -10
- package/dist/esm/src/wallet/CachedKeyDeriver.js.map +1 -1
- package/dist/esm/src/wallet/KeyDeriver.js +15 -12
- package/dist/esm/src/wallet/KeyDeriver.js.map +1 -1
- package/dist/esm/src/wallet/ProtoWallet.js +53 -76
- package/dist/esm/src/wallet/ProtoWallet.js.map +1 -1
- package/dist/esm/src/wallet/WalletClient.js.map +1 -1
- package/dist/esm/src/wallet/index.js +1 -1
- package/dist/esm/src/wallet/index.js.map +1 -1
- package/dist/esm/src/wallet/substrates/WalletWireTransceiver.js +1 -0
- package/dist/esm/src/wallet/substrates/WalletWireTransceiver.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/src/auth/certificates/Certificate.d.ts +2 -2
- package/dist/types/src/auth/certificates/Certificate.d.ts.map +1 -1
- package/dist/types/src/auth/certificates/MasterCertificate.d.ts +2 -2
- package/dist/types/src/auth/certificates/MasterCertificate.d.ts.map +1 -1
- package/dist/types/src/auth/utils/certificateHelpers.d.ts +5 -5
- package/dist/types/src/auth/utils/certificateHelpers.d.ts.map +1 -1
- package/dist/types/src/wallet/CachedKeyDeriver.d.ts +16 -15
- package/dist/types/src/wallet/CachedKeyDeriver.d.ts.map +1 -1
- package/dist/types/src/wallet/KeyDeriver.d.ts +74 -18
- package/dist/types/src/wallet/KeyDeriver.d.ts.map +1 -1
- package/dist/types/src/wallet/ProtoWallet.d.ts +31 -407
- package/dist/types/src/wallet/ProtoWallet.d.ts.map +1 -1
- package/dist/types/src/wallet/Wallet.interfaces.d.ts +201 -169
- package/dist/types/src/wallet/Wallet.interfaces.d.ts.map +1 -1
- package/dist/types/src/wallet/WalletClient.d.ts +2 -3
- package/dist/types/src/wallet/WalletClient.d.ts.map +1 -1
- package/dist/types/src/wallet/index.d.ts +1 -1
- package/dist/types/src/wallet/index.d.ts.map +1 -1
- package/dist/types/src/wallet/substrates/HTTPWalletJSON.d.ts +1 -1
- package/dist/types/src/wallet/substrates/HTTPWalletJSON.d.ts.map +1 -1
- package/dist/types/src/wallet/substrates/WalletWireTransceiver.d.ts +1 -1
- package/dist/types/src/wallet/substrates/WalletWireTransceiver.d.ts.map +1 -1
- package/dist/types/src/wallet/substrates/XDM.d.ts +2 -2
- package/dist/types/src/wallet/substrates/XDM.d.ts.map +1 -1
- package/dist/types/src/wallet/substrates/window.CWI.d.ts +2 -2
- package/dist/types/src/wallet/substrates/window.CWI.d.ts.map +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/umd/bundle.js +1 -1
- package/docs/auth.md +12 -12
- package/docs/wallet-substrates.md +6 -6
- package/docs/wallet.md +897 -983
- package/package.json +1 -1
- package/src/auth/certificates/Certificate.ts +1 -1
- package/src/auth/certificates/MasterCertificate.ts +3 -2
- package/src/auth/utils/certificateHelpers.ts +5 -5
- package/src/wallet/CachedKeyDeriver.ts +22 -21
- package/src/wallet/KeyDeriver.ts +89 -22
- package/src/wallet/ProtoWallet.ts +105 -550
- package/src/wallet/Wallet.interfaces.ts +259 -176
- package/src/wallet/WalletClient.ts +2 -1
- package/src/wallet/__tests/ProtoWallet.test.ts +0 -53
- package/src/wallet/index.ts +1 -1
- package/src/wallet/substrates/HTTPWalletJSON.ts +1 -1
- package/src/wallet/substrates/WalletWireTransceiver.ts +2 -1
- package/src/wallet/substrates/XDM.ts +2 -2
- package/src/wallet/substrates/window.CWI.ts +2 -2
|
@@ -272,8 +272,8 @@ export interface CreateActionOutput {
|
|
|
272
272
|
* @param {TXIDHexString[]} [knownTxids] - Optional. When working with large chained transactions using `noSend` and `sendWith` options, include TXIDs of inputs that may be assumed to be valid even if not already known by this wallet.
|
|
273
273
|
* @param {BooleanDefaultFalse} [returnTXIDOnly] - Optional. If true, only a TXID will be returned instead of a transaction.
|
|
274
274
|
* @param {BooleanDefaultFalse} [noSend] - Optional. If true, the transaction will be constructed but not sent to the network. Supports the creation of chained batches of transactions using the `sendWith` option.
|
|
275
|
-
* @param {
|
|
276
|
-
* @param {
|
|
275
|
+
* @param {OutPoint[]} [noSendChange] - Optional. Valid when `noSend` is true. May contain `noSendChange` outpoints previously returned by prior `noSend` actions in the same batch of chained actions.
|
|
276
|
+
* @param {TXIDHexString[]} [sendWith] - Optional. Sends a batch of actions previously created as `noSend` actions to the network; either synchronously if `acceptDelayedBroadcast` is true or by a background process.
|
|
277
277
|
* @param {BooleanDefaultTrue} [randomizeOutputs] — optional. When set to false, the wallet will avoid randomizing the order of outputs within the transaction.
|
|
278
278
|
*/
|
|
279
279
|
export interface CreateActionOptions {
|
|
@@ -288,11 +288,14 @@ export interface CreateActionOptions {
|
|
|
288
288
|
randomizeOutputs?: BooleanDefaultTrue
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
+
export type SendWithResultStatus = 'unproven' | 'sending' | 'failed'
|
|
292
|
+
|
|
291
293
|
export interface SendWithResult {
|
|
292
294
|
txid: TXIDHexString
|
|
293
|
-
status:
|
|
295
|
+
status: SendWithResultStatus
|
|
294
296
|
}
|
|
295
297
|
|
|
298
|
+
|
|
296
299
|
export interface SignableTransaction {
|
|
297
300
|
tx: AtomicBEEF
|
|
298
301
|
reference: Base64String
|
|
@@ -309,12 +312,12 @@ export interface CreateActionResult {
|
|
|
309
312
|
/**
|
|
310
313
|
* @param {DescriptionString5to50Bytes} description - A human-readable description of the action represented by this transaction.
|
|
311
314
|
* @param {BEEF} [inputBEEF] - BEEF data associated with the set of input transactions from which UTXOs will be consumed.
|
|
312
|
-
* @param {
|
|
313
|
-
* @param {
|
|
315
|
+
* @param {CreateActionInput[]} [inputs] - An optional array of input objects used in the transaction.
|
|
316
|
+
* @param {CreateActionOutput[]} [outputs] - An optional array of output objects for the transaction.
|
|
314
317
|
* @param {PositiveIntegerOrZero} [lockTime] - Optional lock time for the transaction.
|
|
315
318
|
* @param {PositiveInteger} [version] - Optional transaction version specifier.
|
|
316
319
|
* @param {LabelStringUnder300Bytes[]} [labels] - Optional labels providing additional categorization for the transaction.
|
|
317
|
-
* @param {
|
|
320
|
+
* @param {CreateActionOptions} [options] - Optional settings modifying transaction processing behavior.
|
|
318
321
|
*/
|
|
319
322
|
export interface CreateActionArgs {
|
|
320
323
|
description: DescriptionString5to50Bytes
|
|
@@ -342,7 +345,7 @@ export interface SignActionSpend {
|
|
|
342
345
|
* @param {TXIDHexString[]} [knownTxids] - Optional. When working with large chained transactions using `noSend` and `sendWith` options, include TXIDs of inputs that may be assumed to be valid even if not already known by this wallet.
|
|
343
346
|
* @param {BooleanDefaultFalse} [returnTXIDOnly] - Optional. If true, only a TXID will be returned instead of a transaction.
|
|
344
347
|
* @param {BooleanDefaultFalse} [noSend] - Optional. If true, the transaction will be constructed but not sent to the network. Supports the creation of chained batches of transactions using the `sendWith` option.
|
|
345
|
-
* @param {
|
|
348
|
+
* @param {TXIDHexString[]} [sendWith] - Optional. Sends a batch of actions previously created as `noSend` actions to the network; either synchronously if `acceptDelayedBroadcast` is true or by a background process.
|
|
346
349
|
*/
|
|
347
350
|
export interface SignActionOptions {
|
|
348
351
|
acceptDelayedBroadcast?: BooleanDefaultTrue
|
|
@@ -352,9 +355,9 @@ export interface SignActionOptions {
|
|
|
352
355
|
}
|
|
353
356
|
|
|
354
357
|
/**
|
|
355
|
-
* @param {Record<PositiveIntegerOrZero,
|
|
358
|
+
* @param {Record<PositiveIntegerOrZero, SignActionSpend>} spends - Map of input indexes to the corresponding unlocking script and optional sequence number.
|
|
356
359
|
* @param {Base64String} reference - Reference number returned from the call to `createAction`.
|
|
357
|
-
* @param {
|
|
360
|
+
* @param {SignActionOptions} [options] - Optional settings modifying transaction processing behavior.
|
|
358
361
|
*/
|
|
359
362
|
export interface SignActionArgs {
|
|
360
363
|
spends: Record<PositiveIntegerOrZero, SignActionSpend>
|
|
@@ -363,7 +366,7 @@ export interface SignActionArgs {
|
|
|
363
366
|
}
|
|
364
367
|
|
|
365
368
|
/**
|
|
366
|
-
*
|
|
369
|
+
*
|
|
367
370
|
*/
|
|
368
371
|
export interface SignActionResult {
|
|
369
372
|
txid?: TXIDHexString
|
|
@@ -386,11 +389,11 @@ export interface AbortActionResult {
|
|
|
386
389
|
* @param {LabelStringUnder300Bytes[]} labels - An array of labels used to filter actions.
|
|
387
390
|
* @param {'any' | 'all'} [labelQueryMode] - Specifies how to match labels (default is any which matches any of the labels).
|
|
388
391
|
* @param {BooleanDefaultFalse} [includeLabels] - Whether to include transaction labels in the result set.
|
|
389
|
-
* @param {
|
|
390
|
-
* @param {
|
|
391
|
-
* @param {
|
|
392
|
-
* @param {
|
|
393
|
-
* @param {
|
|
392
|
+
* @param {BooleanDefaultFalse} [includeInputs] - Whether to include input details in the result set.
|
|
393
|
+
* @param {BooleanDefaultFalse} [includeInputSourceLockingScripts] - Whether to include input source locking scripts in the result set.
|
|
394
|
+
* @param {BooleanDefaultFalse} [includeInputUnlockingScripts] - Whether to include input unlocking scripts in the result set.
|
|
395
|
+
* @param {BooleanDefaultFalse} [includeOutputs] - Whether to include output details in the result set.
|
|
396
|
+
* @param {BooleanDefaultFalse} [includeOutputLockingScripts] - Whether to include output locking scripts in the result set.
|
|
394
397
|
* @param {PositiveIntegerDefault10Max10000} [limit] - The maximum number of transactions to retrieve.
|
|
395
398
|
* @param {PositiveIntegerOrZero} [offset] - Number of transactions to skip before starting to return the results.
|
|
396
399
|
* @param {BooleanDefaultTrue} [seekPermission] — Whether to seek permission from the user for this operation if required. Default true, will return an error rather than proceed if set to false.
|
|
@@ -435,7 +438,7 @@ export interface WalletActionOutput {
|
|
|
435
438
|
export interface WalletOutput {
|
|
436
439
|
satoshis: SatoshiValue
|
|
437
440
|
lockingScript?: HexString
|
|
438
|
-
spendable:
|
|
441
|
+
spendable: boolean
|
|
439
442
|
customInstructions?: string
|
|
440
443
|
|
|
441
444
|
tags?: OutputTagStringUnder300Bytes[]
|
|
@@ -488,8 +491,8 @@ export interface BasketInsertion {
|
|
|
488
491
|
/**
|
|
489
492
|
* @param {PositiveIntegerOrZero} outputIndex - Index of the output within the transaction.
|
|
490
493
|
* @param {'payment' | 'insert'} protocol - Specifies whether the output is a payment (to be received into the wallet balance) or an insert operation (into a particular basket).
|
|
491
|
-
* @param {
|
|
492
|
-
* @param {
|
|
494
|
+
* @param {WalletPayment} [paymentRemittance] - Optional. Remittance data, structured accordingly for the payment operation.
|
|
495
|
+
* @param {BasketInsertion} [insertionRemittance] - Optional. Remittance data, structured accordingly for the insertion operation.
|
|
493
496
|
*/
|
|
494
497
|
export interface InternalizeOutput {
|
|
495
498
|
outputIndex: PositiveIntegerOrZero
|
|
@@ -500,7 +503,7 @@ export interface InternalizeOutput {
|
|
|
500
503
|
|
|
501
504
|
/**
|
|
502
505
|
* @param {BEEF} tx - Atomic BEEF-formatted transaction to internalize.
|
|
503
|
-
* @param {
|
|
506
|
+
* @param {InternalizeOutput[]} outputs - Metadata about outputs, processed differently based on payment or insertion types.
|
|
504
507
|
* @param {DescriptionString5to50Bytes} description - Human-readable description of the transaction being internalized.
|
|
505
508
|
* @param {LabelStringUnder300Bytes[]} [labels] - Optional labels associated with this transaction.
|
|
506
509
|
* @param {BooleanDefaultTrue} [seekPermission] — Whether to seek permission from the user for this operation if required. Default true, will return an error rather than proceed if set to false.
|
|
@@ -549,40 +552,37 @@ export interface ListOutputsResult {
|
|
|
549
552
|
outputs: WalletOutput[]
|
|
550
553
|
}
|
|
551
554
|
|
|
555
|
+
export interface RelinquishOutputArgs {
|
|
556
|
+
basket: BasketStringUnder300Bytes
|
|
557
|
+
output: OutpointString
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
export interface RelinquishOutputResult {
|
|
561
|
+
relinquished: true
|
|
562
|
+
}
|
|
563
|
+
|
|
552
564
|
/**
|
|
553
565
|
* @param {WalletProtocol} protocolID - The security level and protocol string under which the data should be encrypted.
|
|
554
|
-
* @param {SecurityLevel} securityLevel - The security level of the protocol.
|
|
555
|
-
* @param {WalletProtocol} protocolID - The security level and protocol string under which the data should be encrypted.
|
|
556
|
-
* @param {SecurityLevel} protocolID[0] - SecurityLevel:
|
|
557
|
-
* 0 = Silently grants the request with no user interation.
|
|
558
|
-
* 1 = Requires user approval for every application.
|
|
559
|
-
* 2 = Requires user approval per counterparty per application.
|
|
560
|
-
* @param {ProtocolString5To400Bytes} protocolID[1] - The name of the protocol.
|
|
561
566
|
* @param {KeyIDStringUnder800Bytes} keyID - Key ID under which the encryption will be performed.
|
|
562
567
|
* @param {DescriptionString5to50Bytes} [privilegedReason] - Reason provided for privileged access, required if this is a privileged operation.
|
|
563
568
|
* @param {WalletCounterparty} [counterparty] - Public key of the counterparty (if two-party encryption is desired).
|
|
564
569
|
* @param {BooleanDefaultFalse} [privileged] - Whether this is a privileged request.
|
|
570
|
+
* @param {BooleanDefaultTrue} [seekPermission] — Whether to seek permission from the user for this operation if required. Default true, will return an error rather than proceed if set to false.
|
|
565
571
|
*/
|
|
566
|
-
export interface
|
|
567
|
-
protocolID:
|
|
572
|
+
export interface WalletEncryptionArgs {
|
|
573
|
+
protocolID: WalletProtocol
|
|
568
574
|
keyID: KeyIDStringUnder800Bytes
|
|
569
575
|
counterparty?: WalletCounterparty
|
|
570
576
|
privileged?: BooleanDefaultFalse
|
|
571
577
|
privilegedReason?: DescriptionString5to50Bytes
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
/**
|
|
575
|
-
* @param {BooleanDefaultTrue} [seekPermission] — Whether to seek permission from the user for this operation if required. Default true, will return an error rather than proceed if set to false.
|
|
576
|
-
*/
|
|
577
|
-
export interface WalletEncryptionArgs extends KeyLinkageArgs {
|
|
578
578
|
seekPermission?: BooleanDefaultTrue
|
|
579
579
|
}
|
|
580
580
|
|
|
581
581
|
/**
|
|
582
582
|
* When `identityKey` is true, `WalletEncryptionArgs` are not used.
|
|
583
|
-
*
|
|
583
|
+
*
|
|
584
584
|
* When `identityKey` is undefined, `WalletEncryptionArgs` are required.
|
|
585
|
-
*
|
|
585
|
+
*
|
|
586
586
|
* @param {BooleanDefaultFalse|true} [identityKey] - Use true to retrieve the current user's own identity key, overriding any protocol ID, key ID, or counterparty specified.
|
|
587
587
|
* @param {BooleanDefaultFalse} [forSelf] - Whether to return the public key derived from the current user's own identity (as opposed to the counterparty's identity).
|
|
588
588
|
*/
|
|
@@ -609,12 +609,16 @@ export interface RevealCounterpartyKeyLinkageArgs {
|
|
|
609
609
|
* @param {PubKeyHex} verifier - The public key of the verifier requesting the linkage information.
|
|
610
610
|
* @param {WalletProtocol} protocolID - The security level and protocol string associated with the linkage information to reveal.
|
|
611
611
|
* @param {KeyIDStringUnder800Bytes} keyID - The key ID associated with the linkage information to reveal.
|
|
612
|
-
* @param {DescriptionString5to50Bytes} [privilegedReason] - Reason provided for privileged access, required if this is a privileged operation.
|
|
613
|
-
* @param {BooleanDefaultFalse} [privileged] - Whether this is a privileged request.
|
|
612
|
+
* @param {DescriptionString5to50Bytes} [privilegedReason] - Optional. Reason provided for privileged access, required if this is a privileged operation.
|
|
613
|
+
* @param {BooleanDefaultFalse} [privileged] - Optional. Whether this is a privileged request.
|
|
614
614
|
*/
|
|
615
|
-
export interface RevealSpecificKeyLinkageArgs
|
|
616
|
-
verifier: PubKeyHex
|
|
615
|
+
export interface RevealSpecificKeyLinkageArgs {
|
|
617
616
|
counterparty: WalletCounterparty
|
|
617
|
+
verifier: PubKeyHex
|
|
618
|
+
protocolID: WalletProtocol
|
|
619
|
+
keyID: KeyIDStringUnder800Bytes
|
|
620
|
+
privilegedReason?: DescriptionString5to50Bytes
|
|
621
|
+
privileged?: BooleanDefaultFalse
|
|
618
622
|
}
|
|
619
623
|
|
|
620
624
|
/**
|
|
@@ -648,6 +652,10 @@ export interface WalletEncryptArgs extends WalletEncryptionArgs {
|
|
|
648
652
|
plaintext: Byte[]
|
|
649
653
|
}
|
|
650
654
|
|
|
655
|
+
export interface WalletEncryptResult {
|
|
656
|
+
ciphertext: Byte[]
|
|
657
|
+
}
|
|
658
|
+
|
|
651
659
|
/**
|
|
652
660
|
* @param {Byte[]} ciphertext - Encrypted bytes, including the initialization vector, for decryption.
|
|
653
661
|
*/
|
|
@@ -655,6 +663,10 @@ export interface WalletDecryptArgs extends WalletEncryptionArgs {
|
|
|
655
663
|
ciphertext: Byte[]
|
|
656
664
|
}
|
|
657
665
|
|
|
666
|
+
export interface WalletDecryptResult {
|
|
667
|
+
plaintext: Byte[]
|
|
668
|
+
}
|
|
669
|
+
|
|
658
670
|
/**
|
|
659
671
|
* @param {Byte[]} data - Input data (in bytes) for which the HMAC needs to be created.
|
|
660
672
|
*/
|
|
@@ -662,6 +674,10 @@ export interface CreateHmacArgs extends WalletEncryptionArgs {
|
|
|
662
674
|
data: Byte[]
|
|
663
675
|
}
|
|
664
676
|
|
|
677
|
+
export interface CreateHmacResult {
|
|
678
|
+
hmac: Byte[]
|
|
679
|
+
}
|
|
680
|
+
|
|
665
681
|
/**
|
|
666
682
|
* @param {Byte[]} data - The input data whose HMAC is to be verified.
|
|
667
683
|
* @param {Byte[]} hmac - Byte array representing the HMAC value to be verified.
|
|
@@ -671,6 +687,10 @@ export interface VerifyHmacArgs extends WalletEncryptionArgs {
|
|
|
671
687
|
hmac: Byte[]
|
|
672
688
|
}
|
|
673
689
|
|
|
690
|
+
export interface VerifyHmacResult {
|
|
691
|
+
valid: true
|
|
692
|
+
}
|
|
693
|
+
|
|
674
694
|
/**
|
|
675
695
|
* @param {Byte[]} [data] - Data to be signed using the derived private key with ECDSA. Required unless directly signing a hash.
|
|
676
696
|
* @param {Byte[]} [hashToDirectlySign] - Sign a pre-hashed value in situations where data can't or shouldn't be revealed, whether due to its size or for privacy.
|
|
@@ -680,6 +700,10 @@ export interface CreateSignatureArgs extends WalletEncryptionArgs {
|
|
|
680
700
|
hashToDirectlySign?: Byte[]
|
|
681
701
|
}
|
|
682
702
|
|
|
703
|
+
export interface CreateSignatureResult {
|
|
704
|
+
signature: Byte[]
|
|
705
|
+
}
|
|
706
|
+
|
|
683
707
|
/**
|
|
684
708
|
* @param {Byte[]} [args.data] - The data originally signed, which is required for verification unless directly verifying a hash.
|
|
685
709
|
* @param {Byte[]} [args.hashToDirectlyVerify] - Optional field to verify the signature against a precomputed hash instead of data.
|
|
@@ -693,6 +717,10 @@ export interface VerifySignatureArgs extends WalletEncryptionArgs {
|
|
|
693
717
|
forSelf?: BooleanDefaultFalse
|
|
694
718
|
}
|
|
695
719
|
|
|
720
|
+
export interface VerifySignatureResult {
|
|
721
|
+
valid: true
|
|
722
|
+
}
|
|
723
|
+
|
|
696
724
|
/**
|
|
697
725
|
* @param {Base64String} type - Type identifier for the certificate.
|
|
698
726
|
* @param {PubKeyHex} certifier - The public identity key of the certifier.
|
|
@@ -765,9 +793,14 @@ export interface ListCertificatesArgs {
|
|
|
765
793
|
privilegedReason?: DescriptionString5to50Bytes
|
|
766
794
|
}
|
|
767
795
|
|
|
796
|
+
export interface CertificateResult extends WalletCertificate {
|
|
797
|
+
keyring?: Record<CertificateFieldNameUnder50Bytes, Base64String>
|
|
798
|
+
verifier?: string
|
|
799
|
+
}
|
|
800
|
+
|
|
768
801
|
export interface ListCertificatesResult {
|
|
769
802
|
totalCertificates: PositiveIntegerOrZero
|
|
770
|
-
certificates:
|
|
803
|
+
certificates: CertificateResult[]
|
|
771
804
|
}
|
|
772
805
|
|
|
773
806
|
/**
|
|
@@ -778,7 +811,7 @@ export interface ListCertificatesResult {
|
|
|
778
811
|
* @param {DescriptionString5to50Bytes} [privilegedReason] - Reason provided for privileged access, required if this is a privileged operation.
|
|
779
812
|
*/
|
|
780
813
|
export interface ProveCertificateArgs {
|
|
781
|
-
certificate: WalletCertificate
|
|
814
|
+
certificate: Partial<WalletCertificate>
|
|
782
815
|
fieldsToReveal: CertificateFieldNameUnder50Bytes[]
|
|
783
816
|
verifier: PubKeyHex
|
|
784
817
|
privileged?: BooleanDefaultFalse
|
|
@@ -787,6 +820,8 @@ export interface ProveCertificateArgs {
|
|
|
787
820
|
|
|
788
821
|
export interface ProveCertificateResult {
|
|
789
822
|
keyringForVerifier: Record<CertificateFieldNameUnder50Bytes, Base64String>
|
|
823
|
+
certificate?: WalletCertificate
|
|
824
|
+
verifier?: PubKeyHex
|
|
790
825
|
}
|
|
791
826
|
|
|
792
827
|
/**
|
|
@@ -800,6 +835,37 @@ export interface RelinquishCertificateArgs {
|
|
|
800
835
|
certifier: PubKeyHex
|
|
801
836
|
}
|
|
802
837
|
|
|
838
|
+
export interface RelinquishCertificateResult {
|
|
839
|
+
relinquished: true
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
export interface AuthenticatedResult {
|
|
843
|
+
authenticated: true
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
export interface GetHeightResult {
|
|
847
|
+
height: PositiveInteger
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
/**
|
|
851
|
+
* @param {PositiveInteger} height - Specifies the height at which the block header needs to be retrieved.
|
|
852
|
+
*/
|
|
853
|
+
export interface GetHeaderArgs {
|
|
854
|
+
height: PositiveInteger
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
export interface GetHeaderResult {
|
|
858
|
+
header: HexString
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
export interface GetNetworkResult {
|
|
862
|
+
network: WalletNetwork
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
export interface GetVersionResult {
|
|
866
|
+
version: VersionString7To30Bytes
|
|
867
|
+
}
|
|
868
|
+
|
|
803
869
|
/**
|
|
804
870
|
* @param {PubKeyHex} identityKey - Identity key used to filter and discover certificates.
|
|
805
871
|
* @param {PositiveIntegerDefault10Max10000} [limit] - Maximum number of certificates to return in the response.
|
|
@@ -835,224 +901,242 @@ export interface DiscoverByAttributesArgs {
|
|
|
835
901
|
|
|
836
902
|
/**
|
|
837
903
|
* Every method of the `Wallet` interface has a return value of the form `Promise<object>`.
|
|
838
|
-
* When errors occur, an exception object may be thrown which must conform to the `
|
|
904
|
+
* When errors occur, an exception object may be thrown which must conform to the `WalletErrorObject` interface.
|
|
839
905
|
* Serialization layers can rely on the `isError` property being unique to error objects.
|
|
840
|
-
* Deserialization should rethrow `
|
|
906
|
+
* Deserialization should rethrow `WalletErrorObject` conforming objects.
|
|
841
907
|
*/
|
|
842
908
|
export interface WalletErrorObject extends Error {
|
|
843
909
|
isError: true
|
|
844
910
|
}
|
|
845
911
|
|
|
846
912
|
/**
|
|
847
|
-
*
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
913
|
+
*
|
|
914
|
+
*/
|
|
915
|
+
export interface GetPublicKeyResult {
|
|
916
|
+
publicKey: PubKeyHex
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
/**
|
|
920
|
+
* The ProtoWalletApi interface defines a wallet cryptographic capabilities including:
|
|
921
|
+
* key derivation, encryption, decryption, hmac creation and verification, signature generation and verification
|
|
851
922
|
*
|
|
852
923
|
* Error Handling
|
|
853
|
-
*
|
|
924
|
+
*
|
|
854
925
|
* Every method of the `Wallet` interface has a return value of the form `Promise<object>`.
|
|
855
|
-
* When an error occurs, an exception object may be thrown which must conform to the `
|
|
926
|
+
* When an error occurs, an exception object may be thrown which must conform to the `WalletErrorObject` interface.
|
|
856
927
|
* Serialization layers can rely on the `isError` property being unique to error objects to
|
|
857
|
-
* deserialize and rethrow `
|
|
928
|
+
* deserialize and rethrow `WalletErrorObject` conforming objects.
|
|
858
929
|
*/
|
|
859
|
-
export interface
|
|
930
|
+
export interface ProtoWalletApi {
|
|
860
931
|
/**
|
|
861
|
-
*
|
|
932
|
+
* Retrieves a derived or identity public key based on the requested protocol, key ID, counterparty, and other factors.
|
|
862
933
|
*
|
|
863
|
-
* @param {
|
|
934
|
+
* @param {GetPublicKeyArgs} args - Arguments to specify which public key to retrieve.
|
|
864
935
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
865
|
-
* @returns {Promise<
|
|
936
|
+
* @returns {Promise<GetPublicKeyResult>}} Resolves to an object containing the public key, or an error response.
|
|
866
937
|
*/
|
|
867
|
-
|
|
868
|
-
args:
|
|
938
|
+
getPublicKey: (
|
|
939
|
+
args: GetPublicKeyArgs,
|
|
869
940
|
originator?: OriginatorDomainNameStringUnder250Bytes
|
|
870
|
-
) => Promise<
|
|
941
|
+
) => Promise<GetPublicKeyResult>
|
|
871
942
|
|
|
872
943
|
/**
|
|
873
|
-
*
|
|
944
|
+
* Reveals the key linkage between ourselves and a counterparty, to a particular verifier, across all interactions with the counterparty.
|
|
874
945
|
*
|
|
875
|
-
* @param {
|
|
946
|
+
* @param {RevealCounterpartyKeyLinkageArgs} args - Contains information about counterparty, verifier, and whether the operation is privileged.
|
|
876
947
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
877
|
-
* @returns {Promise<
|
|
948
|
+
* @returns {Promise<RevealSpecificKeyLinkageResult>} Resolves to the key linkage, or an error response.
|
|
878
949
|
*/
|
|
879
|
-
|
|
880
|
-
args:
|
|
950
|
+
revealCounterpartyKeyLinkage: (
|
|
951
|
+
args: RevealCounterpartyKeyLinkageArgs,
|
|
881
952
|
originator?: OriginatorDomainNameStringUnder250Bytes
|
|
882
|
-
) => Promise<
|
|
953
|
+
) => Promise<RevealCounterpartyKeyLinkageResult>
|
|
883
954
|
|
|
884
955
|
/**
|
|
885
|
-
*
|
|
956
|
+
* Reveals the key linkage between ourselves and a counterparty, to a particular verifier, with respect to a specific interaction.
|
|
886
957
|
*
|
|
887
|
-
* @param {
|
|
958
|
+
* @param {RevealSpecificKeyLinkageArgs} args - The object defining the counterparty, verifier, protocol, and keyID for which linkage should be revealed.
|
|
888
959
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
889
|
-
* @returns {Promise<
|
|
960
|
+
* @returns {Promise<RevealSpecificKeyLinkageResult>} The promise returns the requested linkage information, or an error object.
|
|
890
961
|
*/
|
|
891
|
-
|
|
892
|
-
args:
|
|
962
|
+
revealSpecificKeyLinkage: (
|
|
963
|
+
args: RevealSpecificKeyLinkageArgs,
|
|
893
964
|
originator?: OriginatorDomainNameStringUnder250Bytes
|
|
894
|
-
) => Promise<
|
|
965
|
+
) => Promise<RevealSpecificKeyLinkageResult>
|
|
895
966
|
|
|
896
967
|
/**
|
|
897
|
-
*
|
|
968
|
+
* Encrypts the provided plaintext data using derived keys, based on the protocol ID, key ID, counterparty, and other factors.
|
|
898
969
|
*
|
|
899
|
-
* @param {
|
|
970
|
+
* @param {WalletEncryptArgs} args - Information needed for encryption, including the plaintext, protocol ID, and key ID.
|
|
900
971
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
901
|
-
* @returns {Promise<
|
|
972
|
+
* @returns {Promise<WalletEncryptResult>} Resolves to the encrypted ciphertext bytes or an error if encryption fails.
|
|
902
973
|
*/
|
|
903
|
-
|
|
904
|
-
args:
|
|
974
|
+
encrypt: (
|
|
975
|
+
args: WalletEncryptArgs,
|
|
905
976
|
originator?: OriginatorDomainNameStringUnder250Bytes
|
|
906
|
-
) => Promise<
|
|
977
|
+
) => Promise<WalletEncryptResult>
|
|
907
978
|
|
|
908
979
|
/**
|
|
909
|
-
*
|
|
980
|
+
* Decrypts the provided ciphertext using derived keys, based on the protocol ID, key ID, counterparty, and other factors.
|
|
910
981
|
*
|
|
911
|
-
* @param {
|
|
982
|
+
* @param {WalletDecryptArgs} args - Contains the ciphertext, protocol ID, and key ID required to decrypt the data.
|
|
912
983
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
913
|
-
* @returns {Promise<
|
|
984
|
+
* @returns {Promise<WalletDecryptResult>} Resolves to the decryption result, containing the plaintext data or an error.
|
|
914
985
|
*/
|
|
915
|
-
|
|
916
|
-
args:
|
|
986
|
+
decrypt: (
|
|
987
|
+
args: WalletDecryptArgs,
|
|
917
988
|
originator?: OriginatorDomainNameStringUnder250Bytes
|
|
918
|
-
) => Promise<
|
|
989
|
+
) => Promise<WalletDecryptResult>
|
|
919
990
|
|
|
920
991
|
/**
|
|
921
|
-
*
|
|
992
|
+
* Creates an HMAC (Hash-based Message Authentication Code) based on the provided data, protocol, key ID, counterparty, and other factors.
|
|
922
993
|
*
|
|
923
|
-
* @param {
|
|
994
|
+
* @param {CreateHmacArgs} args - Arguments containing the data, protocol ID, and key ID to generate the HMAC from.
|
|
924
995
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
925
|
-
* @returns {Promise<
|
|
996
|
+
* @returns {Promise<CreateHmacResult>} Resolves to an object containing the generated HMAC bytes, or an error if the creation fails.
|
|
926
997
|
*/
|
|
927
|
-
|
|
928
|
-
args:
|
|
998
|
+
createHmac: (
|
|
999
|
+
args: CreateHmacArgs,
|
|
929
1000
|
originator?: OriginatorDomainNameStringUnder250Bytes
|
|
930
|
-
) => Promise<
|
|
1001
|
+
) => Promise<CreateHmacResult>
|
|
931
1002
|
|
|
932
1003
|
/**
|
|
933
|
-
*
|
|
1004
|
+
* Verifies an HMAC (Hash-based Message Authentication Code) based on the provided data, protocol, key ID, counterparty, and other factors.
|
|
934
1005
|
*
|
|
935
|
-
* @param {
|
|
936
|
-
* @param {BasketStringUnder300Bytes} args.basket - The associated basket name where the output should be removed.
|
|
937
|
-
* @param {OutpointString} args.outpoint - The output that should be removed from the basket.
|
|
1006
|
+
* @param {VerifyHmacArgs} args - Arguments containing the HMAC data, protocol ID, and key ID needed for verification.
|
|
938
1007
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
939
|
-
* @returns {Promise<
|
|
1008
|
+
* @returns {Promise<VerifyHmacResult>} Resolves to an object confirming whether the HMAC was valid or an error.
|
|
940
1009
|
*/
|
|
941
|
-
|
|
942
|
-
args:
|
|
943
|
-
basket: BasketStringUnder300Bytes
|
|
944
|
-
output: OutpointString
|
|
945
|
-
},
|
|
1010
|
+
verifyHmac: (
|
|
1011
|
+
args: VerifyHmacArgs,
|
|
946
1012
|
originator?: OriginatorDomainNameStringUnder250Bytes
|
|
947
|
-
) => Promise<
|
|
1013
|
+
) => Promise<VerifyHmacResult>
|
|
948
1014
|
|
|
949
1015
|
/**
|
|
950
|
-
*
|
|
1016
|
+
* Creates a digital signature for the provided data or hash using a specific protocol, key, and optionally considering privilege and counterparty.
|
|
951
1017
|
*
|
|
952
|
-
* @param {
|
|
1018
|
+
* @param {CreateSignatureArgs} args - Arguments to specify data, protocol, key ID, and privilege for creating the signature.
|
|
953
1019
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
954
|
-
* @returns {Promise<
|
|
1020
|
+
* @returns {Promise<CreateSignatureResult>} The promise will resolve to an object containing the DER-encoded ECDSA signature, or an error on failure.
|
|
955
1021
|
*/
|
|
956
|
-
|
|
957
|
-
args:
|
|
1022
|
+
createSignature: (
|
|
1023
|
+
args: CreateSignatureArgs,
|
|
958
1024
|
originator?: OriginatorDomainNameStringUnder250Bytes
|
|
959
|
-
) => Promise<
|
|
1025
|
+
) => Promise<CreateSignatureResult>
|
|
960
1026
|
|
|
961
1027
|
/**
|
|
962
|
-
*
|
|
1028
|
+
* Verifies a digital signature for the provided data or hash using a specific protocol, key, and optionally considering privilege and counterparty.
|
|
963
1029
|
*
|
|
964
|
-
* @param {
|
|
1030
|
+
* @param {VerifySignatureArgs} args - Arguments specifying the data, signature, protocol, and key ID.
|
|
965
1031
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
966
|
-
* @returns {Promise<
|
|
1032
|
+
* @returns {Promise<VerifySignatureResult>} The promise resolves to a boolean object indicating whether the signature was valid or an error message.
|
|
967
1033
|
*/
|
|
968
|
-
|
|
969
|
-
args:
|
|
1034
|
+
verifySignature: (
|
|
1035
|
+
args: VerifySignatureArgs,
|
|
970
1036
|
originator?: OriginatorDomainNameStringUnder250Bytes
|
|
971
|
-
) => Promise<
|
|
1037
|
+
) => Promise<VerifySignatureResult>
|
|
1038
|
+
|
|
1039
|
+
}
|
|
972
1040
|
|
|
1041
|
+
/**
|
|
1042
|
+
* The Wallet interface defines a wallet capable of various tasks including transaction creation and signing,
|
|
1043
|
+
* encryption, decryption, identity certificate management, identity verification, and communication
|
|
1044
|
+
* with applications as per the BRC standards. This interface allows applications to interact with
|
|
1045
|
+
* the wallet for a range of functionalities aligned with the Babbage architectural principles.
|
|
1046
|
+
*
|
|
1047
|
+
* Error Handling
|
|
1048
|
+
*
|
|
1049
|
+
* Every method of the `Wallet` interface has a return value of the form `Promise<object>`.
|
|
1050
|
+
* When an error occurs, an exception object may be thrown which must conform to the `WalletErrorObject` interface.
|
|
1051
|
+
* Serialization layers can rely on the `isError` property being unique to error objects to
|
|
1052
|
+
* deserialize and rethrow `WalletErrorObject` conforming objects.
|
|
1053
|
+
*/
|
|
1054
|
+
export interface Wallet extends ProtoWalletApi {
|
|
973
1055
|
/**
|
|
974
|
-
*
|
|
1056
|
+
* Creates a new Bitcoin transaction based on the provided inputs, outputs, labels, locks, and other options.
|
|
975
1057
|
*
|
|
976
|
-
* @param {
|
|
1058
|
+
* @param {CreateActionArgs} args - The arguments required to create the transaction.
|
|
977
1059
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
978
|
-
* @returns {Promise<
|
|
1060
|
+
* @returns {Promise<CreateActionResult>} The promise returns different structures based on the outcome: error response, response with TXID, response with transaction, or info about signable transaction (partial BEEF and reference number).
|
|
979
1061
|
*/
|
|
980
|
-
|
|
981
|
-
args:
|
|
1062
|
+
createAction: (
|
|
1063
|
+
args: CreateActionArgs,
|
|
982
1064
|
originator?: OriginatorDomainNameStringUnder250Bytes
|
|
983
|
-
) => Promise<
|
|
1065
|
+
) => Promise<CreateActionResult>
|
|
984
1066
|
|
|
985
1067
|
/**
|
|
986
|
-
*
|
|
1068
|
+
* Signs a transaction previously created using `createAction`.
|
|
987
1069
|
*
|
|
988
|
-
* @param {
|
|
1070
|
+
* @param {SignActionArgs} args - Arguments to sign the transaction.
|
|
989
1071
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
990
|
-
* @returns {Promise<
|
|
1072
|
+
* @returns {Promise<SignActionResult>} The promise returns an error response or a response with either the completed transaction or TXID.
|
|
991
1073
|
*/
|
|
992
|
-
|
|
993
|
-
args:
|
|
1074
|
+
signAction: (
|
|
1075
|
+
args: SignActionArgs,
|
|
994
1076
|
originator?: OriginatorDomainNameStringUnder250Bytes
|
|
995
|
-
) => Promise<
|
|
1077
|
+
) => Promise<SignActionResult>
|
|
996
1078
|
|
|
997
1079
|
/**
|
|
998
|
-
*
|
|
1080
|
+
* Aborts a transaction that is in progress and has not yet been finalized or sent to the network.
|
|
999
1081
|
*
|
|
1000
|
-
* @param {
|
|
1082
|
+
* @param {AbortActionArgs} args - Arguments to identify the transaction that needs to be aborted.
|
|
1001
1083
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
1002
|
-
* @returns {Promise<
|
|
1084
|
+
* @returns {Promise<AbortActionResult>} The promise resolves to an object indicating the abortion result (either success or error).
|
|
1003
1085
|
*/
|
|
1004
|
-
|
|
1005
|
-
args:
|
|
1086
|
+
abortAction: (
|
|
1087
|
+
args: AbortActionArgs,
|
|
1006
1088
|
originator?: OriginatorDomainNameStringUnder250Bytes
|
|
1007
|
-
) => Promise<
|
|
1089
|
+
) => Promise<AbortActionResult>
|
|
1008
1090
|
|
|
1009
1091
|
/**
|
|
1010
|
-
*
|
|
1092
|
+
* Lists all transactions matching the specified labels.
|
|
1011
1093
|
*
|
|
1012
|
-
* @param {
|
|
1094
|
+
* @param {ListActionsArgs} args - Arguments to specify how to filter or retrieve transactions.
|
|
1013
1095
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
1014
|
-
* @returns {Promise<
|
|
1096
|
+
* @returns {Promise<ListActionsResult>} The promise resolves to an object containing actions, their metadata, inputs, and outputs if applicable, or an error object.
|
|
1015
1097
|
*/
|
|
1016
|
-
|
|
1017
|
-
args:
|
|
1098
|
+
listActions: (
|
|
1099
|
+
args: ListActionsArgs,
|
|
1018
1100
|
originator?: OriginatorDomainNameStringUnder250Bytes
|
|
1019
|
-
) => Promise<
|
|
1101
|
+
) => Promise<ListActionsResult>
|
|
1020
1102
|
|
|
1021
1103
|
/**
|
|
1022
|
-
*
|
|
1104
|
+
* Submits a transaction to be internalized and optionally labeled, outputs paid to the wallet balance, inserted into baskets, and/or tagged.
|
|
1023
1105
|
*
|
|
1024
|
-
* @param {
|
|
1106
|
+
* @param {InternalizeActionArgs} args - Arguments required to internalize the transaction.
|
|
1025
1107
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
1026
|
-
* @returns {Promise<
|
|
1108
|
+
* @returns {Promise<InternalizeActionResult>} The promise resolves to an object indicating the success of the operation or an error object.
|
|
1027
1109
|
*/
|
|
1028
|
-
|
|
1029
|
-
args:
|
|
1110
|
+
internalizeAction: (
|
|
1111
|
+
args: InternalizeActionArgs,
|
|
1030
1112
|
originator?: OriginatorDomainNameStringUnder250Bytes
|
|
1031
|
-
) => Promise<
|
|
1113
|
+
) => Promise<InternalizeActionResult>
|
|
1032
1114
|
|
|
1033
1115
|
/**
|
|
1034
|
-
*
|
|
1116
|
+
* Lists the spendable outputs kept within a specific basket, optionally tagged with specific labels.
|
|
1035
1117
|
*
|
|
1036
|
-
* @param {
|
|
1118
|
+
* @param {ListOutputsArgs} args - Arguments detailing the query for listing spendable outputs.
|
|
1037
1119
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
1038
|
-
* @returns {Promise<
|
|
1120
|
+
* @returns {Promise<ListOutputsResult>} The promise returns an output listing or an error object.
|
|
1039
1121
|
*/
|
|
1040
|
-
|
|
1041
|
-
args:
|
|
1122
|
+
listOutputs: (
|
|
1123
|
+
args: ListOutputsArgs,
|
|
1042
1124
|
originator?: OriginatorDomainNameStringUnder250Bytes
|
|
1043
|
-
) => Promise<
|
|
1125
|
+
) => Promise<ListOutputsResult>
|
|
1044
1126
|
|
|
1045
1127
|
/**
|
|
1046
|
-
*
|
|
1128
|
+
* Relinquish an output out of a basket, removing it from tracking without spending it.
|
|
1047
1129
|
*
|
|
1048
|
-
* @param {
|
|
1130
|
+
* @param {RelinquishOutputArgs} args - Arguments identifying the output in the basket.
|
|
1131
|
+
* @param {BasketStringUnder300Bytes} args.basket - The associated basket name where the output should be removed.
|
|
1132
|
+
* @param {OutpointString} args.outpoint - The output that should be removed from the basket.
|
|
1049
1133
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
1050
|
-
* @returns {Promise<
|
|
1134
|
+
* @returns {Promise<RelinquishOutputResult>} The promise returns an indication of successful removal or an error object.
|
|
1051
1135
|
*/
|
|
1052
|
-
|
|
1053
|
-
args:
|
|
1136
|
+
relinquishOutput: (
|
|
1137
|
+
args: RelinquishOutputArgs,
|
|
1054
1138
|
originator?: OriginatorDomainNameStringUnder250Bytes
|
|
1055
|
-
) => Promise<
|
|
1139
|
+
) => Promise<RelinquishOutputResult>
|
|
1056
1140
|
|
|
1057
1141
|
/**
|
|
1058
1142
|
* Acquires an identity certificate, whether by acquiring one from the certifier or by directly receiving it.
|
|
@@ -1095,19 +1179,19 @@ export interface Wallet {
|
|
|
1095
1179
|
*
|
|
1096
1180
|
* @param {RelinquishCertificateArgs} args - Contains the type of certificate, certifier, and serial number for relinquishment.
|
|
1097
1181
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
1098
|
-
* @returns {Promise<
|
|
1182
|
+
* @returns {Promise<RelinquishCertificateResult>} The promise resolves to an indication of successful relinquishment or an error object.
|
|
1099
1183
|
*/
|
|
1100
1184
|
relinquishCertificate: (
|
|
1101
1185
|
args: RelinquishCertificateArgs,
|
|
1102
1186
|
originator?: OriginatorDomainNameStringUnder250Bytes
|
|
1103
|
-
) => Promise<
|
|
1187
|
+
) => Promise<RelinquishCertificateResult>
|
|
1104
1188
|
|
|
1105
1189
|
/**
|
|
1106
1190
|
* Discovers identity certificates, issued to a given identity key by a trusted entity.
|
|
1107
1191
|
*
|
|
1108
1192
|
* @param {DiscoverByIdentityKeyArgs} args - Arguments for requesting the discovery based on the identity key.
|
|
1109
1193
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
1110
|
-
* @returns {Promise<
|
|
1194
|
+
* @returns {Promise<DiscoverCertificatesResult>} The promise resolves to the list of certificates discovered or an error object.
|
|
1111
1195
|
*/
|
|
1112
1196
|
discoverByIdentityKey: (
|
|
1113
1197
|
args: DiscoverByIdentityKeyArgs,
|
|
@@ -1129,73 +1213,72 @@ export interface Wallet {
|
|
|
1129
1213
|
/**
|
|
1130
1214
|
* Checks the authentication status of the user.
|
|
1131
1215
|
*
|
|
1132
|
-
* @param {
|
|
1216
|
+
* @param {{}} args - Empty object, as no parameters are needed.
|
|
1133
1217
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
1134
|
-
* @returns {Promise<
|
|
1218
|
+
* @returns {Promise<AuthenticatedResult>} The promise resolves to an object indicating whether the user is authenticated or an error response.
|
|
1135
1219
|
*/
|
|
1136
1220
|
isAuthenticated: (
|
|
1137
1221
|
args: {},
|
|
1138
1222
|
originator?: OriginatorDomainNameStringUnder250Bytes
|
|
1139
|
-
) => Promise<
|
|
1223
|
+
) => Promise<AuthenticatedResult>
|
|
1140
1224
|
|
|
1141
1225
|
/**
|
|
1142
1226
|
* Continuously waits until the user is authenticated, returning the result once confirmed.
|
|
1143
1227
|
*
|
|
1144
|
-
* @param {
|
|
1228
|
+
* @param {{}} args - Not used, pass an empty object.
|
|
1145
1229
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
1146
|
-
* @returns {Promise<
|
|
1230
|
+
* @returns {Promise<AuthenticatedResult>} The final result indicating that the user is authenticated or an error object.
|
|
1147
1231
|
*/
|
|
1148
1232
|
waitForAuthentication: (
|
|
1149
1233
|
args: {},
|
|
1150
1234
|
originator?: OriginatorDomainNameStringUnder250Bytes
|
|
1151
|
-
) => Promise<
|
|
1235
|
+
) => Promise<AuthenticatedResult>
|
|
1152
1236
|
|
|
1153
1237
|
/**
|
|
1154
1238
|
* Retrieves the current height of the blockchain.
|
|
1155
1239
|
*
|
|
1156
|
-
* @param {
|
|
1240
|
+
* @param {{}} args - Empty object as no other parameters are necessary.
|
|
1157
1241
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
1158
1242
|
* @returns {Promise<Object>} Resolves to an object indicating the current height or an error on failure.
|
|
1159
1243
|
*/
|
|
1160
1244
|
getHeight: (
|
|
1161
1245
|
args: {},
|
|
1162
1246
|
originator?: OriginatorDomainNameStringUnder250Bytes
|
|
1163
|
-
) => Promise<
|
|
1247
|
+
) => Promise<GetHeightResult>
|
|
1164
1248
|
|
|
1165
1249
|
/**
|
|
1166
1250
|
* Retrieves the block header of a block at a specified height.
|
|
1167
1251
|
*
|
|
1168
|
-
* @param {
|
|
1169
|
-
* @param {PositiveInteger} args.height - Specifies the height at which the block header needs to be retrieved.
|
|
1252
|
+
* @param {GetHeaderArgs} args - Contains the height parameter needed to retrieve the block header.
|
|
1170
1253
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
1171
|
-
* @returns {Promise<
|
|
1254
|
+
* @returns {Promise<GetHeaderResult>} The promise resolves to an 80-byte block header or an error if it cannot be retrieved.
|
|
1172
1255
|
*/
|
|
1173
1256
|
getHeaderForHeight: (
|
|
1174
|
-
args:
|
|
1257
|
+
args: GetHeaderArgs,
|
|
1175
1258
|
originator?: OriginatorDomainNameStringUnder250Bytes
|
|
1176
|
-
) => Promise<
|
|
1259
|
+
) => Promise<GetHeaderResult>
|
|
1177
1260
|
|
|
1178
1261
|
/**
|
|
1179
1262
|
* Retrieves the Bitcoin network the client is using (mainnet or testnet).
|
|
1180
1263
|
*
|
|
1181
|
-
* @param {
|
|
1264
|
+
* @param {{}} args - No arguments required, pass an empty object.
|
|
1182
1265
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
1183
|
-
* @returns {Promise<
|
|
1266
|
+
* @returns {Promise<GetNetworkResult>} The promise resolves to an object indicating whether the client is using the mainnet or testnet.
|
|
1184
1267
|
*/
|
|
1185
1268
|
getNetwork: (
|
|
1186
1269
|
args: {},
|
|
1187
1270
|
originator?: OriginatorDomainNameStringUnder250Bytes
|
|
1188
|
-
) => Promise<
|
|
1271
|
+
) => Promise<GetNetworkResult>
|
|
1189
1272
|
|
|
1190
1273
|
/**
|
|
1191
1274
|
* Retrieves the current version string of the wallet.
|
|
1192
1275
|
*
|
|
1193
|
-
* @param {
|
|
1276
|
+
* @param {{}} args - Empty argument object.
|
|
1194
1277
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
1195
|
-
* @returns {Promise<
|
|
1278
|
+
* @returns {Promise<GetVersionResult>} Resolves to an object containing the version string of the wallet, or an error.
|
|
1196
1279
|
*/
|
|
1197
1280
|
getVersion: (
|
|
1198
1281
|
args: {},
|
|
1199
1282
|
originator?: OriginatorDomainNameStringUnder250Bytes
|
|
1200
|
-
) => Promise<
|
|
1201
|
-
}
|
|
1283
|
+
) => Promise<GetVersionResult>
|
|
1284
|
+
}
|