Task: Tendermint Activation

task::enable_tendermint::initAPI-v2task::enable_tendermint::init

Use this method for task managed activation of Tendermint coins & tokens. Refer to the task managed activation overview for activation of other coin types.

Arguments

Parameter Type Required Default Description
ticker string Ticker of the platform protocol coin. Options: ATOM, IRIS, OSMOSIS
mm2 integer Required if not set in coins file. Informs the Komodo DeFi Framework API whether or not the coin is expected to function. Accepted values are 0 or 1
tokens_params array of objects A list of standard TokensRequest objects.
nodes array of objects A list of CoinNode objects.
priv_key_policy string ContextPrivKey Value can be ContextPrivKey,Trezor when Komodo DeFi Framework is built for native platforms. value can be ContextPrivKey, Trezor, Metamask when the Komodo DeFi Framework is built targeting wasm
tx_history boolean false 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
required_confirmations integer 3 When the platform coin is involved, the number of confirmations for the Komodo DeFi Framework API to wait during the transaction steps of an atomic swap
requires_notarization boolean false If true, coins protected by Komodo Platform's dPoW security will wait for a notarization before progressing to the next atomic swap transactions step.
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.

Response

Parameter Type Required Description
task_id integer An identifying number which is used to query task status.

📌 Examples

Activation in Trezor mode

POST task::enable_tendermint::init
{
  "userpass": "RPC_UserP@SSW0RD",
  "mmrpc": "2.0",
  "method": "task::enable_tendermint::init",
  "params": {
    "ticker": "IRIS",
    "tokens_params": [
      {
        "ticker": "ATOM-IBC_IRIS"
      }
    ],
    "nodes": [
      {
        "url": "https://iris-rpc.alpha.komodo.earth/",
        "api_url": "https://iris-api.alpha.komodo.earth/",
        "grpc_url": "https://iris-grpc.alpha.komodo.earth/",
        "ws_url": "wss://iris-rpc.alpha.komodo.earth/websocket"
      },
      {
        "url": "https://rpc.irishub-1.irisnet.org"
      }
    ]
  }
}
Show Response

Response

{
  "mmrpc": "2.0",
  "result": {
    "task_id": 2
  },
  "id": null
}

task::enable_tendermint::statusAPI-v2task::enable_tendermint::status

After running the task::enable_tendermint::init method, we can query the status of activation to check its progress. The response will return the following:

  • Result of the task (success or error)
  • Progress status (what state the task is in)
  • Required user action (what user should do before the task can continue)

Arguments

Parameter Type Required Default Description
task_id integer The identifying number returned when initiating the initialisation process.
forget_if_finished boolean true If false, will return final response for completed tasks.

Command

POST task::enable_tendermint::status
{
  "userpass": "RPC_UserP@SSW0RD",
  "mmrpc": "2.0",
  "method": "task::enable_tendermint::status",
  "params": {
    "task_id": 0,
    "forget_if_finished": false
  }
}

Response

Parameter Type Required Description
current_block integer Block height of the coin being activated
ticker string Ticker of the platform protocol coin, as input in the request.
address string An address for the activated coin
balance object Only returned when get_balances is true. A standard BalanceInfos object.
tokens_balances array of objects Only returned when get_balances is true. A list of standard AddressInfo objects, one for each token.
tokens_tickers array Only returned when get_balances is false. A list of each token which was activated.

| | | |

Show Response
{
  "mmrpc": "2.0",
  "result": {
      "status": "Ok",
      "details": {
          "ticker": "IRIS",
          "address": "iaa1p8t6fh9tuq5c9mmnlhuuwuy4hw70cmpdcs8sc6",
          "current_block": 29775307,
          "balance": {
              "spendable": "0",
              "unspendable": "0"
          },
          "tokens_balances": {
              "ATOM-IBC_IRIS": {
                  "spendable": "0",
                  "unspendable": "0"
              }
          }
      }
  },
  "id": null
}

Response (in progress)

ParameterTypeDescription
statusstringWill return InProgress if task is not yet comepleted
detailsstringAn indication of the current step of the activation process
Show Response
{
  "mmrpc": "2.0",
  "result": {
    "status": "InProgress",
    "details": "RequestingWalletBalance"
  },
  "id": null
}
Show Errors

Error Types

StructureTypeDescription
CoinProtocolParseErrorstringParsing the protocol of the platform coin you are trying to activate failed
InternalErrorstringThe request was failed due to an Komodo DeFi Framework API internal error
PlatformCoinCreationErrorstringThere was an error when trying to activate the platform coin
PlatformConfigIsNotFoundstringConfig of the platform coin you are trying to activate is not found
PlatformIsAlreadyActivatedstringThe platform coin you are trying to activate is already activated
PrivKeyNotAllowedstringThe privkey is not allowed
TokenConfigIsNotFoundstringConfig of the token you are trying to activate is not found
TokenProtocolParseErrorstringParsing the protocol of the token you are trying to activate failed
TransportstringThe request was failed due to a network error
UnexpectedDerivationMethodstringThe derivation method used is unexpected
UnexpectedPlatformProtocolstringUnexpected platform protocol found for the platform coin you are trying to activate
UnexpectedTokenProtocolstringUnexpected protocol is found in the config of the token you are trying to activate

PlatformConfigIsNotFound Error

{
  "mmrpc": "2.0",
  "error": "Platform WALDO config is not found",
  "error_path": "platform_coin_with_tokens.prelude",
  "error_trace": "platform_coin_with_tokens:302] prelude:79]",
  "error_type": "PlatformConfigIsNotFound",
  "error_data": "WALDO",
  "id": null
}

PlatformIsAlreadyActivated Error

