Skip to content

Commit

Permalink
added schema
Browse files Browse the repository at this point in the history
  • Loading branch information
gagdiez committed Aug 5, 2024
1 parent aa30d11 commit df7a308
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
3 changes: 1 addition & 2 deletions contract-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"type": "module",
"scripts": {
"build": "near-sdk-js build src/contract.ts build/counter.wasm",
"test": "$npm_execpath build && ava -- ./build/counter.wasm",
"deploy": "npm run build && bash ./scripts/cli_deploy.sh"
"test": "$npm_execpath run build && ava -- ./build/counter.wasm"
},
"dependencies": {
"near-sdk-js": "2.0.0"
Expand Down
7 changes: 0 additions & 7 deletions contract-ts/scripts/cli_deploy.sh

This file was deleted.

4 changes: 4 additions & 0 deletions contract-ts/src/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import { NearBindgen, near, call, view } from 'near-sdk-js'
class Counter {
val: number = 0;

static schema = {
number: 'number'
}

@view({}) // Public read-only method: Returns the counter value.
get_num(): number {
return this.val
Expand Down

0 comments on commit df7a308

Please sign in to comment.