@bsv/sdk 1.1.33 → 1.2.1
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/mod.js +4 -0
- package/dist/cjs/mod.js.map +1 -1
- package/dist/cjs/package.json +4 -3
- package/dist/cjs/src/auth/Certificate.js +163 -0
- package/dist/cjs/src/auth/Certificate.js.map +1 -0
- package/dist/cjs/src/auth/index.js +9 -0
- package/dist/cjs/src/auth/index.js.map +1 -0
- package/dist/cjs/src/compat/BSM.js +17 -7
- package/dist/cjs/src/compat/BSM.js.map +1 -1
- package/dist/cjs/src/compat/ECIES.js +17 -7
- package/dist/cjs/src/compat/ECIES.js.map +1 -1
- package/dist/cjs/src/compat/HD.js +17 -7
- package/dist/cjs/src/compat/HD.js.map +1 -1
- package/dist/cjs/src/compat/Mnemonic.js +17 -7
- package/dist/cjs/src/compat/Mnemonic.js.map +1 -1
- package/dist/cjs/src/compat/index.js +17 -7
- package/dist/cjs/src/compat/index.js.map +1 -1
- package/dist/cjs/src/messages/index.js +17 -7
- package/dist/cjs/src/messages/index.js.map +1 -1
- package/dist/cjs/src/overlay-tools/LookupResolver.js +170 -0
- package/dist/cjs/src/overlay-tools/LookupResolver.js.map +1 -0
- package/dist/cjs/src/overlay-tools/OverlayAdminTokenTemplate.js +69 -0
- package/dist/cjs/src/overlay-tools/OverlayAdminTokenTemplate.js.map +1 -0
- package/dist/cjs/src/overlay-tools/SHIPBroadcaster.js +336 -0
- package/dist/cjs/src/overlay-tools/SHIPBroadcaster.js.map +1 -0
- package/dist/cjs/src/overlay-tools/index.js +29 -0
- package/dist/cjs/src/overlay-tools/index.js.map +1 -0
- package/dist/cjs/src/primitives/PrivateKey.js +17 -7
- package/dist/cjs/src/primitives/PrivateKey.js.map +1 -1
- package/dist/cjs/src/primitives/TransactionSignature.js +17 -7
- package/dist/cjs/src/primitives/TransactionSignature.js.map +1 -1
- package/dist/cjs/src/primitives/index.js +17 -7
- package/dist/cjs/src/primitives/index.js.map +1 -1
- package/dist/cjs/src/script/Spend.js +17 -7
- package/dist/cjs/src/script/Spend.js.map +1 -1
- package/dist/cjs/src/script/templates/PushDrop.js +218 -0
- package/dist/cjs/src/script/templates/PushDrop.js.map +1 -0
- package/dist/cjs/src/script/templates/index.js +3 -1
- package/dist/cjs/src/script/templates/index.js.map +1 -1
- package/dist/cjs/src/transaction/http/DefaultHttpClient.js +1 -1
- package/dist/cjs/src/transaction/http/DefaultHttpClient.js.map +1 -1
- package/dist/cjs/src/wallet/CachedKeyDeriver.js +177 -0
- package/dist/cjs/src/wallet/CachedKeyDeriver.js.map +1 -0
- package/dist/cjs/src/wallet/KeyDeriver.js +174 -0
- package/dist/cjs/src/wallet/KeyDeriver.js.map +1 -0
- package/dist/cjs/src/wallet/ProtoWallet.js +245 -0
- package/dist/cjs/src/wallet/ProtoWallet.js.map +1 -0
- package/dist/cjs/src/wallet/Wallet.interfaces.js +3 -0
- package/dist/cjs/src/wallet/Wallet.interfaces.js.map +1 -0
- package/dist/cjs/src/wallet/WalletClient.js +181 -0
- package/dist/cjs/src/wallet/WalletClient.js.map +1 -0
- package/dist/cjs/src/wallet/WalletError.js +28 -0
- package/dist/cjs/src/wallet/WalletError.js.map +1 -0
- package/dist/cjs/src/wallet/index.js +34 -0
- package/dist/cjs/src/wallet/index.js.map +1 -0
- package/dist/cjs/src/wallet/substrates/HTTPWalletWire.js +45 -0
- package/dist/cjs/src/wallet/substrates/HTTPWalletWire.js.map +1 -0
- package/dist/cjs/src/wallet/substrates/WalletWire.js +3 -0
- package/dist/cjs/src/wallet/substrates/WalletWire.js.map +1 -0
- package/dist/cjs/src/wallet/substrates/WalletWireCalls.js +36 -0
- package/dist/cjs/src/wallet/substrates/WalletWireCalls.js.map +1 -0
- package/dist/cjs/src/wallet/substrates/WalletWireProcessor.js +1821 -0
- package/dist/cjs/src/wallet/substrates/WalletWireProcessor.js.map +1 -0
- package/dist/cjs/src/wallet/substrates/WalletWireTransceiver.js +1305 -0
- package/dist/cjs/src/wallet/substrates/WalletWireTransceiver.js.map +1 -0
- package/dist/cjs/src/wallet/substrates/XDM.js +130 -0
- package/dist/cjs/src/wallet/substrates/XDM.js.map +1 -0
- package/dist/cjs/src/wallet/substrates/index.js +33 -0
- package/dist/cjs/src/wallet/substrates/index.js.map +1 -0
- package/dist/cjs/src/wallet/substrates/window.CWI.js +102 -0
- package/dist/cjs/src/wallet/substrates/window.CWI.js.map +1 -0
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/mod.js +4 -0
- package/dist/esm/mod.js.map +1 -1
- package/dist/esm/src/auth/Certificate.js +185 -0
- package/dist/esm/src/auth/Certificate.js.map +1 -0
- package/dist/esm/src/auth/index.js +2 -0
- package/dist/esm/src/auth/index.js.map +1 -0
- package/dist/esm/src/overlay-tools/LookupResolver.js +167 -0
- package/dist/esm/src/overlay-tools/LookupResolver.js.map +1 -0
- package/dist/esm/src/overlay-tools/OverlayAdminTokenTemplate.js +64 -0
- package/dist/esm/src/overlay-tools/OverlayAdminTokenTemplate.js.map +1 -0
- package/dist/esm/src/overlay-tools/SHIPBroadcaster.js +335 -0
- package/dist/esm/src/overlay-tools/SHIPBroadcaster.js.map +1 -0
- package/dist/esm/src/overlay-tools/index.js +6 -0
- package/dist/esm/src/overlay-tools/index.js.map +1 -0
- package/dist/esm/src/script/templates/PushDrop.js +215 -0
- package/dist/esm/src/script/templates/PushDrop.js.map +1 -0
- package/dist/esm/src/script/templates/index.js +1 -0
- package/dist/esm/src/script/templates/index.js.map +1 -1
- package/dist/esm/src/transaction/http/DefaultHttpClient.js +1 -1
- package/dist/esm/src/transaction/http/DefaultHttpClient.js.map +1 -1
- package/dist/esm/src/wallet/CachedKeyDeriver.js +174 -0
- package/dist/esm/src/wallet/CachedKeyDeriver.js.map +1 -0
- package/dist/esm/src/wallet/KeyDeriver.js +172 -0
- package/dist/esm/src/wallet/KeyDeriver.js.map +1 -0
- package/dist/esm/src/wallet/ProtoWallet.js +207 -0
- package/dist/esm/src/wallet/ProtoWallet.js.map +1 -0
- package/dist/esm/src/wallet/Wallet.interfaces.js +2 -0
- package/dist/esm/src/wallet/Wallet.interfaces.js.map +1 -0
- package/dist/esm/src/wallet/WalletClient.js +177 -0
- package/dist/esm/src/wallet/WalletClient.js.map +1 -0
- package/dist/esm/src/wallet/WalletError.js +25 -0
- package/dist/esm/src/wallet/WalletError.js.map +1 -0
- package/dist/esm/src/wallet/index.js +9 -0
- package/dist/esm/src/wallet/index.js.map +1 -0
- package/dist/esm/src/wallet/substrates/HTTPWalletWire.js +42 -0
- package/dist/esm/src/wallet/substrates/HTTPWalletWire.js.map +1 -0
- package/dist/esm/src/wallet/substrates/WalletWire.js +2 -0
- package/dist/esm/src/wallet/substrates/WalletWire.js.map +1 -0
- package/dist/esm/src/wallet/substrates/WalletWireCalls.js +34 -0
- package/dist/esm/src/wallet/substrates/WalletWireCalls.js.map +1 -0
- package/dist/esm/src/wallet/substrates/WalletWireProcessor.js +1816 -0
- package/dist/esm/src/wallet/substrates/WalletWireProcessor.js.map +1 -0
- package/dist/esm/src/wallet/substrates/WalletWireTransceiver.js +1300 -0
- package/dist/esm/src/wallet/substrates/WalletWireTransceiver.js.map +1 -0
- package/dist/esm/src/wallet/substrates/XDM.js +128 -0
- package/dist/esm/src/wallet/substrates/XDM.js.map +1 -0
- package/dist/esm/src/wallet/substrates/index.js +8 -0
- package/dist/esm/src/wallet/substrates/index.js.map +1 -0
- package/dist/esm/src/wallet/substrates/window.CWI.js +100 -0
- package/dist/esm/src/wallet/substrates/window.CWI.js.map +1 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/mod.d.ts +4 -0
- package/dist/types/mod.d.ts.map +1 -1
- package/dist/types/src/auth/Certificate.d.ts +76 -0
- package/dist/types/src/auth/Certificate.d.ts.map +1 -0
- package/dist/types/src/auth/index.d.ts +2 -0
- package/dist/types/src/auth/index.d.ts.map +1 -0
- package/dist/types/src/overlay-tools/LookupResolver.d.ts +71 -0
- package/dist/types/src/overlay-tools/LookupResolver.d.ts.map +1 -0
- package/dist/types/src/overlay-tools/OverlayAdminTokenTemplate.d.ts +44 -0
- package/dist/types/src/overlay-tools/OverlayAdminTokenTemplate.d.ts.map +1 -0
- package/dist/types/src/overlay-tools/SHIPBroadcaster.d.ts +90 -0
- package/dist/types/src/overlay-tools/SHIPBroadcaster.d.ts.map +1 -0
- package/dist/types/src/overlay-tools/index.d.ts +6 -0
- package/dist/types/src/overlay-tools/index.d.ts.map +1 -0
- package/dist/types/src/script/templates/PushDrop.d.ts +53 -0
- package/dist/types/src/script/templates/PushDrop.d.ts.map +1 -0
- package/dist/types/src/script/templates/index.d.ts +1 -0
- package/dist/types/src/script/templates/index.d.ts.map +1 -1
- package/dist/types/src/wallet/CachedKeyDeriver.d.ts +92 -0
- package/dist/types/src/wallet/CachedKeyDeriver.d.ts.map +1 -0
- package/dist/types/src/wallet/KeyDeriver.d.ts +72 -0
- package/dist/types/src/wallet/KeyDeriver.d.ts.map +1 -0
- package/dist/types/src/wallet/ProtoWallet.d.ts +415 -0
- package/dist/types/src/wallet/ProtoWallet.d.ts.map +1 -0
- package/dist/types/src/wallet/Wallet.interfaces.d.ts +996 -0
- package/dist/types/src/wallet/Wallet.interfaces.d.ts.map +1 -0
- package/dist/types/src/wallet/WalletClient.d.ts +182 -0
- package/dist/types/src/wallet/WalletClient.d.ts.map +1 -0
- package/dist/types/src/wallet/WalletError.d.ts +14 -0
- package/dist/types/src/wallet/WalletError.d.ts.map +1 -0
- package/dist/types/src/wallet/index.d.ts +9 -0
- package/dist/types/src/wallet/index.d.ts.map +1 -0
- package/dist/types/src/wallet/substrates/HTTPWalletWire.d.ts +9 -0
- package/dist/types/src/wallet/substrates/HTTPWalletWire.d.ts.map +1 -0
- package/dist/types/src/wallet/substrates/WalletWire.d.ts +7 -0
- package/dist/types/src/wallet/substrates/WalletWire.d.ts.map +1 -0
- package/dist/types/src/wallet/substrates/WalletWireCalls.d.ts +33 -0
- package/dist/types/src/wallet/substrates/WalletWireCalls.d.ts.map +1 -0
- package/dist/types/src/wallet/substrates/WalletWireProcessor.d.ts +18 -0
- package/dist/types/src/wallet/substrates/WalletWireProcessor.d.ts.map +1 -0
- package/dist/types/src/wallet/substrates/WalletWireTransceiver.d.ts +196 -0
- package/dist/types/src/wallet/substrates/WalletWireTransceiver.d.ts.map +1 -0
- package/dist/types/src/wallet/substrates/XDM.d.ts +412 -0
- package/dist/types/src/wallet/substrates/XDM.d.ts.map +1 -0
- package/dist/types/src/wallet/substrates/index.d.ts +8 -0
- package/dist/types/src/wallet/substrates/index.d.ts.map +1 -0
- package/dist/types/src/wallet/substrates/window.CWI.d.ts +410 -0
- package/dist/types/src/wallet/substrates/window.CWI.d.ts.map +1 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/umd/bundle.js +1 -1
- package/docs/overlay-tools.md +537 -0
- package/docs/script.md +135 -0
- package/docs/totp.md +119 -0
- package/docs/wallet-substrates.md +10 -0
- package/docs/wallet.md +3718 -0
- package/mod.ts +5 -1
- package/package.json +44 -3
- package/src/auth/Certificate.ts +233 -0
- package/src/auth/__tests/Certificate.test.ts +282 -0
- package/src/auth/index.ts +1 -0
- package/src/overlay-tools/LookupResolver.ts +228 -0
- package/src/overlay-tools/OverlayAdminTokenTemplate.ts +79 -0
- package/src/overlay-tools/SHIPBroadcaster.ts +405 -0
- package/src/overlay-tools/__tests/LookupResolver.test.ts +1403 -0
- package/src/overlay-tools/__tests/OverlayAdminTokenTemplate.test.ts +69 -0
- package/src/overlay-tools/__tests/SHIPBroadcaster.test.ts +904 -0
- package/src/overlay-tools/index.ts +5 -0
- package/src/script/templates/PushDrop.ts +246 -0
- package/src/script/templates/__tests/PushDrop.test.ts +158 -0
- package/src/script/templates/index.ts +1 -0
- package/src/transaction/http/DefaultHttpClient.ts +1 -1
- package/src/wallet/CachedKeyDeriver.ts +193 -0
- package/src/wallet/KeyDeriver.ts +178 -0
- package/src/wallet/ProtoWallet.ts +732 -0
- package/src/wallet/Wallet.interfaces.ts +1170 -0
- package/src/wallet/WalletClient.ts +201 -0
- package/src/wallet/WalletError.ts +27 -0
- package/src/wallet/__tests/CachedKeyDeriver.test.ts +322 -0
- package/src/wallet/__tests/KeyDeriver.test.ts +118 -0
- package/src/wallet/__tests/ProtoWallet.test.ts +543 -0
- package/src/wallet/index.ts +8 -0
- package/src/wallet/substrates/HTTPWalletWire.ts +47 -0
- package/src/wallet/substrates/WalletWire.ts +6 -0
- package/src/wallet/substrates/WalletWireCalls.ts +34 -0
- package/src/wallet/substrates/WalletWireProcessor.ts +2046 -0
- package/src/wallet/substrates/WalletWireTransceiver.ts +1454 -0
- package/src/wallet/substrates/XDM.ts +157 -0
- package/src/wallet/substrates/__tests/WalletWire.integration.test.ts +2194 -0
- package/src/wallet/substrates/__tests/XDM.test.ts +659 -0
- package/src/wallet/substrates/index.ts +7 -0
- package/src/wallet/substrates/window.CWI.ts +133 -0
package/docs/wallet.md
ADDED
|
@@ -0,0 +1,3718 @@
|
|
|
1
|
+
# API
|
|
2
|
+
|
|
3
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
4
|
+
|
|
5
|
+
## Interfaces
|
|
6
|
+
|
|
7
|
+
| | | |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| [AbortActionArgs](#interface-abortactionargs) | [InternalizeActionResult](#interface-internalizeactionresult) | [SignActionOptions](#interface-signactionoptions) |
|
|
10
|
+
| [AbortActionResult](#interface-abortactionresult) | [InternalizeOutput](#interface-internalizeoutput) | [SignActionResult](#interface-signactionresult) |
|
|
11
|
+
| [AcquireCertificateArgs](#interface-acquirecertificateargs) | [KeyLinkageArgs](#interface-keylinkageargs) | [SignActionSpend](#interface-signactionspend) |
|
|
12
|
+
| [AcquireCertificateResult](#interface-acquirecertificateresult) | [KeyLinkageResult](#interface-keylinkageresult) | [SignableTransaction](#interface-signabletransaction) |
|
|
13
|
+
| [BasketInsertion](#interface-basketinsertion) | [ListActionsArgs](#interface-listactionsargs) | [VerifyHmacArgs](#interface-verifyhmacargs) |
|
|
14
|
+
| [CreateActionArgs](#interface-createactionargs) | [ListActionsResult](#interface-listactionsresult) | [VerifySignatureArgs](#interface-verifysignatureargs) |
|
|
15
|
+
| [CreateActionInput](#interface-createactioninput) | [ListCertificatesArgs](#interface-listcertificatesargs) | [Wallet](#interface-wallet) |
|
|
16
|
+
| [CreateActionOptions](#interface-createactionoptions) | [ListCertificatesResult](#interface-listcertificatesresult) | [WalletAction](#interface-walletaction) |
|
|
17
|
+
| [CreateActionOutput](#interface-createactionoutput) | [ListOutputsArgs](#interface-listoutputsargs) | [WalletActionInput](#interface-walletactioninput) |
|
|
18
|
+
| [CreateActionResult](#interface-createactionresult) | [ListOutputsResult](#interface-listoutputsresult) | [WalletActionOutput](#interface-walletactionoutput) |
|
|
19
|
+
| [CreateHmacArgs](#interface-createhmacargs) | [ProveCertificateArgs](#interface-provecertificateargs) | [WalletCertificate](#interface-walletcertificate) |
|
|
20
|
+
| [CreateSignatureArgs](#interface-createsignatureargs) | [ProveCertificateResult](#interface-provecertificateresult) | [WalletDecryptArgs](#interface-walletdecryptargs) |
|
|
21
|
+
| [DiscoverByAttributesArgs](#interface-discoverbyattributesargs) | [RelinquishCertificateArgs](#interface-relinquishcertificateargs) | [WalletEncryptArgs](#interface-walletencryptargs) |
|
|
22
|
+
| [DiscoverByIdentityKeyArgs](#interface-discoverbyidentitykeyargs) | [RevealCounterpartyKeyLinkageArgs](#interface-revealcounterpartykeylinkageargs) | [WalletEncryptionArgs](#interface-walletencryptionargs) |
|
|
23
|
+
| [DiscoverCertificatesResult](#interface-discovercertificatesresult) | [RevealCounterpartyKeyLinkageResult](#interface-revealcounterpartykeylinkageresult) | [WalletErrorObject](#interface-walleterrorobject) |
|
|
24
|
+
| [GetPublicKeyArgs](#interface-getpublickeyargs) | [RevealSpecificKeyLinkageArgs](#interface-revealspecifickeylinkageargs) | [WalletOutput](#interface-walletoutput) |
|
|
25
|
+
| [IdentityCertificate](#interface-identitycertificate) | [RevealSpecificKeyLinkageResult](#interface-revealspecifickeylinkageresult) | [WalletPayment](#interface-walletpayment) |
|
|
26
|
+
| [IdentityCertifier](#interface-identitycertifier) | [SendWithResult](#interface-sendwithresult) | [WalletWire](#interface-walletwire) |
|
|
27
|
+
| [InternalizeActionArgs](#interface-internalizeactionargs) | [SignActionArgs](#interface-signactionargs) | |
|
|
28
|
+
|
|
29
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
### Interface: CreateActionInput
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
export interface CreateActionInput {
|
|
37
|
+
outpoint: OutpointString;
|
|
38
|
+
inputDescription: DescriptionString5to50Bytes;
|
|
39
|
+
unlockingScript?: HexString;
|
|
40
|
+
unlockingScriptLength?: PositiveInteger;
|
|
41
|
+
sequenceNumber?: PositiveIntegerOrZero;
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
### Interface: CreateActionOutput
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
export interface CreateActionOutput {
|
|
52
|
+
lockingScript: HexString;
|
|
53
|
+
satoshis: SatoshiValue;
|
|
54
|
+
outputDescription: DescriptionString5to50Bytes;
|
|
55
|
+
basket?: BasketStringUnder300Bytes;
|
|
56
|
+
customInstructions?: string;
|
|
57
|
+
tags?: OutputTagStringUnder300Bytes[];
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
### Interface: CreateActionOptions
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
export interface CreateActionOptions {
|
|
68
|
+
signAndProcess?: BooleanDefaultTrue;
|
|
69
|
+
acceptDelayedBroadcast?: BooleanDefaultTrue;
|
|
70
|
+
trustSelf?: TrustSelf;
|
|
71
|
+
knownTxids?: TXIDHexString[];
|
|
72
|
+
returnTXIDOnly?: BooleanDefaultFalse;
|
|
73
|
+
noSend?: BooleanDefaultFalse;
|
|
74
|
+
noSendChange?: OutpointString[];
|
|
75
|
+
sendWith?: TXIDHexString[];
|
|
76
|
+
randomizeOutputs?: BooleanDefaultTrue;
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
### Interface: SendWithResult
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
export interface SendWithResult {
|
|
87
|
+
txid: TXIDHexString;
|
|
88
|
+
status: "unproven" | "sending" | "failed";
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
### Interface: SignableTransaction
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
export interface SignableTransaction {
|
|
99
|
+
tx: AtomicBEEF;
|
|
100
|
+
reference: Base64String;
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
### Interface: CreateActionResult
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
export interface CreateActionResult {
|
|
111
|
+
txid?: TXIDHexString;
|
|
112
|
+
tx?: AtomicBEEF;
|
|
113
|
+
noSendChange?: OutpointString[];
|
|
114
|
+
sendWithResults?: Array<SendWithResult>;
|
|
115
|
+
signableTransaction?: SignableTransaction;
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
### Interface: CreateActionArgs
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
export interface CreateActionArgs {
|
|
126
|
+
description: DescriptionString5to50Bytes;
|
|
127
|
+
inputBEEF?: BEEF;
|
|
128
|
+
inputs?: Array<CreateActionInput>;
|
|
129
|
+
outputs?: Array<CreateActionOutput>;
|
|
130
|
+
lockTime?: PositiveIntegerOrZero;
|
|
131
|
+
version?: PositiveIntegerOrZero;
|
|
132
|
+
labels?: LabelStringUnder300Bytes[];
|
|
133
|
+
options?: CreateActionOptions;
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
### Interface: SignActionSpend
|
|
141
|
+
|
|
142
|
+
```ts
|
|
143
|
+
export interface SignActionSpend {
|
|
144
|
+
unlockingScript: HexString;
|
|
145
|
+
sequenceNumber?: PositiveIntegerOrZero;
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
### Interface: SignActionOptions
|
|
153
|
+
|
|
154
|
+
```ts
|
|
155
|
+
export interface SignActionOptions {
|
|
156
|
+
acceptDelayedBroadcast?: BooleanDefaultTrue;
|
|
157
|
+
returnTXIDOnly?: BooleanDefaultFalse;
|
|
158
|
+
noSend?: BooleanDefaultFalse;
|
|
159
|
+
sendWith?: TXIDHexString[];
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
### Interface: SignActionArgs
|
|
167
|
+
|
|
168
|
+
```ts
|
|
169
|
+
export interface SignActionArgs {
|
|
170
|
+
spends: Record<PositiveIntegerOrZero, SignActionSpend>;
|
|
171
|
+
reference: Base64String;
|
|
172
|
+
options?: SignActionOptions;
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
### Interface: SignActionResult
|
|
180
|
+
|
|
181
|
+
```ts
|
|
182
|
+
export interface SignActionResult {
|
|
183
|
+
txid?: TXIDHexString;
|
|
184
|
+
tx?: AtomicBEEF;
|
|
185
|
+
sendWithResults?: Array<SendWithResult>;
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
### Interface: AbortActionArgs
|
|
193
|
+
|
|
194
|
+
```ts
|
|
195
|
+
export interface AbortActionArgs {
|
|
196
|
+
reference: Base64String;
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
### Interface: AbortActionResult
|
|
204
|
+
|
|
205
|
+
```ts
|
|
206
|
+
export interface AbortActionResult {
|
|
207
|
+
aborted: true;
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
### Interface: ListActionsArgs
|
|
215
|
+
|
|
216
|
+
```ts
|
|
217
|
+
export interface ListActionsArgs {
|
|
218
|
+
labels: LabelStringUnder300Bytes[];
|
|
219
|
+
labelQueryMode?: "any" | "all";
|
|
220
|
+
includeLabels?: BooleanDefaultFalse;
|
|
221
|
+
includeInputs?: BooleanDefaultFalse;
|
|
222
|
+
includeInputSourceLockingScripts?: BooleanDefaultFalse;
|
|
223
|
+
includeInputUnlockingScripts?: BooleanDefaultFalse;
|
|
224
|
+
includeOutputs?: BooleanDefaultFalse;
|
|
225
|
+
includeOutputLockingScripts?: BooleanDefaultFalse;
|
|
226
|
+
limit?: PositiveIntegerDefault10Max10000;
|
|
227
|
+
offset?: PositiveIntegerOrZero;
|
|
228
|
+
seekPermission?: BooleanDefaultTrue;
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
### Interface: WalletActionInput
|
|
236
|
+
|
|
237
|
+
```ts
|
|
238
|
+
export interface WalletActionInput {
|
|
239
|
+
sourceOutpoint: OutpointString;
|
|
240
|
+
sourceSatoshis: SatoshiValue;
|
|
241
|
+
sourceLockingScript?: HexString;
|
|
242
|
+
unlockingScript?: HexString;
|
|
243
|
+
inputDescription: DescriptionString5to50Bytes;
|
|
244
|
+
sequenceNumber: PositiveIntegerOrZero;
|
|
245
|
+
}
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
### Interface: WalletActionOutput
|
|
252
|
+
|
|
253
|
+
```ts
|
|
254
|
+
export interface WalletActionOutput {
|
|
255
|
+
satoshis: SatoshiValue;
|
|
256
|
+
lockingScript?: HexString;
|
|
257
|
+
spendable: boolean;
|
|
258
|
+
customInstructions?: string;
|
|
259
|
+
tags: OutputTagStringUnder300Bytes[];
|
|
260
|
+
outputIndex: PositiveIntegerOrZero;
|
|
261
|
+
outputDescription: DescriptionString5to50Bytes;
|
|
262
|
+
basket: BasketStringUnder300Bytes;
|
|
263
|
+
}
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
### Interface: WalletOutput
|
|
270
|
+
|
|
271
|
+
```ts
|
|
272
|
+
export interface WalletOutput {
|
|
273
|
+
satoshis: SatoshiValue;
|
|
274
|
+
lockingScript?: HexString;
|
|
275
|
+
spendable: true;
|
|
276
|
+
customInstructions?: string;
|
|
277
|
+
tags?: OutputTagStringUnder300Bytes[];
|
|
278
|
+
outpoint: OutpointString;
|
|
279
|
+
labels?: LabelStringUnder300Bytes[];
|
|
280
|
+
}
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
### Interface: WalletAction
|
|
287
|
+
|
|
288
|
+
```ts
|
|
289
|
+
export interface WalletAction {
|
|
290
|
+
txid: TXIDHexString;
|
|
291
|
+
satoshis: SatoshiValue;
|
|
292
|
+
status: ActionStatus;
|
|
293
|
+
isOutgoing: boolean;
|
|
294
|
+
description: DescriptionString5to50Bytes;
|
|
295
|
+
labels?: LabelStringUnder300Bytes[];
|
|
296
|
+
version: PositiveIntegerOrZero;
|
|
297
|
+
lockTime: PositiveIntegerOrZero;
|
|
298
|
+
inputs?: Array<WalletActionInput>;
|
|
299
|
+
outputs?: Array<WalletActionOutput>;
|
|
300
|
+
}
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
### Interface: ListActionsResult
|
|
307
|
+
|
|
308
|
+
```ts
|
|
309
|
+
export interface ListActionsResult {
|
|
310
|
+
totalActions: PositiveIntegerOrZero;
|
|
311
|
+
actions: Array<WalletAction>;
|
|
312
|
+
}
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
316
|
+
|
|
317
|
+
---
|
|
318
|
+
### Interface: WalletPayment
|
|
319
|
+
|
|
320
|
+
```ts
|
|
321
|
+
export interface WalletPayment {
|
|
322
|
+
derivationPrefix: Base64String;
|
|
323
|
+
derivationSuffix: Base64String;
|
|
324
|
+
senderIdentityKey: PubKeyHex;
|
|
325
|
+
}
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
### Interface: BasketInsertion
|
|
332
|
+
|
|
333
|
+
```ts
|
|
334
|
+
export interface BasketInsertion {
|
|
335
|
+
basket: BasketStringUnder300Bytes;
|
|
336
|
+
customInstructions?: string;
|
|
337
|
+
tags?: OutputTagStringUnder300Bytes[];
|
|
338
|
+
}
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
### Interface: InternalizeOutput
|
|
345
|
+
|
|
346
|
+
```ts
|
|
347
|
+
export interface InternalizeOutput {
|
|
348
|
+
outputIndex: PositiveIntegerOrZero;
|
|
349
|
+
protocol: "wallet payment" | "basket insertion";
|
|
350
|
+
paymentRemittance?: WalletPayment;
|
|
351
|
+
insertionRemittance?: BasketInsertion;
|
|
352
|
+
}
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
### Interface: InternalizeActionArgs
|
|
359
|
+
|
|
360
|
+
```ts
|
|
361
|
+
export interface InternalizeActionArgs {
|
|
362
|
+
tx: AtomicBEEF;
|
|
363
|
+
outputs: Array<InternalizeOutput>;
|
|
364
|
+
description: DescriptionString5to50Bytes;
|
|
365
|
+
labels?: LabelStringUnder300Bytes[];
|
|
366
|
+
seekPermission?: BooleanDefaultTrue;
|
|
367
|
+
}
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
371
|
+
|
|
372
|
+
---
|
|
373
|
+
### Interface: InternalizeActionResult
|
|
374
|
+
|
|
375
|
+
```ts
|
|
376
|
+
export interface InternalizeActionResult {
|
|
377
|
+
accepted: true;
|
|
378
|
+
}
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
382
|
+
|
|
383
|
+
---
|
|
384
|
+
### Interface: ListOutputsArgs
|
|
385
|
+
|
|
386
|
+
```ts
|
|
387
|
+
export interface ListOutputsArgs {
|
|
388
|
+
basket: BasketStringUnder300Bytes;
|
|
389
|
+
tags?: OutputTagStringUnder300Bytes[];
|
|
390
|
+
tagQueryMode?: "all" | "any";
|
|
391
|
+
include?: "locking scripts" | "entire transactions";
|
|
392
|
+
includeCustomInstructions?: BooleanDefaultFalse;
|
|
393
|
+
includeTags?: BooleanDefaultFalse;
|
|
394
|
+
includeLabels?: BooleanDefaultFalse;
|
|
395
|
+
limit?: PositiveIntegerDefault10Max10000;
|
|
396
|
+
offset?: PositiveIntegerOrZero;
|
|
397
|
+
seekPermission?: BooleanDefaultTrue;
|
|
398
|
+
}
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
402
|
+
|
|
403
|
+
---
|
|
404
|
+
### Interface: ListOutputsResult
|
|
405
|
+
|
|
406
|
+
```ts
|
|
407
|
+
export interface ListOutputsResult {
|
|
408
|
+
totalOutputs: PositiveIntegerOrZero;
|
|
409
|
+
BEEF?: BEEF;
|
|
410
|
+
outputs: Array<WalletOutput>;
|
|
411
|
+
}
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
415
|
+
|
|
416
|
+
---
|
|
417
|
+
### Interface: KeyLinkageArgs
|
|
418
|
+
|
|
419
|
+
```ts
|
|
420
|
+
export interface KeyLinkageArgs {
|
|
421
|
+
protocolID: WalletProtocol;
|
|
422
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
423
|
+
counterparty?: WalletCounterparty;
|
|
424
|
+
privileged?: BooleanDefaultFalse;
|
|
425
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
426
|
+
}
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
430
|
+
|
|
431
|
+
---
|
|
432
|
+
### Interface: WalletEncryptionArgs
|
|
433
|
+
|
|
434
|
+
```ts
|
|
435
|
+
export interface WalletEncryptionArgs extends KeyLinkageArgs {
|
|
436
|
+
seekPermission?: BooleanDefaultTrue;
|
|
437
|
+
}
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
441
|
+
|
|
442
|
+
---
|
|
443
|
+
### Interface: GetPublicKeyArgs
|
|
444
|
+
|
|
445
|
+
When `identityKey` is true, `WalletEncryptionArgs` are not used.
|
|
446
|
+
|
|
447
|
+
When `identityKey` is undefined, `WalletEncryptionArgs` are required.
|
|
448
|
+
|
|
449
|
+
```ts
|
|
450
|
+
export interface GetPublicKeyArgs extends Partial<WalletEncryptionArgs> {
|
|
451
|
+
identityKey?: true;
|
|
452
|
+
forSelf?: BooleanDefaultFalse;
|
|
453
|
+
}
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
457
|
+
|
|
458
|
+
---
|
|
459
|
+
### Interface: RevealCounterpartyKeyLinkageArgs
|
|
460
|
+
|
|
461
|
+
```ts
|
|
462
|
+
export interface RevealCounterpartyKeyLinkageArgs {
|
|
463
|
+
counterparty: PubKeyHex;
|
|
464
|
+
verifier: PubKeyHex;
|
|
465
|
+
privileged?: BooleanDefaultFalse;
|
|
466
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
467
|
+
}
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
471
|
+
|
|
472
|
+
---
|
|
473
|
+
### Interface: RevealSpecificKeyLinkageArgs
|
|
474
|
+
|
|
475
|
+
```ts
|
|
476
|
+
export interface RevealSpecificKeyLinkageArgs extends KeyLinkageArgs {
|
|
477
|
+
verifier: PubKeyHex;
|
|
478
|
+
}
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
482
|
+
|
|
483
|
+
---
|
|
484
|
+
### Interface: KeyLinkageResult
|
|
485
|
+
|
|
486
|
+
```ts
|
|
487
|
+
export interface KeyLinkageResult {
|
|
488
|
+
encryptedLinkage: Byte[];
|
|
489
|
+
encryptedLinkageProof: Byte[];
|
|
490
|
+
prover: PubKeyHex;
|
|
491
|
+
verifier: PubKeyHex;
|
|
492
|
+
counterparty: PubKeyHex;
|
|
493
|
+
}
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
497
|
+
|
|
498
|
+
---
|
|
499
|
+
### Interface: RevealCounterpartyKeyLinkageResult
|
|
500
|
+
|
|
501
|
+
```ts
|
|
502
|
+
export interface RevealCounterpartyKeyLinkageResult extends KeyLinkageResult {
|
|
503
|
+
revelationTime: ISOTimestampString;
|
|
504
|
+
}
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
508
|
+
|
|
509
|
+
---
|
|
510
|
+
### Interface: RevealSpecificKeyLinkageResult
|
|
511
|
+
|
|
512
|
+
```ts
|
|
513
|
+
export interface RevealSpecificKeyLinkageResult extends KeyLinkageResult {
|
|
514
|
+
protocolID: WalletProtocol;
|
|
515
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
516
|
+
proofType: Byte;
|
|
517
|
+
}
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
521
|
+
|
|
522
|
+
---
|
|
523
|
+
### Interface: WalletEncryptArgs
|
|
524
|
+
|
|
525
|
+
```ts
|
|
526
|
+
export interface WalletEncryptArgs extends WalletEncryptionArgs {
|
|
527
|
+
plaintext: Byte[];
|
|
528
|
+
}
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
532
|
+
|
|
533
|
+
---
|
|
534
|
+
### Interface: WalletDecryptArgs
|
|
535
|
+
|
|
536
|
+
```ts
|
|
537
|
+
export interface WalletDecryptArgs extends WalletEncryptionArgs {
|
|
538
|
+
ciphertext: Byte[];
|
|
539
|
+
}
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
543
|
+
|
|
544
|
+
---
|
|
545
|
+
### Interface: CreateHmacArgs
|
|
546
|
+
|
|
547
|
+
```ts
|
|
548
|
+
export interface CreateHmacArgs extends WalletEncryptionArgs {
|
|
549
|
+
data: Byte[];
|
|
550
|
+
}
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
554
|
+
|
|
555
|
+
---
|
|
556
|
+
### Interface: VerifyHmacArgs
|
|
557
|
+
|
|
558
|
+
```ts
|
|
559
|
+
export interface VerifyHmacArgs extends WalletEncryptionArgs {
|
|
560
|
+
data: Byte[];
|
|
561
|
+
hmac: Byte[];
|
|
562
|
+
}
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
566
|
+
|
|
567
|
+
---
|
|
568
|
+
### Interface: CreateSignatureArgs
|
|
569
|
+
|
|
570
|
+
```ts
|
|
571
|
+
export interface CreateSignatureArgs extends WalletEncryptionArgs {
|
|
572
|
+
data?: Byte[];
|
|
573
|
+
hashToDirectlySign?: Byte[];
|
|
574
|
+
}
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
578
|
+
|
|
579
|
+
---
|
|
580
|
+
### Interface: VerifySignatureArgs
|
|
581
|
+
|
|
582
|
+
```ts
|
|
583
|
+
export interface VerifySignatureArgs extends WalletEncryptionArgs {
|
|
584
|
+
data?: Byte[];
|
|
585
|
+
hashToDirectlyVerify?: Byte[];
|
|
586
|
+
signature: Byte[];
|
|
587
|
+
forSelf?: BooleanDefaultFalse;
|
|
588
|
+
}
|
|
589
|
+
```
|
|
590
|
+
|
|
591
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
592
|
+
|
|
593
|
+
---
|
|
594
|
+
### Interface: AcquireCertificateArgs
|
|
595
|
+
|
|
596
|
+
```ts
|
|
597
|
+
export interface AcquireCertificateArgs {
|
|
598
|
+
type: Base64String;
|
|
599
|
+
certifier: PubKeyHex;
|
|
600
|
+
acquisitionProtocol: AcquisitionProtocol;
|
|
601
|
+
fields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
602
|
+
serialNumber?: Base64String;
|
|
603
|
+
revocationOutpoint?: OutpointString;
|
|
604
|
+
signature?: HexString;
|
|
605
|
+
certifierUrl?: string;
|
|
606
|
+
keyringRevealer?: KeyringRevealer;
|
|
607
|
+
keyringForSubject?: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
608
|
+
privileged?: BooleanDefaultFalse;
|
|
609
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
610
|
+
}
|
|
611
|
+
```
|
|
612
|
+
|
|
613
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
614
|
+
|
|
615
|
+
---
|
|
616
|
+
### Interface: WalletCertificate
|
|
617
|
+
|
|
618
|
+
```ts
|
|
619
|
+
export interface WalletCertificate {
|
|
620
|
+
type: Base64String;
|
|
621
|
+
subject: PubKeyHex;
|
|
622
|
+
serialNumber: Base64String;
|
|
623
|
+
certifier: PubKeyHex;
|
|
624
|
+
revocationOutpoint: OutpointString;
|
|
625
|
+
signature: HexString;
|
|
626
|
+
fields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
627
|
+
}
|
|
628
|
+
```
|
|
629
|
+
|
|
630
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
631
|
+
|
|
632
|
+
---
|
|
633
|
+
### Interface: IdentityCertifier
|
|
634
|
+
|
|
635
|
+
```ts
|
|
636
|
+
export interface IdentityCertifier {
|
|
637
|
+
name: EntityNameStringMax100Bytes;
|
|
638
|
+
iconUrl: EntityIconURLStringMax500Bytes;
|
|
639
|
+
description: DescriptionString5to50Bytes;
|
|
640
|
+
trust: PositiveIntegerMax10;
|
|
641
|
+
}
|
|
642
|
+
```
|
|
643
|
+
|
|
644
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
645
|
+
|
|
646
|
+
---
|
|
647
|
+
### Interface: IdentityCertificate
|
|
648
|
+
|
|
649
|
+
```ts
|
|
650
|
+
export interface IdentityCertificate extends WalletCertificate {
|
|
651
|
+
certifierInfo: IdentityCertifier;
|
|
652
|
+
publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
653
|
+
decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
654
|
+
}
|
|
655
|
+
```
|
|
656
|
+
|
|
657
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
658
|
+
|
|
659
|
+
---
|
|
660
|
+
### Interface: AcquireCertificateResult
|
|
661
|
+
|
|
662
|
+
```ts
|
|
663
|
+
export interface AcquireCertificateResult extends WalletCertificate {
|
|
664
|
+
}
|
|
665
|
+
```
|
|
666
|
+
|
|
667
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
668
|
+
|
|
669
|
+
---
|
|
670
|
+
### Interface: ListCertificatesArgs
|
|
671
|
+
|
|
672
|
+
```ts
|
|
673
|
+
export interface ListCertificatesArgs {
|
|
674
|
+
certifiers: PubKeyHex[];
|
|
675
|
+
types: Base64String[];
|
|
676
|
+
limit?: PositiveIntegerDefault10Max10000;
|
|
677
|
+
offset?: PositiveIntegerOrZero;
|
|
678
|
+
privileged?: BooleanDefaultFalse;
|
|
679
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
680
|
+
}
|
|
681
|
+
```
|
|
682
|
+
|
|
683
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
684
|
+
|
|
685
|
+
---
|
|
686
|
+
### Interface: ListCertificatesResult
|
|
687
|
+
|
|
688
|
+
```ts
|
|
689
|
+
export interface ListCertificatesResult {
|
|
690
|
+
totalCertificates: PositiveIntegerOrZero;
|
|
691
|
+
certificates: Array<WalletCertificate>;
|
|
692
|
+
}
|
|
693
|
+
```
|
|
694
|
+
|
|
695
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
696
|
+
|
|
697
|
+
---
|
|
698
|
+
### Interface: ProveCertificateArgs
|
|
699
|
+
|
|
700
|
+
```ts
|
|
701
|
+
export interface ProveCertificateArgs {
|
|
702
|
+
certificate: WalletCertificate;
|
|
703
|
+
fieldsToReveal: CertificateFieldNameUnder50Bytes[];
|
|
704
|
+
verifier: PubKeyHex;
|
|
705
|
+
privileged?: BooleanDefaultFalse;
|
|
706
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
707
|
+
}
|
|
708
|
+
```
|
|
709
|
+
|
|
710
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
711
|
+
|
|
712
|
+
---
|
|
713
|
+
### Interface: ProveCertificateResult
|
|
714
|
+
|
|
715
|
+
```ts
|
|
716
|
+
export interface ProveCertificateResult {
|
|
717
|
+
keyringForVerifier: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
718
|
+
}
|
|
719
|
+
```
|
|
720
|
+
|
|
721
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
722
|
+
|
|
723
|
+
---
|
|
724
|
+
### Interface: RelinquishCertificateArgs
|
|
725
|
+
|
|
726
|
+
```ts
|
|
727
|
+
export interface RelinquishCertificateArgs {
|
|
728
|
+
type: Base64String;
|
|
729
|
+
serialNumber: Base64String;
|
|
730
|
+
certifier: PubKeyHex;
|
|
731
|
+
}
|
|
732
|
+
```
|
|
733
|
+
|
|
734
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
735
|
+
|
|
736
|
+
---
|
|
737
|
+
### Interface: DiscoverByIdentityKeyArgs
|
|
738
|
+
|
|
739
|
+
```ts
|
|
740
|
+
export interface DiscoverByIdentityKeyArgs {
|
|
741
|
+
identityKey: PubKeyHex;
|
|
742
|
+
limit?: PositiveIntegerDefault10Max10000;
|
|
743
|
+
offset?: PositiveIntegerOrZero;
|
|
744
|
+
seekPermission?: BooleanDefaultTrue;
|
|
745
|
+
}
|
|
746
|
+
```
|
|
747
|
+
|
|
748
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
749
|
+
|
|
750
|
+
---
|
|
751
|
+
### Interface: DiscoverCertificatesResult
|
|
752
|
+
|
|
753
|
+
```ts
|
|
754
|
+
export interface DiscoverCertificatesResult {
|
|
755
|
+
totalCertificates: PositiveIntegerOrZero;
|
|
756
|
+
certificates: Array<IdentityCertificate>;
|
|
757
|
+
}
|
|
758
|
+
```
|
|
759
|
+
|
|
760
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
761
|
+
|
|
762
|
+
---
|
|
763
|
+
### Interface: DiscoverByAttributesArgs
|
|
764
|
+
|
|
765
|
+
```ts
|
|
766
|
+
export interface DiscoverByAttributesArgs {
|
|
767
|
+
attributes: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
768
|
+
limit?: PositiveIntegerDefault10Max10000;
|
|
769
|
+
offset?: PositiveIntegerOrZero;
|
|
770
|
+
seekPermission?: BooleanDefaultTrue;
|
|
771
|
+
}
|
|
772
|
+
```
|
|
773
|
+
|
|
774
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
775
|
+
|
|
776
|
+
---
|
|
777
|
+
### Interface: WalletErrorObject
|
|
778
|
+
|
|
779
|
+
Every method of the `Wallet` interface has a return value of the form `Promise<object>`.
|
|
780
|
+
When errors occur, an exception object may be thrown which must conform to the `WalletError` interface.
|
|
781
|
+
Serialization layers can rely on the `isError` property being unique to error objects.
|
|
782
|
+
Deserialization should rethrow `WalletError` conforming objects.
|
|
783
|
+
|
|
784
|
+
```ts
|
|
785
|
+
export interface WalletErrorObject extends Error {
|
|
786
|
+
isError: true;
|
|
787
|
+
}
|
|
788
|
+
```
|
|
789
|
+
|
|
790
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
791
|
+
|
|
792
|
+
---
|
|
793
|
+
### Interface: Wallet
|
|
794
|
+
|
|
795
|
+
The Wallet interface defines a wallet capable of various tasks including transaction creation and signing,
|
|
796
|
+
encryption, decryption, identity certificate management, identity verification, and communication
|
|
797
|
+
with applications as per the BRC standards. This interface allows applications to interact with
|
|
798
|
+
the wallet for a range of functionalities aligned with the Babbage architectural principles.
|
|
799
|
+
|
|
800
|
+
Error Handling
|
|
801
|
+
|
|
802
|
+
Every method of the `Wallet` interface has a return value of the form `Promise<object>`.
|
|
803
|
+
When an error occurs, an exception object may be thrown which must conform to the `WalletError` interface.
|
|
804
|
+
Serialization layers can rely on the `isError` property being unique to error objects to
|
|
805
|
+
deserialize and rethrow `WalletError` conforming objects.
|
|
806
|
+
|
|
807
|
+
```ts
|
|
808
|
+
export interface Wallet {
|
|
809
|
+
createAction: (args: CreateActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<CreateActionResult>;
|
|
810
|
+
signAction: (args: SignActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<SignActionResult>;
|
|
811
|
+
abortAction: (args: AbortActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<AbortActionResult>;
|
|
812
|
+
listActions: (args: ListActionsArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<ListActionsResult>;
|
|
813
|
+
internalizeAction: (args: InternalizeActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<InternalizeActionResult>;
|
|
814
|
+
listOutputs: (args: ListOutputsArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<ListOutputsResult>;
|
|
815
|
+
relinquishOutput: (args: {
|
|
816
|
+
basket: BasketStringUnder300Bytes;
|
|
817
|
+
output: OutpointString;
|
|
818
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
819
|
+
relinquished: true;
|
|
820
|
+
}>;
|
|
821
|
+
getPublicKey: (args: GetPublicKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
822
|
+
publicKey: PubKeyHex;
|
|
823
|
+
}>;
|
|
824
|
+
revealCounterpartyKeyLinkage: (args: RevealCounterpartyKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<RevealCounterpartyKeyLinkageResult>;
|
|
825
|
+
revealSpecificKeyLinkage: (args: RevealSpecificKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<RevealSpecificKeyLinkageResult>;
|
|
826
|
+
encrypt: (args: WalletEncryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
827
|
+
ciphertext: Byte[];
|
|
828
|
+
}>;
|
|
829
|
+
decrypt: (args: WalletDecryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
830
|
+
plaintext: Byte[];
|
|
831
|
+
}>;
|
|
832
|
+
createHmac: (args: CreateHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
833
|
+
hmac: Byte[];
|
|
834
|
+
}>;
|
|
835
|
+
verifyHmac: (args: VerifyHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
836
|
+
valid: true;
|
|
837
|
+
}>;
|
|
838
|
+
createSignature: (args: CreateSignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
839
|
+
signature: Byte[];
|
|
840
|
+
}>;
|
|
841
|
+
verifySignature: (args: VerifySignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
842
|
+
valid: true;
|
|
843
|
+
}>;
|
|
844
|
+
acquireCertificate: (args: AcquireCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<AcquireCertificateResult>;
|
|
845
|
+
listCertificates: (args: ListCertificatesArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<ListCertificatesResult>;
|
|
846
|
+
proveCertificate: (args: ProveCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<ProveCertificateResult>;
|
|
847
|
+
relinquishCertificate: (args: RelinquishCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
848
|
+
relinquished: true;
|
|
849
|
+
}>;
|
|
850
|
+
discoverByIdentityKey: (args: DiscoverByIdentityKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<DiscoverCertificatesResult>;
|
|
851
|
+
discoverByAttributes: (args: DiscoverByAttributesArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<DiscoverCertificatesResult>;
|
|
852
|
+
isAuthenticated: (args: {}, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
853
|
+
authenticated: boolean;
|
|
854
|
+
}>;
|
|
855
|
+
waitForAuthentication: (args: {}, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
856
|
+
authenticated: true;
|
|
857
|
+
}>;
|
|
858
|
+
getHeight: (args: {}, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
859
|
+
height: PositiveInteger;
|
|
860
|
+
}>;
|
|
861
|
+
getHeaderForHeight: (args: {
|
|
862
|
+
height: PositiveInteger;
|
|
863
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
864
|
+
header: HexString;
|
|
865
|
+
}>;
|
|
866
|
+
getNetwork: (args: {}, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
867
|
+
network: WalletNetwork;
|
|
868
|
+
}>;
|
|
869
|
+
getVersion: (args: {}, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
870
|
+
version: VersionString7To30Bytes;
|
|
871
|
+
}>;
|
|
872
|
+
}
|
|
873
|
+
```
|
|
874
|
+
|
|
875
|
+
<details>
|
|
876
|
+
|
|
877
|
+
<summary>Interface Wallet Details</summary>
|
|
878
|
+
|
|
879
|
+
#### Property abortAction
|
|
880
|
+
|
|
881
|
+
Aborts a transaction that is in progress and has not yet been finalized or sent to the network.
|
|
882
|
+
|
|
883
|
+
```ts
|
|
884
|
+
abortAction: (args: AbortActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<AbortActionResult>
|
|
885
|
+
```
|
|
886
|
+
|
|
887
|
+
#### Property acquireCertificate
|
|
888
|
+
|
|
889
|
+
Acquires an identity certificate, whether by acquiring one from the certifier or by directly receiving it.
|
|
890
|
+
|
|
891
|
+
```ts
|
|
892
|
+
acquireCertificate: (args: AcquireCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<AcquireCertificateResult>
|
|
893
|
+
```
|
|
894
|
+
|
|
895
|
+
#### Property createAction
|
|
896
|
+
|
|
897
|
+
Creates a new Bitcoin transaction based on the provided inputs, outputs, labels, locks, and other options.
|
|
898
|
+
|
|
899
|
+
```ts
|
|
900
|
+
createAction: (args: CreateActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<CreateActionResult>
|
|
901
|
+
```
|
|
902
|
+
|
|
903
|
+
#### Property createHmac
|
|
904
|
+
|
|
905
|
+
Creates an HMAC (Hash-based Message Authentication Code) based on the provided data, protocol, key ID, counterparty, and other factors.
|
|
906
|
+
|
|
907
|
+
```ts
|
|
908
|
+
createHmac: (args: CreateHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
909
|
+
hmac: Byte[];
|
|
910
|
+
}>
|
|
911
|
+
```
|
|
912
|
+
|
|
913
|
+
#### Property createSignature
|
|
914
|
+
|
|
915
|
+
Creates a digital signature for the provided data or hash using a specific protocol, key, and optionally considering privilege and counterparty.
|
|
916
|
+
|
|
917
|
+
```ts
|
|
918
|
+
createSignature: (args: CreateSignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
919
|
+
signature: Byte[];
|
|
920
|
+
}>
|
|
921
|
+
```
|
|
922
|
+
|
|
923
|
+
#### Property decrypt
|
|
924
|
+
|
|
925
|
+
Decrypts the provided ciphertext using derived keys, based on the protocol ID, key ID, counterparty, and other factors.
|
|
926
|
+
|
|
927
|
+
```ts
|
|
928
|
+
decrypt: (args: WalletDecryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
929
|
+
plaintext: Byte[];
|
|
930
|
+
}>
|
|
931
|
+
```
|
|
932
|
+
|
|
933
|
+
#### Property discoverByAttributes
|
|
934
|
+
|
|
935
|
+
Discovers identity certificates belonging to other users, where the documents contain specific attributes, issued by a trusted entity.
|
|
936
|
+
|
|
937
|
+
```ts
|
|
938
|
+
discoverByAttributes: (args: DiscoverByAttributesArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<DiscoverCertificatesResult>
|
|
939
|
+
```
|
|
940
|
+
|
|
941
|
+
#### Property discoverByIdentityKey
|
|
942
|
+
|
|
943
|
+
Discovers identity certificates, issued to a given identity key by a trusted entity.
|
|
944
|
+
|
|
945
|
+
```ts
|
|
946
|
+
discoverByIdentityKey: (args: DiscoverByIdentityKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<DiscoverCertificatesResult>
|
|
947
|
+
```
|
|
948
|
+
|
|
949
|
+
#### Property encrypt
|
|
950
|
+
|
|
951
|
+
Encrypts the provided plaintext data using derived keys, based on the protocol ID, key ID, counterparty, and other factors.
|
|
952
|
+
|
|
953
|
+
```ts
|
|
954
|
+
encrypt: (args: WalletEncryptArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
955
|
+
ciphertext: Byte[];
|
|
956
|
+
}>
|
|
957
|
+
```
|
|
958
|
+
|
|
959
|
+
#### Property getHeaderForHeight
|
|
960
|
+
|
|
961
|
+
Retrieves the block header of a block at a specified height.
|
|
962
|
+
|
|
963
|
+
```ts
|
|
964
|
+
getHeaderForHeight: (args: {
|
|
965
|
+
height: PositiveInteger;
|
|
966
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
967
|
+
header: HexString;
|
|
968
|
+
}>
|
|
969
|
+
```
|
|
970
|
+
|
|
971
|
+
#### Property getHeight
|
|
972
|
+
|
|
973
|
+
Retrieves the current height of the blockchain.
|
|
974
|
+
|
|
975
|
+
```ts
|
|
976
|
+
getHeight: (args: {}, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
977
|
+
height: PositiveInteger;
|
|
978
|
+
}>
|
|
979
|
+
```
|
|
980
|
+
|
|
981
|
+
#### Property getNetwork
|
|
982
|
+
|
|
983
|
+
Retrieves the Bitcoin network the client is using (mainnet or testnet).
|
|
984
|
+
|
|
985
|
+
```ts
|
|
986
|
+
getNetwork: (args: {}, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
987
|
+
network: WalletNetwork;
|
|
988
|
+
}>
|
|
989
|
+
```
|
|
990
|
+
|
|
991
|
+
#### Property getPublicKey
|
|
992
|
+
|
|
993
|
+
Retrieves a derived or identity public key based on the requested protocol, key ID, counterparty, and other factors.
|
|
994
|
+
|
|
995
|
+
```ts
|
|
996
|
+
getPublicKey: (args: GetPublicKeyArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
997
|
+
publicKey: PubKeyHex;
|
|
998
|
+
}>
|
|
999
|
+
```
|
|
1000
|
+
|
|
1001
|
+
#### Property getVersion
|
|
1002
|
+
|
|
1003
|
+
Retrieves the current version string of the wallet.
|
|
1004
|
+
|
|
1005
|
+
```ts
|
|
1006
|
+
getVersion: (args: {}, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
1007
|
+
version: VersionString7To30Bytes;
|
|
1008
|
+
}>
|
|
1009
|
+
```
|
|
1010
|
+
|
|
1011
|
+
#### Property internalizeAction
|
|
1012
|
+
|
|
1013
|
+
Submits a transaction to be internalized and optionally labeled, outputs paid to the wallet balance, inserted into baskets, and/or tagged.
|
|
1014
|
+
|
|
1015
|
+
```ts
|
|
1016
|
+
internalizeAction: (args: InternalizeActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<InternalizeActionResult>
|
|
1017
|
+
```
|
|
1018
|
+
|
|
1019
|
+
#### Property isAuthenticated
|
|
1020
|
+
|
|
1021
|
+
Checks the authentication status of the user.
|
|
1022
|
+
|
|
1023
|
+
```ts
|
|
1024
|
+
isAuthenticated: (args: {}, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
1025
|
+
authenticated: boolean;
|
|
1026
|
+
}>
|
|
1027
|
+
```
|
|
1028
|
+
|
|
1029
|
+
#### Property listActions
|
|
1030
|
+
|
|
1031
|
+
Lists all transactions matching the specified labels.
|
|
1032
|
+
|
|
1033
|
+
```ts
|
|
1034
|
+
listActions: (args: ListActionsArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<ListActionsResult>
|
|
1035
|
+
```
|
|
1036
|
+
|
|
1037
|
+
#### Property listCertificates
|
|
1038
|
+
|
|
1039
|
+
Lists identity certificates belonging to the user, filtered by certifier(s) and type(s).
|
|
1040
|
+
|
|
1041
|
+
```ts
|
|
1042
|
+
listCertificates: (args: ListCertificatesArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<ListCertificatesResult>
|
|
1043
|
+
```
|
|
1044
|
+
|
|
1045
|
+
#### Property listOutputs
|
|
1046
|
+
|
|
1047
|
+
Lists the spendable outputs kept within a specific basket, optionally tagged with specific labels.
|
|
1048
|
+
|
|
1049
|
+
```ts
|
|
1050
|
+
listOutputs: (args: ListOutputsArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<ListOutputsResult>
|
|
1051
|
+
```
|
|
1052
|
+
|
|
1053
|
+
#### Property proveCertificate
|
|
1054
|
+
|
|
1055
|
+
Proves select fields of an identity certificate, as specified, when requested by a verifier.
|
|
1056
|
+
|
|
1057
|
+
```ts
|
|
1058
|
+
proveCertificate: (args: ProveCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<ProveCertificateResult>
|
|
1059
|
+
```
|
|
1060
|
+
|
|
1061
|
+
#### Property relinquishCertificate
|
|
1062
|
+
|
|
1063
|
+
Relinquishes an identity certificate, removing it from the wallet regardless of whether the revocation outpoint has become spent.
|
|
1064
|
+
|
|
1065
|
+
```ts
|
|
1066
|
+
relinquishCertificate: (args: RelinquishCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
1067
|
+
relinquished: true;
|
|
1068
|
+
}>
|
|
1069
|
+
```
|
|
1070
|
+
|
|
1071
|
+
#### Property relinquishOutput
|
|
1072
|
+
|
|
1073
|
+
Relinquish an output out of a basket, removing it from tracking without spending it.
|
|
1074
|
+
|
|
1075
|
+
```ts
|
|
1076
|
+
relinquishOutput: (args: {
|
|
1077
|
+
basket: BasketStringUnder300Bytes;
|
|
1078
|
+
output: OutpointString;
|
|
1079
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
1080
|
+
relinquished: true;
|
|
1081
|
+
}>
|
|
1082
|
+
```
|
|
1083
|
+
|
|
1084
|
+
#### Property revealCounterpartyKeyLinkage
|
|
1085
|
+
|
|
1086
|
+
Reveals the key linkage between ourselves and a counterparty, to a particular verifier, across all interactions with the counterparty.
|
|
1087
|
+
|
|
1088
|
+
```ts
|
|
1089
|
+
revealCounterpartyKeyLinkage: (args: RevealCounterpartyKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<RevealCounterpartyKeyLinkageResult>
|
|
1090
|
+
```
|
|
1091
|
+
|
|
1092
|
+
#### Property revealSpecificKeyLinkage
|
|
1093
|
+
|
|
1094
|
+
Reveals the key linkage between ourselves and a counterparty, to a particular verifier, with respect to a specific interaction.
|
|
1095
|
+
|
|
1096
|
+
```ts
|
|
1097
|
+
revealSpecificKeyLinkage: (args: RevealSpecificKeyLinkageArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<RevealSpecificKeyLinkageResult>
|
|
1098
|
+
```
|
|
1099
|
+
|
|
1100
|
+
#### Property signAction
|
|
1101
|
+
|
|
1102
|
+
Signs a transaction previously created using `createAction`.
|
|
1103
|
+
|
|
1104
|
+
```ts
|
|
1105
|
+
signAction: (args: SignActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<SignActionResult>
|
|
1106
|
+
```
|
|
1107
|
+
|
|
1108
|
+
#### Property verifyHmac
|
|
1109
|
+
|
|
1110
|
+
Verifies an HMAC (Hash-based Message Authentication Code) based on the provided data, protocol, key ID, counterparty, and other factors.
|
|
1111
|
+
|
|
1112
|
+
```ts
|
|
1113
|
+
verifyHmac: (args: VerifyHmacArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
1114
|
+
valid: true;
|
|
1115
|
+
}>
|
|
1116
|
+
```
|
|
1117
|
+
|
|
1118
|
+
#### Property verifySignature
|
|
1119
|
+
|
|
1120
|
+
Verifies a digital signature for the provided data or hash using a specific protocol, key, and optionally considering privilege and counterparty.
|
|
1121
|
+
|
|
1122
|
+
```ts
|
|
1123
|
+
verifySignature: (args: VerifySignatureArgs, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
1124
|
+
valid: true;
|
|
1125
|
+
}>
|
|
1126
|
+
```
|
|
1127
|
+
|
|
1128
|
+
#### Property waitForAuthentication
|
|
1129
|
+
|
|
1130
|
+
Continuously waits until the user is authenticated, returning the result once confirmed.
|
|
1131
|
+
|
|
1132
|
+
```ts
|
|
1133
|
+
waitForAuthentication: (args: {}, originator?: OriginatorDomainNameStringUnder250Bytes) => Promise<{
|
|
1134
|
+
authenticated: true;
|
|
1135
|
+
}>
|
|
1136
|
+
```
|
|
1137
|
+
|
|
1138
|
+
</details>
|
|
1139
|
+
|
|
1140
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1141
|
+
|
|
1142
|
+
---
|
|
1143
|
+
### Interface: WalletWire
|
|
1144
|
+
|
|
1145
|
+
A Wallet Wire is an abstraction over a raw transport medium where binary data can be sent to and subsequently received from a wallet.
|
|
1146
|
+
|
|
1147
|
+
```ts
|
|
1148
|
+
export default interface WalletWire {
|
|
1149
|
+
transmitToWallet: (message: number[]) => Promise<number[]>;
|
|
1150
|
+
}
|
|
1151
|
+
```
|
|
1152
|
+
|
|
1153
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1154
|
+
|
|
1155
|
+
---
|
|
1156
|
+
## Classes
|
|
1157
|
+
|
|
1158
|
+
| |
|
|
1159
|
+
| --- |
|
|
1160
|
+
| [CachedKeyDeriver](#class-cachedkeyderiver) |
|
|
1161
|
+
| [HTTPWalletWire](#class-httpwalletwire) |
|
|
1162
|
+
| [KeyDeriver](#class-keyderiver) |
|
|
1163
|
+
| [ProtoWallet](#class-protowallet) |
|
|
1164
|
+
| [WalletClient](#class-walletclient) |
|
|
1165
|
+
| [WalletError](#class-walleterror) |
|
|
1166
|
+
| [WalletWireProcessor](#class-walletwireprocessor) |
|
|
1167
|
+
| [WalletWireTransceiver](#class-walletwiretransceiver) |
|
|
1168
|
+
| [WindowCWISubstrate](#class-windowcwisubstrate) |
|
|
1169
|
+
| [XDMSubstrate](#class-xdmsubstrate) |
|
|
1170
|
+
|
|
1171
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1172
|
+
|
|
1173
|
+
---
|
|
1174
|
+
|
|
1175
|
+
### Class: KeyDeriver
|
|
1176
|
+
|
|
1177
|
+
Class responsible for deriving various types of keys using a root private key.
|
|
1178
|
+
It supports deriving public and private keys, symmetric keys, and revealing key linkages.
|
|
1179
|
+
|
|
1180
|
+
```ts
|
|
1181
|
+
export default class KeyDeriver {
|
|
1182
|
+
rootKey: PrivateKey;
|
|
1183
|
+
constructor(rootKey: PrivateKey | "anyone")
|
|
1184
|
+
derivePublicKey(protocolID: [
|
|
1185
|
+
0 | 1 | 2,
|
|
1186
|
+
string
|
|
1187
|
+
], keyID: string, counterparty: PublicKey | string | "self" | "anyone", forSelf: boolean = false): PublicKey
|
|
1188
|
+
derivePrivateKey(protocolID: [
|
|
1189
|
+
0 | 1 | 2,
|
|
1190
|
+
string
|
|
1191
|
+
], keyID: string, counterparty: PublicKey | string | "self" | "anyone"): PrivateKey
|
|
1192
|
+
deriveSymmetricKey(protocolID: [
|
|
1193
|
+
0 | 1 | 2,
|
|
1194
|
+
string
|
|
1195
|
+
], keyID: string, counterparty: PublicKey | string | "self" | "anyone"): SymmetricKey
|
|
1196
|
+
revealCounterpartySecret(counterparty: PublicKey | string | "self" | "anyone"): number[]
|
|
1197
|
+
revealSpecificSecret(counterparty: PublicKey | string | "self" | "anyone", protocolID: [
|
|
1198
|
+
0 | 1 | 2,
|
|
1199
|
+
string
|
|
1200
|
+
], keyID: string): number[]
|
|
1201
|
+
}
|
|
1202
|
+
```
|
|
1203
|
+
|
|
1204
|
+
<details>
|
|
1205
|
+
|
|
1206
|
+
<summary>Class KeyDeriver Details</summary>
|
|
1207
|
+
|
|
1208
|
+
#### Constructor
|
|
1209
|
+
|
|
1210
|
+
Initializes the KeyDeriver instance with a root private key.
|
|
1211
|
+
|
|
1212
|
+
```ts
|
|
1213
|
+
constructor(rootKey: PrivateKey | "anyone")
|
|
1214
|
+
```
|
|
1215
|
+
|
|
1216
|
+
Argument Details
|
|
1217
|
+
|
|
1218
|
+
+ **rootKey**
|
|
1219
|
+
+ The root private key or the string 'anyone'.
|
|
1220
|
+
|
|
1221
|
+
#### Method derivePrivateKey
|
|
1222
|
+
|
|
1223
|
+
Derives a private key based on protocol ID, key ID, and counterparty.
|
|
1224
|
+
|
|
1225
|
+
```ts
|
|
1226
|
+
derivePrivateKey(protocolID: [
|
|
1227
|
+
0 | 1 | 2,
|
|
1228
|
+
string
|
|
1229
|
+
], keyID: string, counterparty: PublicKey | string | "self" | "anyone"): PrivateKey
|
|
1230
|
+
```
|
|
1231
|
+
|
|
1232
|
+
Returns
|
|
1233
|
+
|
|
1234
|
+
- The derived private key.
|
|
1235
|
+
|
|
1236
|
+
Argument Details
|
|
1237
|
+
|
|
1238
|
+
+ **protocolID**
|
|
1239
|
+
+ The protocol ID including a security level and protocol name.
|
|
1240
|
+
+ **keyID**
|
|
1241
|
+
+ The key identifier.
|
|
1242
|
+
+ **counterparty**
|
|
1243
|
+
+ The counterparty's public key or a predefined value ('self' or 'anyone').
|
|
1244
|
+
|
|
1245
|
+
#### Method derivePublicKey
|
|
1246
|
+
|
|
1247
|
+
Derives a public key based on protocol ID, key ID, and counterparty.
|
|
1248
|
+
|
|
1249
|
+
```ts
|
|
1250
|
+
derivePublicKey(protocolID: [
|
|
1251
|
+
0 | 1 | 2,
|
|
1252
|
+
string
|
|
1253
|
+
], keyID: string, counterparty: PublicKey | string | "self" | "anyone", forSelf: boolean = false): PublicKey
|
|
1254
|
+
```
|
|
1255
|
+
|
|
1256
|
+
Returns
|
|
1257
|
+
|
|
1258
|
+
- The derived public key.
|
|
1259
|
+
|
|
1260
|
+
Argument Details
|
|
1261
|
+
|
|
1262
|
+
+ **protocolID**
|
|
1263
|
+
+ The protocol ID including a security level and protocol name.
|
|
1264
|
+
+ **keyID**
|
|
1265
|
+
+ The key identifier.
|
|
1266
|
+
+ **counterparty**
|
|
1267
|
+
+ The counterparty's public key or a predefined value ('self' or 'anyone').
|
|
1268
|
+
+ **forSelf**
|
|
1269
|
+
+ Whether deriving for self.
|
|
1270
|
+
|
|
1271
|
+
#### Method deriveSymmetricKey
|
|
1272
|
+
|
|
1273
|
+
Derives a symmetric key based on protocol ID, key ID, and counterparty.
|
|
1274
|
+
Note: Symmetric keys should not be derivable by everyone due to security risks.
|
|
1275
|
+
|
|
1276
|
+
```ts
|
|
1277
|
+
deriveSymmetricKey(protocolID: [
|
|
1278
|
+
0 | 1 | 2,
|
|
1279
|
+
string
|
|
1280
|
+
], keyID: string, counterparty: PublicKey | string | "self" | "anyone"): SymmetricKey
|
|
1281
|
+
```
|
|
1282
|
+
|
|
1283
|
+
Returns
|
|
1284
|
+
|
|
1285
|
+
- The derived symmetric key.
|
|
1286
|
+
|
|
1287
|
+
Argument Details
|
|
1288
|
+
|
|
1289
|
+
+ **protocolID**
|
|
1290
|
+
+ The protocol ID including a security level and protocol name.
|
|
1291
|
+
+ **keyID**
|
|
1292
|
+
+ The key identifier.
|
|
1293
|
+
+ **counterparty**
|
|
1294
|
+
+ The counterparty's public key or a predefined value ('self' or 'anyone').
|
|
1295
|
+
|
|
1296
|
+
Throws
|
|
1297
|
+
|
|
1298
|
+
- Throws an error if attempting to derive a symmetric key for 'anyone'.
|
|
1299
|
+
|
|
1300
|
+
#### Method revealCounterpartySecret
|
|
1301
|
+
|
|
1302
|
+
Reveals the shared secret between the root key and the counterparty.
|
|
1303
|
+
Note: This should not be used for 'self'.
|
|
1304
|
+
|
|
1305
|
+
```ts
|
|
1306
|
+
revealCounterpartySecret(counterparty: PublicKey | string | "self" | "anyone"): number[]
|
|
1307
|
+
```
|
|
1308
|
+
|
|
1309
|
+
Returns
|
|
1310
|
+
|
|
1311
|
+
- The shared secret as a number array.
|
|
1312
|
+
|
|
1313
|
+
Argument Details
|
|
1314
|
+
|
|
1315
|
+
+ **counterparty**
|
|
1316
|
+
+ The counterparty's public key or a predefined value ('self' or 'anyone').
|
|
1317
|
+
|
|
1318
|
+
Throws
|
|
1319
|
+
|
|
1320
|
+
- Throws an error if attempting to reveal a shared secret for 'self'.
|
|
1321
|
+
|
|
1322
|
+
#### Method revealSpecificSecret
|
|
1323
|
+
|
|
1324
|
+
Reveals the specific key association for a given protocol ID, key ID, and counterparty.
|
|
1325
|
+
|
|
1326
|
+
```ts
|
|
1327
|
+
revealSpecificSecret(counterparty: PublicKey | string | "self" | "anyone", protocolID: [
|
|
1328
|
+
0 | 1 | 2,
|
|
1329
|
+
string
|
|
1330
|
+
], keyID: string): number[]
|
|
1331
|
+
```
|
|
1332
|
+
|
|
1333
|
+
Returns
|
|
1334
|
+
|
|
1335
|
+
- The specific key association as a number array.
|
|
1336
|
+
|
|
1337
|
+
Argument Details
|
|
1338
|
+
|
|
1339
|
+
+ **counterparty**
|
|
1340
|
+
+ The counterparty's public key or a predefined value ('self' or 'anyone').
|
|
1341
|
+
+ **protocolID**
|
|
1342
|
+
+ The protocol ID including a security level and protocol name.
|
|
1343
|
+
+ **keyID**
|
|
1344
|
+
+ The key identifier.
|
|
1345
|
+
|
|
1346
|
+
</details>
|
|
1347
|
+
|
|
1348
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1349
|
+
|
|
1350
|
+
---
|
|
1351
|
+
### Class: CachedKeyDeriver
|
|
1352
|
+
|
|
1353
|
+
A cached version of KeyDeriver that caches the results of key derivation methods.
|
|
1354
|
+
This is useful for optimizing performance when the same keys are derived multiple times.
|
|
1355
|
+
It supports configurable cache size with sane defaults and maintains cache entries using LRU (Least Recently Used) eviction policy.
|
|
1356
|
+
|
|
1357
|
+
```ts
|
|
1358
|
+
export default class CachedKeyDeriver {
|
|
1359
|
+
constructor(rootKey: PrivateKey | "anyone", options?: {
|
|
1360
|
+
maxCacheSize?: number;
|
|
1361
|
+
})
|
|
1362
|
+
derivePublicKey(protocolID: [
|
|
1363
|
+
0 | 1 | 2,
|
|
1364
|
+
string
|
|
1365
|
+
], keyID: string, counterparty: PublicKey | string | "self" | "anyone", forSelf: boolean = false): PublicKey
|
|
1366
|
+
derivePrivateKey(protocolID: [
|
|
1367
|
+
0 | 1 | 2,
|
|
1368
|
+
string
|
|
1369
|
+
], keyID: string, counterparty: PublicKey | string | "self" | "anyone"): PrivateKey
|
|
1370
|
+
deriveSymmetricKey(protocolID: [
|
|
1371
|
+
0 | 1 | 2,
|
|
1372
|
+
string
|
|
1373
|
+
], keyID: string, counterparty: PublicKey | string | "self" | "anyone"): SymmetricKey
|
|
1374
|
+
revealCounterpartySecret(counterparty: PublicKey | string | "self" | "anyone"): number[]
|
|
1375
|
+
revealSpecificSecret(counterparty: PublicKey | string | "self" | "anyone", protocolID: [
|
|
1376
|
+
0 | 1 | 2,
|
|
1377
|
+
string
|
|
1378
|
+
], keyID: string): number[]
|
|
1379
|
+
}
|
|
1380
|
+
```
|
|
1381
|
+
|
|
1382
|
+
<details>
|
|
1383
|
+
|
|
1384
|
+
<summary>Class CachedKeyDeriver Details</summary>
|
|
1385
|
+
|
|
1386
|
+
#### Constructor
|
|
1387
|
+
|
|
1388
|
+
Initializes the CachedKeyDeriver instance with a root private key and optional cache settings.
|
|
1389
|
+
|
|
1390
|
+
```ts
|
|
1391
|
+
constructor(rootKey: PrivateKey | "anyone", options?: {
|
|
1392
|
+
maxCacheSize?: number;
|
|
1393
|
+
})
|
|
1394
|
+
```
|
|
1395
|
+
|
|
1396
|
+
Argument Details
|
|
1397
|
+
|
|
1398
|
+
+ **rootKey**
|
|
1399
|
+
+ The root private key or the string 'anyone'.
|
|
1400
|
+
+ **options**
|
|
1401
|
+
+ Optional settings for the cache.
|
|
1402
|
+
|
|
1403
|
+
#### Method derivePrivateKey
|
|
1404
|
+
|
|
1405
|
+
Derives a private key based on protocol ID, key ID, and counterparty.
|
|
1406
|
+
Caches the result for future calls with the same parameters.
|
|
1407
|
+
|
|
1408
|
+
```ts
|
|
1409
|
+
derivePrivateKey(protocolID: [
|
|
1410
|
+
0 | 1 | 2,
|
|
1411
|
+
string
|
|
1412
|
+
], keyID: string, counterparty: PublicKey | string | "self" | "anyone"): PrivateKey
|
|
1413
|
+
```
|
|
1414
|
+
|
|
1415
|
+
Returns
|
|
1416
|
+
|
|
1417
|
+
- The derived private key.
|
|
1418
|
+
|
|
1419
|
+
Argument Details
|
|
1420
|
+
|
|
1421
|
+
+ **protocolID**
|
|
1422
|
+
+ The protocol ID including a security level and protocol name.
|
|
1423
|
+
+ **keyID**
|
|
1424
|
+
+ The key identifier.
|
|
1425
|
+
+ **counterparty**
|
|
1426
|
+
+ The counterparty's public key or a predefined value ('self' or 'anyone').
|
|
1427
|
+
|
|
1428
|
+
#### Method derivePublicKey
|
|
1429
|
+
|
|
1430
|
+
Derives a public key based on protocol ID, key ID, and counterparty.
|
|
1431
|
+
Caches the result for future calls with the same parameters.
|
|
1432
|
+
|
|
1433
|
+
```ts
|
|
1434
|
+
derivePublicKey(protocolID: [
|
|
1435
|
+
0 | 1 | 2,
|
|
1436
|
+
string
|
|
1437
|
+
], keyID: string, counterparty: PublicKey | string | "self" | "anyone", forSelf: boolean = false): PublicKey
|
|
1438
|
+
```
|
|
1439
|
+
|
|
1440
|
+
Returns
|
|
1441
|
+
|
|
1442
|
+
- The derived public key.
|
|
1443
|
+
|
|
1444
|
+
Argument Details
|
|
1445
|
+
|
|
1446
|
+
+ **protocolID**
|
|
1447
|
+
+ The protocol ID including a security level and protocol name.
|
|
1448
|
+
+ **keyID**
|
|
1449
|
+
+ The key identifier.
|
|
1450
|
+
+ **counterparty**
|
|
1451
|
+
+ The counterparty's public key or a predefined value ('self' or 'anyone').
|
|
1452
|
+
+ **forSelf**
|
|
1453
|
+
+ Whether deriving for self.
|
|
1454
|
+
|
|
1455
|
+
#### Method deriveSymmetricKey
|
|
1456
|
+
|
|
1457
|
+
Derives a symmetric key based on protocol ID, key ID, and counterparty.
|
|
1458
|
+
Caches the result for future calls with the same parameters.
|
|
1459
|
+
|
|
1460
|
+
```ts
|
|
1461
|
+
deriveSymmetricKey(protocolID: [
|
|
1462
|
+
0 | 1 | 2,
|
|
1463
|
+
string
|
|
1464
|
+
], keyID: string, counterparty: PublicKey | string | "self" | "anyone"): SymmetricKey
|
|
1465
|
+
```
|
|
1466
|
+
|
|
1467
|
+
Returns
|
|
1468
|
+
|
|
1469
|
+
- The derived symmetric key.
|
|
1470
|
+
|
|
1471
|
+
Argument Details
|
|
1472
|
+
|
|
1473
|
+
+ **protocolID**
|
|
1474
|
+
+ The protocol ID including a security level and protocol name.
|
|
1475
|
+
+ **keyID**
|
|
1476
|
+
+ The key identifier.
|
|
1477
|
+
+ **counterparty**
|
|
1478
|
+
+ The counterparty's public key or a predefined value ('self' or 'anyone').
|
|
1479
|
+
|
|
1480
|
+
Throws
|
|
1481
|
+
|
|
1482
|
+
- Throws an error if attempting to derive a symmetric key for 'anyone'.
|
|
1483
|
+
|
|
1484
|
+
#### Method revealCounterpartySecret
|
|
1485
|
+
|
|
1486
|
+
Reveals the shared secret between the root key and the counterparty.
|
|
1487
|
+
Caches the result for future calls with the same parameters.
|
|
1488
|
+
|
|
1489
|
+
```ts
|
|
1490
|
+
revealCounterpartySecret(counterparty: PublicKey | string | "self" | "anyone"): number[]
|
|
1491
|
+
```
|
|
1492
|
+
|
|
1493
|
+
Returns
|
|
1494
|
+
|
|
1495
|
+
- The shared secret as a number array.
|
|
1496
|
+
|
|
1497
|
+
Argument Details
|
|
1498
|
+
|
|
1499
|
+
+ **counterparty**
|
|
1500
|
+
+ The counterparty's public key or a predefined value ('self' or 'anyone').
|
|
1501
|
+
|
|
1502
|
+
Throws
|
|
1503
|
+
|
|
1504
|
+
- Throws an error if attempting to reveal a shared secret for 'self'.
|
|
1505
|
+
|
|
1506
|
+
#### Method revealSpecificSecret
|
|
1507
|
+
|
|
1508
|
+
Reveals the specific key association for a given protocol ID, key ID, and counterparty.
|
|
1509
|
+
Caches the result for future calls with the same parameters.
|
|
1510
|
+
|
|
1511
|
+
```ts
|
|
1512
|
+
revealSpecificSecret(counterparty: PublicKey | string | "self" | "anyone", protocolID: [
|
|
1513
|
+
0 | 1 | 2,
|
|
1514
|
+
string
|
|
1515
|
+
], keyID: string): number[]
|
|
1516
|
+
```
|
|
1517
|
+
|
|
1518
|
+
Returns
|
|
1519
|
+
|
|
1520
|
+
- The specific key association as a number array.
|
|
1521
|
+
|
|
1522
|
+
Argument Details
|
|
1523
|
+
|
|
1524
|
+
+ **counterparty**
|
|
1525
|
+
+ The counterparty's public key or a predefined value ('self' or 'anyone').
|
|
1526
|
+
+ **protocolID**
|
|
1527
|
+
+ The protocol ID including a security level and protocol name.
|
|
1528
|
+
+ **keyID**
|
|
1529
|
+
+ The key identifier.
|
|
1530
|
+
|
|
1531
|
+
</details>
|
|
1532
|
+
|
|
1533
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1534
|
+
|
|
1535
|
+
---
|
|
1536
|
+
### Class: WalletError
|
|
1537
|
+
|
|
1538
|
+
```ts
|
|
1539
|
+
export class WalletError extends Error {
|
|
1540
|
+
code: number;
|
|
1541
|
+
isError: boolean = true;
|
|
1542
|
+
constructor(message: string, code = 1, stack?: string)
|
|
1543
|
+
}
|
|
1544
|
+
```
|
|
1545
|
+
|
|
1546
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1547
|
+
|
|
1548
|
+
---
|
|
1549
|
+
### Class: ProtoWallet
|
|
1550
|
+
|
|
1551
|
+
A ProtoWallet is a structure that fulfills the Wallet interface, capable of performing all foundational cryptographic operations. It can derive keys, create signatures, facilitate encryption and HMAC operations, and reveal key linkages. However, ProtoWallet does not create transactions, manage outputs, interact with the blockchain, enable the management of identity certificates, or store any data.
|
|
1552
|
+
|
|
1553
|
+
```ts
|
|
1554
|
+
export default class ProtoWallet implements Wallet {
|
|
1555
|
+
keyDeriver: KeyDeriver;
|
|
1556
|
+
privilegedError: string = "ProtoWallet is a single-keyring wallet, operating without context about whether its configured keyring is privileged.";
|
|
1557
|
+
constructor(rootKey: PrivateKey | "anyone", KeyDeriverClass = KeyDeriver)
|
|
1558
|
+
async createAction(args: {
|
|
1559
|
+
description: DescriptionString5to50Bytes;
|
|
1560
|
+
inputs?: Array<{
|
|
1561
|
+
tx?: BEEF;
|
|
1562
|
+
outpoint: OutpointString;
|
|
1563
|
+
unlockingScript?: HexString;
|
|
1564
|
+
unlockingScriptLength?: PositiveInteger;
|
|
1565
|
+
inputDescription: DescriptionString5to50Bytes;
|
|
1566
|
+
sequenceNumber?: PositiveIntegerOrZero;
|
|
1567
|
+
}>;
|
|
1568
|
+
outputs?: Array<{
|
|
1569
|
+
lockingScript: HexString;
|
|
1570
|
+
satoshis: SatoshiValue;
|
|
1571
|
+
outputDescription: DescriptionString5to50Bytes;
|
|
1572
|
+
basket?: BasketStringUnder300Bytes;
|
|
1573
|
+
customInstructions?: string;
|
|
1574
|
+
tags?: OutputTagStringUnder300Bytes[];
|
|
1575
|
+
}>;
|
|
1576
|
+
lockTime?: PositiveIntegerOrZero;
|
|
1577
|
+
version?: PositiveIntegerOrZero;
|
|
1578
|
+
labels?: LabelStringUnder300Bytes[];
|
|
1579
|
+
options?: {
|
|
1580
|
+
signAndProcess?: BooleanDefaultTrue;
|
|
1581
|
+
acceptDelayedBroadcast?: BooleanDefaultTrue;
|
|
1582
|
+
trustSelf?: "known";
|
|
1583
|
+
knownTxids?: TXIDHexString[];
|
|
1584
|
+
returnTXIDOnly?: BooleanDefaultFalse;
|
|
1585
|
+
noSend?: BooleanDefaultFalse;
|
|
1586
|
+
noSendChange?: OutpointString[];
|
|
1587
|
+
sendWith?: TXIDHexString[];
|
|
1588
|
+
randomizeOutputs?: BooleanDefaultTrue;
|
|
1589
|
+
};
|
|
1590
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1591
|
+
txid?: TXIDHexString;
|
|
1592
|
+
tx?: BEEF;
|
|
1593
|
+
noSendChange?: OutpointString[];
|
|
1594
|
+
sendWithResults?: Array<{
|
|
1595
|
+
txid: TXIDHexString;
|
|
1596
|
+
status: "unproven" | "sending" | "failed";
|
|
1597
|
+
}>;
|
|
1598
|
+
signableTransaction?: {
|
|
1599
|
+
tx: BEEF;
|
|
1600
|
+
reference: Base64String;
|
|
1601
|
+
};
|
|
1602
|
+
}>
|
|
1603
|
+
async signAction(args: {
|
|
1604
|
+
spends: Record<PositiveIntegerOrZero, {
|
|
1605
|
+
unlockingScript: HexString;
|
|
1606
|
+
sequenceNumber?: PositiveIntegerOrZero;
|
|
1607
|
+
}>;
|
|
1608
|
+
reference: Base64String;
|
|
1609
|
+
options?: {
|
|
1610
|
+
acceptDelayedBroadcast?: BooleanDefaultTrue;
|
|
1611
|
+
returnTXIDOnly?: BooleanDefaultFalse;
|
|
1612
|
+
noSend?: BooleanDefaultFalse;
|
|
1613
|
+
noSendChange?: OutpointString[];
|
|
1614
|
+
sendWith?: TXIDHexString[];
|
|
1615
|
+
};
|
|
1616
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1617
|
+
txid?: TXIDHexString;
|
|
1618
|
+
tx?: BEEF;
|
|
1619
|
+
noSendChange?: OutpointString[];
|
|
1620
|
+
sendWithResults?: Array<{
|
|
1621
|
+
txid: TXIDHexString;
|
|
1622
|
+
status: "unproven" | "sending" | "failed";
|
|
1623
|
+
}>;
|
|
1624
|
+
}>
|
|
1625
|
+
async abortAction(args: {
|
|
1626
|
+
reference: Base64String;
|
|
1627
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1628
|
+
aborted: true;
|
|
1629
|
+
}>
|
|
1630
|
+
async listActions(args: {
|
|
1631
|
+
labels: LabelStringUnder300Bytes[];
|
|
1632
|
+
labelQueryMode?: "any" | "all";
|
|
1633
|
+
includeLabels?: BooleanDefaultFalse;
|
|
1634
|
+
includeInputs?: BooleanDefaultFalse;
|
|
1635
|
+
includeInputSourceLockingScripts?: BooleanDefaultFalse;
|
|
1636
|
+
includeInputUnlockingScripts?: BooleanDefaultFalse;
|
|
1637
|
+
includeOutputs?: BooleanDefaultFalse;
|
|
1638
|
+
includeOutputLockingScripts?: BooleanDefaultFalse;
|
|
1639
|
+
limit?: PositiveIntegerDefault10Max10000;
|
|
1640
|
+
offset?: PositiveIntegerOrZero;
|
|
1641
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1642
|
+
totalActions: PositiveIntegerOrZero;
|
|
1643
|
+
actions: Array<{
|
|
1644
|
+
txid: TXIDHexString;
|
|
1645
|
+
satoshis: SatoshiValue;
|
|
1646
|
+
status: "completed" | "unprocessed" | "sending" | "unproven" | "unsigned" | "nosend" | "nonfinal";
|
|
1647
|
+
isOutgoing: boolean;
|
|
1648
|
+
description: DescriptionString5to50Bytes;
|
|
1649
|
+
labels?: LabelStringUnder300Bytes[];
|
|
1650
|
+
version: PositiveIntegerOrZero;
|
|
1651
|
+
lockTime: PositiveIntegerOrZero;
|
|
1652
|
+
inputs?: Array<{
|
|
1653
|
+
sourceOutpoint: OutpointString;
|
|
1654
|
+
sourceSatoshis: SatoshiValue;
|
|
1655
|
+
sourceLockingScript?: HexString;
|
|
1656
|
+
unlockingScript?: HexString;
|
|
1657
|
+
inputDescription: DescriptionString5to50Bytes;
|
|
1658
|
+
sequenceNumber: PositiveIntegerOrZero;
|
|
1659
|
+
}>;
|
|
1660
|
+
outputs?: Array<{
|
|
1661
|
+
outputIndex: PositiveIntegerOrZero;
|
|
1662
|
+
satoshis: SatoshiValue;
|
|
1663
|
+
lockingScript?: HexString;
|
|
1664
|
+
spendable: boolean;
|
|
1665
|
+
outputDescription: DescriptionString5to50Bytes;
|
|
1666
|
+
basket: BasketStringUnder300Bytes;
|
|
1667
|
+
tags: OutputTagStringUnder300Bytes[];
|
|
1668
|
+
customInstructions?: string;
|
|
1669
|
+
}>;
|
|
1670
|
+
}>;
|
|
1671
|
+
}>
|
|
1672
|
+
async internalizeAction(args: {
|
|
1673
|
+
tx: BEEF;
|
|
1674
|
+
outputs: Array<{
|
|
1675
|
+
outputIndex: PositiveIntegerOrZero;
|
|
1676
|
+
protocol: "wallet payment" | "basket insertion";
|
|
1677
|
+
paymentRemittance?: {
|
|
1678
|
+
derivationPrefix: Base64String;
|
|
1679
|
+
derivationSuffix: Base64String;
|
|
1680
|
+
senderIdentityKey: PubKeyHex;
|
|
1681
|
+
};
|
|
1682
|
+
insertionRemittance?: {
|
|
1683
|
+
basket: BasketStringUnder300Bytes;
|
|
1684
|
+
customInstructions?: string;
|
|
1685
|
+
tags?: OutputTagStringUnder300Bytes[];
|
|
1686
|
+
};
|
|
1687
|
+
}>;
|
|
1688
|
+
description: DescriptionString5to50Bytes;
|
|
1689
|
+
labels?: LabelStringUnder300Bytes[];
|
|
1690
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1691
|
+
accepted: true;
|
|
1692
|
+
}>
|
|
1693
|
+
async listOutputs(args: {
|
|
1694
|
+
basket: BasketStringUnder300Bytes;
|
|
1695
|
+
tags?: OutputTagStringUnder300Bytes[];
|
|
1696
|
+
tagQueryMode?: "all" | "any";
|
|
1697
|
+
include?: "locking scripts" | "entire transactions";
|
|
1698
|
+
includeCustomInstructions?: BooleanDefaultFalse;
|
|
1699
|
+
includeTags?: BooleanDefaultFalse;
|
|
1700
|
+
includeLabels?: BooleanDefaultFalse;
|
|
1701
|
+
limit?: PositiveIntegerDefault10Max10000;
|
|
1702
|
+
offset?: PositiveIntegerOrZero;
|
|
1703
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1704
|
+
totalOutputs: PositiveIntegerOrZero;
|
|
1705
|
+
outputs: Array<{
|
|
1706
|
+
outpoint: OutpointString;
|
|
1707
|
+
satoshis: SatoshiValue;
|
|
1708
|
+
lockingScript?: HexString;
|
|
1709
|
+
tx?: BEEF;
|
|
1710
|
+
spendable: true;
|
|
1711
|
+
customInstructions?: string;
|
|
1712
|
+
tags?: OutputTagStringUnder300Bytes[];
|
|
1713
|
+
labels?: LabelStringUnder300Bytes[];
|
|
1714
|
+
}>;
|
|
1715
|
+
}>
|
|
1716
|
+
async relinquishOutput(args: {
|
|
1717
|
+
basket: BasketStringUnder300Bytes;
|
|
1718
|
+
output: OutpointString;
|
|
1719
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1720
|
+
relinquished: true;
|
|
1721
|
+
}>
|
|
1722
|
+
async getPublicKey(args: {
|
|
1723
|
+
identityKey?: true;
|
|
1724
|
+
protocolID?: [
|
|
1725
|
+
0 | 1 | 2,
|
|
1726
|
+
ProtocolString5To400Bytes
|
|
1727
|
+
];
|
|
1728
|
+
keyID?: KeyIDStringUnder800Bytes;
|
|
1729
|
+
privileged?: BooleanDefaultFalse;
|
|
1730
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
1731
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
1732
|
+
forSelf?: BooleanDefaultFalse;
|
|
1733
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1734
|
+
publicKey: PubKeyHex;
|
|
1735
|
+
}>
|
|
1736
|
+
async revealCounterpartyKeyLinkage(args: {
|
|
1737
|
+
counterparty: PubKeyHex;
|
|
1738
|
+
verifier: PubKeyHex;
|
|
1739
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
1740
|
+
privileged?: BooleanDefaultFalse;
|
|
1741
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1742
|
+
prover: PubKeyHex;
|
|
1743
|
+
verifier: PubKeyHex;
|
|
1744
|
+
counterparty: PubKeyHex;
|
|
1745
|
+
revelationTime: ISOTimestampString;
|
|
1746
|
+
encryptedLinkage: Byte[];
|
|
1747
|
+
encryptedLinkageProof: Byte[];
|
|
1748
|
+
}>
|
|
1749
|
+
async revealSpecificKeyLinkage(args: {
|
|
1750
|
+
counterparty: PubKeyHex;
|
|
1751
|
+
verifier: PubKeyHex;
|
|
1752
|
+
protocolID: [
|
|
1753
|
+
0 | 1 | 2,
|
|
1754
|
+
ProtocolString5To400Bytes
|
|
1755
|
+
];
|
|
1756
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
1757
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
1758
|
+
privileged?: BooleanDefaultFalse;
|
|
1759
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1760
|
+
prover: PubKeyHex;
|
|
1761
|
+
verifier: PubKeyHex;
|
|
1762
|
+
counterparty: PubKeyHex;
|
|
1763
|
+
protocolID: [
|
|
1764
|
+
0 | 1 | 2,
|
|
1765
|
+
ProtocolString5To400Bytes
|
|
1766
|
+
];
|
|
1767
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
1768
|
+
encryptedLinkage: Byte[];
|
|
1769
|
+
encryptedLinkageProof: Byte[];
|
|
1770
|
+
proofType: Byte;
|
|
1771
|
+
}>
|
|
1772
|
+
async encrypt(args: {
|
|
1773
|
+
plaintext: Byte[];
|
|
1774
|
+
protocolID: [
|
|
1775
|
+
0 | 1 | 2,
|
|
1776
|
+
ProtocolString5To400Bytes
|
|
1777
|
+
];
|
|
1778
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
1779
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
1780
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
1781
|
+
privileged?: BooleanDefaultFalse;
|
|
1782
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1783
|
+
ciphertext: Byte[];
|
|
1784
|
+
}>
|
|
1785
|
+
async decrypt(args: {
|
|
1786
|
+
ciphertext: Byte[];
|
|
1787
|
+
protocolID: [
|
|
1788
|
+
0 | 1 | 2,
|
|
1789
|
+
ProtocolString5To400Bytes
|
|
1790
|
+
];
|
|
1791
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
1792
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
1793
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
1794
|
+
privileged?: BooleanDefaultFalse;
|
|
1795
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1796
|
+
plaintext: Byte[];
|
|
1797
|
+
}>
|
|
1798
|
+
async createHmac(args: {
|
|
1799
|
+
data: Byte[];
|
|
1800
|
+
protocolID: [
|
|
1801
|
+
0 | 1 | 2,
|
|
1802
|
+
ProtocolString5To400Bytes
|
|
1803
|
+
];
|
|
1804
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
1805
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
1806
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
1807
|
+
privileged?: BooleanDefaultFalse;
|
|
1808
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1809
|
+
hmac: Byte[];
|
|
1810
|
+
}>
|
|
1811
|
+
async verifyHmac(args: {
|
|
1812
|
+
data: Byte[];
|
|
1813
|
+
hmac: Byte[];
|
|
1814
|
+
protocolID: [
|
|
1815
|
+
0 | 1 | 2,
|
|
1816
|
+
ProtocolString5To400Bytes
|
|
1817
|
+
];
|
|
1818
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
1819
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
1820
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
1821
|
+
privileged?: BooleanDefaultFalse;
|
|
1822
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1823
|
+
valid: true;
|
|
1824
|
+
}>
|
|
1825
|
+
async createSignature(args: {
|
|
1826
|
+
data?: Byte[];
|
|
1827
|
+
hashToDirectlySign?: Byte[];
|
|
1828
|
+
protocolID: [
|
|
1829
|
+
0 | 1 | 2,
|
|
1830
|
+
ProtocolString5To400Bytes
|
|
1831
|
+
];
|
|
1832
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
1833
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
1834
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
1835
|
+
privileged?: BooleanDefaultFalse;
|
|
1836
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1837
|
+
signature: Byte[];
|
|
1838
|
+
}>
|
|
1839
|
+
async verifySignature(args: {
|
|
1840
|
+
data?: Byte[];
|
|
1841
|
+
hashToDirectlyVerify?: Byte[];
|
|
1842
|
+
signature: Byte[];
|
|
1843
|
+
protocolID: [
|
|
1844
|
+
0 | 1 | 2,
|
|
1845
|
+
ProtocolString5To400Bytes
|
|
1846
|
+
];
|
|
1847
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
1848
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
1849
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
1850
|
+
forSelf?: BooleanDefaultFalse;
|
|
1851
|
+
privileged?: BooleanDefaultFalse;
|
|
1852
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1853
|
+
valid: true;
|
|
1854
|
+
}>
|
|
1855
|
+
async acquireCertificate(args: {
|
|
1856
|
+
type: Base64String;
|
|
1857
|
+
certifier: PubKeyHex;
|
|
1858
|
+
acquisitionProtocol: "direct" | "issuance";
|
|
1859
|
+
fields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
1860
|
+
serialNumber?: Base64String;
|
|
1861
|
+
revocationOutpoint?: OutpointString;
|
|
1862
|
+
signature?: HexString;
|
|
1863
|
+
certifierUrl?: string;
|
|
1864
|
+
keyringRevealer?: PubKeyHex | "certifier";
|
|
1865
|
+
keyringForSubject?: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
1866
|
+
privileged?: BooleanDefaultFalse;
|
|
1867
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
1868
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1869
|
+
type: Base64String;
|
|
1870
|
+
subject: PubKeyHex;
|
|
1871
|
+
serialNumber: Base64String;
|
|
1872
|
+
certifier: PubKeyHex;
|
|
1873
|
+
revocationOutpoint: OutpointString;
|
|
1874
|
+
signature: HexString;
|
|
1875
|
+
fields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
1876
|
+
}>
|
|
1877
|
+
async listCertificates(args: {
|
|
1878
|
+
certifiers: PubKeyHex[];
|
|
1879
|
+
types: Base64String[];
|
|
1880
|
+
limit?: PositiveIntegerDefault10Max10000;
|
|
1881
|
+
offset?: PositiveIntegerOrZero;
|
|
1882
|
+
privileged?: BooleanDefaultFalse;
|
|
1883
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
1884
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1885
|
+
totalCertificates: PositiveIntegerOrZero;
|
|
1886
|
+
certificates: Array<{
|
|
1887
|
+
type: Base64String;
|
|
1888
|
+
subject: PubKeyHex;
|
|
1889
|
+
serialNumber: Base64String;
|
|
1890
|
+
certifier: PubKeyHex;
|
|
1891
|
+
revocationOutpoint: OutpointString;
|
|
1892
|
+
signature: HexString;
|
|
1893
|
+
fields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
1894
|
+
}>;
|
|
1895
|
+
}>
|
|
1896
|
+
async proveCertificate(args: {
|
|
1897
|
+
certificate: {
|
|
1898
|
+
type: Base64String;
|
|
1899
|
+
subject: PubKeyHex;
|
|
1900
|
+
serialNumber: Base64String;
|
|
1901
|
+
certifier: PubKeyHex;
|
|
1902
|
+
revocationOutpoint: OutpointString;
|
|
1903
|
+
signature: HexString;
|
|
1904
|
+
fields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
1905
|
+
};
|
|
1906
|
+
fieldsToReveal: CertificateFieldNameUnder50Bytes[];
|
|
1907
|
+
verifier: PubKeyHex;
|
|
1908
|
+
privileged?: BooleanDefaultFalse;
|
|
1909
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
1910
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1911
|
+
keyringForVerifier: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
1912
|
+
}>
|
|
1913
|
+
async relinquishCertificate(args: {
|
|
1914
|
+
type: Base64String;
|
|
1915
|
+
serialNumber: Base64String;
|
|
1916
|
+
certifier: PubKeyHex;
|
|
1917
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1918
|
+
relinquished: true;
|
|
1919
|
+
}>
|
|
1920
|
+
async discoverByIdentityKey(args: {
|
|
1921
|
+
identityKey: PubKeyHex;
|
|
1922
|
+
limit?: PositiveIntegerDefault10Max10000;
|
|
1923
|
+
offset?: PositiveIntegerOrZero;
|
|
1924
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1925
|
+
totalCertificates: PositiveIntegerOrZero;
|
|
1926
|
+
certificates: Array<{
|
|
1927
|
+
type: Base64String;
|
|
1928
|
+
subject: PubKeyHex;
|
|
1929
|
+
serialNumber: Base64String;
|
|
1930
|
+
certifier: PubKeyHex;
|
|
1931
|
+
revocationOutpoint: OutpointString;
|
|
1932
|
+
signature: HexString;
|
|
1933
|
+
fields: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
1934
|
+
certifierInfo: {
|
|
1935
|
+
name: EntityNameStringMax100Bytes;
|
|
1936
|
+
iconUrl: EntityIconURLStringMax500Bytes;
|
|
1937
|
+
description: DescriptionString5to50Bytes;
|
|
1938
|
+
trust: PositiveIntegerMax10;
|
|
1939
|
+
};
|
|
1940
|
+
publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
1941
|
+
decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
1942
|
+
}>;
|
|
1943
|
+
}>
|
|
1944
|
+
async discoverByAttributes(args: {
|
|
1945
|
+
attributes: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
1946
|
+
limit?: PositiveIntegerDefault10Max10000;
|
|
1947
|
+
offset?: PositiveIntegerOrZero;
|
|
1948
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1949
|
+
totalCertificates: PositiveIntegerOrZero;
|
|
1950
|
+
certificates: Array<{
|
|
1951
|
+
type: Base64String;
|
|
1952
|
+
subject: PubKeyHex;
|
|
1953
|
+
serialNumber: Base64String;
|
|
1954
|
+
certifier: PubKeyHex;
|
|
1955
|
+
revocationOutpoint: OutpointString;
|
|
1956
|
+
signature: HexString;
|
|
1957
|
+
fields: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
1958
|
+
certifierInfo: {
|
|
1959
|
+
name: EntityNameStringMax100Bytes;
|
|
1960
|
+
iconUrl: EntityIconURLStringMax500Bytes;
|
|
1961
|
+
description: DescriptionString5to50Bytes;
|
|
1962
|
+
trust: PositiveIntegerMax10;
|
|
1963
|
+
};
|
|
1964
|
+
publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
1965
|
+
decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
1966
|
+
}>;
|
|
1967
|
+
}>
|
|
1968
|
+
async isAuthenticated(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1969
|
+
authenticated: boolean;
|
|
1970
|
+
}>
|
|
1971
|
+
async waitForAuthentication(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1972
|
+
authenticated: true;
|
|
1973
|
+
}>
|
|
1974
|
+
async getHeight(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1975
|
+
height: PositiveInteger;
|
|
1976
|
+
}>
|
|
1977
|
+
async getHeaderForHeight(args: {
|
|
1978
|
+
height: PositiveInteger;
|
|
1979
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1980
|
+
header: HexString;
|
|
1981
|
+
}>
|
|
1982
|
+
async getNetwork(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1983
|
+
network: "mainnet" | "testnet";
|
|
1984
|
+
}>
|
|
1985
|
+
async getVersion(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
1986
|
+
version: VersionString7To30Bytes;
|
|
1987
|
+
}>
|
|
1988
|
+
}
|
|
1989
|
+
```
|
|
1990
|
+
|
|
1991
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
1992
|
+
|
|
1993
|
+
---
|
|
1994
|
+
### Class: WindowCWISubstrate
|
|
1995
|
+
|
|
1996
|
+
Facilitates wallet operations over the window.CWI interface.
|
|
1997
|
+
|
|
1998
|
+
```ts
|
|
1999
|
+
export default class WindowCWISubstrate implements Wallet {
|
|
2000
|
+
constructor()
|
|
2001
|
+
async createAction(args: {
|
|
2002
|
+
description: DescriptionString5to50Bytes;
|
|
2003
|
+
inputs?: Array<{
|
|
2004
|
+
tx?: BEEF;
|
|
2005
|
+
outpoint: OutpointString;
|
|
2006
|
+
unlockingScript?: HexString;
|
|
2007
|
+
unlockingScriptLength?: PositiveInteger;
|
|
2008
|
+
inputDescription: DescriptionString5to50Bytes;
|
|
2009
|
+
sequenceNumber?: PositiveIntegerOrZero;
|
|
2010
|
+
}>;
|
|
2011
|
+
outputs?: Array<{
|
|
2012
|
+
lockingScript: HexString;
|
|
2013
|
+
satoshis: SatoshiValue;
|
|
2014
|
+
outputDescription: DescriptionString5to50Bytes;
|
|
2015
|
+
basket?: BasketStringUnder300Bytes;
|
|
2016
|
+
customInstructions?: string;
|
|
2017
|
+
tags?: OutputTagStringUnder300Bytes[];
|
|
2018
|
+
}>;
|
|
2019
|
+
lockTime?: PositiveIntegerOrZero;
|
|
2020
|
+
version?: PositiveIntegerOrZero;
|
|
2021
|
+
labels?: LabelStringUnder300Bytes[];
|
|
2022
|
+
options?: {
|
|
2023
|
+
signAndProcess?: BooleanDefaultTrue;
|
|
2024
|
+
acceptDelayedBroadcast?: BooleanDefaultTrue;
|
|
2025
|
+
trustSelf?: "known";
|
|
2026
|
+
knownTxids?: TXIDHexString[];
|
|
2027
|
+
returnTXIDOnly?: BooleanDefaultFalse;
|
|
2028
|
+
noSend?: BooleanDefaultFalse;
|
|
2029
|
+
noSendChange?: OutpointString[];
|
|
2030
|
+
sendWith?: TXIDHexString[];
|
|
2031
|
+
};
|
|
2032
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2033
|
+
txid?: TXIDHexString;
|
|
2034
|
+
tx?: BEEF;
|
|
2035
|
+
noSendChange?: OutpointString[];
|
|
2036
|
+
sendWithResults?: Array<{
|
|
2037
|
+
txid: TXIDHexString;
|
|
2038
|
+
status: "unproven" | "sending" | "failed";
|
|
2039
|
+
}>;
|
|
2040
|
+
signableTransaction?: {
|
|
2041
|
+
tx: BEEF;
|
|
2042
|
+
reference: Base64String;
|
|
2043
|
+
};
|
|
2044
|
+
}>
|
|
2045
|
+
async signAction(args: {
|
|
2046
|
+
spends: Record<PositiveIntegerOrZero, {
|
|
2047
|
+
unlockingScript: HexString;
|
|
2048
|
+
sequenceNumber?: PositiveIntegerOrZero;
|
|
2049
|
+
}>;
|
|
2050
|
+
reference: Base64String;
|
|
2051
|
+
options?: {
|
|
2052
|
+
acceptDelayedBroadcast?: BooleanDefaultTrue;
|
|
2053
|
+
returnTXIDOnly?: BooleanDefaultFalse;
|
|
2054
|
+
noSend?: BooleanDefaultFalse;
|
|
2055
|
+
noSendChange?: OutpointString[];
|
|
2056
|
+
sendWith: TXIDHexString[];
|
|
2057
|
+
};
|
|
2058
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2059
|
+
txid?: TXIDHexString;
|
|
2060
|
+
tx?: BEEF;
|
|
2061
|
+
noSendChange?: OutpointString[];
|
|
2062
|
+
sendWithResults?: Array<{
|
|
2063
|
+
txid: TXIDHexString;
|
|
2064
|
+
status: "unproven" | "sending" | "failed";
|
|
2065
|
+
}>;
|
|
2066
|
+
}>
|
|
2067
|
+
async abortAction(args: {
|
|
2068
|
+
reference: Base64String;
|
|
2069
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2070
|
+
aborted: true;
|
|
2071
|
+
}>
|
|
2072
|
+
async listActions(args: {
|
|
2073
|
+
labels: LabelStringUnder300Bytes[];
|
|
2074
|
+
labelQueryMode?: "any" | "all";
|
|
2075
|
+
includeLabels?: BooleanDefaultFalse;
|
|
2076
|
+
includeInputs?: BooleanDefaultFalse;
|
|
2077
|
+
includeInputSourceLockingScripts?: BooleanDefaultFalse;
|
|
2078
|
+
includeInputUnlockingScripts?: BooleanDefaultFalse;
|
|
2079
|
+
includeOutputs?: BooleanDefaultFalse;
|
|
2080
|
+
includeOutputLockingScripts?: BooleanDefaultFalse;
|
|
2081
|
+
limit?: PositiveIntegerDefault10Max10000;
|
|
2082
|
+
offset?: PositiveIntegerOrZero;
|
|
2083
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2084
|
+
totalActions: PositiveIntegerOrZero;
|
|
2085
|
+
actions: Array<{
|
|
2086
|
+
txid: TXIDHexString;
|
|
2087
|
+
satoshis: SatoshiValue;
|
|
2088
|
+
status: "completed" | "unprocessed" | "sending" | "unproven" | "unsigned" | "nosend" | "nonfinal";
|
|
2089
|
+
isOutgoing: boolean;
|
|
2090
|
+
description: DescriptionString5to50Bytes;
|
|
2091
|
+
labels?: LabelStringUnder300Bytes[];
|
|
2092
|
+
version: PositiveIntegerOrZero;
|
|
2093
|
+
lockTime: PositiveIntegerOrZero;
|
|
2094
|
+
inputs?: Array<{
|
|
2095
|
+
sourceOutpoint: OutpointString;
|
|
2096
|
+
sourceSatoshis: SatoshiValue;
|
|
2097
|
+
sourceLockingScript?: HexString;
|
|
2098
|
+
unlockingScript?: HexString;
|
|
2099
|
+
inputDescription: DescriptionString5to50Bytes;
|
|
2100
|
+
sequenceNumber: PositiveIntegerOrZero;
|
|
2101
|
+
}>;
|
|
2102
|
+
outputs?: Array<{
|
|
2103
|
+
outputIndex: PositiveIntegerOrZero;
|
|
2104
|
+
satoshis: SatoshiValue;
|
|
2105
|
+
lockingScript?: HexString;
|
|
2106
|
+
spendable: boolean;
|
|
2107
|
+
outputDescription: DescriptionString5to50Bytes;
|
|
2108
|
+
basket: BasketStringUnder300Bytes;
|
|
2109
|
+
tags: OutputTagStringUnder300Bytes[];
|
|
2110
|
+
customInstructions?: string;
|
|
2111
|
+
}>;
|
|
2112
|
+
}>;
|
|
2113
|
+
}>
|
|
2114
|
+
async internalizeAction(args: {
|
|
2115
|
+
tx: BEEF;
|
|
2116
|
+
outputs: Array<{
|
|
2117
|
+
outputIndex: PositiveIntegerOrZero;
|
|
2118
|
+
protocol: "wallet payment" | "basket insertion";
|
|
2119
|
+
paymentRemittance?: {
|
|
2120
|
+
derivationPrefix: Base64String;
|
|
2121
|
+
derivationSuffix: Base64String;
|
|
2122
|
+
senderIdentityKey: PubKeyHex;
|
|
2123
|
+
};
|
|
2124
|
+
insertionRemittance?: {
|
|
2125
|
+
basket: BasketStringUnder300Bytes;
|
|
2126
|
+
customInstructions?: string;
|
|
2127
|
+
tags?: OutputTagStringUnder300Bytes[];
|
|
2128
|
+
};
|
|
2129
|
+
}>;
|
|
2130
|
+
description: DescriptionString5to50Bytes;
|
|
2131
|
+
labels?: LabelStringUnder300Bytes[];
|
|
2132
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2133
|
+
accepted: true;
|
|
2134
|
+
}>
|
|
2135
|
+
async listOutputs(args: {
|
|
2136
|
+
basket: BasketStringUnder300Bytes;
|
|
2137
|
+
tags?: OutputTagStringUnder300Bytes[];
|
|
2138
|
+
tagQueryMode?: "all" | "any";
|
|
2139
|
+
include?: "locking scripts" | "entire transactions";
|
|
2140
|
+
includeCustomInstructions?: BooleanDefaultFalse;
|
|
2141
|
+
includeTags?: BooleanDefaultFalse;
|
|
2142
|
+
includeLabels?: BooleanDefaultFalse;
|
|
2143
|
+
limit?: PositiveIntegerDefault10Max10000;
|
|
2144
|
+
offset?: PositiveIntegerOrZero;
|
|
2145
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2146
|
+
totalOutputs: PositiveIntegerOrZero;
|
|
2147
|
+
outputs: Array<{
|
|
2148
|
+
outpoint: OutpointString;
|
|
2149
|
+
satoshis: SatoshiValue;
|
|
2150
|
+
lockingScript?: HexString;
|
|
2151
|
+
tx?: BEEF;
|
|
2152
|
+
spendable: true;
|
|
2153
|
+
customInstructions?: string;
|
|
2154
|
+
tags?: OutputTagStringUnder300Bytes[];
|
|
2155
|
+
labels?: LabelStringUnder300Bytes[];
|
|
2156
|
+
}>;
|
|
2157
|
+
}>
|
|
2158
|
+
async relinquishOutput(args: {
|
|
2159
|
+
basket: BasketStringUnder300Bytes;
|
|
2160
|
+
output: OutpointString;
|
|
2161
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2162
|
+
relinquished: true;
|
|
2163
|
+
}>
|
|
2164
|
+
async getPublicKey(args: {
|
|
2165
|
+
identityKey?: true;
|
|
2166
|
+
protocolID?: [
|
|
2167
|
+
0 | 1 | 2,
|
|
2168
|
+
ProtocolString5To400Bytes
|
|
2169
|
+
];
|
|
2170
|
+
keyID?: KeyIDStringUnder800Bytes;
|
|
2171
|
+
privileged?: BooleanDefaultFalse;
|
|
2172
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2173
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
2174
|
+
forSelf?: BooleanDefaultFalse;
|
|
2175
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2176
|
+
publicKey: PubKeyHex;
|
|
2177
|
+
}>
|
|
2178
|
+
async revealCounterpartyKeyLinkage(args: {
|
|
2179
|
+
counterparty: PubKeyHex;
|
|
2180
|
+
verifier: PubKeyHex;
|
|
2181
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2182
|
+
privileged?: BooleanDefaultFalse;
|
|
2183
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2184
|
+
prover: PubKeyHex;
|
|
2185
|
+
verifier: PubKeyHex;
|
|
2186
|
+
counterparty: PubKeyHex;
|
|
2187
|
+
revelationTime: ISOTimestampString;
|
|
2188
|
+
encryptedLinkage: Byte[];
|
|
2189
|
+
encryptedLinkageProof: Byte[];
|
|
2190
|
+
}>
|
|
2191
|
+
async revealSpecificKeyLinkage(args: {
|
|
2192
|
+
counterparty: PubKeyHex;
|
|
2193
|
+
verifier: PubKeyHex;
|
|
2194
|
+
protocolID: [
|
|
2195
|
+
0 | 1 | 2,
|
|
2196
|
+
ProtocolString5To400Bytes
|
|
2197
|
+
];
|
|
2198
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
2199
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2200
|
+
privileged?: BooleanDefaultFalse;
|
|
2201
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2202
|
+
prover: PubKeyHex;
|
|
2203
|
+
verifier: PubKeyHex;
|
|
2204
|
+
counterparty: PubKeyHex;
|
|
2205
|
+
protocolID: [
|
|
2206
|
+
0 | 1 | 2,
|
|
2207
|
+
ProtocolString5To400Bytes
|
|
2208
|
+
];
|
|
2209
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
2210
|
+
encryptedLinkage: Byte[];
|
|
2211
|
+
encryptedLinkageProof: Byte[];
|
|
2212
|
+
proofType: Byte;
|
|
2213
|
+
}>
|
|
2214
|
+
async encrypt(args: {
|
|
2215
|
+
plaintext: Byte[];
|
|
2216
|
+
protocolID: [
|
|
2217
|
+
0 | 1 | 2,
|
|
2218
|
+
ProtocolString5To400Bytes
|
|
2219
|
+
];
|
|
2220
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
2221
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2222
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
2223
|
+
privileged?: BooleanDefaultFalse;
|
|
2224
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2225
|
+
ciphertext: Byte[];
|
|
2226
|
+
}>
|
|
2227
|
+
async decrypt(args: {
|
|
2228
|
+
ciphertext: Byte[];
|
|
2229
|
+
protocolID: [
|
|
2230
|
+
0 | 1 | 2,
|
|
2231
|
+
ProtocolString5To400Bytes
|
|
2232
|
+
];
|
|
2233
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
2234
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2235
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
2236
|
+
privileged?: BooleanDefaultFalse;
|
|
2237
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2238
|
+
plaintext: Byte[];
|
|
2239
|
+
}>
|
|
2240
|
+
async createHmac(args: {
|
|
2241
|
+
data: Byte[];
|
|
2242
|
+
protocolID: [
|
|
2243
|
+
0 | 1 | 2,
|
|
2244
|
+
ProtocolString5To400Bytes
|
|
2245
|
+
];
|
|
2246
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
2247
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2248
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
2249
|
+
privileged?: BooleanDefaultFalse;
|
|
2250
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2251
|
+
hmac: Byte[];
|
|
2252
|
+
}>
|
|
2253
|
+
async verifyHmac(args: {
|
|
2254
|
+
data: Byte[];
|
|
2255
|
+
hmac: Byte[];
|
|
2256
|
+
protocolID: [
|
|
2257
|
+
0 | 1 | 2,
|
|
2258
|
+
ProtocolString5To400Bytes
|
|
2259
|
+
];
|
|
2260
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
2261
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2262
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
2263
|
+
privileged?: BooleanDefaultFalse;
|
|
2264
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2265
|
+
valid: true;
|
|
2266
|
+
}>
|
|
2267
|
+
async createSignature(args: {
|
|
2268
|
+
data?: Byte[];
|
|
2269
|
+
hashToDirectlySign?: Byte[];
|
|
2270
|
+
protocolID: [
|
|
2271
|
+
0 | 1 | 2,
|
|
2272
|
+
ProtocolString5To400Bytes
|
|
2273
|
+
];
|
|
2274
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
2275
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2276
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
2277
|
+
privileged?: BooleanDefaultFalse;
|
|
2278
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2279
|
+
signature: Byte[];
|
|
2280
|
+
}>
|
|
2281
|
+
async verifySignature(args: {
|
|
2282
|
+
data?: Byte[];
|
|
2283
|
+
hashToDirectlyVerify?: Byte[];
|
|
2284
|
+
signature: Byte[];
|
|
2285
|
+
protocolID: [
|
|
2286
|
+
0 | 1 | 2,
|
|
2287
|
+
ProtocolString5To400Bytes
|
|
2288
|
+
];
|
|
2289
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
2290
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2291
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
2292
|
+
forSelf?: BooleanDefaultFalse;
|
|
2293
|
+
privileged?: BooleanDefaultFalse;
|
|
2294
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2295
|
+
valid: true;
|
|
2296
|
+
}>
|
|
2297
|
+
async acquireCertificate(args: {
|
|
2298
|
+
type: Base64String;
|
|
2299
|
+
subject: PubKeyHex;
|
|
2300
|
+
serialNumber: Base64String;
|
|
2301
|
+
revocationOutpoint: OutpointString;
|
|
2302
|
+
signature: HexString;
|
|
2303
|
+
fields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
2304
|
+
certifier: PubKeyHex;
|
|
2305
|
+
keyringRevealer: PubKeyHex | "certifier";
|
|
2306
|
+
keyringForSubject: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
2307
|
+
acquisitionProtocol: "direct" | "issuance";
|
|
2308
|
+
certifierUrl?: string;
|
|
2309
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2310
|
+
type: Base64String;
|
|
2311
|
+
subject: PubKeyHex;
|
|
2312
|
+
serialNumber: Base64String;
|
|
2313
|
+
certifier: PubKeyHex;
|
|
2314
|
+
revocationOutpoint: OutpointString;
|
|
2315
|
+
signature: HexString;
|
|
2316
|
+
fields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
2317
|
+
}>
|
|
2318
|
+
async listCertificates(args: {
|
|
2319
|
+
certifiers: PubKeyHex[];
|
|
2320
|
+
types: Base64String[];
|
|
2321
|
+
limit?: PositiveIntegerDefault10Max10000;
|
|
2322
|
+
offset?: PositiveIntegerOrZero;
|
|
2323
|
+
privileged?: BooleanDefaultFalse;
|
|
2324
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2325
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2326
|
+
totalCertificates: PositiveIntegerOrZero;
|
|
2327
|
+
certificates: Array<{
|
|
2328
|
+
type: Base64String;
|
|
2329
|
+
subject: PubKeyHex;
|
|
2330
|
+
serialNumber: Base64String;
|
|
2331
|
+
certifier: PubKeyHex;
|
|
2332
|
+
revocationOutpoint: OutpointString;
|
|
2333
|
+
signature: HexString;
|
|
2334
|
+
fields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
2335
|
+
}>;
|
|
2336
|
+
}>
|
|
2337
|
+
async proveCertificate(args: {
|
|
2338
|
+
certificate: {
|
|
2339
|
+
type: Base64String;
|
|
2340
|
+
subject: PubKeyHex;
|
|
2341
|
+
serialNumber: Base64String;
|
|
2342
|
+
certifier: PubKeyHex;
|
|
2343
|
+
revocationOutpoint: OutpointString;
|
|
2344
|
+
signature: HexString;
|
|
2345
|
+
fields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
2346
|
+
};
|
|
2347
|
+
fieldsToReveal: CertificateFieldNameUnder50Bytes[];
|
|
2348
|
+
verifier: PubKeyHex;
|
|
2349
|
+
privileged?: BooleanDefaultFalse;
|
|
2350
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2351
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2352
|
+
keyringForVerifier: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
2353
|
+
}>
|
|
2354
|
+
async relinquishCertificate(args: {
|
|
2355
|
+
type: Base64String;
|
|
2356
|
+
serialNumber: Base64String;
|
|
2357
|
+
certifier: PubKeyHex;
|
|
2358
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2359
|
+
relinquished: true;
|
|
2360
|
+
}>
|
|
2361
|
+
async discoverByIdentityKey(args: {
|
|
2362
|
+
identityKey: PubKeyHex;
|
|
2363
|
+
limit?: PositiveIntegerDefault10Max10000;
|
|
2364
|
+
offset?: PositiveIntegerOrZero;
|
|
2365
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2366
|
+
totalCertificates: PositiveIntegerOrZero;
|
|
2367
|
+
certificates: Array<{
|
|
2368
|
+
type: Base64String;
|
|
2369
|
+
subject: PubKeyHex;
|
|
2370
|
+
serialNumber: Base64String;
|
|
2371
|
+
certifier: PubKeyHex;
|
|
2372
|
+
revocationOutpoint: OutpointString;
|
|
2373
|
+
signature: HexString;
|
|
2374
|
+
fields: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
2375
|
+
certifierInfo: {
|
|
2376
|
+
name: EntityNameStringMax100Bytes;
|
|
2377
|
+
iconUrl: EntityIconURLStringMax500Bytes;
|
|
2378
|
+
description: DescriptionString5to50Bytes;
|
|
2379
|
+
trust: PositiveIntegerMax10;
|
|
2380
|
+
};
|
|
2381
|
+
publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
2382
|
+
decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
2383
|
+
}>;
|
|
2384
|
+
}>
|
|
2385
|
+
async discoverByAttributes(args: {
|
|
2386
|
+
attributes: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
2387
|
+
limit?: PositiveIntegerDefault10Max10000;
|
|
2388
|
+
offset?: PositiveIntegerOrZero;
|
|
2389
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2390
|
+
totalCertificates: PositiveIntegerOrZero;
|
|
2391
|
+
certificates: Array<{
|
|
2392
|
+
type: Base64String;
|
|
2393
|
+
subject: PubKeyHex;
|
|
2394
|
+
serialNumber: Base64String;
|
|
2395
|
+
certifier: PubKeyHex;
|
|
2396
|
+
revocationOutpoint: OutpointString;
|
|
2397
|
+
signature: HexString;
|
|
2398
|
+
fields: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
2399
|
+
certifierInfo: {
|
|
2400
|
+
name: EntityNameStringMax100Bytes;
|
|
2401
|
+
iconUrl: EntityIconURLStringMax500Bytes;
|
|
2402
|
+
description: DescriptionString5to50Bytes;
|
|
2403
|
+
trust: PositiveIntegerMax10;
|
|
2404
|
+
};
|
|
2405
|
+
publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
2406
|
+
decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
2407
|
+
}>;
|
|
2408
|
+
}>
|
|
2409
|
+
async isAuthenticated(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2410
|
+
authenticated: boolean;
|
|
2411
|
+
}>
|
|
2412
|
+
async waitForAuthentication(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2413
|
+
authenticated: true;
|
|
2414
|
+
}>
|
|
2415
|
+
async getHeight(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2416
|
+
height: PositiveInteger;
|
|
2417
|
+
}>
|
|
2418
|
+
async getHeaderForHeight(args: {
|
|
2419
|
+
height: PositiveInteger;
|
|
2420
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2421
|
+
header: HexString;
|
|
2422
|
+
}>
|
|
2423
|
+
async getNetwork(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2424
|
+
network: "mainnet" | "testnet";
|
|
2425
|
+
}>
|
|
2426
|
+
async getVersion(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2427
|
+
version: VersionString7To30Bytes;
|
|
2428
|
+
}>
|
|
2429
|
+
}
|
|
2430
|
+
```
|
|
2431
|
+
|
|
2432
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2433
|
+
|
|
2434
|
+
---
|
|
2435
|
+
### Class: WalletWireTransceiver
|
|
2436
|
+
|
|
2437
|
+
A way to make remote calls to a wallet over a wallet wire.
|
|
2438
|
+
|
|
2439
|
+
```ts
|
|
2440
|
+
export default class WalletWireTransceiver implements Wallet {
|
|
2441
|
+
wire: WalletWire;
|
|
2442
|
+
constructor(wire: WalletWire)
|
|
2443
|
+
async createAction(args: CreateActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<CreateActionResult>
|
|
2444
|
+
async signAction(args: SignActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<SignActionResult>
|
|
2445
|
+
async abortAction(args: {
|
|
2446
|
+
reference: Base64String;
|
|
2447
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2448
|
+
aborted: true;
|
|
2449
|
+
}>
|
|
2450
|
+
async listActions(args: ListActionsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListActionsResult>
|
|
2451
|
+
async internalizeAction(args: InternalizeActionArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2452
|
+
accepted: true;
|
|
2453
|
+
}>
|
|
2454
|
+
async listOutputs(args: ListOutputsArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListOutputsResult>
|
|
2455
|
+
async relinquishOutput(args: {
|
|
2456
|
+
basket: BasketStringUnder300Bytes;
|
|
2457
|
+
output: OutpointString;
|
|
2458
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2459
|
+
relinquished: true;
|
|
2460
|
+
}>
|
|
2461
|
+
async getPublicKey(args: {
|
|
2462
|
+
seekPermission?: BooleanDefaultTrue;
|
|
2463
|
+
identityKey?: true;
|
|
2464
|
+
protocolID?: [
|
|
2465
|
+
0 | 1 | 2,
|
|
2466
|
+
ProtocolString5To400Bytes
|
|
2467
|
+
];
|
|
2468
|
+
keyID?: KeyIDStringUnder800Bytes;
|
|
2469
|
+
privileged?: BooleanDefaultFalse;
|
|
2470
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2471
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
2472
|
+
forSelf?: BooleanDefaultFalse;
|
|
2473
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2474
|
+
publicKey: PubKeyHex;
|
|
2475
|
+
}>
|
|
2476
|
+
async revealCounterpartyKeyLinkage(args: {
|
|
2477
|
+
counterparty: PubKeyHex;
|
|
2478
|
+
verifier: PubKeyHex;
|
|
2479
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2480
|
+
privileged?: BooleanDefaultFalse;
|
|
2481
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2482
|
+
prover: PubKeyHex;
|
|
2483
|
+
verifier: PubKeyHex;
|
|
2484
|
+
counterparty: PubKeyHex;
|
|
2485
|
+
revelationTime: ISOTimestampString;
|
|
2486
|
+
encryptedLinkage: Byte[];
|
|
2487
|
+
encryptedLinkageProof: number[];
|
|
2488
|
+
}>
|
|
2489
|
+
async revealSpecificKeyLinkage(args: {
|
|
2490
|
+
counterparty: PubKeyHex;
|
|
2491
|
+
verifier: PubKeyHex;
|
|
2492
|
+
protocolID: [
|
|
2493
|
+
0 | 1 | 2,
|
|
2494
|
+
ProtocolString5To400Bytes
|
|
2495
|
+
];
|
|
2496
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
2497
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2498
|
+
privileged?: BooleanDefaultFalse;
|
|
2499
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2500
|
+
prover: PubKeyHex;
|
|
2501
|
+
verifier: PubKeyHex;
|
|
2502
|
+
counterparty: PubKeyHex;
|
|
2503
|
+
protocolID: [
|
|
2504
|
+
0 | 1 | 2,
|
|
2505
|
+
ProtocolString5To400Bytes
|
|
2506
|
+
];
|
|
2507
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
2508
|
+
encryptedLinkage: Byte[];
|
|
2509
|
+
encryptedLinkageProof: Byte[];
|
|
2510
|
+
proofType: Byte;
|
|
2511
|
+
}>
|
|
2512
|
+
async encrypt(args: {
|
|
2513
|
+
seekPermission?: BooleanDefaultTrue;
|
|
2514
|
+
plaintext: Byte[];
|
|
2515
|
+
protocolID: [
|
|
2516
|
+
0 | 1 | 2,
|
|
2517
|
+
ProtocolString5To400Bytes
|
|
2518
|
+
];
|
|
2519
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
2520
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2521
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
2522
|
+
privileged?: BooleanDefaultFalse;
|
|
2523
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2524
|
+
ciphertext: Byte[];
|
|
2525
|
+
}>
|
|
2526
|
+
async decrypt(args: {
|
|
2527
|
+
seekPermission?: BooleanDefaultTrue;
|
|
2528
|
+
ciphertext: Byte[];
|
|
2529
|
+
protocolID: [
|
|
2530
|
+
0 | 1 | 2,
|
|
2531
|
+
ProtocolString5To400Bytes
|
|
2532
|
+
];
|
|
2533
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
2534
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2535
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
2536
|
+
privileged?: BooleanDefaultFalse;
|
|
2537
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2538
|
+
plaintext: Byte[];
|
|
2539
|
+
}>
|
|
2540
|
+
async createHmac(args: {
|
|
2541
|
+
seekPermission?: BooleanDefaultTrue;
|
|
2542
|
+
data: Byte[];
|
|
2543
|
+
protocolID: [
|
|
2544
|
+
0 | 1 | 2,
|
|
2545
|
+
ProtocolString5To400Bytes
|
|
2546
|
+
];
|
|
2547
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
2548
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2549
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
2550
|
+
privileged?: BooleanDefaultFalse;
|
|
2551
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2552
|
+
hmac: Byte[];
|
|
2553
|
+
}>
|
|
2554
|
+
async verifyHmac(args: {
|
|
2555
|
+
seekPermission?: BooleanDefaultTrue;
|
|
2556
|
+
data: Byte[];
|
|
2557
|
+
hmac: Byte[];
|
|
2558
|
+
protocolID: [
|
|
2559
|
+
0 | 1 | 2,
|
|
2560
|
+
ProtocolString5To400Bytes
|
|
2561
|
+
];
|
|
2562
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
2563
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2564
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
2565
|
+
privileged?: BooleanDefaultFalse;
|
|
2566
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2567
|
+
valid: true;
|
|
2568
|
+
}>
|
|
2569
|
+
async createSignature(args: {
|
|
2570
|
+
seekPermission?: BooleanDefaultTrue;
|
|
2571
|
+
data?: Byte[];
|
|
2572
|
+
hashToDirectlySign?: Byte[];
|
|
2573
|
+
protocolID: [
|
|
2574
|
+
0 | 1 | 2,
|
|
2575
|
+
ProtocolString5To400Bytes
|
|
2576
|
+
];
|
|
2577
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
2578
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2579
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
2580
|
+
privileged?: BooleanDefaultFalse;
|
|
2581
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2582
|
+
signature: Byte[];
|
|
2583
|
+
}>
|
|
2584
|
+
async verifySignature(args: {
|
|
2585
|
+
seekPermission?: BooleanDefaultTrue;
|
|
2586
|
+
data?: Byte[];
|
|
2587
|
+
hashToDirectlyVerify?: Byte[];
|
|
2588
|
+
signature: Byte[];
|
|
2589
|
+
protocolID: [
|
|
2590
|
+
0 | 1 | 2,
|
|
2591
|
+
ProtocolString5To400Bytes
|
|
2592
|
+
];
|
|
2593
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
2594
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2595
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
2596
|
+
forSelf?: BooleanDefaultFalse;
|
|
2597
|
+
privileged?: BooleanDefaultFalse;
|
|
2598
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2599
|
+
valid: true;
|
|
2600
|
+
}>
|
|
2601
|
+
async acquireCertificate(args: AcquireCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<AcquireCertificateResult>
|
|
2602
|
+
async listCertificates(args: {
|
|
2603
|
+
certifiers: PubKeyHex[];
|
|
2604
|
+
types: Base64String[];
|
|
2605
|
+
limit?: PositiveIntegerDefault10Max10000;
|
|
2606
|
+
offset?: PositiveIntegerOrZero;
|
|
2607
|
+
privileged?: BooleanDefaultFalse;
|
|
2608
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2609
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ListCertificatesResult>
|
|
2610
|
+
async proveCertificate(args: ProveCertificateArgs, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<ProveCertificateResult>
|
|
2611
|
+
async relinquishCertificate(args: {
|
|
2612
|
+
type: Base64String;
|
|
2613
|
+
serialNumber: Base64String;
|
|
2614
|
+
certifier: PubKeyHex;
|
|
2615
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2616
|
+
relinquished: true;
|
|
2617
|
+
}>
|
|
2618
|
+
async discoverByIdentityKey(args: {
|
|
2619
|
+
seekPermission?: BooleanDefaultTrue;
|
|
2620
|
+
identityKey: PubKeyHex;
|
|
2621
|
+
limit?: PositiveIntegerDefault10Max10000;
|
|
2622
|
+
offset?: PositiveIntegerOrZero;
|
|
2623
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<DiscoverCertificatesResult>
|
|
2624
|
+
async discoverByAttributes(args: {
|
|
2625
|
+
seekPermission?: BooleanDefaultTrue;
|
|
2626
|
+
attributes: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
2627
|
+
limit?: PositiveIntegerDefault10Max10000;
|
|
2628
|
+
offset?: PositiveIntegerOrZero;
|
|
2629
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<DiscoverCertificatesResult>
|
|
2630
|
+
async isAuthenticated(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2631
|
+
authenticated: boolean;
|
|
2632
|
+
}>
|
|
2633
|
+
async waitForAuthentication(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2634
|
+
authenticated: true;
|
|
2635
|
+
}>
|
|
2636
|
+
async getHeight(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2637
|
+
height: PositiveInteger;
|
|
2638
|
+
}>
|
|
2639
|
+
async getHeaderForHeight(args: {
|
|
2640
|
+
height: PositiveInteger;
|
|
2641
|
+
}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2642
|
+
header: HexString;
|
|
2643
|
+
}>
|
|
2644
|
+
async getNetwork(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2645
|
+
network: "mainnet" | "testnet";
|
|
2646
|
+
}>
|
|
2647
|
+
async getVersion(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
|
|
2648
|
+
version: VersionString7To30Bytes;
|
|
2649
|
+
}>
|
|
2650
|
+
}
|
|
2651
|
+
```
|
|
2652
|
+
|
|
2653
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2654
|
+
|
|
2655
|
+
---
|
|
2656
|
+
### Class: WalletWireProcessor
|
|
2657
|
+
|
|
2658
|
+
Processes incoming wallet calls received over a wallet wire, with a given wallet.
|
|
2659
|
+
|
|
2660
|
+
```ts
|
|
2661
|
+
export default class WalletWireProcessor implements WalletWire {
|
|
2662
|
+
wallet: Wallet;
|
|
2663
|
+
constructor(wallet: Wallet)
|
|
2664
|
+
async transmitToWallet(message: number[]): Promise<number[]>
|
|
2665
|
+
}
|
|
2666
|
+
```
|
|
2667
|
+
|
|
2668
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2669
|
+
|
|
2670
|
+
---
|
|
2671
|
+
### Class: HTTPWalletWire
|
|
2672
|
+
|
|
2673
|
+
```ts
|
|
2674
|
+
export default class HTTPWalletWire implements WalletWire {
|
|
2675
|
+
baseUrl: string;
|
|
2676
|
+
httpClient: typeof fetch;
|
|
2677
|
+
originator: string | undefined;
|
|
2678
|
+
constructor(originator: string | undefined, baseUrl: string = "http://localhost:3301", httpClient = fetch)
|
|
2679
|
+
async transmitToWallet(message: number[]): Promise<number[]>
|
|
2680
|
+
}
|
|
2681
|
+
```
|
|
2682
|
+
|
|
2683
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
2684
|
+
|
|
2685
|
+
---
|
|
2686
|
+
### Class: XDMSubstrate
|
|
2687
|
+
|
|
2688
|
+
Facilitates wallet operations over cross-document messaging.
|
|
2689
|
+
|
|
2690
|
+
```ts
|
|
2691
|
+
export default class XDMSubstrate implements Wallet {
|
|
2692
|
+
constructor(domain: string = "*")
|
|
2693
|
+
async invoke(call: CallType, args: any): Promise<any>
|
|
2694
|
+
async createAction(args: {
|
|
2695
|
+
description: DescriptionString5to50Bytes;
|
|
2696
|
+
inputs?: Array<{
|
|
2697
|
+
tx?: BEEF;
|
|
2698
|
+
outpoint: OutpointString;
|
|
2699
|
+
unlockingScript?: HexString;
|
|
2700
|
+
unlockingScriptLength?: PositiveInteger;
|
|
2701
|
+
inputDescription: DescriptionString5to50Bytes;
|
|
2702
|
+
sequenceNumber?: PositiveIntegerOrZero;
|
|
2703
|
+
}>;
|
|
2704
|
+
outputs?: Array<{
|
|
2705
|
+
lockingScript: HexString;
|
|
2706
|
+
satoshis: SatoshiValue;
|
|
2707
|
+
outputDescription: DescriptionString5to50Bytes;
|
|
2708
|
+
basket?: BasketStringUnder300Bytes;
|
|
2709
|
+
customInstructions?: string;
|
|
2710
|
+
tags?: OutputTagStringUnder300Bytes[];
|
|
2711
|
+
}>;
|
|
2712
|
+
lockTime?: PositiveIntegerOrZero;
|
|
2713
|
+
version?: PositiveIntegerOrZero;
|
|
2714
|
+
labels?: LabelStringUnder300Bytes[];
|
|
2715
|
+
options?: {
|
|
2716
|
+
signAndProcess?: BooleanDefaultTrue;
|
|
2717
|
+
acceptDelayedBroadcast?: BooleanDefaultTrue;
|
|
2718
|
+
trustSelf?: "known";
|
|
2719
|
+
knownTxids?: TXIDHexString[];
|
|
2720
|
+
returnTXIDOnly?: BooleanDefaultFalse;
|
|
2721
|
+
noSend?: BooleanDefaultFalse;
|
|
2722
|
+
noSendChange?: OutpointString[];
|
|
2723
|
+
sendWith?: TXIDHexString[];
|
|
2724
|
+
};
|
|
2725
|
+
}): Promise<{
|
|
2726
|
+
txid?: TXIDHexString;
|
|
2727
|
+
tx?: BEEF;
|
|
2728
|
+
noSendChange?: OutpointString[];
|
|
2729
|
+
sendWithResults?: Array<{
|
|
2730
|
+
txid: TXIDHexString;
|
|
2731
|
+
status: "unproven" | "sending" | "failed";
|
|
2732
|
+
}>;
|
|
2733
|
+
signableTransaction?: {
|
|
2734
|
+
tx: BEEF;
|
|
2735
|
+
reference: Base64String;
|
|
2736
|
+
};
|
|
2737
|
+
}>
|
|
2738
|
+
async signAction(args: {
|
|
2739
|
+
spends: Record<PositiveIntegerOrZero, {
|
|
2740
|
+
unlockingScript: HexString;
|
|
2741
|
+
sequenceNumber?: PositiveIntegerOrZero;
|
|
2742
|
+
}>;
|
|
2743
|
+
reference: Base64String;
|
|
2744
|
+
options?: {
|
|
2745
|
+
acceptDelayedBroadcast?: BooleanDefaultTrue;
|
|
2746
|
+
returnTXIDOnly?: BooleanDefaultFalse;
|
|
2747
|
+
noSend?: BooleanDefaultFalse;
|
|
2748
|
+
noSendChange?: OutpointString[];
|
|
2749
|
+
sendWith: TXIDHexString[];
|
|
2750
|
+
};
|
|
2751
|
+
}): Promise<{
|
|
2752
|
+
txid?: TXIDHexString;
|
|
2753
|
+
tx?: BEEF;
|
|
2754
|
+
noSendChange?: OutpointString[];
|
|
2755
|
+
sendWithResults?: Array<{
|
|
2756
|
+
txid: TXIDHexString;
|
|
2757
|
+
status: "unproven" | "sending" | "failed";
|
|
2758
|
+
}>;
|
|
2759
|
+
}>
|
|
2760
|
+
async abortAction(args: {
|
|
2761
|
+
reference: Base64String;
|
|
2762
|
+
}): Promise<{
|
|
2763
|
+
aborted: true;
|
|
2764
|
+
}>
|
|
2765
|
+
async listActions(args: {
|
|
2766
|
+
labels: LabelStringUnder300Bytes[];
|
|
2767
|
+
labelQueryMode?: "any" | "all";
|
|
2768
|
+
includeLabels?: BooleanDefaultFalse;
|
|
2769
|
+
includeInputs?: BooleanDefaultFalse;
|
|
2770
|
+
includeInputSourceLockingScripts?: BooleanDefaultFalse;
|
|
2771
|
+
includeInputUnlockingScripts?: BooleanDefaultFalse;
|
|
2772
|
+
includeOutputs?: BooleanDefaultFalse;
|
|
2773
|
+
includeOutputLockingScripts?: BooleanDefaultFalse;
|
|
2774
|
+
limit?: PositiveIntegerDefault10Max10000;
|
|
2775
|
+
offset?: PositiveIntegerOrZero;
|
|
2776
|
+
}): Promise<{
|
|
2777
|
+
totalActions: PositiveIntegerOrZero;
|
|
2778
|
+
actions: Array<{
|
|
2779
|
+
txid: TXIDHexString;
|
|
2780
|
+
satoshis: SatoshiValue;
|
|
2781
|
+
status: "completed" | "unprocessed" | "sending" | "unproven" | "unsigned" | "nosend" | "nonfinal";
|
|
2782
|
+
isOutgoing: boolean;
|
|
2783
|
+
description: DescriptionString5to50Bytes;
|
|
2784
|
+
labels?: LabelStringUnder300Bytes[];
|
|
2785
|
+
version: PositiveIntegerOrZero;
|
|
2786
|
+
lockTime: PositiveIntegerOrZero;
|
|
2787
|
+
inputs?: Array<{
|
|
2788
|
+
sourceOutpoint: OutpointString;
|
|
2789
|
+
sourceSatoshis: SatoshiValue;
|
|
2790
|
+
sourceLockingScript?: HexString;
|
|
2791
|
+
unlockingScript?: HexString;
|
|
2792
|
+
inputDescription: DescriptionString5to50Bytes;
|
|
2793
|
+
sequenceNumber: PositiveIntegerOrZero;
|
|
2794
|
+
}>;
|
|
2795
|
+
outputs?: Array<{
|
|
2796
|
+
outputIndex: PositiveIntegerOrZero;
|
|
2797
|
+
satoshis: SatoshiValue;
|
|
2798
|
+
lockingScript?: HexString;
|
|
2799
|
+
spendable: boolean;
|
|
2800
|
+
outputDescription: DescriptionString5to50Bytes;
|
|
2801
|
+
basket: BasketStringUnder300Bytes;
|
|
2802
|
+
tags: OutputTagStringUnder300Bytes[];
|
|
2803
|
+
customInstructions?: string;
|
|
2804
|
+
}>;
|
|
2805
|
+
}>;
|
|
2806
|
+
}>
|
|
2807
|
+
async internalizeAction(args: {
|
|
2808
|
+
tx: BEEF;
|
|
2809
|
+
outputs: Array<{
|
|
2810
|
+
outputIndex: PositiveIntegerOrZero;
|
|
2811
|
+
protocol: "wallet payment" | "basket insertion";
|
|
2812
|
+
paymentRemittance?: {
|
|
2813
|
+
derivationPrefix: Base64String;
|
|
2814
|
+
derivationSuffix: Base64String;
|
|
2815
|
+
senderIdentityKey: PubKeyHex;
|
|
2816
|
+
};
|
|
2817
|
+
insertionRemittance?: {
|
|
2818
|
+
basket: BasketStringUnder300Bytes;
|
|
2819
|
+
customInstructions?: string;
|
|
2820
|
+
tags?: OutputTagStringUnder300Bytes[];
|
|
2821
|
+
};
|
|
2822
|
+
}>;
|
|
2823
|
+
description: DescriptionString5to50Bytes;
|
|
2824
|
+
labels?: LabelStringUnder300Bytes[];
|
|
2825
|
+
}): Promise<{
|
|
2826
|
+
accepted: true;
|
|
2827
|
+
}>
|
|
2828
|
+
async listOutputs(args: {
|
|
2829
|
+
basket: BasketStringUnder300Bytes;
|
|
2830
|
+
tags?: OutputTagStringUnder300Bytes[];
|
|
2831
|
+
tagQueryMode?: "all" | "any";
|
|
2832
|
+
include?: "locking scripts" | "entire transactions";
|
|
2833
|
+
includeCustomInstructions?: BooleanDefaultFalse;
|
|
2834
|
+
includeTags?: BooleanDefaultFalse;
|
|
2835
|
+
includeLabels?: BooleanDefaultFalse;
|
|
2836
|
+
limit?: PositiveIntegerDefault10Max10000;
|
|
2837
|
+
offset?: PositiveIntegerOrZero;
|
|
2838
|
+
}): Promise<{
|
|
2839
|
+
totalOutputs: PositiveIntegerOrZero;
|
|
2840
|
+
outputs: Array<{
|
|
2841
|
+
outpoint: OutpointString;
|
|
2842
|
+
satoshis: SatoshiValue;
|
|
2843
|
+
lockingScript?: HexString;
|
|
2844
|
+
tx?: BEEF;
|
|
2845
|
+
spendable: true;
|
|
2846
|
+
customInstructions?: string;
|
|
2847
|
+
tags?: OutputTagStringUnder300Bytes[];
|
|
2848
|
+
labels?: LabelStringUnder300Bytes[];
|
|
2849
|
+
}>;
|
|
2850
|
+
}>
|
|
2851
|
+
async relinquishOutput(args: {
|
|
2852
|
+
basket: BasketStringUnder300Bytes;
|
|
2853
|
+
output: OutpointString;
|
|
2854
|
+
}): Promise<{
|
|
2855
|
+
relinquished: true;
|
|
2856
|
+
}>
|
|
2857
|
+
async getPublicKey(args: {
|
|
2858
|
+
identityKey?: true;
|
|
2859
|
+
protocolID?: [
|
|
2860
|
+
0 | 1 | 2,
|
|
2861
|
+
ProtocolString5To400Bytes
|
|
2862
|
+
];
|
|
2863
|
+
keyID?: KeyIDStringUnder800Bytes;
|
|
2864
|
+
privileged?: BooleanDefaultFalse;
|
|
2865
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2866
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
2867
|
+
forSelf?: BooleanDefaultFalse;
|
|
2868
|
+
}): Promise<{
|
|
2869
|
+
publicKey: PubKeyHex;
|
|
2870
|
+
}>
|
|
2871
|
+
async revealCounterpartyKeyLinkage(args: {
|
|
2872
|
+
counterparty: PubKeyHex;
|
|
2873
|
+
verifier: PubKeyHex;
|
|
2874
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2875
|
+
privileged?: BooleanDefaultFalse;
|
|
2876
|
+
}): Promise<{
|
|
2877
|
+
prover: PubKeyHex;
|
|
2878
|
+
verifier: PubKeyHex;
|
|
2879
|
+
counterparty: PubKeyHex;
|
|
2880
|
+
revelationTime: ISOTimestampString;
|
|
2881
|
+
encryptedLinkage: Byte[];
|
|
2882
|
+
encryptedLinkageProof: Byte[];
|
|
2883
|
+
}>
|
|
2884
|
+
async revealSpecificKeyLinkage(args: {
|
|
2885
|
+
counterparty: PubKeyHex;
|
|
2886
|
+
verifier: PubKeyHex;
|
|
2887
|
+
protocolID: [
|
|
2888
|
+
0 | 1 | 2,
|
|
2889
|
+
ProtocolString5To400Bytes
|
|
2890
|
+
];
|
|
2891
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
2892
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2893
|
+
privileged?: BooleanDefaultFalse;
|
|
2894
|
+
}): Promise<{
|
|
2895
|
+
prover: PubKeyHex;
|
|
2896
|
+
verifier: PubKeyHex;
|
|
2897
|
+
counterparty: PubKeyHex;
|
|
2898
|
+
protocolID: [
|
|
2899
|
+
0 | 1 | 2,
|
|
2900
|
+
ProtocolString5To400Bytes
|
|
2901
|
+
];
|
|
2902
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
2903
|
+
encryptedLinkage: Byte[];
|
|
2904
|
+
encryptedLinkageProof: Byte[];
|
|
2905
|
+
proofType: Byte;
|
|
2906
|
+
}>
|
|
2907
|
+
async encrypt(args: {
|
|
2908
|
+
plaintext: Byte[];
|
|
2909
|
+
protocolID: [
|
|
2910
|
+
0 | 1 | 2,
|
|
2911
|
+
ProtocolString5To400Bytes
|
|
2912
|
+
];
|
|
2913
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
2914
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2915
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
2916
|
+
privileged?: BooleanDefaultFalse;
|
|
2917
|
+
}): Promise<{
|
|
2918
|
+
ciphertext: Byte[];
|
|
2919
|
+
}>
|
|
2920
|
+
async decrypt(args: {
|
|
2921
|
+
ciphertext: Byte[];
|
|
2922
|
+
protocolID: [
|
|
2923
|
+
0 | 1 | 2,
|
|
2924
|
+
ProtocolString5To400Bytes
|
|
2925
|
+
];
|
|
2926
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
2927
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2928
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
2929
|
+
privileged?: BooleanDefaultFalse;
|
|
2930
|
+
}): Promise<{
|
|
2931
|
+
plaintext: Byte[];
|
|
2932
|
+
}>
|
|
2933
|
+
async createHmac(args: {
|
|
2934
|
+
data: Byte[];
|
|
2935
|
+
protocolID: [
|
|
2936
|
+
0 | 1 | 2,
|
|
2937
|
+
ProtocolString5To400Bytes
|
|
2938
|
+
];
|
|
2939
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
2940
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2941
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
2942
|
+
privileged?: BooleanDefaultFalse;
|
|
2943
|
+
}): Promise<{
|
|
2944
|
+
hmac: Byte[];
|
|
2945
|
+
}>
|
|
2946
|
+
async verifyHmac(args: {
|
|
2947
|
+
data: Byte[];
|
|
2948
|
+
hmac: Byte[];
|
|
2949
|
+
protocolID: [
|
|
2950
|
+
0 | 1 | 2,
|
|
2951
|
+
ProtocolString5To400Bytes
|
|
2952
|
+
];
|
|
2953
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
2954
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2955
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
2956
|
+
privileged?: BooleanDefaultFalse;
|
|
2957
|
+
}): Promise<{
|
|
2958
|
+
valid: true;
|
|
2959
|
+
}>
|
|
2960
|
+
async createSignature(args: {
|
|
2961
|
+
data?: Byte[];
|
|
2962
|
+
hashToDirectlySign?: Byte[];
|
|
2963
|
+
protocolID: [
|
|
2964
|
+
0 | 1 | 2,
|
|
2965
|
+
ProtocolString5To400Bytes
|
|
2966
|
+
];
|
|
2967
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
2968
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2969
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
2970
|
+
privileged?: BooleanDefaultFalse;
|
|
2971
|
+
}): Promise<{
|
|
2972
|
+
signature: Byte[];
|
|
2973
|
+
}>
|
|
2974
|
+
async verifySignature(args: {
|
|
2975
|
+
data?: Byte[];
|
|
2976
|
+
hashToDirectlyVerify?: Byte[];
|
|
2977
|
+
signature: Byte[];
|
|
2978
|
+
protocolID: [
|
|
2979
|
+
0 | 1 | 2,
|
|
2980
|
+
ProtocolString5To400Bytes
|
|
2981
|
+
];
|
|
2982
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
2983
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
2984
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
2985
|
+
forSelf?: BooleanDefaultFalse;
|
|
2986
|
+
privileged?: BooleanDefaultFalse;
|
|
2987
|
+
}): Promise<{
|
|
2988
|
+
valid: true;
|
|
2989
|
+
}>
|
|
2990
|
+
async acquireCertificate(args: {
|
|
2991
|
+
type: Base64String;
|
|
2992
|
+
subject: PubKeyHex;
|
|
2993
|
+
serialNumber: Base64String;
|
|
2994
|
+
revocationOutpoint: OutpointString;
|
|
2995
|
+
signature: HexString;
|
|
2996
|
+
fields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
2997
|
+
certifier: PubKeyHex;
|
|
2998
|
+
keyringRevealer: PubKeyHex | "certifier";
|
|
2999
|
+
keyringForSubject: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
3000
|
+
acquisitionProtocol: "direct" | "issuance";
|
|
3001
|
+
certifierUrl?: string;
|
|
3002
|
+
}): Promise<{
|
|
3003
|
+
type: Base64String;
|
|
3004
|
+
subject: PubKeyHex;
|
|
3005
|
+
serialNumber: Base64String;
|
|
3006
|
+
certifier: PubKeyHex;
|
|
3007
|
+
revocationOutpoint: OutpointString;
|
|
3008
|
+
signature: HexString;
|
|
3009
|
+
fields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
3010
|
+
}>
|
|
3011
|
+
async listCertificates(args: {
|
|
3012
|
+
certifiers: PubKeyHex[];
|
|
3013
|
+
types: Base64String[];
|
|
3014
|
+
limit?: PositiveIntegerDefault10Max10000;
|
|
3015
|
+
offset?: PositiveIntegerOrZero;
|
|
3016
|
+
privileged?: BooleanDefaultFalse;
|
|
3017
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
3018
|
+
}): Promise<{
|
|
3019
|
+
totalCertificates: PositiveIntegerOrZero;
|
|
3020
|
+
certificates: Array<{
|
|
3021
|
+
type: Base64String;
|
|
3022
|
+
subject: PubKeyHex;
|
|
3023
|
+
serialNumber: Base64String;
|
|
3024
|
+
certifier: PubKeyHex;
|
|
3025
|
+
revocationOutpoint: OutpointString;
|
|
3026
|
+
signature: HexString;
|
|
3027
|
+
fields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
3028
|
+
}>;
|
|
3029
|
+
}>
|
|
3030
|
+
async proveCertificate(args: {
|
|
3031
|
+
certificate: {
|
|
3032
|
+
type: Base64String;
|
|
3033
|
+
subject: PubKeyHex;
|
|
3034
|
+
serialNumber: Base64String;
|
|
3035
|
+
certifier: PubKeyHex;
|
|
3036
|
+
revocationOutpoint: OutpointString;
|
|
3037
|
+
signature: HexString;
|
|
3038
|
+
fields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
3039
|
+
};
|
|
3040
|
+
fieldsToReveal: CertificateFieldNameUnder50Bytes[];
|
|
3041
|
+
verifier: PubKeyHex;
|
|
3042
|
+
privileged?: BooleanDefaultFalse;
|
|
3043
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
3044
|
+
}): Promise<{
|
|
3045
|
+
keyringForVerifier: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
3046
|
+
}>
|
|
3047
|
+
async relinquishCertificate(args: {
|
|
3048
|
+
type: Base64String;
|
|
3049
|
+
serialNumber: Base64String;
|
|
3050
|
+
certifier: PubKeyHex;
|
|
3051
|
+
}): Promise<{
|
|
3052
|
+
relinquished: true;
|
|
3053
|
+
}>
|
|
3054
|
+
async discoverByIdentityKey(args: {
|
|
3055
|
+
identityKey: PubKeyHex;
|
|
3056
|
+
limit?: PositiveIntegerDefault10Max10000;
|
|
3057
|
+
offset?: PositiveIntegerOrZero;
|
|
3058
|
+
}): Promise<{
|
|
3059
|
+
totalCertificates: PositiveIntegerOrZero;
|
|
3060
|
+
certificates: Array<{
|
|
3061
|
+
type: Base64String;
|
|
3062
|
+
subject: PubKeyHex;
|
|
3063
|
+
serialNumber: Base64String;
|
|
3064
|
+
certifier: PubKeyHex;
|
|
3065
|
+
revocationOutpoint: OutpointString;
|
|
3066
|
+
signature: HexString;
|
|
3067
|
+
fields: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
3068
|
+
certifierInfo: {
|
|
3069
|
+
name: EntityNameStringMax100Bytes;
|
|
3070
|
+
iconUrl: EntityIconURLStringMax500Bytes;
|
|
3071
|
+
description: DescriptionString5to50Bytes;
|
|
3072
|
+
trust: PositiveIntegerMax10;
|
|
3073
|
+
};
|
|
3074
|
+
publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
3075
|
+
decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
3076
|
+
}>;
|
|
3077
|
+
}>
|
|
3078
|
+
async discoverByAttributes(args: {
|
|
3079
|
+
attributes: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
3080
|
+
limit?: PositiveIntegerDefault10Max10000;
|
|
3081
|
+
offset?: PositiveIntegerOrZero;
|
|
3082
|
+
}): Promise<{
|
|
3083
|
+
totalCertificates: PositiveIntegerOrZero;
|
|
3084
|
+
certificates: Array<{
|
|
3085
|
+
type: Base64String;
|
|
3086
|
+
subject: PubKeyHex;
|
|
3087
|
+
serialNumber: Base64String;
|
|
3088
|
+
certifier: PubKeyHex;
|
|
3089
|
+
revocationOutpoint: OutpointString;
|
|
3090
|
+
signature: HexString;
|
|
3091
|
+
fields: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
3092
|
+
certifierInfo: {
|
|
3093
|
+
name: EntityNameStringMax100Bytes;
|
|
3094
|
+
iconUrl: EntityIconURLStringMax500Bytes;
|
|
3095
|
+
description: DescriptionString5to50Bytes;
|
|
3096
|
+
trust: PositiveIntegerMax10;
|
|
3097
|
+
};
|
|
3098
|
+
publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
|
|
3099
|
+
decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
3100
|
+
}>;
|
|
3101
|
+
}>
|
|
3102
|
+
async isAuthenticated(args: {}): Promise<{
|
|
3103
|
+
authenticated: boolean;
|
|
3104
|
+
}>
|
|
3105
|
+
async waitForAuthentication(args: {}): Promise<{
|
|
3106
|
+
authenticated: true;
|
|
3107
|
+
}>
|
|
3108
|
+
async getHeight(args: {}): Promise<{
|
|
3109
|
+
height: PositiveInteger;
|
|
3110
|
+
}>
|
|
3111
|
+
async getHeaderForHeight(args: {
|
|
3112
|
+
height: PositiveInteger;
|
|
3113
|
+
}): Promise<{
|
|
3114
|
+
header: HexString;
|
|
3115
|
+
}>
|
|
3116
|
+
async getNetwork(args: {}): Promise<{
|
|
3117
|
+
network: "mainnet" | "testnet";
|
|
3118
|
+
}>
|
|
3119
|
+
async getVersion(args: {}): Promise<{
|
|
3120
|
+
version: VersionString7To30Bytes;
|
|
3121
|
+
}>
|
|
3122
|
+
}
|
|
3123
|
+
```
|
|
3124
|
+
|
|
3125
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3126
|
+
|
|
3127
|
+
---
|
|
3128
|
+
### Class: WalletClient
|
|
3129
|
+
|
|
3130
|
+
The SDK is how applications communicate with wallets over a communications substrate.
|
|
3131
|
+
|
|
3132
|
+
```ts
|
|
3133
|
+
export default class WalletClient implements Wallet {
|
|
3134
|
+
public substrate: "auto" | Wallet;
|
|
3135
|
+
originator?: OriginatorDomainNameStringUnder250Bytes;
|
|
3136
|
+
constructor(substrate: "auto" | "Cicada" | "XDM" | "window.CWI" | Wallet = "auto", originator?: OriginatorDomainNameStringUnder250Bytes)
|
|
3137
|
+
async connectToSubstrate()
|
|
3138
|
+
async createAction(args: CreateActionArgs): Promise<CreateActionResult>
|
|
3139
|
+
async signAction(args: SignActionArgs): Promise<SignActionResult>
|
|
3140
|
+
async abortAction(args: {
|
|
3141
|
+
reference: Base64String;
|
|
3142
|
+
}): Promise<{
|
|
3143
|
+
aborted: true;
|
|
3144
|
+
}>
|
|
3145
|
+
async listActions(args: ListActionsArgs): Promise<ListActionsResult>
|
|
3146
|
+
async internalizeAction(args: InternalizeActionArgs): Promise<{
|
|
3147
|
+
accepted: true;
|
|
3148
|
+
}>
|
|
3149
|
+
async listOutputs(args: ListOutputsArgs): Promise<ListOutputsResult>
|
|
3150
|
+
async relinquishOutput(args: {
|
|
3151
|
+
basket: BasketStringUnder300Bytes;
|
|
3152
|
+
output: OutpointString;
|
|
3153
|
+
}): Promise<{
|
|
3154
|
+
relinquished: true;
|
|
3155
|
+
}>
|
|
3156
|
+
async getPublicKey(args: {
|
|
3157
|
+
identityKey?: true;
|
|
3158
|
+
protocolID?: [
|
|
3159
|
+
0 | 1 | 2,
|
|
3160
|
+
ProtocolString5To400Bytes
|
|
3161
|
+
];
|
|
3162
|
+
keyID?: KeyIDStringUnder800Bytes;
|
|
3163
|
+
privileged?: BooleanDefaultFalse;
|
|
3164
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
3165
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
3166
|
+
forSelf?: BooleanDefaultFalse;
|
|
3167
|
+
}): Promise<{
|
|
3168
|
+
publicKey: PubKeyHex;
|
|
3169
|
+
}>
|
|
3170
|
+
async revealCounterpartyKeyLinkage(args: {
|
|
3171
|
+
counterparty: PubKeyHex;
|
|
3172
|
+
verifier: PubKeyHex;
|
|
3173
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
3174
|
+
privileged?: BooleanDefaultFalse;
|
|
3175
|
+
}): Promise<{
|
|
3176
|
+
prover: PubKeyHex;
|
|
3177
|
+
verifier: PubKeyHex;
|
|
3178
|
+
counterparty: PubKeyHex;
|
|
3179
|
+
revelationTime: ISOTimestampString;
|
|
3180
|
+
encryptedLinkage: Byte[];
|
|
3181
|
+
encryptedLinkageProof: Byte[];
|
|
3182
|
+
}>
|
|
3183
|
+
async revealSpecificKeyLinkage(args: {
|
|
3184
|
+
counterparty: PubKeyHex;
|
|
3185
|
+
verifier: PubKeyHex;
|
|
3186
|
+
protocolID: [
|
|
3187
|
+
0 | 1 | 2,
|
|
3188
|
+
ProtocolString5To400Bytes
|
|
3189
|
+
];
|
|
3190
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
3191
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
3192
|
+
privileged?: BooleanDefaultFalse;
|
|
3193
|
+
}): Promise<{
|
|
3194
|
+
prover: PubKeyHex;
|
|
3195
|
+
verifier: PubKeyHex;
|
|
3196
|
+
counterparty: PubKeyHex;
|
|
3197
|
+
protocolID: [
|
|
3198
|
+
0 | 1 | 2,
|
|
3199
|
+
ProtocolString5To400Bytes
|
|
3200
|
+
];
|
|
3201
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
3202
|
+
encryptedLinkage: Byte[];
|
|
3203
|
+
encryptedLinkageProof: Byte[];
|
|
3204
|
+
proofType: Byte;
|
|
3205
|
+
}>
|
|
3206
|
+
async encrypt(args: {
|
|
3207
|
+
plaintext: Byte[];
|
|
3208
|
+
protocolID: [
|
|
3209
|
+
0 | 1 | 2,
|
|
3210
|
+
ProtocolString5To400Bytes
|
|
3211
|
+
];
|
|
3212
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
3213
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
3214
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
3215
|
+
privileged?: BooleanDefaultFalse;
|
|
3216
|
+
}): Promise<{
|
|
3217
|
+
ciphertext: Byte[];
|
|
3218
|
+
}>
|
|
3219
|
+
async decrypt(args: {
|
|
3220
|
+
ciphertext: Byte[];
|
|
3221
|
+
protocolID: [
|
|
3222
|
+
0 | 1 | 2,
|
|
3223
|
+
ProtocolString5To400Bytes
|
|
3224
|
+
];
|
|
3225
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
3226
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
3227
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
3228
|
+
privileged?: BooleanDefaultFalse;
|
|
3229
|
+
}): Promise<{
|
|
3230
|
+
plaintext: Byte[];
|
|
3231
|
+
}>
|
|
3232
|
+
async createHmac(args: {
|
|
3233
|
+
data: Byte[];
|
|
3234
|
+
protocolID: [
|
|
3235
|
+
0 | 1 | 2,
|
|
3236
|
+
ProtocolString5To400Bytes
|
|
3237
|
+
];
|
|
3238
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
3239
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
3240
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
3241
|
+
privileged?: BooleanDefaultFalse;
|
|
3242
|
+
}): Promise<{
|
|
3243
|
+
hmac: Byte[];
|
|
3244
|
+
}>
|
|
3245
|
+
async verifyHmac(args: {
|
|
3246
|
+
data: Byte[];
|
|
3247
|
+
hmac: Byte[];
|
|
3248
|
+
protocolID: [
|
|
3249
|
+
0 | 1 | 2,
|
|
3250
|
+
ProtocolString5To400Bytes
|
|
3251
|
+
];
|
|
3252
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
3253
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
3254
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
3255
|
+
privileged?: BooleanDefaultFalse;
|
|
3256
|
+
}): Promise<{
|
|
3257
|
+
valid: true;
|
|
3258
|
+
}>
|
|
3259
|
+
async createSignature(args: {
|
|
3260
|
+
data?: Byte[];
|
|
3261
|
+
hashToDirectlySign?: Byte[];
|
|
3262
|
+
protocolID: [
|
|
3263
|
+
0 | 1 | 2,
|
|
3264
|
+
ProtocolString5To400Bytes
|
|
3265
|
+
];
|
|
3266
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
3267
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
3268
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
3269
|
+
privileged?: BooleanDefaultFalse;
|
|
3270
|
+
}): Promise<{
|
|
3271
|
+
signature: Byte[];
|
|
3272
|
+
}>
|
|
3273
|
+
async verifySignature(args: {
|
|
3274
|
+
data?: Byte[];
|
|
3275
|
+
hashToDirectlyVerify?: Byte[];
|
|
3276
|
+
signature: Byte[];
|
|
3277
|
+
protocolID: [
|
|
3278
|
+
0 | 1 | 2,
|
|
3279
|
+
ProtocolString5To400Bytes
|
|
3280
|
+
];
|
|
3281
|
+
keyID: KeyIDStringUnder800Bytes;
|
|
3282
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
3283
|
+
counterparty?: PubKeyHex | "self" | "anyone";
|
|
3284
|
+
forSelf?: BooleanDefaultFalse;
|
|
3285
|
+
privileged?: BooleanDefaultFalse;
|
|
3286
|
+
}): Promise<{
|
|
3287
|
+
valid: true;
|
|
3288
|
+
}>
|
|
3289
|
+
async acquireCertificate(args: AcquireCertificateArgs): Promise<AcquireCertificateResult>
|
|
3290
|
+
async listCertificates(args: {
|
|
3291
|
+
certifiers: PubKeyHex[];
|
|
3292
|
+
types: Base64String[];
|
|
3293
|
+
limit?: PositiveIntegerDefault10Max10000;
|
|
3294
|
+
offset?: PositiveIntegerOrZero;
|
|
3295
|
+
privileged?: BooleanDefaultFalse;
|
|
3296
|
+
privilegedReason?: DescriptionString5to50Bytes;
|
|
3297
|
+
}): Promise<ListCertificatesResult>
|
|
3298
|
+
async proveCertificate(args: ProveCertificateArgs): Promise<ProveCertificateResult>
|
|
3299
|
+
async relinquishCertificate(args: {
|
|
3300
|
+
type: Base64String;
|
|
3301
|
+
serialNumber: Base64String;
|
|
3302
|
+
certifier: PubKeyHex;
|
|
3303
|
+
}): Promise<{
|
|
3304
|
+
relinquished: true;
|
|
3305
|
+
}>
|
|
3306
|
+
async discoverByIdentityKey(args: {
|
|
3307
|
+
identityKey: PubKeyHex;
|
|
3308
|
+
limit?: PositiveIntegerDefault10Max10000;
|
|
3309
|
+
offset?: PositiveIntegerOrZero;
|
|
3310
|
+
}): Promise<DiscoverCertificatesResult>
|
|
3311
|
+
async discoverByAttributes(args: {
|
|
3312
|
+
attributes: Record<CertificateFieldNameUnder50Bytes, string>;
|
|
3313
|
+
limit?: PositiveIntegerDefault10Max10000;
|
|
3314
|
+
offset?: PositiveIntegerOrZero;
|
|
3315
|
+
}): Promise<DiscoverCertificatesResult>
|
|
3316
|
+
async isAuthenticated(args: {} = {}): Promise<{
|
|
3317
|
+
authenticated: boolean;
|
|
3318
|
+
}>
|
|
3319
|
+
async waitForAuthentication(args: {} = {}): Promise<{
|
|
3320
|
+
authenticated: true;
|
|
3321
|
+
}>
|
|
3322
|
+
async getHeight(args: {} = {}): Promise<{
|
|
3323
|
+
height: PositiveInteger;
|
|
3324
|
+
}>
|
|
3325
|
+
async getHeaderForHeight(args: {
|
|
3326
|
+
height: PositiveInteger;
|
|
3327
|
+
}): Promise<{
|
|
3328
|
+
header: HexString;
|
|
3329
|
+
}>
|
|
3330
|
+
async getNetwork(args: {} = {}): Promise<{
|
|
3331
|
+
network: "mainnet" | "testnet";
|
|
3332
|
+
}>
|
|
3333
|
+
async getVersion(args: {} = {}): Promise<{
|
|
3334
|
+
version: VersionString7To30Bytes;
|
|
3335
|
+
}>
|
|
3336
|
+
}
|
|
3337
|
+
```
|
|
3338
|
+
|
|
3339
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3340
|
+
|
|
3341
|
+
---
|
|
3342
|
+
## Functions
|
|
3343
|
+
|
|
3344
|
+
## Types
|
|
3345
|
+
|
|
3346
|
+
| | | |
|
|
3347
|
+
| --- | --- | --- |
|
|
3348
|
+
| [AcquisitionProtocol](#type-acquisitionprotocol) | [EntityNameStringMax100Bytes](#type-entitynamestringmax100bytes) | [PositiveIntegerMax10](#type-positiveintegermax10) |
|
|
3349
|
+
| [ActionStatus](#type-actionstatus) | [ErrorCodeString10To40Bytes](#type-errorcodestring10to40bytes) | [PositiveIntegerOrZero](#type-positiveintegerorzero) |
|
|
3350
|
+
| [AtomicBEEF](#type-atomicbeef) | [ErrorDescriptionString20To200Bytes](#type-errordescriptionstring20to200bytes) | [ProtocolString5To400Bytes](#type-protocolstring5to400bytes) |
|
|
3351
|
+
| [BEEF](#type-beef) | [HexString](#type-hexstring) | [PubKeyHex](#type-pubkeyhex) |
|
|
3352
|
+
| [Base64String](#type-base64string) | [ISOTimestampString](#type-isotimestampstring) | [SatoshiValue](#type-satoshivalue) |
|
|
3353
|
+
| [BasketStringUnder300Bytes](#type-basketstringunder300bytes) | [KeyIDStringUnder800Bytes](#type-keyidstringunder800bytes) | [TXIDHexString](#type-txidhexstring) |
|
|
3354
|
+
| [BooleanDefaultFalse](#type-booleandefaultfalse) | [KeyringRevealer](#type-keyringrevealer) | [TrustSelf](#type-trustself) |
|
|
3355
|
+
| [BooleanDefaultTrue](#type-booleandefaulttrue) | [LabelStringUnder300Bytes](#type-labelstringunder300bytes) | [VersionString7To30Bytes](#type-versionstring7to30bytes) |
|
|
3356
|
+
| [Byte](#type-byte) | [OriginatorDomainNameStringUnder250Bytes](#type-originatordomainnamestringunder250bytes) | [WalletCounterparty](#type-walletcounterparty) |
|
|
3357
|
+
| [CallType](#type-calltype) | [OutpointString](#type-outpointstring) | [WalletErrorCode](#type-walleterrorcode) |
|
|
3358
|
+
| [CertificateFieldNameUnder50Bytes](#type-certificatefieldnameunder50bytes) | [OutputTagStringUnder300Bytes](#type-outputtagstringunder300bytes) | [WalletNetwork](#type-walletnetwork) |
|
|
3359
|
+
| [DescriptionString5to50Bytes](#type-descriptionstring5to50bytes) | [PositiveInteger](#type-positiveinteger) | [WalletProtocol](#type-walletprotocol) |
|
|
3360
|
+
| [EntityIconURLStringMax500Bytes](#type-entityiconurlstringmax500bytes) | [PositiveIntegerDefault10Max10000](#type-positiveintegerdefault10max10000) | |
|
|
3361
|
+
|
|
3362
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3363
|
+
|
|
3364
|
+
---
|
|
3365
|
+
|
|
3366
|
+
### Type: BooleanDefaultFalse
|
|
3367
|
+
|
|
3368
|
+
```ts
|
|
3369
|
+
export type BooleanDefaultFalse = boolean
|
|
3370
|
+
```
|
|
3371
|
+
|
|
3372
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3373
|
+
|
|
3374
|
+
---
|
|
3375
|
+
### Type: BooleanDefaultTrue
|
|
3376
|
+
|
|
3377
|
+
```ts
|
|
3378
|
+
export type BooleanDefaultTrue = boolean
|
|
3379
|
+
```
|
|
3380
|
+
|
|
3381
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3382
|
+
|
|
3383
|
+
---
|
|
3384
|
+
### Type: Byte
|
|
3385
|
+
|
|
3386
|
+
```ts
|
|
3387
|
+
export type Byte = number
|
|
3388
|
+
```
|
|
3389
|
+
|
|
3390
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3391
|
+
|
|
3392
|
+
---
|
|
3393
|
+
### Type: PositiveIntegerOrZero
|
|
3394
|
+
|
|
3395
|
+
```ts
|
|
3396
|
+
export type PositiveIntegerOrZero = number
|
|
3397
|
+
```
|
|
3398
|
+
|
|
3399
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3400
|
+
|
|
3401
|
+
---
|
|
3402
|
+
### Type: PositiveInteger
|
|
3403
|
+
|
|
3404
|
+
```ts
|
|
3405
|
+
export type PositiveInteger = number
|
|
3406
|
+
```
|
|
3407
|
+
|
|
3408
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3409
|
+
|
|
3410
|
+
---
|
|
3411
|
+
### Type: PositiveIntegerMax10
|
|
3412
|
+
|
|
3413
|
+
```ts
|
|
3414
|
+
export type PositiveIntegerMax10 = number
|
|
3415
|
+
```
|
|
3416
|
+
|
|
3417
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3418
|
+
|
|
3419
|
+
---
|
|
3420
|
+
### Type: PositiveIntegerDefault10Max10000
|
|
3421
|
+
|
|
3422
|
+
```ts
|
|
3423
|
+
export type PositiveIntegerDefault10Max10000 = number
|
|
3424
|
+
```
|
|
3425
|
+
|
|
3426
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3427
|
+
|
|
3428
|
+
---
|
|
3429
|
+
### Type: SatoshiValue
|
|
3430
|
+
|
|
3431
|
+
```ts
|
|
3432
|
+
export type SatoshiValue = number
|
|
3433
|
+
```
|
|
3434
|
+
|
|
3435
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3436
|
+
|
|
3437
|
+
---
|
|
3438
|
+
### Type: ISOTimestampString
|
|
3439
|
+
|
|
3440
|
+
```ts
|
|
3441
|
+
export type ISOTimestampString = string
|
|
3442
|
+
```
|
|
3443
|
+
|
|
3444
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3445
|
+
|
|
3446
|
+
---
|
|
3447
|
+
### Type: HexString
|
|
3448
|
+
|
|
3449
|
+
```ts
|
|
3450
|
+
export type HexString = string
|
|
3451
|
+
```
|
|
3452
|
+
|
|
3453
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3454
|
+
|
|
3455
|
+
---
|
|
3456
|
+
### Type: TXIDHexString
|
|
3457
|
+
|
|
3458
|
+
```ts
|
|
3459
|
+
export type TXIDHexString = HexString
|
|
3460
|
+
```
|
|
3461
|
+
|
|
3462
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3463
|
+
|
|
3464
|
+
---
|
|
3465
|
+
### Type: OutpointString
|
|
3466
|
+
|
|
3467
|
+
```ts
|
|
3468
|
+
export type OutpointString = string
|
|
3469
|
+
```
|
|
3470
|
+
|
|
3471
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3472
|
+
|
|
3473
|
+
---
|
|
3474
|
+
### Type: PubKeyHex
|
|
3475
|
+
|
|
3476
|
+
```ts
|
|
3477
|
+
export type PubKeyHex = HexString
|
|
3478
|
+
```
|
|
3479
|
+
|
|
3480
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3481
|
+
|
|
3482
|
+
---
|
|
3483
|
+
### Type: Base64String
|
|
3484
|
+
|
|
3485
|
+
```ts
|
|
3486
|
+
export type Base64String = string
|
|
3487
|
+
```
|
|
3488
|
+
|
|
3489
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3490
|
+
|
|
3491
|
+
---
|
|
3492
|
+
### Type: OriginatorDomainNameStringUnder250Bytes
|
|
3493
|
+
|
|
3494
|
+
```ts
|
|
3495
|
+
export type OriginatorDomainNameStringUnder250Bytes = string
|
|
3496
|
+
```
|
|
3497
|
+
|
|
3498
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3499
|
+
|
|
3500
|
+
---
|
|
3501
|
+
### Type: DescriptionString5to50Bytes
|
|
3502
|
+
|
|
3503
|
+
```ts
|
|
3504
|
+
export type DescriptionString5to50Bytes = string
|
|
3505
|
+
```
|
|
3506
|
+
|
|
3507
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3508
|
+
|
|
3509
|
+
---
|
|
3510
|
+
### Type: BasketStringUnder300Bytes
|
|
3511
|
+
|
|
3512
|
+
```ts
|
|
3513
|
+
export type BasketStringUnder300Bytes = string
|
|
3514
|
+
```
|
|
3515
|
+
|
|
3516
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3517
|
+
|
|
3518
|
+
---
|
|
3519
|
+
### Type: OutputTagStringUnder300Bytes
|
|
3520
|
+
|
|
3521
|
+
```ts
|
|
3522
|
+
export type OutputTagStringUnder300Bytes = string
|
|
3523
|
+
```
|
|
3524
|
+
|
|
3525
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3526
|
+
|
|
3527
|
+
---
|
|
3528
|
+
### Type: LabelStringUnder300Bytes
|
|
3529
|
+
|
|
3530
|
+
```ts
|
|
3531
|
+
export type LabelStringUnder300Bytes = string
|
|
3532
|
+
```
|
|
3533
|
+
|
|
3534
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3535
|
+
|
|
3536
|
+
---
|
|
3537
|
+
### Type: BEEF
|
|
3538
|
+
|
|
3539
|
+
```ts
|
|
3540
|
+
export type BEEF = Byte[]
|
|
3541
|
+
```
|
|
3542
|
+
|
|
3543
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3544
|
+
|
|
3545
|
+
---
|
|
3546
|
+
### Type: AtomicBEEF
|
|
3547
|
+
|
|
3548
|
+
```ts
|
|
3549
|
+
export type AtomicBEEF = Byte[]
|
|
3550
|
+
```
|
|
3551
|
+
|
|
3552
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3553
|
+
|
|
3554
|
+
---
|
|
3555
|
+
### Type: ProtocolString5To400Bytes
|
|
3556
|
+
|
|
3557
|
+
```ts
|
|
3558
|
+
export type ProtocolString5To400Bytes = string
|
|
3559
|
+
```
|
|
3560
|
+
|
|
3561
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3562
|
+
|
|
3563
|
+
---
|
|
3564
|
+
### Type: KeyIDStringUnder800Bytes
|
|
3565
|
+
|
|
3566
|
+
```ts
|
|
3567
|
+
export type KeyIDStringUnder800Bytes = string
|
|
3568
|
+
```
|
|
3569
|
+
|
|
3570
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3571
|
+
|
|
3572
|
+
---
|
|
3573
|
+
### Type: CertificateFieldNameUnder50Bytes
|
|
3574
|
+
|
|
3575
|
+
```ts
|
|
3576
|
+
export type CertificateFieldNameUnder50Bytes = string
|
|
3577
|
+
```
|
|
3578
|
+
|
|
3579
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3580
|
+
|
|
3581
|
+
---
|
|
3582
|
+
### Type: EntityNameStringMax100Bytes
|
|
3583
|
+
|
|
3584
|
+
```ts
|
|
3585
|
+
export type EntityNameStringMax100Bytes = string
|
|
3586
|
+
```
|
|
3587
|
+
|
|
3588
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3589
|
+
|
|
3590
|
+
---
|
|
3591
|
+
### Type: EntityIconURLStringMax500Bytes
|
|
3592
|
+
|
|
3593
|
+
```ts
|
|
3594
|
+
export type EntityIconURLStringMax500Bytes = string
|
|
3595
|
+
```
|
|
3596
|
+
|
|
3597
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3598
|
+
|
|
3599
|
+
---
|
|
3600
|
+
### Type: VersionString7To30Bytes
|
|
3601
|
+
|
|
3602
|
+
```ts
|
|
3603
|
+
export type VersionString7To30Bytes = string
|
|
3604
|
+
```
|
|
3605
|
+
|
|
3606
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3607
|
+
|
|
3608
|
+
---
|
|
3609
|
+
### Type: ErrorCodeString10To40Bytes
|
|
3610
|
+
|
|
3611
|
+
```ts
|
|
3612
|
+
export type ErrorCodeString10To40Bytes = string
|
|
3613
|
+
```
|
|
3614
|
+
|
|
3615
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3616
|
+
|
|
3617
|
+
---
|
|
3618
|
+
### Type: ErrorDescriptionString20To200Bytes
|
|
3619
|
+
|
|
3620
|
+
```ts
|
|
3621
|
+
export type ErrorDescriptionString20To200Bytes = string
|
|
3622
|
+
```
|
|
3623
|
+
|
|
3624
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3625
|
+
|
|
3626
|
+
---
|
|
3627
|
+
### Type: WalletNetwork
|
|
3628
|
+
|
|
3629
|
+
```ts
|
|
3630
|
+
export type WalletNetwork = "mainnet" | "testnet"
|
|
3631
|
+
```
|
|
3632
|
+
|
|
3633
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3634
|
+
|
|
3635
|
+
---
|
|
3636
|
+
### Type: WalletProtocol
|
|
3637
|
+
|
|
3638
|
+
```ts
|
|
3639
|
+
export type WalletProtocol = [
|
|
3640
|
+
0 | 1 | 2,
|
|
3641
|
+
ProtocolString5To400Bytes
|
|
3642
|
+
]
|
|
3643
|
+
```
|
|
3644
|
+
|
|
3645
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3646
|
+
|
|
3647
|
+
---
|
|
3648
|
+
### Type: WalletCounterparty
|
|
3649
|
+
|
|
3650
|
+
```ts
|
|
3651
|
+
export type WalletCounterparty = PubKeyHex | "self" | "anyone"
|
|
3652
|
+
```
|
|
3653
|
+
|
|
3654
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3655
|
+
|
|
3656
|
+
---
|
|
3657
|
+
### Type: AcquisitionProtocol
|
|
3658
|
+
|
|
3659
|
+
```ts
|
|
3660
|
+
export type AcquisitionProtocol = "direct" | "issuance"
|
|
3661
|
+
```
|
|
3662
|
+
|
|
3663
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3664
|
+
|
|
3665
|
+
---
|
|
3666
|
+
### Type: KeyringRevealer
|
|
3667
|
+
|
|
3668
|
+
```ts
|
|
3669
|
+
export type KeyringRevealer = PubKeyHex | "certifier"
|
|
3670
|
+
```
|
|
3671
|
+
|
|
3672
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3673
|
+
|
|
3674
|
+
---
|
|
3675
|
+
### Type: ActionStatus
|
|
3676
|
+
|
|
3677
|
+
```ts
|
|
3678
|
+
export type ActionStatus = "completed" | "unprocessed" | "sending" | "unproven" | "unsigned" | "nosend" | "nonfinal"
|
|
3679
|
+
```
|
|
3680
|
+
|
|
3681
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3682
|
+
|
|
3683
|
+
---
|
|
3684
|
+
### Type: TrustSelf
|
|
3685
|
+
|
|
3686
|
+
Controls behavior of input BEEF validation.
|
|
3687
|
+
|
|
3688
|
+
If `known`, input transactions may omit supporting validity proof data for all TXIDs known to this wallet.
|
|
3689
|
+
|
|
3690
|
+
If undefined, input BEEFs must be complete and valid.
|
|
3691
|
+
|
|
3692
|
+
```ts
|
|
3693
|
+
export type TrustSelf = "known"
|
|
3694
|
+
```
|
|
3695
|
+
|
|
3696
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3697
|
+
|
|
3698
|
+
---
|
|
3699
|
+
### Type: WalletErrorCode
|
|
3700
|
+
|
|
3701
|
+
```ts
|
|
3702
|
+
export type WalletErrorCode = keyof typeof walletErrors
|
|
3703
|
+
```
|
|
3704
|
+
|
|
3705
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3706
|
+
|
|
3707
|
+
---
|
|
3708
|
+
### Type: CallType
|
|
3709
|
+
|
|
3710
|
+
```ts
|
|
3711
|
+
export type CallType = keyof typeof calls
|
|
3712
|
+
```
|
|
3713
|
+
|
|
3714
|
+
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
|
|
3715
|
+
|
|
3716
|
+
---
|
|
3717
|
+
## Variables
|
|
3718
|
+
|