diff --git a/contract-ts/package.json b/contract-ts/package.json index 827180b..a8c7dcf 100644 --- a/contract-ts/package.json +++ b/contract-ts/package.json @@ -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" diff --git a/contract-ts/scripts/cli_deploy.sh b/contract-ts/scripts/cli_deploy.sh deleted file mode 100755 index 411172e..0000000 --- a/contract-ts/scripts/cli_deploy.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -# generate random account -uuid=$(uuidgen | tr 'A-Z' 'a-z') -CONTRACT="counter-"${uuid:0:10}".testnet" - -near create-account $CONTRACT --useFaucet -near deploy $CONTRACT ./build/counter.wasm diff --git a/contract-ts/src/contract.ts b/contract-ts/src/contract.ts index 50c67bb..ad26755 100644 --- a/contract-ts/src/contract.ts +++ b/contract-ts/src/contract.ts @@ -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