Update NFT
This method will scan selected networks to update NFT information stored in the local database. To interact with your NFTs, you will first need to activate the coin for the network the NFT is on.
See below for which coin to activate for each network:
| Network | Coin |
|---|---|
| AVALANCHE | AVAX |
| BSC | BNB |
| ETH | ETH |
| FANTOM | FTM |
| POLYGON | MATIC |
These coins can be activated using the enable_eth_with_tokens or method.
Request Parameters
| Parameter | Type | Description |
|---|---|---|
| chains | array | List of networks to scan for NFTs. Options are: POLYGON, FANTOM, ETH, BSC, or AVALANCHE. |
| komodo_proxy | boolean | Optional. Indicates whether authentication is required for accessing the proxy URLs. |
| url | string | URL link to the Moralis API proxy base url or equivalent (if komodo_proxy is set to true, will need to provide a new Komodo Proxy URL). |
| url_antispam | string | URL link to the Antispam API proxy base url or equivalent. |
📌 Example
POST Update NFT
update_nft {
"userpass": "RPC_UserP@SSW0RD",
"method": "update_nft",
"mmrpc": "2.0",
"params": {
"chains": [
"BSC",
"POLYGON"
],
"komodo_proxy": false,
"url": "https://moralis-proxy.komodo.earth",
"url_antispam": "https://nft.antispam.dragonhound.info"
}
} curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"method": "update_nft",
"mmrpc": "2.0",
"params": {
"chains": [
"BSC",
"POLYGON"
],
"komodo_proxy": false,
"url": "https://moralis-proxy.komodo.earth",
"url_antispam": "https://nft.antispam.dragonhound.info"
}
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "update_nft",
"mmrpc": "2.0",
"params": {
"chains": [
"BSC",
"POLYGON"
],
"komodo_proxy": false,
"url": "https://moralis-proxy.komodo.earth",
"url_antispam": "https://nft.antispam.dragonhound.info"
}
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "update_nft",
"mmrpc": "2.0",
"params": {
"chains": [
"BSC",
"POLYGON"
],
"komodo_proxy": false,
"url": "https://moralis-proxy.komodo.earth",
"url_antispam": "https://nft.antispam.dragonhound.info"
}
};
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": "update_nft",
"mmrpc": "2.0",
"params": {
"chains": [
"BSC",
"POLYGON"
],
"komodo_proxy": false,
"url": "https://moralis-proxy.komodo.earth",
"url_antispam": "https://nft.antispam.dragonhound.info"
}
}
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":"update_nft","mmrpc":"2.0","params":{"chains":["BSC","POLYGON"],"komodo_proxy":false,"url":"https://moralis-proxy.komodo.earth","url_antispam":"https://nft.antispam.dragonhound.info"}}`)
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": "update_nft",
"mmrpc": "2.0",
"params": {
"chains": [
"BSC",
"POLYGON"
],
"komodo_proxy": false,
"url": "https://moralis-proxy.komodo.earth",
"url_antispam": "https://nft.antispam.dragonhound.info"
}
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Show Response
{
"mmrpc": "2.0",
"result": null,
"id": null
} Show Errors
Error Types
TokenIsAlreadyActivated
This error occurs when NFTs are already activated for the selected network.
{
"mmrpc": "2.0",
"error": "Token NFT_MATIC is already activated",
"error_path": "token",
"error_trace": "token:121]",
"error_type": "TokenIsAlreadyActivated",
"error_data": "NFT_MATIC",
"id": null
}TokenIsAlreadyActivated
This error occurs when NFTs are already activated for the selected network.
{
"mmrpc": "2.0",
"error": "Token NFT_MATICC config is not found",
"error_path": "token.prelude",
"error_trace": "token:124] prelude:79]",
"error_type": "TokenConfigIsNotFound",
"error_data": "NFT_MATICC",
"id": null
}