Simple wrapper around @ton/sandbox.
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,
"arguments": [], # get-method arguments
"address": "EQ...", # contract address
"expected": ["int", "int", "address", "metadata", "cell_hash"], # method signature
"parse_list": true # parse output as a lisp-style list
}
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 hashboc
- returns base64 representation of cellstring
- returns string representation of slicemetadata
- reads TEP-64 metadata
Returns list of results
{
"exit_code": 0,
"gasUsed": 685,
"result": [
12312321,
-1,
"EQ_________________________________1",
{
"content_layout": "on-chain",
"content": {
"name": "Name",
"symbol": "Symbol"
}
},
"zScFSDDDSN1XMaS2UzYDDDejOtgpJSFpCK0sh8VDKUo="
],
.... // some other debug stuff
}
If the contract uses masterchain libs executor will detect it and will try
to request it using dton.io. To avoid repeatedly
requests one could use caching by providing LIBRARY_CACHE
env with the cache
file name like this:
LIBRARY_CACHE=mc_libs.txt node executor.js