# Routes ## Get swap routes for all denoms `swap.routes.list_all(RouteListAllParams**kwargs) -> RouteListAllResponse` **get** `/api/v1/swap/routes/all` Get swap routes for all denoms ### Parameters - `contract_address: str` Swap contract address ### Returns - `class RouteListAllResponse: …` - `count: int` Total number of objects irrespective of any pagination parameters. - `data: List[SwapRouteTargetSet]` - `source: str` Source denom for swap routes - `targets: List[str]` List of target denoms for available swap routes - `error: None` Error data. Guaranteed `null` for successful response. - `status: int` HTTP status. Successful responses are guaranteed to be < `400`. Conversely, error responses are guaranteed to be >= `400`. - `status_text: str` HTTP status text ### Example ```python from neptune_api_v2 import NeptuneAPIV2 client = NeptuneAPIV2() response = client.swap.routes.list_all( contract_address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) print(response.count) ``` #### Response ```json { "data": [ { "source": "inj", "targets": [ "ibc/F6CC233E5C0EA36B1F74AB1AF98471A2D6A80E2542856639703E908B4D93E7C4", "peggy0xAaEf88cEa01475125522e117BFe45cF32044E238" ] }, { "source": "factory/inj1n636d9gzrqggdk66n2f97th0x8yuhfrtx520e7/ausd", "targets": [ "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9", "peggy0xdAC17F958D2ee523a2206206994597C13D831ec7" ] } ], "count": 2, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Get swap routes for a denom `swap.routes.list_by_denom(RouteListByDenomParams**kwargs) -> RouteListByDenomResponse` **get** `/api/v1/swap/routes` Get swap routes for a denom ### Parameters - `contract_address: str` Swap contract address - `source_denom: str` Source asset denom to fetch target routes for **Note**: This is a normal injective asset denom, and not an `AssetSpec` ID. E.g. - `inj` is a **valid** value for `source_denom`. - `native;inj` is **not a valid value** for `source_denom`. ### Returns - `class RouteListByDenomResponse: …` - `data: SwapRouteTargetSet` - `source: str` Source denom for swap routes - `targets: List[str]` List of target denoms for available swap routes - `error: None` Error data. Guaranteed `null` for successful response. - `status: int` HTTP status. Successful responses are guaranteed to be < `400`. Conversely, error responses are guaranteed to be >= `400`. - `status_text: str` HTTP status text ### Example ```python from neptune_api_v2 import NeptuneAPIV2 client = NeptuneAPIV2() response = client.swap.routes.list_by_denom( contract_address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", source_denom="source_denom", ) print(response.data) ``` #### Response ```json { "data": { "source": "inj", "targets": [ "ibc/F6CC233E5C0EA36B1F74AB1AF98471A2D6A80E2542856639703E908B4D93E7C4", "peggy0xAaEf88cEa01475125522e117BFe45cF32044E238" ] }, "error": null, "status": 200, "status_text": "200 OK" } ``` ## Domain Types ### Swap Route Target Set - `class SwapRouteTargetSet: …` - `source: str` Source denom for swap routes - `targets: List[str]` List of target denoms for available swap routes