We are pleased to announce that the NexScript Playground has been upgraded with major improvements. A full code editor has been added with five example contracts to help developers get started with coding advanced transactions. The playground is connected to the network, and you can write, test, and interact with the contracts straight from the website.
Try it now:
https://playground.nexscript.org
What’s NexScript Playground
NexScript playground is designed to write, test, and interact with the Nexa smart contracts. For developers familiar with smart contracting languages other than NexScript, such as Solidity, the playground can be compared to the Remix tool, designed to help easily interact with contracts on the Nexa blockchain.
Smart contracts on Nexa are stateless and UTXO-based. This model allows transactions to be verified independently and efficiently. Because there is no global state that can impact the execution of these smart contracts, the results are deterministic and predictable.
NexScript offers a strong abstraction for writing Nexa smart contracts, improving developer experience and reliability of contracts. Nexa transactions run on a virtual machine called the raw Nexa script, and writing bytecode for this virtual machine can be difficult and error-prone; that’s why it is much easier to use NexScript and the playground.
Upgrades on the Playground
The new piece in the playground is the Monaco editor upgraded to recognize NexScript. It highlights the language properly, including opcodes and script globals, and its autocomplete knows the difference between a base keyword and a member accessor, so what it offers you is what actually applies where your cursor is. When a build fails, the lines at fault are highlighted for you. You can keep several contracts open in tabs, and the app itself is tabbed too.
There are more upgrades to the playground:
- Browser alert boxes have been replaced with modals and toast notifications, and feedback appears inside the application.
- Bytecode and contract breakdown views were added, showing what the source compiled into.
- Artifact actions were moved into dropdown menus, keeping the available operations together in one place.
- Token support arrives with the fields already prefilled.
- A keyboard shortcut now triggers a build.
- Browser storage is scoped per network.
- The layout was rebuilt for both mobile and desktop.
Altogether, these updates are making the playground a very useful tool for every smart contract developer.
More Insights for Developers
There are two main changes in this round, of which the first is the compiler version selection. There is a standalone service that hosts multiple versions of the nexc compiler simultaneously, and the latest is nexc 1.1.0. The editor has a version selector if needed; however, the playground scans the pragma line in your contract and picks a compatible compiler for you. The service can also be used on its own as a standalone API.
The second is the connection to Nexa via its Rostrum service. Every screen used to spin up its own connection and rehydrate it on every request. There is a single provider wrapping Otoplo’s proven Electrum client held once per network and reused across the whole app. Switching networks disconnects from the old one and establishes a new connection.
To Wrap Up
With NexScript, developers can write smart contracts on Nexa, and with the upgraded playground, interacting with them is much easier and more convenient. There are more updates planned for it, and the team is currently working on them.
Appreciation for all this hard work goes to the Nexa developers Dolaned and Sickpig, who are actively working on the playground improvements.
If you have any questions, need any help, or have suggestions, please join our community groups, and the team will always be happy to help or address any needs.
Nexa Discord: https://discord.com/invite/WJhWUEYSse
Main Telegram group: https://t.me/nexacoin
Nexa Developers help: https://t.me/nexa_dev
NexScript Telegram group: https://t.me/nexscript
