@bsv/sdk 1.4.7 → 1.4.9

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 (32) hide show
  1. package/dist/cjs/package.json +1 -1
  2. package/dist/cjs/src/overlay-tools/SHIPBroadcaster.js +1 -1
  3. package/dist/cjs/src/wallet/substrates/WalletWireProcessor.js +3 -0
  4. package/dist/cjs/src/wallet/substrates/WalletWireProcessor.js.map +1 -1
  5. package/dist/cjs/src/wallet/substrates/WalletWireTransceiver.js +3 -0
  6. package/dist/cjs/src/wallet/substrates/WalletWireTransceiver.js.map +1 -1
  7. package/dist/cjs/src/wallet/substrates/window.CWI.js.map +1 -1
  8. package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  9. package/dist/esm/src/overlay-tools/SHIPBroadcaster.js +1 -1
  10. package/dist/esm/src/wallet/substrates/WalletWireProcessor.js +3 -0
  11. package/dist/esm/src/wallet/substrates/WalletWireProcessor.js.map +1 -1
  12. package/dist/esm/src/wallet/substrates/WalletWireTransceiver.js +3 -0
  13. package/dist/esm/src/wallet/substrates/WalletWireTransceiver.js.map +1 -1
  14. package/dist/esm/src/wallet/substrates/window.CWI.js.map +1 -1
  15. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  16. package/dist/types/src/wallet/Wallet.interfaces.d.ts +1 -1
  17. package/dist/types/src/wallet/Wallet.interfaces.d.ts.map +1 -1
  18. package/dist/types/src/wallet/substrates/WalletWireProcessor.d.ts.map +1 -1
  19. package/dist/types/src/wallet/substrates/WalletWireTransceiver.d.ts.map +1 -1
  20. package/dist/types/src/wallet/substrates/window.CWI.d.ts +1 -1
  21. package/dist/types/src/wallet/substrates/window.CWI.d.ts.map +1 -1
  22. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  23. package/dist/umd/bundle.js +1 -1
  24. package/docs/wallet-substrates.md +1 -1
  25. package/docs/wallet.md +2 -2
  26. package/package.json +1 -1
  27. package/src/overlay-tools/SHIPBroadcaster.ts +1 -1
  28. package/src/overlay-tools/__tests/SHIPBroadcaster.test.ts +4 -4
  29. package/src/wallet/Wallet.interfaces.ts +1 -0
  30. package/src/wallet/substrates/WalletWireProcessor.ts +3 -0
  31. package/src/wallet/substrates/WalletWireTransceiver.ts +7 -17
  32. package/src/wallet/substrates/window.CWI.ts +1 -0
