Using minified bundles
2 min
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.
(async () => {
// the 'namespace' of @signum/core is sig$
const ledger = sig$.LedgerClientFactory.create({
nodeHost: 'https://europe.signum.network',
});
const account = await ledger.account.getAccount({accountId: '16107620026796983538'});
console.log('Account', account);
})();The modules are bundled using IIFE II, to avoid global naming collisions with your application. Keep also in mind that the bundles do not contain any type information, so your IDE cannot help you with auto-completion. If ever possible try to use a package manager to be more productive and even reduce the applications payload, as modern toolchains extract the used code from a package (tree shaking, dead code elimination).
Each module of SignumJS comes with its own namespace
- core - sig$
- util - sig$util
- contracts - sig$contracts
- wallets - sig$wallets
- crypto -sig$crypto
- http - sig$http