@polkadot-api/wasm-executor
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

@polkadot-api/wasm-executor

This package has been strongly influenced by Chopsticks. Its usage is only recommended and supported in NodeJS environments.

At this point, it just exports a getMetadataFromRuntime function that runs WASM under the hood, and returns its metadata in string.

import { getMetadataFromRuntime } from "@polkadot-api/wasm-executor";

// IMPORTANT to prefix it with `0x`!
const runtime = "0x" + fs.readFileSync("runtime.wasm").toString("hex");

// returns a `0x` prefixed OpaqueMetadata. It's as well prefixed by a compactInt of its length
const metadata = getMetadataFromRuntime(runtime);

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.22,854latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.22,854
0.1.1153
0.1.00

Package Sidebar

Install

npm i @polkadot-api/wasm-executor

Weekly Downloads

3,007

Version

0.1.2

License

MIT

Unpacked Size

2.77 MB

Total Files

6

Last publish

Collaborators

  • voliva
  • josepot