|
| 1 | +export const title = "Komodo DeFi Framework Method: Enable NFT"; |
| 2 | +export const description = |
| 3 | + "The enable_nft method allows you to activate NFT-like tokens on the platform."; |
| 4 | + |
| 5 | +# enable\_nft |
| 6 | + |
| 7 | +The 'enable\_nft' method activates NFT-like tokens on the platform, if the NFT network was already activated with the [enable\_eth\_with\_tokens](/komodo-defi-framework/api/v20/enable_eth_with_tokens/) method, but without the `nft_req` parameter. |
| 8 | + |
| 9 | +| parameter | Type | Description | |
| 10 | +| ------------------ | ------ | ------------------------------------------------------------------------------------------------ | |
| 11 | +| ticker | string | The ticker of the NFT network, with `NFT_` as a prefix. | |
| 12 | +| activation\_params | object | A standard [NftProvider](/komodo-defi-framework/api/common_structures/nfts/#nft-provider) object | |
| 13 | + |
| 14 | +<CodeGroup title="" tag="POST" label="enable_nft" mm2MethodDecorate="true"> |
| 15 | + ```json |
| 16 | + { |
| 17 | + "userpass": "RPC_UserP@SSW0RD", |
| 18 | + "method": "enable_nft", |
| 19 | + "mmrpc": "2.0", |
| 20 | + "params": { |
| 21 | + "ticker": "NFT_MATIC", |
| 22 | + "activation_params": { |
| 23 | + "provider": { |
| 24 | + "type": "Moralis", |
| 25 | + "info": { |
| 26 | + "url": "https://moralis-proxy.komodo.earth", |
| 27 | + "komodo_proxy": true |
| 28 | + } |
| 29 | + } |
| 30 | + } |
| 31 | + } |
| 32 | + } |
| 33 | + ``` |
| 34 | +</CodeGroup> |
| 35 | + |
| 36 | +## Response |
| 37 | + |
| 38 | +```json |
| 39 | +{ |
| 40 | + "mmrpc": "2.0", |
| 41 | + "result": { |
| 42 | + "nfts": { |
| 43 | + "0xc28a19e9a663d966cf99532bdb1229df1b0e344b,1": { |
| 44 | + "token_address": "0xc28a19e9a663d966cf99532bdb1229df1b0e344b", |
| 45 | + "token_id": "1", |
| 46 | + "chain": "POLYGON", |
| 47 | + "contract_type": "ERC1155", |
| 48 | + "amount": "1" |
| 49 | + }, |
| 50 | + "0xd25f13e4ba534ef625c75b84934689194b7bd59e,14": { |
| 51 | + "token_address": "0xd25f13e4ba534ef625c75b84934689194b7bd59e", |
| 52 | + "token_id": "14", |
| 53 | + "chain": "POLYGON", |
| 54 | + "contract_type": "ERC721", |
| 55 | + "amount": "1" |
| 56 | + } |
| 57 | + }, |
| 58 | + "platform_coin": "MATIC" |
| 59 | + }, |
| 60 | + "id": null |
| 61 | +} |
| 62 | +``` |
| 63 | + |
| 64 | +## Error - Platform coin is not yet activated |
| 65 | + |
| 66 | +```json |
| 67 | +{ |
| 68 | + "mmrpc": "2.0", |
| 69 | + "error": "Platform coin MATIC is not activated", |
| 70 | + "error_path": "token.lp_coins", |
| 71 | + "error_trace": "token:126] lp_coins:2797]", |
| 72 | + "error_type": "PlatformCoinIsNotActivated", |
| 73 | + "error_data": "MATIC", |
| 74 | + "id": null |
| 75 | +} |
| 76 | +``` |
| 77 | + |
| 78 | +## Error - Token already activated |
| 79 | + |
| 80 | +```json |
| 81 | +{ |
| 82 | + "mmrpc": "2.0", |
| 83 | + "error": "Token NFT_MATIC is already activated", |
| 84 | + "error_path": "token", |
| 85 | + "error_trace": "token:119]", |
| 86 | + "error_type": "TokenIsAlreadyActivated", |
| 87 | + "error_data": "NFT_MATIC", |
| 88 | + "id": null |
| 89 | +} |
| 90 | +``` |
| 91 | + |
| 92 | +## Error - Token config not found in coins file |
| 93 | + |
| 94 | +```json |
| 95 | +{ |
| 96 | + "mmrpc": "2.0", |
| 97 | + "error": "Token NFT_TESTTT config is not found", |
| 98 | + "error_path": "token.prelude", |
| 99 | + "error_trace": "token:122] prelude:79]", |
| 100 | + "error_type": "TokenConfigIsNotFound", |
| 101 | + "error_data": "NFT_TESTTT", |
| 102 | + "id": null |
| 103 | +} |
| 104 | +``` |
0 commit comments