@bsv/sdk 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/package.json +2 -2
- package/dist/cjs/src/overlay-tools/SHIPBroadcaster.js +3 -2
- package/dist/cjs/src/overlay-tools/SHIPBroadcaster.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/src/overlay-tools/SHIPBroadcaster.js +3 -2
- package/dist/esm/src/overlay-tools/SHIPBroadcaster.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/src/overlay-tools/SHIPBroadcaster.d.ts.map +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/umd/bundle.js +1 -1
- package/docs/compat.md +166 -135
- package/docs/messages.md +63 -55
- package/docs/overlay-tools.md +136 -120
- package/docs/primitives.md +4095 -3812
- package/docs/script.md +506 -467
- package/docs/totp.md +8 -0
- package/docs/transaction.md +822 -735
- package/docs/wallet.md +921 -1209
- package/package.json +2 -2
- package/src/overlay-tools/SHIPBroadcaster.ts +3 -2
- package/src/overlay-tools/__tests/SHIPBroadcaster.test.ts +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bsv/sdk",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "BSV Blockchain Software Development Kit",
|
|
6
6
|
"main": "dist/cjs/mod.js",
|
|
@@ -214,7 +214,7 @@
|
|
|
214
214
|
"ts-jest": "^29.1.1",
|
|
215
215
|
"ts-loader": "^9.5.1",
|
|
216
216
|
"ts-standard": "^12.0.2",
|
|
217
|
-
"ts2md": "^0.2.
|
|
217
|
+
"ts2md": "^0.2.4",
|
|
218
218
|
"tsconfig-to-dual-package": "^1.2.0",
|
|
219
219
|
"typescript": "^5.2.2",
|
|
220
220
|
"webpack": "^5.95.0",
|
|
@@ -116,8 +116,8 @@ export default class SHIPCast implements Broadcaster {
|
|
|
116
116
|
} = config ?? {} as SHIPBroadcasterConfig
|
|
117
117
|
this.facilitator = facilitator ?? new HTTPSOverlayBroadcastFacilitator()
|
|
118
118
|
this.resolver = resolver ?? new LookupResolver()
|
|
119
|
-
this.requireAcknowledgmentFromAllHostsForTopics = requireAcknowledgmentFromAllHostsForTopics ??
|
|
120
|
-
this.requireAcknowledgmentFromAnyHostForTopics = requireAcknowledgmentFromAnyHostForTopics ??
|
|
119
|
+
this.requireAcknowledgmentFromAllHostsForTopics = requireAcknowledgmentFromAllHostsForTopics ?? []
|
|
120
|
+
this.requireAcknowledgmentFromAnyHostForTopics = requireAcknowledgmentFromAnyHostForTopics ?? 'all'
|
|
121
121
|
this.requireAcknowledgmentFromSpecificHostsForTopics = requireAcknowledgmentFromSpecificHostsForTopics ?? {}
|
|
122
122
|
}
|
|
123
123
|
|
|
@@ -178,6 +178,7 @@ export default class SHIPCast implements Broadcaster {
|
|
|
178
178
|
for (const [topic, instructions] of Object.entries(steak)) {
|
|
179
179
|
const outputsToAdmit = instructions.outputsToAdmit
|
|
180
180
|
const coinsToRetain = instructions.coinsToRetain
|
|
181
|
+
// TODO: Account for coins removed property on STEAK
|
|
181
182
|
if ((outputsToAdmit && outputsToAdmit.length > 0) || (coinsToRetain && coinsToRetain.length > 0)) {
|
|
182
183
|
acknowledgedTopics.add(topic)
|
|
183
184
|
}
|
|
@@ -401,7 +401,7 @@ describe('SHIPCast', () => {
|
|
|
401
401
|
expect(mockFacilitator.send).toHaveBeenCalledTimes(2)
|
|
402
402
|
})
|
|
403
403
|
|
|
404
|
-
it('should fail
|
|
404
|
+
it('should fail if at least one host does not acknowledge every topic (default behavior)', async () => {
|
|
405
405
|
const shipHostKey1 = new PrivateKey(42)
|
|
406
406
|
const shipWallet1 = new ProtoWallet(shipHostKey1)
|
|
407
407
|
const shipLib1 = new OverlayAdminTokenTemplate(shipWallet1)
|
|
@@ -434,7 +434,7 @@ describe('SHIPCast', () => {
|
|
|
434
434
|
const steak = {}
|
|
435
435
|
for (const topic of topics) {
|
|
436
436
|
steak[topic] = {
|
|
437
|
-
outputsToAdmit: [
|
|
437
|
+
outputsToAdmit: [],
|
|
438
438
|
coinsToRetain: []
|
|
439
439
|
}
|
|
440
440
|
}
|
|
@@ -462,8 +462,8 @@ describe('SHIPCast', () => {
|
|
|
462
462
|
|
|
463
463
|
expect(response).toEqual({
|
|
464
464
|
status: 'error',
|
|
465
|
-
code: '
|
|
466
|
-
description: '
|
|
465
|
+
code: 'ERR_REQUIRE_ACK_FROM_ANY_HOST_FAILED',
|
|
466
|
+
description: 'No host acknowledged the required topics.'
|
|
467
467
|
})
|
|
468
468
|
})
|
|
469
469
|
|