Comparing version 1.11.7 to 1.11.8
@@ -78,5 +78,13 @@ "use strict"; | ||
const digest = await this.driver.digest("SHA-256", data); | ||
// salt-length is derived from a formula described here | ||
const salt0 = await this.driver.verify({ | ||
name: "RSA-PSS", | ||
saltLength: 0, | ||
}, key, signature, data); | ||
const salt32 = await this.driver.verify({ | ||
name: "RSA-PSS", | ||
saltLength: 32, | ||
}, key, signature, data); | ||
// saltN's salt-length is derived from a formula described here | ||
// https://developer.mozilla.org/en-US/docs/Web/API/RsaPssParams | ||
return await this.driver.verify({ | ||
const saltN = await this.driver.verify({ | ||
name: "RSA-PSS", | ||
@@ -87,2 +95,3 @@ saltLength: Math.ceil((key.algorithm.modulusLength - 1) / 8) - | ||
}, key, signature, data); | ||
return salt0 || salt32 || saltN; | ||
} | ||
@@ -89,0 +98,0 @@ async jwkToCryptoKey(jwk) { |
@@ -1,2 +0,2 @@ | ||
declare type DeepHashChunk = Uint8Array | DeepHashChunks; | ||
type DeepHashChunk = Uint8Array | DeepHashChunks; | ||
interface DeepHashChunks extends Array<DeepHashChunk> { | ||
@@ -3,0 +3,0 @@ } |
@@ -17,3 +17,3 @@ import { AxiosResponse } from "axios"; | ||
} | ||
declare type AxiosResponseLite = { | ||
type AxiosResponseLite = { | ||
status: number; | ||
@@ -20,0 +20,0 @@ statusText?: string; |
@@ -21,3 +21,3 @@ export interface Chunk { | ||
} | ||
export declare type MerkelNode = BranchNode | LeafNode; | ||
export type MerkelNode = BranchNode | LeafNode; | ||
export declare const MAX_CHUNK_SIZE: number; | ||
@@ -24,0 +24,0 @@ export declare const MIN_CHUNK_SIZE: number; |
@@ -55,2 +55,15 @@ "use strict"; | ||
class TransactionUploader { | ||
get isComplete() { | ||
return (this.txPosted && | ||
this.chunkIndex === this.transaction.chunks.chunks.length); | ||
} | ||
get totalChunks() { | ||
return this.transaction.chunks.chunks.length; | ||
} | ||
get uploadedChunks() { | ||
return this.chunkIndex; | ||
} | ||
get pctComplete() { | ||
return Math.trunc((this.uploadedChunks / this.totalChunks) * 100); | ||
} | ||
constructor(api, transaction) { | ||
@@ -74,15 +87,2 @@ this.api = api; | ||
} | ||
get isComplete() { | ||
return (this.txPosted && | ||
this.chunkIndex === this.transaction.chunks.chunks.length); | ||
} | ||
get totalChunks() { | ||
return this.transaction.chunks.chunks.length; | ||
} | ||
get uploadedChunks() { | ||
return this.chunkIndex; | ||
} | ||
get pctComplete() { | ||
return Math.trunc((this.uploadedChunks / this.totalChunks) * 100); | ||
} | ||
/** | ||
@@ -89,0 +89,0 @@ * Uploads the next part of the transaction. |
@@ -1,2 +0,2 @@ | ||
export declare type Base64UrlString = string; | ||
export type Base64UrlString = string; | ||
export declare function concatBuffers(buffers: Uint8Array[] | ArrayBuffer[]): Uint8Array; | ||
@@ -3,0 +3,0 @@ export declare function b64UrlToString(b64UrlString: string): string; |
{ | ||
"name": "arweave", | ||
"version": "1.11.7", | ||
"version": "1.11.8", | ||
"description": "Arweave JS client library", | ||
@@ -5,0 +5,0 @@ "main": "./node/index.js", |
@@ -55,5 +55,13 @@ "use strict"; | ||
const digest = await this.driver.digest("SHA-256", data); | ||
// salt-length is derived from a formula described here | ||
const salt0 = await this.driver.verify({ | ||
name: "RSA-PSS", | ||
saltLength: 0, | ||
}, key, signature, data); | ||
const salt32 = await this.driver.verify({ | ||
name: "RSA-PSS", | ||
saltLength: 32, | ||
}, key, signature, data); | ||
// saltN's salt-length is derived from a formula described here | ||
// https://developer.mozilla.org/en-US/docs/Web/API/RsaPssParams | ||
return await this.driver.verify({ | ||
const saltN = await this.driver.verify({ | ||
name: "RSA-PSS", | ||
@@ -64,2 +72,3 @@ saltLength: Math.ceil((key.algorithm.modulusLength - 1) / 8) - | ||
}, key, signature, data); | ||
return salt0 || salt32 || saltN; | ||
} | ||
@@ -66,0 +75,0 @@ async jwkToCryptoKey(jwk) { |
@@ -1,2 +0,2 @@ | ||
declare type DeepHashChunk = Uint8Array | DeepHashChunks; | ||
type DeepHashChunk = Uint8Array | DeepHashChunks; | ||
interface DeepHashChunks extends Array<DeepHashChunk> { | ||
@@ -3,0 +3,0 @@ } |
@@ -17,3 +17,3 @@ import { AxiosResponse } from "axios"; | ||
} | ||
declare type AxiosResponseLite = { | ||
type AxiosResponseLite = { | ||
status: number; | ||
@@ -20,0 +20,0 @@ statusText?: string; |
@@ -21,3 +21,3 @@ export interface Chunk { | ||
} | ||
export declare type MerkelNode = BranchNode | LeafNode; | ||
export type MerkelNode = BranchNode | LeafNode; | ||
export declare const MAX_CHUNK_SIZE: number; | ||
@@ -24,0 +24,0 @@ export declare const MIN_CHUNK_SIZE: number; |
@@ -29,2 +29,15 @@ "use strict"; | ||
class TransactionUploader { | ||
get isComplete() { | ||
return (this.txPosted && | ||
this.chunkIndex === this.transaction.chunks.chunks.length); | ||
} | ||
get totalChunks() { | ||
return this.transaction.chunks.chunks.length; | ||
} | ||
get uploadedChunks() { | ||
return this.chunkIndex; | ||
} | ||
get pctComplete() { | ||
return Math.trunc((this.uploadedChunks / this.totalChunks) * 100); | ||
} | ||
constructor(api, transaction) { | ||
@@ -48,15 +61,2 @@ this.api = api; | ||
} | ||
get isComplete() { | ||
return (this.txPosted && | ||
this.chunkIndex === this.transaction.chunks.chunks.length); | ||
} | ||
get totalChunks() { | ||
return this.transaction.chunks.chunks.length; | ||
} | ||
get uploadedChunks() { | ||
return this.chunkIndex; | ||
} | ||
get pctComplete() { | ||
return Math.trunc((this.uploadedChunks / this.totalChunks) * 100); | ||
} | ||
/** | ||
@@ -63,0 +63,0 @@ * Uploads the next part of the transaction. |
@@ -1,2 +0,2 @@ | ||
export declare type Base64UrlString = string; | ||
export type Base64UrlString = string; | ||
export declare function concatBuffers(buffers: Uint8Array[] | ArrayBuffer[]): Uint8Array; | ||
@@ -3,0 +3,0 @@ export declare function b64UrlToString(b64UrlString: string): string; |
Sorry, the diff of this file is too big to display
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
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
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
1290397
14520