diff --git a/src/node/bundlr.ts b/src/node/bundlr.ts index e3d025c3..a890c38e 100644 --- a/src/node/bundlr.ts +++ b/src/node/bundlr.ts @@ -63,6 +63,7 @@ export default class NodeBundlr extends Bundlr { * @param interactivePreflight - whether to interactively prompt the user for confirmation of upload (CLI ONLY) * @param keepDeleted - Whether to keep previously uploaded (but now deleted) files in the manifest * @param logFunction - for handling logging from the uploader for UX + * @param manifestTags - For allowing the caller to pass tags that will be added to the manifest transaction. * @returns */ public async uploadFolder( @@ -73,15 +74,17 @@ export default class NodeBundlr extends Bundlr { indexFile, interactivePreflight, logFunction, + manifestTags, }: { batchSize?: number; keepDeleted?: boolean; indexFile?: string; interactivePreflight?: boolean; logFunction?: (log: string) => Promise; + manifestTags?: { name: string; value: string }[]; } = {}, ): Promise { - return this.uploader.uploadFolder(path, { indexFile, batchSize, interactivePreflight, keepDeleted, logFunction }); + return this.uploader.uploadFolder(path, { indexFile, batchSize, interactivePreflight, keepDeleted, logFunction, manifestTags }); } public static async init(opts: { url: string; diff --git a/src/node/upload.ts b/src/node/upload.ts index ecc2f78b..9fd4247c 100644 --- a/src/node/upload.ts +++ b/src/node/upload.ts @@ -72,12 +72,14 @@ export default class NodeUploader extends Uploader { indexFile, interactivePreflight, logFunction, + manifestTags, }: { batchSize: number; keepDeleted: boolean; indexFile?: string; interactivePreflight?: boolean; logFunction?: (log: string) => Promise; + manifestTags?: { name: string; value: string }[]; } = { batchSize: 10, keepDeleted: true }, ): Promise { path = resolve(path); @@ -214,6 +216,7 @@ export default class NodeUploader extends Uploader { const tags = [ { name: "Type", value: "manifest" }, { name: "Content-Type", value: "application/x.arweave-manifest+json" }, + ...(manifestTags ?? []), ]; const mres = await this.uploadData(createReadStream(jsonManifestPath), { tags }).catch((e) => { throw new Error(`Failed to upload manifest: ${e.message}`);