zano_web3 2.6.0 → 3.1.0
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 +2 -1
- package/src/zanoWallet.ts +8 -2
package/package.json
CHANGED
package/src/zanoWallet.ts
CHANGED
|
@@ -31,6 +31,7 @@ interface WalletCredentials {
|
|
|
31
31
|
nonce: string;
|
|
32
32
|
signature: string;
|
|
33
33
|
publicKey: string;
|
|
34
|
+
address: string;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
class ZanoWallet {
|
|
@@ -83,6 +84,10 @@ class ZanoWallet {
|
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
86
|
|
|
87
|
+
cleanWalletCredentials() {
|
|
88
|
+
this.setWalletCredentials(undefined);
|
|
89
|
+
}
|
|
90
|
+
|
|
86
91
|
async connect() {
|
|
87
92
|
|
|
88
93
|
if (this.params.beforeConnect) {
|
|
@@ -111,7 +116,7 @@ class ZanoWallet {
|
|
|
111
116
|
|
|
112
117
|
const existingWallet = this.params.useLocalStorage ? this.getSavedWalletCredentials() : undefined;
|
|
113
118
|
|
|
114
|
-
if (existingWallet) {
|
|
119
|
+
if (existingWallet && existingWallet.address === walletData.address) {
|
|
115
120
|
nonce = existingWallet.nonce;
|
|
116
121
|
signature = existingWallet.signature;
|
|
117
122
|
publicKey = existingWallet.publicKey;
|
|
@@ -175,7 +180,8 @@ class ZanoWallet {
|
|
|
175
180
|
this.setWalletCredentials({
|
|
176
181
|
publicKey,
|
|
177
182
|
signature,
|
|
178
|
-
nonce
|
|
183
|
+
nonce,
|
|
184
|
+
address: walletData.address
|
|
179
185
|
});
|
|
180
186
|
}
|
|
181
187
|
|