On this page

latest contributor to this doc

Last Edit:

@smk762

Enable BCH with Tokens

deprecatedenable_bch_with_tokens

The Komodo DeFi Framework supports Bitcoin Cash SLP tokens. Using this method, you can enable BCH/tBCH along with multiple SLP tokens in a single command.

This activation method is deprecated, and no longer in use. BCH activation should be done via task::enable_bch::init

ParameterTypeRequiredDefaultDescription
bchd_urlsarray of strings-A list of BCHD gRPC API server URLs, used for validation of SLP token transactions. It's recommended to add as many servers as possible. The URLs list can be found at https://bchd.fountainhead.cash/.
modeobject-A standard ActivationMode object.
slp_tokens_requestsarray of objects-A list of standard TokensRequest objects.
tickerstring-Ticker of the platform protocol coin.
address_formatobject-Overwrites the address format from coins file, if set. A standard AddressFormat object.
allow_slp_unsafe_confbooleanfalseIf true, allows bchd_urls to be empty. Warning: it is highly unsafe to do so as it may lead to invalid SLP transactions generation and tokens burning.
get_balancesbooleantrueIf false, coin and token balances will not be returned in the response, and the response will be returned more quickly.
required_confirmationsinteger3Confirmations to wait for steps in swap. Defaults to value in the coins file if not set.
requires_notarizationbooleantrueHas no effect on BCH.
tx_historybooleanfalseIf true the Komodo DeFi Framework API will preload transaction history as a background process. Must be set to true to use the my_tx_history method.
utxo_merge_paramsobject-A standard UtxoMergeParams object. Used to reduce a wallet's UTXO count in cases where it is causing significantly slower RPC responses.

ParameterTypeDescription
bch_addresses_infosobjectA standard AddressInfo object. Note: the structure may vary based on the value of the get_balances parameter.
current_blockintegerBlock height of the coin being activated.
slp_addresses_infosobjectA standard AddressInfo object. Note: the structure may vary based on the value of the get_balances parameter.

Enable BCH with Tokens (with tx_history, cashaddress format, and utxo merging)

POST
enable_bch_with_tokens
{
  "userpass": "RPC_UserP@SSW0RD",
  "method": "enable_bch_with_tokens",
  "mmrpc": "2.0",
  "params": {
    "ticker": "BCH",
    "allow_slp_unsafe_conf": false,
    "bchd_urls": [
      "https://bchd.dragonhound.info"
    ],
    "mode": {
      "rpc": "Electrum",
      "rpc_data": {
        "servers": [
          {
            "url": "bch.imaginary.cash:50002",
            "protocol": "SSL"
          },
          {
            "url": "cashnode.bch.ninja:50002",
            "protocol": "SSL"
          },
          {
            "url": "electrum3.cipig.net:20055",
            "protocol": "SSL"
          }
        ]
      }
    },
    "tx_history": true,
    "slp_tokens_requests": [
      {
        "ticker": "ASLP-SLP",
        "required_confirmations": 4
      }
    ],
    "required_confirmations": 5,
    "requires_notarization": false,
    "address_format": {
      "format": "cashaddress",
      "network": "bitcoincash"
    },
    "utxo_merge_params": {
      "merge_at": 50,
      "check_every": 10,
      "max_merge_at_once": 25
    }
  }
}

Enable BCH with Tokens (get_balances false)

POST
enable_bch_with_tokens
{
  "userpass": "RPC_UserP@SSW0RD",
  "method": "enable_bch_with_tokens",
  "mmrpc": "2.0",
  "params": {
    "ticker": "BCH",
    "allow_slp_unsafe_conf": false,
    "bchd_urls": [
      "https://bchd.dragonhound.info"
    ],
    "mode": {
      "rpc": "Electrum",
      "rpc_data": {
        "servers": [
          {
            "url": "bch.imaginary.cash:50002",
            "protocol": "SSL"
          },
          {
            "url": "cashnode.bch.ninja:50002",
            "protocol": "SSL"
          },
          {
            "url": "electrum3.cipig.net:20055",
            "protocol": "SSL"
          }
        ]
      }
    },
    "tx_history": true,
    "get_balances": false,
    "slp_tokens_requests": [
      {
        "ticker": "ASLP-SLP",
        "required_confirmations": 4
      }
    ]
  }
}