@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
@@ -0,0 +1,551 @@
1
+ # API
2
+
3
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
4
+
5
+ ## Interfaces
6
+
7
+ | |
8
+ | --- |
9
+ | [AdmittanceInstructions](#interface-admittanceinstructions) |
10
+ | [LookupQuestion](#interface-lookupquestion) |
11
+ | [LookupResolverConfig](#interface-lookupresolverconfig) |
12
+ | [OverlayBroadcastFacilitator](#interface-overlaybroadcastfacilitator) |
13
+ | [OverlayLookupFacilitator](#interface-overlaylookupfacilitator) |
14
+ | [SHIPBroadcasterConfig](#interface-shipbroadcasterconfig) |
15
+ | [TaggedBEEF](#interface-taggedbeef) |
16
+
17
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
18
+
19
+ ---
20
+
21
+ ### Interface: LookupQuestion
22
+
23
+ The question asked to the Overlay Services Engine when a consumer of state wishes to look up information.
24
+
25
+ ```ts
26
+ export interface LookupQuestion {
27
+ service: string;
28
+ query: unknown;
29
+ }
30
+ ```
31
+
32
+ <details>
33
+
34
+ <summary>Interface LookupQuestion Details</summary>
35
+
36
+ #### Property query
37
+
38
+ The query which will be forwarded to the Lookup Service.
39
+ Its type depends on that prescribed by the Lookup Service employed.
40
+
41
+ ```ts
42
+ query: unknown
43
+ ```
44
+
45
+ #### Property service
46
+
47
+ The identifier for a Lookup Service which the person asking the question wishes to use.
48
+
49
+ ```ts
50
+ service: string
51
+ ```
52
+
53
+ </details>
54
+
55
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
56
+
57
+ ---
58
+ ### Interface: LookupResolverConfig
59
+
60
+ Configuration options for the Lookup resolver.
61
+
62
+ ```ts
63
+ export interface LookupResolverConfig {
64
+ facilitator?: OverlayLookupFacilitator;
65
+ slapTrackers?: string[];
66
+ hostOverrides?: Record<string, string[]>;
67
+ additionalHosts?: Record<string, string[]>;
68
+ }
69
+ ```
70
+
71
+ <details>
72
+
73
+ <summary>Interface LookupResolverConfig Details</summary>
74
+
75
+ #### Property additionalHosts
76
+
77
+ Map of lookup service names to arrays of hosts to use in addition to resolving via SLAP.
78
+
79
+ ```ts
80
+ additionalHosts?: Record<string, string[]>
81
+ ```
82
+
83
+ #### Property facilitator
84
+
85
+ The facilitator used to make requests to Overlay Services hosts.
86
+
87
+ ```ts
88
+ facilitator?: OverlayLookupFacilitator
89
+ ```
90
+
91
+ #### Property hostOverrides
92
+
93
+ Map of lookup service names to arrays of hosts to use in place of resolving via SLAP.
94
+
95
+ ```ts
96
+ hostOverrides?: Record<string, string[]>
97
+ ```
98
+
99
+ #### Property slapTrackers
100
+
101
+ The list of SLAP trackers queried to resolve Overlay Services hosts for a given lookup service.
102
+
103
+ ```ts
104
+ slapTrackers?: string[]
105
+ ```
106
+
107
+ </details>
108
+
109
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
110
+
111
+ ---
112
+ ### Interface: OverlayLookupFacilitator
113
+
114
+ Facilitates lookups to URLs that return answers.
115
+
116
+ ```ts
117
+ export interface OverlayLookupFacilitator {
118
+ lookup: (url: string, question: LookupQuestion) => Promise<LookupAnswer>;
119
+ }
120
+ ```
121
+
122
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
123
+
124
+ ---
125
+ ### Interface: TaggedBEEF
126
+
127
+ Tagged BEEF
128
+
129
+ ```ts
130
+ export interface TaggedBEEF {
131
+ beef: number[];
132
+ topics: string[];
133
+ }
134
+ ```
135
+
136
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
137
+
138
+ ---
139
+ ### Interface: AdmittanceInstructions
140
+
141
+ Instructs the Overlay Services Engine about which outputs to admit and which previous outputs to retain. Returned by a Topic Manager.
142
+
143
+ ```ts
144
+ export interface AdmittanceInstructions {
145
+ outputsToAdmit: number[];
146
+ coinsToRetain: number[];
147
+ }
148
+ ```
149
+
150
+ <details>
151
+
152
+ <summary>Interface AdmittanceInstructions Details</summary>
153
+
154
+ #### Property coinsToRetain
155
+
156
+ The indices of all inputs from the provided transaction which spend previously-admitted outputs that should be retained for historical record-keeping.
157
+
158
+ ```ts
159
+ coinsToRetain: number[]
160
+ ```
161
+
162
+ #### Property outputsToAdmit
163
+
164
+ The indices of all admissable outputs into the managed topic from the provided transaction.
165
+
166
+ ```ts
167
+ outputsToAdmit: number[]
168
+ ```
169
+
170
+ </details>
171
+
172
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
173
+
174
+ ---
175
+ ### Interface: SHIPBroadcasterConfig
176
+
177
+ Configuration options for the SHIP broadcaster.
178
+
179
+ ```ts
180
+ export interface SHIPBroadcasterConfig {
181
+ facilitator?: OverlayBroadcastFacilitator;
182
+ resolver: LookupResolver;
183
+ requireAcknowledgmentFromAllHostsForTopics?: "all" | "any" | string[];
184
+ requireAcknowledgmentFromAnyHostForTopics?: "all" | "any" | string[];
185
+ requireAcknowledgmentFromSpecificHostsForTopics?: Record<string, "all" | "any" | string[]>;
186
+ }
187
+ ```
188
+
189
+ <details>
190
+
191
+ <summary>Interface SHIPBroadcasterConfig Details</summary>
192
+
193
+ #### Property facilitator
194
+
195
+ The facilitator used to make requests to Overlay Services hosts.
196
+
197
+ ```ts
198
+ facilitator?: OverlayBroadcastFacilitator
199
+ ```
200
+
201
+ #### Property requireAcknowledgmentFromAllHostsForTopics
202
+
203
+ Determines which topics (all, any, or a specific list) must be present within all STEAKs received from every host for the broadcast to be considered a success. By default, all hosts must acknowledge all topics.
204
+
205
+ ```ts
206
+ requireAcknowledgmentFromAllHostsForTopics?: "all" | "any" | string[]
207
+ ```
208
+
209
+ #### Property requireAcknowledgmentFromAnyHostForTopics
210
+
211
+ Determines which topics (all, any, or a specific list) must be present within STEAK received from at least one host for the broadcast to be considered a success.
212
+
213
+ ```ts
214
+ requireAcknowledgmentFromAnyHostForTopics?: "all" | "any" | string[]
215
+ ```
216
+
217
+ #### Property requireAcknowledgmentFromSpecificHostsForTopics
218
+
219
+ Determines a mapping whose keys are specific hosts and whose values are the topics (all, any, or a specific list) that must be present within the STEAK received by the given hosts, in order for the broadcast to be considered a success.
220
+
221
+ ```ts
222
+ requireAcknowledgmentFromSpecificHostsForTopics?: Record<string, "all" | "any" | string[]>
223
+ ```
224
+
225
+ #### Property resolver
226
+
227
+ The resolver used to locate suitable hosts with SHIP
228
+
229
+ ```ts
230
+ resolver: LookupResolver
231
+ ```
232
+
233
+ </details>
234
+
235
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
236
+
237
+ ---
238
+ ### Interface: OverlayBroadcastFacilitator
239
+
240
+ Facilitates transaction broadcasts that return STEAK.
241
+
242
+ ```ts
243
+ export interface OverlayBroadcastFacilitator {
244
+ send: (url: string, taggedBEEF: TaggedBEEF) => Promise<STEAK>;
245
+ }
246
+ ```
247
+
248
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
249
+
250
+ ---
251
+ ## Classes
252
+
253
+ | |
254
+ | --- |
255
+ | [HTTPSOverlayBroadcastFacilitator](#class-httpsoverlaybroadcastfacilitator) |
256
+ | [HTTPSOverlayLookupFacilitator](#class-httpsoverlaylookupfacilitator) |
257
+ | [LookupResolver](#class-lookupresolver) |
258
+ | [OverlayAdminTokenTemplate](#class-overlayadmintokentemplate) |
259
+ | [SHIPCast](#class-shipcast) |
260
+
261
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
262
+
263
+ ---
264
+
265
+ ### Class: OverlayAdminTokenTemplate
266
+
267
+ Script template enabling the creation, unlocking, and decoding of SHIP and SLAP advertisements.
268
+
269
+ ```ts
270
+ export default class OverlayAdminTokenTemplate implements ScriptTemplate {
271
+ pushDrop: PushDrop;
272
+ static decode(script: LockingScript): {
273
+ protocol: "SHIP" | "SLAP";
274
+ identityKey: string;
275
+ domain: string;
276
+ topicOrService: string;
277
+ }
278
+ constructor(wallet: Wallet)
279
+ async lock(protocol: "SHIP" | "SLAP", domain: string, topicOrService: string): Promise<LockingScript>
280
+ unlock(protocol: "SHIP" | "SLAP"): {
281
+ sign: (tx: Transaction, inputIndex: number) => Promise<UnlockingScript>;
282
+ estimateLength: (tx: Transaction, inputIndex: number) => Promise<number>;
283
+ }
284
+ }
285
+ ```
286
+
287
+ <details>
288
+
289
+ <summary>Class OverlayAdminTokenTemplate Details</summary>
290
+
291
+ #### Constructor
292
+
293
+ Constructs a new Overlay Admin template instance
294
+
295
+ ```ts
296
+ constructor(wallet: Wallet)
297
+ ```
298
+
299
+ Argument Details
300
+
301
+ + **wallet**
302
+ + Wallet to use for locking and unlocking
303
+
304
+ #### Method decode
305
+
306
+ Decodes a SHIP or SLAP advertisement from a given locking script.
307
+
308
+ ```ts
309
+ static decode(script: LockingScript): {
310
+ protocol: "SHIP" | "SLAP";
311
+ identityKey: string;
312
+ domain: string;
313
+ topicOrService: string;
314
+ }
315
+ ```
316
+
317
+ Returns
318
+
319
+ Decoded SHIP or SLAP advertisement
320
+
321
+ Argument Details
322
+
323
+ + **script**
324
+ + Locking script comprising a SHIP or SLAP token to decode
325
+
326
+ #### Method lock
327
+
328
+ Creates a new advertisement locking script
329
+
330
+ ```ts
331
+ async lock(protocol: "SHIP" | "SLAP", domain: string, topicOrService: string): Promise<LockingScript>
332
+ ```
333
+
334
+ Returns
335
+
336
+ Locking script comprising the advertisement token
337
+
338
+ Argument Details
339
+
340
+ + **protocol**
341
+ + SHIP or SLAP
342
+ + **domain**
343
+ + Domain where the topic or service is available
344
+ + **topicOrService**
345
+ + Topic or service to advertise
346
+
347
+ #### Method unlock
348
+
349
+ Unlocks an advertisement token as part of a transaction.
350
+
351
+ ```ts
352
+ unlock(protocol: "SHIP" | "SLAP"): {
353
+ sign: (tx: Transaction, inputIndex: number) => Promise<UnlockingScript>;
354
+ estimateLength: (tx: Transaction, inputIndex: number) => Promise<number>;
355
+ }
356
+ ```
357
+
358
+ Returns
359
+
360
+ Script unlocker capable of unlocking the advertisement token
361
+
362
+ Argument Details
363
+
364
+ + **protocol**
365
+ + SHIP or SLAP, depending on the token to unlock
366
+
367
+ </details>
368
+
369
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
370
+
371
+ ---
372
+ ### Class: HTTPSOverlayLookupFacilitator
373
+
374
+ ```ts
375
+ export class HTTPSOverlayLookupFacilitator implements OverlayLookupFacilitator {
376
+ fetchClient: typeof fetch;
377
+ constructor(httpClient = fetch)
378
+ async lookup(url: string, question: LookupQuestion): Promise<LookupAnswer>
379
+ }
380
+ ```
381
+
382
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
383
+
384
+ ---
385
+ ### Class: LookupResolver
386
+
387
+ Represents an SHIP transaction broadcaster.
388
+
389
+ ```ts
390
+ export default class LookupResolver {
391
+ constructor(config?: LookupResolverConfig)
392
+ async query(question: LookupQuestion): Promise<LookupAnswer>
393
+ }
394
+ ```
395
+
396
+ <details>
397
+
398
+ <summary>Class LookupResolver Details</summary>
399
+
400
+ #### Method query
401
+
402
+ Given a LookupQuestion, returns a LookupAnswer. Aggregates across multiple services and supports resiliency.
403
+
404
+ ```ts
405
+ async query(question: LookupQuestion): Promise<LookupAnswer>
406
+ ```
407
+
408
+ </details>
409
+
410
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
411
+
412
+ ---
413
+ ### Class: HTTPSOverlayBroadcastFacilitator
414
+
415
+ ```ts
416
+ export class HTTPSOverlayBroadcastFacilitator implements OverlayBroadcastFacilitator {
417
+ httpClient: typeof fetch;
418
+ constructor(httpClient = fetch)
419
+ async send(url: string, taggedBEEF: TaggedBEEF): Promise<STEAK>
420
+ }
421
+ ```
422
+
423
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
424
+
425
+ ---
426
+ ### Class: SHIPCast
427
+
428
+ Represents a SHIP transaction broadcaster.
429
+
430
+ ```ts
431
+ export default class SHIPCast implements Broadcaster {
432
+ constructor(topics: string[], config?: SHIPBroadcasterConfig)
433
+ async broadcast(tx: Transaction): Promise<BroadcastResponse | BroadcastFailure>
434
+ }
435
+ ```
436
+
437
+ <details>
438
+
439
+ <summary>Class SHIPCast Details</summary>
440
+
441
+ #### Constructor
442
+
443
+ Constructs an instance of the SHIP broadcaster.
444
+
445
+ ```ts
446
+ constructor(topics: string[], config?: SHIPBroadcasterConfig)
447
+ ```
448
+
449
+ Argument Details
450
+
451
+ + **topics**
452
+ + The list of SHIP topic names where transactions are to be sent.
453
+ + **config**
454
+ + Configuration options for the SHIP broadcaster.
455
+
456
+ #### Method broadcast
457
+
458
+ Broadcasts a transaction to Overlay Services via SHIP.
459
+
460
+ ```ts
461
+ async broadcast(tx: Transaction): Promise<BroadcastResponse | BroadcastFailure>
462
+ ```
463
+
464
+ Returns
465
+
466
+ A promise that resolves to either a success or failure response.
467
+
468
+ Argument Details
469
+
470
+ + **tx**
471
+ + The transaction to be sent.
472
+
473
+ </details>
474
+
475
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
476
+
477
+ ---
478
+ ## Functions
479
+
480
+ ## Types
481
+
482
+ | |
483
+ | --- |
484
+ | [LookupAnswer](#type-lookupanswer) |
485
+ | [STEAK](#type-steak) |
486
+
487
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
488
+
489
+ ---
490
+
491
+ ### Type: LookupAnswer
492
+
493
+ How the Overlay Services Engine responds to a Lookup Question.
494
+ It may comprise either an output list or a freeform response from the Lookup Service.
495
+
496
+ ```ts
497
+ export type LookupAnswer = {
498
+ type: "output-list";
499
+ outputs: Array<{
500
+ beef: number[];
501
+ outputIndex: number;
502
+ }>;
503
+ } | {
504
+ type: "freeform";
505
+ result: unknown;
506
+ }
507
+ ```
508
+
509
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
510
+
511
+ ---
512
+ ### Type: STEAK
513
+
514
+ Submitted Transaction Execution AcKnowledgment
515
+
516
+ ```ts
517
+ export type STEAK = Record<string, AdmittanceInstructions>
518
+ ```
519
+
520
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
521
+
522
+ ---
523
+ ## Variables
524
+
525
+ | |
526
+ | --- |
527
+ | [DEFAULT_SHIP_TRACKERS](#variable-default_ship_trackers) |
528
+ | [DEFAULT_SLAP_TRACKERS](#variable-default_slap_trackers) |
529
+
530
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
531
+
532
+ ---
533
+
534
+ ### Variable: DEFAULT_SLAP_TRACKERS
535
+
536
+ ```ts
537
+ DEFAULT_SLAP_TRACKERS: string[] = []
538
+ ```
539
+
540
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
541
+
542
+ ---
543
+ ### Variable: DEFAULT_SHIP_TRACKERS
544
+
545
+ ```ts
546
+ DEFAULT_SHIP_TRACKERS: string[] = []
547
+ ```
548
+
549
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
550
+
551
+ ---
package/docs/script.md CHANGED
@@ -77,6 +77,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
77
77
  | --- |
78
78
  | [LockingScript](#class-lockingscript) |
79
79
  | [P2PKH](#class-p2pkh) |
80
+ | [PushDrop](#class-pushdrop) |
80
81
  | [RPuzzle](#class-rpuzzle) |
81
82
  | [Script](#class-script) |
82
83
  | [Spend](#class-spend) |
@@ -763,6 +764,140 @@ Argument Details
763
764
 
764
765
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
765
766
 
767
+ ---
768
+ ### Class: PushDrop
769
+
770
+ ```ts
771
+ export default class PushDrop implements ScriptTemplate {
772
+ wallet: Wallet;
773
+ static decode(script: LockingScript): {
774
+ lockingPublicKey: PublicKey;
775
+ fields: number[][];
776
+ }
777
+ constructor(wallet: Wallet)
778
+ async lock(fields: number[][], protocolID: [
779
+ 0 | 1 | 2,
780
+ string
781
+ ], keyID: string, counterparty: string, forSelf = false, includeSignature = true, lockPosition: "before" | "after" = "before"): Promise<LockingScript>
782
+ unlock(protocolID: [
783
+ 0 | 1 | 2,
784
+ string
785
+ ], keyID: string, counterparty: string, signOutputs: "all" | "none" | "single" = "all", anyoneCanPay = false, sourceSatoshis?: number, lockingScript?: LockingScript): {
786
+ sign: (tx: Transaction, inputIndex: number) => Promise<UnlockingScript>;
787
+ estimateLength: () => Promise<73>;
788
+ }
789
+ }
790
+ ```
791
+
792
+ <details>
793
+
794
+ <summary>Class PushDrop Details</summary>
795
+
796
+ #### Constructor
797
+
798
+ Constructs a new instance of the PushDrop class.
799
+
800
+ ```ts
801
+ constructor(wallet: Wallet)
802
+ ```
803
+
804
+ Argument Details
805
+
806
+ + **wallet**
807
+ + The wallet interface used for creating signatures and accessing public keys.
808
+
809
+ #### Method decode
810
+
811
+ Decodes a PushDrop script back into its token fields and the locking public key. If a signature was present, it will be the last field returned.
812
+ Warning: Only works with a P2PK lock at the beginning of the script.
813
+
814
+ ```ts
815
+ static decode(script: LockingScript): {
816
+ lockingPublicKey: PublicKey;
817
+ fields: number[][];
818
+ }
819
+ ```
820
+
821
+ Returns
822
+
823
+ An object containing PushDrop token fields and the locking public key. If a signature was included, it will be the last field.
824
+
825
+ Argument Details
826
+
827
+ + **script**
828
+ + PushDrop script to decode back into token fields
829
+
830
+ #### Method lock
831
+
832
+ Creates a PushDrop locking script with arbitrary data fields and a public key lock.
833
+
834
+ ```ts
835
+ async lock(fields: number[][], protocolID: [
836
+ 0 | 1 | 2,
837
+ string
838
+ ], keyID: string, counterparty: string, forSelf = false, includeSignature = true, lockPosition: "before" | "after" = "before"): Promise<LockingScript>
839
+ ```
840
+
841
+ Returns
842
+
843
+ The generated PushDrop locking script.
844
+
845
+ Argument Details
846
+
847
+ + **fields**
848
+ + The token fields to include in the locking script.
849
+ + **protocolID**
850
+ + The protocol ID to use.
851
+ + **keyID**
852
+ + The key ID to use.
853
+ + **counterparty**
854
+ + The counterparty involved in the transaction, "self" or "anyone".
855
+ + **forSelf**
856
+ + Flag indicating if the lock is for the creator (default no).
857
+ + **includeSignature**
858
+ + Flag indicating if a signature should be included in the script (default yes).
859
+
860
+ #### Method unlock
861
+
862
+ Creates an unlocking script for spending a PushDrop token output.
863
+
864
+ ```ts
865
+ unlock(protocolID: [
866
+ 0 | 1 | 2,
867
+ string
868
+ ], keyID: string, counterparty: string, signOutputs: "all" | "none" | "single" = "all", anyoneCanPay = false, sourceSatoshis?: number, lockingScript?: LockingScript): {
869
+ sign: (tx: Transaction, inputIndex: number) => Promise<UnlockingScript>;
870
+ estimateLength: () => Promise<73>;
871
+ }
872
+ ```
873
+
874
+ Returns
875
+
876
+ An object containing functions to sign the transaction and estimate the script length.
877
+
878
+ Argument Details
879
+
880
+ + **protocolID**
881
+ + The protocol ID to use.
882
+ + **keyID**
883
+ + The key ID to use.
884
+ + **counterparty**
885
+ + The counterparty involved in the transaction, "self" or "anyone".
886
+ + **sourceTXID**
887
+ + The TXID of the source transaction.
888
+ + **sourceSatoshis**
889
+ + The number of satoshis in the source output.
890
+ + **lockingScript**
891
+ + The locking script of the source output.
892
+ + **signOutputs**
893
+ + Specifies which outputs to sign.
894
+ + **anyoneCanPay**
895
+ + Specifies if the anyone-can-pay flag is set.
896
+
897
+ </details>
898
+
899
+ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
900
+
766
901
  ---
767
902
  ## Functions
768
903