On this page

latest contributor to this doc

Last Edit:

@gcharang

enable_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.

ParameterTypeDescription
tickerstringTicker of the platform protocol coin. Options: BCH or tBCH
bchd_urlsarray of stringsA 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/.
modeobjectA standard ActivationMode object.
tx_historybooleanIf true, spawns a background loop to store the local cache of address(es) transactions. Defaults to false.
slp_tokens_requestsarray of objectsA list of standard TokensRequest objects.
address_formatobjectOptional. Overwrites the address format from coins file, if set. A standard AddressFormat object.
allow_slp_unsafe_confbooleanOptional, defaults to false. If 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_balancesbooleanOptional, defaults to true. If false, coin and token balances will not be returned in the response, and the response will be returned more quickly.
required_confirmationsintegerOptional, defaults to value in the coins file, or 3 if not set. Confirmations to wait for steps in swap.
requires_notarizationbooleanOptional, defaults to true. Has no effect on BCH.
tx_historybooleanOptional, defaults to true. If 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_paramsobjectA standard UtxoMergeParams object. Used to reduce a wallet's UTXO count in cases where it is causing significantly slower RPC responses.

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

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
    }
  }
}

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
      }
    ]
  }
}