JS Node
Run and edit TypeScript code on-the-fly with Deno runtime.
Documentation
Code requirements
export interface CommandTrait {
/**
* Deserialize each inputs from `Value` to the type of your choice.
* This function will be called before passing inputs to `run()`.
* If not implemented, `Value.toJSObject()` will be called for each inputs.
*/
deserializeInputs?(inputs: Record<string, Value>): Record<string, any>;
/**
* Serialize each output to a `Value`.
* This function will be called after each `run()`.
* If not implemented, `new Value(output)` will be called for each outputs.
*/
serializeOutputs?(outputs: Record<string, any>): Record<string, Value>;
/**
* This function will be called every time the command is run.
* @param ctx Context
* @param params Map of input_name => input_value.
*/
run(ctx: Context, params: Record<string, any>): Promise<Record<string, any>>;
}
Using BaseCommand class
Using libraries
Example node - node that performs a simple addition

Source code template:
Node definition template
Example with a signature request from a wallet
Option 1 - Bundled node
Option 2 - Plain TypeScript Node

Packages
How it works
Last updated