GraphQL Queries and mutations
curl --request POST \
--url https://router-dev.junction.exchange/graphql/graphqlimport requests
url = "https://router-dev.junction.exchange/graphql/graphql"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://router-dev.junction.exchange/graphql/graphql', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://router-dev.junction.exchange/graphql/graphql",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://router-dev.junction.exchange/graphql/graphql"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://router-dev.junction.exchange/graphql/graphql")
.asString();require 'uri'
require 'net/http'
url = URI("https://router-dev.junction.exchange/graphql/graphql")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyEndpoint Examples
GraphQL Queries and mutations
POST
/
graphql
GraphQL Queries and mutations
curl --request POST \
--url https://router-dev.junction.exchange/graphql/graphqlimport requests
url = "https://router-dev.junction.exchange/graphql/graphql"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://router-dev.junction.exchange/graphql/graphql', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://router-dev.junction.exchange/graphql/graphql",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://router-dev.junction.exchange/graphql/graphql"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://router-dev.junction.exchange/graphql/graphql")
.asString();require 'uri'
require 'net/http'
url = URI("https://router-dev.junction.exchange/graphql/graphql")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyQuery to fetch all supported tokens:
Example response:
query chainsV2 {
routingV2 {
chainsV2 {
name
tokens {
asset {
id
name
symbol
contract
}
}
}
}
}
{
"data": {
"routingV2": {
"chainsV2": [
{
"name": "BTC",
"tokens": [
{
"asset": {
"contract": null,
"id": "d280d259-fc31-4989-9357-e17cb27a79a1",
"name": "Bitcoin",
"symbol": "BTC"
}
}
]
},
{
"name": "BCH",
"tokens": [
{
"asset": {
"contract": null,
"id": "cf82a176-d3f6-496a-b3bd-91ed7fd0f236",
"name": "Bitcoin Cash",
"symbol": "BCH"
}
}
]
},
{
"name": "LTC",
"tokens": [
{
"asset": {
"contract": null,
"id": "3acf799d-2365-4c27-b896-c0e9160dde5f",
"name": "Litecoin",
"symbol": "LTC"
}
}
]
},
{
"name": "ETH",
"tokens": [
{
"asset": {
"contract": "0x72b886d09c117654ab7da13a14d603001de0b777",
"id": "0473ea55-1659-4c9f-a1df-dcd0c81eae5d",
"name": "XDEFI",
"symbol": "XDEFI"
}
},
{
"asset": {
"contract": null,
"id": "47544996-497b-4264-bbee-c9a8f64c06fe",
"name": "Ethereum",
"symbol": "ETH"
}
}
]
}
]
}
}
}
⌘I