{
  "mmrpc": "2.0",
  "error": "IRIS",
  "error_path": "platform_coin_with_tokens",
  "error_trace": "platform_coin_with_tokens:297]",
  "error_type": "PlatformIsAlreadyActivated",
  "error_data": "IRIS",
  "id": null
}

CoinProtocolParseError

{
  "mmrpc": "2.0",
  "error": "Platform coin IRIS protocol parsing failed: invalid type: null, expected adjacently tagged enum CoinProtocol",
  "error_path": "platform_coin_with_tokens.prelude",
  "error_trace": "platform_coin_with_tokens:302] prelude:82]",
  "error_type": "CoinProtocolParseError",
  "error_data": {
    "ticker": "IRIS",
    "error": "invalid type: null, expected adjacently tagged enum CoinProtocol"
  },
  "id": null
}

UnexpectedPlatformProtocol Error

{
  "mmrpc": "2.0",
  "error": "Unexpected platform protocol BCH { slp_prefix: \"simpleledger\" } for BCH",
  "error_path": "platform_coin_with_tokens.prelude.tendermint_with_assets_activation",
  "error_trace": "platform_coin_with_tokens:302] prelude:90] tendermint_with_assets_activation:92]",
  "error_type": "UnexpectedPlatformProtocol",
  "error_data": {
    "ticker": "BCH",
    "protocol": {
      "type": "BCH",
      "protocol_data": {
        "slp_prefix": "simpleledger"
      }
    }
  },
  "id": null
}

TokenConfigIsNotFound Error

{
  "mmrpc": "2.0",
  "error": "Token GALT config is not found",
  "error_path": "platform_coin_with_tokens.prelude",
  "error_trace": "platform_coin_with_tokens:314] platform_coin_with_tokens:109] prelude:79]",
  "error_type": "TokenConfigIsNotFound",
  "error_data": "GALT",
  "id": null
}

TokenProtocolParseError Error

{
  "mmrpc": "2.0",
  "error": "Token BABYDOGE-BEP20 protocol parsing failed: unknown variant `WOOF`, expected one of `UTXO`, `QTUM`, `QRC20`, `ETH`, `ERC20`, `SLPTOKEN`, `BCH`, `TENDERMINT`, `TENDERMINTTOKEN`, `LIGHTNING`, `SOLANA`, `SPLTOKEN`, `ZHTLC`",
  "error_path": "platform_coin_with_tokens.prelude",
  "error_trace": "platform_coin_with_tokens:314] platform_coin_with_tokens:109] prelude:82]",
  "error_type": "TokenProtocolParseError",
  "error_data": {
    "ticker": "BABYDOGE-BEP20",
    "error": "unknown variant `WOOF`, expected one of `UTXO`, `QTUM`, `QRC20`, `ETH`, `ERC20`, `SLPTOKEN`, `BCH`, `TENDERMINT`, `TENDERMINTTOKEN`, `LIGHTNING`, `SOLANA`, `SPLTOKEN`, `ZHTLC`"
  },
  "id": null
}

UnexpectedTokenProtocol Error

{
  "mmrpc": "2.0",
  "error": "Unexpected token protocol UTXO for KMD",
  "error_path": "platform_coin_with_tokens.prelude.tendermint_with_assets_activation",
  "error_trace": "platform_coin_with_tokens:314] platform_coin_with_tokens:109] prelude:90] tendermint_with_assets_activation:101]",
  "error_type": "UnexpectedTokenProtocol",
  "error_data": {
    "ticker": "KMD",
    "protocol": {
      "type": "UTXO"
    }
  },
  "id": null
}

task::enable_tendermint::user_actionAPI-v2task::enable_tendermint::user_action

If the task::enable_tendermint::status returns UserActionRequired, we need to use the task::enable_tendermint::user_action method to enter our PIN

Arguments

ParameterTypeDescription
task_idintegerThe identifying number returned when initiating the initialisation process.
user_actionobjectObject containing the params below
user_action.action_typestringWill be TrezorPin for this method
user_action.pinstring (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.
Trezor Pin

Response

ParameterTypeDescription
resultstringThe outcome of the request.

📌 Examples

Command

POST task::enable_tendermint::user_action
{
  "userpass": "RPC_UserP@SSW0RD",
  "mmrpc": "2.0",
  "method": "task::enable_tendermint::user_action",
  "params": {
    "task_id": 0,
    "user_action": {
      "action_type": "TrezorPin",
      "pin": "862743"
    }
  }
}
Show Response

Response (success)

{
  "mmrpc": "2.0",
  "result": "success",
  "id": null
}

task::enable_tendermint::cancelAPI-v2task::enable_tendermint::cancel

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

Arguments

StructureTypeDescription
task_idintegerThe identifying number returned when initiating the enabling process.

Response

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.
POST task::enable_tendermint::cancel
{
  "userpass": "RPC_UserP@SSW0RD",
  "method": "task::enable_tendermint::cancel",
  "mmrpc": "2.0",
  "params": {
    "task_id": 3
  }
}
Show Response

Response (success)

{
  "mmrpc": "2.0",
  "result": "success",
  "id": null
}
Show Error Responses

Response (success - already finished)

{
  "mmrpc": "2.0",
  "error": "Task is finished already",
  "error_path": "init_standalone_coin.manager",
  "error_trace": "init_standalone_coin:144] manager:101]",
  "error_type": "TaskFinished",
  "error_data": 0,
  "id": null
}

Response (error - no such task)

{
  "mmrpc": "2.0",
  "error": "No such task '1'",
  "error_path": "init_standalone_coin",
  "error_trace": "init_standalone_coin:119]",
  "error_type": "NoSuchTask",
  "error_data": 1,
  "id": null
}