Created
December 9, 2021 17:42
-
-
Save dgabriele/ed86d14f1b6292ead9d5d4ba949d632c to your computer and use it in GitHub Desktop.
query builder for web3.js getParsedProgramAccounts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async getUserLikes( | |
userPubkey: PublicKey, | |
): Promise<Array<Account<UserVotingRecordAccountData>>> { | |
return await this.query(UserVotingRecordAccountData) | |
.match({ | |
kind: 2, | |
user_pubkey: userPubkey, | |
choice: 1 | |
}) | |
.size(32 * 2 + 2) | |
.execute(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment