This project is demonstrating how CRE TypeScript SDK works. It contains TypeScript workflows that can be compiled to WASM.
- Bun 1.2.21 installed
Install dependencies:
bun installBefore first usage run the setup command. Setup will download the right Javy binary based on your operating system and will compile a version with the Chainlink CRE Javy Plugin included:
bun x cre-setupThis repository is fully compatible with the CRE CLI. You can use the CRE CLI to simulate the example workflows it provides.
The setup is done in a way that treats cre-sdk-examples root directory as a CRE project root. When simulating a workflow, you pass the path to the workflow directory you want to simulate.
Examples:
cre workflow simulate ./src/workflows/hello-worldcre workflow simulate ./src/workflows/http-fetchcre workflow simulate ./src/workflows/on-chaincre workflow simulate ./src/workflows/on-chain-writecre workflow simulate ./src/workflows/proof-of-reservecre workflow simulate ./src/workflows/star-warsIf you want use the CRE SDK to compile your workflows to WASM, choose any workflow you want to compile and run the following command:
bun x cre-compile <input.ts> <output.wasm>Example:
bun cre-compile src/workflows/hello-world/index.ts dist/hello-world.wasm