Usage
Once you have added SignumJS to your application you usually want to connect to one of the Signum Network nodes to interact with the blockchain.
All you need is to create an API instance to get access to the methods of the blockchain API.
The following example shows how to get an account from the chain.
const {composeApi} = require('@signumjs/core');
(async () => {
const api = composeApi({
nodeHost: 'https://europe.signum.network',
});
const account = await api.account.getAccount({accountId: '16107620026796983538'});
console.log('Account', account);
})();
import {composeApi} from '@signumjs/core';
(async (): Promise<void> => {
const api = composeApi({
nodeHost: 'https://europe.signum.network',
});
const account = await api.account.getAccount({accountId: '16107620026796983538'});
console.log('Account', account);
})();Usage with bundles
When using the bundles imported via <script/>, you need to use the respective namespace to get access to the any of the functions within a module.
Each module of SignumJS comes with its own namespace
Module
Namespace
Example
core
sig$
contracts
sig$contracts
crypto
sig$crypto
http
sig$http
monitor
sig$monitor
util
sig$util
Last updated