On this page

latest contributor to this doc

Last Edit:

@smk762

get_locked_amount

The get_locked_amount method returns the amount of a coin which is currently locked by a swap which is in progress. If the coin is not activated, a NoSuchCoin error will be returned.

ParameterTypeDescription
coinstringThe ticker of the coin you want to query.

ParameterTypeDescription
coinstringThe ticker of the coin you queried.
locked_amountobjectAn object cointaining the locked amount in decimal, fraction and rational formats.
locked_amount.decimalnumeric stringThe locked amount in decimal format.
locked_amount.rationalrational objectThe locked amount in rational format.
locked_amount.fractionfraction objectThe locked amount in fraction format.

POST
get_locked_amount
{
  "userpass": "RPC_UserP@SSW0RD",
  "mmrpc": "2.0",
  "method": "get_locked_amount",
  "params": {
    "coin": "DOC"
  },
  "id": 42
}

{
  "mmrpc": "2.0",
  "result": {
    "coin": "DOC",
    "locked_amount": {
      "decimal": "0.77803",
      "rational": [
        [1, [77803]],
        [1, [100000]]
      ],
      "fraction": {
        "numer": "77803",
        "denom": "100000"
      }
    }
  },
  "id": 42
}

{
  "mmrpc": "2.0",
  "error": "No such coin: TIME",
  "error_path": "lp_swap.lp_coins",
  "error_trace": "lp_swap:486] lp_coins:2894]",
  "error_type": "NoSuchCoin",
  "error_data": {
    "coin": "TIME"
  },
  "id": 42
}