Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v6.0.0 Release (dev -> main) #406

Merged
merged 121 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
030641a
Fixed MyNearWallet logo, url, name
followdarko Jul 4, 2022
d5e6c3b
Revert "Fixed MyNearWallet logo, url, name"
followdarko Jul 5, 2022
93b78ac
Tuned MyNearWallet production url and displayed name
followdarko Jul 5, 2022
c545fe1
Merge pull request #346 from followdarko/fix/mynearwallet
kujtimprenkuSQA Jul 5, 2022
12e6966
Created next js example
kujtimprenkuSQA Jul 8, 2022
6d0fbe9
Fixed conflicting eslint rules between next and react, moved react es…
kujtimprenkuSQA Jul 8, 2022
766a636
Align meta tags with other examples
kujtimprenkuSQA Jul 8, 2022
bda301d
Added deploy script for angular example
kujtimprenkuSQA Jul 8, 2022
3ede0fd
Replace projectId with a placeholder
kujtimprenkuSQA Jul 8, 2022
56e47d5
Removed react example
kujtimprenkuSQA Jul 8, 2022
2a3be23
Renamed next.js example to react
kujtimprenkuSQA Jul 8, 2022
78ac65a
Updated docs
kujtimprenkuSQA Jul 8, 2022
fc421f0
Fixed eslint
kujtimprenkuSQA Jul 8, 2022
9b21ecc
Merge pull request #347 from near/SQC-194/add-next-js-demo
kujtimprenkuSQA Jul 8, 2022
399f996
Adding Meteor Wallet to the project
lostpebble Jul 11, 2022
18b4ac4
Add @meteorwallet/sdk dep to the root package.json
lostpebble Jul 12, 2022
eed70c8
[meteor-wallet] Lint and readme fixes
lostpebble Jul 12, 2022
74faddd
[meteor-wallet] Updated root Readme with Meteor Wallet info
lostpebble Jul 12, 2022
bc6ed45
[meteor-wallet] Revert a minor wrong change while rebasing onto dev
lostpebble Jul 12, 2022
df5bad0
[meteor-wallet] Updated SDK. got examples working. Minor edits to cle…
lostpebble Jul 12, 2022
07d9a5e
[meteor-wallet] Cleaned up the sign-in action, as well as added a che…
lostpebble Jul 12, 2022
b5e479a
[meteor-wallet] Changed name from meteor to meteor-wallet in relevant…
lostpebble Jul 13, 2022
6235793
Merge pull request #348 from lostpebble/add-meteor
kujtimprenkuSQA Jul 13, 2022
8ec333f
Bumped version to 5.1.0.
lewis-sqa Jul 14, 2022
681a082
Added Meteor Wallet to Angular example.
lewis-sqa Jul 14, 2022
5042150
Minor refactor.
lewis-sqa Jul 14, 2022
5a74076
Minor refactor.
lewis-sqa Jul 14, 2022
26ca80b
Updated WalletConenct packages
kujtimprenkuSQA Jul 15, 2022
e177728
Set near-api-js as a peerDependency in packages that use it
kujtimprenkuSQA Jul 15, 2022
bd3f91e
Updated docs
kujtimprenkuSQA Jul 15, 2022
05bf46b
Improved docs
kujtimprenkuSQA Jul 15, 2022
c53629c
Updated root README
kujtimprenkuSQA Jul 15, 2022
5893194
Merge pull request #353 from near/SQC-201/near-api-js-peer-dependency
kujtimprenkuSQA Jul 15, 2022
ce9ffda
Upgraded nx to 14
amirsaran3 Jul 18, 2022
8bb2208
Fixed react serve
amirsaran3 Jul 19, 2022
acac89f
Fixed react, angular has wallet-connect issue
amirsaran3 Jul 19, 2022
0598711
Switched from Promise.all() to for loop in signAndSendTransactions
kujtimprenkuSQA Jul 19, 2022
2ae376b
Removed confusing variable name
kujtimprenkuSQA Jul 19, 2022
d965897
Added jest-preset-angular dependency
amirsaran3 Jul 19, 2022
c1962f4
Added build:meteor-wallet script to package.json
amirsaran3 Jul 19, 2022
88466d9
Merge pull request #356 from near/SQC-205/send-transactions-in-series
kujtimprenkuSQA Jul 19, 2022
810a3c7
Merge branch 'dev' into SQC-204/upgrade-walletconnect-deps
kujtimprenkuSQA Jul 20, 2022
dad8e1f
Addressed comments in PR
amirsaran3 Jul 20, 2022
70f3959
Updated near-api-js version to 0.44.2
amirsaran3 Jul 20, 2022
7c41c57
Merge pull request #357 from near/SQC-204/upgrade-walletconnect-deps
kujtimprenkuSQA Jul 20, 2022
22a73d2
Resolved conflicts
amirsaran3 Jul 21, 2022
8e55866
Merge pull request #354 from near/SQC-169-upgrade-nx-to-v-14
amirsaran3 Jul 21, 2022
37218d0
Noted down potential issues when adding support for ledger package
kujtimprenkuSQA Jul 21, 2022
a86fee4
Merge remote-tracking branch 'origin/dev' into release-fixes
lewis-sqa Jul 21, 2022
75d86f2
Merge pull request #360 from near/SQC-202/improve-ledger-docs
kujtimprenkuSQA Jul 21, 2022
fc37c6d
Updated react client rendering API to work with v18
amirsaran3 Jul 22, 2022
28a484a
Updated next and eslint-config-next version to 12.2.3
amirsaran3 Jul 22, 2022
dac5fa2
Merge pull request #362 from near/SQC-213-upgrade-to-react-18
amirsaran3 Jul 22, 2022
1e6f3a3
Merge pull request #351 from near/release-fixes
lewis-sqa Jul 25, 2022
bae1214
Ledger will now show in UI if not available
amirsaran3 Jul 25, 2022
48602b5
Merge pull request #364 from near/SQC-214-ledger-support-on-firefox-b…
amirsaran3 Jul 25, 2022
940116b
Added deprecated flag as configurable setup option
amirsaran3 Jul 25, 2022
fc7bb3b
Merge pull request #365 from near/SQC-208-make-wallet-deprecation-con…
amirsaran3 Jul 25, 2022
c740b68
Initial configuration for package.
lewis-sqa Jul 25, 2022
f1a7958
Linked package.
lewis-sqa Jul 26, 2022
5faa62d
Refactored modal-ui ledger components to support single derivation pa…
kujtimprenkuSQA Jul 27, 2022
d059e24
Remvoed unnecessary state variable
kujtimprenkuSQA Jul 28, 2022
0421e60
Removed unnecessary state
kujtimprenkuSQA Jul 28, 2022
d7a2020
Avoid mutative operations on state
kujtimprenkuSQA Jul 28, 2022
31c9cd8
Removed accountIds property, populate accounts differently
kujtimprenkuSQA Jul 28, 2022
ccc7b84
Avoig reassigning previous state
kujtimprenkuSQA Jul 28, 2022
af0f4f6
Handle no accounts found in ledger
kujtimprenkuSQA Jul 28, 2022
46e708f
Avoid updating state for connecting, gets updated in catch or finally…
kujtimprenkuSQA Jul 28, 2022
096366a
Re ordered functions for better readability
kujtimprenkuSQA Jul 28, 2022
18699f2
Update accounts state only when there are one or more accounts
kujtimprenkuSQA Jul 29, 2022
3575b73
Switched for loop with map
kujtimprenkuSQA Jul 29, 2022
821b6af
Made url dynamic based on the network
kujtimprenkuSQA Jul 29, 2022
1c7fd55
Merge pull request #369 from near/SQC-212/ledger-poc
kujtimprenkuSQA Jul 29, 2022
f53a750
Added support for multiple PR templates.
lewis-sqa Jul 29, 2022
af32387
Merge pull request #370 from near/SQC-218/pr-templates
lewis-sqa Jul 29, 2022
7f05261
Initial attempt to setup a group of default wallets
kujtimprenkuSQA Aug 4, 2022
d58d995
Merge branch 'dev' into SQC-154/recommended-wallets
kujtimprenkuSQA Aug 4, 2022
2d6e887
Removed Near Wallet from defaults
kujtimprenkuSQA Aug 4, 2022
ebcb989
Simply export setup functions of each recommended wallet
kujtimprenkuSQA Aug 5, 2022
9abd721
Updated readme.
kujtimprenkuSQA Aug 5, 2022
ddfd11c
Aligned angular example
kujtimprenkuSQA Aug 5, 2022
b1d660e
Updated docs
kujtimprenkuSQA Aug 5, 2022
15f95a0
Fix css for icons/images to avoid alignment issues
kujtimprenkuSQA Aug 8, 2022
1b2d46e
Merge pull request #380 from near/SQC-234/fix-icons-css-rule
kujtimprenkuSQA Aug 8, 2022
47f6b0b
Added Branching and Release Process sections in Contributing docs
kujtimprenkuSQA Aug 8, 2022
4386aad
Return the outcome/result of signAndSendTransaction for my near wallet
kujtimprenkuSQA Aug 9, 2022
9b019c0
Fixed return type.
kujtimprenkuSQA Aug 9, 2022
3c784e0
Improved docs
kujtimprenkuSQA Aug 9, 2022
6ff46b2
Removed Sender
kujtimprenkuSQA Aug 9, 2022
b4504b0
Merge pull request #381 from near/SQC-235/update-contributing-docs
kujtimprenkuSQA Aug 9, 2022
4245a8e
Merge pull request #384 from near/SQC-240/mnw-return-final-execution-…
kujtimprenkuSQA Aug 9, 2022
86ee81c
Fix initalization when user uninstalled a wallet which was already si…
kujtimprenkuSQA Aug 11, 2022
97dd9d6
Added verify owner method, copied code from PR #320
kujtimprenkuSQA Aug 11, 2022
d556051
Throw error for ledger since ledger app can sign only valid transactions
kujtimprenkuSQA Aug 12, 2022
7693666
Changed return type to align with PR 2801 of Near Wallet repo
kujtimprenkuSQA Aug 12, 2022
fa003bb
Updated docs
kujtimprenkuSQA Aug 12, 2022
684535f
Updated examples to show all details returned by verifyOwner
kujtimprenkuSQA Aug 12, 2022
df5f4d2
Setup recommended wallets with setupRecommendedWallets function
kujtimprenkuSQA Aug 12, 2022
b10f628
Updated recommended wallets docs.
kujtimprenkuSQA Aug 12, 2022
145eadc
Skip duplicated modules instead of throwing
kujtimprenkuSQA Aug 12, 2022
34f08c6
Removed customized wallet connect setup, it will be added by recommen…
kujtimprenkuSQA Aug 12, 2022
cb2bf03
Set default projectId for WalletConnect
kujtimprenkuSQA Aug 12, 2022
afa1b4e
Updated root readme.
kujtimprenkuSQA Aug 12, 2022
1a868db
Minor fix in docs
kujtimprenkuSQA Aug 12, 2022
2b86d85
Renamed package to default-wallets
kujtimprenkuSQA Aug 14, 2022
ac11985
Merge pull request #395 from near/SQC-242/fix-wallet-selector-initial…
kujtimprenkuSQA Aug 15, 2022
7cfcd86
Fixed docs, added indexerUrl to Network Options
kujtimprenkuSQA Aug 15, 2022
d35fcc1
[meteor] update to new version of SDK. clean up module and add async …
lostpebble Aug 15, 2022
0ad6b7d
Merge pull request #397 from lostpebble/meteor-new-version
kujtimprenkuSQA Aug 15, 2022
ce720ac
Merge pull request #396 from near/SQC-250/update-core-docs
kujtimprenkuSQA Aug 15, 2022
7eaa77b
fix: sender error handling
think-in-universe Aug 15, 2022
cf7ad46
Merge pull request #398 from near/fix/sender-error
kujtimprenkuSQA Aug 15, 2022
0003c75
Remove WalletConnect from default wallets + reset associated examples…
MaximusHaximus Aug 16, 2022
91fdad0
Sync `verifyOwner` API with base implementation in NW
MaximusHaximus Aug 16, 2022
c74d9f9
Fixed linting.
kujtimprenkuSQA Aug 16, 2022
4af327a
Merge pull request #379 from near/SQC-154/recommended-wallets-2
kujtimprenkuSQA Aug 16, 2022
cc04a95
Merge pull request #391 from near/SQC-153/add-support-for-verify-owner
kujtimprenkuSQA Aug 16, 2022
8a3518c
Realigned dev with main
kujtimprenkuSQA Aug 16, 2022
b8a6026
Bumped version to 6.0.0.
kujtimprenkuSQA Aug 16, 2022
1eed919
Updated scripts.
kujtimprenkuSQA Aug 16, 2022
e06d87a
Merge pull request #404 from near/bump-version-align-branches
kujtimprenkuSQA Aug 16, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"@nrwl/nx",
"@typescript-eslint",
"prettier",
"react",
"react-hooks"
],
"overrides": [
Expand Down Expand Up @@ -40,7 +39,6 @@
"plugin:@nrwl/nx/typescript",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"prettier"
],
"rules": {
Expand Down Expand Up @@ -112,15 +110,7 @@
}
],
"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"
"valid-jsdoc": "error"
}
},
{
Expand Down
38 changes: 5 additions & 33 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,8 @@
# Description
Thanks for taking the time to submit a pull request!

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
If you haven't already, be sure to take a look at the [CONTRIBUTING](https://github.com/near/wallet-selector/blob/main/CONTRIBUTING.md) documentation to get up to speed with the practices in this repository.

Closes # (issue)
<!-- REMOVE ALL THE TEMPLATE BELOW IF THE PR IS A RELEASE -->
When you're ready, switch to the "Preview" tab to select an applicable template:


# Checklist:
<!-- CHECKLIST_TYPE: ALL -->
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
<!-- /CHECKLIST_TYPE -->

# Type of change. This type of change is the main reason for the PR.
<!-- CHECKLIST_TYPE: ONE -->
- [ ] FIX - a PR of this type patches a bug.
- [ ] FEATURE - a PR of this type introduces a new feature.
- [ ] BUILD - a PR of this type introduces build changes.
- [ ] CI - a PR of this type introduces CI changes.
- [ ] DOCS - a PR of this type introduces DOCS improvement.
- [ ] STYLE - a PR of this type introduces style changes.
- [ ] REFACTOR - a PR of this type introduces refactoring.
- [ ] PERFORMANCE - a PR of this type introduces performance changes.
- [ ] TEST - a PR of this type adds more tests.
- [ ] CHORE - a PR introduces other changes than the specified above.
<!-- /CHECKLIST_TYPE -->

# Breaking changes
<!-- CHECKLIST_TYPE: ONE -->
<!-- SPECIFY BREAKING CHANGES AS A ONE-LINER -->
- [ ] BREAKING CHANGE - SPECIFY: _______
- [ ] NO BREAKING CHANGE - this PR doesn't contain any breaking changes and it's backwards compatible
<!-- /CHECKLIST_TYPE -->
- [General template (most common)](?expand=1&template=general.md)
- [Wallet integration template](?expand=1&template=wallet_integration.md)
25 changes: 25 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/general.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

# Checklist:
<!-- CHECKLIST_TYPE: ALL -->
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
<!-- /CHECKLIST_TYPE -->

# Type of change.
<!-- CHECKLIST_TYPE: ONE -->
- [ ] FIX - a PR of this type patches a bug.
- [ ] FEATURE - a PR of this type introduces a new feature.
- [ ] BUILD - a PR of this type introduces build changes.
- [ ] CI - a PR of this type introduces CI changes.
- [ ] DOCS - a PR of this type introduces DOCS improvement.
- [ ] STYLE - a PR of this type introduces style changes.
- [ ] REFACTOR - a PR of this type introduces refactoring.
- [ ] PERFORMANCE - a PR of this type introduces performance changes.
- [ ] TEST - a PR of this type adds more tests.
- [ ] CHORE - a PR introduces other changes than the specified above.
<!-- /CHECKLIST_TYPE -->
11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/wallet_integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Description

Please include a summary of the wallet and how users can install it. Be sure to take a look at our guide on [Custom Wallets](https://github.com/near/wallet-selector/blob/main/packages/core/docs/guides/custom-wallets.md) to understand core concepts when integrating with Wallet Selector.

# Checklist:
<!-- CHECKLIST_TYPE: ALL -->
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
<!-- /CHECKLIST_TYPE -->
44 changes: 39 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,59 @@ yarn nx run [project][:target][:configuration] [options, ...]
yarn nx r [project][:target][:configuration] [options, ...]
```

In order to run a specific example, make sure you build the UI library beforehand and on each modification by running:
In order to run a specific example, make sure you build the packages beforehand by running:

```bash
yarn build # build core package
yarn build:all # builds all packages

yarn nx serve react # run the react example
yarn nx serve angular # run the angular example
```

Build and deploy react example
> Note: [`modal-ui`](/packages/modal-ui) package must be re-build after every change in the source files of this package `yarn nx run modal-ui:build`


Build and deploy angular example

```bash
yarn nx build react # build the react example
yarn nx deploy react # deploys react example to gh-pages
yarn nx build angular # build the angular example
yarn nx deploy angular # deploys angular example to gh-pages
```


# Branching

In this project there are two important branches `main` and `dev` branch. Pushing or committing directly in these two branches is forbidden.

### Main branch

This is the default branch and will be equal the latest official release.

### Dev Branch

This is the branch for development used by the team and/or other contributors from the community.
New features, fixes and other improvements are first implemented and tested in this
branch.
When adding new features/fixes team members must always create a new branch locally based on latest changes of `dev` branch.
When your work is ready a merge request should be opened from your branch to `dev`. When your PR is reviewed and approved then it can be merged.

### Other branches

Except `main` and `dev` branch other branches are work in progress by the team or related to the open PR(s).

# Release Process

Once the planned work has been finished and the set date has arrived a merge request from `dev` to `main` should be made.
After merging only two steps remain:</br>
- Publish packages to NPM.
- Draft release in Github.

Since `main` is the default branch of this project in case of regular release it will be always equal to the latest release.</br> In case of a `pre-release` a specific branch will be linked to the `pre-release` version(tag).

# Listing Third Party Wallet on Wallet Selector

Criteria for Including New Wallets for Wallet Selector

# Product Criteria:

A wallet project must have comply the following product criteria to listed on Wallet Selector.
Expand Down
25 changes: 21 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,28 @@ NEAR Wallet Selector makes it easy for users to interact with your dApp by provi
- [Sender](https://www.npmjs.com/package/@near-wallet-selector/sender) - Injected wallet.
- [Math Wallet](https://www.npmjs.com/package/@near-wallet-selector/math-wallet) - Injected wallet.
- [Nightly](https://www.npmjs.com/package/@near-wallet-selector/nightly) - Injected wallet.
- [Meteor Wallet](https://www.npmjs.com/package/@near-wallet-selector/meteor-wallet) - Injected wallet.
- [Ledger](https://www.npmjs.com/package/@near-wallet-selector/ledger) - Hardware wallet.
- [WalletConnect](https://www.npmjs.com/package/@near-wallet-selector/wallet-connect) - Bridge wallet.
- [Nightly Connect](https://www.npmjs.com/package/@near-wallet-selector/nightly-connect) - Bridge wallet.

## Preview

[React](https://reactjs.org/) and [Angular](https://angular.io/) variations of the [Guest Book](https://github.com/near-examples/guest-book/) dApp can be found in the [`examples`](/examples) directory. You can use these to gain a concrete understanding of how to integrate NEAR Wallet Selector into your own dApp.
[React](https://reactjs.org/) / [Next.js](https://nextjs.org/) and [Angular](https://angular.io/) variations of the [Guest Book](https://github.com/near-examples/guest-book/) dApp can be found in the [`examples`](/examples) directory. You can use these to gain a concrete understanding of how to integrate NEAR Wallet Selector into your own dApp.

![Preview](./images/preview-img.PNG)

## Installation and Usage

The easiest way to use NEAR Wallet Selector is to install the [`core`](https://www.npmjs.com/package/@near-wallet-selector/core) package from the NPM registry:
The easiest way to use NEAR Wallet Selector is to install the [`core`](https://www.npmjs.com/package/@near-wallet-selector/core) package from the NPM registry, some packages may require `near-api-js` v0.44.2 or above check them at [`packages`](./packages)

```bash
# Using Yarn
yarn add near-api-js@^0.44.2

# Using NPM.
npm install near-api-js@^0.44.2
```

```bash
# Using Yarn
Expand All @@ -39,9 +48,11 @@ yarn add \
@near-wallet-selector/sender \
@near-wallet-selector/math-wallet \
@near-wallet-selector/nightly \
@near-wallet-selector/meteor-wallet \
@near-wallet-selector/ledger \
@near-wallet-selector/wallet-connect \
@near-wallet-selector/nightly-connect
@near-wallet-selector/nightly-connect \
@near-wallet-selector/default-wallets

# Using NPM.
npm install \
Expand All @@ -50,9 +61,11 @@ npm install \
@near-wallet-selector/sender \
@near-wallet-selector/math-wallet \
@near-wallet-selector/nightly \
@near-wallet-selector/meteor-wallet \
@near-wallet-selector/ledger \
@near-wallet-selector/wallet-connect \
@near-wallet-selector/nightly-connect
@near-wallet-selector/nightly-connect \
@near-wallet-selector/default-wallets
```

Optionally, you can install our [`modal-ui`](https://www.npmjs.com/package/@near-wallet-selector/modal-ui) package for a pre-built interface that wraps the `core` API and presents the supported wallets:
Expand All @@ -75,18 +88,22 @@ import { setupMyNearWallet } from "@near-wallet-selector/my-near-wallet";
import { setupSender } from "@near-wallet-selector/sender";
import { setupMathWallet } from "@near-wallet-selector/math-wallet";
import { setupNightly } from "@near-wallet-selector/nightly";
import { setupMeteorWallet } from "@near-wallet-selector/meteor-wallet";
import { setupLedger } from "@near-wallet-selector/ledger";
import { setupWalletConnect } from "@near-wallet-selector/wallet-connect";
import { setupNightlyConnect } from "@near-wallet-selector/nightly-connect";
import { setupDefaultWallets } from "@near-wallet-selector/default-wallets";

const selector = await setupWalletSelector({
network: "testnet",
modules: [
...(await setupDefaultWallets()),
setupNearWallet(),
setupMyNearWallet(),
setupSender(),
setupMathWallet(),
setupNightly(),
setupMeteorWallet(),
setupLedger(),
setupWalletConnect({
projectId: "c4f79cc...",
Expand Down
13 changes: 12 additions & 1 deletion examples/angular/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@
"glob": "**/*",
"input": "packages/nightly-connect/assets/",
"output": "assets/"
},
{
"glob": "**/*",
"input": "packages/meteor-wallet/assets/",
"output": "assets/"
}
],
"styles": ["examples/angular/src/styles.scss"],
Expand All @@ -68,7 +73,7 @@
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
"maximumError": "2mb"
},
{
"type": "anyComponentStyle",
Expand Down Expand Up @@ -129,6 +134,12 @@
"jestConfig": "examples/angular/jest.config.js",
"passWithNoTests": true
}
},
"deploy": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "gh-pages -d dist/examples/angular"
}
}
},
"tags": []
Expand Down
10 changes: 5 additions & 5 deletions examples/angular/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Component, OnInit } from "@angular/core";
import { setupWalletSelector } from "@near-wallet-selector/core";
import type { WalletSelector, AccountState } from "@near-wallet-selector/core";
import { setupDefaultWallets } from "@near-wallet-selector/default-wallets";
import { setupNearWallet } from "@near-wallet-selector/near-wallet";
import { setupMyNearWallet } from "@near-wallet-selector/my-near-wallet";
import { setupSender } from "@near-wallet-selector/sender";
import { setupMathWallet } from "@near-wallet-selector/math-wallet";
import { setupNightly } from "@near-wallet-selector/nightly";
import { setupLedger } from "@near-wallet-selector/ledger";
import { setupWalletConnect } from "@near-wallet-selector/wallet-connect";
import { setupMeteorWallet } from "@near-wallet-selector/meteor-wallet";
import { setupNightlyConnect } from "@near-wallet-selector/nightly-connect";
import { setupWalletConnect } from "@near-wallet-selector/wallet-connect";
import { setupModal } from "@near-wallet-selector/modal-ui";
import type { WalletSelectorModal } from "@near-wallet-selector/modal-ui";
import { CONTRACT_ID } from "../constants";
Expand Down Expand Up @@ -43,12 +43,12 @@ export class AppComponent implements OnInit {
network: "testnet",
debug: true,
modules: [
...(await setupDefaultWallets()),
setupNearWallet(),
setupMyNearWallet(),
setupSender(),
setupMathWallet(),
setupNightly(),
setupLedger(),
setupMeteorWallet(),
setupWalletConnect({
projectId: "c4f79cc...",
metadata: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<div>
<button (click)="signOut()">Log out</button>
<button (click)="switchWallet()">Switch Wallet</button>
<button (click)="onVerifyOwner()">Verify Owner</button>
<button *ngIf="accounts.length > 1" (click)="switchAccount()">
Switch Account
</button>
Expand Down
17 changes: 17 additions & 0 deletions examples/angular/src/app/components/content/content.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,23 @@ export class ContentComponent implements OnInit, OnDestroy {
alert("Switched account to " + nextAccountId);
}

async onVerifyOwner() {
const wallet = await this.selector.wallet();
try {
const owner = await wallet.verifyOwner({
message: "test message for verification",
});

if (owner) {
alert(`Signature for verification: ${JSON.stringify(owner)}`);
}
} catch (err) {
const message =
err instanceof Error ? err.message : "Something went wrong";
alert(message);
}
}

subscribeToEvents() {
this.subscription = this.selector.store.observable
.pipe(
Expand Down
11 changes: 1 addition & 10 deletions examples/react/.babelrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
{
"presets": [
[
"@nrwl/react/babel",
{
"runtime": "automatic"
}
],
"@babel/preset-env",
"@babel/preset-react"
],
"presets": ["@nrwl/next/babel"],
"plugins": []
}
16 changes: 0 additions & 16 deletions examples/react/.browserslistrc

This file was deleted.

Loading