SDK
import { Client } from '@solana-tracker/data-api';
const client = new Client({ apiKey: 'YOUR_API_KEY' });
const data = await client.getPortfolioPlatformsV2();
const live = data.platforms.filter((platform) => platform.status === 'live');
console.log(live.map((platform) => platform.id));curl --request GET \
--url https://data.solanatracker.io/v2/portfolio/platforms \
--header 'x-api-key: <api-key>'import requests
url = "https://data.solanatracker.io/v2/portfolio/platforms"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://data.solanatracker.io/v2/portfolio/platforms', 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://data.solanatracker.io/v2/portfolio/platforms",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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://data.solanatracker.io/v2/portfolio/platforms"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://data.solanatracker.io/v2/portfolio/platforms")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://data.solanatracker.io/v2/portfolio/platforms")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"platforms": [
{
"id": "native-stake",
"name": "Native Stake",
"image": "https://image.solanatracker.io/proxy?url=https%3A%2F%2Fplatform-images.solanatracker.io%2Fnative-stake.webp",
"website": "https://solana.com",
"services": [
{
"id": "stake",
"name": "Stake account",
"category": "staking"
}
],
"status": "live"
},
{
"id": "marinade",
"name": "Marinade",
"image": "https://image.solanatracker.io/proxy?url=https%3A%2F%2Fplatform-images.solanatracker.io%2Fmarinade.webp",
"website": "https://marinade.finance/",
"services": [
{
"id": "ticket",
"name": "Marinade unstake ticket",
"category": "staking"
},
{
"id": "liquidity",
"name": "Marinade mSOL-SOL pool",
"category": "liquidity"
}
],
"status": "live"
},
{
"id": "jupiter-governance",
"name": "Jupiter Governance",
"image": "https://image.solanatracker.io/proxy?url=https%3A%2F%2Fplatform-images.solanatracker.io%2Fjupiter-governance.webp",
"website": "https://vote.jup.ag/",
"services": [
{
"id": "stake",
"name": "Staked JUP",
"category": "staking"
}
],
"status": "live"
}
]
}{
"error": "<string>"
}Platforms
Wallet V2 覆盖的 Solana DeFi 平台
列出 Wallet V2 API 支持的 Solana DeFi 平台和服务,附带 logo、官网和状态。
GET
/
v2
/
portfolio
/
platforms
SDK
import { Client } from '@solana-tracker/data-api';
const client = new Client({ apiKey: 'YOUR_API_KEY' });
const data = await client.getPortfolioPlatformsV2();
const live = data.platforms.filter((platform) => platform.status === 'live');
console.log(live.map((platform) => platform.id));curl --request GET \
--url https://data.solanatracker.io/v2/portfolio/platforms \
--header 'x-api-key: <api-key>'import requests
url = "https://data.solanatracker.io/v2/portfolio/platforms"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://data.solanatracker.io/v2/portfolio/platforms', 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://data.solanatracker.io/v2/portfolio/platforms",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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://data.solanatracker.io/v2/portfolio/platforms"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://data.solanatracker.io/v2/portfolio/platforms")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://data.solanatracker.io/v2/portfolio/platforms")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"platforms": [
{
"id": "native-stake",
"name": "Native Stake",
"image": "https://image.solanatracker.io/proxy?url=https%3A%2F%2Fplatform-images.solanatracker.io%2Fnative-stake.webp",
"website": "https://solana.com",
"services": [
{
"id": "stake",
"name": "Stake account",
"category": "staking"
}
],
"status": "live"
},
{
"id": "marinade",
"name": "Marinade",
"image": "https://image.solanatracker.io/proxy?url=https%3A%2F%2Fplatform-images.solanatracker.io%2Fmarinade.webp",
"website": "https://marinade.finance/",
"services": [
{
"id": "ticket",
"name": "Marinade unstake ticket",
"category": "staking"
},
{
"id": "liquidity",
"name": "Marinade mSOL-SOL pool",
"category": "liquidity"
}
],
"status": "live"
},
{
"id": "jupiter-governance",
"name": "Jupiter Governance",
"image": "https://image.solanatracker.io/proxy?url=https%3A%2F%2Fplatform-images.solanatracker.io%2Fjupiter-governance.webp",
"website": "https://vote.jup.ag/",
"services": [
{
"id": "stake",
"name": "Staked JUP",
"category": "staking"
}
],
"status": "live"
}
]
}{
"error": "<string>"
}Wallet V2 支持的所有 DeFi 平台,附带 logo、官网和服务。每个服务都有一个
category,即其仓位所属的类别。
status 为 live 表示会返回该平台的仓位;为 not_indexed 表示平台已列出,但暂不返回其仓位。
可将平台的 id 用作 Get Wallet Positions 的 platform 筛选条件。
SDK Example
import { Client } from '@solana-tracker/data-api';
const client = new Client({ apiKey: 'YOUR_API_KEY' });
const data = await client.getPortfolioPlatformsV2();
const live = data.platforms.filter((platform) => platform.status === 'live');
console.log(live.map((platform) => platform.id));
此页面对您有帮助吗?