Comparing version 0.2.10 to 0.2.11
@@ -146,7 +146,11 @@ "use strict"; | ||
throw new Error("You must sign before sending to bundler"); | ||
return await axios_1.default.post(`${bundler ?? constants_1.BUNDLER}/tx`, this.getRaw(), { | ||
const response = await axios_1.default.post(`${bundler ?? constants_1.BUNDLER}/tx`, this.getRaw(), { | ||
headers, | ||
timeout: 100000, | ||
maxBodyLength: Infinity, | ||
validateStatus: (status) => (status > 200 && status < 300) || status !== 402 | ||
}); | ||
if (response.status === 402) | ||
throw new Error("Not enough funds to send data"); | ||
return response; | ||
} | ||
@@ -153,0 +157,0 @@ static async verify(buffer) { |
@@ -5,4 +5,6 @@ /// <reference types="node" /> | ||
export default class ArweaveSigner extends Rsa4096Pss { | ||
private jwk; | ||
get publicKey(): Buffer; | ||
constructor(jwk: JWKInterface); | ||
sign(message: Uint8Array): Uint8Array; | ||
} |
@@ -7,3 +7,5 @@ "use strict"; | ||
const base64url_1 = tslib_1.__importDefault(require("base64url")); | ||
const arweave_1 = tslib_1.__importDefault(require("arweave")); | ||
class ArweaveSigner extends Rsa4096Pss_1.default { | ||
jwk; | ||
get publicKey() { | ||
@@ -15,5 +17,9 @@ return base64url_1.default.toBuffer(this.pk); | ||
super(pem, jwk.n); | ||
this.jwk = jwk; | ||
} | ||
sign(message) { | ||
return arweave_1.default.crypto.sign(this.jwk, message); | ||
} | ||
} | ||
exports.default = ArweaveSigner; | ||
//# sourceMappingURL=ArweaveSigner.js.map |
@@ -5,4 +5,4 @@ /// <reference types="node" /> | ||
readonly signatureType: number; | ||
abstract sign(message: Uint8Array): Uint8Array; | ||
abstract sign(message: Uint8Array): Promise<Uint8Array> | Uint8Array; | ||
static verify(_: string | Buffer): boolean; | ||
} |
@@ -218,7 +218,11 @@ "use strict"; | ||
throw new Error("You must sign before sending to bundler"); | ||
return await axios_1.default.post(`${bundler ?? constants_1.BUNDLER}/tx`, fs.createReadStream(this.filename), { | ||
const response = await axios_1.default.post(`${bundler ?? constants_1.BUNDLER}/tx`, fs.createReadStream(this.filename), { | ||
headers, | ||
timeout: 100000, | ||
maxBodyLength: Infinity, | ||
validateStatus: (status) => (status > 200 && status < 300) || status !== 402 | ||
}); | ||
if (response.status === 402) | ||
throw new Error("Not enough funds to send data"); | ||
return response; | ||
} | ||
@@ -225,0 +229,0 @@ async anchorStart() { |
@@ -5,4 +5,6 @@ /// <reference types="node" /> | ||
export default class ArweaveSigner extends Rsa4096Pss { | ||
private jwk; | ||
get publicKey(): Buffer; | ||
constructor(jwk: JWKInterface); | ||
sign(message: Uint8Array): Uint8Array; | ||
} |
@@ -7,3 +7,5 @@ "use strict"; | ||
const base64url_1 = tslib_1.__importDefault(require("base64url")); | ||
const arweave_1 = tslib_1.__importDefault(require("arweave")); | ||
class ArweaveSigner extends Rsa4096Pss_1.default { | ||
jwk; | ||
get publicKey() { | ||
@@ -15,5 +17,9 @@ return base64url_1.default.toBuffer(this.pk); | ||
super(pem, jwk.n); | ||
this.jwk = jwk; | ||
} | ||
sign(message) { | ||
return arweave_1.default.crypto.sign(this.jwk, message); | ||
} | ||
} | ||
exports.default = ArweaveSigner; | ||
//# sourceMappingURL=ArweaveSigner.js.map |
@@ -5,4 +5,4 @@ /// <reference types="node" /> | ||
readonly signatureType: number; | ||
abstract sign(message: Uint8Array): Uint8Array; | ||
abstract sign(message: Uint8Array): Promise<Uint8Array> | Uint8Array; | ||
static verify(_: string | Buffer): boolean; | ||
} |
{ | ||
"name": "arbundles", | ||
"version": "0.2.10", | ||
"version": "0.2.11", | ||
"description": "Arweave bundling library", | ||
@@ -5,0 +5,0 @@ "author": "Josh Benaron <joshbenaron@gmail.com>", |
@@ -91,5 +91,5 @@ # Arweave Bundles | ||
const data = await arweave.transactions.getData("hKMMPNh_emBf8v_at1tFzNYACisyMQNcKzeeE1QE9p8"); | ||
const data = await arweave.transactions.getData("hKMMPNh_emBf8v_at1tFzNYACisyMQNcKzeeE1QE9p8", { decode: true }); | ||
const bundle = new Bundle(data); | ||
const bundle = new Bundle(Buffer.from(data)); | ||
``` | ||
@@ -96,0 +96,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
92070
1983
1