Last active
February 5, 2022 16:25
-
-
Save fersilva16/b34cc997e952d8c4d4573b5e30e24927 to your computer and use it in GitHub Desktop.
Benchmark of Metaplex's Metadata's findByOwner method
This file contains hidden or 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
const web3 = require('@solana/web3.js'); | |
const { Metadata } = require('./token-metadata/js/dist/src/mpl-token-metadata'); | |
const connection = new web3.Connection(web3.clusterApiUrl('devnet'), 'confirmed'); | |
const wallet = new web3.PublicKey('WALLET_PUBLIC_KEY'); | |
console.time('findByOwnerV2'); | |
Metadata.findByOwnerV2(connection, wallet).then(() => console.timeEnd('findByOwnerV2')); | |
console.time('findByOwnerV3'); | |
Metadata.findByOwnerV3(connection, wallet).then(() => console.timeEnd('findByOwnerV3')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment