guest-book-as
guest-book-as copied to clipboard
feat: Implement Guest Book contract and frontend with `near-sdk-js`
JS contract based Guest Book is available for preview at: https://think-in-universe.github.io/guest-book/
The PR includes
/contractthat is implemented withnear-sdk-js. Nownear-sdk-jsv0.2.0 includes theVectorcollection, so we can installnear-sdk-jsfrom npm.- The frontend is changed slightly to call
call_js_contractandview_js_contractmethods on JSVM. TheencodeCall()should be used very carefully to make the view and call functions work correctly.depositshould 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.
Code looks good! As Serhii said, you can use near-sdk-js from npm and avoid cloning near-sdk-js repo now.
@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.