Ok
const response = await fetch('https://alephium.nownodes.io/contracts/compile-project', {
method: 'POST',
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"code": "Contract Foo() {\n pub fn foo() -> () {}\n }\n TxScript Main(id: ByteVec) {\n Foo(id).foo() \n}",
"compilerOptions": {
"ignoreUnusedConstantsWarnings": true
}
}),
});
const data = await response.json();
{
"contracts": [
{
"version": "text",
"name": "text",
"bytecode": "text",
"bytecodeDebugPatch": "text",
"codeHash": "text",
"codeHashDebug": "text",
"fields": {
"names": [
"text"
],
"types": [
"text"
],
"isMutable": [
false
]
},
"functions": [
{
"name": "text",
"usePreapprovedAssets": false,
"useAssetsInContract": false,
"isPublic": false,
"paramNames": [
"text"
],
"paramTypes": [
"text"
],
"paramIsMutable": [
false
],
"returnTypes": [
"text"
]
}
],
"constants": [
{
"name": "text",
"value": {
"value": "text",
"type": "text"
}
}
],
"enums": [
{
"name": "text",
"fields": [
{
"name": "text",
"value": {
"value": "text",
"type": "text"
}
}
]
}
],
"events": [
{
"name": "text",
"fieldNames": [
"text"
],
"fieldTypes": [
"text"
]
}
],
"warnings": [
"text"
],
"maps": {
"names": [
"text"
],
"types": [
"text"
]
},
"stdInterfaceId": "text"
}
],
"scripts": [
{
"version": "text",
"name": "text",
"bytecodeTemplate": "text",
"bytecodeDebugPatch": "text",
"fields": {
"names": [
"text"
],
"types": [
"text"
],
"isMutable": [
false
]
},
"functions": [
{
"name": "text",
"usePreapprovedAssets": false,
"useAssetsInContract": false,
"isPublic": false,
"paramNames": [
"text"
],
"paramTypes": [
"text"
],
"paramIsMutable": [
false
],
"returnTypes": [
"text"
]
}
],
"warnings": [
"text"
]
}
],
"structs": [
{
"name": "text",
"fieldNames": [
"text"
],
"fieldTypes": [
"text"
],
"isMutable": [
false
]
}
],
"constants": [
{
"name": "text",
"value": {
"value": "text",
"type": "text"
}
}
],
"enums": [
{
"name": "text",
"fields": [
{
"name": "text",
"value": {
"value": "text",
"type": "text"
}
}
]
}
],
"warnings": [
"text"
]
}