@bsv/sdk 1.1.32 → 1.2.0

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.
Files changed (229) hide show
  1. package/dist/cjs/mod.js +4 -0
  2. package/dist/cjs/mod.js.map +1 -1
  3. package/dist/cjs/package.json +4 -3
  4. package/dist/cjs/src/auth/Certificate.js +163 -0
  5. package/dist/cjs/src/auth/Certificate.js.map +1 -0
  6. package/dist/cjs/src/auth/index.js +9 -0
  7. package/dist/cjs/src/auth/index.js.map +1 -0
  8. package/dist/cjs/src/compat/BSM.js +17 -7
  9. package/dist/cjs/src/compat/BSM.js.map +1 -1
  10. package/dist/cjs/src/compat/ECIES.js +17 -7
  11. package/dist/cjs/src/compat/ECIES.js.map +1 -1
  12. package/dist/cjs/src/compat/HD.js +17 -7
  13. package/dist/cjs/src/compat/HD.js.map +1 -1
  14. package/dist/cjs/src/compat/Mnemonic.js +17 -7
  15. package/dist/cjs/src/compat/Mnemonic.js.map +1 -1
  16. package/dist/cjs/src/compat/index.js +17 -7
  17. package/dist/cjs/src/compat/index.js.map +1 -1
  18. package/dist/cjs/src/messages/index.js +17 -7
  19. package/dist/cjs/src/messages/index.js.map +1 -1
  20. package/dist/cjs/src/overlay-tools/LookupResolver.js +170 -0
  21. package/dist/cjs/src/overlay-tools/LookupResolver.js.map +1 -0
  22. package/dist/cjs/src/overlay-tools/OverlayAdminTokenTemplate.js +69 -0
  23. package/dist/cjs/src/overlay-tools/OverlayAdminTokenTemplate.js.map +1 -0
  24. package/dist/cjs/src/overlay-tools/SHIPBroadcaster.js +336 -0
  25. package/dist/cjs/src/overlay-tools/SHIPBroadcaster.js.map +1 -0
  26. package/dist/cjs/src/overlay-tools/index.js +29 -0
  27. package/dist/cjs/src/overlay-tools/index.js.map +1 -0
  28. package/dist/cjs/src/primitives/PrivateKey.js +17 -7
  29. package/dist/cjs/src/primitives/PrivateKey.js.map +1 -1
  30. package/dist/cjs/src/primitives/TransactionSignature.js +17 -7
  31. package/dist/cjs/src/primitives/TransactionSignature.js.map +1 -1
  32. package/dist/cjs/src/primitives/index.js +17 -7
  33. package/dist/cjs/src/primitives/index.js.map +1 -1
  34. package/dist/cjs/src/script/Spend.js +17 -7
  35. package/dist/cjs/src/script/Spend.js.map +1 -1
  36. package/dist/cjs/src/script/templates/PushDrop.js +218 -0
  37. package/dist/cjs/src/script/templates/PushDrop.js.map +1 -0
  38. package/dist/cjs/src/script/templates/index.js +3 -1
  39. package/dist/cjs/src/script/templates/index.js.map +1 -1
  40. package/dist/cjs/src/transaction/Beef.js +35 -6
  41. package/dist/cjs/src/transaction/Beef.js.map +1 -1
  42. package/dist/cjs/src/transaction/Transaction.js +13 -4
  43. package/dist/cjs/src/transaction/Transaction.js.map +1 -1
  44. package/dist/cjs/src/transaction/http/DefaultHttpClient.js +1 -1
  45. package/dist/cjs/src/transaction/http/DefaultHttpClient.js.map +1 -1
  46. package/dist/cjs/src/wallet/CachedKeyDeriver.js +177 -0
  47. package/dist/cjs/src/wallet/CachedKeyDeriver.js.map +1 -0
  48. package/dist/cjs/src/wallet/KeyDeriver.js +174 -0
  49. package/dist/cjs/src/wallet/KeyDeriver.js.map +1 -0
  50. package/dist/cjs/src/wallet/ProtoWallet.js +245 -0
  51. package/dist/cjs/src/wallet/ProtoWallet.js.map +1 -0
  52. package/dist/cjs/src/wallet/Wallet.interfaces.js +3 -0
  53. package/dist/cjs/src/wallet/Wallet.interfaces.js.map +1 -0
  54. package/dist/cjs/src/wallet/WalletClient.js +181 -0
  55. package/dist/cjs/src/wallet/WalletClient.js.map +1 -0
  56. package/dist/cjs/src/wallet/WalletError.js +28 -0
  57. package/dist/cjs/src/wallet/WalletError.js.map +1 -0
  58. package/dist/cjs/src/wallet/index.js +34 -0
  59. package/dist/cjs/src/wallet/index.js.map +1 -0
  60. package/dist/cjs/src/wallet/substrates/HTTPWalletWire.js +45 -0
  61. package/dist/cjs/src/wallet/substrates/HTTPWalletWire.js.map +1 -0
  62. package/dist/cjs/src/wallet/substrates/WalletWire.js +3 -0
  63. package/dist/cjs/src/wallet/substrates/WalletWire.js.map +1 -0
  64. package/dist/cjs/src/wallet/substrates/WalletWireCalls.js +36 -0
  65. package/dist/cjs/src/wallet/substrates/WalletWireCalls.js.map +1 -0
  66. package/dist/cjs/src/wallet/substrates/WalletWireProcessor.js +1821 -0
  67. package/dist/cjs/src/wallet/substrates/WalletWireProcessor.js.map +1 -0
  68. package/dist/cjs/src/wallet/substrates/WalletWireTransceiver.js +1305 -0
  69. package/dist/cjs/src/wallet/substrates/WalletWireTransceiver.js.map +1 -0
  70. package/dist/cjs/src/wallet/substrates/XDM.js +130 -0
  71. package/dist/cjs/src/wallet/substrates/XDM.js.map +1 -0
  72. package/dist/cjs/src/wallet/substrates/index.js +33 -0
  73. package/dist/cjs/src/wallet/substrates/index.js.map +1 -0
  74. package/dist/cjs/src/wallet/substrates/window.CWI.js +102 -0
  75. package/dist/cjs/src/wallet/substrates/window.CWI.js.map +1 -0
  76. package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  77. package/dist/esm/mod.js +4 -0
  78. package/dist/esm/mod.js.map +1 -1
  79. package/dist/esm/src/auth/Certificate.js +185 -0
  80. package/dist/esm/src/auth/Certificate.js.map +1 -0
  81. package/dist/esm/src/auth/index.js +2 -0
  82. package/dist/esm/src/auth/index.js.map +1 -0
  83. package/dist/esm/src/overlay-tools/LookupResolver.js +167 -0
  84. package/dist/esm/src/overlay-tools/LookupResolver.js.map +1 -0
  85. package/dist/esm/src/overlay-tools/OverlayAdminTokenTemplate.js +64 -0
  86. package/dist/esm/src/overlay-tools/OverlayAdminTokenTemplate.js.map +1 -0
  87. package/dist/esm/src/overlay-tools/SHIPBroadcaster.js +335 -0
  88. package/dist/esm/src/overlay-tools/SHIPBroadcaster.js.map +1 -0
  89. package/dist/esm/src/overlay-tools/index.js +6 -0
  90. package/dist/esm/src/overlay-tools/index.js.map +1 -0
  91. package/dist/esm/src/script/templates/PushDrop.js +215 -0
  92. package/dist/esm/src/script/templates/PushDrop.js.map +1 -0
  93. package/dist/esm/src/script/templates/index.js +1 -0
  94. package/dist/esm/src/script/templates/index.js.map +1 -1
  95. package/dist/esm/src/transaction/Beef.js +35 -6
  96. package/dist/esm/src/transaction/Beef.js.map +1 -1
  97. package/dist/esm/src/transaction/Transaction.js +13 -4
  98. package/dist/esm/src/transaction/Transaction.js.map +1 -1
  99. package/dist/esm/src/transaction/http/DefaultHttpClient.js +1 -1
  100. package/dist/esm/src/transaction/http/DefaultHttpClient.js.map +1 -1
  101. package/dist/esm/src/wallet/CachedKeyDeriver.js +174 -0
  102. package/dist/esm/src/wallet/CachedKeyDeriver.js.map +1 -0
  103. package/dist/esm/src/wallet/KeyDeriver.js +172 -0
  104. package/dist/esm/src/wallet/KeyDeriver.js.map +1 -0
  105. package/dist/esm/src/wallet/ProtoWallet.js +207 -0
  106. package/dist/esm/src/wallet/ProtoWallet.js.map +1 -0
  107. package/dist/esm/src/wallet/Wallet.interfaces.js +2 -0
  108. package/dist/esm/src/wallet/Wallet.interfaces.js.map +1 -0
  109. package/dist/esm/src/wallet/WalletClient.js +177 -0
  110. package/dist/esm/src/wallet/WalletClient.js.map +1 -0
  111. package/dist/esm/src/wallet/WalletError.js +25 -0
  112. package/dist/esm/src/wallet/WalletError.js.map +1 -0
  113. package/dist/esm/src/wallet/index.js +9 -0
  114. package/dist/esm/src/wallet/index.js.map +1 -0
  115. package/dist/esm/src/wallet/substrates/HTTPWalletWire.js +42 -0
  116. package/dist/esm/src/wallet/substrates/HTTPWalletWire.js.map +1 -0
  117. package/dist/esm/src/wallet/substrates/WalletWire.js +2 -0
  118. package/dist/esm/src/wallet/substrates/WalletWire.js.map +1 -0
  119. package/dist/esm/src/wallet/substrates/WalletWireCalls.js +34 -0
  120. package/dist/esm/src/wallet/substrates/WalletWireCalls.js.map +1 -0
  121. package/dist/esm/src/wallet/substrates/WalletWireProcessor.js +1816 -0
  122. package/dist/esm/src/wallet/substrates/WalletWireProcessor.js.map +1 -0
  123. package/dist/esm/src/wallet/substrates/WalletWireTransceiver.js +1300 -0
  124. package/dist/esm/src/wallet/substrates/WalletWireTransceiver.js.map +1 -0
  125. package/dist/esm/src/wallet/substrates/XDM.js +128 -0
  126. package/dist/esm/src/wallet/substrates/XDM.js.map +1 -0
  127. package/dist/esm/src/wallet/substrates/index.js +8 -0
  128. package/dist/esm/src/wallet/substrates/index.js.map +1 -0
  129. package/dist/esm/src/wallet/substrates/window.CWI.js +100 -0
  130. package/dist/esm/src/wallet/substrates/window.CWI.js.map +1 -0
  131. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  132. package/dist/types/mod.d.ts +4 -0
  133. package/dist/types/mod.d.ts.map +1 -1
  134. package/dist/types/src/auth/Certificate.d.ts +76 -0
  135. package/dist/types/src/auth/Certificate.d.ts.map +1 -0
  136. package/dist/types/src/auth/index.d.ts +2 -0
  137. package/dist/types/src/auth/index.d.ts.map +1 -0
  138. package/dist/types/src/overlay-tools/LookupResolver.d.ts +71 -0
  139. package/dist/types/src/overlay-tools/LookupResolver.d.ts.map +1 -0
  140. package/dist/types/src/overlay-tools/OverlayAdminTokenTemplate.d.ts +44 -0
  141. package/dist/types/src/overlay-tools/OverlayAdminTokenTemplate.d.ts.map +1 -0
  142. package/dist/types/src/overlay-tools/SHIPBroadcaster.d.ts +90 -0
  143. package/dist/types/src/overlay-tools/SHIPBroadcaster.d.ts.map +1 -0
  144. package/dist/types/src/overlay-tools/index.d.ts +6 -0
  145. package/dist/types/src/overlay-tools/index.d.ts.map +1 -0
  146. package/dist/types/src/script/templates/PushDrop.d.ts +53 -0
  147. package/dist/types/src/script/templates/PushDrop.d.ts.map +1 -0
  148. package/dist/types/src/script/templates/index.d.ts +1 -0
  149. package/dist/types/src/script/templates/index.d.ts.map +1 -1
  150. package/dist/types/src/transaction/Beef.d.ts +16 -1
  151. package/dist/types/src/transaction/Beef.d.ts.map +1 -1
  152. package/dist/types/src/transaction/Transaction.d.ts.map +1 -1
  153. package/dist/types/src/wallet/CachedKeyDeriver.d.ts +92 -0
  154. package/dist/types/src/wallet/CachedKeyDeriver.d.ts.map +1 -0
  155. package/dist/types/src/wallet/KeyDeriver.d.ts +72 -0
  156. package/dist/types/src/wallet/KeyDeriver.d.ts.map +1 -0
  157. package/dist/types/src/wallet/ProtoWallet.d.ts +415 -0
  158. package/dist/types/src/wallet/ProtoWallet.d.ts.map +1 -0
  159. package/dist/types/src/wallet/Wallet.interfaces.d.ts +996 -0
  160. package/dist/types/src/wallet/Wallet.interfaces.d.ts.map +1 -0
  161. package/dist/types/src/wallet/WalletClient.d.ts +182 -0
  162. package/dist/types/src/wallet/WalletClient.d.ts.map +1 -0
  163. package/dist/types/src/wallet/WalletError.d.ts +14 -0
  164. package/dist/types/src/wallet/WalletError.d.ts.map +1 -0
  165. package/dist/types/src/wallet/index.d.ts +9 -0
  166. package/dist/types/src/wallet/index.d.ts.map +1 -0
  167. package/dist/types/src/wallet/substrates/HTTPWalletWire.d.ts +9 -0
  168. package/dist/types/src/wallet/substrates/HTTPWalletWire.d.ts.map +1 -0
  169. package/dist/types/src/wallet/substrates/WalletWire.d.ts +7 -0
  170. package/dist/types/src/wallet/substrates/WalletWire.d.ts.map +1 -0
  171. package/dist/types/src/wallet/substrates/WalletWireCalls.d.ts +33 -0
  172. package/dist/types/src/wallet/substrates/WalletWireCalls.d.ts.map +1 -0
  173. package/dist/types/src/wallet/substrates/WalletWireProcessor.d.ts +18 -0
  174. package/dist/types/src/wallet/substrates/WalletWireProcessor.d.ts.map +1 -0
  175. package/dist/types/src/wallet/substrates/WalletWireTransceiver.d.ts +196 -0
  176. package/dist/types/src/wallet/substrates/WalletWireTransceiver.d.ts.map +1 -0
  177. package/dist/types/src/wallet/substrates/XDM.d.ts +412 -0
  178. package/dist/types/src/wallet/substrates/XDM.d.ts.map +1 -0
  179. package/dist/types/src/wallet/substrates/index.d.ts +8 -0
  180. package/dist/types/src/wallet/substrates/index.d.ts.map +1 -0
  181. package/dist/types/src/wallet/substrates/window.CWI.d.ts +410 -0
  182. package/dist/types/src/wallet/substrates/window.CWI.d.ts.map +1 -0
  183. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  184. package/dist/umd/bundle.js +1 -1
  185. package/docs/overlay-tools.md +551 -0
  186. package/docs/script.md +135 -0
  187. package/docs/totp.md +119 -0
  188. package/docs/transaction.md +25 -0
  189. package/docs/wallet-substrates.md +10 -0
  190. package/docs/wallet.md +4182 -0
  191. package/mod.ts +5 -1
  192. package/package.json +44 -3
  193. package/src/auth/Certificate.ts +233 -0
  194. package/src/auth/__tests/Certificate.test.ts +282 -0
  195. package/src/auth/index.ts +1 -0
  196. package/src/overlay-tools/LookupResolver.ts +228 -0
  197. package/src/overlay-tools/OverlayAdminTokenTemplate.ts +79 -0
  198. package/src/overlay-tools/SHIPBroadcaster.ts +405 -0
  199. package/src/overlay-tools/__tests/LookupResolver.test.ts +1403 -0
  200. package/src/overlay-tools/__tests/OverlayAdminTokenTemplate.test.ts +69 -0
  201. package/src/overlay-tools/__tests/SHIPBroadcaster.test.ts +904 -0
  202. package/src/overlay-tools/index.ts +5 -0
  203. package/src/script/templates/PushDrop.ts +246 -0
  204. package/src/script/templates/__tests/PushDrop.test.ts +158 -0
  205. package/src/script/templates/index.ts +1 -0
  206. package/src/transaction/Beef.ts +36 -6
  207. package/src/transaction/Transaction.ts +13 -4
  208. package/src/transaction/__tests/Beef.test.ts +20 -6
  209. package/src/transaction/http/DefaultHttpClient.ts +1 -1
  210. package/src/wallet/CachedKeyDeriver.ts +193 -0
  211. package/src/wallet/KeyDeriver.ts +178 -0
  212. package/src/wallet/ProtoWallet.ts +732 -0
  213. package/src/wallet/Wallet.interfaces.ts +1170 -0
  214. package/src/wallet/WalletClient.ts +201 -0
  215. package/src/wallet/WalletError.ts +27 -0
  216. package/src/wallet/__tests/CachedKeyDeriver.test.ts +322 -0
  217. package/src/wallet/__tests/KeyDeriver.test.ts +118 -0
  218. package/src/wallet/__tests/ProtoWallet.test.ts +543 -0
  219. package/src/wallet/index.ts +8 -0
  220. package/src/wallet/substrates/HTTPWalletWire.ts +47 -0
  221. package/src/wallet/substrates/WalletWire.ts +6 -0
  222. package/src/wallet/substrates/WalletWireCalls.ts +34 -0
  223. package/src/wallet/substrates/WalletWireProcessor.ts +2046 -0
  224. package/src/wallet/substrates/WalletWireTransceiver.ts +1454 -0
  225. package/src/wallet/substrates/XDM.ts +157 -0
  226. package/src/wallet/substrates/__tests/WalletWire.integration.test.ts +2194 -0
  227. package/src/wallet/substrates/__tests/XDM.test.ts +659 -0
  228. package/src/wallet/substrates/index.ts +7 -0
  229. package/src/wallet/substrates/window.CWI.ts +133 -0
