@bsv/wallet-toolbox 1.3.22 → 1.3.23

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 (90) hide show
  1. package/mobile/out/src/WalletPermissionsManager.d.ts.map +1 -1
  2. package/mobile/out/src/WalletPermissionsManager.js.map +1 -1
  3. package/mobile/out/src/index.mobile.d.ts +0 -2
  4. package/mobile/out/src/index.mobile.d.ts.map +1 -1
  5. package/mobile/out/src/index.mobile.js +0 -2
  6. package/mobile/out/src/index.mobile.js.map +1 -1
  7. package/mobile/out/src/storage/StorageIdb.d.ts +2 -1
  8. package/mobile/out/src/storage/StorageIdb.d.ts.map +1 -1
  9. package/mobile/out/src/storage/StorageIdb.js +63 -29
  10. package/mobile/out/src/storage/StorageIdb.js.map +1 -1
  11. package/mobile/out/src/storage/StorageProvider.d.ts +2 -1
  12. package/mobile/out/src/storage/StorageProvider.d.ts.map +1 -1
  13. package/mobile/out/src/storage/StorageProvider.js +75 -40
  14. package/mobile/out/src/storage/StorageProvider.js.map +1 -1
  15. package/mobile/out/src/storage/StorageReader.d.ts +2 -1
  16. package/mobile/out/src/storage/StorageReader.d.ts.map +1 -1
  17. package/mobile/out/src/storage/StorageReader.js +45 -11
  18. package/mobile/out/src/storage/StorageReader.js.map +1 -1
  19. package/mobile/out/src/storage/StorageReaderWriter.d.ts +2 -1
  20. package/mobile/out/src/storage/StorageReaderWriter.d.ts.map +1 -1
  21. package/mobile/out/src/storage/StorageReaderWriter.js +29 -29
  22. package/mobile/out/src/storage/StorageReaderWriter.js.map +1 -1
  23. package/mobile/out/src/storage/StorageSyncReader.d.ts +2 -1
  24. package/mobile/out/src/storage/StorageSyncReader.d.ts.map +1 -1
  25. package/mobile/out/src/storage/StorageSyncReader.js +36 -3
  26. package/mobile/out/src/storage/StorageSyncReader.js.map +1 -1
  27. package/mobile/out/src/storage/index.mobile.d.ts +1 -1
  28. package/mobile/out/src/storage/index.mobile.js +1 -1
  29. package/mobile/out/src/storage/remoting/StorageClient.d.ts.map +1 -1
  30. package/mobile/out/src/storage/remoting/StorageClient.js.map +1 -1
  31. package/mobile/out/src/storage/remoting/StorageMobile.d.ts +283 -0
  32. package/mobile/out/src/storage/remoting/StorageMobile.d.ts.map +1 -0
  33. package/mobile/out/src/storage/remoting/StorageMobile.js +477 -0
  34. package/mobile/out/src/storage/remoting/StorageMobile.js.map +1 -0
  35. package/mobile/package-lock.json +5 -6
  36. package/mobile/package.json +1 -1
  37. package/out/src/WalletPermissionsManager.d.ts.map +1 -1
  38. package/out/src/WalletPermissionsManager.js.map +1 -1
  39. package/out/src/index.mobile.d.ts +0 -2
  40. package/out/src/index.mobile.d.ts.map +1 -1
  41. package/out/src/index.mobile.js +0 -2
  42. package/out/src/index.mobile.js.map +1 -1
  43. package/out/src/storage/StorageIdb.d.ts +2 -1
  44. package/out/src/storage/StorageIdb.d.ts.map +1 -1
  45. package/out/src/storage/StorageIdb.js +63 -29
  46. package/out/src/storage/StorageIdb.js.map +1 -1
  47. package/out/src/storage/StorageKnex.d.ts +1 -1
  48. package/out/src/storage/StorageKnex.d.ts.map +1 -1
  49. package/out/src/storage/StorageKnex.js +10 -6
  50. package/out/src/storage/StorageKnex.js.map +1 -1
  51. package/out/src/storage/StorageProvider.d.ts +2 -1
  52. package/out/src/storage/StorageProvider.d.ts.map +1 -1
  53. package/out/src/storage/StorageProvider.js +75 -40
  54. package/out/src/storage/StorageProvider.js.map +1 -1
  55. package/out/src/storage/StorageReader.d.ts +2 -1
  56. package/out/src/storage/StorageReader.d.ts.map +1 -1
  57. package/out/src/storage/StorageReader.js +45 -11
  58. package/out/src/storage/StorageReader.js.map +1 -1
  59. package/out/src/storage/StorageReaderWriter.d.ts +2 -1
  60. package/out/src/storage/StorageReaderWriter.d.ts.map +1 -1
  61. package/out/src/storage/StorageReaderWriter.js +29 -29
  62. package/out/src/storage/StorageReaderWriter.js.map +1 -1
  63. package/out/src/storage/StorageSyncReader.d.ts +2 -1
  64. package/out/src/storage/StorageSyncReader.d.ts.map +1 -1
  65. package/out/src/storage/StorageSyncReader.js +36 -3
  66. package/out/src/storage/StorageSyncReader.js.map +1 -1
  67. package/out/src/storage/index.mobile.d.ts +1 -1
  68. package/out/src/storage/index.mobile.js +1 -1
  69. package/out/src/storage/remoting/StorageClient.d.ts.map +1 -1
  70. package/out/src/storage/remoting/StorageClient.js.map +1 -1
  71. package/out/src/storage/remoting/StorageMobile.d.ts +283 -0
  72. package/out/src/storage/remoting/StorageMobile.d.ts.map +1 -0
  73. package/out/src/storage/remoting/StorageMobile.js +477 -0
  74. package/out/src/storage/remoting/StorageMobile.js.map +1 -0
  75. package/out/tsconfig.all.tsbuildinfo +1 -1
  76. package/package.json +1 -1
  77. package/src/WalletPermissionsManager.ts +19 -8
  78. package/src/index.mobile.ts +0 -2
  79. package/src/storage/StorageIdb.ts +4 -5
  80. package/src/storage/StorageKnex.ts +7 -6
  81. package/src/storage/StorageProvider.ts +5 -9
  82. package/src/storage/StorageReader.ts +4 -7
  83. package/src/storage/StorageReaderWriter.ts +4 -8
  84. package/src/storage/StorageSyncReader.ts +2 -19
  85. package/src/storage/index.mobile.ts +1 -1
  86. package/src/storage/remoting/StorageClient.ts +0 -1
  87. package/src/storage/remoting/StorageMobile.ts +527 -0
  88. package/tsconfig.all.json +2 -1
  89. package/tsconfig.client.json +6 -0
  90. package/tsconfig.mobile.json +6 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bsv/wallet-toolbox",
