Quickstart
In this section, we'll setup execute sdk, and write our very first trigger
and action
!
In a node project, go ahead and
- first install the execute sdk by running
npm install @executehq/sdk
- then lets initiate our execute sdk
import Execute from "@execute/sdk";
const { execute, triggers, actions } = new Execute("access-key", "secret-key");
need an API key pair? reach out to us at team@execute.dev
- now lets make our app and deploy it
const main = async () => {
const app = execute.new();
const deployedApp = await app
.addTrigger(triggers.eth.onEvent("contractAddress", "eventName"))
.addAction(
actions.eth.callContract("contractAddress", "methodName", ["parameters"]),
)
.deploy();
console.log(x);
};
lets go through what we just wrote:
.addTrigger
this method takes in a trigger from thetriggers object
.addAction
this method takes in an action from theactions object
- and lastly calling
.deploy()
deploys it on execute
yay! 🥳you just wrote your first execute app!
show us your app working by tagging us on twitter (@execute_dev)