@bsv/sdk 1.3.3 → 1.3.4
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/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/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/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/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
|
@@ -232,8 +232,8 @@ export interface CreateActionOutput {
|
|
|
232
232
|
* @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.
|
|
233
233
|
* @param {BooleanDefaultFalse} [returnTXIDOnly] - Optional. If true, only a TXID will be returned instead of a transaction.
|
|
234
234
|
* @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.
|
|
235
|
-
* @param {
|
|
236
|
-
* @param {
|
|
235
|
+
* @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.
|
|
236
|
+
* @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.
|
|
237
237
|
* @param {BooleanDefaultTrue} [randomizeOutputs] — optional. When set to false, the wallet will avoid randomizing the order of outputs within the transaction.
|
|
238
238
|
*/
|
|
239
239
|
export interface CreateActionOptions {
|
|
@@ -247,9 +247,10 @@ export interface CreateActionOptions {
|
|
|
247
247
|
sendWith?: TXIDHexString[];
|
|
248
248
|
randomizeOutputs?: BooleanDefaultTrue;
|
|
249
249
|
}
|
|
250
|
+
export type SendWithResultStatus = 'unproven' | 'sending' | 'failed';
|
|
250
251
|
export interface SendWithResult {
|
|
251
252
|
txid: TXIDHexString;
|
|
252
|
-
status:
|
|
253
|
+
status: SendWithResultStatus;
|
|
253
254
|
}
|
|
254
255
|
export interface SignableTransaction {
|
|
255
256
|
tx: AtomicBEEF;
|
|
@@ -265,12 +266,12 @@ export interface CreateActionResult {
|
|
|
265
266
|
/**
|
|
266
267
|
* @param {DescriptionString5to50Bytes} description - A human-readable description of the action represented by this transaction.
|
|
267
268
|
* @param {BEEF} [inputBEEF] - BEEF data associated with the set of input transactions from which UTXOs will be consumed.
|
|
268
|
-
* @param {
|
|
269
|
-
* @param {
|
|
269
|
+
* @param {CreateActionInput[]} [inputs] - An optional array of input objects used in the transaction.
|
|
270
|
+
* @param {CreateActionOutput[]} [outputs] - An optional array of output objects for the transaction.
|
|
270
271
|
* @param {PositiveIntegerOrZero} [lockTime] - Optional lock time for the transaction.
|
|
271
272
|
* @param {PositiveInteger} [version] - Optional transaction version specifier.
|
|
272
273
|
* @param {LabelStringUnder300Bytes[]} [labels] - Optional labels providing additional categorization for the transaction.
|
|
273
|
-
* @param {
|
|
274
|
+
* @param {CreateActionOptions} [options] - Optional settings modifying transaction processing behavior.
|
|
274
275
|
*/
|
|
275
276
|
export interface CreateActionArgs {
|
|
276
277
|
description: DescriptionString5to50Bytes;
|
|
@@ -296,7 +297,7 @@ export interface SignActionSpend {
|
|
|
296
297
|
* @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.
|
|
297
298
|
* @param {BooleanDefaultFalse} [returnTXIDOnly] - Optional. If true, only a TXID will be returned instead of a transaction.
|
|
298
299
|
* @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.
|
|
299
|
-
* @param {
|
|
300
|
+
* @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.
|
|
300
301
|
*/
|
|
301
302
|
export interface SignActionOptions {
|
|
302
303
|
acceptDelayedBroadcast?: BooleanDefaultTrue;
|
|
@@ -305,9 +306,9 @@ export interface SignActionOptions {
|
|
|
305
306
|
sendWith?: TXIDHexString[];
|
|
306
307
|
}
|
|
307
308
|
/**
|
|
308
|
-
* @param {Record<PositiveIntegerOrZero,
|
|
309
|
+
* @param {Record<PositiveIntegerOrZero, SignActionSpend>} spends - Map of input indexes to the corresponding unlocking script and optional sequence number.
|
|
309
310
|
* @param {Base64String} reference - Reference number returned from the call to `createAction`.
|
|
310
|
-
* @param {
|
|
311
|
+
* @param {SignActionOptions} [options] - Optional settings modifying transaction processing behavior.
|
|
311
312
|
*/
|
|
312
313
|
export interface SignActionArgs {
|
|
313
314
|
spends: Record<PositiveIntegerOrZero, SignActionSpend>;
|
|
@@ -335,11 +336,11 @@ export interface AbortActionResult {
|
|
|
335
336
|
* @param {LabelStringUnder300Bytes[]} labels - An array of labels used to filter actions.
|
|
336
337
|
* @param {'any' | 'all'} [labelQueryMode] - Specifies how to match labels (default is any which matches any of the labels).
|
|
337
338
|
* @param {BooleanDefaultFalse} [includeLabels] - Whether to include transaction labels in the result set.
|
|
338
|
-
* @param {
|
|
339
|
-
* @param {
|
|
340
|
-
* @param {
|
|
341
|
-
* @param {
|
|
342
|
-
* @param {
|
|
339
|
+
* @param {BooleanDefaultFalse} [includeInputs] - Whether to include input details in the result set.
|
|
340
|
+
* @param {BooleanDefaultFalse} [includeInputSourceLockingScripts] - Whether to include input source locking scripts in the result set.
|
|
341
|
+
* @param {BooleanDefaultFalse} [includeInputUnlockingScripts] - Whether to include input unlocking scripts in the result set.
|
|
342
|
+
* @param {BooleanDefaultFalse} [includeOutputs] - Whether to include output details in the result set.
|
|
343
|
+
* @param {BooleanDefaultFalse} [includeOutputLockingScripts] - Whether to include output locking scripts in the result set.
|
|
343
344
|
* @param {PositiveIntegerDefault10Max10000} [limit] - The maximum number of transactions to retrieve.
|
|
344
345
|
* @param {PositiveIntegerOrZero} [offset] - Number of transactions to skip before starting to return the results.
|
|
345
346
|
* @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.
|
|
@@ -378,7 +379,7 @@ export interface WalletActionOutput {
|
|
|
378
379
|
export interface WalletOutput {
|
|
379
380
|
satoshis: SatoshiValue;
|
|
380
381
|
lockingScript?: HexString;
|
|
381
|
-
spendable:
|
|
382
|
+
spendable: boolean;
|
|
382
383
|
customInstructions?: string;
|
|
383
384
|
tags?: OutputTagStringUnder300Bytes[];
|
|
384
385
|
outpoint: OutpointString;
|
|
@@ -423,8 +424,8 @@ export interface BasketInsertion {
|
|
|
423
424
|
/**
|
|
424
425
|
* @param {PositiveIntegerOrZero} outputIndex - Index of the output within the transaction.
|
|
425
426
|
* @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).
|
|
426
|
-
* @param {
|
|
427
|
-
* @param {
|
|
427
|
+
* @param {WalletPayment} [paymentRemittance] - Optional. Remittance data, structured accordingly for the payment operation.
|
|
428
|
+
* @param {BasketInsertion} [insertionRemittance] - Optional. Remittance data, structured accordingly for the insertion operation.
|
|
428
429
|
*/
|
|
429
430
|
export interface InternalizeOutput {
|
|
430
431
|
outputIndex: PositiveIntegerOrZero;
|
|
@@ -434,7 +435,7 @@ export interface InternalizeOutput {
|
|
|
434
435
|
}
|
|
435
436
|
/**
|
|
436
437
|
* @param {BEEF} tx - Atomic BEEF-formatted transaction to internalize.
|
|
437
|
-
* @param {
|
|
438
|
+
* @param {InternalizeOutput[]} outputs - Metadata about outputs, processed differently based on payment or insertion types.
|
|
438
439
|
* @param {DescriptionString5to50Bytes} description - Human-readable description of the transaction being internalized.
|
|
439
440
|
* @param {LabelStringUnder300Bytes[]} [labels] - Optional labels associated with this transaction.
|
|
440
441
|
* @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.
|
|
@@ -479,31 +480,27 @@ export interface ListOutputsResult {
|
|
|
479
480
|
BEEF?: BEEF;
|
|
480
481
|
outputs: WalletOutput[];
|
|
481
482
|
}
|
|
483
|
+
export interface RelinquishOutputArgs {
|
|
484
|
+
basket: BasketStringUnder300Bytes;
|
|
485
|
+
output: OutpointString;
|
|
486
|
+
}
|
|
487
|
+
export interface RelinquishOutputResult {
|
|
488
|
+
relinquished: true;
|
|
489
|
+
}
|
|
482
490
|
/**
|
|
483
491
|
* @param {WalletProtocol} protocolID - The security level and protocol string under which the data should be encrypted.
|
|
484
|
-
* @param {SecurityLevel} securityLevel - The security level of the protocol.
|
|
485
|
-
* @param {WalletProtocol} protocolID - The security level and protocol string under which the data should be encrypted.
|
|
486
|
-
* @param {SecurityLevel} protocolID[0] - SecurityLevel:
|
|
487
|
-
* 0 = Silently grants the request with no user interation.
|
|
488
|
-
* 1 = Requires user approval for every application.
|
|
489
|
-
* 2 = Requires user approval per counterparty per application.
|
|
490
|
-
* @param {ProtocolString5To400Bytes} protocolID[1] - The name of the protocol.
|
|
491
492
|
* @param {KeyIDStringUnder800Bytes} keyID - Key ID under which the encryption will be performed.
|
|
492
493
|
* @param {DescriptionString5to50Bytes} [privilegedReason] - Reason provided for privileged access, required if this is a privileged operation.
|
|
493
494
|
* @param {WalletCounterparty} [counterparty] - Public key of the counterparty (if two-party encryption is desired).
|
|
494
495
|
* @param {BooleanDefaultFalse} [privileged] - Whether this is a privileged request.
|
|
496
|
+
* @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.
|
|
495
497
|
*/
|
|
496
|
-
export interface
|
|
497
|
-
protocolID:
|
|
498
|
+
export interface WalletEncryptionArgs {
|
|
499
|
+
protocolID: WalletProtocol;
|
|
498
500
|
keyID: KeyIDStringUnder800Bytes;
|
|
499
501
|
counterparty?: WalletCounterparty;
|
|
500
502
|
privileged?: BooleanDefaultFalse;
|
|
501
503
|
privilegedReason?: DescriptionString5to50Bytes;
|
|
502
|
-
}
|
|
503
|
-
/**
|
|
504
|
-
* @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.
|
|
505
|
-
*/
|
|
506
|
-
export interface WalletEncryptionArgs extends KeyLinkageArgs {
|
|
507
504
|
seekPermission?: BooleanDefaultTrue;
|
|
508
505
|
}
|
|
509
506
|
/**
|
|
@@ -535,12 +532,16 @@ export interface RevealCounterpartyKeyLinkageArgs {
|
|
|
535
532
|
* @param {PubKeyHex} verifier - The public key of the verifier requesting the linkage information.
|
|
536
533
|
* @param {WalletProtocol} protocolID - The security level and protocol string associated with the linkage information to reveal.
|
|
537
534
|
* @param {KeyIDStringUnder800Bytes} keyID - The key ID associated with the linkage information to reveal.
|
|
538
|
-
* @param {DescriptionString5to50Bytes} [privilegedReason] - Reason provided for privileged access, required if this is a privileged operation.
|
|
539
|
-
* @param {BooleanDefaultFalse} [privileged] - Whether this is a privileged request.
|
|
535
|
+
* @param {DescriptionString5to50Bytes} [privilegedReason] - Optional. Reason provided for privileged access, required if this is a privileged operation.
|
|
536
|
+
* @param {BooleanDefaultFalse} [privileged] - Optional. Whether this is a privileged request.
|
|
540
537
|
*/
|
|
541
|
-
export interface RevealSpecificKeyLinkageArgs
|
|
542
|
-
verifier: PubKeyHex;
|
|
538
|
+
export interface RevealSpecificKeyLinkageArgs {
|
|
543
539
|
counterparty: WalletCounterparty;
|
|
540
|
+
verifier: PubKeyHex;
|
|
541
|
+
protocolID: WalletProtocol;
|
|
542
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
543
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
544
|
+
privileged?: BooleanDefaultFalse;
|
|
544
545
|
}
|
|
545
546
|
/**
|
|
546
547
|
*/
|
|
@@ -569,18 +570,27 @@ export interface RevealSpecificKeyLinkageResult extends KeyLinkageResult {
|
|
|
569
570
|
export interface WalletEncryptArgs extends WalletEncryptionArgs {
|
|
570
571
|
plaintext: Byte[];
|
|
571
572
|
}
|
|
573
|
+
export interface WalletEncryptResult {
|
|
574
|
+
ciphertext: Byte[];
|
|
575
|
+
}
|
|
572
576
|
/**
|
|
573
577
|
* @param {Byte[]} ciphertext - Encrypted bytes, including the initialization vector, for decryption.
|
|
574
578
|
*/
|
|
575
579
|
export interface WalletDecryptArgs extends WalletEncryptionArgs {
|
|
576
580
|
ciphertext: Byte[];
|
|
577
581
|
}
|
|
582
|
+
export interface WalletDecryptResult {
|
|
583
|
+
plaintext: Byte[];
|
|
584
|
+
}
|
|
578
585
|
/**
|
|
579
586
|
* @param {Byte[]} data - Input data (in bytes) for which the HMAC needs to be created.
|
|
580
587
|
*/
|
|
581
588
|
export interface CreateHmacArgs extends WalletEncryptionArgs {
|
|
582
589
|
data: Byte[];
|
|
583
590
|
}
|
|
591
|
+
export interface CreateHmacResult {
|
|
592
|
+
hmac: Byte[];
|
|
593
|
+
}
|
|
584
594
|
/**
|
|
585
595
|
* @param {Byte[]} data - The input data whose HMAC is to be verified.
|
|
586
596
|
* @param {Byte[]} hmac - Byte array representing the HMAC value to be verified.
|
|
@@ -589,6 +599,9 @@ export interface VerifyHmacArgs extends WalletEncryptionArgs {
|
|
|
589
599
|
data: Byte[];
|
|
590
600
|
hmac: Byte[];
|
|
591
601
|
}
|
|
602
|
+
export interface VerifyHmacResult {
|
|
603
|
+
valid: true;
|
|
604
|
+
}
|
|
592
605
|
/**
|
|
593
606
|
* @param {Byte[]} [data] - Data to be signed using the derived private key with ECDSA. Required unless directly signing a hash.
|
|
594
607
|
* @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.
|
|
@@ -597,6 +610,9 @@ export interface CreateSignatureArgs extends WalletEncryptionArgs {
|
|
|
597
610
|
data?: Byte[];
|
|
598
611
|
hashToDirectlySign?: Byte[];
|
|
599
612
|
}
|
|
613
|
+
export interface CreateSignatureResult {
|
|
614
|
+
signature: Byte[];
|
|
615
|
+
}
|
|
600
616
|
/**
|
|
601
617
|
* @param {Byte[]} [args.data] - The data originally signed, which is required for verification unless directly verifying a hash.
|
|
602
618
|
* @param {Byte[]} [args.hashToDirectlyVerify] - Optional field to verify the signature against a precomputed hash instead of data.
|
|
@@ -609,6 +625,9 @@ export interface VerifySignatureArgs extends WalletEncryptionArgs {
|
|
|
609
625
|
signature: Byte[];
|
|
610
626
|
forSelf?: BooleanDefaultFalse;
|
|
611
627
|
}
|
|
628
|
+
export interface VerifySignatureResult {
|
|
629
|
+
valid: true;
|
|
630
|
+
}
|
|
612
631
|
/**
|
|
613
632
|
* @param {Base64String} type - Type identifier for the certificate.
|
|
614
633
|
* @param {PubKeyHex} certifier - The public identity key of the certifier.
|
|
@@ -675,9 +694,13 @@ export interface ListCertificatesArgs {
|
|
|
675
694
|
privileged?: BooleanDefaultFalse;
|
|
676
695
|
privilegedReason?: DescriptionString5to50Bytes;
|
|
677
696
|
}
|
|
697
|
+
export interface CertificateResult extends WalletCertificate {
|
|
698
|
+
keyring?: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
699
|
+
verifier?: string;
|
|
700
|
+
}
|
|
678
701
|
export interface ListCertificatesResult {
|
|
679
702
|
totalCertificates: PositiveIntegerOrZero;
|
|
680
|
-
certificates:
|
|
703
|
+
certificates: CertificateResult[];
|
|
681
704
|
}
|
|
682
705
|
/**
|
|
683
706
|
* @param {WalletCertificate} certificate - The specific identity certificate being proven.
|
|
@@ -687,7 +710,7 @@ export interface ListCertificatesResult {
|
|
|
687
710
|
* @param {DescriptionString5to50Bytes} [privilegedReason] - Reason provided for privileged access, required if this is a privileged operation.
|
|
688
711
|
*/
|
|
689
712
|
export interface ProveCertificateArgs {
|
|
690
|
-
certificate: WalletCertificate
|
|
713
|
+
certificate: Partial<WalletCertificate>;
|
|
691
714
|
fieldsToReveal: CertificateFieldNameUnder50Bytes[];
|
|
692
715
|
verifier: PubKeyHex;
|
|
693
716
|
privileged?: BooleanDefaultFalse;
|
|
@@ -695,6 +718,8 @@ export interface ProveCertificateArgs {
|
|
|
695
718
|
}
|
|
696
719
|
export interface ProveCertificateResult {
|
|
697
720
|
keyringForVerifier: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
721
|
+
certificate?: WalletCertificate;
|
|
722
|
+
verifier?: PubKeyHex;
|
|
698
723
|
}
|
|
699
724
|
/**
|
|
700
725
|
* @param {Base64String} type - Type identifier for the certificate.
|
|
@@ -706,6 +731,30 @@ export interface RelinquishCertificateArgs {
|
|
|
706
731
|
serialNumber: Base64String;
|
|
707
732
|
certifier: PubKeyHex;
|
|
708
733
|
}
|
|
734
|
+
export interface RelinquishCertificateResult {
|
|
735
|
+
relinquished: true;
|
|
736
|
+
}
|
|
737
|
+
export interface AuthenticatedResult {
|
|
738
|
+
authenticated: true;
|
|
739
|
+
}
|
|
740
|
+
export interface GetHeightResult {
|
|
741
|
+
height: PositiveInteger;
|
|
742
|
+
}
|
|
743
|
+
/**
|
|
744
|
+
* @param {PositiveInteger} height - Specifies the height at which the block header needs to be retrieved.
|
|
745
|
+
*/
|
|
746
|
+
export interface GetHeaderArgs {
|
|
747
|
+
height: PositiveInteger;
|
|
748
|
+
}
|
|
749
|
+
export interface GetHeaderResult {
|
|
750
|
+
header: HexString;
|
|
751
|
+
}
|
|
752
|
+
export interface GetNetworkResult {
|
|
753
|
+
network: WalletNetwork;
|
|
754
|
+
}
|
|
755
|
+
export interface GetVersionResult {
|
|
756
|
+
version: VersionString7To30Bytes;
|
|
757
|
+
}
|
|
709
758
|
/**
|
|
710
759
|
* @param {PubKeyHex} identityKey - Identity key used to filter and discover certificates.
|
|
711
760
|
* @param {PositiveIntegerDefault10Max10000} [limit] - Maximum number of certificates to return in the response.
|
|
@@ -738,176 +787,176 @@ export interface DiscoverByAttributesArgs {
|
|
|
738
787
|
}
|
|
739
788
|
/**
|
|
740
789
|
* Every method of the `Wallet` interface has a return value of the form `Promise<object>`.
|
|
741
|
-
* When errors occur, an exception object may be thrown which must conform to the `
|
|
790
|
+
* When errors occur, an exception object may be thrown which must conform to the `WalletErrorObject` interface.
|
|
742
791
|
* Serialization layers can rely on the `isError` property being unique to error objects.
|
|
743
|
-
* Deserialization should rethrow `
|
|
792
|
+
* Deserialization should rethrow `WalletErrorObject` conforming objects.
|
|
744
793
|
*/
|
|
745
794
|
export interface WalletErrorObject extends Error {
|
|
746
795
|
isError: true;
|
|
747
796
|
}
|
|
748
797
|
/**
|
|
749
|
-
*
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
798
|
+
*
|
|
799
|
+
*/
|
|
800
|
+
export interface GetPublicKeyResult {
|
|
801
|
+
publicKey: PubKeyHex;
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* The ProtoWalletApi interface defines a wallet cryptographic capabilities including:
|
|
805
|
+
* key derivation, encryption, decryption, hmac creation and verification, signature generation and verification
|
|
753
806
|
*
|
|
754
807
|
* Error Handling
|
|
755
808
|
*
|
|
756
809
|
* Every method of the `Wallet` interface has a return value of the form `Promise<object>`.
|
|
757
|
-
* When an error occurs, an exception object may be thrown which must conform to the `
|
|
810
|
+
* When an error occurs, an exception object may be thrown which must conform to the `WalletErrorObject` interface.
|
|
758
811
|
* Serialization layers can rely on the `isError` property being unique to error objects to
|
|
759
|
-
* deserialize and rethrow `
|
|
812
|
+
* deserialize and rethrow `WalletErrorObject` conforming objects.
|
|
760
813
|
*/
|
|
761
|
-
export interface
|
|
814
|
+
export interface ProtoWalletApi {
|
|
762
815
|
/**
|
|
763
|
-
*
|
|
816
|
+
* Retrieves a derived or identity public key based on the requested protocol, key ID, counterparty, and other factors.
|
|
764
817
|
*
|
|
765
|
-
* @param {
|
|
818
|
+
* @param {GetPublicKeyArgs} args - Arguments to specify which public key to retrieve.
|
|
766
819
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
767
|
-
* @returns {Promise<
|
|
820
|
+
* @returns {Promise<GetPublicKeyResult>}} Resolves to an object containing the public key, or an error response.
|
|
768
821
|
*/
|
|
769
|
-
|
|
822
|
+
getPublicKey: (args: GetPublicKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<GetPublicKeyResult>;
|
|
770
823
|
/**
|
|
771
|
-
*
|
|
824
|
+
* Reveals the key linkage between ourselves and a counterparty, to a particular verifier, across all interactions with the counterparty.
|
|
772
825
|
*
|
|
773
|
-
* @param {
|
|
826
|
+
* @param {RevealCounterpartyKeyLinkageArgs} args - Contains information about counterparty, verifier, and whether the operation is privileged.
|
|
774
827
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
775
|
-
* @returns {Promise<
|
|
828
|
+
* @returns {Promise<RevealSpecificKeyLinkageResult>} Resolves to the key linkage, or an error response.
|
|
776
829
|
*/
|
|
777
|
-
|
|
830
|
+
revealCounterpartyKeyLinkage: (args: RevealCounterpartyKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<RevealCounterpartyKeyLinkageResult>;
|
|
778
831
|
/**
|
|
779
|
-
*
|
|
832
|
+
* Reveals the key linkage between ourselves and a counterparty, to a particular verifier, with respect to a specific interaction.
|
|
780
833
|
*
|
|
781
|
-
* @param {
|
|
834
|
+
* @param {RevealSpecificKeyLinkageArgs} args - The object defining the counterparty, verifier, protocol, and keyID for which linkage should be revealed.
|
|
782
835
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
783
|
-
* @returns {Promise<
|
|
836
|
+
* @returns {Promise<RevealSpecificKeyLinkageResult>} The promise returns the requested linkage information, or an error object.
|
|
784
837
|
*/
|
|
785
|
-
|
|
838
|
+
revealSpecificKeyLinkage: (args: RevealSpecificKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<RevealSpecificKeyLinkageResult>;
|
|
786
839
|
/**
|
|
787
|
-
*
|
|
840
|
+
* Encrypts the provided plaintext data using derived keys, based on the protocol ID, key ID, counterparty, and other factors.
|
|
788
841
|
*
|
|
789
|
-
* @param {
|
|
842
|
+
* @param {WalletEncryptArgs} args - Information needed for encryption, including the plaintext, protocol ID, and key ID.
|
|
790
843
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
791
|
-
* @returns {Promise<
|
|
844
|
+
* @returns {Promise<WalletEncryptResult>} Resolves to the encrypted ciphertext bytes or an error if encryption fails.
|
|
792
845
|
*/
|
|
793
|
-
|
|
846
|
+
encrypt: (args: WalletEncryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<WalletEncryptResult>;
|
|
794
847
|
/**
|
|
795
|
-
*
|
|
848
|
+
* Decrypts the provided ciphertext using derived keys, based on the protocol ID, key ID, counterparty, and other factors.
|
|
796
849
|
*
|
|
797
|
-
* @param {
|
|
850
|
+
* @param {WalletDecryptArgs} args - Contains the ciphertext, protocol ID, and key ID required to decrypt the data.
|
|
798
851
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
799
|
-
* @returns {Promise<
|
|
852
|
+
* @returns {Promise<WalletDecryptResult>} Resolves to the decryption result, containing the plaintext data or an error.
|
|
800
853
|
*/
|
|
801
|
-
|
|
854
|
+
decrypt: (args: WalletDecryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<WalletDecryptResult>;
|
|
802
855
|
/**
|
|
803
|
-
*
|
|
856
|
+
* Creates an HMAC (Hash-based Message Authentication Code) based on the provided data, protocol, key ID, counterparty, and other factors.
|
|
804
857
|
*
|
|
805
|
-
* @param {
|
|
858
|
+
* @param {CreateHmacArgs} args - Arguments containing the data, protocol ID, and key ID to generate the HMAC from.
|
|
806
859
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
807
|
-
* @returns {Promise<
|
|
860
|
+
* @returns {Promise<CreateHmacResult>} Resolves to an object containing the generated HMAC bytes, or an error if the creation fails.
|
|
808
861
|
*/
|
|
809
|
-
|
|
862
|
+
createHmac: (args: CreateHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<CreateHmacResult>;
|
|
810
863
|
/**
|
|
811
|
-
*
|
|
864
|
+
* Verifies an HMAC (Hash-based Message Authentication Code) based on the provided data, protocol, key ID, counterparty, and other factors.
|
|
812
865
|
*
|
|
813
|
-
* @param {
|
|
814
|
-
* @param {BasketStringUnder300Bytes} args.basket - The associated basket name where the output should be removed.
|
|
815
|
-
* @param {OutpointString} args.outpoint - The output that should be removed from the basket.
|
|
866
|
+
* @param {VerifyHmacArgs} args - Arguments containing the HMAC data, protocol ID, and key ID needed for verification.
|
|
816
867
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
817
|
-
* @returns {Promise<
|
|
868
|
+
* @returns {Promise<VerifyHmacResult>} Resolves to an object confirming whether the HMAC was valid or an error.
|
|
818
869
|
*/
|
|
819
|
-
|
|
820
|
-
basket: BasketStringUnder300Bytes;
|
|
821
|
-
output: OutpointString;
|
|
822
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
823
|
-
relinquished: true;
|
|
824
|
-
}>;
|
|
870
|
+
verifyHmac: (args: VerifyHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<VerifyHmacResult>;
|
|
825
871
|
/**
|
|
826
|
-
*
|
|
872
|
+
* Creates a digital signature for the provided data or hash using a specific protocol, key, and optionally considering privilege and counterparty.
|
|
827
873
|
*
|
|
828
|
-
* @param {
|
|
874
|
+
* @param {CreateSignatureArgs} args - Arguments to specify data, protocol, key ID, and privilege for creating the signature.
|
|
829
875
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
830
|
-
* @returns {Promise<
|
|
876
|
+
* @returns {Promise<CreateSignatureResult>} The promise will resolve to an object containing the DER-encoded ECDSA signature, or an error on failure.
|
|
831
877
|
*/
|
|
832
|
-
|
|
833
|
-
publicKey: PubKeyHex;
|
|
834
|
-
}>;
|
|
878
|
+
createSignature: (args: CreateSignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<CreateSignatureResult>;
|
|
835
879
|
/**
|
|
836
|
-
*
|
|
880
|
+
* Verifies a digital signature for the provided data or hash using a specific protocol, key, and optionally considering privilege and counterparty.
|
|
837
881
|
*
|
|
838
|
-
* @param {
|
|
882
|
+
* @param {VerifySignatureArgs} args - Arguments specifying the data, signature, protocol, and key ID.
|
|
839
883
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
840
|
-
* @returns {Promise<
|
|
884
|
+
* @returns {Promise<VerifySignatureResult>} The promise resolves to a boolean object indicating whether the signature was valid or an error message.
|
|
841
885
|
*/
|
|
842
|
-
|
|
886
|
+
verifySignature: (args: VerifySignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<VerifySignatureResult>;
|
|
887
|
+
}
|
|
888
|
+
/**
|
|
889
|
+
* The Wallet interface defines a wallet capable of various tasks including transaction creation and signing,
|
|
890
|
+
* encryption, decryption, identity certificate management, identity verification, and communication
|
|
891
|
+
* with applications as per the BRC standards. This interface allows applications to interact with
|
|
892
|
+
* the wallet for a range of functionalities aligned with the Babbage architectural principles.
|
|
893
|
+
*
|
|
894
|
+
* Error Handling
|
|
895
|
+
*
|
|
896
|
+
* Every method of the `Wallet` interface has a return value of the form `Promise<object>`.
|
|
897
|
+
* When an error occurs, an exception object may be thrown which must conform to the `WalletErrorObject` interface.
|
|
898
|
+
* Serialization layers can rely on the `isError` property being unique to error objects to
|
|
899
|
+
* deserialize and rethrow `WalletErrorObject` conforming objects.
|
|
900
|
+
*/
|
|
901
|
+
export interface Wallet extends ProtoWalletApi {
|
|
843
902
|
/**
|
|
844
|
-
*
|
|
903
|
+
* Creates a new Bitcoin transaction based on the provided inputs, outputs, labels, locks, and other options.
|
|
845
904
|
*
|
|
846
|
-
* @param {
|
|
905
|
+
* @param {CreateActionArgs} args - The arguments required to create the transaction.
|
|
847
906
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
848
|
-
* @returns {Promise<
|
|
907
|
+
* @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).
|
|
849
908
|
*/
|
|
850
|
-
|
|
909
|
+
createAction: (args: CreateActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<CreateActionResult>;
|
|
851
910
|
/**
|
|
852
|
-
*
|
|
911
|
+
* Signs a transaction previously created using `createAction`.
|
|
853
912
|
*
|
|
854
|
-
* @param {
|
|
913
|
+
* @param {SignActionArgs} args - Arguments to sign the transaction.
|
|
855
914
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
856
|
-
* @returns {Promise<
|
|
915
|
+
* @returns {Promise<SignActionResult>} The promise returns an error response or a response with either the completed transaction or TXID.
|
|
857
916
|
*/
|
|
858
|
-
|
|
859
|
-
ciphertext: Byte[];
|
|
860
|
-
}>;
|
|
917
|
+
signAction: (args: SignActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<SignActionResult>;
|
|
861
918
|
/**
|
|
862
|
-
*
|
|
919
|
+
* Aborts a transaction that is in progress and has not yet been finalized or sent to the network.
|
|
863
920
|
*
|
|
864
|
-
* @param {
|
|
921
|
+
* @param {AbortActionArgs} args - Arguments to identify the transaction that needs to be aborted.
|
|
865
922
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
866
|
-
* @returns {Promise<
|
|
923
|
+
* @returns {Promise<AbortActionResult>} The promise resolves to an object indicating the abortion result (either success or error).
|
|
867
924
|
*/
|
|
868
|
-
|
|
869
|
-
plaintext: Byte[];
|
|
870
|
-
}>;
|
|
925
|
+
abortAction: (args: AbortActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<AbortActionResult>;
|
|
871
926
|
/**
|
|
872
|
-
*
|
|
927
|
+
* Lists all transactions matching the specified labels.
|
|
873
928
|
*
|
|
874
|
-
* @param {
|
|
929
|
+
* @param {ListActionsArgs} args - Arguments to specify how to filter or retrieve transactions.
|
|
875
930
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
876
|
-
* @returns {Promise<
|
|
931
|
+
* @returns {Promise<ListActionsResult>} The promise resolves to an object containing actions, their metadata, inputs, and outputs if applicable, or an error object.
|
|
877
932
|
*/
|
|
878
|
-
|
|
879
|
-
hmac: Byte[];
|
|
880
|
-
}>;
|
|
933
|
+
listActions: (args: ListActionsArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<ListActionsResult>;
|
|
881
934
|
/**
|
|
882
|
-
*
|
|
935
|
+
* Submits a transaction to be internalized and optionally labeled, outputs paid to the wallet balance, inserted into baskets, and/or tagged.
|
|
883
936
|
*
|
|
884
|
-
* @param {
|
|
937
|
+
* @param {InternalizeActionArgs} args - Arguments required to internalize the transaction.
|
|
885
938
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
886
|
-
* @returns {Promise<
|
|
939
|
+
* @returns {Promise<InternalizeActionResult>} The promise resolves to an object indicating the success of the operation or an error object.
|
|
887
940
|
*/
|
|
888
|
-
|
|
889
|
-
valid: true;
|
|
890
|
-
}>;
|
|
941
|
+
internalizeAction: (args: InternalizeActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<InternalizeActionResult>;
|
|
891
942
|
/**
|
|
892
|
-
*
|
|
943
|
+
* Lists the spendable outputs kept within a specific basket, optionally tagged with specific labels.
|
|
893
944
|
*
|
|
894
|
-
* @param {
|
|
945
|
+
* @param {ListOutputsArgs} args - Arguments detailing the query for listing spendable outputs.
|
|
895
946
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
896
|
-
* @returns {Promise<
|
|
947
|
+
* @returns {Promise<ListOutputsResult>} The promise returns an output listing or an error object.
|
|
897
948
|
*/
|
|
898
|
-
|
|
899
|
-
signature: Byte[];
|
|
900
|
-
}>;
|
|
949
|
+
listOutputs: (args: ListOutputsArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<ListOutputsResult>;
|
|
901
950
|
/**
|
|
902
|
-
*
|
|
951
|
+
* Relinquish an output out of a basket, removing it from tracking without spending it.
|
|
903
952
|
*
|
|
904
|
-
* @param {
|
|
953
|
+
* @param {RelinquishOutputArgs} args - Arguments identifying the output in the basket.
|
|
954
|
+
* @param {BasketStringUnder300Bytes} args.basket - The associated basket name where the output should be removed.
|
|
955
|
+
* @param {OutpointString} args.outpoint - The output that should be removed from the basket.
|
|
905
956
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
906
|
-
* @returns {Promise<
|
|
957
|
+
* @returns {Promise<RelinquishOutputResult>} The promise returns an indication of successful removal or an error object.
|
|
907
958
|
*/
|
|
908
|
-
|
|
909
|
-
valid: true;
|
|
910
|
-
}>;
|
|
959
|
+
relinquishOutput: (args: RelinquishOutputArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<RelinquishOutputResult>;
|
|
911
960
|
/**
|
|
912
961
|
* Acquires an identity certificate, whether by acquiring one from the certifier or by directly receiving it.
|
|
913
962
|
*
|
|
@@ -937,17 +986,15 @@ export interface Wallet {
|
|
|
937
986
|
*
|
|
938
987
|
* @param {RelinquishCertificateArgs} args - Contains the type of certificate, certifier, and serial number for relinquishment.
|
|
939
988
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
940
|
-
* @returns {Promise<
|
|
989
|
+
* @returns {Promise<RelinquishCertificateResult>} The promise resolves to an indication of successful relinquishment or an error object.
|
|
941
990
|
*/
|
|
942
|
-
relinquishCertificate: (args: RelinquishCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<
|
|
943
|
-
relinquished: true;
|
|
944
|
-
}>;
|
|
991
|
+
relinquishCertificate: (args: RelinquishCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<RelinquishCertificateResult>;
|
|
945
992
|
/**
|
|
946
993
|
* Discovers identity certificates, issued to a given identity key by a trusted entity.
|
|
947
994
|
*
|
|
948
995
|
* @param {DiscoverByIdentityKeyArgs} args - Arguments for requesting the discovery based on the identity key.
|
|
949
996
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
950
|
-
* @returns {Promise<
|
|
997
|
+
* @returns {Promise<DiscoverCertificatesResult>} The promise resolves to the list of certificates discovered or an error object.
|
|
951
998
|
*/
|
|
952
999
|
discoverByIdentityKey: (args: DiscoverByIdentityKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<DiscoverCertificatesResult>;
|
|
953
1000
|
/**
|
|
@@ -961,65 +1008,50 @@ export interface Wallet {
|
|
|
961
1008
|
/**
|
|
962
1009
|
* Checks the authentication status of the user.
|
|
963
1010
|
*
|
|
964
|
-
* @param {
|
|
1011
|
+
* @param {{}} args - Empty object, as no parameters are needed.
|
|
965
1012
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
966
|
-
* @returns {Promise<
|
|
1013
|
+
* @returns {Promise<AuthenticatedResult>} The promise resolves to an object indicating whether the user is authenticated or an error response.
|
|
967
1014
|
*/
|
|
968
|
-
isAuthenticated: (args: {}, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<
|
|
969
|
-
authenticated: boolean;
|
|
970
|
-
}>;
|
|
1015
|
+
isAuthenticated: (args: {}, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<AuthenticatedResult>;
|
|
971
1016
|
/**
|
|
972
1017
|
* Continuously waits until the user is authenticated, returning the result once confirmed.
|
|
973
1018
|
*
|
|
974
|
-
* @param {
|
|
1019
|
+
* @param {{}} args - Not used, pass an empty object.
|
|
975
1020
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
976
|
-
* @returns {Promise<
|
|
1021
|
+
* @returns {Promise<AuthenticatedResult>} The final result indicating that the user is authenticated or an error object.
|
|
977
1022
|
*/
|
|
978
|
-
waitForAuthentication: (args: {}, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<
|
|
979
|
-
authenticated: true;
|
|
980
|
-
}>;
|
|
1023
|
+
waitForAuthentication: (args: {}, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<AuthenticatedResult>;
|
|
981
1024
|
/**
|
|
982
1025
|
* Retrieves the current height of the blockchain.
|
|
983
1026
|
*
|
|
984
|
-
* @param {
|
|
1027
|
+
* @param {{}} args - Empty object as no other parameters are necessary.
|
|
985
1028
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
986
1029
|
* @returns {Promise<Object>} Resolves to an object indicating the current height or an error on failure.
|
|
987
1030
|
*/
|
|
988
|
-
getHeight: (args: {}, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<
|
|
989
|
-
height: PositiveInteger;
|
|
990
|
-
}>;
|
|
1031
|
+
getHeight: (args: {}, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<GetHeightResult>;
|
|
991
1032
|
/**
|
|
992
1033
|
* Retrieves the block header of a block at a specified height.
|
|
993
1034
|
*
|
|
994
|
-
* @param {
|
|
995
|
-
* @param {PositiveInteger} args.height - Specifies the height at which the block header needs to be retrieved.
|
|
1035
|
+
* @param {GetHeaderArgs} args - Contains the height parameter needed to retrieve the block header.
|
|
996
1036
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
997
|
-
* @returns {Promise<
|
|
1037
|
+
* @returns {Promise<GetHeaderResult>} The promise resolves to an 80-byte block header or an error if it cannot be retrieved.
|
|
998
1038
|
*/
|
|
999
|
-
getHeaderForHeight: (args:
|
|
1000
|
-
height: PositiveInteger;
|
|
1001
|
-
}, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
1002
|
-
header: HexString;
|
|
1003
|
-
}>;
|
|
1039
|
+
getHeaderForHeight: (args: GetHeaderArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<GetHeaderResult>;
|
|
1004
1040
|
/**
|
|
1005
1041
|
* Retrieves the Bitcoin network the client is using (mainnet or testnet).
|
|
1006
1042
|
*
|
|
1007
|
-
* @param {
|
|
1043
|
+
* @param {{}} args - No arguments required, pass an empty object.
|
|
1008
1044
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
1009
|
-
* @returns {Promise<
|
|
1045
|
+
* @returns {Promise<GetNetworkResult>} The promise resolves to an object indicating whether the client is using the mainnet or testnet.
|
|
1010
1046
|
*/
|
|
1011
|
-
getNetwork: (args: {}, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<
|
|
1012
|
-
network: WalletNetwork;
|
|
1013
|
-
}>;
|
|
1047
|
+
getNetwork: (args: {}, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<GetNetworkResult>;
|
|
1014
1048
|
/**
|
|
1015
1049
|
* Retrieves the current version string of the wallet.
|
|
1016
1050
|
*
|
|
1017
|
-
* @param {
|
|
1051
|
+
* @param {{}} args - Empty argument object.
|
|
1018
1052
|
* @param {OriginatorDomainNameStringUnder250Bytes} [originator] - Fully-qualified domain name (FQDN) of the application that originated the request.
|
|
1019
|
-
* @returns {Promise<
|
|
1053
|
+
* @returns {Promise<GetVersionResult>} Resolves to an object containing the version string of the wallet, or an error.
|
|
1020
1054
|
*/
|
|
1021
|
-
getVersion: (args: {}, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<
|
|
1022
|
-
version: VersionString7To30Bytes;
|
|
1023
|
-
}>;
|
|
1055
|
+
getVersion: (args: {}, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<GetVersionResult>;
|
|
1024
1056
|
}
|
|
1025
1057
|
//# sourceMappingURL=Wallet.interfaces.d.ts.map
|