Activation Common Structures

activation_common_structuresstructuresactivation_common_structures

ActivationMode

Parameter Type Required Description
rpc string Native if running a native blockchain node, Electrum if using electrum servers or Light for ZHTLC coins.
rpc_data object Electrum or Light mode only. A standard ActivationRpcData object.
Show Example

Defines the activation mode for QTUM, BCH, UTXO & ZHTLC coins.

{
    "mode": {
        "rpc": "Electrum",
        "rpc_data": {
            "servers": [
                {
                    "url": "electrum1.cipig.net:10020"
                },
                {
                    "url": "electrum2.cipig.net:10020"
                }
            ]
        }
    },
}

ActivationRpcData

Contains information about electrum & lightwallet_d servers for coins being used in Electrum or Light mode.

Parameter Type Required Default Description
required_confirmations integer Confirmations to wait for steps in swap. Defaults to value in the coins file if not set.
requires_notarization boolean false For dPoW protected coins, a true value will wait for transactions to be notarised when doing swaps. Overrides value if set in coins file.
mode object QTUM, UTXO & ZHTLC coins only. A standard ActivationMode object.
zcash_params_path string ZHTLC coins only. Path to folder containing Zcash parameters. Defaults to standard location as defined in this guide
scan_blocks_per_iteration integer 1000 ZHTLC coins only. Sets the number of scanned blocks per iteration during BuildingWalletDb state.
scan_interval_ms integer 0 ZHTLC coins only. Sets the interval in milliseconds between iterations of BuildingWalletDb state.
tx_history boolean Enable transaction history scanning. When active, the Komodo DeFi Framework API will collect transaction history data for local storage, and allow use of the my_tx_history (v2) method.
min_addresses_number integer HD wallets only. Number of addresses to generate. If not specified, addresses will be generated up to path_to_address::address_index.
scan_policy string scan_if_new_wallet HD wallets only. Whether or not to scan for new addresses. Select from do_not_scan, scan_if_new_wallet or scan. Note that scan will result in multple requests to the Komodo DeFi API and may take some time to complete.
gap_limit integer 20 HD wallets only. The max number of empty addresses in a row. Transactions sent to an address outside the gap_limit, will not be identified when scanning.
path_to_address object HD wallets only. A standard AddressPath object.
get_balances boolean true If false, coin and token balances will not be returned in the response, and the response will be returned more quickly.

ActivationParams

The ActivationParams object defines additional parameters used for activation. These params may vary depending on the coin type.

Parameter Type Required Default Description
required_confirmations integer Confirmations to wait for steps in swap. Defaults to value in the coins file if not set.
requires_notarization boolean false For dPoW protected coins, a true value will wait for transactions to be notarised when doing swaps. Overrides value if set in coins file.
mode object QTUM, UTXO & ZHTLC coins only. A standard ActivationMode object.
zcash_params_path string ZHTLC coins only. Path to folder containing Zcash parameters. Defaults to standard location as defined in this guide
scan_blocks_per_iteration integer 1000 ZHTLC coins only. Sets the number of scanned blocks per iteration during BuildingWalletDb state.
scan_interval_ms integer 0 ZHTLC coins only. Sets the interval in milliseconds between iterations of BuildingWalletDb state.
tx_history boolean Enable transaction history scanning. When active, the Komodo DeFi Framework API will collect transaction history data for local storage, and allow use of the my_tx_history (v2) method.
min_addresses_number integer HD wallets only. Number of addresses to generate. If not specified, addresses will be generated up to path_to_address::address_index.
scan_policy string scan_if_new_wallet HD wallets only. Whether or not to scan for new addresses. Select from do_not_scan, scan_if_new_wallet or scan. Note that scan will result in multple requests to the Komodo DeFi API and may take some time to complete.
gap_limit integer 20 HD wallets only. The max number of empty addresses in a row. Transactions sent to an address outside the gap_limit, will not be identified when scanning.
path_to_address object HD wallets only. A standard AddressPath object.
get_balances boolean true If false, coin and token balances will not be returned in the response, and the response will be returned more quickly.

ActivationServers

Contains information electrum servers for coins being used in Electrum or Light mode.

Parameter Type Required Default Description
url string The URL and port for an electrum server.
ws_url string WSS only. The URL and port for an electrum server's WSS port.
protocol string TCP Transport protocol used to connect to the server. Options: TCP or SSL
disable_cert_verification boolean false If true, this disables server SSL/TLS certificate verification (e.g. for self-signed certificates). Use at your own risk!
Show Examples

ZHTLC Example

