Skip to content

Commit

Permalink
Merge pull request #695 from near/dev
Browse files Browse the repository at this point in the history
v7.8.0 Release (dev -> main)
  • Loading branch information
kujtimprenkuSQA authored Feb 9, 2023
2 parents 051478a + 6524fa7 commit 7b8c36b
Show file tree
Hide file tree
Showing 43 changed files with 138 additions and 90 deletions.
5 changes: 0 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,3 @@ Wallets shall checkbox a statement of compliance to be maintained on the wallet

41. Communication between infrastructure elements should be secured to the maximum extent possible.
Please link to your the statement on your website or GitHub repo showing a statement of compliance. Please put link below (even if it is a placeholder).


# Default Wallet List Criteria:

To be included in the default wallet list, a wallet project must have met the Wallet Product Criteria, the Wallet Security Criteria, and completed an audit.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ 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";
Expand All @@ -133,7 +132,6 @@ import { setupXDEFI } from "@near-wallet-selector/xdefi";
const selector = await setupWalletSelector({
network: "testnet",
modules: [
...(await setupDefaultWallets()),
setupNearWallet(),
setupMyNearWallet(),
setupSender(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { OnInit } from "@angular/core";
import type { AccountState, WalletSelector } from "@near-wallet-selector/core";
import { setupWalletSelector } from "@near-wallet-selector/core";
import type { WalletSelectorModal } from "@near-wallet-selector/account-export";
import { setupDefaultWallets } from "@near-wallet-selector/default-wallets";
import { setupNearWallet } from "@near-wallet-selector/near-wallet";
import { setupSender } from "@near-wallet-selector/sender";
import { setupXDEFI } from "@near-wallet-selector/xdefi";
Expand All @@ -21,6 +20,8 @@ import { setupWalletConnect } from "@near-wallet-selector/wallet-connect";
import { setupNightlyConnect } from "@near-wallet-selector/nightly-connect";
import { Component } from "@angular/core";
import { setupExportSelectorModal } from "@near-wallet-selector/account-export";
import { setupMyNearWallet } from "@near-wallet-selector/my-near-wallet";
import { setupLedger } from "@near-wallet-selector/ledger";

declare global {
interface Window {
Expand Down Expand Up @@ -52,7 +53,8 @@ export class WalletSelectorExportComponent implements OnInit {
network: "testnet",
debug: true,
modules: [
...(await setupDefaultWallets()),
setupMyNearWallet(),
setupLedger(),
setupNearWallet(),
setupSender(),
setupXDEFI(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { AccountState, WalletSelector } from "@near-wallet-selector/core";
import { setupWalletSelector } from "@near-wallet-selector/core";
import type { WalletSelectorModal } from "@near-wallet-selector/modal-ui-js";
import { setupModal } from "@near-wallet-selector/modal-ui-js";
import { setupDefaultWallets } from "@near-wallet-selector/default-wallets";
import { setupNearWallet } from "@near-wallet-selector/near-wallet";
import { setupSender } from "@near-wallet-selector/sender";
import { setupXDEFI } from "@near-wallet-selector/xdefi";
Expand All @@ -20,8 +19,10 @@ import { setupOptoWallet } from "@near-wallet-selector/opto-wallet";
import { setupFinerWallet } from "@near-wallet-selector/finer-wallet";
import { setupWalletConnect } from "@near-wallet-selector/wallet-connect";
import { setupNightlyConnect } from "@near-wallet-selector/nightly-connect";
import { CONTRACT_ID } from "../../../constants";
import { Component } from "@angular/core";
import { setupMyNearWallet } from "@near-wallet-selector/my-near-wallet";
import { setupLedger } from "@near-wallet-selector/ledger";
import { CONTRACT_ID } from "../../../constants";

declare global {
interface Window {
Expand Down Expand Up @@ -53,7 +54,8 @@ export class WalletSelectorComponent implements OnInit {
network: "testnet",
debug: true,
modules: [
...(await setupDefaultWallets()),
setupMyNearWallet(),
setupLedger(),
setupNearWallet(),
setupSender(),
setupXDEFI(),
Expand Down
8 changes: 5 additions & 3 deletions examples/react/contexts/WalletSelectorContext.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { setupCoin98Wallet } from "@near-wallet-selector/coin98-wallet";
import type { AccountState, WalletSelector } from "@near-wallet-selector/core";
import { setupWalletSelector } from "@near-wallet-selector/core";
import { setupDefaultWallets } from "@near-wallet-selector/default-wallets";
import { setupHereWallet } from "@near-wallet-selector/here-wallet";
import { setupMathWallet } from "@near-wallet-selector/math-wallet";
import { setupMeteorWallet } from "@near-wallet-selector/meteor-wallet";
Expand All @@ -23,8 +22,10 @@ import { distinctUntilChanged, map } from "rxjs";
import { setupNeth } from "@near-wallet-selector/neth";
import { setupOptoWallet } from "@near-wallet-selector/opto-wallet";
import { setupFinerWallet } from "@near-wallet-selector/finer-wallet";
import { CONTRACT_ID } from "../constants";
import { Loading } from "../components/Loading";
import { setupMyNearWallet } from "@near-wallet-selector/my-near-wallet";
import { setupLedger } from "@near-wallet-selector/ledger";
import { CONTRACT_ID } from "../constants";

declare global {
interface Window {
Expand Down Expand Up @@ -55,7 +56,8 @@ export const WalletSelectorContextProvider: React.FC<{
network: "testnet",
debug: true,
modules: [
...(await setupDefaultWallets()),
setupMyNearWallet(),
setupLedger(),
setupNearWallet(),
setupSender(),
setupMathWallet(),
Expand Down
6 changes: 4 additions & 2 deletions examples/react/contexts/WalletSelectorExportContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { setupWalletSelector } from "@near-wallet-selector/core";
import type { WalletSelector, AccountState } from "@near-wallet-selector/core";
import { setupExportSelectorModal } from "@near-wallet-selector/account-export";
import type { WalletSelectorModal } from "@near-wallet-selector/account-export";
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";
Expand All @@ -19,6 +18,8 @@ import { setupWalletConnect } from "@near-wallet-selector/wallet-connect";
import { setupCoin98Wallet } from "@near-wallet-selector/coin98-wallet";
import { setupOptoWallet } from "@near-wallet-selector/opto-wallet";
import { Loading } from "../components/Loading";
import { setupMyNearWallet } from "@near-wallet-selector/my-near-wallet";
import { setupLedger } from "@near-wallet-selector/ledger";

declare global {
interface Window {
Expand Down Expand Up @@ -49,7 +50,8 @@ export const ExportAccountSelectorContextProvider: React.FC<{
network: "testnet",
debug: true,
modules: [
...(await setupDefaultWallets()),
setupMyNearWallet(),
setupLedger(),
setupNearWallet(),
setupSender(),
setupMathWallet(),
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "near-wallet-selector",
"version": "7.7.0",
"version": "7.8.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 Down Expand Up @@ -87,10 +87,10 @@
"@ledgerhq/hw-transport-webhid": "6.27.1",
"@metamask/detect-provider": "^2.0.0",
"@meteorwallet/sdk": "^0.6.0",
"@nightlylabs/connect-near": "0.0.14",
"@nightlylabs/connect-near": "0.0.15",
"@walletconnect/qrcode-modal": "2.0.0-alpha.20",
"@walletconnect/sign-client": "2.1.4",
"better-sqlite3": "^8.0.0",
"better-sqlite3": "^8.0.1",
"big.js": "^6.1.1",
"bn.js": "^5.2.0",
"bs58": "^5.0.0",
Expand All @@ -109,7 +109,7 @@
"react-dom": "18.2.0",
"react-qr-code": "^2.0.11",
"regenerator-runtime": "0.13.11",
"rxjs": "^7.5.7",
"rxjs": "^7.8.0",
"stream-browserify": "^3.0.0",
"tslib": "^2.3.0",
"tweetnacl": "^1.0.3",
Expand Down Expand Up @@ -170,7 +170,7 @@
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "7.30.1",
"eslint-plugin-react-hooks": "4.6.0",
"gh-pages": "^4.0.0",
"gh-pages": "^5.0.0",
"jest": "27.5.1",
"jest-mock-extended": "^2.0.6",
"jest-preset-angular": "^12.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/account-export/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/account-export",
"version": "7.7.0",
"version": "7.8.0",
"description": "This is the Export Selector UI package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/coin98-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/coin98-wallet",
"version": "7.7.0",
"version": "7.8.0",
"description": "Coin 98 wallet package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
1 change: 1 addition & 0 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const selector = await setupWalletSelector({
- `indexerUrl` (`string`): Custom URL for the Indexer service.
- `debug` (`boolean?`): Enable internal logging for debugging purposes. Defaults to `false`.
- `optimizeWalletOrder` (`boolean?`): Enable automatic wallet order. Reorders last signed in wallet on top, then installed wallets over not installed and deprecated wallets.
- `randomizeWalletOrder` (`boolean?`): Randomize wallets order in the `More` section of the UI.
- `allowMultipleSelectors` (`boolean?`): Optionally allow creating new instances of wallet selector.
- `storage` (`StorageService?`): Async storage implementation. Useful when [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) is unavailable. Defaults to `localStorage`.
- `modules` (`Array<WalletModuleFactory>`): List of wallets to support in your dApp.
Expand Down
2 changes: 1 addition & 1 deletion packages/core/docs/api/selector.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- `explorerUrl` (`string`): URL for the NEAR explorer.
- `debug` (`boolean`): Whether internal logging is enabled.
- `optimizeWalletOrder` (`boolean`): Whether wallet order optimization is enabled.

- `randomizeWalletOrder` (`boolean`): Weather wallet order randomization is enabled.
**Description**

Resolved variation of the options passed to `setupWalletSelector`.
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/core",
"version": "7.7.0",
"version": "7.8.0",
"description": "This is the core package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/lib/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const resolveOptions = (params: WalletSelectorParams) => {
network: resolveNetwork(params.network),
debug: params.debug || false,
optimizeWalletOrder: params.optimizeWalletOrder === false ? false : true,
randomizeWalletOrder: params.randomizeWalletOrder || false,
};

return {
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/lib/options.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ export interface Options {
network: Network;
debug: boolean;
optimizeWalletOrder: boolean;
randomizeWalletOrder: boolean;
}
1 change: 1 addition & 0 deletions packages/core/src/lib/wallet-selector.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface WalletSelectorParams {
debug?: boolean;
optimizeWalletOrder?: boolean;
allowMultipleSelectors?: boolean;
randomizeWalletOrder?: boolean;
}

export type WalletSelectorStore = ReadOnlyStore;
Expand Down
4 changes: 1 addition & 3 deletions packages/default-wallets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ This is the Default Wallets package for NEAR Wallet Selector.

This is the list of default wallets:

- [My NEAR Wallet](https://www.npmjs.com/package/@near-wallet-selector/my-near-wallet) - Browser wallet.
- [Ledger](https://www.npmjs.com/package/@near-wallet-selector/ledger) - Hardware wallet.

>**Note**: This package does not contain any wallets by default.
## Installation and Usage

Expand Down
2 changes: 1 addition & 1 deletion packages/default-wallets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/default-wallets",
"version": "7.7.0",
"version": "7.8.0",
"description": "Default wallets package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
4 changes: 1 addition & 3 deletions packages/default-wallets/src/lib/default-wallets.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { setupMyNearWallet } from "@near-wallet-selector/my-near-wallet";
import { setupLedger } from "@near-wallet-selector/ledger";
import type { WalletModuleFactory } from "@near-wallet-selector/core";

export const setupDefaultWallets = async (): Promise<
Array<WalletModuleFactory>
> => {
return [setupMyNearWallet(), setupLedger()];
return [];
};
2 changes: 1 addition & 1 deletion packages/finer-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/finer-wallet",
"version": "7.7.0",
"version": "7.8.0",
"description": "FiNER Wallet package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/here-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/here-wallet",
"version": "7.7.0",
"version": "7.8.0",
"description": "Here wallet package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/ledger",
"version": "7.7.0",
"version": "7.8.0",
"description": "Ledger package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/math-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/math-wallet",
"version": "7.7.0",
"version": "7.8.0",
"description": "Math wallet package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/meteor-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/meteor-wallet",
"version": "7.7.0",
"version": "7.8.0",
"description": "Meteor wallet package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
2 changes: 1 addition & 1 deletion packages/modal-ui-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/modal-ui-js",
"version": "7.7.0",
"version": "7.8.0",
"description": "Modal UI package for NEAR wallet Selector",
"keywords": [
"near",
Expand Down
10 changes: 9 additions & 1 deletion packages/modal-ui-js/src/lib/render-modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,15 @@ export function renderModal() {
`
);
renderOptionsList(".recent-options-list-content", recentlySignedInWallets);
renderOptionsList(".more-options-list-content", moreWallets);

if (modalState.selector.options.randomizeWalletOrder) {
renderOptionsList(
".more-options-list-content",
moreWallets.sort(() => Math.random() - 0.5)
);
} else {
renderOptionsList(".more-options-list-content", moreWallets);
}
} else {
document
.querySelector(".wallet-options-wrapper")
Expand Down
2 changes: 1 addition & 1 deletion packages/modal-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/modal-ui",
"version": "7.7.0",
"version": "7.8.0",
"description": "Modal UI package for NEAR wallet Selector",
"keywords": [
"near",
Expand Down
7 changes: 5 additions & 2 deletions packages/modal-ui/src/lib/components/WalletOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,11 @@ export const WalletOptions: React.FC<WalletOptionsProps> = ({
setRecentModules(recentlySignedInWallets);
setMoreModules(moreWallets);
}

setModules(state.modules);
if (selector.options.randomizeWalletOrder) {
setModules(state.modules.sort(() => Math.random() - 0.5));
} else {
setModules(state.modules);
}
});
return () => subscription.unsubscribe();
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down
2 changes: 1 addition & 1 deletion packages/my-near-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@near-wallet-selector/my-near-wallet",
"version": "7.7.0",
"version": "7.8.0",
"description": "My Near Wallet package for NEAR Wallet Selector.",
"keywords": [
"near",
Expand Down
Loading

0 comments on commit 7b8c36b

Please sign in to comment.