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

MagicWallet is invalid for solana chain #129

Open
AdrianBielecAriane opened this issue Aug 23, 2024 · 0 comments
Open

MagicWallet is invalid for solana chain #129

AdrianBielecAriane opened this issue Aug 23, 2024 · 0 comments

Comments

@AdrianBielecAriane
Copy link

AdrianBielecAriane commented Aug 23, 2024

✅ Prerequisites

  • [✅] Did you perform a cursory search of open issues? Is this bug already reported elsewhere?
  • [✅] Are you running the latest SDK version?
  • [✅] Are you reporting to the correct repository (@magic-sdk/admin)?

🐛 Description

The magic sdk types are incorrect for incoming data by getMetadataByTokenAndWallet with second argument SOLANA

      const { issuer, wallets } = await this.magic.users.getMetadataByTokenAndWallet(token, WalletType.SOLANA);
      const solanaWallet = wallets?.find((w) => w.walletType === 'SOLANA');

This piece of code will always return undefined because an item of wallets array will never receive walletType key, the key we receive is wallet_type.

Now magic handles these types by this interface

export interface MagicWallet {
    network: string | null;
    publicAddress: string | null;
    walletType: string | null;
}

Valid types for solana provider should looks like:

  export interface MagicWallet  {
    wallet_type: string | null;
    public_address: string | null;
    network: string | null;
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant