Development
SignumJS
Recipes
2 min
in this section we show usage examples of signumjs, which give an understanding of how signumjs works the provided examples require at least some basic knowledge of java/typescript all requests are asynchronous such that the concept of https //developer mozilla org/en us/docs/web/javascript/reference/statements/async function and https //developer mozilla org/en us/docs/web/javascript/reference/global objects/promise is required most examples are self containing and fully functional, i e can be copied and pasted directly and executed using nodejs many of these recipes are also available in an extended form in the /examples folder in the https //github com/signum network/signumjs/tree/main/examples to run the examples a https //nodejs org/en/download/ must be set up signumjs works with nodejs 12+ the very basic usage almost all examples require to create an instance of the signum ledger client to get easy access to a networks node // const {ledgerclientfactory} = require('@signumjs/core') import {ledgerclientfactory} from '@signumjs/core' const ledger = ledgerclientfactory createclient({ nodehost "http //localhost 6876" }); // now you have access to the entire api of the signum node // e g getting the account data const account = await ledger account getaccount({accountid '2402520554221019656'})