Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/deprecated-near-examples/counter-as
Increment and decrement a counter with this simple smart contract via a web page.
https://github.com/deprecated-near-examples/counter-as
assemblyscript html javascript
Last synced: about 1 month ago
JSON representation
Increment and decrement a counter with this simple smart contract via a web page.
- Host: GitHub
- URL: https://github.com/deprecated-near-examples/counter-as
- Owner: deprecated-near-examples
- License: mit
- Created: 2020-03-18T15:56:18.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-04-07T21:04:00.000Z (over 1 year ago)
- Last Synced: 2024-09-03T17:01:36.293Z (4 months ago)
- Topics: assemblyscript, html, javascript
- Language: JavaScript
- Homepage:
- Size: 1.4 MB
- Stars: 33
- Watchers: 3
- Forks: 27
- Open Issues: 15
-
Metadata Files:
- Readme: README-Gitpod.md
- License: LICENSE
Awesome Lists containing this project
- awesome-near - Counter
README
Counter example in AssemblyScript - Gitpod version
==================================================This README is specific to Gitpod and this example. For local development, please see [README.md](README.md).
## Description
In Gitpod, the counter will start automatically. Please look in the terminal for a link to follow.
This contract implements simple counter backed by storage on blockchain.
Contract in `assembly/main.ts` provides methods to increment / decrement counter and get it's current value or reset.Plus and minus buttons increase and decrease value correspondingly. When button L is toggled, counter will add or minus 10 a time. RS button is for reset. LE and RE buttons to let the robot wink to you.
## To Test
```
yarn asp # as-pect tests
NODE_ENV=ci yarn jest # jest tests
NODE_ENV=ci yarn test # both
```## To Explore
- `assembly/main.ts` for the contract code
- `src/index.html` for the front-end HTML
- `src/main.js` for the JavaScript front-end code and how to integrate contracts
- `src/test.js` for the JS tests for the contract## Data collection
By using Gitpod in this project, you agree to opt-in to basic, anonymous analytics. No personal information is transmitted. Instead, these usage statistics aid in discovering potential bugs and user flow information.