diff --git a/examples/src/counter.ts b/examples/src/counter.ts index b8b053b67..15244865d 100644 --- a/examples/src/counter.ts +++ b/examples/src/counter.ts @@ -1,13 +1,13 @@ -import { NearContract, NearBindgen, near, call, view } from 'near-sdk-js' +import { NearBindgen, near, call, view, initialize } from 'near-sdk-js' import { isUndefined } from 'lodash-es' import { log } from './log' @NearBindgen -class Counter extends NearContract { +class Counter { count: number; - - constructor({ initial = 0 }: { initial: number }) { - super() + + @initialize + init({ initial = 0 }: { initial: number }) { this.count = initial } @@ -34,9 +34,5 @@ class Counter extends NearContract { getCount(): number { return this.count } - - default() { - return new Counter({ initial: 0 }) - } }