latest contributor to this doc

Last Edit: @smk762 ,

ZHTLC Coin Methods

ZHTLC coins, like Pirate (ARRR) and the test coin ZOMBIE take a little longer to enable, and use a new two step method to enable. Activation can take a little while the first time, as we need to download some block cache data, and build a wallet database. Subsequent enabling will be faster, but still take a bit longer than other coins. The second step for activation is optional, but allows us to check the status of the activation process.

To withdraw ZHTLC coins, you need to use the task::withdraw methods:

  • Generate a transaction with task::withdraw::init
  • Query its status with task::withdraw::status
  • Cancel generating the transaction with task::withdraw::cancel
API-v2task::enable_z_coin::init

To enable Z coins you also need to install some Zcash Params

StructureTypeDescription
tickerstringTicker of coin to activate
activation_paramsobjectA standard ActivationRpcData object.

StructureTypeDescription
task_idintegerAn identifying number which is used to query task status.

Initialize Z Coin Activation

POST
task::enable_z_coin::init
{
  "userpass": "testpsw",
  "method": "task::enable_z_coin::init",
  "mmrpc": "2.0",
  "params": {
    "ticker": "ZOMBIE",
    "activation_params": {
      "mode": {
        "rpc": "Light",
        "rpc_data": {
          "electrum_servers": [
            {
              "url": "zombie.dragonhound.info:10033"
            }
          ],
          "light_wallet_d_servers": [
            "http://zombie.dragonhound.info:443"
          ]
        }
      },
      "zcash_params_path": "/home/username/path_to/.zcash-params",
      "scan_blocks_per_iteration": 100,
      "scan_interval_ms": 200
    }
  }
}

Initialize Z Coin Activation

POST
task::enable_z_coin::init
{
  "userpass": "testpsw",
  "method": "task::enable_z_coin::init",
  "mmrpc": "2.0",
  "params": {
    "ticker": "ZOMBIE",
    "activation_params": {
      "mode": {
        "rpc": "Light",
        "rpc_data": {
          "electrum_servers": [
            {
              "url": "zombie.dragonhound.info:10033"
            }
          ],
          "light_wallet_d_servers": [
            "http://zombie.dragonhound.info:443"
          ],
          "sync_params": {
            "height": 2528700
          }
        }
      },
      "zcash_params_path": "/home/username/path_to/.zcash-params",
      "scan_blocks_per_iteration": 100,
      "scan_interval_ms": 200
    }
  }
}

The Z coin lightwallet client only supports blocks that are post-sapling. The sapling activation height for Z coins can be found in the coins file

Initialize Z Coin Activation

POST
task::enable_z_coin::init
{
  "userpass": "testpsw",
  "method": "task::enable_z_coin::init",
  "mmrpc": "2.0",
  "params": {
    "ticker": "ZOMBIE",
    "activation_params": {
      "mode": {
        "rpc": "Light",
        "rpc_data": {
          "electrum_servers": [
            {
              "url": "zombie.dragonhound.info:10033"
            }
          ],
          "light_wallet_d_servers": [
            "http://zombie.dragonhound.info:443"
          ],
          "sync_params": "earliest"
        }
      },
      "zcash_params_path": "/home/username/path_to/.zcash-params",
      "scan_blocks_per_iteration": 100,
      "scan_interval_ms": 200
    }
  }
}

Initialize Z Coin Activation

POST
task::enable_z_coin::init
{
  "userpass": "testpsw",
  "method": "task::enable_z_coin::init",
  "mmrpc": "2.0",
  "params": {
    "ticker": "ZOMBIE",
    "activation_params": {
      "mode": {
        "rpc": "Light",
        "rpc_data": {
          "electrum_servers": [
            {
              "protocol": "SSL",
              "url": "zombie.dragonhound.info:20133",
              "ws_url": "zombie.dragonhound.info:30059"
            }
          ],
          "light_wallet_d_servers": [
            "http://zombie.dragonhound.info:443"
          ],
          "sync_params": {
            "date": 1672704000
          }
        }
      }
    }
  }
}
API-v2task::enable_z_coin::status

Z coins need to build sync a local block cache and wallet database before they can be used. Using task_id as an input, this method will return the current status of the activation process.

ParameterTypeDescription
task_idintegerThe identifying number returned when initiating the initialisation process.
forget_if_finishedbooleanIf false, will return final response for completed tasks. Optional, defaults to true

StructureTypeDescription
statusstringA short indication of how the enabling is progressing.
detailsobjectDepending on the state of enabling progress, this will contain different information as shown in the responses below.

Activation Status

POST
task::enable_z_coin::status
{
  "userpass": "testpsw",
  "method": "task::enable_z_coin::status",
  "mmrpc": "2.0",
  "params": {
    "task_id": 0,
    "forget_if_finished": false
  }
}
API-v2task::enable_z_coin::cancel

If you want to cancel the enabling process before it has completed, you can use this method.

StructureTypeDescription
task_idintegerThe identifying number returned when initiating the enabling process.

StructureTypeDescription
resultstringIndicates task cancellation was succesful.
errorstringAn error message to explain what went wrong.
error_pathstringAn indicator of the class or function which reurned the error.
error_tracestringAn indicator of where in the source code the error was thrown.
error_typestringAn enumerated value for the returned error.
error_datastringThe input task ID which resulted in the error.

Cancel Initialization

POST
task::enable_z_coin::cancel
{
  "userpass": "testpsw",
  "method": "task::enable_z_coin::cancel",
  "mmrpc": "2.0",
  "params": {
    "task_id": "<TASK_ID>"
  }
}
API-v2z_coin_tx_history

To get the transaction history for ZHTLC coins, you need to use this special method - the v2 my_tx_history and legacy my_tx_history methods are not compatible with ZHTLC coins. Currently trasaction memos will not be displayed in output, though they can be added to outgoing transactions with the task::withdraw methods.

StructureTypeDescription
coinstringTicker of the coin to get history for.
limitintegerOptional. Limits the number of returned transactions. Defaults to 10. Ignored if max = true.
paging_options.FromIdstringOptional. AtomicDEX API will skip records until it reaches this ID, skipping the from_id as well; track the internal_id of the last displayed transaction to find the value of this field for the next page
paging_options.PageNumberintegerOptional. AtomicDEX API will return limit swaps from the selected page. Ignored if FromId .

StructureTypeDescription
transactionsarray of objectstransactions data
from_idstringthe from_id specified in the request; this value is null if from_id was not set
skippednumberthe number of skipped records (i.e. the position of from_id in the list + 1); this value is 0 if from_id was not set
limitnumberthe limit that was set in the request; note that the actual number of transactions can differ from the specified limit (e.g. on the last page)
totalnumberthe total number of transactions available
page_numbernumberthe page_number that was set in the request
total_pagesnumbertotal pages available with the selected limit
current_blocknumberthe number of the latest block of coin blockchain
sync_statusobjectA standard SyncStatus object. Provides the information that helps to track the progress of transaction history preloading at background

Z Coin Transaction History

POST
z_coin_tx_history
{
  "userpass": "testpsw",
  "method": "z_coin_tx_history",
  "mmrpc": "2.0",
  "params": {
    "coin": "ARRR",
    "limit": 2,
    "paging_options": {
      "PageNumber": 2
    }
  }
}