get_enabled_coins
get_enabled_coins
The get_enabled_coins method returns data of coins that are currently enabled on the user’s Komodo DeFi Framework API node.
Arguments
| Structure | Type | Description |
|---|---|---|
| (none) |
Response
| Structure | Type | Description |
|---|---|---|
| result | array of objects | tickers and addresses of enabled coins |
| result.address | string | the user’s address for this coin |
| result.ticker | string | the ticker name of this coin |
📌 Examples
Command
POST get_enabled_coins
{
"userpass": "RPC_UserP@SSW0RD",
"method": "get_enabled_coins"
} curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"method": "get_enabled_coins"
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "get_enabled_coins"
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "get_enabled_coins"
};
const response = await fetch("http://127.0.0.1:7783", {
method: "POST",
body: JSON.stringify(payload),
});
console.log(await response.json()); <?php
$payload = <<<'JSON'
{
"userpass": "RPC_UserP@SSW0RD",
"method": "get_enabled_coins"
}
JSON;
$ch = curl_init("http://127.0.0.1:7783");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
$response = curl_exec($ch);
curl_close($ch);
echo $response; package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{"userpass":"RPC_UserP@SSW0RD","method":"get_enabled_coins"}`)
resp, err := http.Post("http://127.0.0.1:7783", "application/json", bytes.NewBuffer(payload))
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
} require 'net/http'
require 'json'
require 'uri'
uri = URI("http://127.0.0.1:7783")
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "get_enabled_coins"
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Show Response
Response
{
"result": [
{
"address": "1WxswvLF2HdaDr4k77e92VjaXuPQA8Uji",
"ticker": "BTC"
},
{
"address": "R9o9xTocqr6CeEDGDH6mEYpwLoMz6jNjMW",
"ticker": "PIZZA"
},
{
"address": "R9o9xTocqr6CeEDGDH6mEYpwLoMz6jNjMW",
"ticker": "BEER"
},
{
"address": "0xbAB36286672fbdc7B250804bf6D14Be0dF69fa29",
"ticker": "ETH"
},
{
"address": "R9o9xTocqr6CeEDGDH6mEYpwLoMz6jNjMW",
"ticker": "ETOMIC"
},
{
"address": "0xbAB36286672fbdc7B250804bf6D14Be0dF69fa29",
"ticker": "DEC8"
},
{
"address": "0xbAB36286672fbdc7B250804bf6D14Be0dF69fa29",
"ticker": "BAT"
}
]
}