Closed AnderUstarroz closed 1 year ago
Hey there! thanks for the question(s).
Yes, the demo app does not have the best UX (yet :eyes:), but it's role is to show off the full functionality - we leave optimising the UX up to you in a case by case basis (you can get it down to just a couple button presses!)
Unfortunately, Bundlr transactions do not operate in the way you outline above, and as such it is not possible to combine all operations into a single Solana transaction/signing request - this is because the format data is signed and uploaded is custom and cannot be included into other structures i.e a Solana transaction.
In addition, Bundlr does not currently process Solana transactions with multiple instructions (i.e not just a simple fund transfer) correctly. This is a known issue and we are working on it so you can, for example, transfer funds and register NFT metadata in a single transaction.
At current, each operation will require a separate signing request - the fund transfer, the upload, and then the metadata registration; but once the above issue has been resolved you will be able to have 2 (sign, fund transfer & registration) per upload.
re reading in files - if you look at this line you can see that we use a FileReader variant that uses streams (to support any size file) - but just reading in the file in full into a buffer will also work just fine.
You can determine the upload's ID once the upload has been signed - you can use bundlr.createTransaction
for this, you can call sign
and then get the ID from the id
property - the ID returned by upload
will be identical.
Thanks @JesseTheRobot, Happy to know that we will be able to skip one step, still I think this is the best solution for uploading files to arweave using Solana.
Okay, I've updated the nodes with the latest changes - any solana transactions (that include a conventional transfer instruction) should now be supported - I will close this once you have confirmed it's working for your usecase.
Okay, I've updated the nodes with the latest changes - any solana transactions (that include a conventional transfer instruction) should now be supported - I will close this once you have confirmed it's working for your usecase.
Awesome news! I was actually integrating this library, this will make for a much better UX. So the difference is that now I can merge Fund
+ Upload
within the same transaction right? Should it be done via Webrowser client or via transactions? Is there a sample code on how to achieve this?
yes, you can now fund the node and register the ID with whatever smart contract you need in one solana Tx.
No - Bundlr transactions != Solana/other network transactions - in order to leverage this you need to generate the complex solana transaction (i.e containing the instructions to transfer funds to the node, as well as interact with whatever contract you like) yourself, and then you can submit it to Bundlr by POSTing https://<nodeurl>/acccount/balance/solana
with body {tx_id: "solana transaction ID"}
Unfortunately, I don't have any sample code for how to do this at the moment
I have been playing around with the source code of your JS demo. But having to fill so many inputs and click on so many buttons makes for a terrible user experience on real websites. I have seen that transactions are supported so I was wondering if it would be possible to join all the steps on a single Solana transaction?
For instance, if I try to:
These are my doubts:
SOME_FILE_DATA
using WebBundlr? because your example doesn't work on web browsers:INTRUCTION_TO_OTHER_SOLANA_PROGRAM_USING_THE_IMAGE_HASH
)