@polkadot-api/smoldot 0.3.3 → 0.3.5
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.
- package/dist/from-node-worker/esm/from-node-worker.mjs.map +1 -1
- package/dist/from-node-worker/from-node-worker.js.map +1 -1
- package/dist/from-worker/esm/from-worker.mjs.map +1 -1
- package/dist/from-worker/from-worker.js.map +1 -1
- package/dist/node-worker/esm/node-worker.mjs.map +1 -1
- package/dist/node-worker/node-worker.js.map +1 -1
- package/dist/worker/esm/worker.mjs.map +1 -1
- package/dist/worker/worker.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"from-node-worker.mjs","sources":["../../../src/from-node-worker.ts"],"sourcesContent":["import { Worker } from \"node:worker_threads\"\nimport type { Chain, Client } from \"smoldot\"\nimport type { RequestMessage, SmoldotOptions } from \"./node-worker\"\n\nconst chainIds = new WeakMap<Chain, number>()\nexport const startFromWorker = (\n worker: Worker,\n options: SmoldotOptions = {},\n): Client => {\n worker.setMaxListeners(0)\n sendToWorker(worker, {\n type: \"start\",\n value: options,\n })\n\n return {\n async addChain(options) {\n const { potentialRelayChains, ...addChainOptions } = options\n const id = await sendToWorker(worker, {\n type: \"add-chain\",\n value: {\n ...addChainOptions,\n potentialRelayChainIds: potentialRelayChains?.map((chain) => {\n const id = chainIds.get(chain)\n if (id == null) {\n throw new Error(\"Only chains created with `addChain` can be used\")\n }\n return id\n }),\n },\n })\n\n const chain: Chain = {\n jsonRpcResponses: {\n next: async () =>\n sendToWorker(worker, {\n type: \"chain\",\n value: {\n id,\n type: \"receiveIterable\",\n },\n }),\n [Symbol.asyncIterator]() {\n return this\n },\n },\n nextJsonRpcResponse() {\n return sendToWorker(worker, {\n type: \"chain\",\n value: {\n id,\n type: \"receive\",\n },\n })\n },\n remove() {\n return sendToWorker(worker, {\n type: \"chain\",\n value: {\n id,\n type: \"remove\",\n },\n })\n },\n sendJsonRpc(value) {\n return sendToWorker(worker, {\n type: \"chain\",\n value: {\n id,\n type: \"send\",\n value,\n },\n })\n },\n }\n chainIds.set(chain, id)\n\n return chain\n },\n async terminate() {\n await sendToWorker(worker, {\n type: \"terminate\",\n })\n },\n }\n}\n\nlet msgId = 0\nfunction sendToWorker(worker: Worker, msg: RequestMessage): Promise<any> {\n const id = msgId++\n worker.postMessage({ ...msg, id })\n return new Promise((resolve) => {\n const msgHandler = (response: any) => {\n if (response.id === id) {\n resolve(response.value)\n worker.off(\"message\", msgHandler)\n }\n }\n worker.on(\"message\", msgHandler)\n })\n}\n"],"names":["options","chain","id"],"mappings":"AAIA,MAAM,QAAA,uBAAe,OAAuB,EAAA
|
|
1
|
+
{"version":3,"file":"from-node-worker.mjs","sources":["../../../src/from-node-worker.ts"],"sourcesContent":["import { Worker } from \"node:worker_threads\"\nimport type { Chain, Client } from \"smoldot\"\nimport type { RequestMessage, SmoldotOptions } from \"./node-worker\"\n\nconst chainIds = new WeakMap<Chain, number>()\nexport const startFromWorker = (\n worker: Worker,\n options: SmoldotOptions = {},\n): Client => {\n worker.setMaxListeners(0)\n sendToWorker(worker, {\n type: \"start\",\n value: options,\n })\n\n return {\n async addChain(options) {\n const { potentialRelayChains, ...addChainOptions } = options\n const id = await sendToWorker(worker, {\n type: \"add-chain\",\n value: {\n ...addChainOptions,\n potentialRelayChainIds: potentialRelayChains?.map((chain) => {\n const id = chainIds.get(chain)\n if (id == null) {\n throw new Error(\"Only chains created with `addChain` can be used\")\n }\n return id\n }),\n },\n })\n\n const chain: Chain = {\n jsonRpcResponses: {\n next: async () =>\n sendToWorker(worker, {\n type: \"chain\",\n value: {\n id,\n type: \"receiveIterable\",\n },\n }),\n [Symbol.asyncIterator]() {\n return this\n },\n },\n nextJsonRpcResponse() {\n return sendToWorker(worker, {\n type: \"chain\",\n value: {\n id,\n type: \"receive\",\n },\n })\n },\n remove() {\n return sendToWorker(worker, {\n type: \"chain\",\n value: {\n id,\n type: \"remove\",\n },\n })\n },\n sendJsonRpc(value) {\n return sendToWorker(worker, {\n type: \"chain\",\n value: {\n id,\n type: \"send\",\n value,\n },\n })\n },\n }\n chainIds.set(chain, id)\n\n return chain\n },\n async terminate() {\n await sendToWorker(worker, {\n type: \"terminate\",\n })\n },\n }\n}\n\nlet msgId = 0\nfunction sendToWorker(worker: Worker, msg: RequestMessage): Promise<any> {\n const id = msgId++\n worker.postMessage({ ...msg, id })\n return new Promise((resolve) => {\n const msgHandler = (response: any) => {\n if (response.id === id) {\n resolve(response.value)\n worker.off(\"message\", msgHandler)\n }\n }\n worker.on(\"message\", msgHandler)\n })\n}\n"],"names":["options","chain","id"],"mappings":"AAIA,MAAM,QAAA,uBAAe,OAAuB,EAAA;AACrC,MAAM,eAAkB,GAAA,CAC7B,MACA,EAAA,OAAA,GAA0B,EACf,KAAA;AACX,EAAA,MAAA,CAAO,gBAAgB,CAAC,CAAA;AACxB,EAAA,YAAA,CAAa,MAAQ,EAAA;AAAA,IACnB,IAAM,EAAA,OAAA;AAAA,IACN,KAAO,EAAA;AAAA,GACR,CAAA;AAED,EAAO,OAAA;AAAA,IACL,MAAM,SAASA,QAAS,EAAA;AACtB,MAAA,MAAM,EAAE,oBAAA,EAAsB,GAAG,eAAA,EAAoBA,GAAAA,QAAAA;AACrD,MAAM,MAAA,EAAA,GAAK,MAAM,YAAA,CAAa,MAAQ,EAAA;AAAA,QACpC,IAAM,EAAA,WAAA;AAAA,QACN,KAAO,EAAA;AAAA,UACL,GAAG,eAAA;AAAA,UACH,sBAAwB,EAAA,oBAAA,EAAsB,GAAI,CAAA,CAACC,MAAU,KAAA;AAC3D,YAAMC,MAAAA,GAAAA,GAAK,QAAS,CAAA,GAAA,CAAID,MAAK,CAAA;AAC7B,YAAA,IAAIC,OAAM,IAAM,EAAA;AACd,cAAM,MAAA,IAAI,MAAM,iDAAiD,CAAA;AAAA;AAEnE,YAAOA,OAAAA,GAAAA;AAAA,WACR;AAAA;AACH,OACD,CAAA;AAED,MAAA,MAAM,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A,CAAO,WAAY,CAAA,EAAE,GAAG,GAAA,EAAK,IAAI,CAAA;AACjC,EAAO,OAAA,IAAI,OAAQ,CAAA,CAAC,OAAY,KAAA;AAC9B,IAAM,MAAA,UAAA,GAAa,CAAC,QAAkB,KAAA;AACpC,MAAI,IAAA,QAAA,CAAS,OAAO,EAAI,EAAA;AACtB,QAAA,OAAA,CAAQ,SAAS,KAAK,CAAA;AACtB,QAAO,MAAA,CAAA,GAAA,CAAI,WAAW,UAAU,CAAA;AAAA;AAClC,KACF;AACA,IAAO,MAAA,CAAA,EAAA,CAAG,WAAW,UAAU,CAAA;AAAA,GAChC,CAAA;AACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"from-node-worker.js","sources":["../../src/from-node-worker.ts"],"sourcesContent":["import { Worker } from \"node:worker_threads\"\nimport type { Chain, Client } from \"smoldot\"\nimport type { RequestMessage, SmoldotOptions } from \"./node-worker\"\n\nconst chainIds = new WeakMap<Chain, number>()\nexport const startFromWorker = (\n worker: Worker,\n options: SmoldotOptions = {},\n): Client => {\n worker.setMaxListeners(0)\n sendToWorker(worker, {\n type: \"start\",\n value: options,\n })\n\n return {\n async addChain(options) {\n const { potentialRelayChains, ...addChainOptions } = options\n const id = await sendToWorker(worker, {\n type: \"add-chain\",\n value: {\n ...addChainOptions,\n potentialRelayChainIds: potentialRelayChains?.map((chain) => {\n const id = chainIds.get(chain)\n if (id == null) {\n throw new Error(\"Only chains created with `addChain` can be used\")\n }\n return id\n }),\n },\n })\n\n const chain: Chain = {\n jsonRpcResponses: {\n next: async () =>\n sendToWorker(worker, {\n type: \"chain\",\n value: {\n id,\n type: \"receiveIterable\",\n },\n }),\n [Symbol.asyncIterator]() {\n return this\n },\n },\n nextJsonRpcResponse() {\n return sendToWorker(worker, {\n type: \"chain\",\n value: {\n id,\n type: \"receive\",\n },\n })\n },\n remove() {\n return sendToWorker(worker, {\n type: \"chain\",\n value: {\n id,\n type: \"remove\",\n },\n })\n },\n sendJsonRpc(value) {\n return sendToWorker(worker, {\n type: \"chain\",\n value: {\n id,\n type: \"send\",\n value,\n },\n })\n },\n }\n chainIds.set(chain, id)\n\n return chain\n },\n async terminate() {\n await sendToWorker(worker, {\n type: \"terminate\",\n })\n },\n }\n}\n\nlet msgId = 0\nfunction sendToWorker(worker: Worker, msg: RequestMessage): Promise<any> {\n const id = msgId++\n worker.postMessage({ ...msg, id })\n return new Promise((resolve) => {\n const msgHandler = (response: any) => {\n if (response.id === id) {\n resolve(response.value)\n worker.off(\"message\", msgHandler)\n }\n }\n worker.on(\"message\", msgHandler)\n })\n}\n"],"names":["options","chain","id"],"mappings":";;AAIA,MAAM,QAAA,uBAAe,OAAuB,EAAA
|
|
1
|
+
{"version":3,"file":"from-node-worker.js","sources":["../../src/from-node-worker.ts"],"sourcesContent":["import { Worker } from \"node:worker_threads\"\nimport type { Chain, Client } from \"smoldot\"\nimport type { RequestMessage, SmoldotOptions } from \"./node-worker\"\n\nconst chainIds = new WeakMap<Chain, number>()\nexport const startFromWorker = (\n worker: Worker,\n options: SmoldotOptions = {},\n): Client => {\n worker.setMaxListeners(0)\n sendToWorker(worker, {\n type: \"start\",\n value: options,\n })\n\n return {\n async addChain(options) {\n const { potentialRelayChains, ...addChainOptions } = options\n const id = await sendToWorker(worker, {\n type: \"add-chain\",\n value: {\n ...addChainOptions,\n potentialRelayChainIds: potentialRelayChains?.map((chain) => {\n const id = chainIds.get(chain)\n if (id == null) {\n throw new Error(\"Only chains created with `addChain` can be used\")\n }\n return id\n }),\n },\n })\n\n const chain: Chain = {\n jsonRpcResponses: {\n next: async () =>\n sendToWorker(worker, {\n type: \"chain\",\n value: {\n id,\n type: \"receiveIterable\",\n },\n }),\n [Symbol.asyncIterator]() {\n return this\n },\n },\n nextJsonRpcResponse() {\n return sendToWorker(worker, {\n type: \"chain\",\n value: {\n id,\n type: \"receive\",\n },\n })\n },\n remove() {\n return sendToWorker(worker, {\n type: \"chain\",\n value: {\n id,\n type: \"remove\",\n },\n })\n },\n sendJsonRpc(value) {\n return sendToWorker(worker, {\n type: \"chain\",\n value: {\n id,\n type: \"send\",\n value,\n },\n })\n },\n }\n chainIds.set(chain, id)\n\n return chain\n },\n async terminate() {\n await sendToWorker(worker, {\n type: \"terminate\",\n })\n },\n }\n}\n\nlet msgId = 0\nfunction sendToWorker(worker: Worker, msg: RequestMessage): Promise<any> {\n const id = msgId++\n worker.postMessage({ ...msg, id })\n return new Promise((resolve) => {\n const msgHandler = (response: any) => {\n if (response.id === id) {\n resolve(response.value)\n worker.off(\"message\", msgHandler)\n }\n }\n worker.on(\"message\", msgHandler)\n })\n}\n"],"names":["options","chain","id"],"mappings":";;AAIA,MAAM,QAAA,uBAAe,OAAuB,EAAA;AACrC,MAAM,eAAkB,GAAA,CAC7B,MACA,EAAA,OAAA,GAA0B,EACf,KAAA;AACX,EAAA,MAAA,CAAO,gBAAgB,CAAC,CAAA;AACxB,EAAA,YAAA,CAAa,MAAQ,EAAA;AAAA,IACnB,IAAM,EAAA,OAAA;AAAA,IACN,KAAO,EAAA;AAAA,GACR,CAAA;AAED,EAAO,OAAA;AAAA,IACL,MAAM,SAASA,QAAS,EAAA;AACtB,MAAA,MAAM,EAAE,oBAAA,EAAsB,GAAG,eAAA,EAAoBA,GAAAA,QAAAA;AACrD,MAAM,MAAA,EAAA,GAAK,MAAM,YAAA,CAAa,MAAQ,EAAA;AAAA,QACpC,IAAM,EAAA,WAAA;AAAA,QACN,KAAO,EAAA;AAAA,UACL,GAAG,eAAA;AAAA,UACH,sBAAwB,EAAA,oBAAA,EAAsB,GAAI,CAAA,CAACC,MAAU,KAAA;AAC3D,YAAMC,MAAAA,GAAAA,GAAK,QAAS,CAAA,GAAA,CAAID,MAAK,CAAA;AAC7B,YAAA,IAAIC,OAAM,IAAM,EAAA;AACd,cAAM,MAAA,IAAI,MAAM,iDAAiD,CAAA;AAAA;AAEnE,YAAOA,OAAAA,GAAAA;AAAA,WACR;AAAA;AACH,OACD,CAAA;AAED,M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,EAAA,MAAA,CAAO,WAAY,CAAA,EAAE,GAAG,GAAA,EAAK,IAAI,CAAA;AACjC,EAAO,OAAA,IAAI,OAAQ,CAAA,CAAC,OAAY,KAAA;AAC9B,IAAM,MAAA,UAAA,GAAa,CAAC,QAAkB,KAAA;AACpC,MAAI,IAAA,QAAA,CAAS,OAAO,EAAI,EAAA;AACtB,QAAA,OAAA,CAAQ,SAAS,KAAK,CAAA;AACtB,QAAO,MAAA,CAAA,GAAA,CAAI,WAAW,UAAU,CAAA;AAAA;AAClC,KACF;AACA,IAAO,MAAA,CAAA,EAAA,CAAG,WAAW,UAAU,CAAA;AAAA,GAChC,CAAA;AACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"from-worker.mjs","sources":["../../../src/from-worker.ts"],"sourcesContent":["import type { Client } from \"smoldot\"\nimport {\n type SmoldotBytecode,\n type ClientOptionsWithBytecode,\n startWithBytecode,\n} from \"smoldot/no-auto-bytecode\"\n\nexport type SmoldotOptions = Omit<\n ClientOptionsWithBytecode,\n \"bytecode\" | \"portToWorker\"\n>\n\nexport const startFromWorker = (\n worker: Worker,\n options: SmoldotOptions = {},\n): Client => {\n const bytecode = new Promise<SmoldotBytecode>((resolve) => {\n worker.onmessage = (event) => resolve(event.data)\n })\n\n const { port1, port2 } = new MessageChannel()\n worker.postMessage(port1, [port1])\n\n return startWithBytecode({\n bytecode,\n portToWorker: port2,\n ...options,\n })\n}\n"],"names":[],"mappings":";;AAYO,MAAM,eAAkB,GAAA,CAC7B,MACA,EAAA,OAAA,GAA0B,EACf,KAAA;AACX,EAAA,MAAM,QAAW,GAAA,IAAI,OAAyB,CAAA,CAAC,OAAY,KAAA;AACzD,IAAA,MAAA,CAAO,SAAY,GAAA,CAAC,KAAU,KAAA,OAAA,CAAQ,MAAM,IAAI,CAAA
|
|
1
|
+
{"version":3,"file":"from-worker.mjs","sources":["../../../src/from-worker.ts"],"sourcesContent":["import type { Client } from \"smoldot\"\nimport {\n type SmoldotBytecode,\n type ClientOptionsWithBytecode,\n startWithBytecode,\n} from \"smoldot/no-auto-bytecode\"\n\nexport type SmoldotOptions = Omit<\n ClientOptionsWithBytecode,\n \"bytecode\" | \"portToWorker\"\n>\n\nexport const startFromWorker = (\n worker: Worker,\n options: SmoldotOptions = {},\n): Client => {\n const bytecode = new Promise<SmoldotBytecode>((resolve) => {\n worker.onmessage = (event) => resolve(event.data)\n })\n\n const { port1, port2 } = new MessageChannel()\n worker.postMessage(port1, [port1])\n\n return startWithBytecode({\n bytecode,\n portToWorker: port2,\n ...options,\n })\n}\n"],"names":[],"mappings":";;AAYO,MAAM,eAAkB,GAAA,CAC7B,MACA,EAAA,OAAA,GAA0B,EACf,KAAA;AACX,EAAA,MAAM,QAAW,GAAA,IAAI,OAAyB,CAAA,CAAC,OAAY,KAAA;AACzD,IAAA,MAAA,CAAO,SAAY,GAAA,CAAC,KAAU,KAAA,OAAA,CAAQ,MAAM,IAAI,CAAA;AAAA,GACjD,CAAA;AAED,EAAA,MAAM,EAAE,KAAA,EAAO,KAAM,EAAA,GAAI,IAAI,cAAe,EAAA;AAC5C,EAAA,MAAA,CAAO,WAAY,CAAA,KAAA,EAAO,CAAC,KAAK,CAAC,CAAA;AAEjC,EAAA,OAAO,iBAAkB,CAAA;AAAA,IACvB,QAAA;AAAA,IACA,YAAc,EAAA,KAAA;AAAA,IACd,GAAG;AAAA,GACJ,CAAA;AACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"from-worker.js","sources":["../../src/from-worker.ts"],"sourcesContent":["import type { Client } from \"smoldot\"\nimport {\n type SmoldotBytecode,\n type ClientOptionsWithBytecode,\n startWithBytecode,\n} from \"smoldot/no-auto-bytecode\"\n\nexport type SmoldotOptions = Omit<\n ClientOptionsWithBytecode,\n \"bytecode\" | \"portToWorker\"\n>\n\nexport const startFromWorker = (\n worker: Worker,\n options: SmoldotOptions = {},\n): Client => {\n const bytecode = new Promise<SmoldotBytecode>((resolve) => {\n worker.onmessage = (event) => resolve(event.data)\n })\n\n const { port1, port2 } = new MessageChannel()\n worker.postMessage(port1, [port1])\n\n return startWithBytecode({\n bytecode,\n portToWorker: port2,\n ...options,\n })\n}\n"],"names":["startWithBytecode"],"mappings":";;;;AAYO,MAAM,eAAkB,GAAA,CAC7B,MACA,EAAA,OAAA,GAA0B,EACf,KAAA;AACX,EAAA,MAAM,QAAW,GAAA,IAAI,OAAyB,CAAA,CAAC,OAAY,KAAA;AACzD,IAAA,MAAA,CAAO,SAAY,GAAA,CAAC,KAAU,KAAA,OAAA,CAAQ,MAAM,IAAI,CAAA
|
|
1
|
+
{"version":3,"file":"from-worker.js","sources":["../../src/from-worker.ts"],"sourcesContent":["import type { Client } from \"smoldot\"\nimport {\n type SmoldotBytecode,\n type ClientOptionsWithBytecode,\n startWithBytecode,\n} from \"smoldot/no-auto-bytecode\"\n\nexport type SmoldotOptions = Omit<\n ClientOptionsWithBytecode,\n \"bytecode\" | \"portToWorker\"\n>\n\nexport const startFromWorker = (\n worker: Worker,\n options: SmoldotOptions = {},\n): Client => {\n const bytecode = new Promise<SmoldotBytecode>((resolve) => {\n worker.onmessage = (event) => resolve(event.data)\n })\n\n const { port1, port2 } = new MessageChannel()\n worker.postMessage(port1, [port1])\n\n return startWithBytecode({\n bytecode,\n portToWorker: port2,\n ...options,\n })\n}\n"],"names":["startWithBytecode"],"mappings":";;;;AAYO,MAAM,eAAkB,GAAA,CAC7B,MACA,EAAA,OAAA,GAA0B,EACf,KAAA;AACX,EAAA,MAAM,QAAW,GAAA,IAAI,OAAyB,CAAA,CAAC,OAAY,KAAA;AACzD,IAAA,MAAA,CAAO,SAAY,GAAA,CAAC,KAAU,KAAA,OAAA,CAAQ,MAAM,IAAI,CAAA;AAAA,GACjD,CAAA;AAED,EAAA,MAAM,EAAE,KAAA,EAAO,KAAM,EAAA,GAAI,IAAI,cAAe,EAAA;AAC5C,EAAA,MAAA,CAAO,WAAY,CAAA,KAAA,EAAO,CAAC,KAAK,CAAC,CAAA;AAEjC,EAAA,OAAOA,gCAAkB,CAAA;AAAA,IACvB,QAAA;AAAA,IACA,YAAc,EAAA,KAAA;AAAA,IACd,GAAG;AAAA,GACJ,CAAA;AACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-worker.mjs","sources":["../../../src/node-worker.ts"],"sourcesContent":["import { parentPort } from \"node:worker_threads\"\nimport { AddChainOptions, Chain, Client, ClientOptions, start } from \"smoldot\"\n\nexport type SmoldotOptions = Omit<ClientOptions, \"portToWorker\">\nexport interface StartMsg {\n type: \"start\"\n value: SmoldotOptions\n}\nexport interface AddChainMsg {\n type: \"add-chain\"\n value: Omit<AddChainOptions, \"potentialRelayChains\"> & {\n potentialRelayChainIds?: number[]\n }\n}\nexport interface TerminateMsg {\n type: \"terminate\"\n}\nexport interface ChainMsg {\n type: \"chain\"\n value: {\n id: number\n } & (\n | {\n type: \"remove\" | \"receive\" | \"receiveIterable\"\n }\n | {\n type: \"send\"\n value: string\n }\n )\n}\nexport type RequestMessage = StartMsg | AddChainMsg | TerminateMsg | ChainMsg\nexport type CorrelatedRequestMessage = { id: number } & RequestMessage\n\nlet smoldot: Client | null = null\n\nlet chainId = 0\nconst chains = new Map<number, Chain>()\n\nparentPort!.on(\"message\", async (msg: CorrelatedRequestMessage) => {\n if (msg.type === \"start\") {\n if (smoldot !== null) {\n throw new Error(\"Can't call start on a client already started\")\n }\n smoldot = start(msg.value)\n return parentPort?.postMessage({\n id: msg.id,\n })\n }\n\n if (smoldot === null) {\n throw new Error(\"Smoldot not started\")\n }\n\n switch (msg.type) {\n case \"add-chain\": {\n const potentialRelayChains = msg.value.potentialRelayChainIds?.map(\n (id) => {\n const chain = chains.get(id)\n if (!chain) throw new Error(\"Can't reference removed chain\")\n return chain\n },\n )\n const chain = await smoldot.addChain({\n ...msg.value,\n potentialRelayChains,\n })\n const id = chainId++\n chains.set(id, chain)\n parentPort?.postMessage({\n id: msg.id,\n value: id,\n })\n break\n }\n case \"terminate\":\n await smoldot.terminate()\n parentPort?.postMessage({\n id: msg.id,\n })\n smoldot = null\n chains.clear()\n break\n case \"chain\":\n handleChainMessage(msg, msg.id)\n break\n }\n})\n\nasync function handleChainMessage(msg: ChainMsg, id: number) {\n const chain = chains.get(msg.value.id)\n if (!chain) throw new Error(\"Can't reference removed chain\")\n\n switch (msg.value.type) {\n case \"receive\":\n parentPort?.postMessage({\n id,\n value: await chain.nextJsonRpcResponse(),\n })\n break\n case \"receiveIterable\":\n parentPort?.postMessage({\n id,\n value: await chain.jsonRpcResponses.next(),\n })\n break\n case \"send\":\n chain.sendJsonRpc(msg.value.value)\n break\n case \"remove\":\n chain.remove()\n chains.delete(msg.value.id)\n break\n }\n}\n"],"names":["id","chain"],"mappings":";;;AAkCA,IAAI,OAAyB,GAAA,IAAA
|
|
1
|
+
{"version":3,"file":"node-worker.mjs","sources":["../../../src/node-worker.ts"],"sourcesContent":["import { parentPort } from \"node:worker_threads\"\nimport { AddChainOptions, Chain, Client, ClientOptions, start } from \"smoldot\"\n\nexport type SmoldotOptions = Omit<ClientOptions, \"portToWorker\">\nexport interface StartMsg {\n type: \"start\"\n value: SmoldotOptions\n}\nexport interface AddChainMsg {\n type: \"add-chain\"\n value: Omit<AddChainOptions, \"potentialRelayChains\"> & {\n potentialRelayChainIds?: number[]\n }\n}\nexport interface TerminateMsg {\n type: \"terminate\"\n}\nexport interface ChainMsg {\n type: \"chain\"\n value: {\n id: number\n } & (\n | {\n type: \"remove\" | \"receive\" | \"receiveIterable\"\n }\n | {\n type: \"send\"\n value: string\n }\n )\n}\nexport type RequestMessage = StartMsg | AddChainMsg | TerminateMsg | ChainMsg\nexport type CorrelatedRequestMessage = { id: number } & RequestMessage\n\nlet smoldot: Client | null = null\n\nlet chainId = 0\nconst chains = new Map<number, Chain>()\n\nparentPort!.on(\"message\", async (msg: CorrelatedRequestMessage) => {\n if (msg.type === \"start\") {\n if (smoldot !== null) {\n throw new Error(\"Can't call start on a client already started\")\n }\n smoldot = start(msg.value)\n return parentPort?.postMessage({\n id: msg.id,\n })\n }\n\n if (smoldot === null) {\n throw new Error(\"Smoldot not started\")\n }\n\n switch (msg.type) {\n case \"add-chain\": {\n const potentialRelayChains = msg.value.potentialRelayChainIds?.map(\n (id) => {\n const chain = chains.get(id)\n if (!chain) throw new Error(\"Can't reference removed chain\")\n return chain\n },\n )\n const chain = await smoldot.addChain({\n ...msg.value,\n potentialRelayChains,\n })\n const id = chainId++\n chains.set(id, chain)\n parentPort?.postMessage({\n id: msg.id,\n value: id,\n })\n break\n }\n case \"terminate\":\n await smoldot.terminate()\n parentPort?.postMessage({\n id: msg.id,\n })\n smoldot = null\n chains.clear()\n break\n case \"chain\":\n handleChainMessage(msg, msg.id)\n break\n }\n})\n\nasync function handleChainMessage(msg: ChainMsg, id: number) {\n const chain = chains.get(msg.value.id)\n if (!chain) throw new Error(\"Can't reference removed chain\")\n\n switch (msg.value.type) {\n case \"receive\":\n parentPort?.postMessage({\n id,\n value: await chain.nextJsonRpcResponse(),\n })\n break\n case \"receiveIterable\":\n parentPort?.postMessage({\n id,\n value: await chain.jsonRpcResponses.next(),\n })\n break\n case \"send\":\n chain.sendJsonRpc(msg.value.value)\n break\n case \"remove\":\n chain.remove()\n chains.delete(msg.value.id)\n break\n }\n}\n"],"names":["id","chain"],"mappings":";;;AAkCA,IAAI,OAAyB,GAAA,IAAA;AAE7B,IAAI,OAAU,GAAA,CAAA;AACd,MAAM,MAAA,uBAAa,GAAmB,EAAA;AAEtC,UAAY,CAAA,EAAA,CAAG,SAAW,EAAA,OAAO,GAAkC,KAAA;AACjE,EAAI,IAAA,GAAA,CAAI,SAAS,OAAS,EAAA;AACxB,IAAA,IAAI,YAAY,IAAM,EAAA;AACpB,MAAM,MAAA,IAAI,MAAM,8CAA8C,CAAA;AAAA;AAEhE,IAAU,OAAA,GAAA,KAAA,CAAM,IAAI,KAAK,CAAA;AACzB,IAAA,OAAO,YAAY,WAAY,CAAA;AAAA,MAC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Q,GAAA,MAAA,CAAO,GAAI,CAAA,GAAA,CAAI,MAAM,EAAE,CAAA;AACrC,EAAA,IAAI,CAAC,KAAA,EAAa,MAAA,IAAI,MAAM,+BAA+B,CAAA;AAE3D,EAAQ,QAAA,GAAA,CAAI,MAAM,IAAM;AAAA,IACtB,KAAK,SAAA;AACH,MAAA,UAAA,EAAY,WAAY,CAAA;AAAA,QACtB,EAAA;AAAA,QACA,KAAA,EAAO,MAAM,KAAA,CAAM,mBAAoB;AAAA,OACxC,CAAA;AACD,MAAA;AAAA,IACF,KAAK,iBAAA;AACH,MAAA,UAAA,EAAY,WAAY,CAAA;AAAA,QACtB,EAAA;AAAA,QACA,KAAO,EAAA,MAAM,KAAM,CAAA,gBAAA,CAAiB,IAAK;AAAA,OAC1C,CAAA;AACD,MAAA;AAAA,IACF,KAAK,MAAA;AACH,MAAM,KAAA,CAAA,WAAA,CAAY,GAAI,CAAA,KAAA,CAAM,KAAK,CAAA;AACjC,MAAA;AAAA,IACF,KAAK,QAAA;AACH,MAAA,KAAA,CAAM,MAAO,EAAA;AACb,MAAO,MAAA,CAAA,MAAA,CAAO,GAAI,CAAA,KAAA,CAAM,EAAE,CAAA;AAC1B,MAAA;AAAA;AAEN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-worker.js","sources":["../../src/node-worker.ts"],"sourcesContent":["import { parentPort } from \"node:worker_threads\"\nimport { AddChainOptions, Chain, Client, ClientOptions, start } from \"smoldot\"\n\nexport type SmoldotOptions = Omit<ClientOptions, \"portToWorker\">\nexport interface StartMsg {\n type: \"start\"\n value: SmoldotOptions\n}\nexport interface AddChainMsg {\n type: \"add-chain\"\n value: Omit<AddChainOptions, \"potentialRelayChains\"> & {\n potentialRelayChainIds?: number[]\n }\n}\nexport interface TerminateMsg {\n type: \"terminate\"\n}\nexport interface ChainMsg {\n type: \"chain\"\n value: {\n id: number\n } & (\n | {\n type: \"remove\" | \"receive\" | \"receiveIterable\"\n }\n | {\n type: \"send\"\n value: string\n }\n )\n}\nexport type RequestMessage = StartMsg | AddChainMsg | TerminateMsg | ChainMsg\nexport type CorrelatedRequestMessage = { id: number } & RequestMessage\n\nlet smoldot: Client | null = null\n\nlet chainId = 0\nconst chains = new Map<number, Chain>()\n\nparentPort!.on(\"message\", async (msg: CorrelatedRequestMessage) => {\n if (msg.type === \"start\") {\n if (smoldot !== null) {\n throw new Error(\"Can't call start on a client already started\")\n }\n smoldot = start(msg.value)\n return parentPort?.postMessage({\n id: msg.id,\n })\n }\n\n if (smoldot === null) {\n throw new Error(\"Smoldot not started\")\n }\n\n switch (msg.type) {\n case \"add-chain\": {\n const potentialRelayChains = msg.value.potentialRelayChainIds?.map(\n (id) => {\n const chain = chains.get(id)\n if (!chain) throw new Error(\"Can't reference removed chain\")\n return chain\n },\n )\n const chain = await smoldot.addChain({\n ...msg.value,\n potentialRelayChains,\n })\n const id = chainId++\n chains.set(id, chain)\n parentPort?.postMessage({\n id: msg.id,\n value: id,\n })\n break\n }\n case \"terminate\":\n await smoldot.terminate()\n parentPort?.postMessage({\n id: msg.id,\n })\n smoldot = null\n chains.clear()\n break\n case \"chain\":\n handleChainMessage(msg, msg.id)\n break\n }\n})\n\nasync function handleChainMessage(msg: ChainMsg, id: number) {\n const chain = chains.get(msg.value.id)\n if (!chain) throw new Error(\"Can't reference removed chain\")\n\n switch (msg.value.type) {\n case \"receive\":\n parentPort?.postMessage({\n id,\n value: await chain.nextJsonRpcResponse(),\n })\n break\n case \"receiveIterable\":\n parentPort?.postMessage({\n id,\n value: await chain.jsonRpcResponses.next(),\n })\n break\n case \"send\":\n chain.sendJsonRpc(msg.value.value)\n break\n case \"remove\":\n chain.remove()\n chains.delete(msg.value.id)\n break\n }\n}\n"],"names":["parentPort","start","id","chain"],"mappings":";;;;;AAkCA,IAAI,OAAyB,GAAA,IAAA
|
|
1
|
+
{"version":3,"file":"node-worker.js","sources":["../../src/node-worker.ts"],"sourcesContent":["import { parentPort } from \"node:worker_threads\"\nimport { AddChainOptions, Chain, Client, ClientOptions, start } from \"smoldot\"\n\nexport type SmoldotOptions = Omit<ClientOptions, \"portToWorker\">\nexport interface StartMsg {\n type: \"start\"\n value: SmoldotOptions\n}\nexport interface AddChainMsg {\n type: \"add-chain\"\n value: Omit<AddChainOptions, \"potentialRelayChains\"> & {\n potentialRelayChainIds?: number[]\n }\n}\nexport interface TerminateMsg {\n type: \"terminate\"\n}\nexport interface ChainMsg {\n type: \"chain\"\n value: {\n id: number\n } & (\n | {\n type: \"remove\" | \"receive\" | \"receiveIterable\"\n }\n | {\n type: \"send\"\n value: string\n }\n )\n}\nexport type RequestMessage = StartMsg | AddChainMsg | TerminateMsg | ChainMsg\nexport type CorrelatedRequestMessage = { id: number } & RequestMessage\n\nlet smoldot: Client | null = null\n\nlet chainId = 0\nconst chains = new Map<number, Chain>()\n\nparentPort!.on(\"message\", async (msg: CorrelatedRequestMessage) => {\n if (msg.type === \"start\") {\n if (smoldot !== null) {\n throw new Error(\"Can't call start on a client already started\")\n }\n smoldot = start(msg.value)\n return parentPort?.postMessage({\n id: msg.id,\n })\n }\n\n if (smoldot === null) {\n throw new Error(\"Smoldot not started\")\n }\n\n switch (msg.type) {\n case \"add-chain\": {\n const potentialRelayChains = msg.value.potentialRelayChainIds?.map(\n (id) => {\n const chain = chains.get(id)\n if (!chain) throw new Error(\"Can't reference removed chain\")\n return chain\n },\n )\n const chain = await smoldot.addChain({\n ...msg.value,\n potentialRelayChains,\n })\n const id = chainId++\n chains.set(id, chain)\n parentPort?.postMessage({\n id: msg.id,\n value: id,\n })\n break\n }\n case \"terminate\":\n await smoldot.terminate()\n parentPort?.postMessage({\n id: msg.id,\n })\n smoldot = null\n chains.clear()\n break\n case \"chain\":\n handleChainMessage(msg, msg.id)\n break\n }\n})\n\nasync function handleChainMessage(msg: ChainMsg, id: number) {\n const chain = chains.get(msg.value.id)\n if (!chain) throw new Error(\"Can't reference removed chain\")\n\n switch (msg.value.type) {\n case \"receive\":\n parentPort?.postMessage({\n id,\n value: await chain.nextJsonRpcResponse(),\n })\n break\n case \"receiveIterable\":\n parentPort?.postMessage({\n id,\n value: await chain.jsonRpcResponses.next(),\n })\n break\n case \"send\":\n chain.sendJsonRpc(msg.value.value)\n break\n case \"remove\":\n chain.remove()\n chains.delete(msg.value.id)\n break\n }\n}\n"],"names":["parentPort","start","id","chain"],"mappings":";;;;;AAkCA,IAAI,OAAyB,GAAA,IAAA;AAE7B,IAAI,OAAU,GAAA,CAAA;AACd,MAAM,MAAA,uBAAa,GAAmB,EAAA;AAEtCA,8BAAY,CAAA,EAAA,CAAG,SAAW,EAAA,OAAO,GAAkC,KAAA;AACjE,EAAI,IAAA,GAAA,CAAI,SAAS,OAAS,EAAA;AACxB,IAAA,IAAI,YAAY,IAAM,EAAA;AACpB,MAAM,MAAA,IAAI,MAAM,8CAA8C,CAAA;AAAA;AAEhE,IAAU,OAAA,GAAAC,eAAA,CAAM,IAAI,KAAK,CAAA;AACzB,IAAA,OAAOD,gCAAY,WAAY,CAAA;AAAA,MAC7B,IAAI,GAAI,CAAA;AAAA,KACT,CAAA;AAAA;AAGH,EAAA,IAAI,YAAY,IAAM,EAAA;AACpB,IAAM,MAAA,IAAI,MAAM,qBAAqB,CAAA;AAAA;AAGvC,EAAA,QAAQ,IAAI,IAAM;AAAA,IAChB,KAAK,WAAa,EAAA;AAChB,MAAM,MAAA,oBAAA,GAAuB,GAAI,CAAA,KAAA,CAAM,sBAAwB,EAAA,GAAA;AAAA,QAC7D,CAACE,GAAO,KAAA;AACN,UAAMC,MAAAA,MAAAA,GAAQ,MAAO,CAAA,GAAA,CAAID,GAAE,CAAA;AAC3B,UAAA,IAAI,CAACC,MAAAA,EAAa,MAAA,IAAI,MAAM,+BAA+B,CAAA;AAC3D,UAAOA,OAAAA,MAAAA;AAAA;AACT,OACF;AACA,MAAM,MAAA,KAAA,GAAQ,MAAM,OAAA,CAAQ,QAAS,CAAA;AAAA,QACnC,GAAG,GAAI,CAAA,KAAA;AAAA,QACP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AK,CAAA;AACjC,MAAA;AAAA,IACF,KAAK,QAAA;AACH,MAAA,KAAA,CAAM,MAAO,EAAA;AACb,MAAO,MAAA,CAAA,MAAA,CAAO,GAAI,CAAA,KAAA,CAAM,EAAE,CAAA;AAC1B,MAAA;AAAA;AAEN;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.mjs","sources":["../../../src/worker.ts"],"sourcesContent":["import * as smoldot from \"smoldot/worker\"\nimport { compileBytecode } from \"smoldot/bytecode\"\n\ncompileBytecode().then((x) => {\n postMessage(x)\n})\nonmessage = (msg) => smoldot.run(msg.data)\n"],"names":[],"mappings":";;;AAGA,eAAgB,EAAA,CAAE,IAAK,CAAA,CAAC,CAAM,KAAA;AAC5B,EAAA,WAAA,CAAY,CAAC,CAAA
|
|
1
|
+
{"version":3,"file":"worker.mjs","sources":["../../../src/worker.ts"],"sourcesContent":["import * as smoldot from \"smoldot/worker\"\nimport { compileBytecode } from \"smoldot/bytecode\"\n\ncompileBytecode().then((x) => {\n postMessage(x)\n})\nonmessage = (msg) => smoldot.run(msg.data)\n"],"names":[],"mappings":";;;AAGA,eAAgB,EAAA,CAAE,IAAK,CAAA,CAAC,CAAM,KAAA;AAC5B,EAAA,WAAA,CAAY,CAAC,CAAA;AACf,CAAC,CAAA;AACD,SAAA,GAAY,CAAC,GAAA,KAAQ,OAAQ,CAAA,GAAA,CAAI,IAAI,IAAI,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.js","sources":["../../src/worker.ts"],"sourcesContent":["import * as smoldot from \"smoldot/worker\"\nimport { compileBytecode } from \"smoldot/bytecode\"\n\ncompileBytecode().then((x) => {\n postMessage(x)\n})\nonmessage = (msg) => smoldot.run(msg.data)\n"],"names":["compileBytecode","smoldot"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAGAA,wBAAgB,EAAA,CAAE,IAAK,CAAA,CAAC,CAAM,KAAA;AAC5B,EAAA,WAAA,CAAY,CAAC,CAAA
|
|
1
|
+
{"version":3,"file":"worker.js","sources":["../../src/worker.ts"],"sourcesContent":["import * as smoldot from \"smoldot/worker\"\nimport { compileBytecode } from \"smoldot/bytecode\"\n\ncompileBytecode().then((x) => {\n postMessage(x)\n})\nonmessage = (msg) => smoldot.run(msg.data)\n"],"names":["compileBytecode","smoldot"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAGAA,wBAAgB,EAAA,CAAE,IAAK,CAAA,CAAC,CAAM,KAAA;AAC5B,EAAA,WAAA,CAAY,CAAC,CAAA;AACf,CAAC,CAAA;AACD,SAAA,GAAY,CAAC,GAAA,KAAQC,kBAAQ,CAAA,GAAA,CAAI,IAAI,IAAI,CAAA;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polkadot-api/smoldot",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"author": "Josep M Sobrepere (https://github.com/josepot)",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
],
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@types/node": "^22.2.0",
|
|
79
|
-
"smoldot": "2.0.
|
|
79
|
+
"smoldot": "2.0.31"
|
|
80
80
|
},
|
|
81
81
|
"scripts": {
|
|
82
82
|
"build-core": "tsc --noEmit && rollup -c",
|