@@ -382,7 +382,7 @@ export default class WindowCWISubstrate implements WalletInterface {
382
382
  actions: Array<{
383
383
  txid: TXIDHexString;
384
384
  satoshis: SatoshiValue;
385
- status: "completed" | "unprocessed" | "sending" | "unproven" | "unsigned" | "nosend" | "nonfinal";
385
+ status: "completed" | "unprocessed" | "sending" | "unproven" | "unsigned" | "nosend" | "nonfinal" | "failed";
386
386
  isOutgoing: boolean;
387
387
  description: DescriptionString5to50Bytes;
388
388
  labels?: LabelStringUnder300Bytes[];
package/docs/wallet.md CHANGED
@@ -2660,7 +2660,7 @@ export default class WindowCWISubstrate implements WalletInterface {
2660
2660
  actions: Array<{
2661
2661
  txid: TXIDHexString;
2662
2662
  satoshis: SatoshiValue;
2663
- status: "completed" | "unprocessed" | "sending" | "unproven" | "unsigned" | "nosend" | "nonfinal";
2663
+ status: "completed" | "unprocessed" | "sending" | "unproven" | "unsigned" | "nosend" | "nonfinal" | "failed";
2664
2664
  isOutgoing: boolean;
2665
2665
  description: DescriptionString5to50Bytes;
2666
2666
  labels?: LabelStringUnder300Bytes[];
@@ -3501,7 +3501,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
3501
3501
  ### Type: ActionStatus
3502
3502
 
3503
3503
  ```ts
3504
- export type ActionStatus = "completed" | "unprocessed" | "sending" | "unproven" | "unsigned" | "nosend" | "nonfinal"
3504
+ export type ActionStatus = "completed" | "unprocessed" | "sending" | "unproven" | "unsigned" | "nosend" | "nonfinal" | "failed"
3505
3505
  ```
3506
3506
 
3507
3507
  Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bsv/sdk",
3
- "version": "1.4.7",
3
+ "version": "1.4.9",
4
4
  "type": "module",
5
5
  "description": "BSV Blockchain Software Development Kit",
6
6
  "main": "dist/cjs/mod.js",
@@ -74,7 +74,7 @@ export interface OverlayBroadcastFacilitator {
74
74
  send: (url: string, taggedBEEF: TaggedBEEF) => Promise<STEAK>
75
75
  }
76
76
 
77
- const MAX_SHIP_QUERY_TIMEOUT = 1000
77
+ const MAX_SHIP_QUERY_TIMEOUT = 5000
78
78
 
79
79
  export class HTTPSOverlayBroadcastFacilitator implements OverlayBroadcastFacilitator {
80
80
  httpClient: typeof fetch
@@ -88,7 +88,7 @@ describe('SHIPCast', () => {
88
88
  topics: ['tm_foo']
89
89
  }
90
90
  },
91
- 1000
91
+ 5000
92
92
  )
93
93
 
94
94
  expect(mockFacilitator.send).toHaveBeenCalledWith('https://shiphost.com', {
@@ -289,7 +289,7 @@ describe('SHIPCast', () => {
289
289
  topics: ['tm_foo']
290
290
  }
291
291
  },
292
- 1000
292
+ 5000
293
293
  )
294
294
 
295
295
  expect(mockFacilitator.send).not.toHaveBeenCalled()
@@ -516,7 +516,7 @@ describe('SHIPCast', () => {
516
516
  topics: ['tm_foo', 'tm_bar']
517
517
  }
518
518
  },
519
- 1000
519
+ 5000
520
520
  )
521
521
 
522
522
  expect(mockFacilitator.send).toHaveBeenCalledTimes(2)
@@ -971,7 +971,7 @@ describe('SHIPCast', () => {
971
971
  topics: ['tm_foo', 'tm_bar']
972
972
  }
973
973
  },
974
- 1000
974
+ 5000
975
975
  )
976
976
  })
977
977
 
@@ -230,6 +230,7 @@ export type ActionStatus =
230
230
  | 'unsigned'
231
231
  | 'nosend'
232
232
  | 'nonfinal'
233
+ | 'failed'
233
234
 
234
235
  /**
235
236
  * Controls behavior of input BEEF validation.
@@ -626,6 +626,9 @@ export default class WalletWireProcessor implements WalletWire {
626
626
  case 'nonfinal':
627
627
  statusCode = 7
628
628
  break
629
+ case 'failed':
630
+ statusCode = 8
631
+ break
629
632
  default:
630
633
  statusCode = -1
631
634
  break
@@ -43,7 +43,8 @@ import {
43
43
  SignActionResult,
44
44
  TXIDHexString,
45
45
  VersionString7To30Bytes,
46
- WalletInterface
46
+ WalletInterface,
47
+ ActionStatus
47
48
  } from '../Wallet.interfaces.js'
48
49
  import WalletWire from './WalletWire.js'
49
50
  import Certificate from '../../auth/certificates/Certificate.js'
@@ -602,14 +603,7 @@ export default class WalletWireTransceiver implements WalletInterface {
602
603
  const actions: Array<{
603
604
  txid: TXIDHexString
604
605
  satoshis: SatoshiValue
605
- status:
606
- | 'completed'
607
- | 'unprocessed'
608
- | 'sending'
609
- | 'unproven'
610
- | 'unsigned'
611
- | 'nosend'
612
- | 'nonfinal'
606
+ status: ActionStatus
613
607
  isOutgoing: boolean
614
608
  description: DescriptionString5to50Bytes
615
609
  labels?: LabelStringUnder300Bytes[]
@@ -643,14 +637,7 @@ export default class WalletWireTransceiver implements WalletInterface {
643
637
  const satoshis = resultReader.readVarIntNum()
644
638
 
645
639
  const statusCode = resultReader.readInt8()
646
- let status:
647
- | 'completed'
648
- | 'unprocessed'
649
- | 'sending'
650
- | 'unproven'
651
- | 'unsigned'
652
- | 'nosend'
653
- | 'nonfinal'
640
+ let status: ActionStatus
654
641
  switch (statusCode) {
655
642
  case 1:
656
643
  status = 'completed'
@@ -673,6 +660,9 @@ export default class WalletWireTransceiver implements WalletInterface {
673
660
  case 7:
674
661
  status = 'nonfinal'
675
662
  break
663
+ case 8:
664
+ status = 'failed'
665
+ break
676
666
  default:
677
667
  throw new Error(`Unknown status code: ${statusCode}`)
678
668
  }
@@ -161,6 +161,7 @@ export default class WindowCWISubstrate implements WalletInterface {
161
161
  | 'unsigned'
162
162
  | 'nosend'
163
163
  | 'nonfinal'
164
+ | 'failed'
164
165
  isOutgoing: boolean
165
166
  description: DescriptionString5to50Bytes
166
167
  labels?: LabelStringUnder300Bytes[]