Skip to content

@pumpkin-plugins/signing API / sign / signWasm

Function: signWasm() ​

signWasm(wasm, metadata, secretKeyHex): Buffer

Defined in: sign.ts:115

Signs a wasm binary the way Pumpkin verifies it. Existing signing sections are replaced.

Parameters ​

wasm ​

Uint8Array

The binary to sign.

metadata ​

SigningMetadata

What to embed; only the documented fields are written, in order.

secretKeyHex ​

string

The 32-byte seed as 64 hex characters.

Returns ​

Buffer

The binary with pumpkin.metadata and wasm_signature sections appended.

Throws ​

When the key or bytes are invalid, a metadata field has the wrong type, or a metadata ID is unsafe or outside the s64 range.

pumpkin-plugins documentation