Skip to content

Commit

Permalink
Merge pull request #548 from near/dev
Browse files Browse the repository at this point in the history
v7.2.0 Release (dev -> main)
  • Loading branch information
kujtimprenkuSQA authored Nov 7, 2022
2 parents 8f73cb8 + e4f5408 commit fd9bbbb
Show file tree
Hide file tree
Showing 155 changed files with 6,373 additions and 666 deletions.
5 changes: 5 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
},
{
"files": ["*.ts", "*.tsx"],
"parserOptions": {
"project": ["tsconfig.*?.json"]
},
"extends": [
"plugin:@nrwl/nx/typescript",
"eslint:recommended",
Expand Down Expand Up @@ -82,6 +85,8 @@
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/array-type": ["error", { "default": "generic" }],
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/consistent-type-exports": "error",
"curly": ["error", "all"],
"eqeqeq": ["error", "smart"],
"default-case": "off",
Expand Down
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
interval: "monthly"
target-branch: "dev"
allow:
- dependency-name: "lodash"
Expand Down
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ NEAR Wallet Selector makes it easy for users to interact with your dApp by provi
- [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.
- [Welldone Wallet](https://www.npmjs.com/package/@near-wallet-selector/welldone-wallet) - Injected wallet.
- [Coin98 Wallet](https://www.npmjs.com/package/@near-wallet-selector/coin98-wallet) - Injected wallet.
- [Neth](https://www.npmjs.com/package/@near-wallet-selector/neth) - 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.
- [Here Wallet](https://www.npmjs.com/package/@near-wallet-selector/here-wallet) - Mobile wallet.
- [NearFi Wallet](https://www.npmjs.com/package/@near-wallet-selector/nearfi) - Mobile wallet.
- [Opto Wallet](https://www.npmjs.com/package/@near-wallet-selector/opto-wallet) - Mobile wallet & Browser wallet.

## Preview

Expand Down Expand Up @@ -54,11 +57,14 @@ yarn add \
@near-wallet-selector/math-wallet \
@near-wallet-selector/nightly \
@near-wallet-selector/meteor-wallet \
@near-wallet-selector/welldone-wallet \
@near-wallet-selector/ledger \
@near-wallet-selector/wallet-connect \
@near-wallet-selector/nightly-connect \
@near-wallet-selector/default-wallets \
@near-wallet-selector/coin98-wallet
@near-wallet-selector/coin98-wallet \
@near-wallet-selector/opto-wallet \
@near-wallet-selector/neth

# Using NPM.
npm install \
Expand All @@ -70,11 +76,14 @@ npm install \
@near-wallet-selector/math-wallet \
@near-wallet-selector/nightly \
@near-wallet-selector/meteor-wallet \
@near-wallet-selector/welldone-wallet \
@near-wallet-selector/ledger \
@near-wallet-selector/wallet-connect \
@near-wallet-selector/nightly-connect \
@near-wallet-selector/default-wallets \
@near-wallet-selector/coin98-wallet
@near-wallet-selector/coin98-wallet \
@near-wallet-selector/opto-wallet \
@near-wallet-selector/neth
```

Optionally, you can install our [`modal-ui`](https://www.npmjs.com/package/@near-wallet-selector/modal-ui) or [`modal-ui-js`](https://www.npmjs.com/package/@near-wallet-selector/modal-ui-js) package for a pre-built interface that wraps the `core` API and presents the supported wallets:
Expand All @@ -99,12 +108,15 @@ import { setupHereWallet } from "@near-wallet-selector/here-wallet";
import { setupMathWallet } from "@near-wallet-selector/math-wallet";
import { setupNightly } from "@near-wallet-selector/nightly";
import { setupMeteorWallet } from "@near-wallet-selector/meteor-wallet";
import { setupWelldoneWallet } from "@near-wallet-selector/welldone-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";
import { setupNearFi } from "@near-wallet-selector/nearfi";
import { setupCoin98Wallet } from "@near-wallet-selector/coin98-wallet";
import { setupOptoWallet } from "@near-wallet-selector/opto-wallet";
import { setupNeth } from "@near-wallet-selector/neth";

const selector = await setupWalletSelector({
network: "testnet",
Expand All @@ -117,9 +129,12 @@ const selector = await setupWalletSelector({
setupMathWallet(),
setupNightly(),
setupMeteorWallet(),
setupWelldoneWallet(),
setupLedger(),
setupNearFi(),
setupCoin98Wallet(),
setupOptoWallet(),
setupNeth(),
setupWalletConnect({
projectId: "c4f79cc...",
metadata: {
Expand Down
22 changes: 19 additions & 3 deletions examples/angular/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:browser",
"outputs": ["{options.outputPath}"],
"outputs": [
"{options.outputPath}"
],
"options": {
"outputPath": "dist/examples/angular",
"index": "examples/angular/src/index.html",
Expand Down Expand Up @@ -68,13 +70,25 @@
"input": "packages/meteor-wallet/assets/",
"output": "assets/"
},
{
"glob": "**/*",
"input": "packages/welldone-wallet/assets/",
"output": "assets/"
},
{
"glob": "**/*",
"input": "packages/coin98-wallet/assets/",
"output": "assets/"
},
{
"glob": "**/*",
"input": "packages/opto-wallet/assets/",
"output": "assets/"
}
],
"styles": ["examples/angular/src/styles.scss"],
"styles": [
"examples/angular/src/styles.scss"
],
"scripts": []
},
"configurations": {
Expand Down Expand Up @@ -139,7 +153,9 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/examples/angular"],
"outputs": [
"coverage/examples/angular"
],
"options": {
"jestConfig": "examples/angular/jest.config.js",
"passWithNoTests": true
Expand Down
15 changes: 12 additions & 3 deletions examples/angular/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import { Component, OnInit } from "@angular/core";
import { setupWalletSelector } from "@near-wallet-selector/core";
import type { OnInit } from "@angular/core";
import { Component } from "@angular/core";
import type { WalletSelector, AccountState } from "@near-wallet-selector/core";
import { setupWalletSelector } from "@near-wallet-selector/core";
import { setupDefaultWallets } from "@near-wallet-selector/default-wallets";
import { setupNearWallet } from "@near-wallet-selector/near-wallet";
import { setupSender } from "@near-wallet-selector/sender";
import { setupNearFi } from "@near-wallet-selector/nearfi";
import { setupMathWallet } from "@near-wallet-selector/math-wallet";
import { setupNightly } from "@near-wallet-selector/nightly";
import { setupMeteorWallet } from "@near-wallet-selector/meteor-wallet";
import { setupWelldoneWallet } from "@near-wallet-selector/welldone-wallet";
import { setupNightlyConnect } from "@near-wallet-selector/nightly-connect";
import { setupWalletConnect } from "@near-wallet-selector/wallet-connect";
import { setupCoin98Wallet } from "@near-wallet-selector/coin98-wallet";
import { setupHereWallet } from "@near-wallet-selector/here-wallet";
import { setupNeth } from "@near-wallet-selector/neth";
import { setupOptoWallet } from "@near-wallet-selector/opto-wallet";
import { setupNearWallet } from "@near-wallet-selector/near-wallet";
// import { setupModal } from "@near-wallet-selector/modal-ui";
// import type { WalletSelectorModal } from "@near-wallet-selector/modal-ui";
import { setupModal } from "@near-wallet-selector/modal-ui-js";
Expand Down Expand Up @@ -54,9 +58,14 @@ export class AppComponent implements OnInit {
setupMathWallet(),
setupNightly(),
setupMeteorWallet(),
setupWelldoneWallet(),
setupHereWallet(),
setupCoin98Wallet(),
setupNearFi(),
setupNeth({
bundle: false,
}),
setupOptoWallet(),
setupWalletConnect({
projectId: "c4f79cc...",
metadata: {
Expand Down
12 changes: 7 additions & 5 deletions examples/angular/src/app/components/content/content.component.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import { Component, Input, OnDestroy, OnInit } from "@angular/core";
import type { OnDestroy, OnInit } from "@angular/core";
import { Component, Input } from "@angular/core";
import { providers, utils } from "near-api-js";
import type {
AccountView,
CodeResult,
} from "near-api-js/lib/providers/provider";
import type { WalletSelector, AccountState } from "@near-wallet-selector/core";
import type { AccountState, Transaction } from "@near-wallet-selector/core";

import type { Message } from "../../interfaces/message";
import type { Submitted } from "../form/form.component";
import type { Account } from "../../interfaces/account";
import { distinctUntilChanged, map, Subscription } from "rxjs";
import type { WalletSelectorModal } from "@near-wallet-selector/modal-ui";
import type { Subscription } from "rxjs";
import { distinctUntilChanged, map } from "rxjs";
import { WalletSelectorModal } from "@near-wallet-selector/modal-ui";
import { CONTRACT_ID } from "../../../constants";
import { Transaction } from "@near-wallet-selector/core";
import { WalletSelector } from "@near-wallet-selector/core";

const SUGGESTED_DONATION = "0";
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
Expand Down
5 changes: 3 additions & 2 deletions examples/angular/src/app/components/form/form.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Component, EventEmitter, Input, OnInit, Output } from "@angular/core";
import type { OnInit } from "@angular/core";
import { Component, EventEmitter, Input, Output } from "@angular/core";
import Big from "big.js";
import type { Account } from "../../interfaces/account";
import { Account } from "../../interfaces/account";

export type Submitted = SubmitEvent & {
target: { elements: { [key: string]: HTMLInputElement } };
Expand Down
5 changes: 4 additions & 1 deletion examples/angular/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
"noImplicitAny": true,
"noFallthroughCasesInSwitch": true,
"resolveJsonModule": true,
"esModuleInterop": true,
},
"angularCompilerOptions": {
"strictInjectionParameters": true,
Expand Down
2 changes: 1 addition & 1 deletion examples/react/components/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {
AccountView,
CodeResult,
} from "near-api-js/lib/providers/provider";
import { Transaction } from "@near-wallet-selector/core";
import type { Transaction } from "@near-wallet-selector/core";

import type { Account, Message } from "../interfaces";
import { useWalletSelector } from "../contexts/WalletSelectorContext";
Expand Down
3 changes: 2 additions & 1 deletion examples/react/components/Form.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { FormEventHandler } from "react";
import type { FormEventHandler } from "react";
import React from "react";
import Big from "big.js";

import type { Account } from "../interfaces";
Expand Down
9 changes: 9 additions & 0 deletions examples/react/contexts/WalletSelectorContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ 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 { setupWelldoneWallet } from "@near-wallet-selector/welldone-wallet";
import { setupNightlyConnect } from "@near-wallet-selector/nightly-connect";
import { setupNearFi } from "@near-wallet-selector/nearfi";
import { setupWalletConnect } from "@near-wallet-selector/wallet-connect";
import { setupCoin98Wallet } from "@near-wallet-selector/coin98-wallet";
import { setupNeth } from "@near-wallet-selector/neth";
import { setupOptoWallet } from "@near-wallet-selector/opto-wallet";
import { CONTRACT_ID } from "../constants";

declare global {
Expand Down Expand Up @@ -50,9 +53,15 @@ export const WalletSelectorContextProvider: React.FC = ({ children }) => {
setupMathWallet(),
setupNightly(),
setupMeteorWallet(),
setupWelldoneWallet(),
setupHereWallet(),
setupCoin98Wallet(),
setupNearFi(),
setupNeth({
gas: "300000000000000",
bundle: false,
}),
setupOptoWallet(),
setupWalletConnect({
projectId: "c4f79cc...",
metadata: {
Expand Down
22 changes: 19 additions & 3 deletions examples/react/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"targets": {
"build": {
"executor": "@nrwl/next:build",
"outputs": ["{options.outputPath}"],
"outputs": [
"{options.outputPath}"
],
"defaultConfiguration": "production",
"options": {
"root": "examples/react",
Expand Down Expand Up @@ -61,10 +63,20 @@
"input": "packages/meteor-wallet/assets/",
"output": "assets/"
},
{
"glob": "**/*",
"input": "packages/welldone-wallet/assets/",
"output": "assets/"
},
{
"glob": "**/*",
"input": "packages/coin98-wallet/assets/",
"output": "assets/"
},
{
"glob": "**/*",
"input": "packages/opto-wallet/assets/",
"output": "assets/"
}
]
},
Expand Down Expand Up @@ -93,9 +105,13 @@
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"outputs": [
"{options.outputFile}"
],
"options": {
"lintFilePatterns": ["examples/react/**/*.{ts,tsx,js,jsx}"]
"lintFilePatterns": [
"examples/react/**/*.{ts,tsx,js,jsx}"
]
}
}
},
Expand Down
Loading

0 comments on commit fd9bbbb

Please sign in to comment.