@xtr-dev/rondevu-client 0.12.1 → 0.12.2
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/dist/api.d.ts +3 -1
- package/dist/rondevu-service.js +2 -3
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -152,7 +152,9 @@ export declare class RondevuAPI {
|
|
|
152
152
|
*/
|
|
153
153
|
checkUsername(username: string): Promise<{
|
|
154
154
|
available: boolean;
|
|
155
|
-
|
|
155
|
+
publicKey?: string;
|
|
156
|
+
claimedAt?: number;
|
|
157
|
+
expiresAt?: number;
|
|
156
158
|
}>;
|
|
157
159
|
/**
|
|
158
160
|
* Claim a username (requires Ed25519 signature)
|
package/dist/rondevu-service.js
CHANGED
|
@@ -63,8 +63,7 @@ export class RondevuService {
|
|
|
63
63
|
const check = await this.api.checkUsername(this.username);
|
|
64
64
|
if (!check.available) {
|
|
65
65
|
// Verify it's claimed by us
|
|
66
|
-
|
|
67
|
-
if (owner === this.keypair.publicKey) {
|
|
66
|
+
if (check.publicKey === this.keypair.publicKey) {
|
|
68
67
|
this.usernameClaimed = true;
|
|
69
68
|
return;
|
|
70
69
|
}
|
|
@@ -133,7 +132,7 @@ export class RondevuService {
|
|
|
133
132
|
try {
|
|
134
133
|
const check = await this.api.checkUsername(this.username);
|
|
135
134
|
// Username is claimed if it's not available and owned by our public key
|
|
136
|
-
const claimed = !check.available &&
|
|
135
|
+
const claimed = !check.available && check.publicKey === this.keypair.publicKey;
|
|
137
136
|
// Update internal flag to match server state
|
|
138
137
|
this.usernameClaimed = claimed;
|
|
139
138
|
return claimed;
|
package/package.json
CHANGED