Evolving NFTs
For NFTs that have the minter-controlled evolution feature enabled, they can be evolved by the minter even if they are no longer the owner.
API Endpoint:
Section titled “API Endpoint:”GET http://localhost:7292/scapi/scv1/EvolveSpecific/{id}/{address}/{stage}URL Params:
Section titled “URL Params:”id: The smart contract identifier
address: The current owner’s VFX address
stage: the stage to evolve to (the original stage is 0)
Response:
Section titled “Response:”The node returns the evolve transaction. The minter’s account signs it and pays the network fee. The node returns the text Failed to Change State - TX when the minter’s address is not in this node’s wallet, address is not the current owner, the stage does not exist, or the minter’s balance cannot cover the fee.
{ "Hash": "abcdfg...", "ToAddress": "Rabc123...", "FromAddress": "Rabc123...", "Amount": 0.0, "Nonce": 12, "Fee": 0.00000883, "Timestamp": 0000000000, "Data": "[{\"Function\":\"ChangeEvolveStateSpecific()\",\"ContractUID\":\"…\",\"FromAddress\":\"Rabc123...\",\"ToAddress\":\"Rabc123...\",\"NewEvoState\":1,\"Data\":\"…\"}]", "UnlockTime": null, "Signature": "AbCdF...", "Height": 0, "TransactionType": 3, "TransactionRating": null, "TransactionStatus": 0}Code Example
Section titled “Code Example”const evolveNft = async (smartContractUid, address, stage) => { const url = `${CLI_BASE_URL}/scapi/scv1/EvolveSpecific/${smartContractUid}/${address}/${stage}`; const request = await fetch(url);
const data = await request.json();
return data["Hash"];};def evolve_nft(smart_contract_uid, address, stage): url = f"{CLI_BASE_URL}/scapi/scv1/EvolveSpecific/{smart_contract_uid}/{address}/{stage}" response = requests.get(url) data = response.json()
return data["Hash"]Next and Previous Stage
Section titled “Next and Previous Stage”The node can also move an NFT one stage forward or back. The same rules apply: the minter’s account must be in this node’s wallet, address must be the current owner, and the minter signs and pays the network fee.
API Endpoints:
Section titled “API Endpoints:”GET http://localhost:7292/scapi/scv1/Evolve/{id}/{address}GET http://localhost:7292/scapi/scv1/Devolve/{id}/{address}URL Params:
Section titled “URL Params:”id: The smart contract identifier
address: The current owner’s VFX address
Response:
Section titled “Response:”The signed transaction, in the same shape as above. On failure the node returns the text Failed to Evolve - TX or Failed to Devolve - TX.