Getting Started
Installing the CashScript compiler
The command line CashScript compiler cashc
can be installed from NPM.
Installing the JavaScript SDK
The JavaScript SDK can be installed into your project with NPM.
caution
CashScript only offers a JavaScript SDK, but CashScript contracts can be integrated into other languages as well. Because there are no ready-to-use SDKs available for them, this is considered advanced usage, and it is recommended to use the JavaScript SDK.
Writing your first smart contract
There are some examples available on the Examples page, that can be used to take inspiration from. Further examples of the JavaScript integration can be found on GitHub. A simple example is included below.
tip
Read more about the CashScript language syntax in the Language Description.
Integrating into JavaScript
While more detailed examples are available on GitHub, we show an integration of the TransferWithTimeout
contract in a JavaScript project.
After compiling the contract file to an artifact JSON with cashc, it can be imported into the CashScript SDK.
tip
Read more about the JavaScript SDK in the SDK documentation.