my strategy is that i’ll have 5 claims, and a cart to pretty much execute transactions one-by-one after the fact when another buy button is clicked. Also, the original html’s are super heavy if they are all rendered together as some have webgl, some have a ton of datauri’s etc. so i’m using the buy button only claim and just use the realtime animated logos as the display.
my issue is that i can’t get the token name and price from the claim, and since i’m not gonna use the entire claim page, i’m sorta stuck writing the details manually. curious if there’s a way to get these details from the claimID. if they were minted i could get the details with getNFTdata, but as claims are lazy mints i couldn’t find a way to achieve my idea.
ayo! got you. as long as you made the claims using Studio, you can use the following endpoint to get all public information for the claim as JSON by just swapping in your claim id:
it’s the same endpoint we use to build our pages. do note though, i suggest prioritizing on-chain data from getClaim wherever possible to avoid stale data display issues (though they are very rare).
as a thoroughness thing – you can get the token information from the on-chain information as well it’s just a little trickier. the claim’s on-chain data will have a “location”, in there, that’s typically the arweave hash. you can then request that data from arweave and it will return as JSON. you can then parse that JSON to read all of the token’s metadata before it’s minted, such as it’s name etc.
both routes are valid! the second one is more longterm safe as you won’t be relying on manifold’s web2 endpoints. the first one is easier because it’s just one call.
this worked perfectly tysm! for now i used the endpoint, but if i have spare time i’ll also try to tackle it the way you described and mayhaps write a claim Batcher to execute multiple claims for manifold claims cause that would be the best ux!
for this project i didn’t use claim widgets at all rather just connect and window.ethereum requests, cause it made more sense since the displayed tokens will be token-gated.
a mini suggestion: maybe i missed it but manifoldFee wasn’t a variable in the api, it would be nice to get it all from the same json, i currently hardcoded it to 0.0005* tokenAmount but having it dynamic for futureproofing would be comfy!