Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add @run-wasm/clarity package and /clarity page #112

Merged
merged 4 commits into from
Apr 12, 2022
Merged

Conversation

mcintyre94
Copy link
Contributor

@mcintyre94 mcintyre94 commented Apr 12, 2022

This PR adds support for the Clarity REPL in a new @run-wasm/clarity package.

It also adds a new example page /clarity demonstrating the new package

Notes:

  • The clarity-repl JS package comes with a file clarity_repl_bg.wasm which seems to be used by default in init(). But in Next this isn't working correctly (it can't resolve that URL), so I've copied it into public/ in the example app
  • I've added support for initCode which runs before each run(code) call. In the example app it's used to mint STX to the address the code runs as, meaning that STX transfers can work correctly
  • State resets when you call clarityClient.initialise(). In the example app I call that before each run but clients can call run(code) multiple times with eg. balances/token state maintained between runs too

Demo: https://run-wasm-git-cm-clarity-sliphq.vercel.app/clarity

@vercel
Copy link

vercel bot commented Apr 12, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/sliphq/run-wasm/9o9kZM37V2bhomkibqiYsEwCSHYv
✅ Preview: https://run-wasm-git-cm-clarity-sliphq.vercel.app

Copy link

@malerba118 malerba118 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, cool stuff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants