backpack
backpack copied to clipboard
Support for Compression for NFTs
this is a preliminary take on integrating the Metaplex Read API to power the "collectibles" tab in Backpack. here's more information about the Read API along with the specifications.
critically, the Read API serves both compressed and uncompressed NFTs all in the same interface, which we're using here when a custom RPC supports the Read API.
one can try this out by:
- setting
BACKPACK_FEATURE_READ_API=true
when running the initialyarn build
- setting the "custom" Solana connection URL in the Backpack interface to an RPC URL that supports the Read API (
https://rpc-devnet.aws.metaplex.com/
works!). the Read API is served on the same URL as the Solana RPC
caveats
- the initial set of indexers that support the Read API are currently only targeting
devnet
- while compressed NFTs will be visible in the Backpack collectibles interface, things like transfers are not yet supported here. i expect a fast-follow there!
review notes there's a lot of TODOs here because i have some questions for the Backpack team.
- the Read API provides "pagination", but i don't think the Backpack interface does. should i go ahead and retrieve as much as possible + automatically paginate, or are there plans to provide pagination / filter controls?
- some assets will be "compressed", and while the "read" flow is identical to uncompressed NFTs, the transfer is not. is it critical to surface that these assets are compressed in the UI, or just in the transfer process?
@jnwng is attempting to deploy a commit to the coral-xyz Team on Vercel.
A member of the Team first needs to authorize it.
this code is super rough, but i decided to send the PR to get early feedback rather than over-optimize. the Metaplex Read API in devnet is also not 100% ready so this won't work (yet) out of the box, but the code can be evaluated beforehand while the final touches get sorted out on the API side
@jnwng on your two questions. I think the immediate solution (though something we should come back to) is to
- Fetch everything you can and automatically paginate
- Treat compressed and uncompressed as the same in the UI. I'm not married to this and would be interested in arguments against this.
- Fetch everything you can and automatically paginate
added in automatic pagination. surfaced a couple of issues in the Read API from this front, but basically i'll keep calling their API until we have the entire list of assets and optimize for true pagination down the road.
- Treat compressed and uncompressed as the same in the UI. I'm not married to this and would be interested in arguments against this.
i'm onboard with this as well. the only semantic differences between the two kinds of NFTs come on the backend when you're doing transfers (compressed NFTs require a proof from the API), but other than that the rest of the UI elements should be the same
if the code structure looks roughly okay, the next step would be to verify the end-to-end behavior once the Read API is returning the correct informationβright now it's missing the off-chain metadata as well as some pagination elements
regarding feature flags, this is currently going to be a compile-time flag which is suitable for the short-term
any help needed here?
i've revived this code and prepping it for an initial round of review. ETA later today , although it will not be a finished product
On Thu, Feb 02, 2023 at 11:54 AM, Gajesh Naik < @.*** > wrote:
any help needed here?
β Reply to this email directly, view it on GitHub ( https://github.com/coral-xyz/backpack/pull/1311#issuecomment-1414058582 ) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/AAIRCRRGMSYM5I66KX7NXP3WVPRFLANCNFSM6AAAAAARQU7GS4 ). You are receiving this because you were mentioned. Message ID: <coral-xyz/backpack/pull/1311/c1414058582 @ github. com>
@Gajesh2007 @armaniferrante ready for another pass. mostly want to get feedback on where all the code is right now and whether there are better places for the code, the subsequent types, etc
work im starting now:
- [ ] paginating through all NFTs (only retrieving 5 right now)
- [ ] trying to get a minimal amount of the transfer logic into another SDK so Backpack doesn't have to have so much. what's here should work, provided the RPC returns the correct information!
- [ ] add a remote feature flag / feature detection on the connection to see if it responds to Read API methods
- [ ] will flag this entire feature on Developer Mode
New dependency changes detected. Learn more about Socket for GitHub βοΈ
π No new dependency issues detected in pull request
Bot Commands
To ignore an alert, reply with a comment starting with @SocketSecurity ignore
followed by a space separated list of package-name@version
specifiers. e.g. @SocketSecurity ignore [email protected] bar@*
or ignore all packages with @SocketSecurity ignore-all
β οΈ Please accept the latest app permissions to ensure bot commands work properly. Accept the new permissions here.
Pull request alert summary
Issue | Status |
---|---|
Install scripts | β 0 issues |
Native code | β 0 issues |
Bin script shell injection | β 0 issues |
Unresolved require | β 0 issues |
Invalid package.json | β 0 issues |
HTTP dependency | β 0 issues |
Git dependency | β 0 issues |
Potential typo squat | β 0 issues |
Known Malware | β 0 issues |
Telemetry | β 0 issues |
Protestware/Troll package | β 0 issues |
π Modified Dependency Overview:
β Added Package | Capability Access | +/- Transitive Count |
Publisher |
---|---|---|---|
@metaplex-foundation/[email protected] | None | +6 |
lorisleiva |