@tetherto/wdk-wallet 1.0.0-beta.22 → 1.0.0-beta.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.
- package/package.json +1 -1
- package/src/wallet-manager.js +5 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tetherto/wdk-wallet",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.23",
|
|
4
4
|
"description": "Base wallet and protocol classes for WDK (Wallet Development Kit) by Tether. For internal use only.",
|
|
5
5
|
"homepage": "https://docs.wdk.tether.io/",
|
|
6
6
|
"keywords": [
|
package/src/wallet-manager.js
CHANGED
|
@@ -15,14 +15,13 @@
|
|
|
15
15
|
|
|
16
16
|
import * as bip39 from 'bip39'
|
|
17
17
|
|
|
18
|
-
import { InvalidSignerError, NoSuchElementError, NotImplementedError, ValueError } from './errors.js'
|
|
18
|
+
import { DisposalError, InvalidSignerError, NoSuchElementError, NotImplementedError, ValueError } from './errors.js'
|
|
19
19
|
|
|
20
20
|
/** @typedef {import('./wallet-account.js').IWalletAccount} IWalletAccount */
|
|
21
21
|
|
|
22
22
|
/** @typedef {import('./signer.js').ISigner} ISigner */
|
|
23
23
|
/** @typedef {import('./disposable.js').IDisposable} IDisposable */
|
|
24
24
|
|
|
25
|
-
/** @typedef {import('./errors.js').DisposalError} DisposalError */
|
|
26
25
|
/** @typedef {import('./errors.js').ProviderError} ProviderError */
|
|
27
26
|
/** @typedef {import('./errors.js').ProviderRequiredError} ProviderRequiredError */
|
|
28
27
|
|
|
@@ -167,6 +166,10 @@ export default class WalletManager {
|
|
|
167
166
|
* @throws {DisposalError} If the wallet manager has been disposed.
|
|
168
167
|
*/
|
|
169
168
|
addSigner (signerName, signer) {
|
|
169
|
+
if (this.disposed) {
|
|
170
|
+
throw new DisposalError('The wallet manager has been disposed.')
|
|
171
|
+
}
|
|
172
|
+
|
|
170
173
|
if (!signerName.trim()) {
|
|
171
174
|
throw new ValueError('The signer name cannot be an empty or blank string.')
|
|
172
175
|
}
|