Skip to content

Commit 6d009bf

Browse files
Merge pull request #1070 from near/dev
v8.9.4 Release (dev -> main)
2 parents 97b9c3c + 42e7c85 commit 6d009bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+167
-431
lines changed

README.md

-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
NEAR Wallet Selector makes it easy for users to interact with your dApp by providing an abstraction over various wallets within the NEAR ecosystem:
44

5-
- [NEAR Wallet](https://www.npmjs.com/package/@near-wallet-selector/near-wallet) - Browser wallet.
65
- [My NEAR Wallet](https://www.npmjs.com/package/@near-wallet-selector/my-near-wallet) - Browser wallet.
76
- [Mintbase Wallet](https://www.npmjs.com/package/@near-wallet-selector/mintbase-wallet) - Browser wallet.
87
- [Ledger](https://www.npmjs.com/package/@near-wallet-selector/ledger) - Hardware wallet.
@@ -54,7 +53,6 @@ Next, you'll need to install the wallets you want to support:
5453
```bash
5554
# Using Yarn
5655
yarn add \
57-
@near-wallet-selector/near-wallet \
5856
@near-wallet-selector/bitget-wallet \
5957
@near-wallet-selector/my-near-wallet \
6058
@near-wallet-selector/sender \
@@ -77,7 +75,6 @@ yarn add \
7775

7876
# Using NPM.
7977
npm install \
80-
@near-wallet-selector/near-wallet \
8178
@near-wallet-selector/bitget-wallet \
8279
@near-wallet-selector/my-near-wallet \
8380
@near-wallet-selector/sender \
@@ -115,7 +112,6 @@ Then in your dApp:
115112
import { setupWalletSelector } from "@near-wallet-selector/core";
116113
import { setupModal } from "@near-wallet-selector/modal-ui";
117114
import { setupBitgetWallet } from "@near-wallet-selector/bitget-wallet";
118-
import { setupNearWallet } from "@near-wallet-selector/near-wallet";
119115
import { setupMyNearWallet } from "@near-wallet-selector/my-near-wallet";
120116
import { setupSender } from "@near-wallet-selector/sender";
121117
import { setupHereWallet } from "@near-wallet-selector/here-wallet";
@@ -139,7 +135,6 @@ import { setupMintbaseWallet } from "@near-wallet-selector/mintbase-wallet";
139135
const selector = await setupWalletSelector({
140136
network: "testnet",
141137
modules: [
142-
setupNearWallet(),
143138
setupBitgetWallet(),
144139
setupMyNearWallet(),
145140
setupSender(),

examples/angular/project.json

-5
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@
1919
"assets": [
2020
"examples/angular/src/favicon.ico",
2121
"examples/angular/src/assets",
22-
{
23-
"glob": "**/*",
24-
"input": "packages/near-wallet/assets/",
25-
"output": "assets/"
26-
},
2722
{
2823
"glob": "**/*",
2924
"input": "packages/my-near-wallet/assets/",

examples/angular/src/app/components/content/content.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ export class ContentComponent implements OnInit, OnDestroy {
237237
async onSignMessage() {
238238
const wallet = await this.selector.wallet();
239239
const message = "test message to sign";
240-
const nonce = Buffer.from(Array.from(Array(32).keys()));
240+
const nonce = Buffer.from(crypto.getRandomValues(new Uint8Array(32)));
241241
const recipient = "guest-book.testnet";
242242

243243
if (wallet.type === "browser") {

examples/angular/src/app/pages/wallet-selector-export/wallet-selector-export.component.ts

-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { OnInit } from "@angular/core";
22
import type { AccountState, WalletSelector } from "@near-wallet-selector/core";
33
import { setupWalletSelector } from "@near-wallet-selector/core";
44
import type { WalletSelectorModal } from "@near-wallet-selector/account-export";
5-
import { setupNearWallet } from "@near-wallet-selector/near-wallet";
65
import { setupSender } from "@near-wallet-selector/sender";
76
import { setupBitgetWallet } from "@near-wallet-selector/bitget-wallet";
87
import { setupXDEFI } from "@near-wallet-selector/xdefi";
@@ -56,7 +55,6 @@ export class WalletSelectorExportComponent implements OnInit {
5655
modules: [
5756
setupMyNearWallet(),
5857
setupLedger(),
59-
setupNearWallet(),
6058
setupSender(),
6159
setupBitgetWallet(),
6260
setupXDEFI(),

examples/angular/src/app/pages/wallet-selector/wallet-selector.component.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type { AccountState, WalletSelector } from "@near-wallet-selector/core";
33
import { setupWalletSelector } from "@near-wallet-selector/core";
44
import type { WalletSelectorModal } from "@near-wallet-selector/modal-ui-js";
55
import { setupModal } from "@near-wallet-selector/modal-ui-js";
6-
import { setupNearWallet } from "@near-wallet-selector/near-wallet";
76
import { setupSender } from "@near-wallet-selector/sender";
87
import { setupBitgetWallet } from "@near-wallet-selector/bitget-wallet";
98
import { setupXDEFI } from "@near-wallet-selector/xdefi";
@@ -58,7 +57,6 @@ export class WalletSelectorComponent implements OnInit {
5857
modules: [
5958
setupMyNearWallet(),
6059
setupLedger(),
61-
setupNearWallet(),
6260
setupSender(),
6361
setupBitgetWallet(),
6462
setupXDEFI(),
@@ -76,6 +74,15 @@ export class WalletSelectorComponent implements OnInit {
7674
}),
7775
setupWalletConnect({
7876
projectId: "c8cb6204543639c31aef44ea4837a554", // Replace this with your own projectId form WalletConnect.
77+
// Overrides the default methods on wallet-connect.ts
78+
// the near_signMessage and near_verifyOwner are missing here.
79+
methods: [
80+
"near_signIn",
81+
"near_signOut",
82+
"near_getAccounts",
83+
"near_signTransaction",
84+
"near_signTransactions",
85+
],
7986
metadata: {
8087
name: "NEAR Wallet Selector",
8188
description: "Example dApp used by NEAR Wallet Selector",

examples/react/components/Content.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ const Content: React.FC = () => {
338338
const wallet = await selector.wallet();
339339

340340
const message = "test message to sign";
341-
const nonce = Buffer.from(Array.from(Array(32).keys()));
341+
const nonce = Buffer.from(crypto.getRandomValues(new Uint8Array(32)));
342342
const recipient = "guest-book.testnet";
343343

344344
if (wallet.type === "browser") {

examples/react/contexts/WalletSelectorContext.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { setupMeteorWallet } from "@near-wallet-selector/meteor-wallet";
77
import { setupNarwallets } from "@near-wallet-selector/narwallets";
88
import type { WalletSelectorModal } from "@near-wallet-selector/modal-ui";
99
import { setupModal } from "@near-wallet-selector/modal-ui";
10-
import { setupNearWallet } from "@near-wallet-selector/near-wallet";
1110
import { setupNearFi } from "@near-wallet-selector/nearfi";
1211
import { setupNightly } from "@near-wallet-selector/nightly";
1312
import { setupSender } from "@near-wallet-selector/sender";
@@ -68,7 +67,6 @@ export const WalletSelectorContextProvider: React.FC<{
6867
modules: [
6968
setupMyNearWallet(),
7069
setupLedger(),
71-
setupNearWallet(),
7270
setupSender(),
7371
setupBitgetWallet(),
7472
setupMathWallet(),

examples/react/contexts/WalletSelectorExportContext.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { setupWalletSelector } from "@near-wallet-selector/core";
1111
import type { WalletSelector, AccountState } from "@near-wallet-selector/core";
1212
import { setupExportSelectorModal } from "@near-wallet-selector/account-export";
1313
import type { WalletSelectorModal } from "@near-wallet-selector/account-export";
14-
import { setupNearWallet } from "@near-wallet-selector/near-wallet";
1514
import { setupHereWallet } from "@near-wallet-selector/here-wallet";
1615
import { setupSender } from "@near-wallet-selector/sender";
1716
import { setupBitgetWallet } from "@near-wallet-selector/bitget-wallet";
@@ -61,7 +60,6 @@ export const ExportAccountSelectorContextProvider: React.FC<{
6160
modules: [
6261
setupMyNearWallet(),
6362
setupLedger(),
64-
setupNearWallet(),
6563
setupSender(),
6664
setupBitgetWallet(),
6765
setupMathWallet(),

examples/react/project.json

-5
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@
1212
"root": "examples/react",
1313
"outputPath": "dist/examples/react",
1414
"assets": [
15-
{
16-
"glob": "**/*",
17-
"input": "packages/near-wallet/assets/",
18-
"output": "assets/"
19-
},
2015
{
2116
"glob": "**/*",
2217
"input": "packages/my-near-wallet/assets/",

package.json

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "near-wallet-selector",
3-
"version": "8.9.3",
3+
"version": "8.9.4",
44
"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",
55
"keywords": [
66
"near",
@@ -9,7 +9,6 @@
99
"dapps",
1010
"near-protocol",
1111
"near-blockchain",
12-
"near-wallet",
1312
"near-snap",
1413
"my-near-wallet",
1514
"bitget-wallet",
@@ -48,7 +47,6 @@
4847
"build:bitget-wallet": "nx run-many --target=build --projects=bitget-wallet --configuration=production",
4948
"build:ledger": "nx run-many --target=build --projects=ledger --configuration=production",
5049
"build:math-wallet": "nx run-many --target=build --projects=math-wallet --configuration=production",
51-
"build:near-wallet": "nx run-many --target=build --projects=near-wallet --configuration=production",
5250
"build:here-wallet": "nx run-many --target=build --projects=here-wallet --configuration=production",
5351
"build:my-near-wallet": "nx run-many --target=build --projects=my-near-wallet --configuration=production",
5452
"build:sender": "nx run-many --target=build --projects=sender --configuration=production",
@@ -88,8 +86,8 @@
8886
"@angular/router": "15.2.9",
8987
"@here-wallet/core": "^1.5.1",
9088
"@jscutlery/semver": "3.1.0",
91-
"@ledgerhq/hw-transport": "6.27.1",
92-
"@ledgerhq/hw-transport-webhid": "6.27.1",
89+
"@ledgerhq/hw-transport": "6.30.3",
90+
"@ledgerhq/hw-transport-webhid": "6.28.3",
9391
"@metamask/detect-provider": "^2.0.0",
9492
"@meteorwallet/sdk": "^1.0.9",
9593
"@mintbase-js/wallet": "0.5.0-beta.6",
@@ -98,7 +96,7 @@
9896
"@ramper/near": "^0.0.30",
9997
"@walletconnect/modal": "^2.6.2",
10098
"@walletconnect/sign-client": "2.11.0",
101-
"better-sqlite3": "^9.2.2",
99+
"better-sqlite3": "^9.3.0",
102100
"big.js": "^6.1.1",
103101
"bn.js": "^5.2.0",
104102
"borsh": "^0.7.0",

packages/account-export/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ Then use it in your wallet:
1919
```ts
2020
import { setupWalletSelector } from "@near-wallet-selector/core";
2121
import { setupExportSelectorModal } from "@near-wallet-selector/account-export";
22-
import { setupNearWallet } from "@near-wallet-selector/near-wallet";
22+
import { setupMyNearWallet } from "@near-wallet-selector/my-near-wallet";
2323

2424
const selector = await setupWalletSelector({
2525
network: "testnet",
26-
modules: [setupNearWallet()],
26+
modules: [setupMyNearWallet()],
2727
});
2828

2929
const modal = setupExportSelectorModal(selector, {

packages/account-export/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@near-wallet-selector/account-export",
3-
"version": "8.9.3",
3+
"version": "8.9.4",
44
"description": "This is the Export Selector UI package for NEAR Wallet Selector.",
55
"keywords": [
66
"near",

packages/bitget-wallet/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@near-wallet-selector/bitget-wallet",
3-
"version": "8.9.3",
3+
"version": "8.9.4",
44
"description": "Bitget wallet package for NEAR Wallet Selector.",
55
"keywords": [
66
"near",

packages/coin98-wallet/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@near-wallet-selector/coin98-wallet",
3-
"version": "8.9.3",
3+
"version": "8.9.4",
44
"description": "Coin 98 wallet package for NEAR Wallet Selector.",
55
"keywords": [
66
"near",

packages/core/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ Then use it in your dApp:
2626

2727
```ts
2828
import { setupWalletSelector } from "@near-wallet-selector/core";
29-
import { setupNearWallet } from "@near-wallet-selector/near-wallet";
29+
import { setupMyNearWallet } from "@near-wallet-selector/my-near-wallet";
3030

3131
// The entire set of options can be found in the section below.
3232
const selector = await setupWalletSelector({
3333
network: "testnet",
34-
modules: [setupNearWallet()],
34+
modules: [setupMyNearWallet()],
3535
});
3636
```
3737

packages/core/docs/api/selector.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Retrieve the current state. You can find more information on `WalletSelectorStat
6565

6666
```ts
6767
const state = selector.store.getState();
68-
console.log(state); // { modules: [{ id: "near-wallet", ... }], ... }
68+
console.log(state); // { modules: [{ id: "my-near-wallet", ... }], ... }
6969
```
7070

7171
### `.store.observable`
@@ -126,7 +126,7 @@ Programmatically access wallets and call their methods. It's advised to use `sta
126126

127127
// Specific wallet.
128128
(async () => {
129-
const wallet = await selector.wallet("near-wallet");
129+
const wallet = await selector.wallet("my-near-wallet");
130130
const accounts = await wallet.signIn({ contractId: "test.testnet" });
131131
})();
132132
```

packages/core/docs/api/state.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Returns the list of available modules.
3737

3838
```ts
3939
const { modules } = selector.store.getState();
40-
console.log(modules); // [{ id: "near-wallet", ... }]
40+
console.log(modules); // [{ id: "my-near-wallet", ... }]
4141
```
4242

4343
### `.accounts`
@@ -74,7 +74,7 @@ Returns the ID of the selected wallet.
7474

7575
```ts
7676
const { selectedWalletId } = selector.store.getState();
77-
console.log(selectedWalletId); // "near-wallet"
77+
console.log(selectedWalletId); // "my-near-wallet"
7878
```
7979

8080
### `.recentlySignedInWallets`
@@ -91,5 +91,5 @@ Returns ID-s of 5 recently signed in wallets.
9191

9292
```ts
9393
const { recentlySignedInWallets } = selector.store.getState();
94-
console.log(recentlySignedInWallets); // ["near-wallet", "sender", ...]
94+
console.log(recentlySignedInWallets); // ["my-near-wallet", "sender", ...]
9595
```

packages/core/docs/api/wallet.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Unique identifier of the wallet.
1414

1515
```ts
1616
(async () => {
17-
const wallet = await selector.wallet("near-wallet");
18-
console.log(wallet.id); // "near-wallet"
17+
const wallet = await selector.wallet("my-near-wallet");
18+
console.log(wallet.id); // "my-near-wallet"
1919
})();
2020
```
2121

@@ -97,9 +97,9 @@ Programmatically sign in. Hardware wallets (e.g. Ledger) require `derivationPath
9797
**Example**
9898

9999
```ts
100-
// NEAR Wallet.
100+
// MyNearWallet.
101101
(async () => {
102-
const wallet = await selector.wallet("near-wallet");
102+
const wallet = await selector.wallet("my-near-wallet");
103103
const accounts = await wallet.signIn({ contractId: "test.testnet" });
104104
})();
105105

@@ -223,7 +223,7 @@ Signs the message and verifies the owner. Message is not sent to blockchain.
223223
- `signerId` (`string?`): Account ID used to sign the transaction. Defaults to the first account.
224224
- `receiverId` (`string?`): Account ID to receive the transaction. Defaults to `contractId` defined in `.init`.
225225
- `actions` (`Array<Action>`): NEAR Action(s) to sign and send to the network (e.g. `FunctionCall`). You can find more information on `Action` [here](./transactions.md).
226-
- `callbackUrl` (`string?`): Applicable to browser wallets (e.g. NEAR Wallet). This the callback url once the transaction is approved.
226+
- `callbackUrl` (`string?`): Applicable to browser wallets (e.g. MyNearWallet). This the callback url once the transaction is approved.
227227

228228
**Returns**
229229

@@ -260,7 +260,7 @@ Signs one or more NEAR Actions before sending to the network. The user must be s
260260

261261
- `params` (`object`)
262262
- `transactions` (`Array<Transaction>`): NEAR Transactions(s) to sign and send to the network. You can find more information on `Transaction` [here](./transactions.md).
263-
- `callbackUrl` (`string?`): Applicable to browser wallets (e.g. NEAR Wallet). This the callback url once the transaction is approved.
263+
- `callbackUrl` (`string?`): Applicable to browser wallets (e.g. MyNearWallet). This the callback url once the transaction is approved.
264264

265265
**Returns**
266266

packages/core/docs/guides/custom-wallets.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,15 @@ This method signs a list of NEAR Actions before sending via an RPC endpoint. The
142142

143143
Where you might have to construct NEAR Transactions and send them yourself, you can import `near-api-js` and make use of the injected `provider` that's configured based on `options.network`.
144144

145-
> Note: Browser wallets (i.e. NEAR Wallet) are unable to return the transaction outcome as they can trigger a redirect. The return type in this case is `Promise<void>` instead of the usual `Promise<FinalExecutionOutcome>`.
145+
> Note: Browser wallets (i.e. MyNearWallet) are unable to return the transaction outcome as they can trigger a redirect. The return type in this case is `Promise<void>` instead of the usual `Promise<FinalExecutionOutcome>`.
146146
147147
### `signAndSendTransactions`
148148

149149
This method is similar to `signAndSendTransaction` but instead sends a batch of Transactions.
150150

151-
> Note: Exactly how this method should behave when transactions fail is still under review with no clear "right" way to do it. NEAR Wallet (website) seems to ignore any transactions that fail and continue executing the rest. Our approach attempts to execute the transactions in a series and bail if any fail (we will look to improve this in the future by implementing a retry feature).
151+
> Note: Exactly how this method should behave when transactions fail is still under review with no clear "right" way to do it. MyNearWallet (website) seems to ignore any transactions that fail and continue executing the rest. Our approach attempts to execute the transactions in a series and bail if any fail (we will look to improve this in the future by implementing a retry feature).
152152
153153
### `signMessage`
154154

155155
This method allows users to sign a message for a specific recipient using their NEAR account.
156-
Returns the `SignedMessage` based on the [NEP413](https://github.com/near/NEPs/blob/master/neps/nep-0413.md).
156+
Returns the `SignedMessage` based on the [NEP413](https://github.com/near/NEPs/blob/master/neps/nep-0413.md).

packages/core/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@near-wallet-selector/core",
3-
"version": "8.9.3",
3+
"version": "8.9.4",
44
"description": "This is the core package for NEAR Wallet Selector.",
55
"keywords": [
66
"near",

packages/core/src/lib/wallet/wallet.types.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -220,15 +220,15 @@ interface BrowserWalletSignInParams extends SignInParams {
220220
interface BrowserWalletSignAndSendTransactionParams
221221
extends SignAndSendTransactionParams {
222222
/**
223-
* Applicable to browser wallets (e.g. NEAR Wallet). This the callback url once the transaction is approved.
223+
* Applicable to browser wallets (e.g. MyNearWallet). This the callback url once the transaction is approved.
224224
*/
225225
callbackUrl?: string;
226226
}
227227

228228
interface BrowserWalletSignAndSendTransactionsParams
229229
extends SignAndSendTransactionsParams {
230230
/**
231-
* Applicable to browser wallets (e.g. NEAR Wallet). This the callback url once the transaction is approved.
231+
* Applicable to browser wallets (e.g. MyNearWallet). This the callback url once the transaction is approved.
232232
*/
233233
callbackUrl?: string;
234234
}

packages/here-wallet/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@near-wallet-selector/here-wallet",
3-
"version": "8.9.3",
3+
"version": "8.9.4",
44
"description": "Here wallet package for NEAR Wallet Selector.",
55
"keywords": [
66
"near",

0 commit comments

Comments
 (0)