👀
DeFi Analytics
BlockVision's Multi-Chain & Multi-Type API can support users to scan all DeFi assets and transactions on the chain.
The current blockchain industry lacks an API tool to fully support users to scan all DeFi assets on the chain and hold NFTs until BlockVision is launched. BlockVision supports retrieval of fungible, non-fungible, and semi-fungible tokens.
BlockVision’s unique API enables developers to analyze FT and NFT data across multiple chains in real-time, query user portfolios and participating DeFi protocols, from past to present.
Not only that, BlockVision is also the first to integrate many mainstream DApps of DeFi, so that developers can directly obtain and query the relevant data of these DApps through BlockVision.
BlockVision's
erc20_accountPositions
interface allows users to view all ERC20 contract addresses and corresponding token balances held by a wallet. Similarly, the nft_accountPositions
interface supports viewing NFT data held by an account and the SFT balances. These three types of position sizes make up the account's portfolio. In addition to supporting scanning of current positions, users can also view historical positions of any address by specifying the blockNumber.
JavaScript
Python
Golang
var axios = require('axios');
var data = JSON.stringify({
"id": 1,
"jsonrpc": "2.0",
"method": "erc20_accountPositions",
"params": {
"accountAddress": "0x6E2EE712C203be8950Bc33AC9B4065CC90B1155C",
"blockNumber": 0,
"pageSize": 50,
"pageIndex": 1
}
});
var config = {
method: 'post',
url: 'https://apis.blockvision.org/v1/<api key>',
headers: {
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
import requests
import json
url = "https://apis.blockvision.org/v1/<api key>"
payload = json.dumps({
"id": 1,
"jsonrpc": "2.0",
"method": "erc20_accountPositions",
"params": {
"accountAddress": "0x6E2EE712C203be8950Bc33AC9B4065CC90B1155C",
"blockNumber": 0,
"pageSize": 50,
"pageIndex": 1
}
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://apis.blockvision.org/v1/<api key>"
method := "POST"
payload := strings.NewReader(`{
"id": 1,
"jsonrpc": "2.0",
"method": "erc20_accountPositions",
"params": {
"accountAddress":"0x6E2EE712C203be8950Bc33AC9B4065CC90B1155C",
"blockNumber": 0,
"pageSize": 50,
"pageIndex": 1
}
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
BlockVision's
erc20_transfer
enables users to analyze Token's transaction trajectory, and nft_transfer
enables users to analyze NFT transactions with different parameters, including fromAddress, toAddress, fromBlockNumber, toBlockNumber, and contractAddress to achieve different purposes.Not only that, but using
trace_transaction
you can also trace FT & NFT historical transaction records.JavaScript
Python
Golang
var axios = require('axios');
var data = JSON.stringify({
"id": 1,
"jsonrpc": "2.0",
"method": "nft_transfers",
"params": {
"blockNumber": 0,
"accountAddress": "",
"fromAddress": "",
"toAddress": "",
"contractAddress": "0x356613282dBFBdf8c9732e65Dac24cBd3e518f97",
"pageSize": 10,
"pageIndex": 1
}
});
var config = {
method: 'post',
url: 'https://apis.blockvision.org/v1/<api key>',
headers: {
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
import requests
import json
url = "https://apis.blockvision.org/v1/<api key>"
payload = json.dumps({
"id": 1,
"jsonrpc": "2.0",
"method": "nft_transfers",
"params": {
"blockNumber": 0,
"accountAddress": "",
"fromAddress": "",
"toAddress": "",
"contractAddress": "0x356613282dBFBdf8c9732e65Dac24cBd3e518f97",
"pageSize": 10,
"pageIndex": 1
}
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://apis.blockvision.org/v1/<api key>"
method := "POST"
payload := strings.NewReader(`{
"id": 1,
"jsonrpc": "2.0",
"method": "nft_transfers",
"params": {
"blockNumber": 0,
"accountAddress": "",
"fromAddress": "",
"toAddress": "",
"contractAddress": "0x356613282dBFBdf8c9732e65Dac24cBd3e518f97",
"pageSize": 10,
"pageIndex": 1
}
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
By using BlockVision's
erc20_approvals
and nft_approvals
interfaces, users can immediately scan and analyze the potential risk points of the current authorization contract of the wallet address, identify potential risks as early as possible and improve the security index of the address.var axios = require('axios');
var data = JSON.stringify({
"id": 1,
"jsonrpc": "2.0",
"method": "erc20_approvals",
"params": {
"fromBlockNumber": 0,
"toBlockNumber": 0,
"accountAddress": "0x93B918CA73172BbDE2492E21399A003e97EADDC4",
"contractAddress": "0xe49Cb97091b5bDe1E8B7043e3D5717E64fDE825e",
"pageSize": 10,
"pageIndex": 1
}
});
var config = {
method: 'post',
url: 'https://apis.blockvision.org/v1/<api key>',
headers: {
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
BlockVision is integrating mainstream DeFi protocol DApps on the Ethereum chain at the fastest speed, including but not limited to Uniswap V2, Uniswap V3, Aave V2, etc., to help developers quickly index the core data of DApps, saving time and work quantity.
In addition to these already provided, BlockVision also plans to integrate more mainstream DeFi protocols of different public chains for developers to use.
Last modified 8mo ago