package/docs/wallet.md ADDED
@@ -0,0 +1,4182 @@
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
+ constructor(message: string, code = 1, stack?: string)
1542
+ }
1543
+ ```
1544
+
1545
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
1546
+
1547
+ ---
1548
+ ### Class: ProtoWallet
1549
+
1550
+ 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.
1551
+
1552
+ ```ts
1553
+ export default class ProtoWallet implements Wallet {
1554
+ keyDeriver: KeyDeriver;
1555
+ privilegedError: string = "ProtoWallet is a single-keyring wallet, operating without context about whether its configured keyring is privileged.";
1556
+ constructor(rootKey: PrivateKey | "anyone", KeyDeriverClass = KeyDeriver)
1557
+ async createAction(args: {
1558
+ description: DescriptionString5to50Bytes;
1559
+ inputs?: Array<{
1560
+ tx?: BEEF;
1561
+ outpoint: OutpointString;
1562
+ unlockingScript?: HexString;
1563
+ unlockingScriptLength?: PositiveInteger;
1564
+ inputDescription: DescriptionString5to50Bytes;
1565
+ sequenceNumber?: PositiveIntegerOrZero;
1566
+ }>;
1567
+ outputs?: Array<{
1568
+ lockingScript: HexString;
1569
+ satoshis: SatoshiValue;
1570
+ outputDescription: DescriptionString5to50Bytes;
1571
+ basket?: BasketStringUnder300Bytes;
1572
+ customInstructions?: string;
1573
+ tags?: OutputTagStringUnder300Bytes[];
1574
+ }>;
1575
+ lockTime?: PositiveIntegerOrZero;
1576
+ version?: PositiveIntegerOrZero;
1577
+ labels?: LabelStringUnder300Bytes[];
1578
+ options?: {
1579
+ signAndProcess?: BooleanDefaultTrue;
1580
+ acceptDelayedBroadcast?: BooleanDefaultTrue;
1581
+ trustSelf?: "known";
1582
+ knownTxids?: TXIDHexString[];
1583
+ returnTXIDOnly?: BooleanDefaultFalse;
1584
+ noSend?: BooleanDefaultFalse;
1585
+ noSendChange?: OutpointString[];
1586
+ sendWith?: TXIDHexString[];
1587
+ randomizeOutputs?: BooleanDefaultTrue;
1588
+ };
1589
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1590
+ txid?: TXIDHexString;
1591
+ tx?: BEEF;
1592
+ noSendChange?: OutpointString[];
1593
+ sendWithResults?: Array<{
1594
+ txid: TXIDHexString;
1595
+ status: "unproven" | "sending" | "failed";
1596
+ }>;
1597
+ signableTransaction?: {
1598
+ tx: BEEF;
1599
+ reference: Base64String;
1600
+ };
1601
+ }>
1602
+ async signAction(args: {
1603
+ spends: Record<PositiveIntegerOrZero, {
1604
+ unlockingScript: HexString;
1605
+ sequenceNumber?: PositiveIntegerOrZero;
1606
+ }>;
1607
+ reference: Base64String;
1608
+ options?: {
1609
+ acceptDelayedBroadcast?: BooleanDefaultTrue;
1610
+ returnTXIDOnly?: BooleanDefaultFalse;
1611
+ noSend?: BooleanDefaultFalse;
1612
+ noSendChange?: OutpointString[];
1613
+ sendWith?: TXIDHexString[];
1614
+ };
1615
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1616
+ txid?: TXIDHexString;
1617
+ tx?: BEEF;
1618
+ noSendChange?: OutpointString[];
1619
+ sendWithResults?: Array<{
1620
+ txid: TXIDHexString;
1621
+ status: "unproven" | "sending" | "failed";
1622
+ }>;
1623
+ }>
1624
+ async abortAction(args: {
1625
+ reference: Base64String;
1626
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1627
+ aborted: true;
1628
+ }>
1629
+ async listActions(args: {
1630
+ labels: LabelStringUnder300Bytes[];
1631
+ labelQueryMode?: "any" | "all";
1632
+ includeLabels?: BooleanDefaultFalse;
1633
+ includeInputs?: BooleanDefaultFalse;
1634
+ includeInputSourceLockingScripts?: BooleanDefaultFalse;
1635
+ includeInputUnlockingScripts?: BooleanDefaultFalse;
1636
+ includeOutputs?: BooleanDefaultFalse;
1637
+ includeOutputLockingScripts?: BooleanDefaultFalse;
1638
+ limit?: PositiveIntegerDefault10Max10000;
1639
+ offset?: PositiveIntegerOrZero;
1640
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1641
+ totalActions: PositiveIntegerOrZero;
1642
+ actions: Array<{
1643
+ txid: TXIDHexString;
1644
+ satoshis: SatoshiValue;
1645
+ status: "completed" | "unprocessed" | "sending" | "unproven" | "unsigned" | "nosend" | "nonfinal";
1646
+ isOutgoing: boolean;
1647
+ description: DescriptionString5to50Bytes;
1648
+ labels?: LabelStringUnder300Bytes[];
1649
+ version: PositiveIntegerOrZero;
1650
+ lockTime: PositiveIntegerOrZero;
1651
+ inputs?: Array<{
1652
+ sourceOutpoint: OutpointString;
1653
+ sourceSatoshis: SatoshiValue;
1654
+ sourceLockingScript?: HexString;
1655
+ unlockingScript?: HexString;
1656
+ inputDescription: DescriptionString5to50Bytes;
1657
+ sequenceNumber: PositiveIntegerOrZero;
1658
+ }>;
1659
+ outputs?: Array<{
1660
+ outputIndex: PositiveIntegerOrZero;
1661
+ satoshis: SatoshiValue;
1662
+ lockingScript?: HexString;
1663
+ spendable: boolean;
1664
+ outputDescription: DescriptionString5to50Bytes;
1665
+ basket: BasketStringUnder300Bytes;
1666
+ tags: OutputTagStringUnder300Bytes[];
1667
+ customInstructions?: string;
1668
+ }>;
1669
+ }>;
1670
+ }>
1671
+ async internalizeAction(args: {
1672
+ tx: BEEF;
1673
+ outputs: Array<{
1674
+ outputIndex: PositiveIntegerOrZero;
1675
+ protocol: "wallet payment" | "basket insertion";
1676
+ paymentRemittance?: {
1677
+ derivationPrefix: Base64String;
1678
+ derivationSuffix: Base64String;
1679
+ senderIdentityKey: PubKeyHex;
1680
+ };
1681
+ insertionRemittance?: {
1682
+ basket: BasketStringUnder300Bytes;
1683
+ customInstructions?: string;
1684
+ tags?: OutputTagStringUnder300Bytes[];
1685
+ };
1686
+ }>;
1687
+ description: DescriptionString5to50Bytes;
1688
+ labels?: LabelStringUnder300Bytes[];
1689
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1690
+ accepted: true;
1691
+ }>
1692
+ async listOutputs(args: {
1693
+ basket: BasketStringUnder300Bytes;
1694
+ tags?: OutputTagStringUnder300Bytes[];
1695
+ tagQueryMode?: "all" | "any";
1696
+ include?: "locking scripts" | "entire transactions";
1697
+ includeCustomInstructions?: BooleanDefaultFalse;
1698
+ includeTags?: BooleanDefaultFalse;
1699
+ includeLabels?: BooleanDefaultFalse;
1700
+ limit?: PositiveIntegerDefault10Max10000;
1701
+ offset?: PositiveIntegerOrZero;
1702
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1703
+ totalOutputs: PositiveIntegerOrZero;
1704
+ outputs: Array<{
1705
+ outpoint: OutpointString;
1706
+ satoshis: SatoshiValue;
1707
+ lockingScript?: HexString;
1708
+ tx?: BEEF;
1709
+ spendable: true;
1710
+ customInstructions?: string;
1711
+ tags?: OutputTagStringUnder300Bytes[];
1712
+ labels?: LabelStringUnder300Bytes[];
1713
+ }>;
1714
+ }>
1715
+ async relinquishOutput(args: {
1716
+ basket: BasketStringUnder300Bytes;
1717
+ output: OutpointString;
1718
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1719
+ relinquished: true;
1720
+ }>
1721
+ async getPublicKey(args: {
1722
+ identityKey?: true;
1723
+ protocolID?: [
1724
+ 0 | 1 | 2,
1725
+ ProtocolString5To400Bytes
1726
+ ];
1727
+ keyID?: KeyIDStringUnder800Bytes;
1728
+ privileged?: BooleanDefaultFalse;
1729
+ privilegedReason?: DescriptionString5to50Bytes;
1730
+ counterparty?: PubKeyHex | "self" | "anyone";
1731
+ forSelf?: BooleanDefaultFalse;
1732
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1733
+ publicKey: PubKeyHex;
1734
+ }>
1735
+ async revealCounterpartyKeyLinkage(args: {
1736
+ counterparty: PubKeyHex;
1737
+ verifier: PubKeyHex;
1738
+ privilegedReason?: DescriptionString5to50Bytes;
1739
+ privileged?: BooleanDefaultFalse;
1740
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1741
+ prover: PubKeyHex;
1742
+ verifier: PubKeyHex;
1743
+ counterparty: PubKeyHex;
1744
+ revelationTime: ISOTimestampString;
1745
+ encryptedLinkage: Byte[];
1746
+ encryptedLinkageProof: Byte[];
1747
+ }>
1748
+ async revealSpecificKeyLinkage(args: {
1749
+ counterparty: PubKeyHex;
1750
+ verifier: PubKeyHex;
1751
+ protocolID: [
1752
+ 0 | 1 | 2,
1753
+ ProtocolString5To400Bytes
1754
+ ];
1755
+ keyID: KeyIDStringUnder800Bytes;
1756
+ privilegedReason?: DescriptionString5to50Bytes;
1757
+ privileged?: BooleanDefaultFalse;
1758
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1759
+ prover: PubKeyHex;
1760
+ verifier: PubKeyHex;
1761
+ counterparty: PubKeyHex;
1762
+ protocolID: [
1763
+ 0 | 1 | 2,
1764
+ ProtocolString5To400Bytes
1765
+ ];
1766
+ keyID: KeyIDStringUnder800Bytes;
1767
+ encryptedLinkage: Byte[];
1768
+ encryptedLinkageProof: Byte[];
1769
+ proofType: Byte;
1770
+ }>
1771
+ async encrypt(args: {
1772
+ plaintext: Byte[];
1773
+ protocolID: [
1774
+ 0 | 1 | 2,
1775
+ ProtocolString5To400Bytes
1776
+ ];
1777
+ keyID: KeyIDStringUnder800Bytes;
1778
+ privilegedReason?: DescriptionString5to50Bytes;
1779
+ counterparty?: PubKeyHex | "self" | "anyone";
1780
+ privileged?: BooleanDefaultFalse;
1781
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1782
+ ciphertext: Byte[];
1783
+ }>
1784
+ async decrypt(args: {
1785
+ ciphertext: Byte[];
1786
+ protocolID: [
1787
+ 0 | 1 | 2,
1788
+ ProtocolString5To400Bytes
1789
+ ];
1790
+ keyID: KeyIDStringUnder800Bytes;
1791
+ privilegedReason?: DescriptionString5to50Bytes;
1792
+ counterparty?: PubKeyHex | "self" | "anyone";
1793
+ privileged?: BooleanDefaultFalse;
1794
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1795
+ plaintext: Byte[];
1796
+ }>
1797
+ async createHmac(args: {
1798
+ data: Byte[];
1799
+ protocolID: [
1800
+ 0 | 1 | 2,
1801
+ ProtocolString5To400Bytes
1802
+ ];
1803
+ keyID: KeyIDStringUnder800Bytes;
1804
+ privilegedReason?: DescriptionString5to50Bytes;
1805
+ counterparty?: PubKeyHex | "self" | "anyone";
1806
+ privileged?: BooleanDefaultFalse;
1807
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1808
+ hmac: Byte[];
1809
+ }>
1810
+ async verifyHmac(args: {
1811
+ data: Byte[];
1812
+ hmac: Byte[];
1813
+ protocolID: [
1814
+ 0 | 1 | 2,
1815
+ ProtocolString5To400Bytes
1816
+ ];
1817
+ keyID: KeyIDStringUnder800Bytes;
1818
+ privilegedReason?: DescriptionString5to50Bytes;
1819
+ counterparty?: PubKeyHex | "self" | "anyone";
1820
+ privileged?: BooleanDefaultFalse;
1821
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1822
+ valid: true;
1823
+ }>
1824
+ async createSignature(args: {
1825
+ data?: Byte[];
1826
+ hashToDirectlySign?: Byte[];
1827
+ protocolID: [
1828
+ 0 | 1 | 2,
1829
+ ProtocolString5To400Bytes
1830
+ ];
1831
+ keyID: KeyIDStringUnder800Bytes;
1832
+ privilegedReason?: DescriptionString5to50Bytes;
1833
+ counterparty?: PubKeyHex | "self" | "anyone";
1834
+ privileged?: BooleanDefaultFalse;
1835
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1836
+ signature: Byte[];
1837
+ }>
1838
+ async verifySignature(args: {
1839
+ data?: Byte[];
1840
+ hashToDirectlyVerify?: Byte[];
1841
+ signature: Byte[];
1842
+ protocolID: [
1843
+ 0 | 1 | 2,
1844
+ ProtocolString5To400Bytes
1845
+ ];
1846
+ keyID: KeyIDStringUnder800Bytes;
1847
+ privilegedReason?: DescriptionString5to50Bytes;
1848
+ counterparty?: PubKeyHex | "self" | "anyone";
1849
+ forSelf?: BooleanDefaultFalse;
1850
+ privileged?: BooleanDefaultFalse;
1851
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1852
+ valid: true;
1853
+ }>
1854
+ async acquireCertificate(args: {
1855
+ type: Base64String;
1856
+ certifier: PubKeyHex;
1857
+ acquisitionProtocol: "direct" | "issuance";
1858
+ fields: Record<CertificateFieldNameUnder50Bytes, string>;
1859
+ serialNumber?: Base64String;
1860
+ revocationOutpoint?: OutpointString;
1861
+ signature?: HexString;
1862
+ certifierUrl?: string;
1863
+ keyringRevealer?: PubKeyHex | "certifier";
1864
+ keyringForSubject?: Record<CertificateFieldNameUnder50Bytes, Base64String>;
1865
+ privileged?: BooleanDefaultFalse;
1866
+ privilegedReason?: DescriptionString5to50Bytes;
1867
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1868
+ type: Base64String;
1869
+ subject: PubKeyHex;
1870
+ serialNumber: Base64String;
1871
+ certifier: PubKeyHex;
1872
+ revocationOutpoint: OutpointString;
1873
+ signature: HexString;
1874
+ fields: Record<CertificateFieldNameUnder50Bytes, string>;
1875
+ }>
1876
+ async listCertificates(args: {
1877
+ certifiers: PubKeyHex[];
1878
+ types: Base64String[];
1879
+ limit?: PositiveIntegerDefault10Max10000;
1880
+ offset?: PositiveIntegerOrZero;
1881
+ privileged?: BooleanDefaultFalse;
1882
+ privilegedReason?: DescriptionString5to50Bytes;
1883
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1884
+ totalCertificates: PositiveIntegerOrZero;
1885
+ certificates: Array<{
1886
+ type: Base64String;
1887
+ subject: PubKeyHex;
1888
+ serialNumber: Base64String;
1889
+ certifier: PubKeyHex;
1890
+ revocationOutpoint: OutpointString;
1891
+ signature: HexString;
1892
+ fields: Record<CertificateFieldNameUnder50Bytes, string>;
1893
+ }>;
1894
+ }>
1895
+ async proveCertificate(args: {
1896
+ certificate: {
1897
+ type: Base64String;
1898
+ subject: PubKeyHex;
1899
+ serialNumber: Base64String;
1900
+ certifier: PubKeyHex;
1901
+ revocationOutpoint: OutpointString;
1902
+ signature: HexString;
1903
+ fields: Record<CertificateFieldNameUnder50Bytes, string>;
1904
+ };
1905
+ fieldsToReveal: CertificateFieldNameUnder50Bytes[];
1906
+ verifier: PubKeyHex;
1907
+ privileged?: BooleanDefaultFalse;
1908
+ privilegedReason?: DescriptionString5to50Bytes;
1909
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1910
+ keyringForVerifier: Record<CertificateFieldNameUnder50Bytes, Base64String>;
1911
+ }>
1912
+ async relinquishCertificate(args: {
1913
+ type: Base64String;
1914
+ serialNumber: Base64String;
1915
+ certifier: PubKeyHex;
1916
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1917
+ relinquished: true;
1918
+ }>
1919
+ async discoverByIdentityKey(args: {
1920
+ identityKey: PubKeyHex;
1921
+ limit?: PositiveIntegerDefault10Max10000;
1922
+ offset?: PositiveIntegerOrZero;
1923
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1924
+ totalCertificates: PositiveIntegerOrZero;
1925
+ certificates: Array<{
1926
+ type: Base64String;
1927
+ subject: PubKeyHex;
1928
+ serialNumber: Base64String;
1929
+ certifier: PubKeyHex;
1930
+ revocationOutpoint: OutpointString;
1931
+ signature: HexString;
1932
+ fields: Record<CertificateFieldNameUnder50Bytes, Base64String>;
1933
+ certifierInfo: {
1934
+ name: EntityNameStringMax100Bytes;
1935
+ iconUrl: EntityIconURLStringMax500Bytes;
1936
+ description: DescriptionString5to50Bytes;
1937
+ trust: PositiveIntegerMax10;
1938
+ };
1939
+ publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
1940
+ decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
1941
+ }>;
1942
+ }>
1943
+ async discoverByAttributes(args: {
1944
+ attributes: Record<CertificateFieldNameUnder50Bytes, string>;
1945
+ limit?: PositiveIntegerDefault10Max10000;
1946
+ offset?: PositiveIntegerOrZero;
1947
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1948
+ totalCertificates: PositiveIntegerOrZero;
1949
+ certificates: Array<{
1950
+ type: Base64String;
1951
+ subject: PubKeyHex;
1952
+ serialNumber: Base64String;
1953
+ certifier: PubKeyHex;
1954
+ revocationOutpoint: OutpointString;
1955
+ signature: HexString;
1956
+ fields: Record<CertificateFieldNameUnder50Bytes, Base64String>;
1957
+ certifierInfo: {
1958
+ name: EntityNameStringMax100Bytes;
1959
+ iconUrl: EntityIconURLStringMax500Bytes;
1960
+ description: DescriptionString5to50Bytes;
1961
+ trust: PositiveIntegerMax10;
1962
+ };
1963
+ publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
1964
+ decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
1965
+ }>;
1966
+ }>
1967
+ async isAuthenticated(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1968
+ authenticated: boolean;
1969
+ }>
1970
+ async waitForAuthentication(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1971
+ authenticated: true;
1972
+ }>
1973
+ async getHeight(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1974
+ height: PositiveInteger;
1975
+ }>
1976
+ async getHeaderForHeight(args: {
1977
+ height: PositiveInteger;
1978
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1979
+ header: HexString;
1980
+ }>
1981
+ async getNetwork(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1982
+ network: "mainnet" | "testnet";
1983
+ }>
1984
+ async getVersion(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
1985
+ version: VersionString7To30Bytes;
1986
+ }>
1987
+ }
1988
+ ```
1989
+
1990
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
1991
+
1992
+ ---
1993
+ ### Class: WindowCWISubstrate
1994
+
1995
+ Facilitates wallet operations over the window.CWI interface.
1996
+
1997
+ ```ts
1998
+ export default class WindowCWISubstrate implements Wallet {
1999
+ constructor()
2000
+ async createAction(args: {
2001
+ description: DescriptionString5to50Bytes;
2002
+ inputs?: Array<{
2003
+ tx?: BEEF;
2004
+ outpoint: OutpointString;
2005
+ unlockingScript?: HexString;
2006
+ unlockingScriptLength?: PositiveInteger;
2007
+ inputDescription: DescriptionString5to50Bytes;
2008
+ sequenceNumber?: PositiveIntegerOrZero;
2009
+ }>;
2010
+ outputs?: Array<{
2011
+ lockingScript: HexString;
2012
+ satoshis: SatoshiValue;
2013
+ outputDescription: DescriptionString5to50Bytes;
2014
+ basket?: BasketStringUnder300Bytes;
2015
+ customInstructions?: string;
2016
+ tags?: OutputTagStringUnder300Bytes[];
2017
+ }>;
2018
+ lockTime?: PositiveIntegerOrZero;
2019
+ version?: PositiveIntegerOrZero;
2020
+ labels?: LabelStringUnder300Bytes[];
2021
+ options?: {
2022
+ signAndProcess?: BooleanDefaultTrue;
2023
+ acceptDelayedBroadcast?: BooleanDefaultTrue;
2024
+ trustSelf?: "known";
2025
+ knownTxids?: TXIDHexString[];
2026
+ returnTXIDOnly?: BooleanDefaultFalse;
2027
+ noSend?: BooleanDefaultFalse;
2028
+ noSendChange?: OutpointString[];
2029
+ sendWith?: TXIDHexString[];
2030
+ };
2031
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2032
+ txid?: TXIDHexString;
2033
+ tx?: BEEF;
2034
+ noSendChange?: OutpointString[];
2035
+ sendWithResults?: Array<{
2036
+ txid: TXIDHexString;
2037
+ status: "unproven" | "sending" | "failed";
2038
+ }>;
2039
+ signableTransaction?: {
2040
+ tx: BEEF;
2041
+ reference: Base64String;
2042
+ };
2043
+ }>
2044
+ async signAction(args: {
2045
+ spends: Record<PositiveIntegerOrZero, {
2046
+ unlockingScript: HexString;
2047
+ sequenceNumber?: PositiveIntegerOrZero;
2048
+ }>;
2049
+ reference: Base64String;
2050
+ options?: {
2051
+ acceptDelayedBroadcast?: BooleanDefaultTrue;
2052
+ returnTXIDOnly?: BooleanDefaultFalse;
2053
+ noSend?: BooleanDefaultFalse;
2054
+ noSendChange?: OutpointString[];
2055
+ sendWith: TXIDHexString[];
2056
+ };
2057
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2058
+ txid?: TXIDHexString;
2059
+ tx?: BEEF;
2060
+ noSendChange?: OutpointString[];
2061
+ sendWithResults?: Array<{
2062
+ txid: TXIDHexString;
2063
+ status: "unproven" | "sending" | "failed";
2064
+ }>;
2065
+ }>
2066
+ async abortAction(args: {
2067
+ reference: Base64String;
2068
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2069
+ aborted: true;
2070
+ }>
2071
+ async listActions(args: {
2072
+ labels: LabelStringUnder300Bytes[];
2073
+ labelQueryMode?: "any" | "all";
2074
+ includeLabels?: BooleanDefaultFalse;
2075
+ includeInputs?: BooleanDefaultFalse;
2076
+ includeInputSourceLockingScripts?: BooleanDefaultFalse;
2077
+ includeInputUnlockingScripts?: BooleanDefaultFalse;
2078
+ includeOutputs?: BooleanDefaultFalse;
2079
+ includeOutputLockingScripts?: BooleanDefaultFalse;
2080
+ limit?: PositiveIntegerDefault10Max10000;
2081
+ offset?: PositiveIntegerOrZero;
2082
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2083
+ totalActions: PositiveIntegerOrZero;
2084
+ actions: Array<{
2085
+ txid: TXIDHexString;
2086
+ satoshis: SatoshiValue;
2087
+ status: "completed" | "unprocessed" | "sending" | "unproven" | "unsigned" | "nosend" | "nonfinal";
2088
+ isOutgoing: boolean;
2089
+ description: DescriptionString5to50Bytes;
2090
+ labels?: LabelStringUnder300Bytes[];
2091
+ version: PositiveIntegerOrZero;
2092
+ lockTime: PositiveIntegerOrZero;
2093
+ inputs?: Array<{
2094
+ sourceOutpoint: OutpointString;
2095
+ sourceSatoshis: SatoshiValue;
2096
+ sourceLockingScript?: HexString;
2097
+ unlockingScript?: HexString;
2098
+ inputDescription: DescriptionString5to50Bytes;
2099
+ sequenceNumber: PositiveIntegerOrZero;
2100
+ }>;
2101
+ outputs?: Array<{
2102
+ outputIndex: PositiveIntegerOrZero;
2103
+ satoshis: SatoshiValue;
2104
+ lockingScript?: HexString;
2105
+ spendable: boolean;
2106
+ outputDescription: DescriptionString5to50Bytes;
2107
+ basket: BasketStringUnder300Bytes;
2108
+ tags: OutputTagStringUnder300Bytes[];
2109
+ customInstructions?: string;
2110
+ }>;
2111
+ }>;
2112
+ }>
2113
+ async internalizeAction(args: {
2114
+ tx: BEEF;
2115
+ outputs: Array<{
2116
+ outputIndex: PositiveIntegerOrZero;
2117
+ protocol: "wallet payment" | "basket insertion";
2118
+ paymentRemittance?: {
2119
+ derivationPrefix: Base64String;
2120
+ derivationSuffix: Base64String;
2121
+ senderIdentityKey: PubKeyHex;
2122
+ };
2123
+ insertionRemittance?: {
2124
+ basket: BasketStringUnder300Bytes;
2125
+ customInstructions?: string;
2126
+ tags?: OutputTagStringUnder300Bytes[];
2127
+ };
2128
+ }>;
2129
+ description: DescriptionString5to50Bytes;
2130
+ labels?: LabelStringUnder300Bytes[];
2131
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2132
+ accepted: true;
2133
+ }>
2134
+ async listOutputs(args: {
2135
+ basket: BasketStringUnder300Bytes;
2136
+ tags?: OutputTagStringUnder300Bytes[];
2137
+ tagQueryMode?: "all" | "any";
2138
+ include?: "locking scripts" | "entire transactions";
2139
+ includeCustomInstructions?: BooleanDefaultFalse;
2140
+ includeTags?: BooleanDefaultFalse;
2141
+ includeLabels?: BooleanDefaultFalse;
2142
+ limit?: PositiveIntegerDefault10Max10000;
2143
+ offset?: PositiveIntegerOrZero;
2144
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2145
+ totalOutputs: PositiveIntegerOrZero;
2146
+ outputs: Array<{
2147
+ outpoint: OutpointString;
2148
+ satoshis: SatoshiValue;
2149
+ lockingScript?: HexString;
2150
+ tx?: BEEF;
2151
+ spendable: true;
2152
+ customInstructions?: string;
2153
+ tags?: OutputTagStringUnder300Bytes[];
2154
+ labels?: LabelStringUnder300Bytes[];
2155
+ }>;
2156
+ }>
2157
+ async relinquishOutput(args: {
2158
+ basket: BasketStringUnder300Bytes;
2159
+ output: OutpointString;
2160
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2161
+ relinquished: true;
2162
+ }>
2163
+ async getPublicKey(args: {
2164
+ identityKey?: true;
2165
+ protocolID?: [
2166
+ 0 | 1 | 2,
2167
+ ProtocolString5To400Bytes
2168
+ ];
2169
+ keyID?: KeyIDStringUnder800Bytes;
2170
+ privileged?: BooleanDefaultFalse;
2171
+ privilegedReason?: DescriptionString5to50Bytes;
2172
+ counterparty?: PubKeyHex | "self" | "anyone";
2173
+ forSelf?: BooleanDefaultFalse;
2174
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2175
+ publicKey: PubKeyHex;
2176
+ }>
2177
+ async revealCounterpartyKeyLinkage(args: {
2178
+ counterparty: PubKeyHex;
2179
+ verifier: PubKeyHex;
2180
+ privilegedReason?: DescriptionString5to50Bytes;
2181
+ privileged?: BooleanDefaultFalse;
2182
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2183
+ prover: PubKeyHex;
2184
+ verifier: PubKeyHex;
2185
+ counterparty: PubKeyHex;
2186
+ revelationTime: ISOTimestampString;
2187
+ encryptedLinkage: Byte[];
2188
+ encryptedLinkageProof: Byte[];
2189
+ }>
2190
+ async revealSpecificKeyLinkage(args: {
2191
+ counterparty: PubKeyHex;
2192
+ verifier: PubKeyHex;
2193
+ protocolID: [
2194
+ 0 | 1 | 2,
2195
+ ProtocolString5To400Bytes
2196
+ ];
2197
+ keyID: KeyIDStringUnder800Bytes;
2198
+ privilegedReason?: DescriptionString5to50Bytes;
2199
+ privileged?: BooleanDefaultFalse;
2200
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2201
+ prover: PubKeyHex;
2202
+ verifier: PubKeyHex;
2203
+ counterparty: PubKeyHex;
2204
+ protocolID: [
2205
+ 0 | 1 | 2,
2206
+ ProtocolString5To400Bytes
2207
+ ];
2208
+ keyID: KeyIDStringUnder800Bytes;
2209
+ encryptedLinkage: Byte[];
2210
+ encryptedLinkageProof: Byte[];
2211
+ proofType: Byte;
2212
+ }>
2213
+ async encrypt(args: {
2214
+ plaintext: Byte[];
2215
+ protocolID: [
2216
+ 0 | 1 | 2,
2217
+ ProtocolString5To400Bytes
2218
+ ];
2219
+ keyID: KeyIDStringUnder800Bytes;
2220
+ privilegedReason?: DescriptionString5to50Bytes;
2221
+ counterparty?: PubKeyHex | "self" | "anyone";
2222
+ privileged?: BooleanDefaultFalse;
2223
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2224
+ ciphertext: Byte[];
2225
+ }>
2226
+ async decrypt(args: {
2227
+ ciphertext: Byte[];
2228
+ protocolID: [
2229
+ 0 | 1 | 2,
2230
+ ProtocolString5To400Bytes
2231
+ ];
2232
+ keyID: KeyIDStringUnder800Bytes;
2233
+ privilegedReason?: DescriptionString5to50Bytes;
2234
+ counterparty?: PubKeyHex | "self" | "anyone";
2235
+ privileged?: BooleanDefaultFalse;
2236
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2237
+ plaintext: Byte[];
2238
+ }>
2239
+ async createHmac(args: {
2240
+ data: Byte[];
2241
+ protocolID: [
2242
+ 0 | 1 | 2,
2243
+ ProtocolString5To400Bytes
2244
+ ];
2245
+ keyID: KeyIDStringUnder800Bytes;
2246
+ privilegedReason?: DescriptionString5to50Bytes;
2247
+ counterparty?: PubKeyHex | "self" | "anyone";
2248
+ privileged?: BooleanDefaultFalse;
2249
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2250
+ hmac: Byte[];
2251
+ }>
2252
+ async verifyHmac(args: {
2253
+ data: Byte[];
2254
+ hmac: Byte[];
2255
+ protocolID: [
2256
+ 0 | 1 | 2,
2257
+ ProtocolString5To400Bytes
2258
+ ];
2259
+ keyID: KeyIDStringUnder800Bytes;
2260
+ privilegedReason?: DescriptionString5to50Bytes;
2261
+ counterparty?: PubKeyHex | "self" | "anyone";
2262
+ privileged?: BooleanDefaultFalse;
2263
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2264
+ valid: true;
2265
+ }>
2266
+ async createSignature(args: {
2267
+ data?: Byte[];
2268
+ hashToDirectlySign?: Byte[];
2269
+ protocolID: [
2270
+ 0 | 1 | 2,
2271
+ ProtocolString5To400Bytes
2272
+ ];
2273
+ keyID: KeyIDStringUnder800Bytes;
2274
+ privilegedReason?: DescriptionString5to50Bytes;
2275
+ counterparty?: PubKeyHex | "self" | "anyone";
2276
+ privileged?: BooleanDefaultFalse;
2277
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2278
+ signature: Byte[];
2279
+ }>
2280
+ async verifySignature(args: {
2281
+ data?: Byte[];
2282
+ hashToDirectlyVerify?: Byte[];
2283
+ signature: Byte[];
2284
+ protocolID: [
2285
+ 0 | 1 | 2,
2286
+ ProtocolString5To400Bytes
2287
+ ];
2288
+ keyID: KeyIDStringUnder800Bytes;
2289
+ privilegedReason?: DescriptionString5to50Bytes;
2290
+ counterparty?: PubKeyHex | "self" | "anyone";
2291
+ forSelf?: BooleanDefaultFalse;
2292
+ privileged?: BooleanDefaultFalse;
2293
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2294
+ valid: true;
2295
+ }>
2296
+ async acquireCertificate(args: {
2297
+ type: Base64String;
2298
+ subject: PubKeyHex;
2299
+ serialNumber: Base64String;
2300
+ revocationOutpoint: OutpointString;
2301
+ signature: HexString;
2302
+ fields: Record<CertificateFieldNameUnder50Bytes, string>;
2303
+ certifier: PubKeyHex;
2304
+ keyringRevealer: PubKeyHex | "certifier";
2305
+ keyringForSubject: Record<CertificateFieldNameUnder50Bytes, Base64String>;
2306
+ acquisitionProtocol: "direct" | "issuance";
2307
+ certifierUrl?: string;
2308
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2309
+ type: Base64String;
2310
+ subject: PubKeyHex;
2311
+ serialNumber: Base64String;
2312
+ certifier: PubKeyHex;
2313
+ revocationOutpoint: OutpointString;
2314
+ signature: HexString;
2315
+ fields: Record<CertificateFieldNameUnder50Bytes, string>;
2316
+ }>
2317
+ async listCertificates(args: {
2318
+ certifiers: PubKeyHex[];
2319
+ types: Base64String[];
2320
+ limit?: PositiveIntegerDefault10Max10000;
2321
+ offset?: PositiveIntegerOrZero;
2322
+ privileged?: BooleanDefaultFalse;
2323
+ privilegedReason?: DescriptionString5to50Bytes;
2324
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2325
+ totalCertificates: PositiveIntegerOrZero;
2326
+ certificates: Array<{
2327
+ type: Base64String;
2328
+ subject: PubKeyHex;
2329
+ serialNumber: Base64String;
2330
+ certifier: PubKeyHex;
2331
+ revocationOutpoint: OutpointString;
2332
+ signature: HexString;
2333
+ fields: Record<CertificateFieldNameUnder50Bytes, string>;
2334
+ }>;
2335
+ }>
2336
+ async proveCertificate(args: {
2337
+ certificate: {
2338
+ type: Base64String;
2339
+ subject: PubKeyHex;
2340
+ serialNumber: Base64String;
2341
+ certifier: PubKeyHex;
2342
+ revocationOutpoint: OutpointString;
2343
+ signature: HexString;
2344
+ fields: Record<CertificateFieldNameUnder50Bytes, string>;
2345
+ };
2346
+ fieldsToReveal: CertificateFieldNameUnder50Bytes[];
2347
+ verifier: PubKeyHex;
2348
+ privileged?: BooleanDefaultFalse;
2349
+ privilegedReason?: DescriptionString5to50Bytes;
2350
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2351
+ keyringForVerifier: Record<CertificateFieldNameUnder50Bytes, Base64String>;
2352
+ }>
2353
+ async relinquishCertificate(args: {
2354
+ type: Base64String;
2355
+ serialNumber: Base64String;
2356
+ certifier: PubKeyHex;
2357
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2358
+ relinquished: true;
2359
+ }>
2360
+ async discoverByIdentityKey(args: {
2361
+ identityKey: PubKeyHex;
2362
+ limit?: PositiveIntegerDefault10Max10000;
2363
+ offset?: PositiveIntegerOrZero;
2364
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2365
+ totalCertificates: PositiveIntegerOrZero;
2366
+ certificates: Array<{
2367
+ type: Base64String;
2368
+ subject: PubKeyHex;
2369
+ serialNumber: Base64String;
2370
+ certifier: PubKeyHex;
2371
+ revocationOutpoint: OutpointString;
2372
+ signature: HexString;
2373
+ fields: Record<CertificateFieldNameUnder50Bytes, Base64String>;
2374
+ certifierInfo: {
2375
+ name: EntityNameStringMax100Bytes;
2376
+ iconUrl: EntityIconURLStringMax500Bytes;
2377
+ description: DescriptionString5to50Bytes;
2378
+ trust: PositiveIntegerMax10;
2379
+ };
2380
+ publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
2381
+ decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
2382
+ }>;
2383
+ }>
2384
+ async discoverByAttributes(args: {
2385
+ attributes: Record<CertificateFieldNameUnder50Bytes, string>;
2386
+ limit?: PositiveIntegerDefault10Max10000;
2387
+ offset?: PositiveIntegerOrZero;
2388
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2389
+ totalCertificates: PositiveIntegerOrZero;
2390
+ certificates: Array<{
2391
+ type: Base64String;
2392
+ subject: PubKeyHex;
2393
+ serialNumber: Base64String;
2394
+ certifier: PubKeyHex;
2395
+ revocationOutpoint: OutpointString;
2396
+ signature: HexString;
2397
+ fields: Record<CertificateFieldNameUnder50Bytes, Base64String>;
2398
+ certifierInfo: {
2399
+ name: EntityNameStringMax100Bytes;
2400
+ iconUrl: EntityIconURLStringMax500Bytes;
2401
+ description: DescriptionString5to50Bytes;
2402
+ trust: PositiveIntegerMax10;
2403
+ };
2404
+ publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
2405
+ decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
2406
+ }>;
2407
+ }>
2408
+ async isAuthenticated(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2409
+ authenticated: boolean;
2410
+ }>
2411
+ async waitForAuthentication(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2412
+ authenticated: true;
2413
+ }>
2414
+ async getHeight(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2415
+ height: PositiveInteger;
2416
+ }>
2417
+ async getHeaderForHeight(args: {
2418
+ height: PositiveInteger;
2419
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2420
+ header: HexString;
2421
+ }>
2422
+ async getNetwork(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2423
+ network: "mainnet" | "testnet";
2424
+ }>
2425
+ async getVersion(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2426
+ version: VersionString7To30Bytes;
2427
+ }>
2428
+ }
2429
+ ```
2430
+
2431
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
2432
+
2433
+ ---
2434
+ ### Class: XDMSubstrate
2435
+
2436
+ Facilitates wallet operations over cross-document messaging.
2437
+
2438
+ ```ts
2439
+ export default class XDMSubstrate implements Wallet {
2440
+ constructor()
2441
+ async invoke(call, args): Promise<any>
2442
+ async createAction(args: {
2443
+ description: DescriptionString5to50Bytes;
2444
+ inputs?: Array<{
2445
+ tx?: BEEF;
2446
+ outpoint: OutpointString;
2447
+ unlockingScript?: HexString;
2448
+ unlockingScriptLength?: PositiveInteger;
2449
+ inputDescription: DescriptionString5to50Bytes;
2450
+ sequenceNumber?: PositiveIntegerOrZero;
2451
+ }>;
2452
+ outputs?: Array<{
2453
+ lockingScript: HexString;
2454
+ satoshis: SatoshiValue;
2455
+ outputDescription: DescriptionString5to50Bytes;
2456
+ basket?: BasketStringUnder300Bytes;
2457
+ customInstructions?: string;
2458
+ tags?: OutputTagStringUnder300Bytes[];
2459
+ }>;
2460
+ lockTime?: PositiveIntegerOrZero;
2461
+ version?: PositiveIntegerOrZero;
2462
+ labels?: LabelStringUnder300Bytes[];
2463
+ options?: {
2464
+ signAndProcess?: BooleanDefaultTrue;
2465
+ acceptDelayedBroadcast?: BooleanDefaultTrue;
2466
+ trustSelf?: "known";
2467
+ knownTxids?: TXIDHexString[];
2468
+ returnTXIDOnly?: BooleanDefaultFalse;
2469
+ noSend?: BooleanDefaultFalse;
2470
+ noSendChange?: OutpointString[];
2471
+ sendWith?: TXIDHexString[];
2472
+ };
2473
+ }): Promise<{
2474
+ txid?: TXIDHexString;
2475
+ tx?: BEEF;
2476
+ noSendChange?: OutpointString[];
2477
+ sendWithResults?: Array<{
2478
+ txid: TXIDHexString;
2479
+ status: "unproven" | "sending" | "failed";
2480
+ }>;
2481
+ signableTransaction?: {
2482
+ tx: BEEF;
2483
+ reference: Base64String;
2484
+ };
2485
+ }>
2486
+ async signAction(args: {
2487
+ spends: Record<PositiveIntegerOrZero, {
2488
+ unlockingScript: HexString;
2489
+ sequenceNumber?: PositiveIntegerOrZero;
2490
+ }>;
2491
+ reference: Base64String;
2492
+ options?: {
2493
+ acceptDelayedBroadcast?: BooleanDefaultTrue;
2494
+ returnTXIDOnly?: BooleanDefaultFalse;
2495
+ noSend?: BooleanDefaultFalse;
2496
+ noSendChange?: OutpointString[];
2497
+ sendWith: TXIDHexString[];
2498
+ };
2499
+ }): Promise<{
2500
+ txid?: TXIDHexString;
2501
+ tx?: BEEF;
2502
+ noSendChange?: OutpointString[];
2503
+ sendWithResults?: Array<{
2504
+ txid: TXIDHexString;
2505
+ status: "unproven" | "sending" | "failed";
2506
+ }>;
2507
+ }>
2508
+ async abortAction(args: {
2509
+ reference: Base64String;
2510
+ }): Promise<{
2511
+ aborted: true;
2512
+ }>
2513
+ async listActions(args: {
2514
+ labels: LabelStringUnder300Bytes[];
2515
+ labelQueryMode?: "any" | "all";
2516
+ includeLabels?: BooleanDefaultFalse;
2517
+ includeInputs?: BooleanDefaultFalse;
2518
+ includeInputSourceLockingScripts?: BooleanDefaultFalse;
2519
+ includeInputUnlockingScripts?: BooleanDefaultFalse;
2520
+ includeOutputs?: BooleanDefaultFalse;
2521
+ includeOutputLockingScripts?: BooleanDefaultFalse;
2522
+ limit?: PositiveIntegerDefault10Max10000;
2523
+ offset?: PositiveIntegerOrZero;
2524
+ }): Promise<{
2525
+ totalActions: PositiveIntegerOrZero;
2526
+ actions: Array<{
2527
+ txid: TXIDHexString;
2528
+ satoshis: SatoshiValue;
2529
+ status: "completed" | "unprocessed" | "sending" | "unproven" | "unsigned" | "nosend" | "nonfinal";
2530
+ isOutgoing: boolean;
2531
+ description: DescriptionString5to50Bytes;
2532
+ labels?: LabelStringUnder300Bytes[];
2533
+ version: PositiveIntegerOrZero;
2534
+ lockTime: PositiveIntegerOrZero;
2535
+ inputs?: Array<{
2536
+ sourceOutpoint: OutpointString;
2537
+ sourceSatoshis: SatoshiValue;
2538
+ sourceLockingScript?: HexString;
2539
+ unlockingScript?: HexString;
2540
+ inputDescription: DescriptionString5to50Bytes;
2541
+ sequenceNumber: PositiveIntegerOrZero;
2542
+ }>;
2543
+ outputs?: Array<{
2544
+ outputIndex: PositiveIntegerOrZero;
2545
+ satoshis: SatoshiValue;
2546
+ lockingScript?: HexString;
2547
+ spendable: boolean;
2548
+ outputDescription: DescriptionString5to50Bytes;
2549
+ basket: BasketStringUnder300Bytes;
2550
+ tags: OutputTagStringUnder300Bytes[];
2551
+ customInstructions?: string;
2552
+ }>;
2553
+ }>;
2554
+ }>
2555
+ async internalizeAction(args: {
2556
+ tx: BEEF;
2557
+ outputs: Array<{
2558
+ outputIndex: PositiveIntegerOrZero;
2559
+ protocol: "wallet payment" | "basket insertion";
2560
+ paymentRemittance?: {
2561
+ derivationPrefix: Base64String;
2562
+ derivationSuffix: Base64String;
2563
+ senderIdentityKey: PubKeyHex;
2564
+ };
2565
+ insertionRemittance?: {
2566
+ basket: BasketStringUnder300Bytes;
2567
+ customInstructions?: string;
2568
+ tags?: OutputTagStringUnder300Bytes[];
2569
+ };
2570
+ }>;
2571
+ description: DescriptionString5to50Bytes;
2572
+ labels?: LabelStringUnder300Bytes[];
2573
+ }): Promise<{
2574
+ accepted: true;
2575
+ }>
2576
+ async listOutputs(args: {
2577
+ basket: BasketStringUnder300Bytes;
2578
+ tags?: OutputTagStringUnder300Bytes[];
2579
+ tagQueryMode?: "all" | "any";
2580
+ include?: "locking scripts" | "entire transactions";
2581
+ includeCustomInstructions?: BooleanDefaultFalse;
2582
+ includeTags?: BooleanDefaultFalse;
2583
+ includeLabels?: BooleanDefaultFalse;
2584
+ limit?: PositiveIntegerDefault10Max10000;
2585
+ offset?: PositiveIntegerOrZero;
2586
+ }): Promise<{
2587
+ totalOutputs: PositiveIntegerOrZero;
2588
+ outputs: Array<{
2589
+ outpoint: OutpointString;
2590
+ satoshis: SatoshiValue;
2591
+ lockingScript?: HexString;
2592
+ tx?: BEEF;
2593
+ spendable: true;
2594
+ customInstructions?: string;
2595
+ tags?: OutputTagStringUnder300Bytes[];
2596
+ labels?: LabelStringUnder300Bytes[];
2597
+ }>;
2598
+ }>
2599
+ async relinquishOutput(args: {
2600
+ basket: BasketStringUnder300Bytes;
2601
+ output: OutpointString;
2602
+ }): Promise<{
2603
+ relinquished: true;
2604
+ }>
2605
+ async getPublicKey(args: {
2606
+ identityKey?: true;
2607
+ protocolID?: [
2608
+ 0 | 1 | 2,
2609
+ ProtocolString5To400Bytes
2610
+ ];
2611
+ keyID?: KeyIDStringUnder800Bytes;
2612
+ privileged?: BooleanDefaultFalse;
2613
+ privilegedReason?: DescriptionString5to50Bytes;
2614
+ counterparty?: PubKeyHex | "self" | "anyone";
2615
+ forSelf?: BooleanDefaultFalse;
2616
+ }): Promise<{
2617
+ publicKey: PubKeyHex;
2618
+ }>
2619
+ async revealCounterpartyKeyLinkage(args: {
2620
+ counterparty: PubKeyHex;
2621
+ verifier: PubKeyHex;
2622
+ privilegedReason?: DescriptionString5to50Bytes;
2623
+ privileged?: BooleanDefaultFalse;
2624
+ }): Promise<{
2625
+ prover: PubKeyHex;
2626
+ verifier: PubKeyHex;
2627
+ counterparty: PubKeyHex;
2628
+ revelationTime: ISOTimestampString;
2629
+ encryptedLinkage: Byte[];
2630
+ encryptedLinkageProof: Byte[];
2631
+ }>
2632
+ async revealSpecificKeyLinkage(args: {
2633
+ counterparty: PubKeyHex;
2634
+ verifier: PubKeyHex;
2635
+ protocolID: [
2636
+ 0 | 1 | 2,
2637
+ ProtocolString5To400Bytes
2638
+ ];
2639
+ keyID: KeyIDStringUnder800Bytes;
2640
+ privilegedReason?: DescriptionString5to50Bytes;
2641
+ privileged?: BooleanDefaultFalse;
2642
+ }): Promise<{
2643
+ prover: PubKeyHex;
2644
+ verifier: PubKeyHex;
2645
+ counterparty: PubKeyHex;
2646
+ protocolID: [
2647
+ 0 | 1 | 2,
2648
+ ProtocolString5To400Bytes
2649
+ ];
2650
+ keyID: KeyIDStringUnder800Bytes;
2651
+ encryptedLinkage: Byte[];
2652
+ encryptedLinkageProof: Byte[];
2653
+ proofType: Byte;
2654
+ }>
2655
+ async encrypt(args: {
2656
+ plaintext: Byte[];
2657
+ protocolID: [
2658
+ 0 | 1 | 2,
2659
+ ProtocolString5To400Bytes
2660
+ ];
2661
+ keyID: KeyIDStringUnder800Bytes;
2662
+ privilegedReason?: DescriptionString5to50Bytes;
2663
+ counterparty?: PubKeyHex | "self" | "anyone";
2664
+ privileged?: BooleanDefaultFalse;
2665
+ }): Promise<{
2666
+ ciphertext: Byte[];
2667
+ }>
2668
+ async decrypt(args: {
2669
+ ciphertext: Byte[];
2670
+ protocolID: [
2671
+ 0 | 1 | 2,
2672
+ ProtocolString5To400Bytes
2673
+ ];
2674
+ keyID: KeyIDStringUnder800Bytes;
2675
+ privilegedReason?: DescriptionString5to50Bytes;
2676
+ counterparty?: PubKeyHex | "self" | "anyone";
2677
+ privileged?: BooleanDefaultFalse;
2678
+ }): Promise<{
2679
+ plaintext: Byte[];
2680
+ }>
2681
+ async createHmac(args: {
2682
+ data: Byte[];
2683
+ protocolID: [
2684
+ 0 | 1 | 2,
2685
+ ProtocolString5To400Bytes
2686
+ ];
2687
+ keyID: KeyIDStringUnder800Bytes;
2688
+ privilegedReason?: DescriptionString5to50Bytes;
2689
+ counterparty?: PubKeyHex | "self" | "anyone";
2690
+ privileged?: BooleanDefaultFalse;
2691
+ }): Promise<{
2692
+ hmac: Byte[];
2693
+ }>
2694
+ async verifyHmac(args: {
2695
+ data: Byte[];
2696
+ hmac: Byte[];
2697
+ protocolID: [
2698
+ 0 | 1 | 2,
2699
+ ProtocolString5To400Bytes
2700
+ ];
2701
+ keyID: KeyIDStringUnder800Bytes;
2702
+ privilegedReason?: DescriptionString5to50Bytes;
2703
+ counterparty?: PubKeyHex | "self" | "anyone";
2704
+ privileged?: BooleanDefaultFalse;
2705
+ }): Promise<{
2706
+ valid: true;
2707
+ }>
2708
+ async createSignature(args: {
2709
+ data?: Byte[];
2710
+ hashToDirectlySign?: Byte[];
2711
+ protocolID: [
2712
+ 0 | 1 | 2,
2713
+ ProtocolString5To400Bytes
2714
+ ];
2715
+ keyID: KeyIDStringUnder800Bytes;
2716
+ privilegedReason?: DescriptionString5to50Bytes;
2717
+ counterparty?: PubKeyHex | "self" | "anyone";
2718
+ privileged?: BooleanDefaultFalse;
2719
+ }): Promise<{
2720
+ signature: Byte[];
2721
+ }>
2722
+ async verifySignature(args: {
2723
+ data?: Byte[];
2724
+ hashToDirectlyVerify?: Byte[];
2725
+ signature: Byte[];
2726
+ protocolID: [
2727
+ 0 | 1 | 2,
2728
+ ProtocolString5To400Bytes
2729
+ ];
2730
+ keyID: KeyIDStringUnder800Bytes;
2731
+ privilegedReason?: DescriptionString5to50Bytes;
2732
+ counterparty?: PubKeyHex | "self" | "anyone";
2733
+ forSelf?: BooleanDefaultFalse;
2734
+ privileged?: BooleanDefaultFalse;
2735
+ }): Promise<{
2736
+ valid: true;
2737
+ }>
2738
+ async acquireCertificate(args: {
2739
+ type: Base64String;
2740
+ subject: PubKeyHex;
2741
+ serialNumber: Base64String;
2742
+ revocationOutpoint: OutpointString;
2743
+ signature: HexString;
2744
+ fields: Record<CertificateFieldNameUnder50Bytes, string>;
2745
+ certifier: PubKeyHex;
2746
+ keyringRevealer: PubKeyHex | "certifier";
2747
+ keyringForSubject: Record<CertificateFieldNameUnder50Bytes, Base64String>;
2748
+ acquisitionProtocol: "direct" | "issuance";
2749
+ certifierUrl?: string;
2750
+ }): Promise<{
2751
+ type: Base64String;
2752
+ subject: PubKeyHex;
2753
+ serialNumber: Base64String;
2754
+ certifier: PubKeyHex;
2755
+ revocationOutpoint: OutpointString;
2756
+ signature: HexString;
2757
+ fields: Record<CertificateFieldNameUnder50Bytes, string>;
2758
+ }>
2759
+ async listCertificates(args: {
2760
+ certifiers: PubKeyHex[];
2761
+ types: Base64String[];
2762
+ limit?: PositiveIntegerDefault10Max10000;
2763
+ offset?: PositiveIntegerOrZero;
2764
+ privileged?: BooleanDefaultFalse;
2765
+ privilegedReason?: DescriptionString5to50Bytes;
2766
+ }): Promise<{
2767
+ totalCertificates: PositiveIntegerOrZero;
2768
+ certificates: Array<{
2769
+ type: Base64String;
2770
+ subject: PubKeyHex;
2771
+ serialNumber: Base64String;
2772
+ certifier: PubKeyHex;
2773
+ revocationOutpoint: OutpointString;
2774
+ signature: HexString;
2775
+ fields: Record<CertificateFieldNameUnder50Bytes, string>;
2776
+ }>;
2777
+ }>
2778
+ async proveCertificate(args: {
2779
+ certificate: {
2780
+ type: Base64String;
2781
+ subject: PubKeyHex;
2782
+ serialNumber: Base64String;
2783
+ certifier: PubKeyHex;
2784
+ revocationOutpoint: OutpointString;
2785
+ signature: HexString;
2786
+ fields: Record<CertificateFieldNameUnder50Bytes, string>;
2787
+ };
2788
+ fieldsToReveal: CertificateFieldNameUnder50Bytes[];
2789
+ verifier: PubKeyHex;
2790
+ privileged?: BooleanDefaultFalse;
2791
+ privilegedReason?: DescriptionString5to50Bytes;
2792
+ }): Promise<{
2793
+ keyringForVerifier: Record<CertificateFieldNameUnder50Bytes, Base64String>;
2794
+ }>
2795
+ async relinquishCertificate(args: {
2796
+ type: Base64String;
2797
+ serialNumber: Base64String;
2798
+ certifier: PubKeyHex;
2799
+ }): Promise<{
2800
+ relinquished: true;
2801
+ }>
2802
+ async discoverByIdentityKey(args: {
2803
+ identityKey: PubKeyHex;
2804
+ limit?: PositiveIntegerDefault10Max10000;
2805
+ offset?: PositiveIntegerOrZero;
2806
+ }): Promise<{
2807
+ totalCertificates: PositiveIntegerOrZero;
2808
+ certificates: Array<{
2809
+ type: Base64String;
2810
+ subject: PubKeyHex;
2811
+ serialNumber: Base64String;
2812
+ certifier: PubKeyHex;
2813
+ revocationOutpoint: OutpointString;
2814
+ signature: HexString;
2815
+ fields: Record<CertificateFieldNameUnder50Bytes, Base64String>;
2816
+ certifierInfo: {
2817
+ name: EntityNameStringMax100Bytes;
2818
+ iconUrl: EntityIconURLStringMax500Bytes;
2819
+ description: DescriptionString5to50Bytes;
2820
+ trust: PositiveIntegerMax10;
2821
+ };
2822
+ publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
2823
+ decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
2824
+ }>;
2825
+ }>
2826
+ async discoverByAttributes(args: {
2827
+ attributes: Record<CertificateFieldNameUnder50Bytes, string>;
2828
+ limit?: PositiveIntegerDefault10Max10000;
2829
+ offset?: PositiveIntegerOrZero;
2830
+ }): Promise<{
2831
+ totalCertificates: PositiveIntegerOrZero;
2832
+ certificates: Array<{
2833
+ type: Base64String;
2834
+ subject: PubKeyHex;
2835
+ serialNumber: Base64String;
2836
+ certifier: PubKeyHex;
2837
+ revocationOutpoint: OutpointString;
2838
+ signature: HexString;
2839
+ fields: Record<CertificateFieldNameUnder50Bytes, Base64String>;
2840
+ certifierInfo: {
2841
+ name: EntityNameStringMax100Bytes;
2842
+ iconUrl: EntityIconURLStringMax500Bytes;
2843
+ description: DescriptionString5to50Bytes;
2844
+ trust: PositiveIntegerMax10;
2845
+ };
2846
+ publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
2847
+ decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
2848
+ }>;
2849
+ }>
2850
+ async isAuthenticated(args: {}): Promise<{
2851
+ authenticated: boolean;
2852
+ }>
2853
+ async waitForAuthentication(args: {}): Promise<{
2854
+ authenticated: true;
2855
+ }>
2856
+ async getHeight(args: {}): Promise<{
2857
+ height: PositiveInteger;
2858
+ }>
2859
+ async getHeaderForHeight(args: {
2860
+ height: PositiveInteger;
2861
+ }): Promise<{
2862
+ header: HexString;
2863
+ }>
2864
+ async getNetwork(args: {}): Promise<{
2865
+ network: "mainnet" | "testnet";
2866
+ }>
2867
+ async getVersion(args: {}): Promise<{
2868
+ version: VersionString7To30Bytes;
2869
+ }>
2870
+ }
2871
+ ```
2872
+
2873
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
2874
+
2875
+ ---
2876
+ ### Class: WalletWireTransceiver
2877
+
2878
+ A way to make remote calls to a wallet over a wallet wire.
2879
+
2880
+ ```ts
2881
+ export default class WalletWireTransceiver implements Wallet {
2882
+ wire: WalletWire;
2883
+ constructor(wire: WalletWire)
2884
+ async createAction(args: {
2885
+ description: DescriptionString5to50Bytes;
2886
+ inputBEEF?: BEEF;
2887
+ inputs?: Array<{
2888
+ outpoint: OutpointString;
2889
+ unlockingScript?: HexString;
2890
+ unlockingScriptLength?: PositiveInteger;
2891
+ inputDescription: DescriptionString5to50Bytes;
2892
+ sequenceNumber?: PositiveIntegerOrZero;
2893
+ }>;
2894
+ outputs?: Array<{
2895
+ lockingScript: HexString;
2896
+ satoshis: SatoshiValue;
2897
+ outputDescription: DescriptionString5to50Bytes;
2898
+ basket?: BasketStringUnder300Bytes;
2899
+ customInstructions?: string;
2900
+ tags?: OutputTagStringUnder300Bytes[];
2901
+ }>;
2902
+ lockTime?: PositiveIntegerOrZero;
2903
+ version?: PositiveIntegerOrZero;
2904
+ labels?: LabelStringUnder300Bytes[];
2905
+ options?: {
2906
+ signAndProcess?: BooleanDefaultTrue;
2907
+ acceptDelayedBroadcast?: BooleanDefaultTrue;
2908
+ trustSelf?: "known";
2909
+ knownTxids?: TXIDHexString[];
2910
+ returnTXIDOnly?: BooleanDefaultFalse;
2911
+ noSend?: BooleanDefaultFalse;
2912
+ noSendChange?: OutpointString[];
2913
+ sendWith?: TXIDHexString[];
2914
+ randomizeOutputs?: BooleanDefaultTrue;
2915
+ };
2916
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2917
+ txid?: TXIDHexString;
2918
+ tx?: BEEF;
2919
+ noSendChange?: OutpointString[];
2920
+ sendWithResults?: Array<{
2921
+ txid: TXIDHexString;
2922
+ status: "unproven" | "sending" | "failed";
2923
+ }>;
2924
+ signableTransaction?: {
2925
+ tx: BEEF;
2926
+ reference: Base64String;
2927
+ };
2928
+ }>
2929
+ async signAction(args: {
2930
+ spends: Record<PositiveIntegerOrZero, {
2931
+ unlockingScript: HexString;
2932
+ sequenceNumber?: PositiveIntegerOrZero;
2933
+ }>;
2934
+ reference: Base64String;
2935
+ options?: {
2936
+ acceptDelayedBroadcast?: BooleanDefaultTrue;
2937
+ returnTXIDOnly?: BooleanDefaultFalse;
2938
+ noSend?: BooleanDefaultFalse;
2939
+ noSendChange?: OutpointString[];
2940
+ sendWith: TXIDHexString[];
2941
+ };
2942
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2943
+ txid?: TXIDHexString;
2944
+ tx?: BEEF;
2945
+ noSendChange?: OutpointString[];
2946
+ sendWithResults?: Array<{
2947
+ txid: TXIDHexString;
2948
+ status: "unproven" | "sending" | "failed";
2949
+ }>;
2950
+ }>
2951
+ async abortAction(args: {
2952
+ reference: Base64String;
2953
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2954
+ aborted: true;
2955
+ }>
2956
+ async listActions(args: {
2957
+ seekPermission?: BooleanDefaultTrue;
2958
+ labels: LabelStringUnder300Bytes[];
2959
+ labelQueryMode?: "any" | "all";
2960
+ includeLabels?: BooleanDefaultFalse;
2961
+ includeInputs?: BooleanDefaultFalse;
2962
+ includeInputSourceLockingScripts?: BooleanDefaultFalse;
2963
+ includeInputUnlockingScripts?: BooleanDefaultFalse;
2964
+ includeOutputs?: BooleanDefaultFalse;
2965
+ includeOutputLockingScripts?: BooleanDefaultFalse;
2966
+ limit?: PositiveIntegerDefault10Max10000;
2967
+ offset?: PositiveIntegerOrZero;
2968
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
2969
+ totalActions: PositiveIntegerOrZero;
2970
+ actions: Array<{
2971
+ txid: TXIDHexString;
2972
+ satoshis: SatoshiValue;
2973
+ status: "completed" | "unprocessed" | "sending" | "unproven" | "unsigned" | "nosend" | "nonfinal";
2974
+ isOutgoing: boolean;
2975
+ description: DescriptionString5to50Bytes;
2976
+ labels?: LabelStringUnder300Bytes[];
2977
+ version: PositiveIntegerOrZero;
2978
+ lockTime: PositiveIntegerOrZero;
2979
+ inputs?: Array<{
2980
+ sourceOutpoint: OutpointString;
2981
+ sourceSatoshis: SatoshiValue;
2982
+ sourceLockingScript?: HexString;
2983
+ unlockingScript?: HexString;
2984
+ inputDescription: DescriptionString5to50Bytes;
2985
+ sequenceNumber: PositiveIntegerOrZero;
2986
+ }>;
2987
+ outputs?: Array<{
2988
+ outputIndex: PositiveIntegerOrZero;
2989
+ satoshis: SatoshiValue;
2990
+ lockingScript?: HexString;
2991
+ spendable: boolean;
2992
+ outputDescription: DescriptionString5to50Bytes;
2993
+ basket: BasketStringUnder300Bytes;
2994
+ tags: OutputTagStringUnder300Bytes[];
2995
+ customInstructions?: string;
2996
+ }>;
2997
+ }>;
2998
+ }>
2999
+ async internalizeAction(args: {
3000
+ seekPermission?: BooleanDefaultTrue;
3001
+ tx: AtomicBEEF;
3002
+ outputs: Array<{
3003
+ outputIndex: PositiveIntegerOrZero;
3004
+ protocol: "wallet payment" | "basket insertion";
3005
+ paymentRemittance?: {
3006
+ derivationPrefix: Base64String;
3007
+ derivationSuffix: Base64String;
3008
+ senderIdentityKey: PubKeyHex;
3009
+ };
3010
+ insertionRemittance?: {
3011
+ basket: BasketStringUnder300Bytes;
3012
+ customInstructions?: string;
3013
+ tags?: OutputTagStringUnder300Bytes[];
3014
+ };
3015
+ }>;
3016
+ description: DescriptionString5to50Bytes;
3017
+ labels?: LabelStringUnder300Bytes[];
3018
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
3019
+ accepted: true;
3020
+ }>
3021
+ async listOutputs(args: {
3022
+ seekPermission?: BooleanDefaultTrue;
3023
+ basket: BasketStringUnder300Bytes;
3024
+ tags?: OutputTagStringUnder300Bytes[];
3025
+ tagQueryMode?: "all" | "any";
3026
+ include?: "locking scripts" | "entire transactions";
3027
+ includeCustomInstructions?: BooleanDefaultFalse;
3028
+ includeTags?: BooleanDefaultFalse;
3029
+ includeLabels?: BooleanDefaultFalse;
3030
+ limit?: PositiveIntegerDefault10Max10000;
3031
+ offset?: PositiveIntegerOrZero;
3032
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
3033
+ totalOutputs: PositiveIntegerOrZero;
3034
+ BEEF?: BEEF;
3035
+ outputs: Array<{
3036
+ outpoint: OutpointString;
3037
+ satoshis: SatoshiValue;
3038
+ lockingScript?: HexString;
3039
+ spendable: true;
3040
+ customInstructions?: string;
3041
+ tags?: OutputTagStringUnder300Bytes[];
3042
+ labels?: LabelStringUnder300Bytes[];
3043
+ }>;
3044
+ }>
3045
+ async relinquishOutput(args: {
3046
+ basket: BasketStringUnder300Bytes;
3047
+ output: OutpointString;
3048
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
3049
+ relinquished: true;
3050
+ }>
3051
+ async getPublicKey(args: {
3052
+ seekPermission?: BooleanDefaultTrue;
3053
+ identityKey?: true;
3054
+ protocolID?: [
3055
+ 0 | 1 | 2,
3056
+ ProtocolString5To400Bytes
3057
+ ];
3058
+ keyID?: KeyIDStringUnder800Bytes;
3059
+ privileged?: BooleanDefaultFalse;
3060
+ privilegedReason?: DescriptionString5to50Bytes;
3061
+ counterparty?: PubKeyHex | "self" | "anyone";
3062
+ forSelf?: BooleanDefaultFalse;
3063
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
3064
+ publicKey: PubKeyHex;
3065
+ }>
3066
+ async revealCounterpartyKeyLinkage(args: {
3067
+ counterparty: PubKeyHex;
3068
+ verifier: PubKeyHex;
3069
+ privilegedReason?: DescriptionString5to50Bytes;
3070
+ privileged?: BooleanDefaultFalse;
3071
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
3072
+ prover: PubKeyHex;
3073
+ verifier: PubKeyHex;
3074
+ counterparty: PubKeyHex;
3075
+ revelationTime: ISOTimestampString;
3076
+ encryptedLinkage: Byte[];
3077
+ encryptedLinkageProof: number[];
3078
+ }>
3079
+ async revealSpecificKeyLinkage(args: {
3080
+ counterparty: PubKeyHex;
3081
+ verifier: PubKeyHex;
3082
+ protocolID: [
3083
+ 0 | 1 | 2,
3084
+ ProtocolString5To400Bytes
3085
+ ];
3086
+ keyID: KeyIDStringUnder800Bytes;
3087
+ privilegedReason?: DescriptionString5to50Bytes;
3088
+ privileged?: BooleanDefaultFalse;
3089
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
3090
+ prover: PubKeyHex;
3091
+ verifier: PubKeyHex;
3092
+ counterparty: PubKeyHex;
3093
+ protocolID: [
3094
+ 0 | 1 | 2,
3095
+ ProtocolString5To400Bytes
3096
+ ];
3097
+ keyID: KeyIDStringUnder800Bytes;
3098
+ encryptedLinkage: Byte[];
3099
+ encryptedLinkageProof: Byte[];
3100
+ proofType: Byte;
3101
+ }>
3102
+ async encrypt(args: {
3103
+ seekPermission?: BooleanDefaultTrue;
3104
+ plaintext: Byte[];
3105
+ protocolID: [
3106
+ 0 | 1 | 2,
3107
+ ProtocolString5To400Bytes
3108
+ ];
3109
+ keyID: KeyIDStringUnder800Bytes;
3110
+ privilegedReason?: DescriptionString5to50Bytes;
3111
+ counterparty?: PubKeyHex | "self" | "anyone";
3112
+ privileged?: BooleanDefaultFalse;
3113
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
3114
+ ciphertext: Byte[];
3115
+ }>
3116
+ async decrypt(args: {
3117
+ seekPermission?: BooleanDefaultTrue;
3118
+ ciphertext: Byte[];
3119
+ protocolID: [
3120
+ 0 | 1 | 2,
3121
+ ProtocolString5To400Bytes
3122
+ ];
3123
+ keyID: KeyIDStringUnder800Bytes;
3124
+ privilegedReason?: DescriptionString5to50Bytes;
3125
+ counterparty?: PubKeyHex | "self" | "anyone";
3126
+ privileged?: BooleanDefaultFalse;
3127
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
3128
+ plaintext: Byte[];
3129
+ }>
3130
+ async createHmac(args: {
3131
+ seekPermission?: BooleanDefaultTrue;
3132
+ data: Byte[];
3133
+ protocolID: [
3134
+ 0 | 1 | 2,
3135
+ ProtocolString5To400Bytes
3136
+ ];
3137
+ keyID: KeyIDStringUnder800Bytes;
3138
+ privilegedReason?: DescriptionString5to50Bytes;
3139
+ counterparty?: PubKeyHex | "self" | "anyone";
3140
+ privileged?: BooleanDefaultFalse;
3141
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
3142
+ hmac: Byte[];
3143
+ }>
3144
+ async verifyHmac(args: {
3145
+ seekPermission?: BooleanDefaultTrue;
3146
+ data: Byte[];
3147
+ hmac: Byte[];
3148
+ protocolID: [
3149
+ 0 | 1 | 2,
3150
+ ProtocolString5To400Bytes
3151
+ ];
3152
+ keyID: KeyIDStringUnder800Bytes;
3153
+ privilegedReason?: DescriptionString5to50Bytes;
3154
+ counterparty?: PubKeyHex | "self" | "anyone";
3155
+ privileged?: BooleanDefaultFalse;
3156
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
3157
+ valid: true;
3158
+ }>
3159
+ async createSignature(args: {
3160
+ seekPermission?: BooleanDefaultTrue;
3161
+ data?: Byte[];
3162
+ hashToDirectlySign?: Byte[];
3163
+ protocolID: [
3164
+ 0 | 1 | 2,
3165
+ ProtocolString5To400Bytes
3166
+ ];
3167
+ keyID: KeyIDStringUnder800Bytes;
3168
+ privilegedReason?: DescriptionString5to50Bytes;
3169
+ counterparty?: PubKeyHex | "self" | "anyone";
3170
+ privileged?: BooleanDefaultFalse;
3171
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
3172
+ signature: Byte[];
3173
+ }>
3174
+ async verifySignature(args: {
3175
+ seekPermission?: BooleanDefaultTrue;
3176
+ data?: Byte[];
3177
+ hashToDirectlyVerify?: Byte[];
3178
+ signature: Byte[];
3179
+ protocolID: [
3180
+ 0 | 1 | 2,
3181
+ ProtocolString5To400Bytes
3182
+ ];
3183
+ keyID: KeyIDStringUnder800Bytes;
3184
+ privilegedReason?: DescriptionString5to50Bytes;
3185
+ counterparty?: PubKeyHex | "self" | "anyone";
3186
+ forSelf?: BooleanDefaultFalse;
3187
+ privileged?: BooleanDefaultFalse;
3188
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
3189
+ valid: true;
3190
+ }>
3191
+ async acquireCertificate(args: {
3192
+ type: Base64String;
3193
+ certifier: PubKeyHex;
3194
+ acquisitionProtocol: "direct" | "issuance";
3195
+ fields: Record<CertificateFieldNameUnder50Bytes, string>;
3196
+ serialNumber?: Base64String;
3197
+ revocationOutpoint?: OutpointString;
3198
+ signature?: HexString;
3199
+ certifierUrl?: string;
3200
+ keyringRevealer?: PubKeyHex | "certifier";
3201
+ keyringForSubject?: Record<CertificateFieldNameUnder50Bytes, Base64String>;
3202
+ privileged?: BooleanDefaultFalse;
3203
+ privilegedReason?: DescriptionString5to50Bytes;
3204
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
3205
+ type: Base64String;
3206
+ subject: PubKeyHex;
3207
+ serialNumber: Base64String;
3208
+ certifier: PubKeyHex;
3209
+ revocationOutpoint: OutpointString;
3210
+ signature: HexString;
3211
+ fields: Record<CertificateFieldNameUnder50Bytes, string>;
3212
+ }>
3213
+ async listCertificates(args: {
3214
+ certifiers: PubKeyHex[];
3215
+ types: Base64String[];
3216
+ limit?: PositiveIntegerDefault10Max10000;
3217
+ offset?: PositiveIntegerOrZero;
3218
+ privileged?: BooleanDefaultFalse;
3219
+ privilegedReason?: DescriptionString5to50Bytes;
3220
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
3221
+ totalCertificates: PositiveIntegerOrZero;
3222
+ certificates: Array<{
3223
+ type: Base64String;
3224
+ subject: PubKeyHex;
3225
+ serialNumber: Base64String;
3226
+ certifier: PubKeyHex;
3227
+ revocationOutpoint: OutpointString;
3228
+ signature: HexString;
3229
+ fields: Record<CertificateFieldNameUnder50Bytes, string>;
3230
+ }>;
3231
+ }>
3232
+ async proveCertificate(args: {
3233
+ certificate: {
3234
+ type: Base64String;
3235
+ subject: PubKeyHex;
3236
+ serialNumber: Base64String;
3237
+ certifier: PubKeyHex;
3238
+ revocationOutpoint: OutpointString;
3239
+ signature: HexString;
3240
+ fields: Record<CertificateFieldNameUnder50Bytes, string>;
3241
+ };
3242
+ fieldsToReveal: CertificateFieldNameUnder50Bytes[];
3243
+ verifier: PubKeyHex;
3244
+ privileged?: BooleanDefaultFalse;
3245
+ privilegedReason?: DescriptionString5to50Bytes;
3246
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
3247
+ keyringForVerifier: Record<CertificateFieldNameUnder50Bytes, Base64String>;
3248
+ }>
3249
+ async relinquishCertificate(args: {
3250
+ type: Base64String;
3251
+ serialNumber: Base64String;
3252
+ certifier: PubKeyHex;
3253
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
3254
+ relinquished: true;
3255
+ }>
3256
+ async discoverByIdentityKey(args: {
3257
+ seekPermission?: BooleanDefaultTrue;
3258
+ identityKey: PubKeyHex;
3259
+ limit?: PositiveIntegerDefault10Max10000;
3260
+ offset?: PositiveIntegerOrZero;
3261
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
3262
+ totalCertificates: PositiveIntegerOrZero;
3263
+ certificates: Array<{
3264
+ type: Base64String;
3265
+ subject: PubKeyHex;
3266
+ serialNumber: Base64String;
3267
+ certifier: PubKeyHex;
3268
+ revocationOutpoint: OutpointString;
3269
+ signature: HexString;
3270
+ fields: Record<CertificateFieldNameUnder50Bytes, Base64String>;
3271
+ certifierInfo: {
3272
+ name: EntityNameStringMax100Bytes;
3273
+ iconUrl: EntityIconURLStringMax500Bytes;
3274
+ description: DescriptionString5to50Bytes;
3275
+ trust: PositiveIntegerMax10;
3276
+ };
3277
+ publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
3278
+ decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
3279
+ }>;
3280
+ }>
3281
+ async discoverByAttributes(args: {
3282
+ seekPermission?: BooleanDefaultTrue;
3283
+ attributes: Record<CertificateFieldNameUnder50Bytes, string>;
3284
+ limit?: PositiveIntegerDefault10Max10000;
3285
+ offset?: PositiveIntegerOrZero;
3286
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
3287
+ totalCertificates: PositiveIntegerOrZero;
3288
+ certificates: Array<{
3289
+ type: Base64String;
3290
+ subject: PubKeyHex;
3291
+ serialNumber: Base64String;
3292
+ certifier: PubKeyHex;
3293
+ revocationOutpoint: OutpointString;
3294
+ signature: HexString;
3295
+ fields: Record<CertificateFieldNameUnder50Bytes, Base64String>;
3296
+ certifierInfo: {
3297
+ name: EntityNameStringMax100Bytes;
3298
+ iconUrl: EntityIconURLStringMax500Bytes;
3299
+ description: DescriptionString5to50Bytes;
3300
+ trust: PositiveIntegerMax10;
3301
+ };
3302
+ publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
3303
+ decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
3304
+ }>;
3305
+ }>
3306
+ async isAuthenticated(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
3307
+ authenticated: boolean;
3308
+ }>
3309
+ async waitForAuthentication(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
3310
+ authenticated: true;
3311
+ }>
3312
+ async getHeight(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
3313
+ height: PositiveInteger;
3314
+ }>
3315
+ async getHeaderForHeight(args: {
3316
+ height: PositiveInteger;
3317
+ }, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
3318
+ header: HexString;
3319
+ }>
3320
+ async getNetwork(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
3321
+ network: "mainnet" | "testnet";
3322
+ }>
3323
+ async getVersion(args: {}, originator?: OriginatorDomainNameStringUnder250Bytes): Promise<{
3324
+ version: VersionString7To30Bytes;
3325
+ }>
3326
+ }
3327
+ ```
3328
+
3329
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3330
+
3331
+ ---
3332
+ ### Class: HTTPWalletWire
3333
+
3334
+ ```ts
3335
+ export default class HTTPWalletWire implements WalletWire {
3336
+ baseUrl: string;
3337
+ httpClient: typeof fetch;
3338
+ originator: string | undefined;
3339
+ constructor(originator: string | undefined, baseUrl: string = "http://localhost:3301", httpClient = fetch)
3340
+ async transmitToWallet(message: number[]): Promise<number[]>
3341
+ }
3342
+ ```
3343
+
3344
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3345
+
3346
+ ---
3347
+ ### Class: WalletClient
3348
+
3349
+ The SDK is how applications communicate with wallets over a communications substrate.
3350
+
3351
+ ```ts
3352
+ export default class WalletClient implements Wallet {
3353
+ public substrate: "auto" | Wallet;
3354
+ originator?: OriginatorDomainNameStringUnder250Bytes;
3355
+ constructor(substrate: "auto" | "Cicada" | "XDM" | "window.CWI" | Wallet = "auto", originator?: OriginatorDomainNameStringUnder250Bytes)
3356
+ async connectToSubstrate()
3357
+ async createAction(args: {
3358
+ description: DescriptionString5to50Bytes;
3359
+ inputs?: Array<{
3360
+ tx?: BEEF;
3361
+ outpoint: OutpointString;
3362
+ unlockingScript?: HexString;
3363
+ unlockingScriptLength?: PositiveInteger;
3364
+ inputDescription: DescriptionString5to50Bytes;
3365
+ sequenceNumber?: PositiveIntegerOrZero;
3366
+ }>;
3367
+ outputs?: Array<{
3368
+ lockingScript: HexString;
3369
+ satoshis: SatoshiValue;
3370
+ outputDescription: DescriptionString5to50Bytes;
3371
+ basket?: BasketStringUnder300Bytes;
3372
+ customInstructions?: string;
3373
+ tags?: OutputTagStringUnder300Bytes[];
3374
+ }>;
3375
+ lockTime?: PositiveIntegerOrZero;
3376
+ version?: PositiveIntegerOrZero;
3377
+ labels?: LabelStringUnder300Bytes[];
3378
+ options?: {
3379
+ signAndProcess?: BooleanDefaultTrue;
3380
+ acceptDelayedBroadcast?: BooleanDefaultTrue;
3381
+ trustSelf?: "known";
3382
+ knownTxids?: TXIDHexString[];
3383
+ returnTXIDOnly?: BooleanDefaultFalse;
3384
+ noSend?: BooleanDefaultFalse;
3385
+ noSendChange?: OutpointString[];
3386
+ sendWith?: TXIDHexString[];
3387
+ };
3388
+ }): Promise<{
3389
+ txid?: TXIDHexString;
3390
+ tx?: BEEF;
3391
+ noSendChange?: OutpointString[];
3392
+ sendWithResults?: Array<{
3393
+ txid: TXIDHexString;
3394
+ status: "unproven" | "sending" | "failed";
3395
+ }>;
3396
+ signableTransaction?: {
3397
+ tx: BEEF;
3398
+ reference: Base64String;
3399
+ };
3400
+ }>
3401
+ async signAction(args: {
3402
+ spends: Record<PositiveIntegerOrZero, {
3403
+ unlockingScript: HexString;
3404
+ sequenceNumber?: PositiveIntegerOrZero;
3405
+ }>;
3406
+ reference: Base64String;
3407
+ options?: {
3408
+ acceptDelayedBroadcast?: BooleanDefaultTrue;
3409
+ returnTXIDOnly?: BooleanDefaultFalse;
3410
+ noSend?: BooleanDefaultFalse;
3411
+ noSendChange?: OutpointString[];
3412
+ sendWith: TXIDHexString[];
3413
+ };
3414
+ }): Promise<{
3415
+ txid?: TXIDHexString;
3416
+ tx?: BEEF;
3417
+ noSendChange?: OutpointString[];
3418
+ sendWithResults?: Array<{
3419
+ txid: TXIDHexString;
3420
+ status: "unproven" | "sending" | "failed";
3421
+ }>;
3422
+ }>
3423
+ async abortAction(args: {
3424
+ reference: Base64String;
3425
+ }): Promise<{
3426
+ aborted: true;
3427
+ }>
3428
+ async listActions(args: {
3429
+ labels: LabelStringUnder300Bytes[];
3430
+ labelQueryMode?: "any" | "all";
3431
+ includeLabels?: BooleanDefaultFalse;
3432
+ includeInputs?: BooleanDefaultFalse;
3433
+ includeInputSourceLockingScripts?: BooleanDefaultFalse;
3434
+ includeInputUnlockingScripts?: BooleanDefaultFalse;
3435
+ includeOutputs?: BooleanDefaultFalse;
3436
+ includeOutputLockingScripts?: BooleanDefaultFalse;
3437
+ limit?: PositiveIntegerDefault10Max10000;
3438
+ offset?: PositiveIntegerOrZero;
3439
+ }): Promise<{
3440
+ totalActions: PositiveIntegerOrZero;
3441
+ actions: Array<{
3442
+ txid: TXIDHexString;
3443
+ satoshis: SatoshiValue;
3444
+ status: "completed" | "unprocessed" | "sending" | "unproven" | "unsigned" | "nosend" | "nonfinal";
3445
+ isOutgoing: boolean;
3446
+ description: DescriptionString5to50Bytes;
3447
+ labels?: LabelStringUnder300Bytes[];
3448
+ version: PositiveIntegerOrZero;
3449
+ lockTime: PositiveIntegerOrZero;
3450
+ inputs?: Array<{
3451
+ sourceOutpoint: OutpointString;
3452
+ sourceSatoshis: SatoshiValue;
3453
+ sourceLockingScript?: HexString;
3454
+ unlockingScript?: HexString;
3455
+ inputDescription: DescriptionString5to50Bytes;
3456
+ sequenceNumber: PositiveIntegerOrZero;
3457
+ }>;
3458
+ outputs?: Array<{
3459
+ outputIndex: PositiveIntegerOrZero;
3460
+ satoshis: SatoshiValue;
3461
+ lockingScript?: HexString;
3462
+ spendable: boolean;
3463
+ outputDescription: DescriptionString5to50Bytes;
3464
+ basket: BasketStringUnder300Bytes;
3465
+ tags: OutputTagStringUnder300Bytes[];
3466
+ customInstructions?: string;
3467
+ }>;
3468
+ }>;
3469
+ }>
3470
+ async internalizeAction(args: {
3471
+ tx: BEEF;
3472
+ outputs: Array<{
3473
+ outputIndex: PositiveIntegerOrZero;
3474
+ protocol: "wallet payment" | "basket insertion";
3475
+ paymentRemittance?: {
3476
+ derivationPrefix: Base64String;
3477
+ derivationSuffix: Base64String;
3478
+ senderIdentityKey: PubKeyHex;
3479
+ };
3480
+ insertionRemittance?: {
3481
+ basket: BasketStringUnder300Bytes;
3482
+ customInstructions?: string;
3483
+ tags?: OutputTagStringUnder300Bytes[];
3484
+ };
3485
+ }>;
3486
+ description: DescriptionString5to50Bytes;
3487
+ labels?: LabelStringUnder300Bytes[];
3488
+ }): Promise<{
3489
+ accepted: true;
3490
+ }>
3491
+ async listOutputs(args: {
3492
+ basket: BasketStringUnder300Bytes;
3493
+ tags?: OutputTagStringUnder300Bytes[];
3494
+ tagQueryMode?: "all" | "any";
3495
+ include?: "locking scripts" | "entire transactions";
3496
+ includeCustomInstructions?: BooleanDefaultFalse;
3497
+ includeTags?: BooleanDefaultFalse;
3498
+ includeLabels?: BooleanDefaultFalse;
3499
+ limit?: PositiveIntegerDefault10Max10000;
3500
+ offset?: PositiveIntegerOrZero;
3501
+ }): Promise<{
3502
+ totalOutputs: PositiveIntegerOrZero;
3503
+ outputs: Array<{
3504
+ outpoint: OutpointString;
3505
+ satoshis: SatoshiValue;
3506
+ lockingScript?: HexString;
3507
+ tx?: BEEF;
3508
+ spendable: true;
3509
+ customInstructions?: string;
3510
+ tags?: OutputTagStringUnder300Bytes[];
3511
+ labels?: LabelStringUnder300Bytes[];
3512
+ }>;
3513
+ }>
3514
+ async relinquishOutput(args: {
3515
+ basket: BasketStringUnder300Bytes;
3516
+ output: OutpointString;
3517
+ }): Promise<{
3518
+ relinquished: true;
3519
+ }>
3520
+ async getPublicKey(args: {
3521
+ identityKey?: true;
3522
+ protocolID?: [
3523
+ 0 | 1 | 2,
3524
+ ProtocolString5To400Bytes
3525
+ ];
3526
+ keyID?: KeyIDStringUnder800Bytes;
3527
+ privileged?: BooleanDefaultFalse;
3528
+ privilegedReason?: DescriptionString5to50Bytes;
3529
+ counterparty?: PubKeyHex | "self" | "anyone";
3530
+ forSelf?: BooleanDefaultFalse;
3531
+ }): Promise<{
3532
+ publicKey: PubKeyHex;
3533
+ }>
3534
+ async revealCounterpartyKeyLinkage(args: {
3535
+ counterparty: PubKeyHex;
3536
+ verifier: PubKeyHex;
3537
+ privilegedReason?: DescriptionString5to50Bytes;
3538
+ privileged?: BooleanDefaultFalse;
3539
+ }): Promise<{
3540
+ prover: PubKeyHex;
3541
+ verifier: PubKeyHex;
3542
+ counterparty: PubKeyHex;
3543
+ revelationTime: ISOTimestampString;
3544
+ encryptedLinkage: Byte[];
3545
+ encryptedLinkageProof: Byte[];
3546
+ }>
3547
+ async revealSpecificKeyLinkage(args: {
3548
+ counterparty: PubKeyHex;
3549
+ verifier: PubKeyHex;
3550
+ protocolID: [
3551
+ 0 | 1 | 2,
3552
+ ProtocolString5To400Bytes
3553
+ ];
3554
+ keyID: KeyIDStringUnder800Bytes;
3555
+ privilegedReason?: DescriptionString5to50Bytes;
3556
+ privileged?: BooleanDefaultFalse;
3557
+ }): Promise<{
3558
+ prover: PubKeyHex;
3559
+ verifier: PubKeyHex;
3560
+ counterparty: PubKeyHex;
3561
+ protocolID: [
3562
+ 0 | 1 | 2,
3563
+ ProtocolString5To400Bytes
3564
+ ];
3565
+ keyID: KeyIDStringUnder800Bytes;
3566
+ encryptedLinkage: Byte[];
3567
+ encryptedLinkageProof: Byte[];
3568
+ proofType: Byte;
3569
+ }>
3570
+ async encrypt(args: {
3571
+ plaintext: Byte[];
3572
+ protocolID: [
3573
+ 0 | 1 | 2,
3574
+ ProtocolString5To400Bytes
3575
+ ];
3576
+ keyID: KeyIDStringUnder800Bytes;
3577
+ privilegedReason?: DescriptionString5to50Bytes;
3578
+ counterparty?: PubKeyHex | "self" | "anyone";
3579
+ privileged?: BooleanDefaultFalse;
3580
+ }): Promise<{
3581
+ ciphertext: Byte[];
3582
+ }>
3583
+ async decrypt(args: {
3584
+ ciphertext: Byte[];
3585
+ protocolID: [
3586
+ 0 | 1 | 2,
3587
+ ProtocolString5To400Bytes
3588
+ ];
3589
+ keyID: KeyIDStringUnder800Bytes;
3590
+ privilegedReason?: DescriptionString5to50Bytes;
3591
+ counterparty?: PubKeyHex | "self" | "anyone";
3592
+ privileged?: BooleanDefaultFalse;
3593
+ }): Promise<{
3594
+ plaintext: Byte[];
3595
+ }>
3596
+ async createHmac(args: {
3597
+ data: Byte[];
3598
+ protocolID: [
3599
+ 0 | 1 | 2,
3600
+ ProtocolString5To400Bytes
3601
+ ];
3602
+ keyID: KeyIDStringUnder800Bytes;
3603
+ privilegedReason?: DescriptionString5to50Bytes;
3604
+ counterparty?: PubKeyHex | "self" | "anyone";
3605
+ privileged?: BooleanDefaultFalse;
3606
+ }): Promise<{
3607
+ hmac: Byte[];
3608
+ }>
3609
+ async verifyHmac(args: {
3610
+ data: Byte[];
3611
+ hmac: Byte[];
3612
+ protocolID: [
3613
+ 0 | 1 | 2,
3614
+ ProtocolString5To400Bytes
3615
+ ];
3616
+ keyID: KeyIDStringUnder800Bytes;
3617
+ privilegedReason?: DescriptionString5to50Bytes;
3618
+ counterparty?: PubKeyHex | "self" | "anyone";
3619
+ privileged?: BooleanDefaultFalse;
3620
+ }): Promise<{
3621
+ valid: true;
3622
+ }>
3623
+ async createSignature(args: {
3624
+ data?: Byte[];
3625
+ hashToDirectlySign?: Byte[];
3626
+ protocolID: [
3627
+ 0 | 1 | 2,
3628
+ ProtocolString5To400Bytes
3629
+ ];
3630
+ keyID: KeyIDStringUnder800Bytes;
3631
+ privilegedReason?: DescriptionString5to50Bytes;
3632
+ counterparty?: PubKeyHex | "self" | "anyone";
3633
+ privileged?: BooleanDefaultFalse;
3634
+ }): Promise<{
3635
+ signature: Byte[];
3636
+ }>
3637
+ async verifySignature(args: {
3638
+ data?: Byte[];
3639
+ hashToDirectlyVerify?: Byte[];
3640
+ signature: Byte[];
3641
+ protocolID: [
3642
+ 0 | 1 | 2,
3643
+ ProtocolString5To400Bytes
3644
+ ];
3645
+ keyID: KeyIDStringUnder800Bytes;
3646
+ privilegedReason?: DescriptionString5to50Bytes;
3647
+ counterparty?: PubKeyHex | "self" | "anyone";
3648
+ forSelf?: BooleanDefaultFalse;
3649
+ privileged?: BooleanDefaultFalse;
3650
+ }): Promise<{
3651
+ valid: true;
3652
+ }>
3653
+ async acquireCertificate(args: {
3654
+ type: Base64String;
3655
+ subject: PubKeyHex;
3656
+ serialNumber: Base64String;
3657
+ revocationOutpoint: OutpointString;
3658
+ signature: HexString;
3659
+ fields: Record<CertificateFieldNameUnder50Bytes, string>;
3660
+ certifier: PubKeyHex;
3661
+ keyringRevealer: PubKeyHex | "certifier";
3662
+ keyringForSubject: Record<CertificateFieldNameUnder50Bytes, Base64String>;
3663
+ acquisitionProtocol: "direct" | "issuance";
3664
+ certifierUrl?: string;
3665
+ }): Promise<{
3666
+ type: Base64String;
3667
+ subject: PubKeyHex;
3668
+ serialNumber: Base64String;
3669
+ certifier: PubKeyHex;
3670
+ revocationOutpoint: OutpointString;
3671
+ signature: HexString;
3672
+ fields: Record<CertificateFieldNameUnder50Bytes, string>;
3673
+ }>
3674
+ async listCertificates(args: {
3675
+ certifiers: PubKeyHex[];
3676
+ types: Base64String[];
3677
+ limit?: PositiveIntegerDefault10Max10000;
3678
+ offset?: PositiveIntegerOrZero;
3679
+ privileged?: BooleanDefaultFalse;
3680
+ privilegedReason?: DescriptionString5to50Bytes;
3681
+ }): Promise<{
3682
+ totalCertificates: PositiveIntegerOrZero;
3683
+ certificates: Array<{
3684
+ type: Base64String;
3685
+ subject: PubKeyHex;
3686
+ serialNumber: Base64String;
3687
+ certifier: PubKeyHex;
3688
+ revocationOutpoint: OutpointString;
3689
+ signature: HexString;
3690
+ fields: Record<CertificateFieldNameUnder50Bytes, string>;
3691
+ }>;
3692
+ }>
3693
+ async proveCertificate(args: {
3694
+ certificate: {
3695
+ type: Base64String;
3696
+ subject: PubKeyHex;
3697
+ serialNumber: Base64String;
3698
+ certifier: PubKeyHex;
3699
+ revocationOutpoint: OutpointString;
3700
+ signature: HexString;
3701
+ fields: Record<CertificateFieldNameUnder50Bytes, string>;
3702
+ };
3703
+ fieldsToReveal: CertificateFieldNameUnder50Bytes[];
3704
+ verifier: PubKeyHex;
3705
+ privileged?: BooleanDefaultFalse;
3706
+ privilegedReason?: DescriptionString5to50Bytes;
3707
+ }): Promise<{
3708
+ keyringForVerifier: Record<CertificateFieldNameUnder50Bytes, Base64String>;
3709
+ }>
3710
+ async relinquishCertificate(args: {
3711
+ type: Base64String;
3712
+ serialNumber: Base64String;
3713
+ certifier: PubKeyHex;
3714
+ }): Promise<{
3715
+ relinquished: true;
3716
+ }>
3717
+ async discoverByIdentityKey(args: {
3718
+ identityKey: PubKeyHex;
3719
+ limit?: PositiveIntegerDefault10Max10000;
3720
+ offset?: PositiveIntegerOrZero;
3721
+ }): Promise<{
3722
+ totalCertificates: PositiveIntegerOrZero;
3723
+ certificates: Array<{
3724
+ type: Base64String;
3725
+ subject: PubKeyHex;
3726
+ serialNumber: Base64String;
3727
+ certifier: PubKeyHex;
3728
+ revocationOutpoint: OutpointString;
3729
+ signature: HexString;
3730
+ fields: Record<CertificateFieldNameUnder50Bytes, Base64String>;
3731
+ certifierInfo: {
3732
+ name: EntityNameStringMax100Bytes;
3733
+ iconUrl: EntityIconURLStringMax500Bytes;
3734
+ description: DescriptionString5to50Bytes;
3735
+ trust: PositiveIntegerMax10;
3736
+ };
3737
+ publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
3738
+ decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
3739
+ }>;
3740
+ }>
3741
+ async discoverByAttributes(args: {
3742
+ attributes: Record<CertificateFieldNameUnder50Bytes, string>;
3743
+ limit?: PositiveIntegerDefault10Max10000;
3744
+ offset?: PositiveIntegerOrZero;
3745
+ }): Promise<{
3746
+ totalCertificates: PositiveIntegerOrZero;
3747
+ certificates: Array<{
3748
+ type: Base64String;
3749
+ subject: PubKeyHex;
3750
+ serialNumber: Base64String;
3751
+ certifier: PubKeyHex;
3752
+ revocationOutpoint: OutpointString;
3753
+ signature: HexString;
3754
+ fields: Record<CertificateFieldNameUnder50Bytes, Base64String>;
3755
+ certifierInfo: {
3756
+ name: EntityNameStringMax100Bytes;
3757
+ iconUrl: EntityIconURLStringMax500Bytes;
3758
+ description: DescriptionString5to50Bytes;
3759
+ trust: PositiveIntegerMax10;
3760
+ };
3761
+ publiclyRevealedKeyring: Record<CertificateFieldNameUnder50Bytes, Base64String>;
3762
+ decryptedFields: Record<CertificateFieldNameUnder50Bytes, string>;
3763
+ }>;
3764
+ }>
3765
+ async isAuthenticated(args: {} = {}): Promise<{
3766
+ authenticated: boolean;
3767
+ }>
3768
+ async waitForAuthentication(args: {} = {}): Promise<{
3769
+ authenticated: true;
3770
+ }>
3771
+ async getHeight(args: {} = {}): Promise<{
3772
+ height: PositiveInteger;
3773
+ }>
3774
+ async getHeaderForHeight(args: {
3775
+ height: PositiveInteger;
3776
+ }): Promise<{
3777
+ header: HexString;
3778
+ }>
3779
+ async getNetwork(args: {} = {}): Promise<{
3780
+ network: "mainnet" | "testnet";
3781
+ }>
3782
+ async getVersion(args: {} = {}): Promise<{
3783
+ version: VersionString7To30Bytes;
3784
+ }>
3785
+ }
3786
+ ```
3787
+
3788
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3789
+
3790
+ ---
3791
+ ### Class: WalletWireProcessor
3792
+
3793
+ Processes incoming wallet calls received over a wallet wire, with a given wallet.
3794
+
3795
+ ```ts
3796
+ export default class WalletWireProcessor implements WalletWire {
3797
+ wallet: Wallet;
3798
+ constructor(wallet: Wallet)
3799
+ async transmitToWallet(message: number[]): Promise<number[]>
3800
+ }
3801
+ ```
3802
+
3803
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3804
+
3805
+ ---
3806
+ ## Functions
3807
+
3808
+ ## Types
3809
+
3810
+ | | | |
3811
+ | --- | --- | --- |
3812
+ | [AcquisitionProtocol](#type-acquisitionprotocol) | [EntityNameStringMax100Bytes](#type-entitynamestringmax100characters) | [PositiveIntegerMax10](#type-positiveintegermax10) |
3813
+ | [ActionStatus](#type-actionstatus) | [ErrorCodeString10To40Bytes](#type-errorcodestring10to40characters) | [PositiveIntegerOrZero](#type-positiveintegerorzero) |
3814
+ | [AtomicBEEF](#type-atomicbeef) | [ErrorDescriptionString20To200Bytes](#type-errordescriptionstring20to200characters) | [ProtocolString5To400Bytes](#type-protocolstring5to400characters) |
3815
+ | [BEEF](#type-beef) | [HexString](#type-hexstring) | [PubKeyHex](#type-pubkeyhex) |
3816
+ | [Base64String](#type-base64string) | [ISOTimestampString](#type-isotimestampstring) | [SatoshiValue](#type-satoshivalue) |
3817
+ | [BasketStringUnder300Bytes](#type-basketstringunder300characters) | [KeyIDStringUnder800Bytes](#type-keyidstringunder800characters) | [TXIDHexString](#type-txidhexstring) |
3818
+ | [BooleanDefaultFalse](#type-booleandefaultfalse) | [KeyringRevealer](#type-keyringrevealer) | [TrustSelf](#type-trustself) |
3819
+ | [BooleanDefaultTrue](#type-booleandefaulttrue) | [LabelStringUnder300Bytes](#type-labelstringunder300characters) | [VersionString7To30Bytes](#type-versionstring7to30characters) |
3820
+ | [Byte](#type-byte) | [OriginatorDomainNameStringUnder250Bytes](#type-originatordomainnamestringunder250characters) | [WalletCounterparty](#type-walletcounterparty) |
3821
+ | [CallType](#type-calltype) | [OutpointString](#type-outpointstring) | [WalletErrorCode](#type-walleterrorcode) |
3822
+ | [CertificateFieldNameUnder50Bytes](#type-certificatefieldnameunder50characters) | [OutputTagStringUnder300Bytes](#type-outputtagstringunder300characters) | [WalletNetwork](#type-walletnetwork) |
3823
+ | [DescriptionString5to50Bytes](#type-descriptionstring5to50characters) | [PositiveInteger](#type-positiveinteger) | [WalletProtocol](#type-walletprotocol) |
3824
+ | [EntityIconURLStringMax500Bytes](#type-entityiconurlstringmax500characters) | [PositiveIntegerDefault10Max10000](#type-positiveintegerdefault10max10000) | |
3825
+
3826
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3827
+
3828
+ ---
3829
+
3830
+ ### Type: BooleanDefaultFalse
3831
+
3832
+ ```ts
3833
+ export type BooleanDefaultFalse = boolean
3834
+ ```
3835
+
3836
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3837
+
3838
+ ---
3839
+ ### Type: BooleanDefaultTrue
3840
+
3841
+ ```ts
3842
+ export type BooleanDefaultTrue = boolean
3843
+ ```
3844
+
3845
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3846
+
3847
+ ---
3848
+ ### Type: Byte
3849
+
3850
+ ```ts
3851
+ export type Byte = number
3852
+ ```
3853
+
3854
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3855
+
3856
+ ---
3857
+ ### Type: PositiveIntegerOrZero
3858
+
3859
+ ```ts
3860
+ export type PositiveIntegerOrZero = number
3861
+ ```
3862
+
3863
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3864
+
3865
+ ---
3866
+ ### Type: PositiveInteger
3867
+
3868
+ ```ts
3869
+ export type PositiveInteger = number
3870
+ ```
3871
+
3872
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3873
+
3874
+ ---
3875
+ ### Type: PositiveIntegerMax10
3876
+
3877
+ ```ts
3878
+ export type PositiveIntegerMax10 = number
3879
+ ```
3880
+
3881
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3882
+
3883
+ ---
3884
+ ### Type: PositiveIntegerDefault10Max10000
3885
+
3886
+ ```ts
3887
+ export type PositiveIntegerDefault10Max10000 = number
3888
+ ```
3889
+
3890
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3891
+
3892
+ ---
3893
+ ### Type: SatoshiValue
3894
+
3895
+ ```ts
3896
+ export type SatoshiValue = number
3897
+ ```
3898
+
3899
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3900
+
3901
+ ---
3902
+ ### Type: ISOTimestampString
3903
+
3904
+ ```ts
3905
+ export type ISOTimestampString = string
3906
+ ```
3907
+
3908
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3909
+
3910
+ ---
3911
+ ### Type: HexString
3912
+
3913
+ ```ts
3914
+ export type HexString = string
3915
+ ```
3916
+
3917
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3918
+
3919
+ ---
3920
+ ### Type: TXIDHexString
3921
+
3922
+ ```ts
3923
+ export type TXIDHexString = HexString
3924
+ ```
3925
+
3926
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3927
+
3928
+ ---
3929
+ ### Type: OutpointString
3930
+
3931
+ ```ts
3932
+ export type OutpointString = string
3933
+ ```
3934
+
3935
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3936
+
3937
+ ---
3938
+ ### Type: PubKeyHex
3939
+
3940
+ ```ts
3941
+ export type PubKeyHex = HexString
3942
+ ```
3943
+
3944
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3945
+
3946
+ ---
3947
+ ### Type: Base64String
3948
+
3949
+ ```ts
3950
+ export type Base64String = string
3951
+ ```
3952
+
3953
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3954
+
3955
+ ---
3956
+ ### Type: OriginatorDomainNameStringUnder250Bytes
3957
+
3958
+ ```ts
3959
+ export type OriginatorDomainNameStringUnder250Bytes = string
3960
+ ```
3961
+
3962
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3963
+
3964
+ ---
3965
+ ### Type: DescriptionString5to50Bytes
3966
+
3967
+ ```ts
3968
+ export type DescriptionString5to50Bytes = string
3969
+ ```
3970
+
3971
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3972
+
3973
+ ---
3974
+ ### Type: BasketStringUnder300Bytes
3975
+
3976
+ ```ts
3977
+ export type BasketStringUnder300Bytes = string
3978
+ ```
3979
+
3980
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3981
+
3982
+ ---
3983
+ ### Type: OutputTagStringUnder300Bytes
3984
+
3985
+ ```ts
3986
+ export type OutputTagStringUnder300Bytes = string
3987
+ ```
3988
+
3989
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3990
+
3991
+ ---
3992
+ ### Type: LabelStringUnder300Bytes
3993
+
3994
+ ```ts
3995
+ export type LabelStringUnder300Bytes = string
3996
+ ```
3997
+
3998
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
3999
+
4000
+ ---
4001
+ ### Type: BEEF
4002
+
4003
+ ```ts
4004
+ export type BEEF = Byte[]
4005
+ ```
4006
+
4007
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4008
+
4009
+ ---
4010
+ ### Type: AtomicBEEF
4011
+
4012
+ ```ts
4013
+ export type AtomicBEEF = Byte[]
4014
+ ```
4015
+
4016
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4017
+
4018
+ ---
4019
+ ### Type: ProtocolString5To400Bytes
4020
+
4021
+ ```ts
4022
+ export type ProtocolString5To400Bytes = string
4023
+ ```
4024
+
4025
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4026
+
4027
+ ---
4028
+ ### Type: KeyIDStringUnder800Bytes
4029
+
4030
+ ```ts
4031
+ export type KeyIDStringUnder800Bytes = string
4032
+ ```
4033
+
4034
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4035
+
4036
+ ---
4037
+ ### Type: CertificateFieldNameUnder50Bytes
4038
+
4039
+ ```ts
4040
+ export type CertificateFieldNameUnder50Bytes = string
4041
+ ```
4042
+
4043
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4044
+
4045
+ ---
4046
+ ### Type: EntityNameStringMax100Bytes
4047
+
4048
+ ```ts
4049
+ export type EntityNameStringMax100Bytes = string
4050
+ ```
4051
+
4052
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4053
+
4054
+ ---
4055
+ ### Type: EntityIconURLStringMax500Bytes
4056
+
4057
+ ```ts
4058
+ export type EntityIconURLStringMax500Bytes = string
4059
+ ```
4060
+
4061
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4062
+
4063
+ ---
4064
+ ### Type: VersionString7To30Bytes
4065
+
4066
+ ```ts
4067
+ export type VersionString7To30Bytes = string
4068
+ ```
4069
+
4070
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4071
+
4072
+ ---
4073
+ ### Type: ErrorCodeString10To40Bytes
4074
+
4075
+ ```ts
4076
+ export type ErrorCodeString10To40Bytes = string
4077
+ ```
4078
+
4079
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4080
+
4081
+ ---
4082
+ ### Type: ErrorDescriptionString20To200Bytes
4083
+
4084
+ ```ts
4085
+ export type ErrorDescriptionString20To200Bytes = string
4086
+ ```
4087
+
4088
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4089
+
4090
+ ---
4091
+ ### Type: WalletNetwork
4092
+
4093
+ ```ts
4094
+ export type WalletNetwork = "mainnet" | "testnet"
4095
+ ```
4096
+
4097
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4098
+
4099
+ ---
4100
+ ### Type: WalletProtocol
4101
+
4102
+ ```ts
4103
+ export type WalletProtocol = [
4104
+ 0 | 1 | 2,
4105
+ ProtocolString5To400Bytes
4106
+ ]
4107
+ ```
4108
+
4109
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4110
+
4111
+ ---
4112
+ ### Type: WalletCounterparty
4113
+
4114
+ ```ts
4115
+ export type WalletCounterparty = PubKeyHex | "self" | "anyone"
4116
+ ```
4117
+
4118
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4119
+
4120
+ ---
4121
+ ### Type: AcquisitionProtocol
4122
+
4123
+ ```ts
4124
+ export type AcquisitionProtocol = "direct" | "issuance"
4125
+ ```
4126
+
4127
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4128
+
4129
+ ---
4130
+ ### Type: KeyringRevealer
4131
+
4132
+ ```ts
4133
+ export type KeyringRevealer = PubKeyHex | "certifier"
4134
+ ```
4135
+
4136
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4137
+
4138
+ ---
4139
+ ### Type: ActionStatus
4140
+
4141
+ ```ts
4142
+ export type ActionStatus = "completed" | "unprocessed" | "sending" | "unproven" | "unsigned" | "nosend" | "nonfinal"
4143
+ ```
4144
+
4145
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4146
+
4147
+ ---
4148
+ ### Type: TrustSelf
4149
+
4150
+ Controls behavior of input BEEF validation.
4151
+
4152
+ If `known`, input transactions may omit supporting validity proof data for all TXIDs known to this wallet.
4153
+
4154
+ If undefined, input BEEFs must be complete and valid.
4155
+
4156
+ ```ts
4157
+ export type TrustSelf = "known"
4158
+ ```
4159
+
4160
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4161
+
4162
+ ---
4163
+ ### Type: WalletErrorCode
4164
+
4165
+ ```ts
4166
+ export type WalletErrorCode = keyof typeof walletErrors
4167
+ ```
4168
+
4169
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4170
+
4171
+ ---
4172
+ ### Type: CallType
4173
+
4174
+ ```ts
4175
+ export type CallType = keyof typeof calls
4176
+ ```
4177
+
4178
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4179
+
4180
+ ---
4181
+ ## Variables
4182
+