On this page

latest contributor to this doc

Last Edit:

@smk762

Task: Tendermint Activation

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

Parameter* = requiredTypeDescription
nodes*
array of objects
A list of CoinNode objects.
ticker*
string
Ticker of the platform protocol coin. Options: ATOM, IRIS, OSMOSIS
tokens_params*
array of objects
A list of standard TokensRequest objects.
get_balances
boolean
default: `true`
Optional. If false, coin and token balances will not be returned in the response, and the response will be returned more quickly.
mm2
integer
Optional. 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
priv_key_policy
string
default: `ContextPrivKey`
Optional. 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
required_confirmations
integer
default: `3`
Optional. 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
default: `false`
Optional. If true, coins protected by Komodo Platform's dPoW security will wait for a notarization before progressing to the next atomic swap transactions step.
tx_history
boolean
default: `false`
Optional. 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

Parameter* = requiredTypeDescription
task_id*
integer
An identifying number which is used to query task status.

task::enable_tendermint::init

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

{
  "mmrpc": "2.0",
  "result": {
    "task_id": 2
  },
  "id": null
}
API-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)

Parameter* = requiredTypeDescription
task_id*
integer
The identifying number returned when initiating the initialisation process.
forget_if_finished
boolean
default: `true`
Optional. If false, will return final response for completed tasks.

task::enable_tendermint::status

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

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

| | | |

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

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

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

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

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

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

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

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

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

{
  "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
}
API-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

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

ParameterTypeDescription
resultstringThe outcome of the request.

task::enable_tendermint::user_action

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

{
  "mmrpc": "2.0",
  "result": "success",
  "id": null
}
API-v2task::enable_tendermint::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.

task::enable_tendermint::cancel

POST
task::enable_tendermint::cancel
{
  "userpass": "RPC_UserP@SSW0RD",
  "method": "task::enable_tendermint::cancel",
  "mmrpc": "2.0",
  "params": {
    "task_id": 3
  }
}

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

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

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