Skip to content

Create Script Call

Note

Check the Scriptbuilder: It explains how to create every type of script.

Example

import { ScriptBuilder } from "phantasma-sdk-ts/public";

const address = "P2K..."; // the account to read

const sb = new ScriptBuilder();
const script = sb
  .beginScript()
  .callContract("stake", "GetUnclaimed", [address])
  .endScript();

console.log(script);

The script returns the KCAL the account can claim from its SOUL stake. Invoke a Script runs such a script without a transaction.