Skip to content

Latest commit

 

History

History
64 lines (39 loc) · 1.56 KB

ScriptApi.md

File metadata and controls

64 lines (39 loc) · 1.56 KB

ScriptApi

All URIs are relative to http://localhost

Method HTTP request Description
runScript POST /{ledger}/script Execute Numscript

runScript

ScriptResult runScript(script)

Execute a Numscript and create the transaction if any

Example

import { ScriptApi, createConfiguration } from '@numaryhq/ledger-nodejs';
import * as fs from 'fs';

const configuration = createConfiguration();
const apiInstance = new ScriptApi(configuration);

apiInstance.runScript("ledger_example",  {
    plain: "plain_example",
    vars: {},
  },  true ).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
script Script script
ledger [string] ledger defaults to undefined
preview [boolean] Preview mode (optional) defaults to undefined

Return type

ScriptResult

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to README]