v2

latestOpenAPI 3.1.0Apache 2.02026-07-31441011.7 MB
Actions

Get details for all Web3 Actions

Retrieve the configuration details for all Web3 Actions created in a specific project.

get/v1/account/{accountSlug}/project/{projectSlug}/actions

Path parameters

accountSlugstring required

Account slug of the user

projectSlugstring required

Project slug of the account

Response

A successful response.

idstring required

ID of the Web3 Action.

projectIdstring required

ID of the project where Web3 Action is created.

namestring required

Web3 Action name.

descriptionstring required

Web3 Action description.

status'DEPLOYED' | 'PUBLISHED' required

Status of the Web3 Action.

stoppedboolean required

Flag showing if Web3 Action is stopped or not.

editableboolean required

Flag showing if Web3 Action is editable or not.

createdAtstring required

When Web3 Action is created.

Example response

[
  {
    "id": "4cc3ee95-6bc5-4c85-83d0-26d4b89d5c25",
    "projectId": "dfdc391a-a15d-4590-9aef-8691259c7df4",
    "name": "periodic-cron",
    "description": "every 1 hour",
    "status": "DEPLOYED",
    "stopped": false,
    "version": {
      "id": "65f4e0e8-4b67-4f0c-815f-1a08cd418f1a",
      "index": 1,
      "actionId": "4cc3ee95-6bc5-4c85-83d0-26d4b89d5c25",
      "parentActionId": "",
      "runtime": "V2",
      "function": "implementation:actionFn",
      "triggerType": "PERIODIC",
      "trigger": {
        "type": "periodic",
        "periodic": {
          "cron": "0 * * * *",
          "interval": "1h"
        }
      },
      "commitish": null,
      "source": "// Do not change function name.\nconst actionFn = async (context, periodicEvent) => {\n    console.log(periodicEvent)\n\n    // To access project's secret\n    // let secret = await context.secrets.get('MY-SECRET')\n\n    // To access project's storage\n    // let value = await context.storage.getStr('MY-KEY')\n    // await context.storage.putStr('MY-KEY', 'MY-VALUE')\n\n    // Your logic goes here :)\n}\n// Do not change this.\nmodule.exports = { actionFn }",
      "createdAt": "2023-12-14T16:20:36.078679Z",
      "deployRequested": false,
      "deployError": null,
      "invocationType": "SYNC"
    },
    "editable": true,
    "createdAt": "2023-12-14T16:20:36.078679Z",
    "deliveryChannels": null
  },
  {
    "id": "74e9f7d8-4a53-425c-912b-8d5cef87cef1",
    "projectId": "dfdc391a-a15d-4590-9aef-8691259c7df4",
    "name": "mainnet-block",
    "description": "Trigger on every 1000th block",
    "status": "DEPLOYED",
    "stopped": true,
    "version": {
      "id": "ac015512-fcca-4a94-b782-e1fb584d8aef",
      "index": 1,
      "actionId": "74e9f7d8-4a53-425c-912b-8d5cef87cef1",
      "parentActionId": "",
      "runtime": "V2",
      "function": "implementation:actionFn",
      "triggerType": "BLOCK",
      "trigger": {
        "type": "block",
        "block": {
          "network": [
            "1"
          ],
          "blocks": 1000
        }
      },
      "commitish": null,
      "source": "// Do not change function name.\nconst actionFn = async (context, blockEvent) => {\n    console.log(blockEvent)\n\n    // To access project's secret\n    // let secret = await context.secrets.get('MY-SECRET')\n\n    // To access project's storage\n    // let value = await context.storage.getStr('MY-KEY')\n    // await context.storage.putStr('MY-KEY', 'MY-VALUE')\n\n    // Your logic goes here :)\n}\n// Do not change this.\nmodule.exports = { actionFn }",
      "createdAt": "2023-12-13T00:37:13.821647Z",
      "deployRequested": false,
      "deployError": null,
      "invocationType": "ASYNC"
    },
    "editable": true,
    "createdAt": "2023-12-13T00:37:13.821647Z",
    "deliveryChannels": null
  },
  {
    "id": "be048c73-41c3-4fcd-b0c6-d286af7155fe",
    "projectId": "cbb49e29-24ad-4cf9-8b2d-1f34a3019582",
    "name": "instadapp-implementation",
    "description": "Track these 3 proposal events: add, remove & setDefault.",
    "status": "DEPLOYED",
    "stopped": false,
    "version": {
      "id": "34655755-771f-4da7-989e-ec2b27e8f13b",
      "index": 3,
      "actionId": "be048c73-41c3-4fcd-b0c6-d286af7155fe",
      "parentActionId": "",
      "runtime": "V1",
      "function": "instadappImplementation:implementationFn",
      "triggerType": "TRANSACTION",
      "trigger": {
        "type": "transaction",
        "transaction": {
          "status": [
            "MINED"
          ],
          "filter": {
            "any": [
              {
                "network": [
                  "1"
                ],
                "status": [],
                "value": [],
                "gasLimit": [],
                "gasUsed": [],
                "fee": [],
                "from": [],
                "to": [],
                "function": [],
                "eventEmitted": [
                  {
                    "contract": {
                      "address": "0xcba828153d3a85b30b5b912e1f2dacac5816ae9d",
                      "invocationType": "ANY"
                    },
                    "id": null,
                    "name": "LogSetDefaultImplementation"
                  },
                  {
                    "contract": {
                      "address": "0xcba828153d3a85b30b5b912e1f2dacac5816ae9d",
                      "invocationType": "ANY"
                    },
                    "id": null,
                    "name": "LogAddImplementation"
                  },
                  {
                    "contract": {
                      "address": "0xcba828153d3a85b30b5b912e1f2dacac5816ae9d",
                      "invocationType": "ANY"
                    },
                    "id": null,
                    "name": "LogRemoveImplementation"
                  }
                ],
                "logEmmitted": []
              }
            ],
            "and": null
          }
        }
      },
      "commitish": null,
      "source": "import {\n  ActionFn,\n  Context,\n  Event,\n  TransactionEvent,\n} from '@tenderly/actions';\n\n// TEST: Try manual trigger with this tx hash on Mainnet: 0x3bdf5a48174f7f8f7bfb2f43dbe399c47405bba1cea3480aa0c199270f262f7e\nexport const implementationFn: ActionFn = async (context: Context, event: Event) => {\n  let txEvent = event as TransactionEvent;\n  console.log('InstaDapp Implementation Event is detected');\n  // Shorten logs because it's too large to print\n  console.log({ ...txEvent, logs: txEvent.logs.splice(0, 5) });\n};\n",
      "createdAt": "2022-10-18T12:37:10.392964Z",
      "deployRequested": false,
      "deployError": null,
      "invocationType": "SYNC"
    },
    "editable": false,
    "createdAt": "2022-10-18T12:24:51.187849Z",
    "deliveryChannels": null
  },
  {
    "id": "785e140d-3a15-45c0-90a7-8c54bb41e562",
    "projectId": "cbb49e29-24ad-4cf9-8b2d-1f34a3019582",
    "name": "instadapp-governance-event",
    "description": "Track these 3 events: executed, queued & cancelled.",
    "status": "DEPLOYED",
    "stopped": false,
    "version": {
      "id": "9d8eaac3-85cc-4c48-a557-47c36b80dd52",
      "index": 3,
      "actionId": "785e140d-3a15-45c0-90a7-8c54bb41e562",
      "parentActionId": "",
      "runtime": "V1",
      "function": "instadappGovernance:governanceFn",
      "triggerType": "TRANSACTION",
      "trigger": {
        "type": "transaction",
        "transaction": {
          "status": [
            "MINED"
          ],
          "filter": {
            "any": [
              {
                "network": [
                  "1"
                ],
                "status": [],
                "value": [],
                "gasLimit": [],
                "gasUsed": [],
                "fee": [],
                "from": [],
                "to": [],
                "function": [],
                "eventEmitted": [
                  {
                    "contract": {
                      "address": "0x0204cd037b2ec03605cfdfe482d8e257c765fa1b",
                      "invocationType": "ANY"
                    },
                    "id": null,
                    "name": "ProposalCanceled"
                  },
                  {
                    "contract": {
                      "address": "0x0204cd037b2ec03605cfdfe482d8e257c765fa1b",
                      "invocationType": "ANY"
                    },
                    "id": null,
                    "name": "ProposalQueued"
                  },
                  {
                    "contract": {
                      "address": "0x0204cd037b2ec03605cfdfe482d8e257c765fa1b",
                      "invocationType": "ANY"
                    },
                    "id": null,
                    "name": "ProposalExecuted"
                  }
                ],
                "logEmmitted": []
              }
            ],
            "and": null
          }
        }
      },
      "commitish": null,
      "source": "import {\n  ActionFn,\n  Context,\n  Event,\n  TransactionEvent,\n} from '@tenderly/actions';\n\n// TEST: Try manual trigger with this tx hash on Mainnet: 0x338fda662797c4750d6c81bc261380ca4782cf8112227f53962f4fb60d13bbcb\nexport const governanceFn: ActionFn = async (context: Context, event: Event) => {\n  let txEvent = event as TransactionEvent;\n  console.log('InstaDapp Governance Event is detected');\n  // Shorten logs because it's too large to print\n  console.log({ ...txEvent, logs: txEvent.logs.splice(0, 2) });\n};\n",
      "createdAt": "2022-10-18T12:37:10.370654Z",
      "deployRequested": false,
      "deployError": null,
      "invocationType": "SYNC"
    },
    "editable": false,
    "createdAt": "2022-10-18T12:24:51.154171Z",
    "deliveryChannels": null
  },
  {
    "id": "02a83586-aabb-45c6-9ea5-23e089879b22",
    "projectId": "cbb49e29-24ad-4cf9-8b2d-1f34a3019582",
    "name": "blacklisted-addresses",
    "description": "This Web3 Action detects transactions that involve blacklisted addresses.",
    "status": "DEPLOYED",
    "stopped": false,
    "version": {
      "id": "900f7a5f-cb71-4f46-9e82-51fded6d8691",
      "index": 3,
      "actionId": "02a83586-aabb-45c6-9ea5-23e089879b22",
      "parentActionId": "",
      "runtime": "V1",
      "function": "blacklistedAddresses:blacklistedAddressFn",
      "triggerType": "TRANSACTION",
      "trigger": {
        "type": "transaction",
        "transaction": {
          "status": [
            "MINED"
          ],
          "filter": {
            "any": [
              {
                "network": [
                  "1"
                ],
                "status": [],
                "value": [],
                "gasLimit": [],
                "gasUsed": [],
                "fee": [],
                "from": [
                  {
                    "exact": "0xf38b4de019aca232711d7b7abae59adc93efc3e9"
                  },
                  {
                    "exact": "0x6B175474E89094C44Da98b954EedeAC495271d0F"
                  },
                  {
                    "exact": "0xa40dfee99e1c85dc97fdc594b16a460717838703"
                  }
                ],
                "to": [],
                "function": [],
                "eventEmitted": [],
                "logEmmitted": []
              }
            ],
            "and": null
          }
        }
      },
      "commitish": null,
      "source": "import {\n  ActionFn,\n  Context,\n  Event,\n  TransactionEvent,\n} from '@tenderly/actions';\n\n// TEST: Try manual trigger with this tx hash on Mainnet with write storage type: 0x7295b1bdfc6b277c10a4b8b6002183c005f4512a4d1537a0a81b0ff3eb6fe6c9\nexport const blacklistedAddressFn: ActionFn = async (context: Context, event: Event) => {\n  const blacklistedAddresses = [\n    '0xf38b4de019aca232711d7b7abae59adc93efc3e9',\n    '0x6B175474E89094C44Da98b954EedeAC495271d0F',\n    '0xa40dfee99e1c85dc97fdc594b16a460717838703',\n  ];\n  let txEvent = event as TransactionEvent;\n  console.log('Blacklisted Addresses:', blacklistedAddresses);\n  console.log(`Blacklisted Address: ${txEvent.from}`);\n  console.log(`Tx Hash: ${txEvent.hash}`);\n  console.log('Contains:', blacklistedAddresses.includes(txEvent.from));\n  await context.storage.putStr(`Blacklisted Address: ${txEvent.from}`, txEvent.hash);\n};\n",
      "createdAt": "2022-10-18T12:37:10.333383Z",
      "deployRequested": false,
      "deployError": null,
      "invocationType": "SYNC"
    },
    "editable": false,
    "createdAt": "2022-10-18T12:24:51.082156Z",
    "deliveryChannels": null
  }
]