Task: Z Coin Activation
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.
Refer to the task managed activation overview for activation of other coin types.
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
- Broadcast the transaction with send_raw_transaction
ZHTLC coins are not compatible with the v2 my_tx_history and legacy my_tx_history methods. To get the transaction history for ZHTLC coins, you need to use the z_coin_tx_history method.
To enable Z coins you also need to install some Zcash Params
Structure | Type | Description |
---|---|---|
ticker | string | Ticker of coin to activate |
activation_params | object | A standard ActivationRpcData object. |
Structure | Type | Description |
---|---|---|
task_id | integer | An identifying number which is used to query task status. |
task::enable_z_coin::init
{
"userpass": "RPC_UserP@SSW0RD",
"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:10133"
},
{
"url": "zombie.dragonhound.info:20133",
"protocol": "SSL",
"ws_url": "zombie.dragonhound.info:30059"
}
],
"light_wallet_d_servers": [
"http://zombie.dragonhound.info:1443"
]
}
},
"zcash_params_path": "/home/username/path_to/.zcash-params",
"scan_blocks_per_iteration": 100,
"scan_interval_ms": 200
}
}
}
task::enable_z_coin::init
{
"userpass": "RPC_UserP@SSW0RD",
"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: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
}
}
}
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
task::enable_z_coin::init
{
"userpass": "RPC_UserP@SSW0RD",
"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:10133"
},
{
"url": "zombie.dragonhound.info:20133",
"protocol": "SSL",
"ws_url": "zombie.dragonhound.info:30059"
}
],
"light_wallet_d_servers": [
"http://zombie.dragonhound.info:1443"
],
"sync_params": "earliest"
}
},
"zcash_params_path": "/home/username/path_to/.zcash-params",
"scan_blocks_per_iteration": 100,
"scan_interval_ms": 200
}
}
}
task::enable_z_coin::init
{
"userpass": "RPC_UserP@SSW0RD",
"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:1443"
],
"sync_params": {
"date": 1672704000
}
}
}
}
}
}
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.
Parameter | Type | Description |
---|---|---|
task_id | integer | The identifying number returned when initiating the initialisation process. |
forget_if_finished | boolean | If false , will return final response for completed tasks. Optional, defaults to true |
Parameter | Type | Description |
---|---|---|
status | string | A short indication of how the enabling is progressing. |
details | object | Depending on the state of enabling progress, this will contain different information as shown in the responses below. |
Possible status
values while activation is in progress:
ActivatingCoin
: The first step of activation. It does not require any action from the user.RequestingWalletBalance
: The first step of activation, while initial balances info is being requested. It does not require any action from the user.Finishing
: Activation process completedWaitingForTrezorToConnect
: Waiting for the user to plugin a Trezor deviceFollowHwDeviceInstructions
: Waiting for the user to follow the instructions on the device
Once complete, status
will be Ok
, and the details
object will have the following structure:
Parameter | Type | Description |
---|---|---|
current_block | integer | Block height of the coin being activated |
ticker | string | Ticker of the coin being activated. |
wallet_balance | object | A standard WalletBalanceInfo object. Note: the structure may vary based on the get_balances parameter value in the activation request. |
task::enable_z_coin::status
{
"userpass": "RPC_UserP@SSW0RD",
"method": "task::enable_z_coin::status",
"mmrpc": "2.0",
"params": {
"task_id": 0,
"forget_if_finished": false
}
}
If the task::enable_z_coin::status
returns UserActionRequired
, we need to use the task::enable_z_coin::user_action
method to enter our PIN
Parameter | Type | Description |
---|---|---|
task_id | integer | The identifying number returned when initiating the initialisation process. |
user_action | object | Object containing the params below |
user_action.action_type | string | Will be TrezorPin for this method |
user_action.pin | string (number) | When the Trezor device is displaying a grid of numbers for PIN entry, this param will contain your Trezor pin, as mapped through your keyboard numpad. See the image below for more information. |
Parameter | Type | Description |
---|---|---|
result | string | The outcome of the request. |
task::enable_z_coin::user_action
{
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "task::enable_z_coin::user_action",
"params": {
"task_id": 3,
"user_action": {
"action_type": "TrezorPin",
"pin": "862743"
}
}
}
If you want to cancel the enabling process before it has completed, you can use this method.
Structure | Type | Description |
---|---|---|
task_id | integer | The identifying number returned when initiating the enabling process. |
Structure | Type | Description |
---|---|---|
result | string | Indicates task cancellation was succesful. |
error | string | An error message to explain what went wrong. |
error_path | string | An indicator of the class or function which reurned the error. |
error_trace | string | An indicator of where in the source code the error was thrown. |
error_type | string | An enumerated value for the returned error. |
error_data | string | The input task ID which resulted in the error. |
task::enable_z_coin::cancel
{
"userpass": "RPC_UserP@SSW0RD",
"method": "task::enable_z_coin::cancel",
"mmrpc": "2.0",
"params": {
"task_id": 3
}
}