Developer's Hub
v1.0
API Reference
Powered By

Title
Message
Create new category
What is the title of your new category?
Edit page index title
What is the title of the page index?
Edit category
What is the new title of your category?
Edit link
What is the new title and URL of your link?
ContractValidation()
Copy Markdown
Open in ChatGPT
Open in Claude
Summary
| Route | Type | Example |
|---|---|---|
| /contract/validate | POST | http://apinode.credits.com/api/contract/validate |
Description
Validation of a smart contract compatibility
Request
Request Structure
JSON
x
{// parameters common for all requests для любых запросов"sourceString": “string value”, // smart contract source code in String Value}Request Parameters
String : sourceString - Normalized (without double spaces and double line spacing) smart contract source code
Response
Response Structure
JSON
{//data structure required for smart contract deployment"deploy":{ "sourceCode":"string_value", "byteCodeObjects":[{"name":"Contract","byteCode":[]},{},... ],“status”: “string value”,//errors occured during compliation (status == “fail”)“errors”:”string value” }, "tokenStandard":int, "success":bool, "message":”string_value” }Example Code
Python
C#
C++
def Contractvalidate(): url = 'http://apinode.credits.com/api/contract/validate' headers = { 'Content-type': 'application/json' , 'Accept': 'application/json' , 'Content-Encoding': 'utf-8' } data = { "NetworkAlias":"Mainnet" , "PublicKey":"4WsH74PEaiZkKCm853KTUpMfUzegybsJrf8ZvN2bevac" , "sourceString":"import com.credits.scapi.v0.BasicStandard;import com.credits.scapi.v0.SmartContract;import java.math.BigDecimal;import java.util.HashMap;import java.util.Map;import java.util.Optional;import static java.math.BigDecimal.ROUND_DOWN;import static java.math.BigDecimal.ZERO" } answer = requests.post(url, data=json.dumps(data), headers=headers) response = answer.json() print(response)Contractvalidate()Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
Last updated on
Next to read:
ContractCall()Discard Changes
Do you want to discard your current changes and overwrite with the template?
Archive Synced Block
Message
Create new Template
What is this template's title?
Delete Template
Message