arbundles
Advanced tools
Comparing version 0.6.10 to 0.6.11
{ | ||
"name": "arbundles", | ||
"version": "0.6.10", | ||
"version": "0.6.11", | ||
"description": "Arweave bundling library", | ||
@@ -5,0 +5,0 @@ "author": "Josh Benaron <joshbenaron@gmail.com>", |
@@ -79,2 +79,8 @@ /// <reference types="node" /> | ||
/** | ||
* Returns data which needs to be signed | ||
* | ||
* @public | ||
*/ | ||
getSignatureData(): Promise<Uint8Array>; | ||
/** | ||
* Returns the start byte of the tags section (number of tags) | ||
@@ -81,0 +87,0 @@ * |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -16,2 +35,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
const constants_1 = require("./constants"); | ||
const crypto = __importStar(require("crypto")); | ||
exports.MIN_BINARY_SIZE = 80; | ||
@@ -52,6 +72,6 @@ class DataItem { | ||
get rawId() { | ||
if (!this._id) { | ||
throw new Error("To get the data item id you must sign the item first"); | ||
} | ||
return this._id; | ||
return crypto | ||
.createHash("sha256") | ||
.update(this.rawSignature) | ||
.digest(); | ||
} | ||
@@ -232,2 +252,10 @@ set rawId(id) { | ||
/** | ||
* Returns data which needs to be signed | ||
* | ||
* @public | ||
*/ | ||
async getSignatureData() { | ||
return await ar_data_base_1.getSignatureData(this); | ||
} | ||
/** | ||
* Returns the start byte of the tags section (number of tags) | ||
@@ -234,0 +262,0 @@ * |
Sorry, the diff of this file is not supported yet
197178
2815