NAV Navbar
CURL CLI Javascript
  • Introduction
  • Authentication
  • Configuring Clients
  • Node
  • RPC Calls - Node
  • RPC Calls - Network
  • RPC Calls - Chain
  • RPC Calls - Block
  • RPC Calls - Mempool
  • RPC Calls - Transactions
  • RPC Calls - Mining
  • Coin
  • Transaction
  • Wallet Admin
  • Wallet
  • Wallet Transactions
  • Wallet Accounts
  • Wallet Events
  • Errors
  • Introduction

    Welcome to the WMCC API!

    The default WMCC HTTP server listens on the standard RPC port 7880. It exposes a REST json api, as well as a JSON-RPC api.

    Authentication

    Auth

    To authorize, use this code:

    curl http://x:[api-key]@127.0.0.1:7880/
    
    export WMCC_API_KEY=[api-key]
    wmcc cli info
    
    const Core = require('wmcc-core');
    // http client
    const client = new Core.http.Client({
      apiKey: [api-key],
      //...
    });
    // Or wallet
    const wallet = new Core.http.Wallet({
      apiKey: [api-key],
      //...
    });
    

    Make sure to replace [api-key] with your API key.

    Auth is accomplished via HTTP Basic Auth, using your node's API key (passed via --api-key).

    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.

    Configuring WMCC CLI

    # You can use config file
    wmcc cli --config /full/path/to/wmcc.conf
    
    # Or with prefix (which will later load wmcc.conf file from the directory)
    wmcc cli --prefix /full/path/to/wmcc/dir
    
    # You can configure it by passing arguments:
    wmcc cli --network=mainnet info
    wmcc cli info --network=mainnet
    
    # Or use ENV variables (Starting with WMCC_)
    export WMCC_NETWORK=mainnet
    export WMCC_API_KEY=yoursecret
    wmcc cli info
    

    wmcc cli can be configured with many params:

    General configurations are:

    Config Options Description
    prefix dir path This accepts directory where DBs and wmcc.conf are located.
    network mainnet This will configure which network to load, also where to look for config file
    uri, url Base HTTP URI This can be used for custom port
    api-key secret Secret used by RPC for auth.

    Wallet Specific

    Config Options Description
    id primary, custom specify which account to use by default
    token token str Token specific wallet

    Using Javascript Client

    const Core = require('wmcc-core');
    const Client = Core.http.Client;
    const Wallet = Core.http.Wallet;
    
    const client = new Client({
      network: 'mainnet',
      uri: 'http://localhost:7880'
    });
    
    const wallet = new Wallet({
      network: 'mainnet',
      uri: 'http://localhost:7880',
      id: 'primary'
    });
    

    You can also use api with Javascript Library (used by wmcc cli). There are two objects: Core.http.Client for general API and Core.http.Wallet for wallet API.

    Core.http.Client options:

    Config Type Description
    network mainnet Network to use (doesn't lookup configs by itself)
    uri String URI of the service
    apiKey String api secret

    Core.http.Wallet options:

    Config Type Description
    network mainnet Network to use (doesn't lookup configs by itself)
    uri String URI of the service
    apiKey String api secret
    id primary, custom specify which account to use by default
    token token str Token specific wallet

    Node

    JSON-RPC Requests

    curl $url \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{ "method": "getblockchaininfo", "params": [] }'
    

    Route for JSON-RPC requests, most of which mimic the bitcoind RPC calls completely.

    HTTP Request

    POST /

    More about RPC Requests in RPC Docs.

    Get server info

    curl $url/
    
    wmcc cli info
    
    const client = new Core.http.Client({
      network: 'mainnet'
    });
    
    (async () => {
      await client.open();
      const info = await client.getInfo();
    
      console.log(info);
    
      await client.close();
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON structured like this:

    {
      "version": "v1.0.0-beta.1",
      "network": "mainnet",
      "chain": {
        "height": 37766,
        "tip": "000000000064cabec0739edc60c976bb6be8175f0631dfcd6a908b61545f63c6",
        "progress": 1
      },
      "pool": {
        "host": "115.164.83.225",
        "port": 8880,
        "agent": "/wmcc:v1.0.0-beta.1/",
        "services": "1001",
        "outbound": 27,
        "inbound": 58
      },
      "mempool": {
        "tx": 0,
        "size": 0
      },
      "time": {
        "uptime": 23,
        "system": 1519816083,
        "adjusted": 1519816132,
        "offset": 49
      },
      "memory": {
        "total": 98,
        "jsHeap": 23,
        "jsHeapTotal": 38,
        "nativeHeap": 60,
        "external": 62
      }
    }
    

    Get server Info.

    HTTP Request

    Get server info. No params.

    GET /

    No Params.

    Get mempool snapshot

    curl $url/mempool
    
    wmcc cli mempool
    
    const client = new Core.http.Client({
      network: 'mainnet'
    });
    
    (async () => {
      await client.open();
      const mempoolTxs = await client.getMempool();
    
      console.log(mempoolTxs);
    
      await client.close();
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON structured like this:

    [
      "58a16a5ad4baaf061360ae2cf8ed3fb1fff53d46394a245721166df444c88427",
      "ef54e616f21d517bb7f5bf690892afc4a64313a910f176e9f329767bc89067fc",
      "e0e7b6a6354b9dd85b019536d6636a2ec56cedaf5f6fca7dda9ad96abafac298",
      ...
    ]
    

    Get mempool snapshot (array of json txs).

    HTTP Request

    GET /mempool

    No Params.

    Get block by hash or height

    blockHash='00000f010aabd27b067361a8d8bde8dc320ccb237c17797028eb41b00e7dca38';
    blockHeight='1000';
    
    curl $url/block/$blockHash # by hash
    curl $url/block/$blockHeight # by height
    
    blockHash='00000f010aabd27b067361a8d8bde8dc320ccb237c17797028eb41b00e7dca38';
    blockHeight='1000';
    
    wmcc cli block $blockHash # by hash
    wmcc cli block $blockHeight # by height
    
    const blockHash='00000f010aabd27b067361a8d8bde8dc320ccb237c17797028eb41b00e7dca38';
    const blockHeight='1000';
    
    const client = new Core.http.Client({
      network: 'mainnet'
    });
    
    (async () => {
      await client.open();
      const blockByHash = await client.getBlock(blockHash);
      const blockByHeight = await client.getBlock(blockHeight);
    
      console.log(blockByHash, blockByHeight);
    
      await client.close();
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON structured like this:

    {
      "hash": "00000f010aabd27b067361a8d8bde8dc320ccb237c17797028eb41b00e7dca38",
      "height": 1000,
      "version": 536870928,
      "prevBlock": "0000067fb4774fb96629f2432ed346f996bdd574cbdcca2756fef29fc31ec242",
      "merkleRoot": "2ce43b45c4ba096251124c62a654aab15bbe4c33cb9b1254841d11c7238083e2",
      "time": 1513786020,
      "bits": 504365040,
      "nonce": 231774,
      "txs": [
        {
          "hash": "2ce43b45c4ba096251124c62a654aab15bbe4c33cb9b1254841d11c7238083e2",
          "witnessHash": "96b8e9877e0e025157c27818d18aa7c58192500ac051d6457474c5a3678e1b05",
          "fee": 0,
          "rate": 0,
          "mtime": 1519816880,
          "index": 0,
          "version": 1,
          "inputs": [
            {
              "prevout": {
                "hash": "0000000000000000000000000000000000000000000000000000000000000000",
                "index": 4294967295
              },
              "script": "02e803126d696e656420627920776d63635f636f72650457e3f57b080000000000000000",
              "witness": "01200000000000000000000000000000000000000000000000000000000000000000",
              "sequence": 4294967295,
              "address": null
            }
          ],
          "outputs": [
            {
              "value": 5000000000,
              "script": "00148dca4b88efee49e6756ba2ed09e1e27e994a679e",
              "address": "wc1q3h9yhz80aey7vatt5tksnc0z06v55eu78dqwxt"
            },
            {
              "value": 500000000,
              "script": "76a914456c9dc895ca8bc6e6bae8ca8f2a8a29018ca57d88ac",
              "address": "WV17cxcpPmNNJYuFp7nkNoXJ75uZj11zTC"
            },
            {
              "value": 0,
              "script": "6a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf9",
              "address": null
            }
          ],
          "locktime": 0,
          "hex": "010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff2402e803126..."
        }
      ]
    }
    

    Returns block info by block hash or height.

    HTTP Request

    GET /block/:blockhashOrHeight

    URL Parameters

    Parameter Description
    :blockhashOrHeight Hash or Height of block

    Broadcast transaction

    tx='0100000001c3f71d1defd642062799dc895ca8bc6e6b1e27e994ca8bc6e6ba799962b48b...';
    
    curl $url/broadcast \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{ "tx": "'$tx'" }'
    
    tx='0100000001c3f71d1defd642062799dc895ca8bc6e6b1e27e994ca8bc6e6ba799962b48b...';
    
    wmcc cli broadcast $tx
    
    const tx='0100000001c3f71d1defd642062799dc895ca8bc6e6b1e27e994ca8bc6e6ba799962b48b...';
    
    const client = new Core.http.Client({
      network: 'mainnet',
    });
    
    (async () => {
      await client.open();
    
      const result = await client.broadcast(tx);
    
      console.log(result);
    
      await client.close();
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON structured like this:

    {
      "success": true
    }
    

    Broadcast a transaction by adding it to the node's mempool. If mempool verification fails, the node will still forcefully advertise and relay the transaction for the next 60 seconds.

    HTTP Request

    POST /broadcast

    POST Parameters (JSON)

    Parameter Description
    tx transaction hash

    RPC Calls - Node

    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{ "method": "methodname", "params": [...] "id": "some-id" }'
    
    wmcc cli rpc params...
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.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.

    RPC Calls are accepted at: POST /

    POST Parameters RPC

    Parameter Description
    method Name of the RPC call
    params Parameters accepted by method
    id Will be returned with the response (Shouldn't be object)

    stop

    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{ "method": "stop" }'
    
    wmcc cli rpc stop
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('stop');
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    "Stopping."
    

    Stops the running node.

    Params

    # Name Default Description
    None

    getinfo

    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "getinfo",
        "params": []
      }'
    
    wmcc cli rpc getinfo
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getinfo');
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    {
      "version": "v1.0.0-beta.1",
      "protocolversion": 70015,
      "walletversion": 0,
      "balance": 0,
      "blocks": 38432,
      "timeoffset": 0,
      "connections": 28,
      "proxy": "",
      "difficulty": 689.0484608679707,
      "testnet": false,
      "keypoololdest": 0,
      "keypoolsize": 0,
      "unlocked_until": 0,
      "paytxfee": 0.001,
      "relayfee": 0.00001,
      "errors": ""
    }
    

    Returns general info.

    Params

    # Name Default Description
    None

    getmemoryinfo

    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "getmemoryinfo",
        "params": []
      }'
    
    wmcc cli rpc getmemoryinfo
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getmemoryinfo');
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    {
      "total": 62,
      "jsHeap": 16,
      "jsHeapTotal": 19,
      "nativeHeap": 42,
      "external": 62
    }
    

    Returns Memory usage info.

    Params

    # Name Default Description
    None

    setloglevel

    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "setloglevel",
        "params": [ "none" ]
      }'
    
    wmcc cli rpc setloglevel none
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('setloglevel', [ 'none' ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    null
    

    Change Log level of the running node.

    Levels are: NONE, ERROR, WARNING, INFO, DEBUG, SPAM

    Params

    # Name Default Description
    1 level Required Level for the logger

    validateaddress

    address='wc1qg0325qf07mysegu5qeuupf5zr38yrcsrkqhnav';
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "validateaddress",
        "params": [ "'$address'" ]
      }'
    
    address='wc1qg0325qf07mysegu5qeuupf5zr38yrcsrkqhnav';
    
    wmcc cli rpc validateaddress $address
    
    const address = 'wc1qg0325qf07mysegu5qeuupf5zr38yrcsrkqhnav';
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('validateaddress', [ address ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    {
      "isvalid": true,
      "address": "wc1qg0325qf07mysegu5qeuupf5zr38yrcsrkqhnav",
      "scriptPubKey": "001443e2aa012ff6c90ca3940679c0a6821c4e41e203",
      "ismine": false,
      "iswatchonly": false
    }
    

    Validates address.

    Params

    # Name Default Description
    1 address Required Address to validate

    createmultisig

    later
    
    later
    
    later
    

    The above command returns JSON "result" like this:

    later
    

    Create multisig address.

    Params

    # Name Default Description
    1 nrequired Required Required number of approvals for spending
    2 keyArray Required Array of public keys

    createwitnessaddress

    later
    
    later
    
    later
    

    The above command returns JSON "result" like this:

    later
    

    Creates witness address.

    Params

    # Name Default Description
    1 script Required WMCC script.

    signmessagewithprivkey

    later
    
    later
    
    later
    

    The above command returns JSON "result" like this:

    later
    

    Signs message with private key.

    Params

    # Name Default Description
    1 privkey Required Private key
    2 message Required Message you want to sign.

    verifymessage

    later
    
    later
    
    later
    

    The above command returns JSON "result" like this:

    later
    

    Verify a message.

    Params

    # Name Default Description
    1 address Required Address of the signer
    2 signature Required Signature of signed message
    3 message Required Message that was signed

    setmocktime

    timestamp=1519880400;
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "setmocktime",
        "params": [ '$timestamp' ]
      }'
    
    timestamp=1519880400;
    
    wmcc cli rpc setmocktime $timestamp
    
    
    const timestamp = 1519880400;
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('setmocktime', [ timestamp ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    null
    

    Changes network time (This is consensus-critical).

    Params

    # Name Default Description
    1 timestamp Required timestamp to change to

    RPC Calls - Network

    getconnectioncount

    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "getconnectioncount",
        "params": []
      }'
    
    wmcc cli rpc getconnectioncount
    
    const rpc = new Core.http.Client({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getconnectioncount');
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    16
    

    Returns connection count.

    Params

    # Name Default Description
    None

    ping

    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "ping",
        "params": []
      }'
    
    wmcc cli rpc ping
    
    const rpc = new Core.http.Client({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('ping');
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    null
    

    Will send ping request to every connected peer.

    Params

    # Name Default Description
    None

    getpeerinfo

    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "getpeerinfo",
        "params": []
      }'
    
    wmcc cli rpc getpeerinfo
    
    const rpc = new Core.http.Client({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getpeerinfo');
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    [
      {
        "id": 55852,
        "addr": "172.245.190.73:8880",
        "addrlocal": "115.164.177.220:2334",
        "services": "00000009",
        "relaytxes": true,
        "lastsend": 1520053635,
        "lastrecv": 1520053635,
        "bytessent": 25016,
        "bytesrecv": 34335,
        "conntime": 401,
        "timeoffset": 51,
        "pingtime": 0.234,
        "minping": 0.234,
        "version": 70015,
        "subver": "/wmcc:v1.0.0-beta.1/",
        "inbound": false,
        "startingheight": 40406,
        "besthash": "00000000000d53383bf2c2e8eaeaf79a73a3cd51b7b0ea36f6839c2e86ed89d2",
        "bestheight": 40407,
        "banscore": 0,
        "inflight": [],
        "whitelisted": false
      },
      ...
    ]
    

    Returns information about all connected peers.

    Params

    # Name Default Description
    None

    addnode

    nodeAddr='172.245.190.68:8880';
    cmd='add';
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "addnode",
        "params": [ "'$nodeAddr'", "'$cmd'" ]
      }'
    
    nodeAddr='172.245.190.68:8880';
    cmd='add';
    
    wmcc cli rpc addnode $nodeAddr $cmd
    
    const nodeAddr = '172.245.190.68:8880';
    const cmd = 'add';
    
    const rpc = new Core.http.Client({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('addnode', [ nodeAddr, cmd ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    null
    

    Adds or removes peers in Host List.

    Params

    # Name Default Description
    1 addr Required IP Address (port) of the Node
    2 cmd Required Command

    Commands

    # Command Description
    1 add Adds node to Host List and connects to it
    2 onetry Tries to connect to the given node
    3 remove Removes node from host list

    disconnectnode

    nodeAddr='172.245.190.68:8880';
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "disconnectnode",
        "params": [ "'$nodeAddr'" ]
      }'
    
    nodeAddr='172.245.190.68:8880';
    
    wmcc cli rpc disconnectnode $nodeAddr
    
    const nodeAddr = '172.245.190.68:8880';
    
    const rpc = new Core.http.Client({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('disconnectnode', [ nodeAddr ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    null
    

    Disconnects node.

    Params

    # Name Default Description
    1 addr Required IP Address of the Node

    getaddednodeinfo

    nodeAddr='172.245.190.68:8880';
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "getaddednodeinfo",
        "params": [ "'$nodeAddr'" ]
      }'
    
    nodeAddr='172.245.190.68:8880';
    
    wmcc cli rpc getaddednodeinfo $nodeAddr
    
    const nodeAddr = '172.245.190.68:8880';
    
    const rpc = new Core.http.Client({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getaddednodeinfo', [ nodeAddr ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    [
      {
        "addednode": "172.245.190.68:8880",
        "connected": true,
        "addresses": [
          {
            "address": "172.245.190.68:8880",
            "connected": "outbound"
          }
        ]
      }
    ]
    

    Returns node information from host list.

    Params

    # Name Default Description
    1 addr Required IP Address (port) of the Node

    getnettotals

    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "getnettotals",
        "params": []
      }'
    
    wmcc cli rpc getnettotals
    
    const rpc = new Core.http.Client({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getnettotals');
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    {
      "totalbytesrecv": 94851,
      "totalbytessent": 56241,
      "timemillis": 1520054570343
    }
    

    Returns information about used network resources.

    Params

    # Name Default Description
    None

    getnetworkinfo

    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "getnetworkinfo",
        "params": []
      }'
    
    wmcc cli rpc getnetworkinfo
    
    const rpc = new Core.http.Client({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getnetworkinfo');
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    {
      "version": "v1.0.0-beta.1",
      "subversion": "/wmcc:v1.0.0-beta.1/",
      "protocolversion": 70015,
      "localservices": "00000009",
      "localrelay": true,
      "timeoffset": 0,
      "networkactive": true,
      "connections": 32,
      "networks": [],
      "relayfee": 0.00001,
      "incrementalfee": 0,
      "localaddresses": [
        {
          "address": "115.164.177.220",
          "port": 8880,
          "score": 3
        }
      ],
      "warnings": ""
    }
    

    Returns local node's network information.

    Params

    # Name Default Description
    None

    setban

    nodeAddr='172.245.190.68:8880';
    cmd='add';
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "setban",
        "params": [ "'$nodeAddr'", "'$cmd'" ]
      }'
    
    nodeAddr='172.245.190.68:8880';
    cmd='add';
    
    wmcc cli rpc setban $nodeAddr $cmd
    
    const nodeAddr = '172.245.190.68:8880';
    const cmd = 'add';
    
    const rpc = new Core.http.Client({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('setban', [ nodeAddr, cmd ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    null
    

    Adds or removes nodes from banlist.

    Params

    # Name Default Description
    1 addr Required IP Address (port) of the Node
    2 cmd Required Command

    Commands

    # Command Description
    1 add Adds node to ban list, removes from host list, disconnects
    2 remove Removes node from ban list

    listbanned

    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "listbanned",
        "params": []
      }'
    
    wmcc cli rpc listbanned
    
    const rpc = new Core.http.Client({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('listbanned');
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    [
      {
        "address": "172.245.190.68",
        "banned_until": 1520141477,
        "ban_created": 1520055077,
        "ban_reason": ""
      },
      ...
    ]
    

    Lists all banned peers.

    Params

    # Name Default Description
    None

    clearbanned

    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "clearbanned",
        "params": []
      }'
    
    wmcc cli rpc clearbanned
    
    const rpc = new Core.http.Client({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('clearbanned');
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    null
    

    Removes all banned peers.

    Params

    # Name Default Description
    None

    RPC Calls - Chain

    pruneblockchain

    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "pruneblockchain",
        "params": []
      }'
    
    wmcc cli rpc pruneblockchain
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('pruneblockchain');
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON structured like this:

    null
    

    Prunes the blockchain, it will keep blocks specified in Network Configurations.

    Default Prune Options

    Network keepBlocks pruneAfter
    main 288 1000

    Params

    # Name Default Description
    None

    invalidateblock

    blockhash='00000f010aabd27b067361a8d8bde8dc320ccb237c17797028eb41b00e7dca38';
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "invalidateblock",
        "params": [ "'$blockhash'" ]
      }'
    
    blockhash='00000f010aabd27b067361a8d8bde8dc320ccb237c17797028eb41b00e7dca38';
    
    wmcc cli rpc invalidateblock $blockhash
    
    const blockhash = '00000f010aabd27b067361a8d8bde8dc320ccb237c17797028eb41b00e7dca38';
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('invalidateblock', [ blockhash ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON structured like this:

    null
    

    Invalidates the block in the chain. It will rewind network to blockhash and invalidate it.

    It won't accept that block as valid Invalidation will work while running, restarting node will remove invalid block from list.

    Params

    # Name Default Description
    1 blockhash Required Block's hash

    reconsiderblock

    blockhash='00000f010aabd27b067361a8d8bde8dc320ccb237c17797028eb41b00e7dca38';
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "reconsiderblock",
        "params": [ "'$blockhash'" ]
      }'
    
    blockhash='00000f010aabd27b067361a8d8bde8dc320ccb237c17797028eb41b00e7dca38';
    
    wmcc cli rpc reconsiderblock $blockhash
    
    const blockhash = '00000f010aabd27b067361a8d8bde8dc320ccb237c17797028eb41b00e7dca38';
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('reconsiderblock', [ blockhash ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON structured like this:

    null
    

    This rpc command will remove block from invalid block set.

    Params

    # Name Default Description
    1 blockhash Required Block's hash

    RPC Calls - Block

    getblockchaininfo

    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{ "method": "getblockchaininfo" }'
    
    wmcc cli rpc getblockchaininfo
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getblockchaininfo');
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON structured like this:

    {
      "chain": "mainnet",
      "blocks": 1798,
      "headers": 1798,
      "bestblockhash": "000008ec940a34757a5dcf1dad1414f48eedb41fcdd248022d53793b2db2d99c",
      "difficulty": 0.000244140625,
      "mediantime": 1513832890,
      "verificationprogress": 0.017091019843844264,
      "chainwork": "0000000000000000000000000000000000000000000000000000000070707070",
      "pruned": false,
      "softforks": [
        {
          "id": "bip34",
          "version": 2,
          "reject": {
            "status": true
          }
        },
        {
          "id": "bip66",
          "version": 3,
          "reject": {
            "status": true
          }
        },
        {
          "id": "bip65",
          "version": 4,
          "reject": {
            "status": true
          }
        }
      ],
      "bip9_softforks": {
        "csv": {
          "status": "defined",
          "bit": 0,
          "startTime": 1509494400,
          "timeout": 1541030400
        },
        "segwit": {
          "status": "defined",
          "bit": 1,
          "startTime": 1509494400,
          "timeout": 1541030400
        },
        "segsignal": {
          "status": "active",
          "bit": 4,
          "startTime": 1509494400,
          "timeout": 1541030400
        },
        "testdummy": {
          "status": "defined",
          "bit": 28,
          "startTime": 1509494400,
          "timeout": 1541030400
        }
      },
      "pruneheight": null
    }
    

    Returns blockchain information.

    Params

    # Name Default Description
    None

    getbestblockhash

    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{ "method": "getbestblockhash" }'
    
    wmcc cli rpc getbestblockhash
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getbestblockhash');
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON structured like this:

    "0000093b3947f33f00ee5e4247606d78be62d0ac41059dbad1203d01779ee470"
    

    Returns Block Hash of the tip.

    Params

    # Name Default Description
    None

    getblockcount

    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{ "method": "getblockcount" }'
    
    wmcc cli rpc getblockcount
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getblockcount');
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON structured like this:

    38495
    

    Returns block count.

    Params

    # Name Default Description
    None

    getblock

    blockhash='000002d3f7dbc79d1bbaff4cb76e77bc6c8df3728f0c1e419de86b8830056774';
    verbose=1;
    details=0;
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "getblock",
        "params": [ "'$blockhash'", "'$verbose'", "'$details'" ]
      }'
    
    blockhash='000002d3f7dbc79d1bbaff4cb76e77bc6c8df3728f0c1e419de86b8830056774';
    verbose=1;
    details=0;
    
    wmcc cli rpc getblock $blockhash $verbose $details
    
    const blockhash = '000002d3f7dbc79d1bbaff4cb76e77bc6c8df3728f0c1e419de86b8830056774';
    const verbose = 1;
    const details = 0;
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getblock', [ blockhash, verbose, details ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON structured like this:

    {
      "hash": "000002d3f7dbc79d1bbaff4cb76e77bc6c8df3728f0c1e419de86b8830056774",
      "confirmations": 35499,
      "strippedsize": 280,
      "size": 316,
      "weight": 1156,
      "height": 3000,
      "version": 536870912,
      "nonce": 2541542,
      "versionHex": "20000000",
      "merkleroot": "93820db11708782c947fe2fe34830616bb6cec52f9a032cf18c7e0ae58e47385",
      "coinbase": "02b80b126d696e656420627920776d63635f636f726504daddb6ac080000000000000000",
      "tx": [
        "93820db11708782c947fe2fe34830616bb6cec52f9a032cf18c7e0ae58e47385"
      ],
      "time": 1514098188,
      "mediantime": 1514096878,
      "bits": 503578620,
      "difficulty": 0.0009765625,
      "chainwork": "0000000000000000000000000000000000000000000000000000000174417440",
      "previousblockhash": "000000ea5b593cd198ee136524be6ca46a25154765b2eccf3d6ceff13f243562",
      "nextblockhash": "000000b0346a304c4f9bb7b672bc10cdac3cd203f105962fa64faa594cebc465"
    }
    

    Returns information about block.

    Params

    # Name Default Description
    1 blockhash Required Hash of the block
    2 verbose true If set to false, it will return hex of the block
    3 details false If set to true, it will return transaction details too

    getblockbyheight

    blockheight=3000;
    verbose=1;
    details=0;
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "getblockbyheight",
        "params": [ "'$blockheight'", "'$verbose'", "'$details'" ]
      }'
    
    blockheight=3000;
    verbose=1;
    details=0;
    
    wmcc cli rpc getblockbyheight $blockheight $verbose $details
    
    const blockheight = 3000;
    const verbose = 1;
    const details = 0;
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getblockbyheight', [ blockheight, verbose, details ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON structured like this:

    {
      "hash": "000002d3f7dbc79d1bbaff4cb76e77bc6c8df3728f0c1e419de86b8830056774",
      "confirmations": 35500,
      "strippedsize": 280,
      "size": 316,
      "weight": 1156,
      "height": 3000,
      "version": 536870912,
      "nonce": 2541542,
      "versionHex": "20000000",
      "merkleroot": "93820db11708782c947fe2fe34830616bb6cec52f9a032cf18c7e0ae58e47385",
      "coinbase": "02b80b126d696e656420627920776d63635f636f726504daddb6ac080000000000000000",
      "tx": [
        "93820db11708782c947fe2fe34830616bb6cec52f9a032cf18c7e0ae58e47385"
      ],
      "time": 1514098188,
      "mediantime": 1514096878,
      "bits": 503578620,
      "difficulty": 0.0009765625,
      "chainwork": "0000000000000000000000000000000000000000000000000000000174417440",
      "previousblockhash": "000000ea5b593cd198ee136524be6ca46a25154765b2eccf3d6ceff13f243562",
      "nextblockhash": "000000b0346a304c4f9bb7b672bc10cdac3cd203f105962fa64faa594cebc465"
    }
    

    Returns information about block by height.

    Params

    # Name Default Description
    1 blockheight Required Height of the block in the blockchain
    2 verbose true If set to false, it will return hex of the block
    3 details false If set to true, it will return transaction details too

    getblockhash

    blockheight=3000;
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "getblockhash",
        "params": [ "'$blockheight'" ]
      }'
    
    blockheight=3000;
    
    wmcc cli rpc getblockhash $blockheight
    
    const blockheight = 3000;
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getblockhash', [ blockheight ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON structured like this:

    "000002d3f7dbc79d1bbaff4cb76e77bc6c8df3728f0c1e419de86b8830056774"
    

    Returns block's hash by height.

    Params

    # Name Default Description
    1 blockheight Required Height of the block in the blockchain

    getblockheader

    blockhash='000002d3f7dbc79d1bbaff4cb76e77bc6c8df3728f0c1e419de86b8830056774';
    verbose=1;
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "getblockheader",
        "params": [ "'$blockhash'", "'$details'" ]
      }'
    
    blockhash='000002d3f7dbc79d1bbaff4cb76e77bc6c8df3728f0c1e419de86b8830056774';
    verbose=1;
    
    wmcc cli rpc getblockheader $blockhash $verbose
    
    const blockhash = '000002d3f7dbc79d1bbaff4cb76e77bc6c8df3728f0c1e419de86b8830056774';
    const verbose = 1;
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getblockheader', [ blockheight, verbose ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON structured like this:

    {
      "hash": "000002d3f7dbc79d1bbaff4cb76e77bc6c8df3728f0c1e419de86b8830056774",
      "confirmations": 35501,
      "height": 3000,
      "version": 536870912,
      "versionHex": "20000000",
      "merkleroot": "93820db11708782c947fe2fe34830616bb6cec52f9a032cf18c7e0ae58e47385",
      "time": 1514098188,
      "mediantime": 1514096878,
      "bits": 503578620,
      "difficulty": 0.0009765625,
      "chainwork": "0000000000000000000000000000000000000000000000000000000174417440",
      "previousblockhash": "000000ea5b593cd198ee136524be6ca46a25154765b2eccf3d6ceff13f243562",
      "nextblockhash": "000000b0346a304c4f9bb7b672bc10cdac3cd203f105962fa64faa594cebc465"
    }
    

    Returns block's header by hash.

    Params

    # Name Default Description
    1 blockheight Required Height of the block in the blockchain
    2 verbose true If set to false, it will return hex of the block

    getchaintips

    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "getchaintips"
      }'
    
    wmcc cli rpc getchaintips
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getchaintips');
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON structured like this:

    [
      {
        "height": 33389,
        "hash": "000000000373310bebeefd0996baccc67c8efe7c8b0e9916e38c840d8cdf2e00",
        "branchlen": 1,
        "status": "valid-headers"
      },
      {
        "height": 38419,
        "hash": "000000000025e47166b1aeee010e7745708b5653c75ce74e252a9ac36cea0608",
        "branchlen": 1,
        "status": "valid-headers"
      },
      {
        "height": 31060,
        "hash": "00000000032589e67ea46869d1b9417f86cdba3ed2323800b876d7602e7a330a",
        "branchlen": 1,
        "status": "valid-headers"
      },
      ...
    ]
    

    Returns chaintips.

    Params

    # Name Default Description
    None

    getdifficulty

    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "getdifficulty"
      }'
    
    wmcc cli rpc getdifficulty
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getdifficulty');
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON structured like this:

    689.0484608679707
    

    Returns block difficulty.

    Params

    # Name Default Description
    None

    RPC Calls - Mempool

    getmempoolinfo

    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "getmempoolinfo"
      }'
    
    wmcc cli rpc getmempoolinfo
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getmempoolinfo');
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    {
      "size": 10,
      "bytes": 30432,
      "usage": 30432,
      "maxmempool": 100000000,
      "mempoolminfee": 0.00001
    }
    later
    

    Returns informations about mempool.

    Params

    # Name Default Description
    None

    getmempoolancestors

    txhash='later';
    verbose=1;
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "getmempoolancestors",
        "params": [ "'$txhash'", "'$verbose'" ]
      }'
    
    txhash='later';
    verbose=1;
    
    wmcc cli rpc getmempoolancestors $txhash $verbose
    
    const txhash = 'later';
    const verbose = 1;
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getmempoolancestors', [ txhash, verbose ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    later
    

    Returns all in-mempool ancestors for a transaction in the mempool.

    Params

    # Name Default Description
    1 txhash Required Transaction Hash
    2 verbose false False - returns only tx hashs, true - returns dependency tx info

    getmempooldescendants

    txhash='later';
    
    verbose=1;
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "getmempooldescendants",
        "params": [ "'$txhash'", "'$verbose'" ]
      }'
    
    txhash='later';
    verbose=1;
    
    wmcc cli rpc getmempooldescendants $txhash $verbose
    
    const txhash = 'later';
    const verbose = 1;
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getmempooldescendants', [ txhash, verbose ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    later
    

    Returns all in-mempool descendants for a transaction in the mempool.

    Params

    # Name Default Description
    1 txhash Required Transaction Hash
    2 verbose false False - returns only tx hashs, true - returns dependency tx info

    getmempoolentry

    txhash='later';
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "getmempoolentry",
        "params": [ "'$txhash'" ]
      }'
    
    txhash='later';
    
    wmcc cli rpc getmempoolentry $txhash
    
    const txhash = 'later';
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getmempoolentry', [ txhash ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    later
    

    Returns mempool transaction info by its hash.

    Params

    # Name Default Description
    1 txhash Required Transaction Hash

    getrawmempool

    verbose=1;
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "getrawmempool",
        "params": [ "'$verbose'" ]
      }'
    
    verbose=1;
    
    wmcc cli rpc getrawmempool $verbose
    
    const verbose = 1;
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getrawmempool', [ verbose ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    later
    

    Returns mempool detailed information (on verbose). Or mempool tx list.

    Params

    # Name Default Description
    1 verbose false False - returns only tx hashs, true - returns full tx info

    prioritisetransaction

    txhash='';
    priorityDelta=1000;
    feeDelta=1000;
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "prioritisetransaction",
        "params": [ "'$txhash'", "'$priorityDelta'", "'$feeDelta'" ]
      }'
    
    txhash='';
    priorityDelta=1000;
    feeDelta=1000;
    
    wmcc cli rpc prioritisetransaction $txhash $priorityDelta $feeDelta
    
    const txhash = '';
    const priorityDelta = 1000;
    const feeDelta = 1000;
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('prioritisetransaction', [ txhash, priorityDelta, feeDelta ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    true
    

    Prioritises the transaction.

    Params

    # Name Default Description
    1 txid Required Transaction hash
    2 priority delta Required Virtual priority to add/subtract to the entry
    3 fee delta Required Virtual fee to add/subtract to the entry

    estimatefee

    nblocks=10;
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "estimatefee",
        "params": [ "'$nblocks'" ]
      }'
    
    nblocks=10;
    
    wmcc cli rpc estimatefee $nblocks
    
    const nblocks = 10;
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('estimatefee', [ nblocks ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    later
    

    Estimates fee to be paid for transaction.

    Params

    # Name Default Description
    1 nblocks 1 Number of blocks to check for estimation

    estimatepriority

    nblocks=10;
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "estimatepriority",
        "params": [ "'$nblocks'" ]
      }'
    
    nblocks=10;
    
    wmcc cli rpc estimatepriority $nblocks
    
    const nblocks = 10;
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('estimatepriority', [ nblocks ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    later
    

    Estimates the priority (coin age) that a transaction needs in order to be included within a certain number of blocks as a free high-priority transaction.

    Params

    # Name Default Description
    1 nblocks 1 Number of blocks to check for estimation

    estimatesmartfee

    nblocks=10;
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "estimatesmartfee",
        "params": [ "'$nblocks'" ]
      }'
    
    nblocks=10;
    
    wmcc cli rpc estimatesmartfee $nblocks
    
    const nblocks = 10;
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('estimatesmartfee', [ nblocks ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    later
    

    Estimates smart fee to be paid for transaction.

    Params

    # Name Default Description
    1 nblocks 1 Number of blocks to check for estimation

    estimatesmartpriority

    nblocks=10;
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "estimatesmartpriority",
        "params": [ "'$nblocks'" ]
      }'
    
    nblocks=10;
    
    wmcc cli rpc estimatesmartpriority $nblocks
    
    const nblocks = 10;
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('estimatesmartpriority', [ nblocks ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    later
    

    Estimates smart priority (coin age) that a transaction needs in order to be included within a certain number of blocks as a free high-priority transaction.

    Params

    # Name Default Description
    1 nblocks 1 Number of blocks to check for estimation

    RPC Calls - Transactions

    gettxout

    txhash='2784c844f46d162157244a39463df5ffb13fedf82cae601306afbad45a6aa158';
    index=0;
    includemempool=1;
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "gettxout",
        "params": [ "'$txhash'", "'$index'", "'$includemempool'" ]
      }'
    
    txhash='2784c844f46d162157244a39463df5ffb13fedf82cae601306afbad45a6aa158';
    index=0;
    includemempool=1;
    
    wmcc cli rpc gettxout $txhash $index $includemempool
    
    const txhash = '2784c844f46d162157244a39463df5ffb13fedf82cae601306afbad45a6aa158';
    const index = 0;
    const includemempool = 1;
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('gettxout', [ txhash, index, includemempool ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    {
      "bestblock": "00000000005dd7dc561adf5a45b424522ddb5d5d097cf786e3765d131c45d541",
      "confirmations": 27102,
      "value": 4.6761,
      "scriptPubKey": {
        "asm": "OP_0 fabd5c4234e13f6afcf5bb88d31778bd4a7501ef",
        "hex": "0014fabd5c4234e13f6afcf5bb88d31778bd4a7501ef",
        "type": "WITNESSPUBKEYHASH",
        "reqSigs": 1,
        "addresses": [
          "wc1ql274cs35uylk4l84hwydx9mch4982q006z9a6r"
        ]
      },
      "version": 1,
      "coinbase": false
    }
    

    Validates address.

    Params

    # Name Default Description
    1 address Required Address to validate

    gettxoutsetinfo

    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "gettxoutsetinfo",
        "params": []
      }'
    
    wmcc cli rpc gettxoutsetinfo
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('gettxoutsetinfo');
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    {
      "height": 38515,
      "bestblock": "0000000000302782c0835cad1da86e8c98c92cb05a0304d3b6b4ca62199f6a28",
      "transactions": 38670,
      "txouts": 71313,
      "bytes_serialized": 0,
      "hash_serialized": 0,
      "total_amount": 22118325
    }
    

    Returns information about UTXO's from Chain.

    Params

    # Name Default Description
    None

    getrawtransaction

    txhash='2784c844f46d162157244a39463df5ffb13fedf82cae601306afbad45a6aa158';
    verbose=0;
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "getrawtransaction",
        "params": [ "'$txhash'", "'$verbose'" ]
      }'
    
    txhash='2784c844f46d162157244a39463df5ffb13fedf82cae601306afbad45a6aa158';
    verbose=0;
    
    wmcc cli rpc getrawtransaction $txhash $verbose
    
    const txhash = '2784c844f46d162157244a39463df5ffb13fedf82cae601306afbad45a6aa158';
    const verbose = 0;
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getrawtransaction', [ txhash, verbose ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    "010000000001013e1ac1713e83b89067f97b2b583dc88afc6dbd391dd9782a363be2d108bb62290000000000ffffffff029029df1b00000000160014fabd5c4234e13f6afcf5bb88d31778bd4a7501efc091260e010000001600145ead51bc8f6ba3536a2ac99a2f28c8ab9bbec383024730440220669783ecaffb8da8f9d2b09faa33240486570a1ca5091f9feb1d2f451e125a9602206c63013c292f2eb9a2a363b13f73f2f8d8035b81f4d3c83a51f1c171d693a17c012102db24f4484b429ee9de01bc0e2d7a8d5945fafca8c8c986dd61eb49bd5044300600000000"
    

    Returns raw transaction.

    Params

    # Name Default Description
    1 txhash Required Transaction hash
    2 verbose false Returns json formatted if true

    decoderawtransaction

    rawtx='010000000001013e1ac1713e83b89067f97b2b583dc88afc6dbd391dd9782a363be2d108bb62290000000000ffffffff029029df1b00000000160014fabd5c4234e13f6afcf5bb88d31778bd4a7501efc091260e010000001600145ead51bc8f6ba3536a2ac99a2f28c8ab9bbec383024730440220669783ecaffb8da8f9d2b09faa33240486570a1ca5091f9feb1d2f451e125a9602206c63013c292f2eb9a2a363b13f73f2f8d8035b81f4d3c83a51f1c171d693a17c012102db24f4484b429ee9de01bc0e2d7a8d5945fafca8c8c986dd61eb49bd5044300600000000';
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "decoderawtransaction",
        "params": [ "'$rawtx'" ]
      }'
    
    rawtx='010000000001013e1ac1713e83b89067f97b2b583dc88afc6dbd391dd9782a363be2d108bb62290000000000ffffffff029029df1b00000000160014fabd5c4234e13f6afcf5bb88d31778bd4a7501efc091260e010000001600145ead51bc8f6ba3536a2ac99a2f28c8ab9bbec383024730440220669783ecaffb8da8f9d2b09faa33240486570a1ca5091f9feb1d2f451e125a9602206c63013c292f2eb9a2a363b13f73f2f8d8035b81f4d3c83a51f1c171d693a17c012102db24f4484b429ee9de01bc0e2d7a8d5945fafca8c8c986dd61eb49bd5044300600000000';
    
    wmcc cli rpc decoderawtransaction $rawtx
    
    const rawtx = '010000000001013e1ac1713e83b89067f97b2b583dc88afc6dbd391dd9782a363be2d108bb62290000000000ffffffff029029df1b00000000160014fabd5c4234e13f6afcf5bb88d31778bd4a7501efc091260e010000001600145ead51bc8f6ba3536a2ac99a2f28c8ab9bbec383024730440220669783ecaffb8da8f9d2b09faa33240486570a1ca5091f9feb1d2f451e125a9602206c63013c292f2eb9a2a363b13f73f2f8d8035b81f4d3c83a51f1c171d693a17c012102db24f4484b429ee9de01bc0e2d7a8d5945fafca8c8c986dd61eb49bd5044300600000000';
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('decoderawtransaction', [ rawtx ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    {
      "txid": "2784c844f46d162157244a39463df5ffb13fedf82cae601306afbad45a6aa158",
      "hash": "ec3f8bffc219ba76205567bdae14b352e292a90895b1ac131ac1129f94276dbf",
      "size": 222,
      "vsize": 141,
      "version": 1,
      "locktime": 0,
      "vin": [
        {
          "txid": "2962bb08d1e23b362a78d91d39bd6dfc8ac83d582b7bf96790b8833e71c11a3e",
          "scriptSig": {
            "asm": "",
            "hex": ""
          },
          "txinwitness": [
            "30440220669783ecaffb8da8f9d2b09faa33240486570a1ca5091f9feb1d2f451e125a9602206c63013c292f2eb9a2a363b13f73f2f8d8035b81f4d3c83a51f1c171d693a17c01",
            "02db24f4484b429ee9de01bc0e2d7a8d5945fafca8c8c986dd61eb49bd50443006"
          ],
          "sequence": 4294967295,
          "vout": 0
        }
      ],
      "vout": [
        {
          "value": 4.6761,
          "n": 0,
          "scriptPubKey": {
            "asm": "OP_0 fabd5c4234e13f6afcf5bb88d31778bd4a7501ef",
            "hex": "0014fabd5c4234e13f6afcf5bb88d31778bd4a7501ef",
            "type": "WITNESSPUBKEYHASH",
            "reqSigs": 1,
            "addresses": [
              "wc1ql274cs35uylk4l84hwydx9mch4982q006z9a6r"
            ]
          }
        },
        {
          "value": 45.32376,
          "n": 1,
          "scriptPubKey": {
            "asm": "OP_0 5ead51bc8f6ba3536a2ac99a2f28c8ab9bbec383",
            "hex": "00145ead51bc8f6ba3536a2ac99a2f28c8ab9bbec383",
            "type": "WITNESSPUBKEYHASH",
            "reqSigs": 1,
            "addresses": [
              "wc1qt6k4r0y0dw34x632exdz72xg4wdmasurll7j7u"
            ]
          }
        }
      ],
      "coinbase": false,
      "blockhash": null,
      "confirmations": 0,
      "time": 0,
      "blocktime": 0
    }
    

    Decodes raw transaction and provide chain info.

    Params

    # Name Default Description
    1 rawtx Required Raw transaction hex

    decodescript

    script='483045022100a00ee7b3f66cb730b1dcac558871add61fdd0b6505d074ff8750bf776893025002202091022864a5b9f1104c31f399e1855def6ac03cd1e981abe06b3bf5e7ec2143012102e054848255c88553a04cfae49c0bba95bf23243e61aa15e5a8c01cc918b19687';
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "decodescript",
        "params": [ "'$script'" ]
      }'
    
    script='483045022100a00ee7b3f66cb730b1dcac558871add61fdd0b6505d074ff8750bf776893025002202091022864a5b9f1104c31f399e1855def6ac03cd1e981abe06b3bf5e7ec2143012102e054848255c88553a04cfae49c0bba95bf23243e61aa15e5a8c01cc918b19687';
    
    wmcc cli rpc decodescript $script
    
    const script='483045022100a00ee7b3f66cb730b1dcac558871add61fdd0b6505d074ff8750bf776893025002202091022864a5b9f1104c31f399e1855def6ac03cd1e981abe06b3bf5e7ec2143012102e054848255c88553a04cfae49c0bba95bf23243e61aa15e5a8c01cc918b19687';
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('decodescript', [ script ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    {
      "asm": "3045022100a00ee7b3f66cb730b1dcac558871add61fdd0b6505d074ff8750bf776893025002202091022864a5b9f1104c31f399e1855def6ac03cd1e981abe06b3bf5e7ec214301 02e054848255c88553a04cfae49c0bba95bf23243e61aa15e5a8c01cc918b19687",
      "type": "NONSTANDARD",
      "reqSigs": 1,
      "addresses": [],
      "p2sh": "XCYUwwFSNj76UmQd2Hyrt1wTE499Q5xqv7"
    }
    

    Decodes raw transaction and provide chain info.

    Params

    # Name Default Description
    1 script Required Script hex

    sendrawtransaction

    rawtx='later';
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "sendrawtransaction",
        "params": [ "'$rawtx'" ]
      }'
    
    rawtx='later';
    
    wmcc cli rpc sendrawtransaction $rawtx
    
    const rawtx = 'later';
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('sendrawtransaction', [ rawtx ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    later
    

    Sends raw transaction without verification.

    Params

    # Name Default Description
    1 rawtx Required Raw transaction hex

    createrawtransaction

    txhash='later';
    txindex=1;
    amount=1;
    address='later';
    data='';
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "createrawtransaction",
        "params": [
          [{ "txid": "'$txhash'", "vout": "'$txindex'" }],
          { "'$address'": "'$amount'", "data": "'$data'" }
        ]
      }'
    
    txhash='later';
    txindex=1;
    amount=1;
    address='later';
    data='';
    
    wmcc cli rpc createrawtransaction \
      '[{ "txid": "'$txhash'", "vout": "'$txindex'" }]' \
      '{ "'$address'": "'$amount'", "data": "'$data'" }'
    
    const txhash = 'later';
    const txindex = 1;
    const amount = 1;
    const address = 'later';
    const data = '';
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const sendTo = {
        data: data
      };
      sendTo[address] = amount;
      const res = await rpc.execute('createrawtransaction', [ [{ txid: txhash, vout: txindex }], sendTo]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    later
    

    Creates raw, unsigned transaction without any formal verification.

    Params

    # Name Default Description
    1 outpoints Required Outpoint list
    1.1 txid Transaction Hash
    1.2 vout Transaction Outpoint Index
    1.3 sequence Sequence number for input
    2 sendto Required List of addresses with amounts that we are sending to
    2.1 address 0 address: amount key pairs
    2.2 data nullData Data output
    3 locktime Earliest time a transaction can be added

    signrawtransaction

    rawtx='later';
    txhash='later';
    txindex=1;
    scriptPubKey='later';
    amount=1;
    privkey='later';
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "signrawtransaction",
        "params": [
          "'$rawtx'",
          [{
            "txid": "'$txhash'",
            "vout": "'$txindex'",
            "scriptPubKey": "'$scriptPubKey'",
            "amount": "'$amount'"
          }],
          [ "'$privkey'" ]
        ]
      }'
    
    rawtx='later';
    txhash='later';
    txindex=1;
    scriptPubKey='later';
    amount=1;
    privkey='later';
    
    wmcc cli rpc signrawtransaction $rawtx \
      '[{ "txid": "'$txhash'", "vout": "'$txindex'", "scriptPubKey": "'$scriptPubKey'", "amount": "'$amount'" }]' \
      '[ "'$privkey'" ]'
    
    const rawtx = 'later';
    const txhash = 'later';
    const txindex = 1;
    const scriptPubKey = 'later';
    const amount = 1;
    const privkey = 'later';
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('signrawtransaction', [ rawtx,
        [{
          txid: txhash,
          vout: txindex,
          scriptPubKey: scriptPubKey,
          amount: amount
        }],
        [ privkey ]
      ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    later
    

    Signs raw transaction.

    Params

    # Name Default Description
    1 rawtx Required Raw tx
    2 inputs Required Coins you're going to spend
    2.1 txid Transaction Hash
    2.2 vout Transaction Outpoint Index
    2.3 scriptPubKey Script with pubkey you are going to sign
    2.4 redeemScript redeemScript if tx is P2SH
    3 privkeylist List of private keys
    4 sighashtype Type of signature hash

    gettxoutproof

    txhash='93820db11708782c947fe2fe34830616bb6cec52f9a032cf18c7e0ae58e47385';
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "gettxoutproof",
        "params": [ "'$txhash'" ]
      }'
    
    txhash='93820db11708782c947fe2fe34830616bb6cec52f9a032cf18c7e0ae58e47385';
    
    wmcc cli rpc gettxoutproof $txhash
    
    const txhash = '93820db11708782c947fe2fe34830616bb6cec52f9a032cf18c7e0ae58e47385';
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('gettxoutproof', [ txhash ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    "000000206235243ff1ef6c3dcfecb2654715256aa46cbe246513ee98d13c595bea0000008573e458aee0c718cf32a0f952ec6cbb16068334fee27f942c780817b10d82930c4e3f5afcff031ee6c7260001000000018573e458aee0c718cf32a0f952ec6cbb16068334fee27f942c780817b10d82930101"
    

    Checks if transactions are within block. Returns raw block.

    Params

    # Name Default Description
    1 txidlist Required Array of transaction hashes
    2 blockhash Based on TX Block hash

    verifytxoutproof

    proof='000000206235243ff1ef6c3dcfecb2654715256aa46cbe246513ee98d13c595bea0000008573e458aee0c718cf32a0f952ec6cbb16068334fee27f942c780817b10d82930c4e3f5afcff031ee6c7260001000000018573e458aee0c718cf32a0f952ec6cbb16068334fee27f942c780817b10d82930101';
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "verifytxoutproof",
        "params": [ "'$proof'" ]
      }'
    
    proof='000000206235243ff1ef6c3dcfecb2654715256aa46cbe246513ee98d13c595bea0000008573e458aee0c718cf32a0f952ec6cbb16068334fee27f942c780817b10d82930c4e3f5afcff031ee6c7260001000000018573e458aee0c718cf32a0f952ec6cbb16068334fee27f942c780817b10d82930101';
    
    wmcc cli rpc verifytxoutproof $proof
    
    const proof = '000000206235243ff1ef6c3dcfecb2654715256aa46cbe246513ee98d13c595bea0000008573e458aee0c718cf32a0f952ec6cbb16068334fee27f942c780817b10d82930c4e3f5afcff031ee6c7260001000000018573e458aee0c718cf32a0f952ec6cbb16068334fee27f942c780817b10d82930101';
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('verifytxoutproof', [ proof ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    [] later ** check this **
    

    Checks the proof for transaction inclusion.

    Params

    # Name Default Description
    1 proof Required Proof of transaction inclusion

    RPC Calls - Mining

    getnetworkhashps

    blocks=100;
    height=40000;
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "getnetworkhashps",
        "params": [ "'$blocks'", "'$height'" ]
      }'
    
    blocks=100;
    height=40000;
    
    wmcc cli rpc getnetworkhashps $blocks $height
    
    const blocks = 100;
    const height = 40000;
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getnetworkhashps', [ blocks, height ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    137203790586.74084
    

    Returns the estimated current or historical network hashes per second, based on last blocks.

    Params

    # Name Default Description
    1 blocks 120 Number of blocks to lookup
    2 height 1 Starting height for calculations

    getmininginfo

    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "getmininginfo",
        "params": []
      }'
    
    wmcc cli rpc getmininginfo
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getmininginfo', []);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    {
      "blocks": 40362,
      "currentblocksize": 0,
      "currentblockweight": 0,
      "currentblocktx": 0,
      "difficulty": 0,
      "errors": "",
      "genproclimit": 0,
      "networkhashps": 24046735192.49907,
      "pooledtx": 0,
      "testnet": false,
      "chain": "mainnet",
      "generate": false
    }
    

    Returns mining info.

    Params

    # Name Default Description
    None

    getwork

    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "getwork",
        "params": []
      }'
    
    wmcc cli rpc getwork
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getwork');
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    {
      "data": "200000000114a149005805d7815d010fd8fb72cea9b71962c4ee903e000b86d60000000092b433f3ca27bc115a243022a0687d9f129c032ef2d7e4e2d88375318fc40f3e5a9985c51b17c70000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000",
      "target": "00000000000000000000000000000000000000000000000000c7170000000000",
      "height": 40365
    }
    

    Returns hashing work to be solved by miner. Or submits solved block.

    Params

    # Name Default Description
    1 data Data to be submitted to the network.

    getworklp

    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "getworklp",
        "params": []
      }'
    
    # Because there is a request timeout set on CLI http requests
    # without manually adjusting the timeout, this call will timeout before the request is complete
    
    wmcc cli rpc getworklp
    
    # Because there is a request timeout set on CLI http requests
    # without manually adjusting the timeout, this call will timeout before the request is complete
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getworklp');
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    later *timeout*
    

    Returns hashing work to be solved by miner. Or submits solved block.

    Params

    # Name Default Description
    1 data Data to be submitted to the network.

    getblocktemplate

    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "getblocktemplate",
        "params": []
      }'
    
    wmcc cli rpc getblocktemplate
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getblocktemplate');
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    later *segwit*
    

    Returns block template or proposal for use with mining. Also validates proposal if mode is specified as proposal.

    Params

    # Name Default Description
    1 jsonrequestobject {} JSONRequestObject

    submitblock

    blockdata='1000002042c21ec39ff2fe5627cadccb74d5bd96f946d32e43f22966b94f77b47f060000e2838023c7111d8454129bcb334cbe5bb1aa54a6624c12516209bac4453be42ca48a3a5af0ff0f1e5e89030001010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff2402e803126d696e656420627920776d63635f636f72650457e3f57b080000000000000000ffffffff0300f2052a010000001600148dca4b88efee49e6756ba2ed09e1e27e994a679e0065cd1d000000001976a914456c9dc895ca8bc6e6bae8ca8f2a8a29018ca57d88ac0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90120000000000000000000000000000000000000000000000000000000000000000000000000';
    
    # Block data is old, so it should return error
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "submitblock",
        "params": [ "'$blockdata'" ]
      }'
    
    blockdata='1000002042c21ec39ff2fe5627cadccb74d5bd96f946d32e43f22966b94f77b47f060000e2838023c7111d8454129bcb334cbe5bb1aa54a6624c12516209bac4453be42ca48a3a5af0ff0f1e5e89030001010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff2402e803126d696e656420627920776d63635f636f72650457e3f57b080000000000000000ffffffff0300f2052a010000001600148dca4b88efee49e6756ba2ed09e1e27e994a679e0065cd1d000000001976a914456c9dc895ca8bc6e6bae8ca8f2a8a29018ca57d88ac0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90120000000000000000000000000000000000000000000000000000000000000000000000000';
    
    # Block data is old, so it should return error
    wmcc cli rpc submitblock $blockdata
    
    const blockdata = '1000002042c21ec39ff2fe5627cadccb74d5bd96f946d32e43f22966b94f77b47f060000e2838023c7111d8454129bcb334cbe5bb1aa54a6624c12516209bac4453be42ca48a3a5af0ff0f1e5e89030001010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff2402e803126d696e656420627920776d63635f636f72650457e3f57b080000000000000000ffffffff0300f2052a010000001600148dca4b88efee49e6756ba2ed09e1e27e994a679e0065cd1d000000001976a914456c9dc895ca8bc6e6bae8ca8f2a8a29018ca57d88ac0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90120000000000000000000000000000000000000000000000000000000000000000000000000';
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      // Block data is old, so it should return error
      const res = await rpc.execute('submitblock', [ blockdata ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    true
    

    Adds block to chain.

    Params

    # Name Default Description
    1 blockdata Required Mined block data (hex)

    setgenerate

    blockdata='1000002042c21ec39ff2fe5627cadccb74d5bd96f946d32e43f22966b94f77b47f060000e2838023c7111d8454129bcb334cbe5bb1aa54a6624c12516209bac4453be42ca48a3a5af0ff0f1e5e89030001010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff2402e803126d696e656420627920776d63635f636f72650457e3f57b080000000000000000ffffffff0300f2052a010000001600148dca4b88efee49e6756ba2ed09e1e27e994a679e0065cd1d000000001976a914456c9dc895ca8bc6e6bae8ca8f2a8a29018ca57d88ac0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90120000000000000000000000000000000000000000000000000000000000000000000000000';
    
    # Block data is old, so it should return error
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "verifyblock",
        "params": [ "'$blockdata'" ]
      }'
    
    blockdata='1000002042c21ec39ff2fe5627cadccb74d5bd96f946d32e43f22966b94f77b47f060000e2838023c7111d8454129bcb334cbe5bb1aa54a6624c12516209bac4453be42ca48a3a5af0ff0f1e5e89030001010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff2402e803126d696e656420627920776d63635f636f72650457e3f57b080000000000000000ffffffff0300f2052a010000001600148dca4b88efee49e6756ba2ed09e1e27e994a679e0065cd1d000000001976a914456c9dc895ca8bc6e6bae8ca8f2a8a29018ca57d88ac0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90120000000000000000000000000000000000000000000000000000000000000000000000000';
    
    # Block data is old, so it should return error
    wmcc cli rpc verifyblock $blockdata
    
    const blockdata = '1000002042c21ec39ff2fe5627cadccb74d5bd96f946d32e43f22966b94f77b47f060000e2838023c7111d8454129bcb334cbe5bb1aa54a6624c12516209bac4453be42ca48a3a5af0ff0f1e5e89030001010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff2402e803126d696e656420627920776d63635f636f72650457e3f57b080000000000000000ffffffff0300f2052a010000001600148dca4b88efee49e6756ba2ed09e1e27e994a679e0065cd1d000000001976a914456c9dc895ca8bc6e6bae8ca8f2a8a29018ca57d88ac0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90120000000000000000000000000000000000000000000000000000000000000000000000000';
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      // Block data is old, so it should return error
      const res = await rpc.execute('verifyblock', [ blockdata ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    true
    

    Verifies the block data.

    Params

    # Name Default Description
    1 blockdata Required Mined block data (hex)

    setgenerate

    mining=1;
    proclimit=1;
    
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "setgenerate",
        "params": [ "'$mining'", "'$proclimit'" ]
      }'
    
    mining=1;
    proclimit=1;
    
    wmcc cli rpc setgenerate $mining $proclimit
    
    const mining = 1;
    const proclimit = 1;
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('setgenerate', [ mining, proclimit ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    true
    

    Will start/stop the mining on CPU.

    Params

    # Name Default Description
    1 mining 0 Set to true will start mining, false will stop.
    2 proclimit 0

    getgenerate

    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "getgenerate",
        "params": []
      }'
    
    wmcc cli rpc getgenerate
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      const res = await rpc.execute('getgenerate');
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    true
    

    Returns status of mining on Node.

    Params

    # Name Default Description
    None

    generate

    numblocks=2;
    
    # Will return once all blocks are mined.
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "generate",
        "params": [ "'$numblocks'" ]
      }'
    
    numblocks=2;
    
    # Timeout error
    wmcc cli rpc generate $numblocks
    
    const numblocks = 2;
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      // Timeout error
      const res = await rpc.execute('generate', [ numblocks ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    later
    

    Mines numblocks number of blocks.

    Params

    # Name Default Description
    1 numblocks 1 Number of blocks to mine
    2 maxtries

    generatetoaddress

    numblocks=2;
    address='wc1qg0325qf07mysegu5qeuupf5zr38yrcsrkqhnav';
    
    # Will return once all blocks are mined.
    curl $url/ \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{
        "method": "generatetoaddress",
        "params": [ "'$numblocks'", "'$address'" ]
      }'
    
    numblocks=2;
    address='wc1qg0325qf07mysegu5qeuupf5zr38yrcsrkqhnav';
    
    # Timeout error
    wmcc cli rpc generatetoaddress $numblocks $address
    
    const numblocks = 2;
    const address = 'wc1qg0325qf07mysegu5qeuupf5zr38yrcsrkqhnav';
    
    const rpc = new Core.http.RPCClient({
      network: 'mainnet'
    });
    
    (async () => {
      // Timeout error
      const res = await rpc.execute('generate', [ numblocks ]);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    later
    

    Mines blocknumber blocks, with address as coinbase.

    Params

    # Name Default Description
    1 numblocks 1 Number of blocks to mine
    2 address Coinbase address for new blocks

    Coin

    Getting coin information via API.

    Get coin by Outpoint

    hash='93820db11708782c947fe2fe34830616bb6cec52f9a032cf18c7e0ae58e47385';
    index=0;
    
    curl $url/coin/$hash/$index
    
    hash='93820db11708782c947fe2fe34830616bb6cec52f9a032cf18c7e0ae58e47385';
    index=0;
    
    wmcc cli coin $hash $index
    
    const hash = '93820db11708782c947fe2fe34830616bb6cec52f9a032cf18c7e0ae58e47385';
    const index = 0;
    
    const client = new Core.http.Client({
      network: 'mainnet'
    });
    
    (async () => {
      await client.open();
    
      const coin = await client.getCoin(hash, index);
    
      console.log(coin);
    
      await client.close();
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    {
      "version": 1,
      "height": 3000,
      "value": 5000000000,
      "script": "00141e8adf6f166aceec5fc65080aa1f88a3a260dd10",
      "address": "wc1qr69d7mckdt8wch7x2zq258ug5w3xphgs2sxpwg",
      "coinbase": true,
      "hash": "93820db11708782c947fe2fe34830616bb6cec52f9a032cf18c7e0ae58e47385",
      "index": 0
    }
    

    Get coin by outpoint (hash and index). Returns coin in wmcc coin json format.

    HTTP Request

    GET /coin/:hash/:index

    URL Parameters

    # Parameter Description
    1 hash Hash of tx
    2 index Output's index in tx

    Get coins by address

    address='wc1qg0325qf07mysegu5qeuupf5zr38yrcsrkqhnav';
    
    curl $url/coin/address/$address
    
    address='wc1qg0325qf07mysegu5qeuupf5zr38yrcsrkqhnav';
    
    wmcc cli coin $address
    
    const address = 'wc1qg0325qf07mysegu5qeuupf5zr38yrcsrkqhnav';
    
    const client = new Core.http.Client({
      network: 'mainnet'
    });
    
    (async () => {
      await client.open();
    
      const coins = await client.getCoinsByAddress(address);
    
      console.log(coins);
    
      await client.close();
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    [
      {
        "version": 1,
        "height": 11508,
        "value": 4532376000,
        "script": "001443e2aa012ff6c90ca3940679c0a6821c4e41e203",
        "address": "wc1qg0325qf07mysegu5qeuupf5zr38yrcsrkqhnav",
        "coinbase": false,
        "hash": "1f99f3ea4e8f97428520436d63fc1f2f9a46e052d6cf798ba70881c76f016473",
        "index": 1
      },
      ...
    ]
    

    Get coin objects array by address.

    HTTP Request

    GET /coin/address/:address

    URL Parameters

    # Parameter Description
    1 address WMCC Address

    Get coins by addresses

    address0='wc1qg0325qf07mysegu5qeuupf5zr38yrcsrkqhnav';
    address1='wc1qp5mqu3axakk7rnv3egpacnh4a4pm9mm33p0pag';
    
    curl $url/coin/address \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{ "addresses":[ "'$address0'", "'$address1'" ]}'
    
    No CLI Option.
    
    const address0 = 'wc1qg0325qf07mysegu5qeuupf5zr38yrcsrkqhnav';
    const address1 = 'wc1qp5mqu3axakk7rnv3egpacnh4a4pm9mm33p0pag';
    
    const client = new Core.http.Client({
      network: 'mainnet'
    });
    
    (async () => {
      await client.open();
    
      const coins = await client.getCoinsByAddresses([address0, address1]);
    
      console.log(coins);
    
      await client.close();
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    [
      {
        "version": 1,
        "height": 11508,
        "value": 4532376000,
        "script": "001443e2aa012ff6c90ca3940679c0a6821c4e41e203",
        "address": "wc1qg0325qf07mysegu5qeuupf5zr38yrcsrkqhnav",
        "coinbase": false,
        "hash": "1f99f3ea4e8f97428520436d63fc1f2f9a46e052d6cf798ba70881c76f016473",
        "index": 1
      },
      {
        "version": 1,
        "height": 11218,
        "value": 4899986000,
        "script": "00140d360e47a6edade1cd91ca03dc4ef5ed43b2ef71",
        "address": "wc1qp5mqu3axakk7rnv3egpacnh4a4pm9mm33p0pag",
        "coinbase": false,
        "hash": "98c2faba6ad99ada7dca6f5fafed6cc52e6a63d63695015bd89d4b35a6b6e7e0",
        "index": 1
      }
    ]
    

    Get coins by addresses, returns array of coin objects.

    HTTP Request

    POST /coin/address

    POST Parameters (JSON)

    # Parameter Description
    1 addresses Array of WMCC Addresses

    Transaction

    Getting transaction information via API.

    Get tx by txhash

    txhash='93820db11708782c947fe2fe34830616bb6cec52f9a032cf18c7e0ae58e47385';
    
    curl $url/tx/$txhash
    
    txhash='93820db11708782c947fe2fe34830616bb6cec52f9a032cf18c7e0ae58e47385';
    
    wmcc cli tx $txhash
    
    const hash = '93820db11708782c947fe2fe34830616bb6cec52f9a032cf18c7e0ae58e47385';
    
    const client = new Core.http.Client({
      network: 'mainnet'
    });
    
    (async () => {
      await client.open();
    
      const tx = await client.getTX(txhash);
    
      console.log(tx);
    
      await client.close();
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    {
      "hash": "93820db11708782c947fe2fe34830616bb6cec52f9a032cf18c7e0ae58e47385",
      "witnessHash": "03fa0cc2887608d8e85b11b557f7794786bc823d402f563456a5e92993031a13",
      "fee": 0,
      "rate": 0,
      "mtime": 1516127377,
      "height": 3000,
      "block": "000002d3f7dbc79d1bbaff4cb76e77bc6c8df3728f0c1e419de86b8830056774",
      "time": 1514098188,
      "index": 0,
      "version": 1,
      "inputs": [
        {
          "prevout": {
            "hash": "0000000000000000000000000000000000000000000000000000000000000000",
            "index": 4294967295
          },
          "script": "02b80b126d696e656420627920776d63635f636f726504daddb6ac080000000000000000",
          "witness": "01200000000000000000000000000000000000000000000000000000000000000000",
          "sequence": 4294967295,
          "address": null
        }
      ],
      "outputs": [
        {
          "value": 5000000000,
          "script": "00141e8adf6f166aceec5fc65080aa1f88a3a260dd10",
          "address": "wc1qr69d7mckdt8wch7x2zq258ug5w3xphgs2sxpwg"
        },
        {
          "value": 500000000,
          "script": "76a914456c9dc895ca8bc6e6bae8ca8f2a8a29018ca57d88ac",
          "address": "WV17cxcpPmNNJYuFp7nkNoXJ75uZj11zTC"
        },
        {
          "value": 0,
          "script": "6a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf9",
          "address": null
        }
      ],
      "locktime": 0,
      "hex": "010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff2402b80b126d696e656420627920776d63635f636f726504daddb6ac080000000000000000ffffffff0300f2052a010000001600141e8adf6f166aceec5fc65080aa1f88a3a260dd100065cd1d000000001976a914456c9dc895ca8bc6e6bae8ca8f2a8a29018ca57d88ac0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90120000000000000000000000000000000000000000000000000000000000000000000000000"
    }
    

    Returns transaction objects by transaction hash.

    HTTP Request

    GET /tx/:txhash

    URL Parameters

    # Parameter Description
    1 txhash Hash of tx

    Get tx by address

    address='wc1qg0325qf07mysegu5qeuupf5zr38yrcsrkqhnav';
    
    curl $url/tx/address/$address
    
    address='wc1qg0325qf07mysegu5qeuupf5zr38yrcsrkqhnav';
    
    wmcc cli tx $address
    
    const address = 'wc1qg0325qf07mysegu5qeuupf5zr38yrcsrkqhnav';
    
    const client = new Core.http.Client({
      network: 'mainnet'
    });
    
    (async () => {
      await client.open();
    
      const txs = await client.getTXByAddress(address);
    
      console.log(txs);
    
      await client.close();
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    [
      {
        "hash": "1f99f3ea4e8f97428520436d63fc1f2f9a46e052d6cf798ba70881c76f016473",
        "witnessHash": "ab246207ebe4d139e2c8249ddecb59e833e683234193544b8b98e03f012d3fe3",
        "fee": 14000,
        "rate": 99290,
        "mtime": 1516128901,
        "height": 11508,
        "block": "0000003c98972eaf21a5e42b46de6db0baf388e6c637d51a3fece50f63faa2ee",
        "time": 1515440066,
        "index": 1,
        "version": 1,
        "inputs": [
          {
            "prevout": {
              "hash": "9084b8e5f47a907e5f64ab025d9b6e9b8d03f2cb5cb2f43d2dc38502ef489c3e",
              "index": 0
            },
            "script": "",
            "witness": "0247304402201fef4f614d9a3743a7ce1ea4fc08ea605a14f52a3b5500d3b1de855143f736c6022035bfb53e34d1f534f098a3b14b32cabb9b64c8b802c25a275a0c71f2e4d85506012102fc8a6976837630608b2fdcbc8528a43bfc10e1ab473ae65247f3a03d92135605",
            "sequence": 4294967295,
            "coin": {
              "version": 1,
              "height": 1365,
              "value": 5000000000,
              "script": "0014a1925e42c0ff25bebd156891ef0680f573fcffa7",
              "address": "wc1q5xf9uskqlujma0g4dzg77p5q74elela8jexdtz",
              "coinbase": true
            }
          }
        ],
        "outputs": [
          {
            "value": 467610000,
            "script": "00140469e2609ea55b89369b916ba740d8f394bd5c88",
            "address": "wc1qq357ycy754dcjd5mj946wsxc7w2t6hygxfg9ft"
          },
          {
            "value": 4532376000,
            "script": "001443e2aa012ff6c90ca3940679c0a6821c4e41e203",
            "address": "wc1qg0325qf07mysegu5qeuupf5zr38yrcsrkqhnav"
          }
        ],
        "locktime": 0,
        "hex": "010000000001013e9c48ef0285c32d3df4b25ccbf2038d9b6e9b5d02ab645f7e907af4e5b884900000000000ffffffff029029df1b000000001600140469e2609ea55b89369b916ba740d8f394bd5c88c091260e0100000016001443e2aa012ff6c90ca3940679c0a6821c4e41e2030247304402201fef4f614d9a3743a7ce1ea4fc08ea605a14f52a3b5500d3b1de855143f736c6022035bfb53e34d1f534f098a3b14b32cabb9b64c8b802c25a275a0c71f2e4d85506012102fc8a6976837630608b2fdcbc8528a43bfc10e1ab473ae65247f3a03d9213560500000000"
      },
      ...
    ]
    

    Returns transaction objects array by address.

    HTTP Request

    GET /tx/address/:address

    URL Parameters

    # Parameter Description
    1 address WMCC Address

    Get tx by addresses

    address0='wc1qg0325qf07mysegu5qeuupf5zr38yrcsrkqhnav';
    address1='wc1qp5mqu3axakk7rnv3egpacnh4a4pm9mm33p0pag';
    
     curl $url/tx/address \
      -H 'Content-Type: application/json' \
      -X POST \
      --data '{ "addresses":[ "'$address0'", "'$address1'" ]}'
    
    No CLI Option.
    
    const address0 = 'wc1qg0325qf07mysegu5qeuupf5zr38yrcsrkqhnav';
    const address1 = 'wc1qp5mqu3axakk7rnv3egpacnh4a4pm9mm33p0pag';
    
    const client = new Core.http.Client({
      network: 'mainnet'
    });
    
    (async () => {
      await client.open();
    
      const txs = await client.getTXByAddress([address0, address1]);
    
      console.log(txs);
    
      await client.close();
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    [
      ...,
      {
        "hash": "98c2faba6ad99ada7dca6f5fafed6cc52e6a63d63695015bd89d4b35a6b6e7e0",
        "witnessHash": "b7fe2d49e1e05b04929ecbbb444b5410dbea62f62f828f18ce68bf47e7ece6b6",
        "fee": 14000,
        "rate": 99290,
        "mtime": 1516128887,
        "height": 11218,
        "block": "00000011d493899de55b981f67151964cdf6486a92fc6b22b22384191447a0cb",
        "time": 1515382539,
        "index": 1,
        "version": 1,
        "inputs": [
          {
            "prevout": {
              "hash": "1134b445ebe98a890284ece292a8b63b8fc7cbb577fa086a05e2e09b2d64d23d",
              "index": 0
            },
            "script": "",
            "witness": "02473044022017187b9bdc387a65bae66bf5961e8acb6c514853654e694c734b9f761ed10c3802205b4f41524e5b29a93b093e4deff4d2cc0846310f0361a429c67efedfc9c82a67012102db24f4484b429ee9de01bc0e2d7a8d5945fafca8c8c986dd61eb49bd50443006",
            "sequence": 4294967295,
            "coin": {
              "version": 1,
              "height": 1254,
              "value": 5000000000,
              "script": "00148dca4b88efee49e6756ba2ed09e1e27e994a679e",
              "address": "wc1q3h9yhz80aey7vatt5tksnc0z06v55eu78dqwxt",
              "coinbase": true
            }
          }
        ],
        "outputs": [
          {
            "value": 100000000,
            "script": "00140469e2609ea55b89369b916ba740d8f394bd5c88",
            "address": "wc1qq357ycy754dcjd5mj946wsxc7w2t6hygxfg9ft"
          },
          {
            "value": 4899986000,
            "script": "00140d360e47a6edade1cd91ca03dc4ef5ed43b2ef71",
            "address": "wc1qp5mqu3axakk7rnv3egpacnh4a4pm9mm33p0pag"
          }
        ],
        "locktime": 0,
        "hex": "010000000001013dd2642d9be0e2056a08fa77b5cbc78f3bb6a892e2ec8402898ae9eb45b434110000000000ffffffff0200e1f505000000001600140469e2609ea55b89369b916ba740d8f394bd5c8850da0f24010000001600140d360e47a6edade1cd91ca03dc4ef5ed43b2ef7102473044022017187b9bdc387a65bae66bf5961e8acb6c514853654e694c734b9f761ed10c3802205b4f41524e5b29a93b093e4deff4d2cc0846310f0361a429c67efedfc9c82a67012102db24f4484b429ee9de01bc0e2d7a8d5945fafca8c8c986dd61eb49bd5044300600000000"
      },
      ...
    ]
    

    Returns transaction objects array by addresses.

    HTTP Request

    POST /tx/address

    POST Parameters (JSON)

    # Parameter Description
    1 addresses Array of WMCC Addresses

    Wallet Admin

    The _admin namespace exists to differentiate administrative level tasks on the wallet API that you probably don't want to expose to individual wallets.

    /wallet/_admin/[TARGET_ACTION]

    Wallet Rescan

    height = 40000;
    
    curl $url/wallet/_admin/rescan \
      -X POST \
      --data '{"height": '$height'}'
    
    height = 40000;
    
    wmcc cli rescan $height
    
    const height = 40000;
    
    const client = new Core.http.Client({
      network: 'mainnet'
    });
    
    (async () => {
      await client.rescan(height);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    Response Body:

    Rescanning...
    

    Initiates a blockchain rescan for the walletdb. Wallets will be rolled back to the specified height (transactions above this height will be unconfirmed).

    HTTP Request

    POST /wallet/_admin/rescan

    POST Parameters (JSON)

    # Parameter Description
    1 height Height of block to start rescan

    Wallet Resend

    curl $url/wallet/_admin/resend \
      -X POST
    
    wmcc cli resend
    
    const height = 40000;
    
    const client = new Core.http.Client({
      network: 'mainnet'
    });
    
    (async () => {
      await client.resend();
    })().catch((err) => {
      console.error(err.stack);
    });
    

    Response Body:

    Resending...
    

    Rebroadcast all pending transactions in all wallets.

    HTTP Request

    POST /wallet/_admin/resend

    POST Parameters (JSON)

    # Parameter Description
    None

    Wallet Backup

    path='./backup/my_wallet.ldb';
    
    curl $url/wallet/_admin/backup \
      -X POST \
      --data '{"path": "'$path'"}'
    
    path='./backup/my_wallet.ldb';
    
    wmcc cli backup $path
    
    const path = './backup/my_wallet.ldb';
    
    const client = new Core.http.Client({
      network: 'mainnet'
    });
    
    (async () => {
      await client.backup(path);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    Response Body:

    Backup complete.
    

    Safely backup the wallet database to specified path (creates a clone of the database).

    HTTP Request

    POST /wallet/_admin/backup

    POST Parameters (JSON)

    # Parameter Description
    1 path Path to backup wallet database

    List all Wallets

    curl $url/wallet/_admin/wallets
    
    wmcc cli wallets
    
    const client = new Core.http.Client({
      network: 'mainnet'
    });
    
    (async () => {
      const wallets = await client.getWallets();
    
      console.log(wallets);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    Response Body:

    [
      "primary",
      "my_wallet"
    ]
    

    List all wallet IDs. Returns an array of strings.

    HTTP Request

    GET /wallet/_admin/wallets

    Wallet

    Wallet Transactions

    Get Wallet TX Details

    id="my_wallet";
    hash="later";
    
    curl $url/wallet/$id/tx/$hash
    
    id="my_wallet";
    hash="later";
    
    wmcc cli wallet --id=$id tx $hash
    
    const id = "my_wallet";
    const hash = "later";
    
    const httpWallet = new Core.http.Wallet({
      id: id
    });
    
    (async () => {
      const res = await httpWallet.getTX(hash);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    later
    

    Get wallet transaction details.

    HTTP Request

    GET /wallet/:id/tx/:hash

    Request Parameters

    # Parameter Type Description
    1 id string Id of wallet that handled the transaction
    2 hash string Hash of the transaction to retrieve

    Delete Transaction

    id="my_wallet";
    hash="later";
    passphrase="later";
    
    curl $url/wallet/$id/tx/$hash \
      -X DELETE \
      --data '{"passphrase": "'$passphrase'"}'
    
    # Not available in CLI
    
    // Not available in javascript wallet client.
    

    Abandon single pending transaction. Confirmed transactions will throw an error. "TX not eligible"

    HTTP Request

    DEL /wallet/:id/tx/:hash

    Request Parameters

    # Parameter Type Description
    1 id string Id of wallet where the transaction is that you want to remove
    2 hash string Hash of transaction you would like to remove

    Get Wallet TX History

    id="my_wallet";
    
    curl $url/wallet/$id/tx/history
    
    id="my_wallet";
    
    wmcc cli wallet --id=$id history
    
    const id = "my_wallet";
    const account = 'default';
    
    const httpWallet = new Core.http.Wallet({
      id: id
    });
    
    (async () => {
      const res = await httpWallet.getHistory(account);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    later
    

    Get wallet TX history. Returns array of tx details.

    HTTP Request

    GET /wallet/:id/tx/history

    Request Parameters

    # Parameter Type Description
    1 id string Id of wallet to get history of

    Get Pending Transactions

    id="my_wallet";
    
    curl $url/wallet/$id/tx/unconfirmed
    
    id="my_wallet";
    
    wmcc cli wallet --id=$id pending
    
    const id = "my_wallet";
    const account = 'default';
    
    const httpWallet = new Core.http.Wallet({
      id: id
    });
    
    (async () => {
      const res = await httpWallet.getPending(account);
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    later
    

    Get pending wallet transactions. Returns array of tx details.

    HTTP Request

    GET /wallet/:id/tx/unconfirmed

    Request Parameters

    # Parameter Type Description
    1 id string Id of wallet to get pending/unconfirmed txs

    Get Range of Transactions

    id="my_wallet";
    account="default";
    start=later;
    end=later;
    
    curl $url/wallet/$id/tx/range?account=$account&start=$start&end=$end
    
    # Range not available in CLI yet
    
    const id = "my_wallet";
    const account = "default";
    const start = later;
    const end = later;
    
    const httpWallet = new Core.http.Wallet({
      id: id
    });
    
    (async () => {
      const res = await httpWallet.getRange(account, {start: start, end: end});
    
      console.log(res);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    later
    

    HTTP Request

    GET /wallet/:id/tx/range

    Request Parameters

    # Parameter Type Description
    1 id string Id of wallet to get history from

    Body Parameters

    # Parameter Type Description
    1 account string Account to get the tx history from
    2 start int Start time to get range from
    3 end int End time to get range from

    Wallet Accounts

    Account Object

    An account object looks like this:

    later
    
    

    Account belonging to a Wallet.

    Get Wallet Account List

    id='my_wallet';
    
    curl $url/wallet/$id/account
    
    id='my_wallet';
    
    wmcc cli wallet account list --id=$id
    
    const id = 'my_wallet';
    
    const client = new Core.http.Client({
      network: 'mainnet'
    });
    
    (async () => {
      await client.open();
      const info = await client.getAccounts(id);
    
      console.log(info);
    
      await client.close();
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    later
    

    List all account names (array indices map directly to bip44 account indices) associated with a specific wallet id.

    HTTP Request

    GET /wallet/:id/account

    Request Parameters

    # Parameter Type Description
    1 id string Id of wallet you would like to retrieve the account list for

    Get Account Information

    id='my_wallet';
    account='default';
    
    curl $url/wallet/$id/account/$account
    
    id='my_wallet';
    
    wmcc cli wallet --id=$id account get $account
    
    const id = 'my_wallet';
    const account = 'default';
    
    const client = new Core.http.Client({
      network: 'mainnet'
    });
    
    (async () => {
      await client.open();
      const info = await client.getAccount(id, account);
    
      console.log(info);
    
      await client.close();
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    later
    

    Get account info.

    HTTP Request

    GET /wallet/:id/account/:account

    Request Parameters

    # Parameter Type Description
    1 id string Id of wallet you would like to query
    2 account string Id of account you would to retrieve information for

    Create new wallet account

    id='my_wallet';
    account='new_account';
    type='multisig';
    
    curl $url/wallet/$id/account/$name \
      -X PUT \
      --data '{"type": "'$type"}'
    
    id='my_wallet';
    account='new_account';
    type='multisig';
    
    wmcc cli wallet --id=$id account create $name --type=$type --key=$accountKey
    
    const id = 'my_wallet';
    const account = 'default';
    const type = 'multisig';
    
    const httpWallet = new Core.http.Wallet({
      id: id
    });
    
    const options = {type: type};
    
    (async () => {
      const acc = await httpWallet.createAccount(account, options);
    
      console.log(acc);
    })().catch((err) => {
      console.error(err.stack);
    });
    

    The above command returns JSON "result" like this:

    later
    

    Create account with specified account name.

    HTTP Request

    PUT /wallet/:id/account/:name

    Request Parameters

    # Parameter Type Description
    1 id string Id of wallet you would like to query
    2 account string Name of account you would to create

    Options Parameters

    # Parameter Type Description
    1 witness bool Whether or not to act as segregated witness wallet account
    2 accountKey string The extended public key for the account. This is ignored for non watch only wallets. Watch only accounts can't accept private keys for import (or sign transactions)
    3 type string Type of key for that account ('multisig', 'pubkeyhash')
    4 m int For multisig accounts, the m value in m-of-n
    5 n int For multisig accounts, the n value in in m-of-n

    Wallet Events

    Errors