To obtain the library use npm:
npm install dcorejs-lib
The following examples will provide you basics of dcorejs-lib library usage, like is manipulation and doing fetches of DCore blockchain objects.
Moreover, it includes connection to DCore daemon APIs.
var Apis ChainConfig = ;var dcoreWsAddress = 'wss://dcore.address.com';ChainConfignetworksdecent =chainId: 'your_dcore_chain_id';Apisinit_promise;
The module provides utility methods which handles DCore blockchain objects.
var Apis ChainStore FetchChain = ;Apisinit_promise;
Generate a new private key from a seed (e.g. a brainkey).
var PrivateKey key = ;let seed = "THIS IS A TERRIBLE BRAINKEY SEED WORD SEQUENCE";let pkey = PrivateKey;console;console;
Following example show the way of broadcasting
transfer operation transaction into DCore network.
var Apis TransactionHelper ChainStore FetchChain Aes TransactionBuilder = ;var amount = 011;var fromAccountId = 'sender_account_name';var toAccountId = 'receiver_account_name';var memoMessage = 'some memo for receiver';Apisinit_promise;