Skip to content

Commit

Permalink
Merge pull request #496 from near/dev
Browse files Browse the repository at this point in the history
v7.1.0 Release (dev -> main)
  • Loading branch information
kujtimprenkuSQA authored Oct 12, 2022
2 parents 4128764 + 9bafbd0 commit 2e151d2
Show file tree
Hide file tree
Showing 100 changed files with 2,486 additions and 317 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
target-branch: "dev"
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Criteria for Including New Wallets for Wallet Selector
A wallet project must have comply the following product criteria to listed on Wallet Selector.

1. Non-custodial: The user controls their fund.
2. Conformity to Wallet Standards: The wallet product conforms to NEAR NEP wallet standards. (Injected Wallet https://github.com/near/NEPs/pull/370 and Bridged Wallet https://github.com/near/NEPs/pull/368)
2. Conformity to Wallet Standards: The wallet product conforms to NEAR NEP wallet standards. (Injected Wallet https://github.com/near/NEPs/pull/408 and Bridged Wallet https://github.com/near/NEPs/pull/368)
3. Ease of use: The wallet product provides a usable interface for the end users. Please provide a user guide.
4. Ability to recover accounts: The wallet product allows users to be able to recover accounts.
5. Actively maintained: The wallet is actively maintained by a team and can provide user support.
Expand Down
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ 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.
- [Coin98 Wallet](https://www.npmjs.com/package/@near-wallet-selector/coin98-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.
- [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.

## Preview

[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)
![Preview](./images/preview-img.gif)

## Installation and Usage

Expand Down Expand Up @@ -46,26 +49,32 @@ yarn add \
@near-wallet-selector/near-wallet \
@near-wallet-selector/my-near-wallet \
@near-wallet-selector/sender \
@near-wallet-selector/nearfi \
@near-wallet-selector/here-wallet \
@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/default-wallets
@near-wallet-selector/default-wallets \
@near-wallet-selector/coin98-wallet

# Using NPM.
npm install \
@near-wallet-selector/near-wallet \
@near-wallet-selector/my-near-wallet \
@near-wallet-selector/sender \
@near-wallet-selector/nearfi \
@near-wallet-selector/here-wallet \
@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/default-wallets
@near-wallet-selector/default-wallets \
@near-wallet-selector/coin98-wallet
```

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 @@ -86,13 +95,16 @@ import { setupModal } from "@near-wallet-selector/modal-ui";
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 { 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 { 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";

const selector = await setupWalletSelector({
network: "testnet",
Expand All @@ -101,10 +113,13 @@ const selector = await setupWalletSelector({
setupNearWallet(),
setupMyNearWallet(),
setupSender(),
setupHereWallet(),
setupMathWallet(),
setupNightly(),
setupMeteorWallet(),
setupLedger(),
setupNearFi(),
setupCoin98Wallet(),
setupWalletConnect({
projectId: "c4f79cc...",
metadata: {
Expand Down
10 changes: 10 additions & 0 deletions examples/angular/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
"input": "packages/sender/assets/",
"output": "assets/"
},
{
"glob": "**/*",
"input": "packages/nearfi/assets/",
"output": "assets/"
},
{
"glob": "**/*",
"input": "packages/nightly/assets/",
Expand Down Expand Up @@ -62,6 +67,11 @@
"glob": "**/*",
"input": "packages/meteor-wallet/assets/",
"output": "assets/"
},
{
"glob": "**/*",
"input": "packages/coin98-wallet/assets/",
"output": "assets/"
}
],
"styles": ["examples/angular/src/styles.scss"],
Expand Down
6 changes: 6 additions & 0 deletions examples/angular/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ 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 { 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 { 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 { 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 @@ -51,6 +54,9 @@ export class AppComponent implements OnInit {
setupMathWallet(),
setupNightly(),
setupMeteorWallet(),
setupHereWallet(),
setupCoin98Wallet(),
setupNearFi(),
setupWalletConnect({
projectId: "c4f79cc...",
metadata: {
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,4 @@ button {
border-left: 0.25em solid var(--secondary);
padding-left: 0.25em;
margin-left: -0.5em;
}
}
2 changes: 1 addition & 1 deletion examples/react/components/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ const Content: React.FC = () => {
}

return wallet.signAndSendTransactions({ transactions }).catch((err) => {
alert("Failed to add messages");
alert("Failed to add messages exception " + err);
console.log("Failed to add messages");

throw err;
Expand Down
9 changes: 7 additions & 2 deletions examples/react/contexts/WalletSelectorContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ import { setupModal } from "@near-wallet-selector/modal-ui";
import type { WalletSelectorModal } from "@near-wallet-selector/modal-ui";
import { setupDefaultWallets } from "@near-wallet-selector/default-wallets";
import { setupNearWallet } from "@near-wallet-selector/near-wallet";
import { setupHereWallet } from "@near-wallet-selector/here-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 { 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 { CONTRACT_ID } from "../constants";

declare global {
Expand Down Expand Up @@ -47,8 +50,11 @@ export const WalletSelectorContextProvider: React.FC = ({ children }) => {
setupMathWallet(),
setupNightly(),
setupMeteorWallet(),
setupHereWallet(),
setupCoin98Wallet(),
setupNearFi(),
setupWalletConnect({
projectId: "test...",
projectId: "c4f79cc...",
metadata: {
name: "NEAR Wallet Selector",
description: "Example dApp used by NEAR Wallet Selector",
Expand All @@ -69,7 +75,6 @@ export const WalletSelectorContextProvider: React.FC = ({ children }) => {
});
const _modal = setupModal(_selector, { contractId: CONTRACT_ID });
const state = _selector.store.getState();

setAccounts(state.accounts);

window.selector = _selector;
Expand Down
10 changes: 10 additions & 0 deletions examples/react/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
"input": "packages/sender/assets/",
"output": "assets/"
},
{
"glob": "**/*",
"input": "packages/nearfi/assets/",
"output": "assets/"
},
{
"glob": "**/*",
"input": "packages/nightly/assets/",
Expand Down Expand Up @@ -55,6 +60,11 @@
"glob": "**/*",
"input": "packages/meteor-wallet/assets/",
"output": "assets/"
},
{
"glob": "**/*",
"input": "packages/coin98-wallet/assets/",
"output": "assets/"
}
]
},
Expand Down
Binary file added images/preview-img.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/preview-img.png
Binary file not shown.
14 changes: 11 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "near-wallet-selector",
"version": "7.0.3",
"version": "7.1.0",
"description": "NEAR Wallet Selector makes it easy for users to interact with your dApp by providing an abstraction over various wallets within the NEAR ecosystem",
"keywords": [
"near",
Expand All @@ -17,6 +17,7 @@
"ledger",
"wallet-connect",
"nightly-connect",
"nearfi",
"meteor-wallet"
],
"homepage": "https://github.com/near/wallet-selector#README",
Expand All @@ -40,8 +41,10 @@
"build:ledger": "nx run-many --target=build --projects=ledger --configuration=production",
"build:math-wallet": "nx run-many --target=build --projects=math-wallet --configuration=production",
"build:near-wallet": "nx run-many --target=build --projects=near-wallet --configuration=production",
"build:here-wallet": "nx run-many --target=build --projects=here-wallet --configuration=production",
"build:my-near-wallet": "nx run-many --target=build --projects=my-near-wallet --configuration=production",
"build:sender": "nx run-many --target=build --projects=sender --configuration=production",
"build:nearfi": "nx run-many --target=build --projects=nearfi --configuration=production",
"build:nightly": "nx run-many --target=build --projects=nightly --configuration=production",
"build:meteor-wallet": "nx run-many --target=build --projects=meteor-wallet --configuration=production",
"build:wallet-connect": "nx run-many --target=build --projects=wallet-connect --configuration=production",
Expand All @@ -50,13 +53,14 @@
"build:default-wallets": "nx run-many --target=build --projects=default-wallets --configuration=production",
"lint": "nx workspace-lint && nx run-many --target=lint --all --parallel",
"lint:fix": "nx run-many --target=lint --all --fix",
"serve:react": "nx serve react",
"serve:react": "nx serve react --host=0.0.0.0",
"serve:angular": "nx serve angular",
"prepack": "yarn build:core && yarn build:all",
"test": "nx run-many --target=test --all",
"postinstall": "ngcc --properties es2020 browser module main"
},
"dependencies": {

"@angular/animations": "~14.0.0",
"@angular/common": "~14.0.0",
"@angular/compiler": "~14.0.0",
Expand All @@ -76,13 +80,16 @@
"big.js": "^6.1.1",
"bn.js": "^5.2.0",
"buffer": "^6.0.3",
"copy-to-clipboard": "^3.3.2",
"core-js": "^3.6.5",
"is-mobile": "^3.1.1",
"near-api-js": "^0.44.2",
"next": "12.2.3",
"ngx-deploy-npm": "^4.1.1",
"qrcode": "^1.5.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-qr-code": "^2.0.8",
"regenerator-runtime": "0.13.7",
"rxjs": "^7.5.5",
"tslib": "^2.3.0",
Expand Down Expand Up @@ -121,6 +128,7 @@
"@types/gh-pages": "^3.2.1",
"@types/jest": "27.4.1",
"@types/node": "16.11.7",
"@types/qrcode": "^1.5.0",
"@types/react": "18.0.14",
"@types/react-dom": "18.0.5",
"@types/regenerator-runtime": "^0.13.1",
Expand All @@ -141,11 +149,11 @@
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "7.30.1",
"eslint-plugin-react-hooks": "4.6.0",
"gh-pages": "^4.0.0",
"jest": "27.5.1",
"jest-mock-extended": "^2.0.6",
"jest-preset-angular": "^12.2.0",
"nx": "14.4.2",
"gh-pages": "^4.0.0",
"prettier": "^2.7.1",
"react-test-renderer": "18.2.0",
"sass": "1.52.3",
Expand Down
3 changes: 3 additions & 0 deletions packages/coin98-wallet/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": [["@nrwl/web/babel", { "useBuiltIns": "usage" }]]
}
18 changes: 18 additions & 0 deletions packages/coin98-wallet/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}
49 changes: 49 additions & 0 deletions packages/coin98-wallet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# @near-wallet-selector/coin98-wallet

Coin98 Wallet [Coin98 Wallet](https://chrome.google.com/webstore/detail/coin98-wallet/aeachknmefphepccionboohckonoeemg) Package for NEAR Wallet Selector

## Installation

This package requires `near-api-js` v0.44.2 or above:

```bash
# Using Yarn
yarn add near-api-js

# Using NPM.
npm install near-api-js
```

```bash
# Using Yarn
yarn add @near-wallet-selector/coin98-wallet

# Using NPM.
npm install @near-wallet-selector/coin98-wallet
```

## Usage

```ts
import { setupWalletSelector } from "@near-wallet-selector/core";
import { setupCoin98Wallet } from "@near-wallet-selector/coin98-wallet";

// Coin98 Wallet for Wallet Selector can be setup without any params or it can take one optional param.
const coin98Wallet = setupCoin98Wallet({
iconUrl: "https://<Your Icon URL here>"
});


const selector = await setupWalletSelector({
network: "testnet",
modules: [coin98Wallet],
});
```

## Options

- `iconUrl`: (`string?`): Icon is optional. Default image point to Coin98 Wallet Logo in base64 format.

## License

This repository is distributed under the terms of both the MIT license and the Apache License (Version 2.0).
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions packages/coin98-wallet/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
displayName: "coin98-wallet",
preset: "../../jest.preset.js",
globals: {
"ts-jest": {
tsconfig: "<rootDir>/tsconfig.spec.json",
},
},
transform: {
"^.+\\.[tj]sx?$": "ts-jest",
},
moduleFileExtensions: ["ts", "tsx", "js", "jsx"],
coverageDirectory: "../../coverage/packages/coin98-wallet",
};
Loading

0 comments on commit 2e151d2

Please sign in to comment.