Skip to content

Commit

Permalink
GITBOOK-19: added another code example
Browse files Browse the repository at this point in the history
  • Loading branch information
nadabots authored and gitbook-bot committed Feb 17, 2024
1 parent 71d841c commit f8bb200
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion guides/for-applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,25 @@ Near.asyncView("v1.nadabot.near", "is_human", { account_id: accountId }).then(
);

return <>{state.human && <span></span>}</>;

```
##
#### Check Contract for Human Score
```jsx
// check human score of account from https://near.social/mob.near/widget/WidgetSource?src=plugrel.near/widget/nadabot.checkHumanScore

const accountId = props.accountId ?? "odins_eyehole.near";
const staging = props.staging ?? false;
const contract = staging ? "v1.staging.nada.bot" : "v1.nadabot.near";
Near.asyncView(contract, "get_human_score", {
account_id: accountId,
}).then((result) => {
State.update({ score_result: result });
});
// console.log(state.score.score);
return <>{state.score_result && <span>{state.score_result.score}</span>}</>;
```
## VanillaJS
Expand Down

0 comments on commit f8bb200

Please sign in to comment.