@polkadot/wasm-crypto
Advanced tools
Comparing version 6.1.2-6 to 6.1.2-7
@@ -6,4 +6,20 @@ // Copyright 2019-2022 @polkadot/wasm-crypto authors & contributors | ||
export { packageInfo } from "./packageInfo.js"; | ||
export { bridge }; | ||
export { bridge }; // Removes the first parameter (expected as WasmCryptoInstance) and leaves the | ||
// rest of the parameters in-tack. This allows us to dynamically create a function | ||
// return from the withWasm helper | ||
/** | ||
* @internal | ||
* @description | ||
* This create an extenal interface function from the signature, all the while checking | ||
* the actual bridge wasm interface to ensure it has been initialized. | ||
* | ||
* This means that we can call it | ||
* | ||
* withWasm(wasm: WasmCryptoInstance, a: number, b: string) => Uint8Array | ||
* | ||
* and in this case it will create an interface function with the signarure | ||
* | ||
* (a: number, b: string) => Uint8Array | ||
*/ | ||
function withWasm(fn) { | ||
@@ -10,0 +26,0 @@ return (...params) => { |
@@ -33,2 +33,17 @@ "use strict"; | ||
// SPDX-License-Identifier: Apache-2.0 | ||
/** | ||
* @internal | ||
* @description | ||
* This create an extenal interface function from the signature, all the while checking | ||
* the actual bridge wasm interface to ensure it has been initialized. | ||
* | ||
* This means that we can call it | ||
* | ||
* withWasm(wasm: WasmCryptoInstance, a: number, b: string) => Uint8Array | ||
* | ||
* and in this case it will create an interface function with the signarure | ||
* | ||
* (a: number, b: string) => Uint8Array | ||
*/ | ||
function withWasm(fn) { | ||
@@ -35,0 +50,0 @@ return function () { |
@@ -15,3 +15,16 @@ "use strict"; | ||
// SPDX-License-Identifier: Apache-2.0 | ||
/** | ||
* @name bridge | ||
* @description | ||
* The JS <-> WASM bridge that is in operation. For the specific package | ||
* it is a global, i.e. all operations happens on this specific bridge | ||
*/ | ||
const bridge = new _wasmBridge.Bridge(_wasmCryptoInit.createWasm); | ||
/** | ||
* @name initBridge | ||
* @description | ||
* Creates a new bridge interface with the (optional) initialization function | ||
*/ | ||
exports.bridge = bridge; | ||
@@ -18,0 +31,0 @@ |
@@ -14,2 +14,12 @@ "use strict"; | ||
// SPDX-License-Identifier: Apache-2.0 | ||
/** | ||
* @name initWasm | ||
* @description | ||
* For historic purposes and for tighter control on init, specifically performing | ||
* a WASM initialization with no interface whatsoever (no WASM, no ASM.js) | ||
* | ||
* Generally should not be used unless you want explicit control over which | ||
* interfaces are initialized. | ||
*/ | ||
async function initWasm() { | ||
@@ -16,0 +26,0 @@ await (0, _init.initBridge)(_none.createWasm); |
@@ -14,2 +14,12 @@ "use strict"; | ||
// SPDX-License-Identifier: Apache-2.0 | ||
/** | ||
* @name initWasm | ||
* @description | ||
* For historic purposes and for tighter control on init, specifically performing | ||
* a WASM initialization with only ASM.js | ||
* | ||
* Generally should not be used unless you want explicit control over which | ||
* interfaces are initialized. | ||
*/ | ||
async function initWasm() { | ||
@@ -16,0 +26,0 @@ await (0, _init.initBridge)(_asm.createWasm); |
@@ -14,2 +14,12 @@ "use strict"; | ||
// SPDX-License-Identifier: Apache-2.0 | ||
/** | ||
* @name initWasm | ||
* @description | ||
* For historic purposes and for tighter control on init, specifically performing | ||
* a WASM initialization with only WASM (generally the default for most platforms) | ||
* | ||
* Generally should not be used unless you want explicit control over which | ||
* interfaces are initialized. | ||
*/ | ||
async function initWasm() { | ||
@@ -16,0 +26,0 @@ await (0, _init.initBridge)(_wasm.createWasm); |
@@ -14,2 +14,12 @@ "use strict"; | ||
// SPDX-License-Identifier: Apache-2.0 | ||
/** | ||
* @name initWasm | ||
* @description | ||
* For historic purposes and for tighter control on init, specifically performing | ||
* a WASM initialization with ASM and an ASM.js fallback | ||
* | ||
* Generally should not be used unless you want explicit control over which | ||
* interfaces are initialized. | ||
*/ | ||
async function initWasm() { | ||
@@ -16,0 +26,0 @@ await (0, _init.initBridge)(_both.createWasm); |
@@ -14,4 +14,4 @@ "use strict"; | ||
type: 'cjs', | ||
version: '6.1.2-6' | ||
version: '6.1.2-7' | ||
}; | ||
exports.packageInfo = packageInfo; |
import type { InitFn } from '@polkadot/wasm-bridge/types'; | ||
import type { WasmCryptoInstance } from '@polkadot/wasm-crypto-init/types'; | ||
import { Bridge } from '@polkadot/wasm-bridge'; | ||
/** | ||
* @name bridge | ||
* @description | ||
* The JS <-> WASM bridge that is in operation. For the specific package | ||
* it is a global, i.e. all operations happens on this specific bridge | ||
*/ | ||
export declare const bridge: Bridge<WasmCryptoInstance>; | ||
/** | ||
* @name initBridge | ||
* @description | ||
* Creates a new bridge interface with the (optional) initialization function | ||
*/ | ||
export declare function initBridge(createWasm?: InitFn<WasmCryptoInstance>): Promise<WasmCryptoInstance | null>; |
13
init.js
@@ -5,5 +5,18 @@ // Copyright 2019-2022 @polkadot/wasm-crypto authors & contributors | ||
import { createWasm } from '@polkadot/wasm-crypto-init'; | ||
/** | ||
* @name bridge | ||
* @description | ||
* The JS <-> WASM bridge that is in operation. For the specific package | ||
* it is a global, i.e. all operations happens on this specific bridge | ||
*/ | ||
export const bridge = new Bridge(createWasm); | ||
/** | ||
* @name initBridge | ||
* @description | ||
* Creates a new bridge interface with the (optional) initialization function | ||
*/ | ||
export async function initBridge(createWasm) { | ||
return bridge.init(createWasm); | ||
} |
@@ -0,1 +1,10 @@ | ||
/** | ||
* @name initWasm | ||
* @description | ||
* For historic purposes and for tighter control on init, specifically performing | ||
* a WASM initialization with no interface whatsoever (no WASM, no ASM.js) | ||
* | ||
* Generally should not be used unless you want explicit control over which | ||
* interfaces are initialized. | ||
*/ | ||
export declare function initWasm(): Promise<void>; |
@@ -5,2 +5,12 @@ // Copyright 2019-2022 @polkadot/wasm-crypto authors & contributors | ||
import { initBridge } from "./init.js"; | ||
/** | ||
* @name initWasm | ||
* @description | ||
* For historic purposes and for tighter control on init, specifically performing | ||
* a WASM initialization with no interface whatsoever (no WASM, no ASM.js) | ||
* | ||
* Generally should not be used unless you want explicit control over which | ||
* interfaces are initialized. | ||
*/ | ||
export async function initWasm() { | ||
@@ -7,0 +17,0 @@ await initBridge(createWasm); |
@@ -0,1 +1,10 @@ | ||
/** | ||
* @name initWasm | ||
* @description | ||
* For historic purposes and for tighter control on init, specifically performing | ||
* a WASM initialization with only ASM.js | ||
* | ||
* Generally should not be used unless you want explicit control over which | ||
* interfaces are initialized. | ||
*/ | ||
export declare function initWasm(): Promise<void>; |
@@ -5,2 +5,12 @@ // Copyright 2019-2022 @polkadot/wasm-crypto authors & contributors | ||
import { initBridge } from "./init.js"; | ||
/** | ||
* @name initWasm | ||
* @description | ||
* For historic purposes and for tighter control on init, specifically performing | ||
* a WASM initialization with only ASM.js | ||
* | ||
* Generally should not be used unless you want explicit control over which | ||
* interfaces are initialized. | ||
*/ | ||
export async function initWasm() { | ||
@@ -7,0 +17,0 @@ await initBridge(createWasm); |
@@ -0,1 +1,10 @@ | ||
/** | ||
* @name initWasm | ||
* @description | ||
* For historic purposes and for tighter control on init, specifically performing | ||
* a WASM initialization with only WASM (generally the default for most platforms) | ||
* | ||
* Generally should not be used unless you want explicit control over which | ||
* interfaces are initialized. | ||
*/ | ||
export declare function initWasm(): Promise<void>; |
@@ -5,2 +5,12 @@ // Copyright 2019-2022 @polkadot/wasm-crypto authors & contributors | ||
import { initBridge } from "./init.js"; | ||
/** | ||
* @name initWasm | ||
* @description | ||
* For historic purposes and for tighter control on init, specifically performing | ||
* a WASM initialization with only WASM (generally the default for most platforms) | ||
* | ||
* Generally should not be used unless you want explicit control over which | ||
* interfaces are initialized. | ||
*/ | ||
export async function initWasm() { | ||
@@ -7,0 +17,0 @@ await initBridge(createWasm); |
@@ -0,1 +1,10 @@ | ||
/** | ||
* @name initWasm | ||
* @description | ||
* For historic purposes and for tighter control on init, specifically performing | ||
* a WASM initialization with ASM and an ASM.js fallback | ||
* | ||
* Generally should not be used unless you want explicit control over which | ||
* interfaces are initialized. | ||
*/ | ||
export declare function initWasm(): Promise<void>; |
@@ -5,2 +5,12 @@ // Copyright 2019-2022 @polkadot/wasm-crypto authors & contributors | ||
import { initBridge } from "./init.js"; | ||
/** | ||
* @name initWasm | ||
* @description | ||
* For historic purposes and for tighter control on init, specifically performing | ||
* a WASM initialization with ASM and an ASM.js fallback | ||
* | ||
* Generally should not be used unless you want explicit control over which | ||
* interfaces are initialized. | ||
*/ | ||
export async function initWasm() { | ||
@@ -7,0 +17,0 @@ await initBridge(createWasm); |
@@ -31,3 +31,3 @@ { | ||
"type": "module", | ||
"version": "6.1.2-6", | ||
"version": "6.1.2-7", | ||
"main": "./cjs/index.js", | ||
@@ -98,7 +98,7 @@ "module": "./index.js", | ||
"@babel/runtime": "^7.18.3", | ||
"@polkadot/wasm-bridge": "6.1.2-6", | ||
"@polkadot/wasm-crypto-asmjs": "6.1.2-6", | ||
"@polkadot/wasm-crypto-init": "6.1.2-6", | ||
"@polkadot/wasm-crypto-wasm": "6.1.2-6", | ||
"@polkadot/wasm-util": "6.1.2-6" | ||
"@polkadot/wasm-bridge": "6.1.2-7", | ||
"@polkadot/wasm-crypto-asmjs": "6.1.2-7", | ||
"@polkadot/wasm-crypto-init": "6.1.2-7", | ||
"@polkadot/wasm-crypto-wasm": "6.1.2-7", | ||
"@polkadot/wasm-util": "6.1.2-7" | ||
}, | ||
@@ -105,0 +105,0 @@ "peerDependencies": { |
@@ -8,3 +8,3 @@ // Copyright 2017-2022 @polkadot/wasm-crypto authors & contributors | ||
type: 'esm', | ||
version: '6.1.2-6' | ||
version: '6.1.2-7' | ||
}; |
Sorry, the diff of this file is too big to display
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
306563
2344
+ Added@polkadot/wasm-bridge@6.1.2-7(transitive)
+ Added@polkadot/wasm-crypto-asmjs@6.1.2-7(transitive)
+ Added@polkadot/wasm-crypto-init@6.1.2-7(transitive)
+ Added@polkadot/wasm-crypto-wasm@6.1.2-7(transitive)
+ Added@polkadot/wasm-util@6.1.2-7(transitive)
- Removed@polkadot/wasm-bridge@6.1.2-6(transitive)
- Removed@polkadot/wasm-crypto-asmjs@6.1.2-6(transitive)
- Removed@polkadot/wasm-crypto-init@6.1.2-6(transitive)
- Removed@polkadot/wasm-crypto-wasm@6.1.2-6(transitive)
- Removed@polkadot/wasm-util@6.1.2-6(transitive)
Updated@polkadot/wasm-util@6.1.2-7