Skip to content

Frankie/issue clean up #261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ export default class Entropy {
#programReadOnly: boolean
#allReadOnly: boolean
/** A promise that resolves once chacha20poly1305 cryptoLib has been loaded */
ready: Promise<void>
ready: Promise<boolean>
public sigRequestPublicKey?: string
public programModPublicKey?: string
registrationManager: RegistrationManager
@@ -103,7 +103,7 @@ export default class Entropy {
signer: programModKeyPair as Signer || this.account.sigRequestKey,
})
if (this.#programReadOnly || this.#allReadOnly) this.programs.set = async () => { throw new Error('Programs is in a read only state: Must pass a valid key pair in initialization.') }
this.#ready()
this.#ready(true)
this.isRegistered = this.registrationManager.checkRegistrationStatus.bind(
this.registrationManager
)
2 changes: 1 addition & 1 deletion src/utils/crypto.ts
Original file line number Diff line number Diff line change
@@ -98,7 +98,7 @@ async function verifySignature (message: string, signature: string, address: str
export async function loadCryptoLib () {
if (isImported) return cryptoLib

if (typeof window === 'undefined') {
if (!globalThis.window) {
cryptoLib = await import('@entropyxyz/x25519-chacha20poly1305-nodejs')
} else {
cryptoLib = await import('@entropyxyz/x25519-chacha20poly1305-web')