enable_nft
The ‘enable_nft’ method activates NFT-like tokens on the platform, if the NFT network was already activated with the enable_eth_with_tokens method, but without the nft_req parameter.
| parameter | Type | Description |
|---|---|---|
| ticker | string | The ticker of the NFT network, with NFT_ as a prefix. |
| activation_params | object | A standard NftProvider object |
POST enable_nft
{
"userpass": "RPC_UserP@SSW0RD",
"method": "enable_nft",
"mmrpc": "2.0",
"params": {
"ticker": "NFT_MATIC",
"activation_params": {
"provider": {
"type": "Moralis",
"info": {
"url": "https://moralis-proxy.komodo.earth",
"komodo_proxy": true
}
}
}
}
} curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"method": "enable_nft",
"mmrpc": "2.0",
"params": {
"ticker": "NFT_MATIC",
"activation_params": {
"provider": {
"type": "Moralis",
"info": {
"url": "https://moralis-proxy.komodo.earth",
"komodo_proxy": true
}
}
}
}
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "enable_nft",
"mmrpc": "2.0",
"params": {
"ticker": "NFT_MATIC",
"activation_params": {
"provider": {
"type": "Moralis",
"info": {
"url": "https://moralis-proxy.komodo.earth",
"komodo_proxy": true
}
}
}
}
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "enable_nft",
"mmrpc": "2.0",
"params": {
"ticker": "NFT_MATIC",
"activation_params": {
"provider": {
"type": "Moralis",
"info": {
"url": "https://moralis-proxy.komodo.earth",
"komodo_proxy": true
}
}
}
}
};
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": "enable_nft",
"mmrpc": "2.0",
"params": {
"ticker": "NFT_MATIC",
"activation_params": {
"provider": {
"type": "Moralis",
"info": {
"url": "https://moralis-proxy.komodo.earth",
"komodo_proxy": true
}
}
}
}
}
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":"enable_nft","mmrpc":"2.0","params":{"ticker":"NFT_MATIC","activation_params":{"provider":{"type":"Moralis","info":{"url":"https://moralis-proxy.komodo.earth","komodo_proxy":true}}}}}`)
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": "enable_nft",
"mmrpc": "2.0",
"params": {
"ticker": "NFT_MATIC",
"activation_params": {
"provider": {
"type": "Moralis",
"info": {
"url": "https://moralis-proxy.komodo.earth",
"komodo_proxy": true
}
}
}
}
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Response
{
"mmrpc": "2.0",
"result": {
"nfts": {
"0xc28a19e9a663d966cf99532bdb1229df1b0e344b,1": {
"token_address": "0xc28a19e9a663d966cf99532bdb1229df1b0e344b",
"token_id": "1",
"chain": "POLYGON",
"contract_type": "ERC1155",
"amount": "1"
},
"0xd25f13e4ba534ef625c75b84934689194b7bd59e,14": {
"token_address": "0xd25f13e4ba534ef625c75b84934689194b7bd59e",
"token_id": "14",
"chain": "POLYGON",
"contract_type": "ERC721",
"amount": "1"
}
},
"platform_coin": "MATIC"
},
"id": null
}
Error - Platform coin is not yet activated
{
"mmrpc": "2.0",
"error": "Platform coin MATIC is not activated",
"error_path": "token.lp_coins",
"error_trace": "token:126] lp_coins:2797]",
"error_type": "PlatformCoinIsNotActivated",
"error_data": "MATIC",
"id": null
}
Error - Token already activated
{
"mmrpc": "2.0",
"error": "Token NFT_MATIC is already activated",
"error_path": "token",
"error_trace": "token:119]",
"error_type": "TokenIsAlreadyActivated",
"error_data": "NFT_MATIC",
"id": null
}
Error - Token config not found in coins file
{
"mmrpc": "2.0",
"error": "Token NFT_TESTTT config is not found",
"error_path": "token.prelude",
"error_trace": "token:122] prelude:79]",
"error_type": "TokenConfigIsNotFound",
"error_data": "NFT_TESTTT",
"id": null
}