@bsv/wallet-toolbox 2.1.6 → 2.1.8
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/CHANGELOG.md +13 -0
- package/README.md +111 -28
- package/docs/client.md +146 -224
- package/docs/services.md +64 -28
- package/docs/storage.md +2 -22
- package/docs/wallet.md +146 -224
- package/out/src/Wallet.js +3 -3
- package/out/src/Wallet.js.map +1 -1
- package/out/src/WalletPermissionsManager.d.ts.map +1 -1
- package/out/src/WalletPermissionsManager.js +35 -36
- package/out/src/WalletPermissionsManager.js.map +1 -1
- package/out/src/__tests/ShamirWalletManager.test.js +4 -4
- package/out/src/__tests/ShamirWalletManager.test.js.map +1 -1
- package/out/src/mockchain/MockMiner.d.ts.map +1 -1
- package/out/src/mockchain/MockMiner.js +2 -1
- package/out/src/mockchain/MockMiner.js.map +1 -1
- package/out/src/mockchain/MockServices.d.ts.map +1 -1
- package/out/src/mockchain/MockServices.js +2 -1
- package/out/src/mockchain/MockServices.js.map +1 -1
- package/out/src/sdk/PrivilegedKeyManager.d.ts.map +1 -1
- package/out/src/sdk/PrivilegedKeyManager.js +3 -1
- package/out/src/sdk/PrivilegedKeyManager.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/ChaintracksService.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/ChaintracksService.js +1 -0
- package/out/src/services/chaintracker/chaintracks/ChaintracksService.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/__tests/WhatsOnChainServices.man.test.js +1 -1
- package/out/src/services/chaintracker/chaintracks/Ingest/__tests/WhatsOnChainServices.man.test.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/__tests/createIdbChaintracks.test.js +3 -8
- package/out/src/services/chaintracker/chaintracks/__tests/createIdbChaintracks.test.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/configureChaintracksIngestors.d.ts +22 -0
- package/out/src/services/chaintracker/chaintracks/configureChaintracksIngestors.d.ts.map +1 -0
- package/out/src/services/chaintracker/chaintracks/configureChaintracksIngestors.js +54 -0
- package/out/src/services/chaintracker/chaintracks/configureChaintracksIngestors.js.map +1 -0
- package/out/src/services/chaintracker/chaintracks/createDefaultIdbChaintracksOptions.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createDefaultIdbChaintracksOptions.js +3 -42
- package/out/src/services/chaintracker/chaintracks/createDefaultIdbChaintracksOptions.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createDefaultKnexChaintracksOptions.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createDefaultKnexChaintracksOptions.js +2 -41
- package/out/src/services/chaintracker/chaintracks/createDefaultKnexChaintracksOptions.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createDefaultNoDbChaintracksOptions.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/createDefaultNoDbChaintracksOptions.js +3 -42
- package/out/src/services/chaintracker/chaintracks/createDefaultNoDbChaintracksOptions.js.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.d.ts +2 -20
- package/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.d.ts.map +1 -1
- package/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.js +5 -55
- package/out/src/services/chaintracker/chaintracks/util/BulkFileDataManager.js.map +1 -1
- package/out/src/storage/StorageIdb.js +2 -2
- package/out/src/storage/StorageIdb.js.map +1 -1
- package/out/src/storage/WalletStorageManager.d.ts +1 -15
- package/out/src/storage/WalletStorageManager.d.ts.map +1 -1
- package/out/src/storage/WalletStorageManager.js +0 -53
- package/out/src/storage/WalletStorageManager.js.map +1 -1
- package/out/src/storage/__test/getBeefForTransaction.test.js +49 -2
- package/out/src/storage/__test/getBeefForTransaction.test.js.map +1 -1
- package/out/src/storage/methods/__test/offsetKey.test.js +133 -286
- package/out/src/storage/methods/__test/offsetKey.test.js.map +1 -1
- package/out/src/storage/methods/createAction.js +4 -2
- package/out/src/storage/methods/createAction.js.map +1 -1
- package/out/src/storage/methods/generateChange.d.ts.map +1 -1
- package/out/src/storage/methods/generateChange.js +15 -14
- package/out/src/storage/methods/generateChange.js.map +1 -1
- package/out/src/storage/remoting/__test/StorageClient.man.test.js +0 -1
- package/out/src/storage/remoting/__test/StorageClient.man.test.js.map +1 -1
- package/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.d.ts +10 -3
- package/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.d.ts.map +1 -1
- package/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.js +34 -1
- package/out/src/wab-client/auth-method-interactors/AuthMethodInteractor.js.map +1 -1
- package/out/src/wab-client/auth-method-interactors/DevConsoleInteractor.d.ts +1 -19
- package/out/src/wab-client/auth-method-interactors/DevConsoleInteractor.d.ts.map +1 -1
- package/out/src/wab-client/auth-method-interactors/DevConsoleInteractor.js +0 -52
- package/out/src/wab-client/auth-method-interactors/DevConsoleInteractor.js.map +1 -1
- package/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.d.ts +1 -3
- package/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.d.ts.map +1 -1
- package/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.js +0 -24
- package/out/src/wab-client/auth-method-interactors/PersonaIDInteractor.js.map +1 -1
- package/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.d.ts +1 -19
- package/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.d.ts.map +1 -1
- package/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.js +0 -52
- package/out/src/wab-client/auth-method-interactors/TwilioPhoneInteractor.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,19 @@ This document captures the history of significant changes to the wallet-toolbox
|
|
|
4
4
|
The git commit history contains the details but is unable to draw
|
|
5
5
|
attention to changes that materially alter behavior or extend functionality.
|
|
6
6
|
|
|
7
|
+
## wallet-toolbox 2.1.8
|
|
8
|
+
|
|
9
|
+
- Drop no longer required verifyAndRepairBeef method
|
|
10
|
+
- Simplify collectCommission tests in offsetKey.test.ts
|
|
11
|
+
- Remove duplicate BulkFileDataReader class.
|
|
12
|
+
- Reorg createDefault*ChaintracksOptions to reduce duplicated code.
|
|
13
|
+
- Reorg auth-method-interactors
|
|
14
|
+
- Flip waitForAuthentication grouped permission request event (now first) and activation (now second)
|
|
15
|
+
|
|
16
|
+
## wallet-toolbox 2.1.7
|
|
17
|
+
|
|
18
|
+
- Sonarqube recommended changes...
|
|
19
|
+
|
|
7
20
|
## wallet-toolbox 2.1.6
|
|
8
21
|
|
|
9
22
|
- Improve change-making algorithm: cap change outputs per transaction to 8 (gradual UTXO pool build-up, smaller BEEFs). Enforce dynamic dust floor so no change output is worth less than 2× the fee to spend it.
|
package/README.md
CHANGED
|
@@ -1,43 +1,126 @@
|
|
|
1
|
-
# BSV
|
|
1
|
+
# BSV Wallet Toolbox
|
|
2
|
+
|
|
3
|
+
[](https://github.com/bsv-blockchain/wallet-toolbox/actions)
|
|
4
|
+
[](https://www.npmjs.com/package/@bsv/wallet-toolbox)
|
|
5
|
+
[](https://www.npmjs.com/package/@bsv/wallet-toolbox)
|
|
6
|
+
[](https://sonarcloud.io/summary/new_code?id=bsv-blockchain_wallet-toolbox)
|
|
7
|
+
[](https://sonarcloud.io/summary/new_code?id=bsv-blockchain_wallet-toolbox)
|
|
8
|
+
[](https://sonarcloud.io/summary/new_code?id=bsv-blockchain_wallet-toolbox)
|
|
9
|
+
[](https://sonarcloud.io/summary/new_code?id=bsv-blockchain_wallet-toolbox)
|
|
10
|
+
[](https://sonarcloud.io/summary/new_code?id=bsv-blockchain_wallet-toolbox)
|
|
11
|
+
[](https://sonarcloud.io/summary/new_code?id=bsv-blockchain_wallet-toolbox)
|
|
12
|
+
[](https://github.com/bsv-blockchain/wallet-toolbox/actions/workflows/github-code-scanning/codeql)
|
|
13
|
+
[](https://sonarcloud.io/summary/new_code?id=bsv-blockchain_wallet-toolbox)
|
|
14
|
+
[](./LICENSE.txt)
|
|
15
|
+
|
|
16
|
+
A [BRC-100](https://github.com/bitcoin-sv/BRCs/blob/master/wallet/0100.md) conforming wallet implementation for the BSV blockchain, built on the [BSV SDK](https://bsv-blockchain.github.io/ts-sdk). Provides persistent storage, protocol-based key derivation, transaction monitoring, chain tracking, and signing — everything needed to build wallet-powered applications on BSV.
|
|
17
|
+
|
|
18
|
+
## Overview
|
|
19
|
+
|
|
20
|
+
The Wallet Toolbox is the reference implementation of the BRC-100 wallet interface. It connects the BSV SDK's cryptographic primitives to real storage backends, network services, and signing flows so that application developers don't have to wire these layers together themselves.
|
|
21
|
+
|
|
22
|
+
### What's Inside
|
|
23
|
+
|
|
24
|
+
| Module | Description |
|
|
25
|
+
|--------|-------------|
|
|
26
|
+
| **Wallet** | Full BRC-100 wallet — action creation, signing, certificate management, identity discovery, output tracking |
|
|
27
|
+
| **Storage** | Pluggable persistence with three backends: **SQLite/MySQL** (via Knex), **IndexedDB** (browser/mobile), and **remote** (client/server over HTTP) |
|
|
28
|
+
| **Services** | Network layer — ARC transaction broadcasting, chain tracking (Chaintracks), merkle proof verification, UTXO lookups via WhatsOnChain |
|
|
29
|
+
| **Monitor** | Background daemon that watches pending transactions, rebroadcasts failures, handles chain reorganizations, and manages proof acquisition |
|
|
30
|
+
| **Signer** | `WalletSigner` bridges any BRC-100 wallet to the SDK's `Transaction` signing interface |
|
|
31
|
+
| **Key Management** | `PrivilegedKeyManager` for secure key storage with Shamir secret sharing and obfuscation; protocol-based key derivation per BRC-42/43 |
|
|
32
|
+
| **Permissions** | `WalletPermissionsManager` for fine-grained per-app, per-protocol permission control with grouped approval flows |
|
|
33
|
+
| **MockChain** | In-memory blockchain for testing — mock mining, UTXO tracking, and merkle proof generation without a network |
|
|
34
|
+
| **Entropy** | `EntropyCollector` gathers mouse/touch entropy for high-quality randomness in browser environments |
|
|
35
|
+
|
|
36
|
+
### Packages
|
|
37
|
+
|
|
38
|
+
The toolbox publishes three npm packages from this repo:
|
|
39
|
+
|
|
40
|
+
- **[`@bsv/wallet-toolbox`](https://www.npmjs.com/package/@bsv/wallet-toolbox)** — Full package with all storage backends (SQLite, MySQL, IndexedDB, remote)
|
|
41
|
+
- **[`@bsv/wallet-toolbox-client`](https://www.npmjs.com/package/@bsv/wallet-toolbox-client)** — Browser build; excludes Node-only backends (Knex/SQLite/MySQL)
|
|
42
|
+
- **[`@bsv/wallet-toolbox-mobile`](https://www.npmjs.com/package/@bsv/wallet-toolbox-mobile)** — Mobile build; IndexedDB and remote storage only
|
|
43
|
+
|
|
44
|
+
## Getting Started
|
|
45
|
+
|
|
46
|
+
### Installation
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Full (Node.js servers, CLIs)
|
|
50
|
+
npm install @bsv/wallet-toolbox
|
|
51
|
+
|
|
52
|
+
# Browser apps
|
|
53
|
+
npm install @bsv/wallet-toolbox-client
|
|
54
|
+
|
|
55
|
+
# React Native / mobile
|
|
56
|
+
npm install @bsv/wallet-toolbox-mobile
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Quick Example
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
import { SetupWallet } from '@bsv/wallet-toolbox'
|
|
63
|
+
|
|
64
|
+
// Create a wallet with SQLite storage and default mainnet services
|
|
65
|
+
const wallet = await SetupWallet({
|
|
66
|
+
env: 'main',
|
|
67
|
+
endpointUrl: 'https://your-storage-server.example.com'
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
// Create a transaction
|
|
71
|
+
const result = await wallet.createAction({
|
|
72
|
+
description: 'Send payment',
|
|
73
|
+
outputs: [{
|
|
74
|
+
lockingScript: '76a914...88ac',
|
|
75
|
+
satoshis: 1000,
|
|
76
|
+
outputDescription: 'payment'
|
|
77
|
+
}]
|
|
78
|
+
})
|
|
79
|
+
```
|
|
2
80
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Objective
|
|
6
|
-
|
|
7
|
-
The BSV Wallet Toolbox builds on the [SDK](https://bsv-blockchain.github.io/ts-sdk).
|
|
8
|
-
|
|
9
|
-
It aims to support building sophisticated applications and services on the BSV Blockchain technology stack.
|
|
81
|
+
## Documentation
|
|
10
82
|
|
|
11
|
-
|
|
83
|
+
[Full API documentation](https://bsv-blockchain.github.io/wallet-toolbox) is available on GitHub Pages.
|
|
12
84
|
|
|
13
|
-
|
|
85
|
+
The codebase has detailed JSDoc annotations throughout — these will surface inline in editors like VS Code.
|
|
14
86
|
|
|
15
|
-
|
|
87
|
+
## Development
|
|
16
88
|
|
|
17
|
-
|
|
89
|
+
```bash
|
|
90
|
+
git clone https://github.com/bsv-blockchain/wallet-toolbox.git
|
|
91
|
+
cd wallet-toolbox
|
|
92
|
+
npm install
|
|
93
|
+
npm run build
|
|
94
|
+
npm test
|
|
95
|
+
```
|
|
18
96
|
|
|
19
|
-
|
|
97
|
+
Tests use Jest. Files named `*.man.test.ts` are manual/integration tests excluded from CI — they require network access or long runtimes and are run locally by developers.
|
|
20
98
|
|
|
21
|
-
|
|
99
|
+
## Contributing
|
|
22
100
|
|
|
23
|
-
|
|
24
|
-
2. **Set Up**: Run `npm install` to install all dependencies.
|
|
25
|
-
3. **Make Changes**: Create a new branch and make your changes.
|
|
26
|
-
4. **Test**: Ensure all tests pass by running `npm test`.
|
|
27
|
-
5. **Commit**: Commit your changes and push to your fork.
|
|
28
|
-
6. **Pull Request**: Open a pull request from your fork to this repository.
|
|
29
|
-
For more details, check the [contribution guidelines](./CONTRIBUTING.md).
|
|
101
|
+
We welcome bug reports, feature requests, and pull requests.
|
|
30
102
|
|
|
31
|
-
|
|
103
|
+
1. Fork and clone the repository
|
|
104
|
+
2. `npm install`
|
|
105
|
+
3. Create a feature branch
|
|
106
|
+
4. Make your changes and ensure `npm test` passes
|
|
107
|
+
5. Open a pull request
|
|
32
108
|
|
|
33
|
-
|
|
109
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for full guidelines.
|
|
34
110
|
|
|
35
|
-
|
|
111
|
+
## Contributors
|
|
36
112
|
|
|
37
|
-
|
|
113
|
+
| | Name | GitHub | Role |
|
|
114
|
+
|---|------|--------|------|
|
|
115
|
+
| | Tone Engel | [@tonesnotes](https://github.com/tonesnotes) | Lead developer, maintainer |
|
|
116
|
+
| | Darren Kellenschwiler | [@sirdeggen](https://github.com/sirdeggen) | Core contributor |
|
|
117
|
+
| | Brayden Langley | [@BraydenLangley](https://github.com/BraydenLangley) | Core contributor |
|
|
118
|
+
| | Ty Everett | [@ty-everett](https://github.com/ty-everett) | Core contributor, reviewer |
|
|
119
|
+
| | Jackie Lu | [@jackielu3](https://github.com/jackielu3) | Contributor |
|
|
120
|
+
| | David Case | [@shruggr](https://github.com/shruggr) | Contributor |
|
|
121
|
+
| | Stephen Thomson | [@Stephen-Thomson](https://github.com/Stephen-Thomson) | Contributor |
|
|
122
|
+
| | Chance Barimbao | [@ChanceBarimbao](https://github.com/ChanceBarimbao) | Contributor |
|
|
38
123
|
|
|
39
124
|
## License
|
|
40
125
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
Thank you for being a part of the BSV Blockchain Libraries Project. Let's build the future of BSV Blockchain together!
|
|
126
|
+
Released under the [Open BSV License](./LICENSE.txt).
|