@bsv/wallet-toolbox 1.1.4 → 1.1.6

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 (84) hide show
  1. package/docs/README.md +1 -1
  2. package/docs/client.md +714 -470
  3. package/docs/monitor.md +54 -37
  4. package/docs/services.md +53 -34
  5. package/docs/setup.md +326 -53
  6. package/docs/storage.md +116 -104
  7. package/docs/wallet.md +713 -470
  8. package/license.md +28 -1
  9. package/out/src/Setup.d.ts +27 -3
  10. package/out/src/Setup.d.ts.map +1 -1
  11. package/out/src/Setup.js +17 -5
  12. package/out/src/Setup.js.map +1 -1
  13. package/out/src/SetupClient.d.ts +130 -15
  14. package/out/src/SetupClient.d.ts.map +1 -1
  15. package/out/src/SetupClient.js +29 -15
  16. package/out/src/SetupClient.js.map +1 -1
  17. package/out/src/Wallet.d.ts +4 -0
  18. package/out/src/Wallet.d.ts.map +1 -1
  19. package/out/src/Wallet.js +7 -0
  20. package/out/src/Wallet.js.map +1 -1
  21. package/out/src/sdk/WalletError.d.ts +0 -1
  22. package/out/src/sdk/WalletError.d.ts.map +1 -1
  23. package/out/src/sdk/WalletError.js +0 -1
  24. package/out/src/sdk/WalletError.js.map +1 -1
  25. package/out/src/sdk/validationHelpers.d.ts +1 -0
  26. package/out/src/sdk/validationHelpers.d.ts.map +1 -1
  27. package/out/src/sdk/validationHelpers.js +2 -1
  28. package/out/src/sdk/validationHelpers.js.map +1 -1
  29. package/out/src/storage/StorageProvider.d.ts +1 -4
  30. package/out/src/storage/StorageProvider.d.ts.map +1 -1
  31. package/out/src/storage/StorageProvider.js +1 -4
  32. package/out/src/storage/StorageProvider.js.map +1 -1
  33. package/out/src/storage/WalletStorageManager.d.ts +1 -1
  34. package/out/src/storage/WalletStorageManager.js +1 -1
  35. package/out/src/storage/methods/createAction.d.ts.map +1 -1
  36. package/out/src/storage/methods/createAction.js +42 -11
  37. package/out/src/storage/methods/createAction.js.map +1 -1
  38. package/out/src/storage/methods/generateChange.js +1 -1
  39. package/out/src/storage/methods/generateChange.js.map +1 -1
  40. package/out/src/storage/methods/listOutputs.d.ts.map +1 -1
  41. package/out/src/storage/methods/listOutputs.js +4 -2
  42. package/out/src/storage/methods/listOutputs.js.map +1 -1
  43. package/out/src/storage/schema/tables/ProvenTxReq.d.ts +4 -4
  44. package/out/src/utility/ScriptTemplateSABPPP.d.ts +4 -0
  45. package/out/src/utility/ScriptTemplateSABPPP.d.ts.map +1 -1
  46. package/out/src/utility/ScriptTemplateSABPPP.js +4 -0
  47. package/out/src/utility/ScriptTemplateSABPPP.js.map +1 -1
  48. package/out/test/examples/README.man.test.js +1 -1
  49. package/out/test/utils/TestUtilsWalletStorage.d.ts +2 -1
  50. package/out/test/utils/TestUtilsWalletStorage.d.ts.map +1 -1
  51. package/out/test/utils/TestUtilsWalletStorage.js +112 -27
  52. package/out/test/utils/TestUtilsWalletStorage.js.map +1 -1
  53. package/out/test/wallet/action/createAction.test.js +31 -5
  54. package/out/test/wallet/action/createAction.test.js.map +1 -1
  55. package/out/test/wallet/action/createAction2.test.d.ts +37 -0
  56. package/out/test/wallet/action/createAction2.test.d.ts.map +1 -0
  57. package/out/test/wallet/action/createAction2.test.js +1145 -0
  58. package/out/test/wallet/action/createAction2.test.js.map +1 -0
  59. package/out/test/wallet/list/listOutputs.test.js +8 -12
  60. package/out/test/wallet/list/listOutputs.test.js.map +1 -1
  61. package/out/tsconfig.all.tsbuildinfo +1 -1
  62. package/package.json +2 -2
  63. package/src/Setup.ts +29 -5
  64. package/src/SetupClient.ts +136 -22
  65. package/src/Wallet.ts +9 -0
  66. package/src/sdk/WalletError.ts +0 -1
  67. package/src/sdk/validationHelpers.ts +3 -1
  68. package/src/storage/StorageProvider.ts +1 -4
  69. package/src/storage/WalletStorageManager.ts +1 -1
  70. package/src/storage/methods/createAction.ts +48 -12
  71. package/src/storage/methods/generateChange.ts +1 -1
  72. package/src/storage/methods/listOutputs.ts +4 -2
  73. package/src/storage/schema/tables/ProvenTxReq.ts +4 -4
  74. package/src/utility/ScriptTemplateSABPPP.ts +4 -0
  75. package/test/examples/README.man.test.ts +1 -1
  76. package/test/utils/TestUtilsWalletStorage.ts +131 -35
  77. package/test/wallet/action/createAction.test.ts +36 -5
  78. package/test/wallet/action/createAction2.test.ts +1400 -0
  79. package/test/wallet/list/listOutputs.test.ts +7 -13
  80. package/ts2md.json +6 -6
  81. package/tsconfig.all.json +1 -1
  82. package/LICENSE.txt +0 -28
  83. package/dev.sqlite3 +0 -0
  84. package/knexfile.js +0 -9
