pub enum OtherContractExecuteMsg {
ReceiveOutput { output: String },
}
This interface allows for the transmission of JavaScript code execution results to another contract.
When minting, it is mandatory to set the destination
field (address of the other contract).
$ archway contracts build
$ archway contracts store gateway721
$ archway contracts instantiate gateway721 --args '{
"name": "Gateway 721",
"symbol": "GW721"
}'
$ archway contracts metadata gateway721 --owner-address "archway1r0cmlns8ta3hckzlpalennsxxv5erfgnz3qq0s" --rewards-address "archway1r0cmlns8ta3hckzlpalennsxxv5erfgnz3qq0s"
# archway contracts premium gateway721 --premium-fee "1000000000000000000aconst"
$ archway contracts execute gateway721 --args '{
"mint": {
"token_id": "0",
"owner": "archway1dqqfypr9a98czeh23a64eh6a0y7cqhycrzsm6a",
"extension": {
"code": "function addNumbers(params) { const { a, b } = params; return a + b; } mainFunction = addNumbers;"
}
}
}'
$ archway contracts execute gateway721 --args '{
"mint": {
"token_id": "1",
"owner": "archway1dqqfypr9a98czeh23a64eh6a0y7cqhycrzsm6a",
"extension": {
"code": "function calculateCircleArea(params) { const { radius } = params; const area = Math.PI * Math.pow(radius, 2); return area; } mainFunction = calculateCircleArea;"
}
}
}'
$ archway contracts execute gateway721 --args '{
"request": {
"token_id": "0",
"input": "{ \"a\": 5, \"b\": 3 }"
}
}'
$ archway contracts execute gateway721 --args '{
"request": {
"token_id": "0",
"input": "{ \"a\": 1, \"b\": 2 }"
}
}'
$ archway contracts execute gateway721 --args '{
"request": {
"token_id": "1",
"input": "{ \"radius\": 10 }"
}
}'
$ archway contracts execute gateway721 --args '{
"response": {
"token_id": "0",
"task_id": "0",
"output": "8"
}
}'
$ archway contracts execute gateway721 --args '{
"update": {
"token_id": "1",
"title": "Circle Area Calculation",
"description": "Calculates the area of a circle given its radius."
}
}'
$ archway contracts query smart gateway721 --args '{
"nft_info": {
"token_id": "0"
}
}'
$ archway contracts query smart gateway721 --args '{
"remains": {
"token_id": "0"
}
}'
$ archway contracts query smart gateway721 --args '{"incomplete_projects": {}}'
$ archway contracts query smart gateway721 --args '{"num_tokens": {}}'