Skip to content

Latest commit

 

History

History

contracts_executor

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Contract executor HTTP API

Simple wrapper around great tool from ton-community: ton-contract-executor. Starts an HTTP server with POST /execute method:

{
    "code": "te6cckECDQEA...", # base64 encoded code cell
    "data": "te6cckECDQEA...", # base64 encoded data cell
    "method": "get_data", # get-method data
    "expected": ["int", "int", "address", "metadata", "cell_hash"] # method signature
}

expected field should contain a list of expected value types for the method being executed. It is required to format returned value from internal representation to some meaningful form. Supported types:

  • int - converts BN to number (returned as string, not int)
  • address - reads address from slice and converts to friendly format (EQ..)
  • cell_hash - computes Cell hash
  • metadata - reads TEP-64 metadata

Returns list of results

{
    "type": "success",
    "exit_code": 0,
    "gas_consumed": 685,
    "result": [
        12312321,
        -1,
        "EQ_________________________________1",
        {
            "content_layout": "on-chain",
            "content": {
                "name": "Name",
                "symbol": "Symbol"
            }
        },
        "zScFSDDDSN1XMaS2UzYDDDejOtgpJSFpCK0sh8VDKUo="
    ],
    "action_list_cell": {
        "refs": [],
        "kind": "ordinary",
        "bits": {}
    },
    "logs": "",
    "actionList": [],
    "debugLogs": []
}