JSPM

@lit-protocol/bls-sdk

2.1.98
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 16107
  • Score
    100M100P100Q145292F
  • License MIT

Package Exports

  • @lit-protocol/bls-sdk
  • @lit-protocol/bls-sdk/src/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@lit-protocol/bls-sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Installation

yarn add @lit-protocol/bls-sdk

Usage

import { initWasmBlsSdk } from '@lit-protocol/bls-sdk';

initWasmBlsSdk().then((exports) => {
  globalThis.wasmExports = exports;
  log(
    `✅ [BLS SDK] wasmExports loaded. ${
      Object.keys(exports).length
    } functions available. Run 'wasmExports' in the console to see them.`
  );
});

Then

// set decryption shares bytes in wasm
decryptionShares.forEach((s: any, idx: any) => {

    wasmExports.set_share_indexes(idx, s.shareIndex);

    const shareAsBytes = uint8arrayFromString(s.decryptionShare, 'base16');

    for (let i = 0; i < shareAsBytes.length; i++) {
        wasmExports.set_decryption_shares_byte(i, idx, shareAsBytes[i]);
    }
});