create-near-app 5.0.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -4,15 +4,15 @@ import { NearBindgen, near, call, view } from 'near-sdk-js';
|
|
|
4
4
|
class HelloNear {
|
|
5
5
|
greeting: string = "Hello";
|
|
6
6
|
|
|
7
|
-
@view // This method is read-only and can be called for free
|
|
7
|
+
@view({}) // This method is read-only and can be called for free
|
|
8
8
|
get_greeting(): string {
|
|
9
9
|
return this.greeting;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
@call // This method changes the state, for which it cost gas
|
|
12
|
+
@call({}) // This method changes the state, for which it cost gas
|
|
13
13
|
set_greeting({ message }: { message: string }): void {
|
|
14
14
|
// Record a log permanently to the blockchain!
|
|
15
15
|
near.log(`Saving greeting ${message}`);
|
|
16
16
|
this.greeting = message;
|
|
17
17
|
}
|
|
18
|
-
}
|
|
18
|
+
}
|
|
@@ -43,7 +43,7 @@ export function EducationalText() {
|
|
|
43
43
|
</p>
|
|
44
44
|
<ol>
|
|
45
45
|
<li>
|
|
46
|
-
Look in <code>
|
|
46
|
+
Look in <code>frontend/App.js</code> - you'll see <code>getGreeting</code> and <code>setGreeting</code> being called on <code>contract</code>. What's this?
|
|
47
47
|
</li>
|
|
48
48
|
<li>
|
|
49
49
|
Ultimately, this <code>contract</code> code is defined in <code>./contract</code> – this is the source code for your <a target="_blank" rel="noreferrer" href="https://docs.near.org/docs/develop/contracts/overview">smart contract</a>.</li>
|