{
  "activation_params": {
    "mode": {
      "rpc": "Light",
      "rpc_data": {
        "electrum_servers": [
          {
            "url":"zombie.dragonhound.info:10133"
          }
        ],
        "light_wallet_d_servers": [
          "http://zombie.dragonhound.info:1443"
        ]
      },
      "sync_params": { 
          "height":  2528700
      }
    },
    "zcash_params_path": "/home/username/path_to/.zcash-params",
    "scan_blocks_per_iteration": 100,
    "scan_interval_ms": 200
  }
}

HD UTXO Activation (v2)

{
"activation_params": {
    "mode": {
        "rpc": "Electrum",
        "rpc_data": {
            "servers": [
                {
                    "url": "electrum2.cipig.net:10001"
                },
                {
                    "url": "electrum3.cipig.net:20001",
                    "ws_url": "electrum3.cipig.net:30001",
                    "protocol": "SSL"
                }
            ]
        }
    },
    "scan_policy": "scan_if_new_wallet",
    "priv_key_policy": {"type": "Trezor"},
    "min_addresses_number": 3,
    "gap_limit": 20
}
}

AddressInfo

The AddressInfo object includes the following items for a given address:

Parameter Type Required Description
balances object A standard BalanceInfo object. Not included in responses where get_balances is false
derivation_method object A standard DerivationMethod object
pubkey string The public key associated with the seed used to launch Komodo DeFi Framework
tickers array A list of tokens which were successfully activated. Only included in responses where get_balances is false
Show Examples

Example with balances

"bitcoincash:qrf5vpn78s7rjexrjhlwyzzeg7gw98k7t5qx64fztj": {
    "derivation_method": {
        "type": "Iguana"
    },
    "pubkey": "036879df230663db4cd083c8eeb0f293f46abc460ad3c299b0089b72e6d472202c",
    "balances": {
        "spendable": "0.11398301",
        "unspendable": "0.00001"
    }
}

Example without balances

"bitcoincash:qrf5vpn78s7rjexrjhlwyzzeg7gw98k7t5qx64fztj": {
    "derivation_method": {
        "type": "Iguana"
    },
    "pubkey": "036879df230663db4cd083c8eeb0f293f46abc460ad3c299b0089b72e6d472202c",
    "tickers": ["ASLP-SLP"]
}

CoinProtocol

Parameter Type Required Description
type integer One of the Coin Types supported by the Komodo DeFi Framework
protocol_data object A standard CoinProtocolData object.

CoinProtocolData

Parameter Type Required Description
platform string Indicates the platform parent coin for EMV-like protocols, or the coin used for lightning nodes.
network string Either mainnet or testnet
confirmation_targets object A standard ConfirmationTargets object.

CoinNode

The CoinNode object includes the following items for a given coin or token:

Parameter Type Required Default Description
url string URL of an RPC node
komodo_auth boolean false Must be set to true to access RPC nodes run behind komodo-defi-proxy
Show Example
{
    "url": "https://nucleus-rpc.alpha.komodo.earth",
    "komodo_proxy": true
}

SwapV2Contracts

The SwapV2Contracts object includes the following items for a given coin or token:

Parameter Type Required Default Description
ticker string Ticker of the token to be enabled
required_confirmations integer 3 How many confirmations to wait during the transaction steps of an atomic swap. Overwrites value in coins file
Show Example
{
      "maker_swap_v2_contract": "0x9130b257D37A52E52F21054c4DA3450c72f595CE",
      "taker_swap_v2_contract": "0x9130b257D37A52E52F21054c4DA3450c72f595CE",
      "nft_maker_swap_v2_contract": "0x9130b257D37A52E52F21054c4DA3450c72f595CE"
}

TokenActivationParams

Standard object structure used in token activation methods for specifying activation parameters.

Parameter Type Required Description
required_confirmations integer Confirmations to wait for steps in swap. Defaults to value in coins file if not set.

TokensRequest

The TokensRequest object includes the following items for a given coin or token:

Parameter Type Required Default Description
ticker string Ticker of the token to be enabled
required_confirmations integer 3 How many confirmations to wait during the transaction steps of an atomic swap. Overwrites value in coins file
Show Example
{
    "ticker": "MINDS-ERC20",
    "required_confirmations": 4
}

UtxoMergeParams

The UtxoMergeParams object defines how often and at which thresholds to merge UTXOs. This is useful for wallets which have been used for a long time, and have many small UTXOs from mining activity.

Parameter Type Required Description
merge_at integer Mamimum UTXO count before merge loop is initiated.
check_every integer How frequently (in blocks) the wallet UTXO count is evaluated.
max_merge_at_once integer The maximum nouber of UTXOs to inlude as inputs for a merge transaction. Note that more input UTXOs means a larger transaction and greater fees, and that each blockchain has a limit to the maximum size of a transaction.
Show Example
{
"merge_at": 50,
"check_every": 10,
"max_merge_at_once": 25
}