Skip to content
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

getInstalledWalletExtensions string returns #141

Open
nhenin opened this issue Dec 20, 2023 Discussed in #140 · 0 comments
Open

getInstalledWalletExtensions string returns #141

nhenin opened this issue Dec 20, 2023 Discussed in #140 · 0 comments
Labels
good first issue Good for newcomers

Comments

@nhenin
Copy link
Collaborator

nhenin commented Dec 20, 2023

Discussed in #140

Originally posted by nstanford5 December 19, 2023
Calling getInstalledWalletExtensions returns the name of any installed wallet extensions in a browser window. Currently it returns as follows..

  1. lace = "lace"
  2. eternl = "eternl"
  3. nami = "Nami"

The issue I had was parsing the return to check for each of these extensions -- I assumed they would return to conform to the SupportedWalletName Type, but the return for nami uses a capital N.

Checking these returns against a set of constants like this..

const constants = {
    NAMI: 'nami',
    ETERNL: 'eternl',
    LACE: 'lace',
}

const installedWalletExtensions = wallet.getInstalledWalletExtensions();
        installedWalletExtensions.forEach((i) => names.push(i.name));
        if(names.includes(constants.NAMI)){ setNami(true); }
        if(names.includes(constants.LACE)){ setLace(true); }
        if(names.includes(constants.ETERNL)){ setEternl(true); }

incorrectly denotes that Nami is not installed. The issue would persist when checking the array of names is a SupportedWalletName as well, because the Type denotes below..

SupportedWalletName: "nami" | "eternl" | "lace"

Fix: Have getInstalledWalletExtensions return "nami" with a lowercase n

@nhenin nhenin added the good first issue Good for newcomers label Dec 20, 2023
@nhenin nhenin added this to the [#0] Release 0.3.0-beta milestone Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant