diff --git a/.eslintignore b/.eslintignore
new file mode 100644
index 000000000..eafd89abc
--- /dev/null
+++ b/.eslintignore
@@ -0,0 +1,3 @@
+node_modules/
+lib/
+example/
\ No newline at end of file
diff --git a/.eslintrc.js b/.eslintrc.js
new file mode 100644
index 000000000..69876861f
--- /dev/null
+++ b/.eslintrc.js
@@ -0,0 +1,91 @@
+module.exports = {
+ env: {
+ commonjs: true,
+ browser: true,
+ es6: true,
+ node: true,
+ jest: true,
+ },
+ parser: "@typescript-eslint/parser",
+ parserOptions: {
+ project: ["tsconfig.json"],
+ ecmaFeatures: {
+ jsx: true,
+ modules: true,
+ },
+ ecmaVersion: 6,
+ sourceType: "module",
+ },
+ plugins: [
+ "@typescript-eslint",
+ "prettier",
+ "react",
+ "react-hooks"
+ ],
+ extends: [
+ "eslint:recommended",
+ "plugin:@typescript-eslint/recommended",
+ "plugin:react/recommended",
+ "prettier",
+ ],
+ rules: {
+ "prettier/prettier": ["error", require("./prettier.config")],
+ "@typescript-eslint/ban-ts-comment": "off",
+ "@typescript-eslint/explicit-module-boundary-types": "off",
+ "@typescript-eslint/explicit-function-return-type": "off",
+ "@typescript-eslint/no-non-null-asserted-optional-chain": "off",
+ "@typescript-eslint/naming-convention": ["error", {
+ "selector": "variableLike",
+ "format": ["camelCase", "PascalCase", "UPPER_CASE"]
+ }],
+ "@typescript-eslint/no-explicit-any": "error",
+ "@typescript-eslint/no-empty-interface": "error",
+ "@typescript-eslint/no-non-null-assertion": "off",
+ "@typescript-eslint/no-var-requires": "warn",
+ "@typescript-eslint/no-use-before-define": "error",
+ "@typescript-eslint/type-annotation-spacing": "error",
+ "@typescript-eslint/no-unused-vars": "error",
+ "@typescript-eslint/ban-ts-ignore": "off",
+ "eqeqeq": ["error", "smart"],
+ "default-case": "off",
+ "no-caller": "error",
+ "no-case-declarations": "off",
+ "no-console": "error",
+ "no-debugger": "error",
+ "no-eval": "error",
+ "no-fallthrough": "error",
+ "no-labels": "warn",
+ "no-redeclare": "error",
+ "no-shadow": "off",
+ "@typescript-eslint/no-shadow": "error",
+ "no-unused-expressions": "error",
+ "radix": ["error", "as-needed"],
+ "no-restricted-syntax": [
+ "error",
+ {
+ "selector": "CallExpression[callee.name!='parseInt'] > Identifier[name='parseInt']",
+ "message": "Call parseInt directly to guarantee radix param is not incorrectly provided"
+ },
+ "error",
+ {
+ "selector": "CallExpression[callee.name!='parseFloat'] > Identifier[name='parseFloat']",
+ "message": "Call parseFloat directly to guarantee radix param is not incorrectly provided"
+ }
+ ],
+ "strict": ["error", "global"],
+ "valid-jsdoc": "error",
+ "react/jsx-uses-react": "error",
+ "react/react-in-jsx-scope": "error",
+ "react/jsx-no-target-blank": "off",
+ "react/no-unescaped-entities": "off",
+ "react/prop-types": "off",
+ "react-hooks/rules-of-hooks": "error",
+ "react-hooks/exhaustive-deps": "warn",
+ "react/display-name": "off",
+ },
+ settings: {
+ react: {
+ version: "detect",
+ },
+ },
+}
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 000000000..212566614
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+* text=auto
\ No newline at end of file
diff --git a/.github/workflows/pr-actions.yaml b/.github/workflows/pr-actions.yaml
new file mode 100644
index 000000000..e9a1eb84a
--- /dev/null
+++ b/.github/workflows/pr-actions.yaml
@@ -0,0 +1,35 @@
+name: PR Actions
+
+on:
+ pull_request:
+ branches:
+ - main
+ - dev
+
+env:
+ CI: true
+
+jobs:
+ test:
+ name: Test Suite
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout Repository
+ uses: actions/checkout@v2
+ - name: Use Node.js
+ uses: actions/setup-node@v2
+ with:
+ node-version: "16.x"
+ - name: Install NPM Dependencies
+ run: npm install
+ - name: Run Build
+ run: npm run build
+ - name: Run Linting
+ run: npm run lint
+ - name: Run Unit & Integration Tests
+ run: npm test
+ # - name: Install Playwright Dependencies
+ # run: sudo npx playwright install-deps
+ # - name: Run End-to-End Tests
+ # run: npm run test:e2e
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 1ccc52a7f..ffca93a56 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,7 @@
/node_modules
-/lib
\ No newline at end of file
+/lib
+/.jest
+
+# IDEs and editors
+/.idea
+/.vscode
\ No newline at end of file
diff --git a/.npmignore b/.npmignore
new file mode 100644
index 000000000..4949f0980
--- /dev/null
+++ b/.npmignore
@@ -0,0 +1 @@
+example/
\ No newline at end of file
diff --git a/README.md b/README.md
index ac80b7b8c..7c3d3e9d1 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,153 @@
-# near-walletselector
+# NEAR Wallet Selector
+
+The NEAR Wallet Selector makes it easy for users to interact with your dApp. This package presents a modal to switch between a number of supported wallet types:
+
+- [NEAR Wallet](https://wallet.near.org/) - Web wallet.
+- [Sender Wallet](https://chrome.google.com/webstore/detail/sender-wallet/epapihdplajcdnnkdeiahlgigofloibg) - Browser extension wallet.
+- [Ledger](https://www.ledger.com/) - Hardware wallet.
+
+## Installation and Usage
+
+The easiest way to use `near-wallet-selector` is to install it from NPM:
+
+```bash
+npm install near-wallet-selector
+```
+
+Then use it in your dApp:
+
+```ts
+import NearWalletSelector from "near-wallet-selector";
+
+const near = new NearWalletSelector({
+ wallets: ["near-wallet", "sender-wallet", "ledger-wallet"],
+ networkId: "testnet",
+ theme: "light",
+ contract: {
+ accountId: "guest-book.testnet",
+ viewMethods: ["getMessages"],
+ changeMethods: ["addMessage"],
+ },
+ walletSelectorUI: {
+ description: "Please select a wallet to connect to this dApp:",
+ explanation: [
+ "Wallets are used to send, receive, and store digital assets.",
+ "There are different types of wallets. They can be an extension",
+ "added to your browser, a hardware device plugged into your",
+ "computer, web-based, or as an app on your phone.",
+ ].join(" "),
+ }
+});
+```
+
+## API Reference
+
+Init:
+
+```ts
+await near.init();
+```
+
+Show modal:
+
+```ts
+near.show();
+```
+
+Hide modal:
+
+```ts
+near.hide();
+```
+
+Sign in (programmatically):
+
+```ts
+await near.signIn("near-wallet");
+```
+
+Sign out:
+
+```ts
+await near.signOut();
+```
+
+Is signed in:
+
+```ts
+await near.isSignedIn();
+```
+
+Get account:
+
+```ts
+const account = await near.getAccount();
+```
+
+Add event listeners:
+
+```ts
+near.on("signIn", () => {
+ // your code
+});
+
+near.on("signOut", () => {
+ // your code
+});
+```
+
+Remove event listeners:
+
+```ts
+// Method 1:
+const subscription = near.on("signIn", () => {
+ // your code
+});
+
+subscription.remove();
+
+// Method 2:
+const handleSignIn = () => {
+ // your code
+}
+
+near.on("signIn", handleSignIn);
+near.off("signIn", handleSignIn);
+```
+
+Interact with the Smart Contract:
+
+```ts
+// Retrieve messages via RPC endpoint (view method).
+const messages = await near.contract.view({ methodName: "getMessages" });
+
+// Send a message, modifying the blockchain (change method).
+await near.contract.call({
+ actions: [{
+ methodName: "addMessage",
+ args: { text: message.value },
+ gas: "30000000000000",
+ deposit: "10000000000000000000000"
+ }]
+});
+
+// Retrieve contract accountId.
+const accountId = near.contract.getAccountId();
+```
+
+## Example Integration
+
+A variation of the [guest-book](https://github.com/near-examples/guest-book/) example project can be found in the `example` directory. You can use this to gain a concrete understanding of how to integrate this package into your own dApp.
+
+Contributors to this package may also find this integration useful as it provides a quick and consistent way of manually testing new changes and/or bugs. Below is a common workflow you can use:
+
+- Navigate to the `example` directory.
+- Execute `npm link ../` to create a symlink locally.
+- Execute `npm install`.
+- Execute `npm run watch` to watch both `src` directories and automatically recompile.
+
+## Editor Setup
+
+This project uses [ESLint](https://eslint.org/) (with [Prettier](https://prettier.io/)) to enforce a consistent coding style. It's important that you configure your editor correctly to avoid issues when you're ready to open a Pull Request.
+
+Although this project uses Prettier, it's simply an "internal" dependency to our ESLint configuration. This is because we want Prettier to handle code styling while avoiding conflicts with ESLint which specifically focuses on potentially problematic code. As a result, **it's important that you switch off Prettier in your editor and ensure only ESLint is enabled**.
diff --git a/__tests__/example.spec.tsx b/__tests__/example.spec.tsx
new file mode 100644
index 000000000..49f3d494b
--- /dev/null
+++ b/__tests__/example.spec.tsx
@@ -0,0 +1,13 @@
+import React from "react";
+import { render } from "@testing-library/react";
+
+it("works", () => {
+ const component = render(
+
+ Hello World!
+
+ );
+ const text = component.getByText("Hello World!");
+
+ expect(text).toBeInTheDocument();
+});
diff --git a/e2e/example.e2e.ts b/e2e/example.e2e.ts
new file mode 100644
index 000000000..e6cd86140
--- /dev/null
+++ b/e2e/example.e2e.ts
@@ -0,0 +1,7 @@
+import { test, expect } from "@playwright/test";
+
+test("basic test", async ({ page }) => {
+ await page.goto("https://playwright.dev/");
+ await page.locator("text=Get started").click();
+ await expect(page).toHaveTitle(/Getting started/);
+});
diff --git a/example/.editorconfig b/example/.editorconfig
new file mode 100644
index 000000000..7059cd928
--- /dev/null
+++ b/example/.editorconfig
@@ -0,0 +1,5 @@
+# https://EditorConfig.org
+
+[*]
+indent_style = space
+indent_size = 2
diff --git a/example/.eslintignore b/example/.eslintignore
new file mode 100644
index 000000000..3191ead19
--- /dev/null
+++ b/example/.eslintignore
@@ -0,0 +1,3 @@
+node_modules/
+out/
+dist/
diff --git a/example/.eslintrc.yml b/example/.eslintrc.yml
new file mode 100644
index 000000000..154438eaa
--- /dev/null
+++ b/example/.eslintrc.yml
@@ -0,0 +1,13 @@
+env:
+ es2021: true
+ node: true
+extends:
+ - 'eslint:recommended'
+ - 'plugin:@typescript-eslint/recommended'
+parser: '@typescript-eslint/parser'
+parserOptions:
+ ecmaVersion: 12
+ sourceType: module
+plugins:
+ - '@typescript-eslint'
+rules: {}
diff --git a/example/.gitignore b/example/.gitignore
new file mode 100644
index 000000000..1ca358bae
--- /dev/null
+++ b/example/.gitignore
@@ -0,0 +1,13 @@
+.cache/
+dist/
+node_modules/
+out/
+
+# ignore accounts generated by tests
+neardev/shared-test/*
+# but not the original test.near.json account
+!neardev/shared-test/test.near.json
+
+# ignore any default network private keys and dev-account
+neardev/default/*
+neardev/dev-account*
diff --git a/example/LICENSE b/example/LICENSE
new file mode 100644
index 000000000..5f49e39bd
--- /dev/null
+++ b/example/LICENSE
@@ -0,0 +1,25 @@
+Copyright 2020 NEAR Inc
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/example/LICENSE-APACHE b/example/LICENSE-APACHE
new file mode 100644
index 000000000..1b5ec8b78
--- /dev/null
+++ b/example/LICENSE-APACHE
@@ -0,0 +1,176 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
diff --git a/example/README-Gitpod.md b/example/README-Gitpod.md
new file mode 100644
index 000000000..2ac1ae4b7
--- /dev/null
+++ b/example/README-Gitpod.md
@@ -0,0 +1,59 @@
+Guest Book - Gitpod version
+===========================
+
+Sign in with [NEAR] and add a message to the guest book! A starter app built with an [AssemblyScript] backend and a [React] frontend.
+
+This README is specific to Gitpod and this example. For local development, please see [README.md](README.md).
+
+Exploring The Code
+==================
+
+1. The backend code lives in the `/assembly` folder. This code gets deployed to
+ the NEAR blockchain when you run `yarn deploy:contract`. This sort of
+ code-that-runs-on-a-blockchain is called a "smart contract" – [learn more
+ about NEAR smart contracts][smart contract docs].
+2. The frontend code lives in the `/src` folder.
+ [/src/index.html](/src/index.html) is a great place to start exploring. Note
+ that it loads in `/src/index.js`, where you can learn how the frontend
+ connects to the NEAR blockchain.
+3. Tests: there are different kinds of tests for the frontend and backend. The
+ backend code gets tested with the [asp] command for running the backend
+ AssemblyScript tests, and [jest] for running frontend tests. You can run
+ both of these at once with `yarn test`.
+
+Both contract and client-side code will auto-reload as you change source files.
+
+
+Using
+======
+
+Gitpod has taken care of installing all the necessary tools and dependencies. At the bottom of Gitpod is a terminal which will display a link to follow:
+
+
+ Server running at http://localhost:1234
+
+
+A small dialog appears showing options similar to this:
+
+![A Gitpod dialog box saying 'A service is available on port 1234' and giving options to 'Open Preview' or 'Open Browser'](assets/gitpod-port-1234.jpg)
+
+The "Open Preview" option will open the site in a tab within the IDE. Note that Gitpod may need a little time to spin up the website. It's possible this step might require reloading after a brief pause.
+
+The "Open Browser" option will open a new tab in your browser. Either option will work and is up to your preference.
+
+Once you've opened the web app in your browser, log in and experiment with the simple "guest book" smart contract.
+
+The "Save" button sends the text input to the blockchain, storing it as a string. The web app will reload with the new guest book messages automatically.
+
+The "Save & Donate" button demonstrates attaching NEAR and a gas price when calling the smart contract's method `addMessage`. When the web app refreshes with "paid" messages, the user interface highlights them.
+
+Data collection
+===============
+By using Gitpod in this project, you agree to opt-in to basic, anonymous analytics. No personal information is transmitted. Instead, these usage statistics aid in discovering potential bugs and user flow information.
+
+ [smart contract docs]: https://docs.near.org/docs/develop/contracts/overview
+ [asp]: https://www.npmjs.com/package/@as-pect/cli
+ [jest]: https://jestjs.io/
+ [NEAR]: https://near.org/
+ [AssemblyScript]: https://www.assemblyscript.org/introduction.html
+ [React]: https://reactjs.org
diff --git a/example/README.md b/example/README.md
new file mode 100644
index 000000000..a99ac26b1
--- /dev/null
+++ b/example/README.md
@@ -0,0 +1,116 @@
+Guest Book
+==========
+
+[![Build Status](https://travis-ci.com/near-examples/guest-book.svg?branch=master)](https://travis-ci.com/near-examples/guest-book)
+
+[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/near-examples/guest-book)
+
+
+
+Sign in with [NEAR] and add a message to the guest book! A starter app built with an [AssemblyScript] backend and a [React] frontend.
+
+
+Quick Start
+===========
+
+To run this project locally:
+
+1. Prerequisites: Make sure you have Node.js ≥ 12 installed (https://nodejs.org).
+2. Run the local development server: `npm install && npm run watch` (see `package.json` for a
+ full list of `scripts` you can run with `npm run
+