bundlr.uploadWithReceipt(data, tags)
ℹ️
More information on cryptographically signed receipts can be found in our Bundlr 101 section.
Uploads any data passed to it, returns a signed receipt. This function is a part of our Proof Of Provenance and only works on node 1, and Devnet. It will return an error message if invoked on node 2.
Parameters
-data
: The data to upload
- tags
: Optional metatags
Returns
-response
: A JSON object with the following values
response = {
id, // Transaction id (used to download the data)
timestamp, // Timestamp (UNIX milliseconds) of when the transaction was created and verified
version, // The version of this JSON file, currently 1.0.0
public, // Public key of the bundler node used
signature, // A signed deep hash of the JSON receipt
deadlineHeight, // The block number by which the transaction must be finalized on Arweave
block, // Deprecated
validatorSignatures, // Reserved for future use once we're decentralized
verify, // An async function used to verify the receipt at any time
}
// Data to upload
const dataToUpload = "GM world.";
try {
const receipt = await bundlr.uploadWithReceipt(dataToUpload);
console.log(`Data uploaded ==> https://arweave.net/${receipt.id}`);
} catch (e) {
console.log("Error uploading file ", e);
}
ℹ️
The transaction id returned as part of the response is used to download the data, simply create a URL with the
format https://arweave.net/[transaction-id].