import { storage , logging } from "near-runtime-ts" ; export function incrementCounter ( value ) { const newCounter = storage . getPrimitive < i32 > ( "counter" , 0 ) + value ; storage . set < i32 > ( "counter" , newCounter ) ; logging . log ( "Counter is now: " + newCounter . toString ( ) ) ; } export function decrementCounter ( value ) { const newCounter = storage . getPrimitive < i32 > ( "counter" , 0 ) - value ; storage . set < i32 > ( "counter" , newCounter ) ; logging . log ( "Counter is now: " + newCounter . toString ( ) ) ; } export function getCounter ( ) { return storage . getPrimitive < i32 > ( "counter" , 0 ) ; } export function resetCounter ( ) { storage . set < i32 > ( "counter" , 0 ) ; logging . log ( "Counter is reset!" ) ; }