Fixed cache getting program accounts instead of wallet ASA (#192)

* fixed button with no provider

* fixed mint key on native sol tokens and wwt eth, eth -> sol

* fixed cached getting program accounts instead of wallet ASA
This commit is contained in:
Juan Diego García 2021-08-19 15:35:42 -05:00 committed by GitHub
parent e0c9ca80a7
commit 4f5f0db2e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -93,7 +93,10 @@ export const toSolana = async (
.byParser(TokenAccountParser)
.map(key => {
let account = cache.get(key) as ParsedAccount<AccountInfo>;
if (account?.info.mint.toBase58() === mintKey.toBase58()) {
if (
account?.info.mint.toBase58() === mintKey.toBase58() &&
account?.info.owner.toBase58() === wallet?.publicKey?.toBase58()
) {
return key;
}