Developer's Hub
v1.0
API Reference
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?
GetContractByAddress()
Copy Markdown
Open in ChatGPT
Open in Claude
Summary
| Route | Type | Example |
|---|---|---|
| /contract/getbyaddress | POST | http://apinode.credits.com/api/contract/getbyaddress |
Description
Get smart contract source code by its address.
Request
Request Structure
JSON
x
{// Parameters common for all requests"PublicKey": "base58_string", // Smart contract address in Base58“compressed”: boolean value // Indicator of data compression true or false}Request Parameters
string: PublicKey - Smart contract address in Base58
bool: Compressed - Request compressed data True or False
Response
JSON output depends on the request type and its success.
If there’s an error, request returns to the node basic Result:
- Success: False
- Message:
If successful, requested information is returned.
Response Structure
JSON
{ "gZipped":Bytes, // Source code of smart contract Compressed "sourceString":"String", // Source code of smart contract in String Value "success":bool, // Shows if request was Succes or False Boolean Value "message":"String" // Shows if a problem occurred with request in String Value}Example Code
Python
C#
C++
import requestsimport jsondef Getcontractbyaddres(): url = 'http://apinode.credits.com/api/contract/getbyaddress' headers = { 'Content-type': 'application/json' , 'Accept': 'application/json' , 'Content-Encoding': 'utf-8' } data = { "NetworkAlias":"Mainnet" , "PublicKey":"4WsH74PEaiZkKCm853KTUpMfUzegybsJrf8ZvN2bevac" , "compressed ": False } answer = requests.post(url, data=json.dumps(data), headers=headers) response = answer.json() print(response)Getcontractbyaddres()Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
Last updated on
Next to read:
GetContractFromTransaction()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