Socket
Socket
Sign inDemoInstall

arbundles

Package Overview
Dependencies
Maintainers
3
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arbundles - npm Package Compare versions

Comparing version 0.9.5 to 0.9.6

1

build/node/cjs/src/ar-data-create.js

@@ -27,2 +27,3 @@ "use strict";

const anchor_length = 1 + ((_b = _anchor === null || _anchor === void 0 ? void 0 : _anchor.byteLength) !== null && _b !== void 0 ? _b : 0);
// @ts-expect-error opts.tags has a null guard
const _tags = ((_d = (_c = opts === null || opts === void 0 ? void 0 : opts.tags) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) > 0 ? (0, tags_1.serializeTags)(opts.tags) : null;

@@ -29,0 +30,0 @@ const tags_length = 16 + (_tags ? _tags.byteLength : 0);

3

build/node/cjs/src/file/createData.js

@@ -33,3 +33,4 @@ "use strict";

const _anchor = (opts === null || opts === void 0 ? void 0 : opts.anchor) ? Buffer.from(opts.anchor) : null;
const _tags = ((_b = (_a = opts === null || opts === void 0 ? void 0 : opts.tags) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0 ? yield (0, tags_1.serializeTags)(opts.tags) : null;
// @ts-expect-error undefined opts.tags already has a guard
const _tags = ((_b = (_a = opts === null || opts === void 0 ? void 0 : opts.tags) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0 ? (0, tags_1.serializeTags)(opts.tags) : null;
stream.write((0, utils_1.shortTo2ByteArray)(signer.signatureType));

@@ -36,0 +37,0 @@ // Signature

@@ -104,3 +104,3 @@ "use strict";

const fd = yield fileToFd(file);
const offset = (_a = options.offset) !== null && _a !== void 0 ? _a : 0;
const offset = (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : 0;
const buffer = yield read(fd.fd, Buffer.allocUnsafe(512), offset, 512, null).then((r) => r.buffer);

@@ -116,3 +116,3 @@ yield fd.close();

const fd = yield fileToFd(file);
const offset = (_a = options.offset) !== null && _a !== void 0 ? _a : 0;
const offset = (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : 0;
const buffer = yield read(fd.fd, Buffer.allocUnsafe(512), offset, 512, null).then((r) => r.buffer);

@@ -128,3 +128,3 @@ yield fd.close();

const fd = yield fileToFd(file);
const offset = (_a = options.offset) !== null && _a !== void 0 ? _a : 0;
const offset = (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : 0;
const buffer = yield read(fd.fd, Buffer.allocUnsafe(512), offset + 512, 512, null).then((r) => r.buffer);

@@ -140,3 +140,3 @@ yield fd.close();

const fd = yield fileToFd(file);
const offset = (_a = options.offset) !== null && _a !== void 0 ? _a : 0;
const offset = (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : 0;
const targetStart = offset + 1024;

@@ -157,3 +157,3 @@ const targetPresent = yield read(fd.fd, Buffer.allocUnsafe(1), targetStart, 1, null).then((value) => value.buffer[0] == 1);

const fd = yield fileToFd(file);
const offset = (_a = options.offset) !== null && _a !== void 0 ? _a : 0;
const offset = (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : 0;
const targetPresent = yield read(fd.fd, Buffer.allocUnsafe(1), 1024, 1, null).then((value) => value.buffer[0] == 1);

@@ -160,0 +160,0 @@ let anchorStart = offset + 1025;

@@ -52,2 +52,4 @@ "use strict";

get id() {
if (!this._id)
throw new Error("FileDataItem - ID is undefined");
return base64url_1.default.encode(this._id);

@@ -54,0 +56,0 @@ }

@@ -25,2 +25,4 @@ "use strict";

get publicKey() {
if (!this.pk)
throw new Error("ArweaveSigner - pk is undefined");
return base64url_1.default.toBuffer(this.pk);

@@ -27,0 +29,0 @@ }

@@ -24,2 +24,4 @@ "use strict";

this.provider = provider;
if (!this.provider.publicKey)
throw new Error("InjectedSolanaSigner - provider.publicKey is undefined");
this._publicKey = this.provider.publicKey.toBuffer();

@@ -26,0 +28,0 @@ }

@@ -5,3 +5,3 @@ /// <reference types="node" />

private _key;
pk?: string;
pk?: string | undefined;
readonly signatureType: number;

@@ -12,5 +12,5 @@ readonly ownerLength: number;

get publicKey(): Buffer;
constructor(_key: string, pk?: string);
constructor(_key: string, pk?: string | undefined);
sign(message: Uint8Array): Uint8Array;
static verify(pk: string | Buffer, message: Uint8Array, signature: Uint8Array): Promise<boolean>;
}

@@ -197,3 +197,3 @@ "use strict";

return __awaiter(this, void 0, void 0, function* () {
if (buffer.byteLength > length)
if (buffer.byteLength >= length)
return buffer;

@@ -200,0 +200,0 @@ const { done, value } = yield reader.next();

@@ -17,5 +17,5 @@ /// <reference types="node" />

readTags(): Tag[];
protected readString(): string | undefined;
protected readString(): string;
}
export declare function serializeTags(tags: Tag[]): Buffer;
export declare function deserializeTags(tagsBuffer: Buffer): Tag[];

@@ -21,3 +21,3 @@ "use strict";

const tag = tags[i];
if ((tag === null || tag === void 0 ? void 0 : tag.name) === undefined || (tag === null || tag === void 0 ? void 0 : tag.value) === undefined)
if (typeof (tag === null || tag === void 0 ? void 0 : tag.name) !== "string" || typeof (tag === null || tag === void 0 ? void 0 : tag.value) !== "string")
throw new Error(`Invalid tag format for ${tag}, expected {name:string, value: string}`);

@@ -169,3 +169,4 @@ this.writeString(tag.name);

if (this.pos > buf.length) {
return undefined;
// return undefined;
throw new Error("TAP Position out of range");
}

@@ -172,0 +173,0 @@ return this.buf.slice(pos, pos + len).toString();

@@ -35,3 +35,3 @@ /// <reference types="node" />

sign(item: arbundlesSrc.DataItem, signer: arbundlesSrc.Signer): Promise<Buffer>;
createData(data: string | Uint8Array, signer: arbundlesSrc.Signer, opts?: arbundlesSrc.DataItemCreateOptions): arbundlesSrc.DataItem;
createData(data: string | Uint8Array, signer: arbundlesSrc.Signer, opts?: arbundlesSrc.DataItemCreateOptions | undefined): arbundlesSrc.DataItem;
Bundle: typeof arbundlesSrc.Bundle;

@@ -93,3 +93,3 @@ BundleItem: typeof arbundlesSrc.BundleItem;

sign(item: arbundlesSrc.DataItem, signer: arbundlesSrc.Signer): Promise<Buffer>;
createData(data: string | Uint8Array, signer: arbundlesSrc.Signer, opts?: arbundlesSrc.DataItemCreateOptions): arbundlesSrc.DataItem;
createData(data: string | Uint8Array, signer: arbundlesSrc.Signer, opts?: arbundlesSrc.DataItemCreateOptions | undefined): arbundlesSrc.DataItem;
Bundle: typeof arbundlesSrc.Bundle;

@@ -96,0 +96,0 @@ BundleItem: typeof arbundlesSrc.BundleItem;

@@ -20,2 +20,3 @@ import base64url from "base64url";

const anchor_length = 1 + (_anchor?.byteLength ?? 0);
// @ts-expect-error opts.tags has a null guard
const _tags = (opts?.tags?.length ?? 0) > 0 ? serializeTags(opts.tags) : null;

@@ -22,0 +23,0 @@ const tags_length = 16 + (_tags ? _tags.byteLength : 0);

@@ -16,3 +16,4 @@ import FileDataItem from "./FileDataItem.js";

const _anchor = opts?.anchor ? Buffer.from(opts.anchor) : null;
const _tags = (opts?.tags?.length ?? 0) > 0 ? await serializeTags(opts.tags) : null;
// @ts-expect-error undefined opts.tags already has a guard
const _tags = (opts?.tags?.length ?? 0) > 0 ? serializeTags(opts.tags) : null;
stream.write(shortTo2ByteArray(signer.signatureType));

@@ -19,0 +20,0 @@ // Signature

@@ -63,3 +63,3 @@ import { createReadStream, promises, read as FSRead } from "fs";

const fd = await fileToFd(file);
const offset = options.offset ?? 0;
const offset = options?.offset ?? 0;
const buffer = await read(fd.fd, Buffer.allocUnsafe(512), offset, 512, null).then((r) => r.buffer);

@@ -71,3 +71,3 @@ await fd.close();

const fd = await fileToFd(file);
const offset = options.offset ?? 0;
const offset = options?.offset ?? 0;
const buffer = await read(fd.fd, Buffer.allocUnsafe(512), offset, 512, null).then((r) => r.buffer);

@@ -79,3 +79,3 @@ await fd.close();

const fd = await fileToFd(file);
const offset = options.offset ?? 0;
const offset = options?.offset ?? 0;
const buffer = await read(fd.fd, Buffer.allocUnsafe(512), offset + 512, 512, null).then((r) => r.buffer);

@@ -87,3 +87,3 @@ await fd.close();

const fd = await fileToFd(file);
const offset = options.offset ?? 0;
const offset = options?.offset ?? 0;
const targetStart = offset + 1024;

@@ -100,3 +100,3 @@ const targetPresent = await read(fd.fd, Buffer.allocUnsafe(1), targetStart, 1, null).then((value) => value.buffer[0] == 1);

const fd = await fileToFd(file);
const offset = options.offset ?? 0;
const offset = options?.offset ?? 0;
const targetPresent = await read(fd.fd, Buffer.allocUnsafe(1), 1024, 1, null).then((value) => value.buffer[0] == 1);

@@ -103,0 +103,0 @@ let anchorStart = offset + 1025;

@@ -33,2 +33,4 @@ import base64url from "base64url";

get id() {
if (!this._id)
throw new Error("FileDataItem - ID is undefined");
return base64url.encode(this._id);

@@ -35,0 +37,0 @@ }

@@ -12,2 +12,4 @@ import Rsa4096Pss from "../keys/Rsa4096Pss.js";

get publicKey() {
if (!this.pk)
throw new Error("ArweaveSigner - pk is undefined");
return base64url.toBuffer(this.pk);

@@ -14,0 +16,0 @@ }

@@ -13,2 +13,4 @@ import base64url from "base64url";

this.provider = provider;
if (!this.provider.publicKey)
throw new Error("InjectedSolanaSigner - provider.publicKey is undefined");
this._publicKey = this.provider.publicKey.toBuffer();

@@ -15,0 +17,0 @@ }

@@ -5,3 +5,3 @@ /// <reference types="node" />

private _key;
pk?: string;
pk?: string | undefined;
readonly signatureType: number;

@@ -12,5 +12,5 @@ readonly ownerLength: number;

get publicKey(): Buffer;
constructor(_key: string, pk?: string);
constructor(_key: string, pk?: string | undefined);
sign(message: Uint8Array): Uint8Array;
static verify(pk: string | Buffer, message: Uint8Array, signature: Uint8Array): Promise<boolean>;
}

@@ -156,3 +156,3 @@ import { PassThrough, Transform } from "stream";

async function readBytes(reader, buffer, length) {
if (buffer.byteLength > length)
if (buffer.byteLength >= length)
return buffer;

@@ -159,0 +159,0 @@ const { done, value } = await reader.next();

@@ -17,5 +17,5 @@ /// <reference types="node" />

readTags(): Tag[];
protected readString(): string | undefined;
protected readString(): string;
}
export declare function serializeTags(tags: Tag[]): Buffer;
export declare function deserializeTags(tagsBuffer: Buffer): Tag[];

@@ -20,3 +20,3 @@ import { MAX_TAG_BYTES } from "./DataItem.js";

const tag = tags[i];
if (tag?.name === undefined || tag?.value === undefined)
if (typeof tag?.name !== "string" || typeof tag?.value !== "string")
throw new Error(`Invalid tag format for ${tag}, expected {name:string, value: string}`);

@@ -168,3 +168,4 @@ this.writeString(tag.name);

if (this.pos > buf.length) {
return undefined;
// return undefined;
throw new Error("TAP Position out of range");
}

@@ -171,0 +172,0 @@ return this.buf.slice(pos, pos + len).toString();

@@ -35,3 +35,3 @@ /// <reference types="node" />

sign(item: arbundlesSrc.DataItem, signer: arbundlesSrc.Signer): Promise<Buffer>;
createData(data: string | Uint8Array, signer: arbundlesSrc.Signer, opts?: arbundlesSrc.DataItemCreateOptions): arbundlesSrc.DataItem;
createData(data: string | Uint8Array, signer: arbundlesSrc.Signer, opts?: arbundlesSrc.DataItemCreateOptions | undefined): arbundlesSrc.DataItem;
Bundle: typeof arbundlesSrc.Bundle;

@@ -93,3 +93,3 @@ BundleItem: typeof arbundlesSrc.BundleItem;

sign(item: arbundlesSrc.DataItem, signer: arbundlesSrc.Signer): Promise<Buffer>;
createData(data: string | Uint8Array, signer: arbundlesSrc.Signer, opts?: arbundlesSrc.DataItemCreateOptions): arbundlesSrc.DataItem;
createData(data: string | Uint8Array, signer: arbundlesSrc.Signer, opts?: arbundlesSrc.DataItemCreateOptions | undefined): arbundlesSrc.DataItem;
Bundle: typeof arbundlesSrc.Bundle;

@@ -96,0 +96,0 @@ BundleItem: typeof arbundlesSrc.BundleItem;

@@ -27,2 +27,3 @@ "use strict";

const anchor_length = 1 + ((_b = _anchor === null || _anchor === void 0 ? void 0 : _anchor.byteLength) !== null && _b !== void 0 ? _b : 0);
// @ts-expect-error opts.tags has a null guard
const _tags = ((_d = (_c = opts === null || opts === void 0 ? void 0 : opts.tags) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) > 0 ? (0, tags_1.serializeTags)(opts.tags) : null;

@@ -29,0 +30,0 @@ const tags_length = 16 + (_tags ? _tags.byteLength : 0);

@@ -33,3 +33,4 @@ "use strict";

const _anchor = (opts === null || opts === void 0 ? void 0 : opts.anchor) ? Buffer.from(opts.anchor) : null;
const _tags = ((_b = (_a = opts === null || opts === void 0 ? void 0 : opts.tags) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0 ? yield (0, tags_1.serializeTags)(opts.tags) : null;
// @ts-expect-error undefined opts.tags already has a guard
const _tags = ((_b = (_a = opts === null || opts === void 0 ? void 0 : opts.tags) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0 ? (0, tags_1.serializeTags)(opts.tags) : null;
stream.write((0, utils_1.shortTo2ByteArray)(signer.signatureType));

@@ -36,0 +37,0 @@ // Signature

@@ -104,3 +104,3 @@ "use strict";

const fd = yield fileToFd(file);
const offset = (_a = options.offset) !== null && _a !== void 0 ? _a : 0;
const offset = (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : 0;
const buffer = yield read(fd.fd, Buffer.allocUnsafe(512), offset, 512, null).then((r) => r.buffer);

@@ -116,3 +116,3 @@ yield fd.close();

const fd = yield fileToFd(file);
const offset = (_a = options.offset) !== null && _a !== void 0 ? _a : 0;
const offset = (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : 0;
const buffer = yield read(fd.fd, Buffer.allocUnsafe(512), offset, 512, null).then((r) => r.buffer);

@@ -128,3 +128,3 @@ yield fd.close();

const fd = yield fileToFd(file);
const offset = (_a = options.offset) !== null && _a !== void 0 ? _a : 0;
const offset = (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : 0;
const buffer = yield read(fd.fd, Buffer.allocUnsafe(512), offset + 512, 512, null).then((r) => r.buffer);

@@ -140,3 +140,3 @@ yield fd.close();

const fd = yield fileToFd(file);
const offset = (_a = options.offset) !== null && _a !== void 0 ? _a : 0;
const offset = (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : 0;
const targetStart = offset + 1024;

@@ -157,3 +157,3 @@ const targetPresent = yield read(fd.fd, Buffer.allocUnsafe(1), targetStart, 1, null).then((value) => value.buffer[0] == 1);

const fd = yield fileToFd(file);
const offset = (_a = options.offset) !== null && _a !== void 0 ? _a : 0;
const offset = (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : 0;
const targetPresent = yield read(fd.fd, Buffer.allocUnsafe(1), 1024, 1, null).then((value) => value.buffer[0] == 1);

@@ -160,0 +160,0 @@ let anchorStart = offset + 1025;

@@ -52,2 +52,4 @@ "use strict";

get id() {
if (!this._id)
throw new Error("FileDataItem - ID is undefined");
return base64url_1.default.encode(this._id);

@@ -54,0 +56,0 @@ }

@@ -25,2 +25,4 @@ "use strict";

get publicKey() {
if (!this.pk)
throw new Error("ArweaveSigner - pk is undefined");
return base64url_1.default.toBuffer(this.pk);

@@ -27,0 +29,0 @@ }

@@ -24,2 +24,4 @@ "use strict";

this.provider = provider;
if (!this.provider.publicKey)
throw new Error("InjectedSolanaSigner - provider.publicKey is undefined");
this._publicKey = this.provider.publicKey.toBuffer();

@@ -26,0 +28,0 @@ }

@@ -5,3 +5,3 @@ /// <reference types="node" />

private _key;
pk?: string;
pk?: string | undefined;
readonly signatureType: number;

@@ -12,5 +12,5 @@ readonly ownerLength: number;

get publicKey(): Buffer;
constructor(_key: string, pk?: string);
constructor(_key: string, pk?: string | undefined);
sign(message: Uint8Array): Uint8Array;
static verify(pk: string | Buffer, message: Uint8Array, signature: Uint8Array): Promise<boolean>;
}

@@ -197,3 +197,3 @@ "use strict";

return __awaiter(this, void 0, void 0, function* () {
if (buffer.byteLength > length)
if (buffer.byteLength >= length)
return buffer;

@@ -200,0 +200,0 @@ const { done, value } = yield reader.next();

@@ -17,5 +17,5 @@ /// <reference types="node" />

readTags(): Tag[];
protected readString(): string | undefined;
protected readString(): string;
}
export declare function serializeTags(tags: Tag[]): Buffer;
export declare function deserializeTags(tagsBuffer: Buffer): Tag[];

@@ -21,3 +21,3 @@ "use strict";

const tag = tags[i];
if ((tag === null || tag === void 0 ? void 0 : tag.name) === undefined || (tag === null || tag === void 0 ? void 0 : tag.value) === undefined)
if (typeof (tag === null || tag === void 0 ? void 0 : tag.name) !== "string" || typeof (tag === null || tag === void 0 ? void 0 : tag.value) !== "string")
throw new Error(`Invalid tag format for ${tag}, expected {name:string, value: string}`);

@@ -169,3 +169,4 @@ this.writeString(tag.name);

if (this.pos > buf.length) {
return undefined;
// return undefined;
throw new Error("TAP Position out of range");
}

@@ -172,0 +173,0 @@ return this.buf.slice(pos, pos + len).toString();

@@ -35,3 +35,3 @@ /// <reference types="node" />

sign(item: arbundlesSrc.DataItem, signer: arbundlesSrc.Signer): Promise<Buffer>;
createData(data: string | Uint8Array, signer: arbundlesSrc.Signer, opts?: arbundlesSrc.DataItemCreateOptions): arbundlesSrc.DataItem;
createData(data: string | Uint8Array, signer: arbundlesSrc.Signer, opts?: arbundlesSrc.DataItemCreateOptions | undefined): arbundlesSrc.DataItem;
Bundle: typeof arbundlesSrc.Bundle;

@@ -93,3 +93,3 @@ BundleItem: typeof arbundlesSrc.BundleItem;

sign(item: arbundlesSrc.DataItem, signer: arbundlesSrc.Signer): Promise<Buffer>;
createData(data: string | Uint8Array, signer: arbundlesSrc.Signer, opts?: arbundlesSrc.DataItemCreateOptions): arbundlesSrc.DataItem;
createData(data: string | Uint8Array, signer: arbundlesSrc.Signer, opts?: arbundlesSrc.DataItemCreateOptions | undefined): arbundlesSrc.DataItem;
Bundle: typeof arbundlesSrc.Bundle;

@@ -96,0 +96,0 @@ BundleItem: typeof arbundlesSrc.BundleItem;

@@ -20,2 +20,3 @@ import base64url from "base64url";

const anchor_length = 1 + (_anchor?.byteLength ?? 0);
// @ts-expect-error opts.tags has a null guard
const _tags = (opts?.tags?.length ?? 0) > 0 ? serializeTags(opts.tags) : null;

@@ -22,0 +23,0 @@ const tags_length = 16 + (_tags ? _tags.byteLength : 0);

@@ -16,3 +16,4 @@ import FileDataItem from "./FileDataItem.js";

const _anchor = opts?.anchor ? Buffer.from(opts.anchor) : null;
const _tags = (opts?.tags?.length ?? 0) > 0 ? await serializeTags(opts.tags) : null;
// @ts-expect-error undefined opts.tags already has a guard
const _tags = (opts?.tags?.length ?? 0) > 0 ? serializeTags(opts.tags) : null;
stream.write(shortTo2ByteArray(signer.signatureType));

@@ -19,0 +20,0 @@ // Signature

@@ -63,3 +63,3 @@ import { createReadStream, promises, read as FSRead } from "fs";

const fd = await fileToFd(file);
const offset = options.offset ?? 0;
const offset = options?.offset ?? 0;
const buffer = await read(fd.fd, Buffer.allocUnsafe(512), offset, 512, null).then((r) => r.buffer);

@@ -71,3 +71,3 @@ await fd.close();

const fd = await fileToFd(file);
const offset = options.offset ?? 0;
const offset = options?.offset ?? 0;
const buffer = await read(fd.fd, Buffer.allocUnsafe(512), offset, 512, null).then((r) => r.buffer);

@@ -79,3 +79,3 @@ await fd.close();

const fd = await fileToFd(file);
const offset = options.offset ?? 0;
const offset = options?.offset ?? 0;
const buffer = await read(fd.fd, Buffer.allocUnsafe(512), offset + 512, 512, null).then((r) => r.buffer);

@@ -87,3 +87,3 @@ await fd.close();

const fd = await fileToFd(file);
const offset = options.offset ?? 0;
const offset = options?.offset ?? 0;
const targetStart = offset + 1024;

@@ -100,3 +100,3 @@ const targetPresent = await read(fd.fd, Buffer.allocUnsafe(1), targetStart, 1, null).then((value) => value.buffer[0] == 1);

const fd = await fileToFd(file);
const offset = options.offset ?? 0;
const offset = options?.offset ?? 0;
const targetPresent = await read(fd.fd, Buffer.allocUnsafe(1), 1024, 1, null).then((value) => value.buffer[0] == 1);

@@ -103,0 +103,0 @@ let anchorStart = offset + 1025;

@@ -33,2 +33,4 @@ import base64url from "base64url";

get id() {
if (!this._id)
throw new Error("FileDataItem - ID is undefined");
return base64url.encode(this._id);

@@ -35,0 +37,0 @@ }

@@ -12,2 +12,4 @@ import Rsa4096Pss from "../keys/Rsa4096Pss.js";

get publicKey() {
if (!this.pk)
throw new Error("ArweaveSigner - pk is undefined");
return base64url.toBuffer(this.pk);

@@ -14,0 +16,0 @@ }

@@ -13,2 +13,4 @@ import base64url from "base64url";

this.provider = provider;
if (!this.provider.publicKey)
throw new Error("InjectedSolanaSigner - provider.publicKey is undefined");
this._publicKey = this.provider.publicKey.toBuffer();

@@ -15,0 +17,0 @@ }

@@ -5,3 +5,3 @@ /// <reference types="node" />

private _key;
pk?: string;
pk?: string | undefined;
readonly signatureType: number;

@@ -12,5 +12,5 @@ readonly ownerLength: number;

get publicKey(): Buffer;
constructor(_key: string, pk?: string);
constructor(_key: string, pk?: string | undefined);
sign(message: Uint8Array): Uint8Array;
static verify(pk: string | Buffer, message: Uint8Array, signature: Uint8Array): Promise<boolean>;
}

@@ -156,3 +156,3 @@ import { PassThrough, Transform } from "stream";

async function readBytes(reader, buffer, length) {
if (buffer.byteLength > length)
if (buffer.byteLength >= length)
return buffer;

@@ -159,0 +159,0 @@ const { done, value } = await reader.next();

@@ -17,5 +17,5 @@ /// <reference types="node" />

readTags(): Tag[];
protected readString(): string | undefined;
protected readString(): string;
}
export declare function serializeTags(tags: Tag[]): Buffer;
export declare function deserializeTags(tagsBuffer: Buffer): Tag[];

@@ -20,3 +20,3 @@ import { MAX_TAG_BYTES } from "./DataItem.js";

const tag = tags[i];
if (tag?.name === undefined || tag?.value === undefined)
if (typeof tag?.name !== "string" || typeof tag?.value !== "string")
throw new Error(`Invalid tag format for ${tag}, expected {name:string, value: string}`);

@@ -168,3 +168,4 @@ this.writeString(tag.name);

if (this.pos > buf.length) {
return undefined;
// return undefined;
throw new Error("TAP Position out of range");
}

@@ -171,0 +172,0 @@ return this.buf.slice(pos, pos + len).toString();

@@ -35,3 +35,3 @@ /// <reference types="node" />

sign(item: arbundlesSrc.DataItem, signer: arbundlesSrc.Signer): Promise<Buffer>;
createData(data: string | Uint8Array, signer: arbundlesSrc.Signer, opts?: arbundlesSrc.DataItemCreateOptions): arbundlesSrc.DataItem;
createData(data: string | Uint8Array, signer: arbundlesSrc.Signer, opts?: arbundlesSrc.DataItemCreateOptions | undefined): arbundlesSrc.DataItem;
Bundle: typeof arbundlesSrc.Bundle;

@@ -92,3 +92,3 @@ BundleItem: typeof arbundlesSrc.BundleItem;

sign(item: arbundlesSrc.DataItem, signer: arbundlesSrc.Signer): Promise<Buffer>;
createData(data: string | Uint8Array, signer: arbundlesSrc.Signer, opts?: arbundlesSrc.DataItemCreateOptions): arbundlesSrc.DataItem;
createData(data: string | Uint8Array, signer: arbundlesSrc.Signer, opts?: arbundlesSrc.DataItemCreateOptions | undefined): arbundlesSrc.DataItem;
Bundle: typeof arbundlesSrc.Bundle;

@@ -95,0 +95,0 @@ BundleItem: typeof arbundlesSrc.BundleItem;

{
"name": "arbundles",
"version": "0.9.5",
"version": "0.9.6",
"description": "Arweave bundling library",

@@ -5,0 +5,0 @@ "author": "Josh Benaron <joshbenaron@gmail.com>",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc