Usage with Bundlr
Values too large? Meet Bundlr.
const response = await fetch(`https://arweave.net/${transactionId}`);const Bundlr = require('@bundlr-network/client');
async function upload(jwk, largeValue) {
const bundlr = new Bundlr.default('http://node1.bundlr.network', 'arweave', jwk);
const tags = [{name: 'Content-Type', value: 'application/json'}];
const transaction = await bundlr.createTransaction(
JSON.stringify({
data: largeValue,
}),
{
tags: tags,
}
);
await transaction.sign();
const txID = transaction.id;
// you can choose to not await this if you want to upload in the background
// but if the upload fails, you will not be able to get the data from the txid
await transaction.upload();
return txID;
}Last updated