Closed happyJ2024 closed 2 years ago
sublink的swagger 文档 https://web3go.xyz/sublink/ => http://18.163.114.136:30001/api/
get Price:
var fetch = require('node-fetch');
fetch('https://web3go.xyz/oracle/getPrice', {
method: 'POST',
headers: {
'User-Agent': 'Apipost client Runtime/+https://www.apipost.cn/',
'Content-Type': 'application/json'
},
body: JSON.stringify({ "symbol": "DOT" })
});
var fetch = require('node-fetch');
fetch('https://web3go.xyz/polkadot-balance/polkadot-balance-analysis/getAccountDetail', { method: 'POST', headers: { 'User-Agent': 'Apipost client Runtime/+https://www.apipost.cn/', 'Content-Type': 'application/json' }, body: JSON.stringify({ "account_id": "1kroLNzcZDxc9p3KdRdwbAxTSR4Tmxzzfgc2CH9peL5Mnaw", "time_start": "2022-01-04T13:16:37.324Z", "time_end": "2022-01-04T13:16:37.324Z", "include_transactions_detail": true }) });
var fetch = require('node-fetch');
fetch('https://web3go.xyz/sublink/parachain/getAllSupportedChains', { method: 'POST', headers: { 'User-Agent': 'Apipost client Runtime/+https://www.apipost.cn/', 'Content-Type': 'application/json' } });
var fetch = require('node-fetch');
fetch('https://web3go.xyz/sublink/parachain/ss58transform', { method: 'POST', headers: { 'User-Agent': 'Apipost client Runtime/+https://www.apipost.cn/', 'Content-Type': 'application/json' }, body: JSON.stringify({ "account": "15MtNMKZUFjHoWzqQzQ8ntuXaAB8KHb3QSf5SeXfkqpBh45i", "networks": [ "polkadot" ], "filter_no_symbol": true }) });
Balance 显示流程: 1, 进入Profile 页面时 , 调用 接口https://web3go.xyz/sublink/parachain/getAllSupportedChains
输入地址, 回车=》 调用接口https://web3go.xyz/sublink/parachain/ss58transform 得到了AddressList
默认选择的是 Balance Tab
根据Address List 循环, 一次性发送所有的请求到接口: https://web3go.xyz/sublink/parachain/getBalance , 得到 每一个token的 balance。
根据Address List 循环, 一次性发送所有的请求到接口: https://web3go.xyz/oracle/getPrice { "symbol": "DOT" }
Price * Balance = Value
最上面的total amount= Sum(Value).
点击token表格中的某个token,显示明细, 调用接口:https://web3go.xyz/polkadot-balance/polkadot-balance-analysis/getAccountDetail
Defi cdp api:
curl --location --request POST 'https://web3go.xyz/sublink/defi/karura/getLoanPositionList' \
--header 'User-Agent: Apipost client Runtime/+https://www.apipost.cn/' \
--header 'Content-Type: application/json' \
--data '{
"pageSize": 10,
"pageIndex": 1,
"orderBys": [],
"chain": "Karura",
"symbol": "KSM",
"accountId": "rLLs6M3ss96nMPjmV5c5gByx4qhur2zAKRE8mzm2YZi7EGd",
"filterStatus": [],
"hideLoanCompleted": false
}'
note: account_id 是karura链的账户地址
页面链接地址: Karura CDP: https://web3go.xyz/#/CDPDetail?loanPositionId=693&accountId=rLLs6M3ss96nMPjmV5c5gByx4qhur2zAKRE8mzm2YZi7EGd
nft api
curl --location --request POST 'https://web3go.xyz/sublink/nft/rmrk/getAccountOwnedNFT' \
--header 'User-Agent: Apipost client Runtime/+https://www.apipost.cn/' \
--header 'origin: http://localhost:10005' \
--header 'Content-Type: application/json' \
--data '{
"account_id": "8949162-e0b9bdcc456a36497a-KANBIRD-KANL-00001695"
}'
note: account_id 是kusama链的账户地址
页面链接地址: Collection: https://web3go.xyz/#/NftDetail?back=NFTProfiler&id=e0b9bdcc456a36497a-KANBIRD&symbol=KANBIRD
NFT: https://web3go.xyz/#/NftItemDetail?id=8949162-e0b9bdcc456a36497a-KANBIRD-KANR-00000842
polkadot crowdloan
note: account是polkadot 链的账户地址
get contribution detail of account:
curl --location --request POST 'https://web3go.xyz/polkadot/parachain-analysis/getCrowdloanContributions' \
--header 'User-Agent: Apipost client Runtime/+https://www.apipost.cn/' \
--header 'Content-Type: application/json' \
--data '{
"account": "JGmrBLZEqaaqLrfRmXkZhsD4JhoPkjRkfXJjj9smCk2UoYA",
}'
get parachain info
curl --location --request POST 'https://web3go.xyz/polkadot/parachain-analysis/getPolkParaChainList' \
--header 'User-Agent: Apipost client Runtime/+https://www.apipost.cn/' \
--header 'Content-Type: application/json' \
--data ''
kusama crowdloan
note: account是kusama 链的账户地址
get contribution detail of account:
curl --location --request POST 'https://web3go.xyz/kusama /parachain-analysis/getCrowdloanContributions' \
--header 'User-Agent: Apipost client Runtime/+https://www.apipost.cn/' \
--header 'Content-Type: application/json' \
--data '{
"account": "FcPK96da7tjqzxxLHoTpGbS59ywakFs2g6SSg8xFQznRWKW",
}'
get parachain info
curl --location --request POST 'https://web3go.xyz/kusama /parachain-analysis/getPolkParaChainList' \
--header 'User-Agent: Apipost client Runtime/+https://www.apipost.cn/' \
--header 'Content-Type: application/json' \
--data ''