Skip to content

Commit

Permalink
Remove manual loading of Nimiq in IFrameApi
Browse files Browse the repository at this point in the history
  • Loading branch information
sisou committed Nov 23, 2024
1 parent f99259f commit 7110403
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
7 changes: 0 additions & 7 deletions src/request/iframe/IFrameApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
/* global AccountStore */
/* global KeyStore */
/* global Nimiq */
/* global loadNimiq */
/* global Errors */

class IFrameApi {
Expand Down Expand Up @@ -45,8 +44,6 @@ class IFrameApi {
throw new Errors.KeyguardError('Unexpected: top-level sessionStorage got migrated in iframe.');
}

await loadNimiq();

const entropy = new Nimiq.Entropy(storedEntropy);
const master = entropy.toExtendedPrivateKey();

Expand Down Expand Up @@ -89,7 +86,6 @@ class IFrameApi {
if (accounts.length === 0) return [];

// Convert to KeyInfoObjects
await loadNimiq();
return KeyStore.accountInfos2KeyInfos(accounts);
}

Expand Down Expand Up @@ -122,9 +118,6 @@ class IFrameApi {
return { success: true };
}

// Requires Nimiq lib to be loaded, to derive keyIds from legacy accounts' user-friendly addresses
await loadNimiq();

await KeyStore.instance.migrateAccountsToKeys();
return { success: true };
}
Expand Down
2 changes: 1 addition & 1 deletion src/request/iframe/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* global IFrameApi */

runKeyguard(IFrameApi, {
loadNimiq: true,
loadNimiq: true, // At least Nimiq.Address is used in all methods
whitelist: [
'list',
'hasKeys',
Expand Down

0 comments on commit 7110403

Please sign in to comment.