You must replace [api-key] with your personal API key.
If you intend to use API via network and setup api-key, make sure to setup ssl too.

Configuring Clients

Default Listeners

# With curl you just send HTTP Requests based on further docs# Only thing to have in mind is Authentication, which is described in Auth section.
curl http://127.0.0.1:7880/ # will get info from mainnet

By default API listens on this address:

Network

API Port

mainnet

7880

You can interact with wmcc with REST Api as well as RPC, there are couple of ways you can use API.

cURL - You can use direct HTTP calls for invoking REST/RPC API calls.

CLI - wmcc cli has almost all methods described to be used.

Javascript - Clients used by wmcc cli can be used directly from javascript.

RPC Calls - Node

constrpc=newCore.http.RPCClient({network:'mainnet'});(async()=>{constres=awaitrpc.execute('MethodName',[...params]);// RES will return "result" part of the object, not the id or error})().catch((err)=>{// error will be thrown.console.error(err.stack);});

The above command returns JSON structured like this:

{"result":resultObject,"error":errorObject,"id":passedID}

Further examples will only include "result" part.

WMCC RPC calls mimic Bitcoin Core's RPC. This is documentation how to use it with wmcc-core.

constblockdata='1000002042c21ec39ff2fe5627cadccb74d5bd96f946d32e43f22966b94f77b47f060000e2838023c7111d8454129bcb334cbe5bb1aa54a6624c12516209bac4453be42ca48a3a5af0ff0f1e5e89030001010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff2402e803126d696e656420627920776d63635f636f72650457e3f57b080000000000000000ffffffff0300f2052a010000001600148dca4b88efee49e6756ba2ed09e1e27e994a679e0065cd1d000000001976a914456c9dc895ca8bc6e6bae8ca8f2a8a29018ca57d88ac0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90120000000000000000000000000000000000000000000000000000000000000000000000000';constrpc=newCore.http.RPCClient({network:'mainnet'});(async()=>{// Block data is old, so it should return errorconstres=awaitrpc.execute('submitblock',[blockdata]);console.log(res);})().catch((err)=>{console.error(err.stack);});

constblockdata='1000002042c21ec39ff2fe5627cadccb74d5bd96f946d32e43f22966b94f77b47f060000e2838023c7111d8454129bcb334cbe5bb1aa54a6624c12516209bac4453be42ca48a3a5af0ff0f1e5e89030001010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff2402e803126d696e656420627920776d63635f636f72650457e3f57b080000000000000000ffffffff0300f2052a010000001600148dca4b88efee49e6756ba2ed09e1e27e994a679e0065cd1d000000001976a914456c9dc895ca8bc6e6bae8ca8f2a8a29018ca57d88ac0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90120000000000000000000000000000000000000000000000000000000000000000000000000';constrpc=newCore.http.RPCClient({network:'mainnet'});(async()=>{// Block data is old, so it should return errorconstres=awaitrpc.execute('verifyblock',[blockdata]);console.log(res);})().catch((err)=>{console.error(err.stack);});