@@ -143,7 +143,7 @@ describe('listOutputs test', () => {
143
143
  }
144
144
  })
145
145
 
146
- test('1_default', async () => {
146
+ test('2a default', async () => {
147
147
  for (const { wallet } of ctxs) {
148
148
  {
149
149
  let log = `\n${testName()}\n`
@@ -166,7 +166,7 @@ describe('listOutputs test', () => {
166
166
  }
167
167
  })
168
168
 
169
- test('2_default', async () => {
169
+ test('2b default with originators', async () => {
170
170
  for (const { wallet } of ctxs) {
171
171
  {
172
172
  let log = `\n${testName()}\n`
@@ -260,18 +260,12 @@ describe('listOutputs test', () => {
260
260
 
261
261
  test('6_non-existent basket', async () => {
262
262
  for (const { wallet } of ctxs) {
263
- {
264
- let log = `\n${testName()}\n`
265
- const args: ListOutputsArgs = {
266
- basket: 'non-existent-basket',
267
- tags: ['babbage_action_originator projectbabbage.com'],
268
- includeTags: true
269
- }
270
- await expectToThrowWERR(
271
- sdk.WERR_INVALID_PARAMETER,
272
- async () => await wallet.listOutputs(args)
273
- )
263
+ // non-existent basket should return zero results.
264
+ const args: ListOutputsArgs = {
265
+ basket: 'admin foo'
274
266
  }
267
+ const r = await wallet.listOutputs(args)
268
+ expect(r.totalOutputs === 0)
275
269
  }
276
270
  })
277
271
 
package/ts2md.json CHANGED
@@ -3,36 +3,36 @@
3
3
  {
4
4
  "inputFilename": "src/index.ts",
5
5
  "outputFilename": "docs/setup.md",
6
- "firstHeadingLevel": 1,
6
+ "firstHeadingLevel": 2,
7
7
  "filenameSubString": "Setup"
8
8
  },
9
9
  {
10
10
  "inputFilename": "src/index.ts",
11
11
  "outputFilename": "docs/monitor.md",
12
- "firstHeadingLevel": 1,
12
+ "firstHeadingLevel": 2,
13
13
  "filenameSubString": "monitor"
14
14
  },
15
15
  {
16
16
  "inputFilename": "src/index.ts",
17
17
  "outputFilename": "docs/services.md",
18
- "firstHeadingLevel": 1,
18
+ "firstHeadingLevel": 2,
19
19
  "filenameSubString": "services"
20
20
  },
21
21
  {
22
22
  "inputFilename": "src/index.ts",
23
23
  "outputFilename": "docs/storage.md",
24
- "firstHeadingLevel": 1,
24
+ "firstHeadingLevel": 2,
25
25
  "filenameSubString": "storage"
26
26
  },
27
27
  {
28
28
  "inputFilename": "src/index.client.ts",
29
29
  "outputFilename": "docs/client.md",
30
- "firstHeadingLevel": 1
30
+ "firstHeadingLevel": 2
31
31
  },
32
32
  {
33
33
  "inputFilename": "src/Wallet.ts",
34
34
  "outputFilename": "docs/wallet.md",
35
- "firstHeadingLevel": 1
35
+ "firstHeadingLevel": 2
36
36
  }
37
37
  ]
38
38
  }
package/tsconfig.all.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "include": [
21
21
  "src/**/*",
22
22
  "test/**/*"
23
- ], // Include test files
23
+ ],
24
24
  "exclude": [
25
25
  "node_modules",
26
26
  "out",
package/LICENSE.txt DELETED
@@ -1,28 +0,0 @@
1
- Open BSV License version 4
2
-
3
- Copyright (c) 2023 BSV Blockchain Association ("Bitcoin Association")
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- 1 - The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- 2 - The Software, and any software that is derived from the Software or parts thereof,
16
- can only be used on the Bitcoin SV blockchains. The Bitcoin SV blockchains are defined,
17
- for purposes of this license, as the Bitcoin blockchain containing block height #556767
18
- with the hash "000000000000000001d956714215d96ffc00e0afda4cd0a96c96f8d802b1662b" and
19
- that contains the longest persistent chain of blocks accepted by this Software and which are valid under the rules set forth in the Bitcoin white paper (S. Nakamoto, Bitcoin: A Peer-to-Peer Electronic Cash System, posted online October 2008) and the latest version of this Software available in this repository or another repository designated by Bitcoin Association,
20
- as well as the test blockchains that contain the longest persistent chains of blocks accepted by this Software and which are valid under the rules set forth in the Bitcoin whitepaper (S. Nakamoto, Bitcoin: A Peer-to-Peer Electronic Cash System, posted online October 2008) and the latest version of this Software available in this repository, or another repository designated by Bitcoin Association
21
-
22
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
28
- THE SOFTWARE.
package/dev.sqlite3 DELETED
File without changes
package/knexfile.js DELETED
@@ -1,9 +0,0 @@
1
- module.exports = {
2
- development: {
3
- client: 'sqlite3',
4
- connection: {
5
- filename: 'test/data/tmp/updatetest.sqlite'
6
- },
7
- useNullAsDefault: true
8
- }
9
- }