3
- "version": "1.3.22",
3
+ "version": "1.3.23",
4
4
  "description": "BRC100 conforming wallet, wallet storage and wallet signer components",
5
5
  "main": "./out/src/index.js",
6
6
  "types": "./out/src/index.d.ts",
@@ -1,4 +1,13 @@
1
- import { WalletInterface, Utils, PushDrop, LockingScript, Transaction, WalletProtocol, Base64String, PubKeyHex } from '@bsv/sdk'
1
+ import {
2
+ WalletInterface,
3
+ Utils,
4
+ PushDrop,
5
+ LockingScript,
6
+ Transaction,
7
+ WalletProtocol,
8
+ Base64String,
9
+ PubKeyHex
10
+ } from '@bsv/sdk'
2
11
  import { validateCreateActionArgs } from './sdk'
3
12
 
4
13
  ////// TODO: ADD SUPPORT FOR ADMIN COUNTERPARTIES BASED ON WALLET STORAGE
@@ -1576,7 +1585,7 @@ export class WalletPermissionsManager implements WalletInterface {
1576
1585
  * @param params.basket Optional basket name to filter by
1577
1586
  * @returns Array of permission tokens that match the filter criteria
1578
1587
  */
1579
- public async listBasketAccess(params: { originator?: string, basket?: string } = {}): Promise<PermissionToken[]> {
1588
+ public async listBasketAccess(params: { originator?: string; basket?: string } = {}): Promise<PermissionToken[]> {
1580
1589
  const basketName = BASKET_MAP.basket
1581
1590
  const tags: string[] = []
1582
1591
 
@@ -1708,12 +1717,14 @@ export class WalletPermissionsManager implements WalletInterface {
1708
1717
  * @param verifier Optional verifier to filter by
1709
1718
  * @returns Array of permission tokens that match the filter criteria
1710
1719
  */
1711
- public async listCertificateAccess(params: {
1712
- originator?: string,
1713
- privileged?: boolean,
1714
- certType?: Base64String,
1715
- verifier?: PubKeyHex
1716
- } = {}): Promise<PermissionToken[]> {
1720
+ public async listCertificateAccess(
1721
+ params: {
1722
+ originator?: string
1723
+ privileged?: boolean
1724
+ certType?: Base64String
1725
+ verifier?: PubKeyHex
1726
+ } = {}
1727
+ ): Promise<PermissionToken[]> {
1717
1728
  const basketName = BASKET_MAP.certificate
1718
1729
  const tags: string[] = []
1719
1730
 
@@ -1,7 +1,5 @@
1
1
  export * as sdk from './sdk/index'
2
2
  export * from './utility/index.client'
3
- export * from './SetupClient'
4
- export * from './SetupWallet'
5
3
  export * from './signer/WalletSigner'
6
4
  export * from './WalletPermissionsManager'
7
5
  export * from './CWIStyleWalletManager'
@@ -1,7 +1,6 @@
1
1
  import { deleteDB, IDBPCursorWithValue, IDBPDatabase, IDBPTransaction, openDB } from 'idb'
2
2
  import { ListActionsResult, ListOutputsResult } from '@bsv/sdk'
3
3
  import {
4
- sdk,
5
4
  TableCertificate,
6
5
  TableCertificateField,
7
6
  TableCertificateX,
@@ -18,10 +17,10 @@ import {
18
17
  TableTransaction,
19
18
  TableTxLabel,
20
19
  TableTxLabelMap,
21
- TableUser,
22
- verifyOne,
23
- verifyOneOrNone
24
- } from '../index.client'
20
+ TableUser
21
+ } from './schema/tables'
22
+ import * as sdk from '../sdk/index'
23
+ import { verifyOne, verifyOneOrNone } from '../utility/utilityHelpers'
25
24
  import { StorageAdminStats, StorageProvider, StorageProviderOptions } from './StorageProvider'
26
25
  import { StorageIdbSchema } from './schema/StorageIdbSchema'
27
26
  import { DBType } from './StorageReader'
@@ -1,7 +1,6 @@
1
- import { ListActionsResult, ListOutputsResult, Transaction } from '@bsv/sdk'
1
+ import { ListActionsResult, ListOutputsResult } from '@bsv/sdk'
2
2
  import { sdk, verifyOne, verifyOneOrNone, verifyTruthy } from '../index.all'
3
3
  import {
4
- KnexMigrations,
5
4
  outputColumnsWithoutLockingScript,
6
5
  TableCertificate,
7
6
  TableCertificateField,
@@ -12,7 +11,6 @@ import {
12
11
  TableOutputBasket,
13
12
  TableOutputTag,
14
13
  TableOutputTagMap,
15
- TableOutputX,
16
14
  TableProvenTx,
17
15
  TableProvenTxReq,
18
16
  TableSettings,
@@ -22,8 +20,8 @@ import {
22
20
  TableTxLabelMap,
23
21
  TableUser,
24
22
  transactionColumnsWithoutRawTx
25
- } from './index.all'
26
-
23
+ } from './schema/tables'
24
+ import { KnexMigrations } from './schema/KnexMigrations'
27
25
  import { Knex } from 'knex'
28
26
  import { StorageAdminStats, StorageProvider, StorageProviderOptions } from './StorageProvider'
29
27
  import { purgeData } from './methods/purgeData'
@@ -797,7 +795,10 @@ export class StorageKnex extends StorageProvider implements sdk.WalletStoragePro
797
795
  for (let i = 0; i < count; i++) {
798
796
  try {
799
797
  const r = await this.knex.migrate.down(config)
800
- expect(r).toBeTruthy()
798
+ if (!r) {
799
+ console.error(`Migration returned falsy result await this.knex.migrate.down(config)`)
800
+ break
801
+ }
801
802
  } catch (eu: unknown) {
802
803
  break
803
804
  }
@@ -14,9 +14,6 @@ import {
14
14
  AbortActionArgs
15
15
  } from '@bsv/sdk'
16
16
  import {
17
- asArray,
18
- asString,
19
- sdk,
20
17
  TableCertificateX,
21
18
  TableMonitorEvent,
22
19
  TableOutput,
@@ -26,12 +23,11 @@ import {
26
23
  TableProvenTxReq,
27
24
  TableProvenTxReqDynamics,
28
25
  TableTransaction,
29
- TableTxLabel,
30
- verifyId,
31
- verifyOne,
32
- verifyOneOrNone,
33
- verifyTruthy
34
- } from '../index.client'
26
+ TableTxLabel
27
+ } from './schema/tables'
28
+ import { verifyId, verifyOne, verifyOneOrNone, verifyTruthy } from '../utility/utilityHelpers'
29
+ import * as sdk from '../sdk/index'
30
+ import { asArray, asString } from '../utility/utilityHelpers.noBuffer'
35
31
  import { getBeefForTransaction } from './methods/getBeefForTransaction'
36
32
  import { GetReqsAndBeefDetail, GetReqsAndBeefResult, processAction } from './methods/processAction'
37
33
  import { attemptToPostReqsToNetwork, PostReqsToNetworkResult } from './methods/attemptToPostReqsToNetwork'
@@ -1,6 +1,4 @@
1
1
  import {
2
- sdk,
3
- TableCertificate,
4
2
  TableCertificateField,
5
3
  TableCertificateX,
6
4
  TableCommission,
@@ -16,11 +14,10 @@ import {
16
14
  TableTransaction,
17
15
  TableTxLabel,
18
16
  TableTxLabelMap,
19
- TableUser,
20
- validateSecondsSinceEpoch,
21
- verifyOneOrNone,
22
- verifyTruthy
23
- } from '../index.client'
17
+ TableUser
18
+ } from './schema/tables'
19
+ import * as sdk from '../sdk/index'
20
+ import { validateSecondsSinceEpoch, verifyOneOrNone, verifyTruthy } from '../utility/utilityHelpers'
24
21
  import { getSyncChunk } from './methods/getSyncChunk'
25
22
 
26
23
  /**
@@ -1,6 +1,4 @@
1
1
  import {
2
- randomBytesBase64,
3
- sdk,
4
2
  TableCertificate,
5
3
  TableCertificateField,
6
4
  TableCommission,
@@ -15,12 +13,10 @@ import {
15
13
  TableTransaction,
16
14
  TableTxLabel,
17
15
  TableTxLabelMap,
18
- TableUser,
19
- verifyId,
20
- verifyOne,
21
- verifyOneOrNone,
22
- verifyTruthy
23
- } from '../index.client'
16
+ TableUser
17
+ } from './schema/tables'
18
+ import { randomBytesBase64, verifyOneOrNone, verifyId, verifyOne } from '../utility/utilityHelpers'
19
+ import * as sdk from '../sdk/index'
24
20
  import { createSyncMap } from './schema/entities'
25
21
  import { StorageReader, StorageReaderOptions } from './StorageReader'
26
22
 
@@ -1,22 +1,5 @@
1
- import {
2
- sdk,
3
- TableCertificate,
4
- TableCertificateField,
5
- TableCertificateX,
6
- TableCommission,
7
- TableOutput,
8
- TableOutputBasket,
9
- TableOutputTag,
10
- TableOutputTagMap,
11
- TableProvenTx,
12
- TableProvenTxReq,
13
- TableSettings,
14
- TableSyncState,
15
- TableTransaction,
16
- TableTxLabel,
17
- TableTxLabelMap,
18
- TableUser
19
- } from '../index.client'
1
+ import * as sdk from '../sdk/index'
2
+ import { TableSettings } from '../storage/schema/tables/TableSettings'
20
3
  import { StorageReader } from './StorageReader'
21
4
 
22
5
  /**
@@ -3,4 +3,4 @@ export * from './StorageProvider'
3
3
  export * from './StorageSyncReader'
4
4
  export * from './schema/tables/index'
5
5
  export * from './schema/entities/index'
6
- export * from './remoting/StorageClient'
6
+ export * from './remoting/StorageMobile'
@@ -13,7 +13,6 @@ import {
13
13
  } from '@bsv/sdk'
14
14
  import {
15
15
  sdk,
16
- TableCertificate,
17
16
  TableCertificateX,
18
17
  TableOutput,
19
18
  TableOutputBasket,