pshenmic-dpp 1.1.0-dev.7 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
1
  import * as DPP from './pshenmic_dpp.js';
2
2
 
3
- export * from './pshenmic_dpp.js'
3
+ export * from './pshenmic_dpp.js';
4
4
 
5
- export * from './base122.js'
5
+ export * from './base122.js';
6
6
 
7
- export default dpp;
8
7
 
9
8
  declare const dpp: DashPlatformProtocolWASM;
9
+ export default dpp;
10
10
 
11
11
  export class DashPlatformProtocolWASM {
12
12
  // CLASSES
@@ -1,5 +1,5 @@
1
1
  import * as DPP from './pshenmic_dpp.js'
2
- import wasmBytes from './pshenmic_dpp_bg.js'
2
+ import { bytes as wasmBytes } from './pshenmic_dpp_bg.js'
3
3
  import { decode } from './base122.js'
4
4
  import { decompressSync } from 'fflate'
5
5
 
@@ -1,6 +1,4 @@
1
1
  import type {DashPlatformProtocolWASM} from "./index.d.ts";
2
2
 
3
- declare function initModule(): Promise<DashPlatformProtocolWASM>
4
-
5
- export default initModule;
6
- export type { DashPlatformProtocolWASM } from './index.d.ts';
3
+ export type { DashPlatformProtocolWASM } from './index.d.ts';
4
+ export function initModule(): Promise<DashPlatformProtocolWASM>
@@ -1,5 +1,5 @@
1
- import initWASM from './initWASM.js'
2
- import initWASMInterface from './initInterface.js'
1
+ import {initWASM} from './initWASM.js'
2
+ import {initInterface} from './initInterface.js'
3
3
 
4
4
  // eslint-disable-next-line
5
5
  let dpp
@@ -8,13 +8,13 @@ let dpp
8
8
  * Asynchronously initialization for compressed module (reduced size)
9
9
  * @returns {Promise<*>}
10
10
  */
11
- async function initModule () {
11
+ async function initModule() {
12
12
  const wasm = await initWASM()
13
- const wasmInterface = await initWASMInterface()
13
+ const wasmInterface = await initInterface()
14
14
 
15
15
  dpp = wasmInterface.initSync(wasm)
16
16
 
17
17
  return wasmInterface
18
18
  }
19
19
 
20
- export default initModule
20
+ export {initModule}
@@ -1,5 +1,3 @@
1
1
  import type {DashPlatformProtocolWASM} from "./index.d.ts";
2
2
 
3
- declare function initModule(): Promise<DashPlatformProtocolWASM>
4
-
5
- export default initModule;
3
+ export function initInterface(): Promise<DashPlatformProtocolWASM>
@@ -1,4 +1,4 @@
1
- import wasmInterfaceBytes from './pshenmic_dpp_zipped.js'
1
+ import {bytes as wasmInterfaceBytes} from './pshenmic_dpp_zipped.js'
2
2
  import { decode } from './base122.js'
3
3
 
4
4
  export * from './base122.js'
@@ -23,7 +23,8 @@ async function initInterface () {
23
23
 
24
24
  const context = vm.createContext({
25
25
  crypto,
26
- TextDecoder
26
+ TextDecoder,
27
+ TextEncoder
27
28
  })
28
29
  const vmModule = new vm.Script(moduleText)
29
30
 
@@ -42,4 +43,4 @@ async function initInterface () {
42
43
  return module
43
44
  }
44
45
 
45
- export default initInterface
46
+ export { initInterface }
@@ -1,2 +1 @@
1
- declare function _default(): Promise<ArrayBuffer>;
2
- export default _default;
1
+ export function initWASM(): Promise<ArrayBuffer>;
@@ -1,5 +1,5 @@
1
- import wasmBytes from './pshenmic_dpp_bg.js'
2
- import { decode } from './base122.js'
1
+ import {bytes as wasmBytes} from './pshenmic_dpp_bg.js'
2
+ import {decode} from './base122.js'
3
3
 
4
4
  export * from './base122.js'
5
5
 
@@ -16,7 +16,7 @@ const interfaceBlob = new Blob([interfaceBytes])
16
16
  * Convert wasm bin string to Uint8Array with decompression via DecompressionStream
17
17
  * @returns {Promise<ArrayBuffer>}
18
18
  */
19
- async function initWASM () {
19
+ async function initWASM() {
20
20
  const decompressionStream = new DecompressionStream('gzip')
21
21
  const decompressedStream = interfaceBlob.stream().pipeThrough(decompressionStream)
22
22
  const decompressedResponse = new Response(decompressedStream)
@@ -25,4 +25,4 @@ async function initWASM () {
25
25
  return module
26
26
  }
27
27
 
28
- export default initWASM
28
+ export {initWASM}