@spirobel/monero-wallet-api 0.3.11 → 0.3.12
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.
|
@@ -60,7 +60,7 @@ export declare function shareViewKey002(payload: ShareViewkeyPayload): Promise<S
|
|
|
60
60
|
export type ShareViewkey002Pruned = {
|
|
61
61
|
viewkey: string;
|
|
62
62
|
primary_address: string;
|
|
63
|
-
wallet_slot:
|
|
63
|
+
wallet_slot: number;
|
|
64
64
|
};
|
|
65
65
|
export declare function potentialSuccessRedirect002(payload: ShareViewkeyPayload): Promise<void>;
|
|
66
66
|
export declare function handle002ShareRequest(req: Request, parsed_cb: (parsed_body: ShareViewkey002Pruned) => Promise<void>, successUrl?: string): Promise<ShareViewkeyResult>;
|
|
@@ -227,13 +227,11 @@ export async function handle002ShareRequest(req, parsed_cb, successUrl) {
|
|
|
227
227
|
try {
|
|
228
228
|
const json_body = await req.json();
|
|
229
229
|
const { viewkey, primary_address, wallet_slot } = json_body;
|
|
230
|
-
if (Number.isNaN(parseInt(wallet_slot))) {
|
|
231
|
-
return { ok: false, successUrl: null };
|
|
232
|
-
}
|
|
233
230
|
if (typeof viewkey !== "string" ||
|
|
234
231
|
viewkey.trim().length === 0 ||
|
|
235
232
|
typeof primary_address !== "string" ||
|
|
236
|
-
primary_address.trim().length === 0
|
|
233
|
+
primary_address.trim().length === 0 ||
|
|
234
|
+
typeof wallet_slot !== "number") {
|
|
237
235
|
return { ok: false, successUrl: null };
|
|
238
236
|
}
|
|
239
237
|
await parsed_cb({ viewkey, primary_address, wallet_slot });
|