index.js:
const { gg18 } = require("@ieigen/tss-wasm-node");
async function main() {
const t = 1;
const n = 3;
context = await gg18.gg18_keygen_client_new_context(
"http://127.0.0.1:8000",
t,
n
);
console.log("keygen new context: ", context);
context = await gg18.gg18_keygen_client_round1(context);
console.log("keygen round1: ", context);
context = await gg18.gg18_keygen_client_round2(context);
console.log("keygen round2: ", context);
context = await gg18.gg18_keygen_client_round3(context);
console.log("keygen round3: ", context);
context = await gg18.gg18_keygen_client_round4(context);
console.log("keygen round4: ", context);
const keygen_json = await gg18.gg18_keygen_client_round5(context);
console.log("keygen json: ", keygen_json);
res.json(util.Succ(keygen_json));
}
main().then(() => {
console.log("done")
})
run: node index.js
error:
post resp Err(reqwest::Error { kind: Builder, source: "JsValue(ReferenceError: Headers is not defined\nReferenceError: Headers is not defined\n at /Users/Project/dev/tss-wasm/pkg/tss_wasm.js:549:17\n at handleError (/Users/Project/dev/tss-wasm/pkg/tss_wasm.js:438:18)\n at module.exports.__wbg_new_4cba26249c1686cd (/Users/Project/dev/tss-wasm/pkg/tss_wasm.js:548:65)\n at wasm://wasm/008f18ba:wasm-function[1139]:0xf66ee\n at wasm://wasm/008f18ba:wasm-function[100]:0x5c0d0\n at wasm://wasm/008f18ba:wasm-function[177]:0x8e261\n at wasm://wasm/008f18ba:wasm-function[276]:0xae7df\n at wasm://wasm/008f18ba:wasm-function[822]:0xebae7\n at wasm://wasm/008f18ba:wasm-function[601]:0xdbb8a\n at wasm://wasm/008f18ba:wasm-function[1258]:0xf7cef)" })