API References v20
Smart Contracts & DEFI
/updateSmartContractFromPreview
1 min
POST
/updateSmartContractFromPreview
Update an existing smart contract's functions from a parsed preview.
Requires admin user and an active MPC administrative session. FileHash and PreviewContentHash locate the cached file on the MCS and are included in the signed MPC body.
************** Request example **********************
updateSmartContractFromPreview(
existing_contract_address="CA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ",
contract_name="XLMMMFv2",
coin_symbol="XLM",
file_hash="3f786850e387550fdab836ed7e6dc881de23001b",
preview_content_hash="c2f8a7e1b0d94a5c8f6e2d3b1a9c8e7f6d5c4b3a",
description="XLM money market fund contract (adds revoke_role)",
request_extra_data={}
)
************** Response example *********************
{
"FunctionData": {
"StatusCode": 0,
"StatusCodeDescription": "Success"
},
"Meta": {
"AccessToken": "58f08df6e369fa4d126e1ba5c7f66cf85c9c79df32d05fee8f3c542121c87cf5",
"Destination": "044fd7dc60304b8aceeb662ce41bf9d9cc132278c0871c0a72fb4f3cecbabb25a86e43ae28dab21a95c64e2db76abdcfffb9bfdeec67a21399cfa5f555f01d054b",
"Source": "be1f60e490b8ccabcc02a4595817b8edf45905d24944e87b8e3cae27f158df63843bfc4b09d37a5e752017b74ea2d136af272bea210f059e768e1ea8777aaf21e9",
"Time": "2025-10-19 15:04:13.129"
}
}
### Error Responses
| Error Type | Http Code | GK8 error code | Reason / Description | Example Response |
|------------------|-----------|----------------|-----------------------------------------------------------------|------------------|
| Backend Response | 400 | 1 | Coin not supported | "StatusCode": 1 |
| Backend Response | 400 | 2 | Invalid contract address | "StatusCode": 2 |
| Backend Response | 400 | 3 | Smart contract not found | "StatusCode": 3, |
| Backend Response | 400 | 4 | Contract parse failed during cosigner handle() | "StatusCode": 4 |
| Backend Response | 400 | 5 | PARSED_PREVIEW_HASH_MISMATCH | "StatusCode": 5 |
| Backend Response | 400 | 6 | Display name already exists (another contract on the same coin) | "StatusCode": 6 |
| Backend Response | 400 | 7 | Name already used by an existing contact | "StatusCode": 7 |
acceptstringGenerated from available response content types
200success
curl --request POST \
--url /updateSmartContractFromPreview \
--header 'accept: application/json'