enable_tendermint_with_assets

Use this method to activate Tendermint coins (COSMOS/IRIS/OSMOSIS) and IBC assets in a single command.

Request Parameters

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.
activation_params object Only used with Metamask, Keplr or WalletConnect activations. Defines the PrivKeyPolicy of the connection.

Response Parameters

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.

📌 Examples

Request with get_balances set to false

POST enable_tendermint_with_assets
{
  "method": "enable_tendermint_with_assets",
  "userpass": "RPC_UserP@SSW0RD",
  "mmrpc": "2.0",
  "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"
      }
    ],
    "tx_history": true,
    "get_balances": false
  }
}
Show Response

Response

{
	"mmrpc": "2.0",
	"result": {
		"ticker": "IRIS",
		"address": "iaa16drqvl3u8sukfsu4lm3qsk28jr3fahja9vsv6k",
		"current_block": 19769628,
		"tokens_tickers": ["ATOM-IBC_IRIS"]
	},
	"id": null
}

Request with token activation and get_balances as true

POST enable_tendermint_with_assets
{
  "method": "enable_tendermint_with_assets",
  "userpass": "RPC_UserP@SSW0RD",
  "mmrpc": "2.0",
  "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"
      }
    ],
    "get_balances": true
  }
}
Show Response

Response

{
	"mmrpc": "2.0",
	"result": {
		"ticker": "IRIS",
		"address": "iaa16drqvl3u8sukfsu4lm3qsk28jr3fahja9vsv6k",
		"current_block": 19769638,
		"balance": {
			"spendable": "44.147264",
			"unspendable": "0"
		},
		"tokens_balances": {
			"ATOM-IBC_IRIS": {
				"spendable": "0.028306",
				"unspendable": "0"
			}
		}
	},
	"id": null
}

Request for Metamask / WalletConnect activation

POST enable_tendermint_with_assets
{
  "userpass": "RPC_UserP@SSW0RD",
  "method": "enable_tendermint_with_assets",
  "mmrpc": "2.0",
  "params": {
    "ticker": "ATOM",
    "tx_history": true,
    "get_balances": true,
    "activation_params": {
      "priv_key_policy": {
        "type": "WalletConnect",
        "data": "3569914dd09a5cc4ac92dedab354f06ff5db17ef616233a8ba562cbea51269fd"
      }
    },
    "nodes": [
      {
        "url": "https://cosmos-rpc.alpha.komodo.earth/",
        "api_url": "https://cosmos-api.alpha.komodo.earth/",
        "grpc_url": "https://cosmos-grpc.alpha.komodo.earth/",
        "ws_url": "wss://cosmos-rpc.alpha.komodo.earth/websocket"
      },
      {
        "url": "https://cosmoshub.rpc.stakin-nodes.com/"
      },
      {
        "url": "https://node.komodo.earth:8080/cosmos",
        "komodo_proxy": true
      }
    ],
    "tokens_params": []
  }
}
Show Response

Response

{
  "mmrpc": "2.0",
  "result": {
      "ticker": "ATOM",
      "address": "cosmos16drqvl3u8sukfsu4lm3qsk28jr3fahjaswsac8",
      "current_block": 22148347,
      "balance": {
          "spendable": "1.003381",
          "unspendable": "0"
      },
      "tokens_balances": {}
  },
  "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
}

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