guest-book-as icon indicating copy to clipboard operation
guest-book-as copied to clipboard

feat: Implement Guest Book contract and frontend with `near-sdk-js`

Open think-in-universe opened this issue 3 years ago • 2 comments

JS contract based Guest Book is available for preview at: https://think-in-universe.github.io/guest-book/

The PR includes

  1. /contract that is implemented with near-sdk-js. Now near-sdk-js v0.2.0 includes the Vector collection, so we can install near-sdk-js from npm.
  2. The frontend is changed slightly to call call_js_contract and view_js_contract methods on JSVM. The encodeCall() should be used very carefully to make the view and call functions work correctly. deposit should be attached with some NEAR by default for each call to cover storage cost.

The intent of the PR is not to merge the JS contract right now, but to make it easy to review the required common changes to migrate from AS contract to JS contract.

think-in-universe avatar May 24 '22 10:05 think-in-universe

Code looks good! As Serhii said, you can use near-sdk-js from npm and avoid cloning near-sdk-js repo now.

ailisp avatar Jun 01 '22 02:06 ailisp

@volovyk-s @ailisp I have updated package.json with near-sdk-js from npm and updated README using near-cli JS commands for deploy and init.

I didn't update the frontend code. maybe it's a good idea to have a standalone guest-book example for JS contract and frontend. let me know how you think.

think-in-universe avatar Jun 03 '22 08:06 think-in-universe