diff --git a/blog/2024-07-01.md b/blog/2024-07-01.md
index 295ae061678..d2b7d0612d5 100644
--- a/blog/2024-07-01.md
+++ b/blog/2024-07-01.md
@@ -76,4 +76,4 @@ If your application relies on community-contributed or unreviewed third-party co
If you are not relying on any untrusted component code, then **maybe**. You are not being forced to migrate and there are still teams actively building new applications leveraging B.O.S. Additionally, there are no plans to deprecate main B.O.S. gateways at [dev.near.org](https://dev.near.org), [near.social](https://near.social), [dapdap](https://dapdap.net) or [bos.gg](https://bos.gg). However, the underlying framework and virtual machine are no longer actively developed or maintained by the original team. Consequently, the pace at which new features are introduced and existing bugs or vulnerabilities are addressed may be slower than expected. We openly welcome new maintainers for [this codebase](https://github.com/nearsocial). However, as previously mentioned, we anticipate that additional security vulnerabilities may still be discovered.
-We have updated [βFrontends for Web3 dAppsβ in docs.near.org](/web3-apps/tutorials/web-login/wallet-selector) to help you choose a solution that is right for you. If you need help, please reach out to one of our support channels on [Telegram](https://t.me/neardev) or [Discord](https://near.chat) and we will be happy to assist you or answer any questions you have.
+We have updated ["Frontends for Web3 dApps" in docs.near.org](/web3-apps/tutorials/wallet-login) to help you choose a solution that is right for you. If you need help, please reach out to one of our support channels on [Telegram](https://t.me/neardev) or [Discord](https://near.chat) and we will be happy to assist you or answer any questions you have.
diff --git a/blog/2024-11-07.md b/blog/2024-11-07.md
index 67b7be922d0..b276a7d49e9 100644
--- a/blog/2024-11-07.md
+++ b/blog/2024-11-07.md
@@ -23,27 +23,71 @@ The idea of bringing Ethereum wallets to Near was born on the [NEP-518](https://
Since Ethereum wallets create **ethereum transactions** and talk with **ethereum RPCs**, the Aurora team had to create three components:
-1. A Translator API, that translates Ethereum RPC calls into NEAR RPC calls
-2. A "Wallet Contract" deployed on Near, that can process Ethereum transactions
+1. A `Transaction Encoder` service, that encodes NEAR actions into Ethereum transactions
+2. A `Translator RPC` service, that translates Ethereum RPC calls into NEAR RPC calls
+3. A `Wallet Contract` that allows NEAR accounts to process EVM transactions
+---
-### Login
+### Transaction Encoder
-Imagine your account on Metamask is `0xD79...314`, and you want to login on a Near application.
+The `Transaction Encoder` - implemented [directly in the NEAR Wallet Selector](https://github.com/near/wallet-selector/blob/main/packages/ethereum-wallets/src/lib/index.ts) - takes the intent of the user (e.g. call `set_greeting` on `hello.near`) and translates it into an Ethereum transaction that the EVM wallet can sign.
-The first time you login, `ethereum-wallets.near` will create the Near account `0xD79...314` for you.
+#### To (field)
+The `to` field of the Ethereum transaction is transformed following these rules:
+- If the `receiverId` matches `^0x[a-f0-9]{40}$` (e.g. `0xD79...314`), then the `to` field is set to the `receiverId`
+- Otherwise (e.g. `ana.near` or an implicit account) the `to` field is set as `keccak-256(receiverId)[12,32]`
-
+#### Data (field)
+The `data` field contains the RLP-encoded NEAR actions wanted by the user, encoded as function calls on Ethereum, for example:
+- `FunctionCall(to: string, method: string, args: bytes, yoctoNear: uint32)`
+- `Transfer(to: string, yoctoNear: uint32)`
+- `Stake(public_key: bytes, yoctoNear: uint32)`
+- `AddKey(public_key: bytes, nonce: uint64, is_full_access: bool, allowance: uint256, receiver_id: string, method_names: string[])`
-Your new Near account already has a `Wallet Contract` deployed on it, which can **translate ethereum transactions** into **account actions**.
+:::info
+For more information on how other fields (such as `value`, `gas`, and `chainId`) are set, please refer to the [NEP-518 technical specification](https://github.com/near/NEPs/issues/518)
+:::
-:::tip
-In Near, smart contracts can do anything an account can do, including sending tokens and calling other contracts!
+---
+
+### Translator RPC
+
+The `Translator RPC` is a service deployed at `https://eth-rpc.mainnet.near.org` (for mainnet) and `https://eth-rpc.testnet.near.org` (for testnet) that translates Ethereum RPC calls into NEAR RPC calls.
+
+In other words, the `Translator RPC` simply acts as a relayer, taking the Ethereum transactions signed by the user and translating them into a function call into the `Wallet Contract` deployed in the user's account.
+
+---
+
+### Wallet Contract
+
+The `Wallet Contract` is a smart contract on NEAR that allows NEAR accounts to process EVM transactions.
+
+The contract exposes a method called `rlp_execute`, which takes as argument an RLP-encoded Ethereum transaction, verifies its signature, and executes the NEAR actions encoded in the `data` field of the transaction.
+
+Every NEAR account created through an EVM wallet has the `Wallet Contract` deployed on it.
+
+:::tip Wallet Accounts
+Remember that in NEAR **all accounts** can **have contracts**, and that **contracts** can perform **all the actions** that the **account can do**.
:::
-### Using your Account
+---
+
+## Using the Account
+
+### First Time Login
+
+Imagine your account on Metamask is `0xD79...314`, and you want to login on a Near application.
+
+The first time you login through your EVM wallet, the wallet selector will contact the account `ethereum-wallets.near` to create a NEAR account with the same address as your Ethereum wallet. For example, if your address on Metamask is `0xD79...314`, the NEAR account created will be `0xD79...314`.
+
+On this account, the `Wallet Contract` is deployed and a function-call key is added for the `rlp_execute` function of the contract.
+
+
+
+### Interacting with Applications
Once you have logged in, you can start interacting with the application. If at some point the application needs to interact with the blockchain, Metamask will ask you to sign a transaction.
@@ -65,16 +109,14 @@ Check [this transaction](https://testnet.nearblocks.io/txns/GrVGFVFmGBcNP5xkoA21
In order to support Ethereum wallets, you only need to update your version of `wallet-selector`, and configure it to include the new `ethereum-wallets` module.
-Do not worry! it is very simple, check our [**tutorial**](/web3-apps/tutorials/web-login/ethereum-wallets) and working example [**hello world frontend**](https://github.com/near-examples/hello-near-examples/tree/main/frontend).
+Do not worry! it is very simple, check the working example [**hello world frontend**](https://github.com/near-examples/hello-near-examples/tree/main/frontend).
---
## Resources
-1. [**Integration Tutorial**](/web3-apps/tutorials/web-login/ethereum-wallets)
-
-2. [Hello World Example](https://github.com/near-examples/hello-near-examples/blob/main/frontend/)
+1. [Hello World Example](https://github.com/near-examples/hello-near-examples/blob/main/frontend/)
-3. [Recording of the Ethereum Wallet Presentation](https://drive.google.com/file/d/1xGWN1yRLzFmRn1e29kbSiO2W1JsxuJH-/view?usp=sharing)
+2. [Recording of the Ethereum Wallet Presentation](https://drive.google.com/file/d/1xGWN1yRLzFmRn1e29kbSiO2W1JsxuJH-/view?usp=sharing)
-4. [NEP-518](https://github.com/near/NEPs/issues/518), the proposal that started it all
+3. [NEP-518](https://github.com/near/NEPs/issues/518), the proposal that started it all
diff --git a/docs/api/rpc/providers.md b/docs/api/rpc/providers.md
index a5af43eb6d4..dc992a0528e 100644
--- a/docs/api/rpc/providers.md
+++ b/docs/api/rpc/providers.md
@@ -10,7 +10,7 @@ balancing.
:::tip
-If you want to use a custom RPC provider with NEAR Wallet Selector, [check this example](../../web3-apps/tutorials/web-login/wallet-selector.md#custom-rpc).
+You can use any of these RPC endpoints with [any of our APIs](../../tools/near-api.md#view-function) or [wallet libraries](../../web3-apps/tutorials/wallet-login.md)
:::
diff --git a/docs/chain-abstraction/chain-signatures/implementation.md b/docs/chain-abstraction/chain-signatures/implementation.md
index 6096d09595a..1480c1d9a16 100644
--- a/docs/chain-abstraction/chain-signatures/implementation.md
+++ b/docs/chain-abstraction/chain-signatures/implementation.md
@@ -279,7 +279,7 @@ The method requires four parameters:
1. The `payloads` (or hashes) to be signed for the target blockchain
2. The derivation `path` for the account we want to use to sign the transaction
3. The `keyType`, `Ecdsa` for `Secp256k1` signatures and `Eddsa` for `Ed25519` signatures.
- 4. The `signerAccount` which contains the `accountId` that is signing and the `signAndSendTransactions` function from the [wallet selector](../../tools/wallet-selector.md).
+ 4. The `signerAccount` which contains the `accountId` that is signing and the `signAndSendTransactions` function from [Near Connect](../../web3-apps/tutorials/wallet-login).
diff --git a/docs/primitives/dao.md b/docs/primitives/dao.md
index c81555cd4c8..75be9a56e17 100644
--- a/docs/primitives/dao.md
+++ b/docs/primitives/dao.md
@@ -63,7 +63,7 @@ You can create a DAO by interacting with the `sputnik-dao` contract:
The full list of roles and permissions you can find [here](https://github.com/near-daos/sputnik-dao-contract#roles-and-permissions).
:::
- Learn more about adding the [Wallet Selector Hooks](../web3-apps/tutorials/web-login/wallet-selector.md) to your application
+ Learn more about adding [Near Connect](../web3-apps/tutorials/wallet-login) to your application
@@ -209,7 +209,7 @@ Query the list of DAOs existing in Sputnik Dao.
});
```
- Learn more about adding the [Wallet Selector Hooks](../web3-apps/tutorials/web-login/wallet-selector.md) to your application
+ Learn more about adding [Near Connect](../web3-apps/tutorials/wallet-login) to your application
@@ -269,7 +269,7 @@ These snippets will enable you to query the proposals existing in a particular D
});
```
- Learn more about adding the [Wallet Selector Hooks](../web3-apps/tutorials/web-login/wallet-selector.md) to your application
+ Learn more about adding [Near Connect](../web3-apps/tutorials/wallet-login) to your application
@@ -414,7 +414,7 @@ Create a proposal so other users can vote in favor or against it.
});
```
- Learn more about adding the [Wallet Selector Hooks](../web3-apps/tutorials/web-login/wallet-selector.md) to your application
+ Learn more about adding [Near Connect](../web3-apps/tutorials/wallet-login) to your application
@@ -734,7 +734,7 @@ These snippet will enable your users to cast a vote for proposal of a particular
Available vote options: `VoteApprove`, `VoteReject`, `VoteRemove`.
:::
- Learn more about adding the [Wallet Selector Hooks](../web3-apps/tutorials/web-login/wallet-selector.md) to your application
+ Learn more about adding [Near Connect](../web3-apps/tutorials/wallet-login) to your application
diff --git a/docs/primitives/dex.md b/docs/primitives/dex.md
index f741cfb148b..b5cd21561b2 100644
--- a/docs/primitives/dex.md
+++ b/docs/primitives/dex.md
@@ -188,7 +188,7 @@ Query your deposit balances by calling the `get_deposits` method:
});
```
- Learn more about adding the [Wallet Selector Hooks](../web3-apps/tutorials/web-login/wallet-selector.md) to your application
+ Learn more about adding [Near Connect](../web3-apps/tutorials/wallet-login) to your application
Example response
@@ -306,7 +306,7 @@ DEXs work by having multiple pools of token pairs (e.g. NEAR-USDC) that users ca
});
```
- Learn more about adding the [Wallet Selector Hooks](../web3-apps/tutorials/web-login/wallet-selector.md) to your application
+ Learn more about adding [Near Connect](../web3-apps/tutorials/wallet-login) to your application
Example response
@@ -498,7 +498,7 @@ In order to swap a token for another, you need to [have funds](#deposit-funds),
});
```
- Learn more about adding the [Wallet Selector Hooks](../web3-apps/tutorials/web-login/wallet-selector.md) to your application
+ Learn more about adding [Near Connect](../web3-apps/tutorials/wallet-login) to your application
Example response
diff --git a/docs/primitives/ft/ft.md b/docs/primitives/ft/ft.md
index 373e8dac2b7..bd0c794ac1c 100644
--- a/docs/primitives/ft/ft.md
+++ b/docs/primitives/ft/ft.md
@@ -68,7 +68,7 @@ Here is how to directly interact with the factory contract through your applicat
});
```
- Learn more about adding the [Wallet Selector Hooks](../../web3-apps/tutorials/web-login/wallet-selector.md) to your application
+ Learn more about adding [Near Connect](../../web3-apps/tutorials/wallet-login) to your application
@@ -204,7 +204,7 @@ You can query the FT's metadata by calling the `ft_metadata`.
- Learn more about adding the [Wallet Selector Hooks](../../web3-apps/tutorials/web-login/wallet-selector.md) to your application
+ Learn more about adding [Near Connect](../../web3-apps/tutorials/wallet-login) to your application
@@ -275,7 +275,7 @@ To know how many coins a user has you will need to query the method `ft_balance_
- Learn more about adding the [Wallet Selector Hooks](../../web3-apps/tutorials/web-login/wallet-selector.md) to your application
+ Learn more about adding [Near Connect](../../web3-apps/tutorials/wallet-login) to your application
@@ -326,7 +326,7 @@ By calling this `storage_deposit` the user can register themselves or **register
});
```
- Learn more about adding the [Wallet Selector Hooks](../../web3-apps/tutorials/web-login/wallet-selector.md) to your application
+ Learn more about adding [Near Connect](../../web3-apps/tutorials/wallet-login) to your application
@@ -374,7 +374,7 @@ To send FT to another account you will use the `ft_transfer` method, indicating
});
```
- Learn more about adding the [Wallet Selector Hooks](../../web3-apps/tutorials/web-login/wallet-selector.md) to your application
+ Learn more about adding [Near Connect](../../web3-apps/tutorials/wallet-login) to your application
@@ -464,7 +464,7 @@ Let's assume that you need to deposit FTs on [Ref Finance](https://rhea.finance/
- Learn more about adding the [Wallet Selector Hooks](../../web3-apps/tutorials/web-login/wallet-selector.md) to your application
+ Learn more about adding [Near Connect](../../web3-apps/tutorials/wallet-login) to your application
@@ -564,7 +564,7 @@ While the FT standard does not define a `burn` method, you can simply transfer t
});
```
- Learn more about adding the [Wallet Selector Hooks](../../web3-apps/tutorials/web-login/wallet-selector.md) to your application
+ Learn more about adding [Near Connect](../../web3-apps/tutorials/wallet-login) to your application
diff --git a/docs/primitives/linkdrop/linkdrop.md b/docs/primitives/linkdrop/linkdrop.md
index 6f3b10ef505..5b50ea35583 100644
--- a/docs/primitives/linkdrop/linkdrop.md
+++ b/docs/primitives/linkdrop/linkdrop.md
@@ -87,7 +87,7 @@ await callMethod({
});
```
-Learn more about adding the [Wallet Selector Hooks](../../web3-apps/tutorials/web-login/wallet-selector.md) to your application
+Learn more about adding [Near Connect](../../web3-apps/tutorials/wallet-login) to your application
@@ -155,7 +155,7 @@ await callMethod({
});
```
-Learn more about adding the [Wallet Selector Hooks](../../web3-apps/tutorials/web-login/wallet-selector.md) to your application
+Learn more about adding [Near Connect](../../web3-apps/tutorials/wallet-login) to your application
@@ -200,7 +200,7 @@ await callMethod({
});
```
-Learn more about adding the [Wallet Selector Hooks](../../web3-apps/tutorials/web-login/wallet-selector.md) to your application
+Learn more about adding [Near Connect](../../web3-apps/tutorials/wallet-login) to your application
@@ -270,7 +270,7 @@ await callMethod({
});
```
-Learn more about adding the [Wallet Selector Hooks](../../web3-apps/tutorials/web-login/wallet-selector.md) to your application
+Learn more about adding [Near Connect](../../web3-apps/tutorials/wallet-login) to your application
@@ -317,7 +317,7 @@ await callMethod({
});
```
-Learn more about adding the [Wallet Selector Hooks](../../web3-apps/tutorials/web-login/wallet-selector.md) to your application
+Learn more about adding [Near Connect](../../web3-apps/tutorials/wallet-login) to your application
@@ -396,7 +396,7 @@ await callMethod({
});
```
-Learn more about adding the [Wallet Selector Hooks](../../web3-apps/tutorials/web-login/wallet-selector.md) to your application
+Learn more about adding [Near Connect](../../web3-apps/tutorials/wallet-login) to your application
diff --git a/docs/primitives/nft/nft.md b/docs/primitives/nft/nft.md
index 0198acf699f..a1338d0abd4 100644
--- a/docs/primitives/nft/nft.md
+++ b/docs/primitives/nft/nft.md
@@ -116,7 +116,7 @@ Here is how to directly interact with the factory contract through your applicat
});
```
- Learn more about adding the [Wallet Selector Hooks](../../web3-apps/tutorials/web-login/wallet-selector.md) to your application
+ Learn more about adding [Near Connect](../../web3-apps/tutorials/wallet-login) to your application
@@ -228,7 +228,7 @@ You can query the NFT's information and metadata by calling the `nft_token`.
});
```
- Learn more about adding the [Wallet Selector Hooks](../../web3-apps/tutorials/web-login/wallet-selector.md) to your application
+ Learn more about adding [Near Connect](../../web3-apps/tutorials/wallet-login) to your application
@@ -388,7 +388,7 @@ In both cases, it is necessary to invoke the `nft_transfer` method, indicating t
});
```
- Learn more about adding the [Wallet Selector Hooks](../../web3-apps/tutorials/web-login/wallet-selector.md) to your application
+ Learn more about adding [Near Connect](../../web3-apps/tutorials/wallet-login) to your application
@@ -538,7 +538,7 @@ While the NFT standard does not define a `burn` method, you can simply transfer
});
```
- Learn more about adding the [Wallet Selector Hooks](../../web3-apps/tutorials/web-login/wallet-selector.md) to your application
+ Learn more about adding [Near Connect](../../web3-apps/tutorials/wallet-login) to your application
diff --git a/docs/smart-contracts/security/one_yocto.md b/docs/smart-contracts/security/one_yocto.md
index 6e4c20b5388..6f13b426a72 100644
--- a/docs/smart-contracts/security/one_yocto.md
+++ b/docs/smart-contracts/security/one_yocto.md
@@ -6,11 +6,10 @@ description: "Learn about the one yocto security pattern in NEAR smart contracts
NEAR uses a system of [Access Keys](../../protocol/access-keys.md) to simplify handling accounts.There are basically two type of keys: `Full Access`, that have full control over an account (i.e. can perform all [actions](../anatomy/actions.md)), and`Function Call`, that only have permission to call a specified smart contract's method(s) that _do not_ attach β as a deposit.
-When a user [signs in on a website](../../web3-apps/tutorials/web-login/wallet-selector.md#user-sign-in--sign-out) to interact with your contract, what actually happens is
-that a `Function Call` key is created and stored in the website. Since the website has access to the `Function Call` key, it can use it to
-call the authorized methods as it pleases. While this is very user friendly for most cases, it is important to be careful in scenarios involving
-transferring of valuable assets like [NFTs](../../primitives/nft/nft.md) or [FTs](../../primitives/ft/ft.md). In such cases, you need to ensure that
-the person asking for the asset to be transfer is **actually the user**.
+For example, developers can choose to request creating a `Function Call` key when the user logs in, so the application can call specific methods on a smart contract without needing to ask the user to sign every time.
+
+While this is very user friendly for most cases, it is important to be careful in scenarios involving transferring of valuable assets like [NFTs](../../primitives/nft/nft.md)
+or [FTs](../../primitives/ft/ft.md). In such cases, you need to ensure that the person asking for the asset to be transfer is **actually the user**.
One direct and inexpensive way to ensure that the user is the one calling is by requiring to attach `1 yβ`. In this case, the user will be
redirected to the wallet and be asked to accept the transaction. This is because, once again, only the `Full Access` key can be used to send NEAR.
diff --git a/docs/smart-contracts/tutorials/basic-contracts.md b/docs/smart-contracts/tutorials/basic-contracts.md
index f299c76efda..b07bb801e83 100644
--- a/docs/smart-contracts/tutorials/basic-contracts.md
+++ b/docs/smart-contracts/tutorials/basic-contracts.md
@@ -137,7 +137,7 @@ Each frontend connects to a **pre-deployed version of the contract**. Check `./f
### NEAR Connector Hooks
-All frontends use [`near-connect-hooks`](https://www.npmjs.com/package/near-connect-hooks), which wrap the functionality of [NEAR Connector](../../web3-apps/tutorials/web-login/near-connector.md) to handle the connection between the web app and the NEAR blockchain.
+All frontends use [`near-connect-hooks`](https://www.npmjs.com/package/near-connect-hooks), which wrap the functionality of [NEAR Connector](../../web3-apps/tutorials/wallet-login.md) to handle the connection between the web app and the NEAR blockchain.
The `near-connect-hooks` expose a `NearProvider` that is used to wrap the entire application, usually in `pages/_app.js`:
diff --git a/docs/tools/near-api.md b/docs/tools/near-api.md
index e91af2ee702..5041b4ffe6e 100644
--- a/docs/tools/near-api.md
+++ b/docs/tools/near-api.md
@@ -38,7 +38,7 @@ Our API is available in multiple languages, including:
- Python: [`py-near`](https://github.com/pvolnov/py-near)
:::tip Wallet Integration
-To allow users to login into your web application using a wallet you will need the `wallet-selector`. Read more in our [Web Frontend integration](../web3-apps/tutorials/web-login/wallet-selector.md) article
+To allow users to login into your web application using a wallet you will need a wallet connector. Read more in our [NEAR Connect](../web3-apps/tutorials/wallet-login) article
:::
---
@@ -163,9 +163,7 @@ To allow users to login into your web application using a wallet you will need t
- In browser, you typically donβt need to manage private keys manually. Instead, use [Wallet Selector](https://github.com/near/wallet-selector), the official wallet connection framework for NEAR dApps. It handles account access, key management, and user authentication across multiple wallet providers with a unified interface.
-
- You can find a full example of browser-based signing with `Wallet Selector` in the [official example here](https://github.com/near/wallet-selector/tree/main/examples).
+ In browser, you typically donβt need to manage private keys manually. Instead, use [NEAR Connect](../web3-apps/tutorials/wallet-login.md) to handle the user authentication and signing process securely
Manually managing keys in the browser (not recommended)
@@ -1672,7 +1670,7 @@ Users can sign messages using the `wallet-selector` `signMessage` method, which
+ url="https://github.com/near-examples/near-api-examples/blob/main/javascript/examples/verify-signature.js" />
diff --git a/docs/tools/wallet-selector.md b/docs/tools/wallet-selector.md
deleted file mode 100644
index a40f029ad1a..00000000000
--- a/docs/tools/wallet-selector.md
+++ /dev/null
@@ -1,531 +0,0 @@
----
-id: wallet-selector
-title: Wallet Selector
-sidebar_label: NEAR Wallet Selector
-description: "A single library to connect all NEAR Wallets."
----
-
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-
-The [Wallet Selector](https://github.com/near/wallet-selector) is a `JS`/`TS` library that lets users connect to your application using their preferred wallet.
-
-
-_Initial screen of [Wallet Selector](https://near.github.io/wallet-selector/)_
-
-
- List of NEAR Wallets
-
-Here is a list of user-friendly wallets that support the NEAR blockchain, you can find more at the [NEAR Wallets](https://wallet.near.org/) page.
-
-- [Bitget Wallet](https://web3.bitget.com/): A multi-chain wallet supporting NEAR and other blockchains with comprehensive DeFi features.
-
-- [Coin98 Wallet](https://coin98.com/): A multi-chain wallet and DeFi gateway supporting NEAR and 40+ blockchains.
-
-- [Hot Wallet](https://hot-labs.org/): A browser-based wallet optimized for development and testing environments.
-
-- [Intear Wallet](https://intear.tech/): A NEAR-focused wallet with seamless integration capabilities.
-
-- [Math Wallet](https://mathwallet.org/): A multi-platform wallet supporting NEAR and multiple blockchain networks.
-
-- [Meteor Wallet](https://wallet.meteorwallet.app/): Both a browser and extension wallet, with advanced NFT features.
-
-- [NEAR Mobile](https://nearmobile.app/): A non-custodial wallet that is easy to use and well designed to manage your crypto wherever you go.
-
-- [OKX Wallet](https://www.okx.com/web3): A comprehensive Web3 wallet supporting NEAR and multiple chains with built-in DeFi access.
-
-- [Ramper Wallet](https://www.ramper.xyz/): A user-friendly wallet with social login features supporting NEAR.
-
-- [Sender Wallet](https://sender.org/): Security-audited mobile & extension wallet with 1M+ users, supporting NEAR & Aurora.
-
-- [Unity Wallet](https://www.unitywallet.app/): A wallet designed for seamless NEAR blockchain integration.
-
-- [WELLDONE Wallet](https://welldonestudio.io/): A multi-chain extension wallet that gives you control over all your assets from a single platform.
-
-
-
----
-
-## Unlocking the wallet ecosystem
-
-Wallet Selector makes it easy for users to interact with dApps by providing an abstraction over various wallets and wallet types within the NEAR ecosystem.
-
-:::info
-
-You can check the current list of supported wallets in the [README.md](https://github.com/near/wallet-selector/blob/main/README.md) file of near/wallet-selector repository.
-
-:::
-
----
-
-## Install
-
-The easiest way to use NEAR Wallet Selector is to install the core package from the NPM registry, some packages may require near-api-js v5.1.1 or above check them at packages.
-
-```bash
-npm install near-api-js
-```
-
-```bash
-npm install @near-wallet-selector/core
-```
-
-Next, you'll need to install the wallets you want to support:
-
-```bash
-npm install \
- @near-wallet-selector/modal-ui \
- @near-wallet-selector/bitget-wallet \
- @near-wallet-selector/coin98-wallet \
- @near-wallet-selector/ethereum-wallets \
- @near-wallet-selector/hot-wallet \
- @near-wallet-selector/intear-wallet \
- @near-wallet-selector/ledger \
- @near-wallet-selector/math-wallet \
- @near-wallet-selector/meteor-wallet \
- @near-wallet-selector/meteor-wallet-app \
- @near-wallet-selector/near-mobile-wallet \
- @near-wallet-selector/okx-wallet \
- @near-wallet-selector/ramper-wallet \
- @near-wallet-selector/sender \
- @near-wallet-selector/unity-wallet \
- @near-wallet-selector/welldone-wallet
-```
-
----
-
-## Setup
-
-The wallet selector can be set up in two ways: by using its `core` API, or by importing its `React context/hooks` into your app:
-
-
-
-
-
- ```ts
- import "@near-wallet-selector/modal-ui/styles.css";
- import { setupWalletSelector } from "@near-wallet-selector/core";
- import { setupMeteorWallet } from "@near-wallet-selector/meteor-wallet";
- // import other wallets you want to support
-
- const selector = await setupWalletSelector({
- network: "testnet",
- modules: [
- setupMeteorWallet(),
- /// add other setup functions
- ],
- });
-
- // Subscribe to changes in the selected account
- walletSelector.then(async (selector) => {
- selector.subscribeOnAccountChange(async (signedAccount) => { ... });
- });
- ```
-
-
-
-
-
- Install the React hook package:
-
- ```bash
- npm install @near-wallet-selector/react-hook
- ```
-
-Wrap your app with the provider:
-
- ```jsx
- import "@near-wallet-selector/modal-ui/styles.css";
- import { WalletSelectorProvider } from "@near-wallet-selector/react-hook";
- import { setupMeteorWallet } from "@near-wallet-selector/meteor-wallet";
- // import other wallets you want to support
-
- const config = {
- network: "testnet",
- modules: [
- setupMeteorWallet()
- // add other setup functions
- ],
- createAccessKeyFor: "hello.near-examples.testnet",
- };
-
- function App() {
- return (
-
- {/* Your app components */}
-
- );
- }
- ```
-
-
-
-
----
-
-## Sign in
-
-
-
-
-To sign in, you will need to create a modal instance and call the `show()` method:
-
-```ts
- import { setupModal } from "@near-wallet-selector/modal-ui";
-
- const modal = setupModal(selector, {
- contractId: "hello.near-examples.testnet",
- });
-
- modal.show();
-```
-
-
-
-
-
-```jsx
-import { useWalletSelector } from "@near-wallet-selector/react-hook";
-
-const MyComponent = () => {
- const { signIn } = useWalletSelector();
-
- const handleSignIn = () => {
- signIn();
- };
-
- return ;
-};
-```
-
-
-
-
----
-
-## Sign out
-
-
-
-
-```ts
- const wallet = await selector.wallet();
- await wallet.signOut();
-```
-
-
-
-
-
-```jsx
-import { useWalletSelector } from "@near-wallet-selector/react-hook";
-
-const MyComponent = () => {
- const { signOut } = useWalletSelector();
-
- const handleSignOut = async () => {
- await signOut();
- };
-
- return ;
-};
-```
-
-
-
-
----
-
-## Get accounts
-
-You can easily query the signed-in accounts (either one or `none`):
-
-
-
-
-```ts
-const wallet = await selector.wallet();
-const accounts = await wallet.getAccounts();
-console.log(accounts); // [{ accountId: "test.testnet" }]
-```
-
-
-
-
-
-```jsx
-import { useWalletSelector } from "@near-wallet-selector/react-hook";
-
-const MyComponent = () => {
- const { signedAccountId } = useWalletSelector();
-
- if (signedAccountId) {
- return
Signed in as {signedAccountId}
;
- } else {
- return
Not signed in
;
- }
-};
-```
-
-
-
-
----
-
-## Get Balance
-
-The React hook exposes a method that can be used to get the balance of the currently signed-in account:
-
-
-
-
-```jsx
-const { getBalance } = useWalletSelector();
-
-const balance = await getBalance();
-```
-
-
-
-
----
-
-## Verify Message
-
-In NEAR, users can sign messages with their private keys to prove ownership of their accounts. This is useful for various purposes, such as authentication, authorization, and data integrity.
-
-The wallet selector provides a `signNep413Message` method that allows users to sign messages in a standardized way, following the [NEP-413](https://github.com/near/NEPs/blob/master/neps/nep-0413.md) specification.
-
-
-
-
-
-```ts
-// MyNearWallet
-const wallet = await selector.wallet();
-const signedMessage = await wallet.signNep413Message({
- message: "Test message",
- accountId: "example.testnet",
- recipient: "app.near",
- nonce: Buffer.from(Date.now().toString()),
-});
-```
-
-
-
-
-
-```jsx
-import { useWalletSelector } from "@near-wallet-selector/react-hook";
-
-const MyComponent = () => {
- const { signNep413Message } = useWalletSelector();
-
- const signedMessage = await signNep413Message({
- message: "Test message",
- accountId: "example.testnet",
- recipient: "app.near",
- nonce: Buffer.from(Date.now().toString()),
- });
-
- console.log("Message signed:", signedMessage);
-};
-```
-
-
-
-
----
-
-## Call a Read-Only Method
-
-Smart contracts often expose read-only methods that allow users to query data without modifying the contract's state. These methods are typically used to fetch information such as balances, configurations, or other relevant data.
-
-
-
-
-In order to call a read-only method you will need to use `near-api-js`, as the core wallet selector does not provide this functionality out of the box.
-
-```ts
-import { JsonRpcProvider } from "@near-js/providers";
-
-const provider = new JsonRpcProvider({
- url: "https://free.rpc.fastnear.com",
-});
-
-const viewFunction = async ({
- contractId,
- method,
- args = {},
-}: ViewMethodParams) => {
- const res = await provider.callFunction(
- "hello.near-examples.testnet",
- "get_greeting",
- {}
- );
-
- return JSON.parse(Buffer.from(res.result).toString());
-};
-```
-
-
-
-
-
-```jsx
-import { useWalletSelector } from "@near-wallet-selector/react-hook";
-
-const MyComponent = () => {
- const { viewFunction } = useWalletSelector();
-
- const handleViewMethod = async () => {
- try {
- const result = await viewFunction({
- contractId: "guestbook.near-examples.testnet",
- method: "get_messages",
- args: {},
- });
- console.log("View result:", result);
- } catch (error) {
- console.error("View method failed:", error);
- }
- };
-
- return ;
-};
-```
-
-
-
-
----
-
-## Sign and Send a Transaction
-
-You can use the wallet selector to sign and send transactions to the NEAR blockchain. This is useful for performing actions that modify the state of a smart contract, such as transferring tokens, updating data, or executing specific functions.
-
-
-
-
-```ts
-import { actionCreators } from "@near-js/transactions";
-
-const wallet = await selector.wallet();
-await wallet.signAndSendTransaction({
- receiverId: 'guestbook.near-examples.testnet',
- actions: [
- actionCreators.functionCall(
- "add_message",
- { text: "Hello World!" },
- "30000000000000",
- "10000000000000000000000",
- )
- ],
-});
-```
-
-
-
-
-
-```jsx
-import { useWalletSelector } from "@near-wallet-selector/react-hook";
-
-const MyComponent = () => {
- const { signAndSendTransaction, callFunction } = useWalletSelector();
-
- const handleTransaction = async () => {
- try {
- const result = await callFunction({
- contractId: "guestbook.near-examples.testnet",
- method: "add_message",
- args: { text: "Hello World!" },
- gas: "30000000000000",
- deposit: "10000000000000000000000",
- });
- console.log("Transaction result:", result);
- } catch (error) {
- console.error("Transaction failed:", error);
- }
- };
-
- return ;
-};
-```
-
-
-
-
-## Sign and send transactions
-
-You can use the wallet selector to sign and send multiple transactions in parallel with a single request.
-
-
-
-
-```ts
-const wallet = await selector.wallet();
-await wallet.signAndSendTransactions({
- transactions: [
- {
- receiverId: "guestbook.near-examples.testnet",
- actions: [
- {
- type: "FunctionCall",
- params: {
- methodName: "add_message",
- args: { text: "Hello World!" },
- gas: "30000000000000",
- deposit: "10000000000000000000000",
- },
- },
- ],
- },
- ],
-});
-```
-
-
-
-
-
-```jsx
-import { useWalletSelector } from "@near-wallet-selector/react-hook";
-
-const MyComponent = () => {
- const { signAndSendTransactions } = useWalletSelector();
-
- const handleBatchTransactions = async () => {
- try {
- const transactions = [
- {
- receiverId: "guestbook.near-examples.testnet",
- actions: [
- {
- type: "FunctionCall",
- params: {
- methodName: "add_message",
- args: { text: "Hello World!" },
- gas: "30000000000000",
- deposit: "10000000000000000000000",
- },
- },
- ],
- },
- ];
-
- const results = await signAndSendTransactions({ transactions });
- console.log("Batch results:", results);
- } catch (error) {
- console.error("Batch transaction failed:", error);
- }
- };
-
- return (
-
- );
-};
-```
-
-
-
diff --git a/docs/web3-apps/backend/backend.md b/docs/web3-apps/backend/backend.md
index e6dfc7f87cf..852216a9ad4 100644
--- a/docs/web3-apps/backend/backend.md
+++ b/docs/web3-apps/backend/backend.md
@@ -66,4 +66,4 @@ const signature = wallet.signMessage({ message, recipient, nonce: challenge, cal
Once the user has signed the challenge, the wallet will call the `callbackUrl` with the signature. The backend can then verify the signature.
+ url="https://github.com/near-examples/near-api-examples/blob/main/javascript/examples/verify-signature.js" />
diff --git a/docs/web3-apps/concepts/eth-wallets.md b/docs/web3-apps/concepts/eth-wallets.md
deleted file mode 100644
index ca5f7ca318d..00000000000
--- a/docs/web3-apps/concepts/eth-wallets.md
+++ /dev/null
@@ -1,122 +0,0 @@
----
-title: EVM Wallets on NEAR
-id: eth-wallets-on-near
-description: "Understand how NEAR supports Ethereum wallets"
----
-
-Thanks to the [NEAR Wallet Selector](./web-login.md#wallet-selector), users can login into NEAR applications using [Ethereum-compatible wallets](https://ethereum.org/en/wallets/), such as MetaMask, Trust Wallet, and others.
-
-To make this possible, different components interact to translate Ethereum transactions into NEAR transactions, and vice-versa. Let's see how they work!
-
-:::info
-
-This page provides a high-level overview on how these components works, for a detailed specification please see the [NEAR Enhancement Proposal (NEP-518)](https://github.com/near/NEPs/issues/518).
-
-:::
-
-:::tip Searching for a tutorial?
-
-Check our step-by-step tutorial on how to add Ethereum wallets support to your NEAR app using the [NEAR Wallet Selector](../tutorials/web-login/ethereum-wallets.md)
-
-:::
-
----
-
-## Components Overview
-
-Since Ethereum wallets create _ethereum transactions_ and talk with _ethereum RPCs_, three components are needed to make them work on NEAR:
-
-1. A `Transaction Encoder` service, that encodes NEAR actions into Ethereum transactions
-2. A `Translator RPC` service, that translates Ethereum RPC calls into NEAR RPC calls
-3. A `Wallet Contract` that allows NEAR accounts to process EVM transactions
-
-
-*High-level architecture of Ethereum wallets on NEAR*
-
-
-
-### Transaction Encoder
-
-The `Translator Encoder` - implemented [directly in the NEAR Wallet Selector](https://github.com/near/wallet-selector/blob/main/packages/ethereum-wallets/src/lib/index.ts) - takes the intent of the user (e.g. call `set_greeting` on `hello.near`) and translates it into an Ethereum transaction that the EVM wallet can sign.
-
-#### To (field)
-The `to` field of the Ethereum transaction is transformed following these rules:
-- If the `receiverId` matches `^0x[a-f0-9]{40}$` (e.g. `0xD79...314`), then the `to` field is set to the `receiverId`
-- Otherwise (e.g. `ana.near` or an implicit account) the `to` field is set as `keccak-256(receiverId)[12,32]`
-
-#### Data (field)
-The `data` field meanwhile contains the RLP-encoded NEAR actions wanted by the user, encoded as function calls on Ethereum, for example:
-- `FunctionCall(to: string, method: string, args: bytes, yoctoNear: uint32)`
-- `Transfer(to: string, yoctoNear: uint32)`
-- `Stake(public_key: bytes, yoctoNear: uint32)`
-- `AddKey(public_key: bytes, nonce: uint64, is_full_access: bool, allowance: uint256, receiver_id: string, method_names: string[])`
-
-:::info
-
-For more information on how other fields (such as `value`, `gas`, and `chainId`) are set, please refer to the [NEP-518 technical specification](https://github.com/near/NEPs/issues/518)
-
-:::
-
-
-
-### Translator RPC
-
-The `Translator RPC` is a service deployed at `https://eth-rpc.mainnet.near.org` (for mainnet) and `https://eth-rpc.testnet.near.org` (for testnet) that translates Ethereum RPC calls into NEAR RPC calls.
-
-In other words, the `Translator RPC` simply acts as a relayer, taking the Ethereum transactions signed by the user and translating them into a function call into the `Wallet Contract` deployed in the user's account.
-
-
-
-### Wallet Contract
-
-The `Wallet Contract` is a smart contract on NEAR that allows NEAR accounts to process EVM transactions.
-
-The contract exposes a method called `rlp_execute`, which takes as argument an RLP-encoded Ethereum transaction, verifies its signature, and executes the NEAR actions encoded in the `data` field of the transaction.
-
-Every NEAR account created through an EVM wallet has the `Wallet Contract` deployed on it.
-
-:::tip Wallet Accounts
-
-Remember that in NEAR **all accounts** can **have contracts**, and that **contracts** can perform **all the actions** that the **account can do**.
-
-:::
-
----
-
-## How it Works?
-
-Let's see how the components described above interact when a user logs in and uses an application.
-
-
-
-### First Time Login
-
-The first time you login through your EVM wallet, the wallet selector will contact the account `ethereum-wallets.near` to create a NEAR account with the same address as your Ethereum wallet. For example, if your address on Metamask is `0xD79...314`, the NEAR account created will be `0xD79...314`.
-
-On this account, the `Wallet Contract` is deployed and a function-call key is added for the `rlp_execute` function of the contract
-
-
-*On your first login, a NEAR accounts with the same address as your Ethereum wallet is created, and the Wallet Contract is deployed on it*
-
-
-
-### Using the Account
-
-Once you have logged in, you can start interacting with the application. If at some point the application needs to interact with the blockchain, Metamask will ask you to sign a transaction.
-
-Under the hood, Metamask will create an Ethereum transaction and send it to the `Translator API`, deployed at `https://eth-rpc.mainnet.near.org`.
-
-The `Translator API` will then translate the Ethereum transaction into a **function call** into the `Wallet Contract` deployed in your account. Particularly, it will call the `rlp_execute` function, passing the Ethereum transaction as an argument.
-
-
-
-The `Wallet Contract` will then execute the function call, and the application will receive the result.
-
----
-
-## Resources
-
-Check the following resources to learn more about Ethereum wallets on NEAR:
-
-- [Adding EVM Wallets to your NEAR App](../tutorials/web-login/ethereum-wallets.md) - Step-by-step tutorial on how to add Ethereum wallets support to your NEAR app
-- [NEP-518 Technical Specification](https://github.com/near/NEPs/issues/518) - Full technical specification of how Ethereum wallets work on NEAR
diff --git a/docs/web3-apps/concepts/web-login.md b/docs/web3-apps/concepts/web-login.md
index af74bf0ccd4..9c2fa9aa9b3 100644
--- a/docs/web3-apps/concepts/web-login.md
+++ b/docs/web3-apps/concepts/web-login.md
@@ -10,78 +10,32 @@ integrate web login into your web app or website, each tailored to different use
Once the user is logged in, they will be able to use their accounts to interact with the NEAR blockchain, making
call to smart contracts, transfer tokens, and more.
-
-
- Summary of Available Methods
-
-| Method | Wallet Login | Social Login | Key Owners | Description |
-|-------------------------------------------|--------------|--------------|------------|--------------------------------------------------|
-| [Wallet Selector](#wallet-selector) | β | β | User | Popup modal to select from existing NEAR wallets |
-| [NEAR Connector](#near-connector) | β | β | User | Popup modal to select from existing NEAR wallets |
-| [Privy Social Login](#privy-social-login) | β | β | | Developer |
-| [Web3Auth](#web3auth) | β | β | User | Login using email or social accounts |
-
-
-
----
-
-## Wallet Selector
-
-The [wallet selector](https://github.com/near/wallet-selector) is a javascript library that allows you to easily add a `modal popup` to your web, so users can login using one of the existing [NEAR wallets](https://wallet.near.org).
-
-It includes support for the most popular wallets, and `react hooks` to easily integrate it into your app.
-
-
-
-
-:::tip
-
-You can learn how to integrate the wallet selector into your app in our [Wallet Selector Tutorial](../tutorials/web-login/wallet-selector.md) guide.
-
-:::
-
---
## NEAR Connector
-Considered a successor to the wallet selector, the [NEAR Connector](https://github.com/AZbang/hot-connector) is a zero-dependency lightweight library that allows users to connect to your dApp using their preferred wallet.
+[NEAR Connect](https://github.com/azbang/near-connect) is a zero-dependency lightweight library that allows users to connect to your dApp using their preferred wallet. It uses a secure sandbox-based architecture where wallet scripts run in isolated iframes.

:::tip
-
-You can learn how to integrate the `near connector` into your app in the [NEAR Connector tutorial](../tutorials/web-login/near-connector.md).
-
+You can learn how to integrate NEAR Connect into your app in the [NEAR Connector tutorial](../tutorials/wallet-login.md)
:::
---
-## Privy Social Login
+## Social Login
[Privy](https://www.privy.io/) is a third-party service that allows users to login using their email or social accounts (Google, Facebook, Twitter, etc). Upon login, a NEAR wallet is created for the user, which they can fund and use to interact with your dApp.
-
-
:::tip
Check our [Privy Integration Example](https://github.com/near-examples/hello-privy/) to learn how to integrate Privy into your web app
:::
----
-
-## Web3Auth
-
-[Web3Auth](https://web3auth.io/) is a third-party service that allows users to login using their email or social accounts (Google, Facebook, Twitter, etc). Upon login, a NEAR wallet is created for the user, which they can fund and use to interact with your dApp.
-
-
-
-:::tip
-
-Check our [Web3Auth Integration Example](https://github.com/near-examples/hello-web3auth/) to learn how to integrate Privy into your web app
+
+:::info Web3Auth
+For an alternative social login method you can check [Web3Auth](https://web3auth.io/). We have a functional [Web3Auth Integration Example](https://github.com/near-examples/hello-web3auth/) to show how to integrate Web3Auth into your web app.
:::
-
-:::warning Ethereum Wallets
-The ethereum wallet login offered by Web3Auth will not allow you to interact with NEAR contracts
-:::
\ No newline at end of file
diff --git a/docs/web3-apps/quickstart.md b/docs/web3-apps/quickstart.md
index 52194bcccaf..7884284925e 100644
--- a/docs/web3-apps/quickstart.md
+++ b/docs/web3-apps/quickstart.md
@@ -13,42 +13,29 @@ In this guide we will show you how to quickly spin up a frontend where users can
:::tip Searching to integrate NEAR in your App?
-If you already have an application and want to integrate NEAR into it, we recommend you to first go through this guide and then check our documentation on [integrating NEAR to a frontend](./tutorials/web-login/wallet-selector.md)
+If you already have an application and want to integrate NEAR into it, we recommend you to first go through this guide and then check our documentation on [integrating NEAR to a frontend](./tutorials/wallet-login.md)
:::
---
-## Create NEAR App
-If you already have [Node.js](https://nodejs.org/en/download) installed, simply run:
+## Template Setup
+If you already have [Node.js](https://nodejs.org/en/download) installed, you can use `create-near-app` to quickly setup a template:
```bash
npx create-near-app@latest
-```
-
-Use the interactive menu to set up:
-1. `A Web App`.
-2. `NextJs (Classic)`.
-
-
- More boilerplate options from `create-near-app`
-
-Using `create-near-app` you can also set up:
- - NextJs (App Router)
- - Vite (React)
- - JS/TS Smart Contract
- - Rust Smart Contract
-
-
-:::tip Using pnpm
-While you can use our app with any package manager, we recommend you to skip the installation step and manually install the dependencies using `pnpm i`.
-:::
+ # β What do you want to build? βΊ Web Application
+ # β Select a framework for your frontend βΊ Next.js (Classic)
+ # β Name your project (we will create a directory with that name) β¦ near-template
+ # β Run 'npm install' now? β¦ yes
+```
Once the folder is ready - and all dependencies installed - you can start the development server using `pnpm`.
```bash
-pnpm dev
+cd near-template # go to your project folder
+npm run dev
```
Visit `http://localhost:3000` in your browser to view the dApp. Note that since the dApp uses NextJS the app might take longer to load the pages on first visit.
@@ -56,18 +43,14 @@ Visit `http://localhost:3000` in your browser to view the dApp. Note that since
The app is not starting?
-Make sure you are using **node >= v18**, you can easily switch versions using `nvm use 18`
+Make sure you are using **node >= v22**, you can easily switch versions using `nvm use 22`
-
-:::info Info: Community Starter Templates
-
- These are some community templates that you can use to start quickstart your project. Refer to their pages for more information:
- * [Bitte Templates](https://github.com/Mintbase/templates) - A `collection` of templates from Bitte and MintBase
- * [NEARBuilders/near-vite-starter](https://github.com/NEARBuilders/near-vite-starter) - `Vite`, `TypeScript`, `Tanstack`, `Tailwind`,`Playwright`
-
+:::tip Framework
+In this tutorial we are using the **Next.js** framework with the "classic" page-based routing, but you can select other frameworks such as Vite when creating the app
:::
+
---
## Landing Page
@@ -81,46 +64,28 @@ Go ahead and sign in with your NEAR account. If you don't have one, you can crea
-### Under the Hood
-
-[Next.js](https://nextjs.org/) uses a template system, where each page is a React component.
+### Context Provider
-Our app's template is defined at `./src/pages/_app.js`. It does two things:
+[Next.js](https://nextjs.org/) uses a template system, where each page is a React component. Our main logic is defined at `./src/pages/_app.js`, which:
-1. Initializes a [wallet selector](../tools/wallet-selector.md), and stores it in context so other components can access it later.
-2. Renders the navigation menu and the page's content.
+1. Creates a `NearProvider` that wraps the entire application to provide NEAR functionality
+2. Renders the navigation menu and the page's content
-
-
-When initializing the wallet-selector you can choose to **create a [Function-Call Key](../protocol/access-keys.md)** using the `createAccessKeyFor` parameter. This allows the application to sign `non-payable` methods on behalf of the user so they are not required to manually sign each transaction.
-
-```jsx
-const walletSelectorConfig = {
- networkId: NetworkId,
- createAccessKeyFor: HelloNearContract,
- modules: [
- ...
- ],
-};
-```
-
-This example additionally includes the option to login with `Metamask` and other `EVM wallets`. Further information on how to add EVM wallets to your application can be found in the [Ethereum Wallets on NEAR documentation](./tutorials/web-login/ethereum-wallets.md).
+
-What is the wallet selector?
+What is NEAR Connect Hooks?
-The wallet selector is a modal that allows users to select their preferred Near wallet to login. Our application creates a new instance of the wallet selector then stores it in the apps context so it can be accessed by other components.
+NEAR Connect is a library that allows users to select their preferred NEAR wallet to login, our application uses **hooks** that wrap its functionality to make it easier to use
-### Navigation Bar & Login
-The navigation bar implements buttons to `login` and `logout` users with their Near wallet.
-
-The code for the navigation bar can be found at `./src/components/navigation.js`. The login and logout buttons are implemented by using the `signIn` and `signOut` methods from the wallet selector previously initialized:
+### Navigation Bar
+The navigation bar implements a button to allow users to `login` and `logout` with their NEAR wallet. The main logic comes from the `useNearWallet` hook, which exposes all wallet related functionality.
-
+
---
@@ -135,17 +100,24 @@ Login if you haven't done it yet and you will see a simple form that allows you
-### Under the Hood
-We retrieve the `wallet` we initialized earlier via the `useContext` hook. The wallet allows us to interact with the smart contract through `viewMethod` and `callMethod`.
+### Function Call Hooks
+Just like the [navigation bar](#navigation-bar), we use the `useNearWallet` hook to get functions that allow us to call methods on the contract:
- `viewMethod` is used to call functions that are read-only
- `callMethod` is used to call functions that modify the state of the contract
-
+
+
+#### Calling Read-Only Methods
+
+For example, when we want to fetch the current greeting stored in the contract, we use `viewMethod` inside a `useEffect` hook:
+
+
-On load, the first `useEffect` hook will call the contract's `get_greeting` method and set the `greeting` state to the result.
+#### Calling Change Methods
+On the other hand, when the user submits a new greeting, we use `callMethod` to send a transaction to the contract:
-If the user is logged in, the user will be able to use the `saveGreeting` function which will call the contract's `set_greeting` method and then update the `greeting`.
+
---
diff --git a/docs/web3-apps/tutorials/wallet-login.md b/docs/web3-apps/tutorials/wallet-login.md
new file mode 100644
index 00000000000..3eeb2fcb48e
--- /dev/null
+++ b/docs/web3-apps/tutorials/wallet-login.md
@@ -0,0 +1,347 @@
+---
+id: wallet-login
+title: Wallet Login
+description: "Connect users to NEAR wallets with a secure, sandbox-based connector library"
+---
+import {CodeTabs, Language, Github} from "@site/src/components/UI/Codetabs"
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+The `@hot-labs/near-connect` library provides a secure, zero-dependency wallet connector for NEAR blockchain with a unique sandbox-based architecture.
+
+
+
+:::tip Example
+
+We have a [working example](https://github.com/near-examples/hello-near-connector), which you can easily get through `create-near-app`:
+
+```bash
+npx create-near-app@latest
+```
+
+:::
+
+---
+
+## Why NEAR Connect?
+
+Unlike traditional wallet selectors, it offers a dynamic manifest system that allows wallets to be added and updated without requiring developers to update their dependencies.
+
+- **Secure Execution**: Wallet scripts run in isolated sandboxed iframes for maximum security
+- **Dynamic Wallets**: Wallets are loaded from a manifest and can be updated without code changes
+- **Zero Dependencies**: Lightweight library with no external dependencies
+- **Automatic Detection**: Supports both injected wallets (extensions) and manifest-based wallets
+
+---
+
+## Installation
+
+You can add the NEAR Connect library to your project in two ways:
+
+
+
+ Install the `@hot-labs/near-connect` and `near-api-js` packages manually:
+
+ ```bash
+ npm install @hot-labs/near-connect near-api-js
+ ```
+
+
+
+ If you are using React, we recommend installing the `near-connect-hooks` package which provides convenient hooks for integrating NEAR Connect into your app:
+
+ ```bash
+ npm install near-connect-hooks
+ ```
+
+
+
+
+---
+
+## Initializing the Connector
+
+Initialize the `NearConnector` instance in your application:
+
+
+
+
+
+
+
+
+
+
+
+
+ Selecting Wallets
+
+Unlike traditional wallet selectors that bundle wallet code, NEAR Connect uses a **manifest-based approach**:
+
+1. Wallet providers register their integration scripts in a public manifest
+2. The connector dynamically loads wallet scripts when users want to connect
+
+This architecture eliminates the need to install individual wallet packages and ensures wallet code can be updated independently from your app.
+
+```tsx
+connector = new NearConnector({
+ network: "testnet", // or "mainnet"
+ features: {
+ signMessage: true, // Only show wallets that support message signing
+ signTransaction: true,
+ signInWithoutAddKey: true,
+ signAndSendTransaction: true,
+ signAndSendTransactions: true
+ },
+});
+```
+
+
+
+---
+
+## Signing In / Out
+
+
+
+ The connector uses the Observer Pattern (pub/sub), for which we need to subscribe to the `wallet:signIn" and `wallet:signOut` events
+
+
+
+ Then, call the `connect` function to open a modal where the user can select a wallet and sign in, and `disconnect` to sign out
+
+
+
+
+
+ The `near-connect-hooks` package provides a `useNearWallet` hook that simplifies the sign-in process, first import the hook:
+
+
+ Then, import the `signIn` and `signOut` method from the hook and call them when needed:
+
+
+
+---
+
+## Calling Contract Method
+
+
+
+ To call a contract method, first get the connected wallet instance using `connector.wallet()`, then use the wallet's `signAndSendTransaction` method to make a function call:
+
+ ```tsx
+ // Get the connected wallet
+ const wallet = await connector.wallet();
+
+ // Call a change method
+ const result = await wallet.signAndSendTransaction({
+ receiverId: "hello.near-examples.testnet",
+ actions: [
+ {
+ type: "FunctionCall",
+ params: {
+ methodName: "set_greeting",
+ args: { greeting: "Hello from NEAR Connect!" },
+ gas: "30000000000000", // 30 TGas
+ deposit: "0", // No deposit
+ },
+ },
+ ],
+ });
+
+ console.log("Transaction:", result.transaction.hash);
+ ```
+
+
+
+ To call a contract method, you can use the `callFunction` method provided by the `useNearWallet` hook:
+
+
+
+
+---
+
+## Calling Read-only Methods
+
+
+
+
+ The `near-connector` does not provide a built-in way to call read-only (view) methods.
+
+ However, you can use the `near-api-js` package (or any of your preferred APIs) to create a JSON-RPC provider and call view methods directly:
+
+ ```tsx
+ import { JsonRpcProvider } from "near-api-js";
+
+ const provider = new JsonRpcProvider({ url: "https://test.rpc.fastnear.com" });
+
+ const greeting = await provider.callFunction(
+ "hello.near-examples.testnet",
+ "get_greeting",
+ {}
+ );
+ ```
+
+
+ You can use the `viewFunction` method provided by the `useNearWallet` hook to call read-only methods on the contract:
+
+
+
+
+
+
+---
+
+## Send Multiple Transactions
+
+
+
+
+
+ You can request the user to sign and send multiple transactions in parallel through a single prompt:
+
+ ```tsx
+ const wallet = await connector.wallet();
+
+ const results = await wallet.signAndSendTransactions({
+ transactions: [
+ {
+ receiverId: "token.near",
+ actions: [
+ {
+ type: "FunctionCall",
+ params: {
+ methodName: "ft_transfer",
+ args: {
+ receiver_id: "alice.near",
+ amount: "1000000",
+ },
+ gas: "30000000000000",
+ deposit: "1", // 1 yoctoNEAR for security
+ },
+ },
+ ],
+ },
+ {
+ receiverId: "nft.near",
+ actions: [
+ {
+ type: "FunctionCall",
+ params: {
+ methodName: "nft_mint",
+ args: {
+ token_id: "token-1",
+ receiver_id: "alice.near",
+ },
+ gas: "30000000000000",
+ deposit: "10000000000000000000000", // 0.01 NEAR
+ },
+ },
+ ],
+ },
+ ],
+ });
+
+ console.log(`Completed ${results.length} transactions`);
+ ```
+
+
+ You can use the `signAndSendTransactions` method provided by the `useNearWallet` hook to send multiple transactions in a single request:
+
+ ```tsx
+ import { useNearWallet } from 'near-connect-hooks';
+
+ ...
+
+ const { signAndSendTransactions } = useNearWallet();
+
+ const results = await signAndSendTransactions({
+ transactions: [
+ {
+ receiverId: "token.near",
+ actions: [
+ {
+ type: "FunctionCall",
+ params: {
+ methodName: "ft_transfer",
+ args: {
+ receiver_id: "alice.near",
+ amount: "1000000",
+ },
+ gas: "30000000000000",
+ deposit: "1", // 1 yoctoNEAR for security
+ },
+ },
+ ],
+ },
+ {
+ receiverId: "nft.near",
+ actions: [
+ {
+ type: "FunctionCall",
+ params: {
+ methodName: "nft_mint",
+ args: {
+ token_id: "token-1",
+ receiver_id: "alice.near",
+ },
+ gas: "30000000000000",
+ deposit: "10000000000000000000000", // 0.01 NEAR
+ },
+ },
+ ],
+ },
+ ],
+ });
+ console.log(`Completed ${results.length} transactions`);
+ ```
+
+
+
+---
+
+### Sign Messages (NEP-413)
+
+In NEAR, users can sign messages for authentication purposes without needing to send a transaction:
+
+
+
+
+ You can request the user to sign a message using the wallet's `signMessage` method:
+
+ ```tsx
+ const wallet = await connector.wallet();
+
+ const signature = await wallet.signMessage({
+ message: "Please sign this message to authenticate",
+ recipient: "your-app.near",
+ nonce: Buffer.from(crypto.randomUUID()),
+ });
+
+ console.log("Signature:", signature.signature);
+ console.log("Public Key:", signature.publicKey);
+
+ // Verify the signature on your backend
+ ```
+
+
+ You can use the `signMessage` method provided by the `useNearWallet` hook to request the user to sign a message:
+
+ ```tsx
+ import { useNearWallet } from 'near-connect-hooks';
+
+ ...
+
+ const { signNEP413Message } = useNearWallet();
+
+ const signature = await signMessage({
+ message: "Please sign this message to authenticate",
+ recipient: "your-app.near",
+ nonce: Buffer.from(crypto.randomUUID()),
+ });
+
+ console.log("Signature:", signature.signature);
+ console.log("Public Key:", signature.publicKey);
+ ```
+
+
\ No newline at end of file
diff --git a/docs/web3-apps/tutorials/web-login/ethereum-wallets.md b/docs/web3-apps/tutorials/web-login/ethereum-wallets.md
deleted file mode 100644
index 09ec795aadd..00000000000
--- a/docs/web3-apps/tutorials/web-login/ethereum-wallets.md
+++ /dev/null
@@ -1,160 +0,0 @@
----
-title: EVM Wallets Login
-id: ethereum-wallets
-description: "Learn how to integrate Ethereum wallets like MetaMask into your NEAR DApp using the Near Wallet Selector, Web3Modal, and wagmi libraries."
----
-
-import { Github } from "@site/src/components/UI/Codetabs"
-
-Using the [Wallet Selector](./wallet-selector.md) it is possible to login into NEAR applications using Ethereum wallets like MetaMask, WalletConnect and many others.
-
-This tutorial will guide you to add Ethereum wallet support to your NEAR application using the [Reown](https://reown.com/appkit) library, which is widely used in the Ethereum ecosystem.
-
-:::info
-
-Learn more about Ethereum Wallets on NEAR in our [concepts page](../../concepts/eth-wallets.md)
-
-:::
-
----
-
-## Overview
-
-To integrate Metamask and other EVM wallets you will need to:
-
-1. Add the `@near-wallet-selector/ethereum-wallets` module
-2. Add the EVM libraries `wagmi` and `reown`
-3. Create configurations so the Ethereum wallets can communicate with our [Translator RPC](../../concepts/eth-wallets.md#translator-rpc)
-4. Create a Web3Modal and connect it to the Near Wallet Selector
-5. Initialize the Ethereum Wallets
-
-We will show how we added Ethereum Wallets support to our [**Hello Near Examples**](https://github.com/near-examples/hello-near-examples/tree/main/frontend).
-
-:::tip
-
-This article was created by the AuroraLabs team, and appeared originally in the [official Aurora documentation](https://doc.aurora.dev/dev-reference/eth-wallets)
-
-:::
-
----
-
-## 1. Update Wallet Selector libraries
-
-Lets start by updating the `package.json`, adding all the necessary libraries to support Ethereum wallets.
-
-
-
-### Wallet Selector Packages
-
-
-In your `package.json`, add the `@near-wallet-selector/ethereum-wallets` package, and update **all** wallet selector packages to version `8.9.13` or above:
-
-
-
-
-
-### Add Web3Modal libraries
-
-[Web3Modal (also known as AppKit)](https://reown.com/appkit) is a standard way to integrate multiple wallets in Ethereum community.
-
-It is based on [wagmi] hooks library for React. We will describe the React integration here, but if you are on another platform - just go [here](https://docs.reown.com/appkit/overview#get-started), and try using specific instructions suitable for you to install it.
-
-```bash
-npm install @reown/appkit-adapter-wagmi @reown/appkit @wagmi/core viem
-```
-
----
-
-## 2. Add Web3Modal
-
-First, let's create a new file to handle the Web3Modal (i.e. the modal shown when selecting the `Ethereum Wallets` on the `Wallet Selector`), and all the configs needed to setup the Ethereum Wallets.
-
-
-
-
- Metadata
-
- You can pass a `metadata` object to the `walletConnect` connector. This object will be displayed in the EVM wallets, like MetaMask.
-
- ```js title="source/wallets/web3modal.js"
- const url = "http://localhost:3000";
-
- const metadata = {
- name: "Onboard to NEAR Protocol with EVM Wallet",
- description: "Discover NEAR Protocol with Ethereum and NEAR wallets.",
- url: url,
- icons: [`${url}/icon.svg`],
- };
- ```
-
- This tracks the app requesting the connection on the WalletConnect side. See more [here](https://wagmi.sh/core/api/connectors/walletConnect#metadata).
-
-
-
-:::tip
-
-Make sure to call `reconnect(wagmiConfig)` in your code, to persist the connection between the app and the wallet when the user refreshes the page
-
-:::
-
-
-
-### Get `projectId`
-
-Notice that the modal uses a `projectId`, which refers to your unique project on `Reown`. Let's get the Web3Modal `projectId` for your project:
-
-1. Go to [Cloud Reown](https://cloud.reown.com/).
-2. Register there.
-3. Create a project on Cloud Reown.
-4. You can copy your `projectId`:
-
-
-
-:::tip
-
-You can read more about the `projectId` and how it works [here](https://docs.reown.com/appkit/react/core/installation#cloud-configuration).
-
-:::
-
----
-
-## 4. Setup Wallet Selector
-
-The last step is to add the Ethereum Wallets selector to your Near Wallet Selector. Let's find your `setupWalletSelector` call and add `setupEthereumWallets` there:
-
-```js showLineNumbers
-import { setupWalletSelector } from '@near-wallet-selector/core';
-import { wagmiConfig, web3Modal } from '@/wallets/web3modal';
-import { setupEthereumWallets } from "@near-wallet-selector/ethereum-wallets";
-```
-
-
-
-
----
-
-## 5. Use It!
-
-That is it! Just re-build your project and click on login! You should see Ethereum Wallets option in your Near Selector:
-
-
-
-And after click to be able to choose the EVM wallet of your taste:
-
-
-
----
-
-## Resources
-
-1. [Source code of the project above](https://github.com/near-examples/hello-near-examples/blob/main/frontend/)
-
-2. [Example of the EVM account on the Near Testnet](https://testnet.nearblocks.io/address/0xe5acd26a443d2d62f6b3379c0a5b2c7ac65d9454) to see what happens in reality on-chain during the execution.
-
-3. Details about how does it work are in [NEP-518](https://github.com/near/NEPs/issues/518)
-
-4. [Recording of the Near Devs call](https://drive.google.com/file/d/1xGWN1yRLzFmRn1e29kbSiO2W1JsxuJH-/view?usp=sharing) with the EthWallets presentation.
diff --git a/docs/web3-apps/tutorials/web-login/near-connector.md b/docs/web3-apps/tutorials/web-login/near-connector.md
deleted file mode 100644
index 03437b33b13..00000000000
--- a/docs/web3-apps/tutorials/web-login/near-connector.md
+++ /dev/null
@@ -1,270 +0,0 @@
----
-id: near-connector
-title: NEAR Connect Tutorial
-description: "Connect users to NEAR wallets with a secure, sandbox-based connector library"
----
-import {CodeTabs, Language, Github} from "@site/src/components/UI/Codetabs"
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-
-The `@hot-labs/near-connect` library provides a secure, zero-dependency wallet connector for NEAR blockchain with a unique sandbox-based architecture. Unlike traditional wallet selectors, it offers a dynamic manifest system that allows wallets to be added and updated without requiring developers to update their dependencies.
-
-:::info Working Example
-
-For a complete working example with React, check out the [hello-near-connector repository](https://github.com/near-examples/hello-near-connector) which demonstrates all features in action.
-
-:::
-
-
-
-
-:::tip Why NEAR Connect?
-
-- **Secure Execution**: Wallet scripts run in isolated sandboxed iframes for maximum security
-- **Dynamic Wallets**: Wallets are loaded from a manifest and can be updated without code changes
-- **Zero Dependencies**: Lightweight library with no external dependencies
-- **Automatic Detection**: Supports both injected wallets (extensions) and manifest-based wallets
-
-:::
-
-
----
-
-## Installation
-
-Install the `@hot-labs/near-connect` package along with its required peer dependencies:
-
-```bash
-npm install @hot-labs/near-connect \
- @near-js/providers \
- @near-js/utils
-```
-
----
-
-## Creating the Connector
-
-Initialize the `NearConnector` instance in your application. For a complete reference of the `NearConnector` class implementation, see the [source code on GitHub](https://github.com/azbang/hot-connector/blob/main/near-connect/src/NearConnector.ts).
-
-```tsx title="lib/near.ts"
-// Basic connector for NEAR testnet
-import { NearConnector } from "@hot-labs/near-connect";
-
-connector = new NearConnector({ network: "testnet" });
-```
-
-
-
-### Selecting Wallets
-
-Unlike traditional wallet selectors that bundle wallet code, NEAR Connect uses a **manifest-based approach**:
-
-1. Wallet providers register their integration scripts in a public manifest
-2. The connector dynamically loads wallet scripts when users want to connect
-
-This architecture eliminates the need to install individual wallet packages and ensures wallet code can be updated independently from your app.
-
-```tsx
-connector = new NearConnector({
- network: "testnet", // or "mainnet"
- features: {
- signMessage: true, // Only show wallets that support message signing
- signTransaction: true,
- signInWithoutAddKey: true,
- signAndSendTransaction: true,
- signAndSendTransactions: true
- },
-});
-```
-
-
-
-### Creating an Access Key
-
-The connector can request a [Function-Call Key](/protocol/access-keys#function-call-keys) for a specific contract on behalf of the user. This allows your app to interact with the contract without asking the user to sign every transaction.
-
-```tsx title="lib/near.ts"
-const connector = new NearConnector({
- network: "testnet", // or "mainnet"
-
- // Optional: Request access key for contract interaction
- connectWithKey: {
- contractId: "your-contract.testnet",
- methodNames: ["method1", "method2"],
- allowance: "250000000000000", // 0.25 NEAR
- },
-});
-```
-
----
-
-## Signing In
-
-The connector uses the Observer Pattern (pub/sub), for which we need to do two things:
-
-1. Subscribe to the `signIn` event:
-
-```tsx
-connector.on("wallet:signIn", async({ wallet, accounts, success }) => {
- const address = await wallet.getAddress();
- console.log(`User signed in: ${address}`);
-});
-```
-
-2. Call the `connect` function to open a modal where the user can select a wallet and sign in:
-
-```tsx
-
-```
-
----
-
-## Signing Out
-
-Similarly, to sign out we need to subscribe to the `signOut` event and call the `disconnect` function:
-
-```tsx
-// Listen for sign-out
-connector.on("wallet:signOut", () => {
- console.log("User signed out");
-});
-
-// Disconnect current wallet
-
-```
-
----
-
-## Calling Contract Method
-
-To call a contract method, first get the connected wallet instance using `connector.wallet()`, then use the wallet's `signAndSendTransaction` method to make a function call:
-
-```tsx
-// Get the connected wallet
-const wallet = await connector.wallet();
-
-// Call a change method
-const result = await wallet.signAndSendTransaction({
- receiverId: "hello.near-examples.testnet",
- actions: [
- {
- type: "FunctionCall",
- params: {
- methodName: "set_greeting",
- args: { greeting: "Hello from NEAR Connect!" },
- gas: "30000000000000", // 30 TGas
- deposit: "0", // No deposit
- },
- },
- ],
-});
-
-console.log("Transaction:", result.transaction.hash);
-```
-
-
-
- Read-only Methods
-
-The `near-connector` does not provide a built-in way to call read-only (view) methods.
-
-However, you can use the `@near-js/providers` package to create a JSON-RPC provider and call view methods directly:
-
-```tsx
-import { JsonRpcProvider } from "@near-js/providers";
-
-const provider = new JsonRpcProvider({ url: "https://test.rpc.fastnear.com" });
-
-const greeting = await provider.callFunction(
- "hello.near-examples.testnet",
- "get_greeting",
- {}
-);
-```
-
-
-
----
-
-## Send Multiple Transactions
-
-You can request the user to sign and send multiple transactions in parallel through a single prompt:
-
-```tsx
-const wallet = await connector.wallet();
-
-const results = await wallet.signAndSendTransactions({
- transactions: [
- {
- receiverId: "token.near",
- actions: [
- {
- type: "FunctionCall",
- params: {
- methodName: "ft_transfer",
- args: {
- receiver_id: "alice.near",
- amount: "1000000",
- },
- gas: "30000000000000",
- deposit: "1", // 1 yoctoNEAR for security
- },
- },
- ],
- },
- {
- receiverId: "nft.near",
- actions: [
- {
- type: "FunctionCall",
- params: {
- methodName: "nft_mint",
- args: {
- token_id: "token-1",
- receiver_id: "alice.near",
- },
- gas: "30000000000000",
- deposit: "10000000000000000000000", // 0.01 NEAR
- },
- },
- ],
- },
- ],
-});
-
-console.log(`Completed ${results.length} transactions`);
-```
-
----
-
-### Sign Messages (NEP-413)
-
-In NEAR, users can sign messages for authentication purposes without needing to send a transaction:
-
-```tsx
-const wallet = await connector.wallet();
-
-const signature = await wallet.signMessage({
- message: "Please sign this message to authenticate",
- recipient: "your-app.near",
- nonce: Buffer.from(crypto.randomUUID()),
-});
-
-console.log("Signature:", signature.signature);
-console.log("Public Key:", signature.publicKey);
-
-// Verify the signature on your backend
-```
-
----
-
-## React Integration
-
-For React applications, the `near-connector` can be easily integrated using a custom hook.
-
-Check out our example [`useNear` hook](https://github.com/near-examples/hello-near-connector/blob/main/src/hooks/useNear.jsx) which handles:
-- Connector initialization
-- Auto-reconnect on page load
-- Event listener management and cleanup
-- Wallet state synchronization
-- Error handling
diff --git a/docs/web3-apps/tutorials/web-login/wallet-selector.md b/docs/web3-apps/tutorials/web-login/wallet-selector.md
deleted file mode 100644
index f61ca25e7ca..00000000000
--- a/docs/web3-apps/tutorials/web-login/wallet-selector.md
+++ /dev/null
@@ -1,233 +0,0 @@
----
-id: wallet-selector
-title: Wallet Selector Tutorial
-description: "Enable users to sign-in using their NEAR wallet with the Wallet Selector"
----
-import {CodeTabs, Language, Github} from "@site/src/components/UI/Codetabs"
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-
-Allowing your users to connect with their favorite wallet and interact with your dApp is a crucial step in building web3 applications. This guide will help you to integrate the `Wallet Selector` into your frontend, enabling users to sign-in and perform transactions using their NEAR wallet.
-
-
-
-:::tip
-
-To see a fully working example, check our [Hello NEAR Example](https://github.com/near-examples/hello-near-examples/frontend), a simple app that allows users to set and get a greeting message on the NEAR blockchain
-
-:::
-
-:::info
-
-Check other options to let users login into your application and use NEAR accounts in the [Web Login](../../concepts/web-login.md) section
-
-:::
-
----
-
-## Adding the Wallet Selector
-
-To start, you will need to add the `Wallet Selector` and its dependencies to your project.
-
-If you prefer to explore the complete code example, you can check the [hello-near-example](https://github.com/near-examples/hello-near-examples/tree/main/frontend) repository:
-
-```bash
-npm install \
- @near-wallet-selector/modal-ui \
- @near-wallet-selector/bitget-wallet \
- @near-wallet-selector/coin98-wallet \
- @near-wallet-selector/ethereum-wallets \
- @near-wallet-selector/hot-wallet \
- @near-wallet-selector/intear-wallet \
- @near-wallet-selector/ledger \
- @near-wallet-selector/math-wallet \
- @near-wallet-selector/meteor-wallet \
- @near-wallet-selector/meteor-wallet-app \
- @near-wallet-selector/near-mobile-wallet \
- @near-wallet-selector/okx-wallet \
- @near-wallet-selector/ramper-wallet \
- @near-wallet-selector/sender \
- @near-wallet-selector/unity-wallet \
- @near-wallet-selector/welldone-wallet
-```
-
-Notice that the wallet selector implements multiple wallet packages to select from, [see the full list on the Repo](https://github.com/near/wallet-selector)
-
----
-
-## Initialize the Selector
-
-To initialize the wallet selector, you will need to set it up in your main application file (e.g., `app.js` or `index.js`). You can choose which wallets to include in the selector by importing their respective setup functions and adding them to the `modules` array.
-
-
-
-
-
-
-### Custom RPC
-
-If you want to use a user-defined RPC endpoint with the Wallet Selector, you can set up a [network options](https://github.com/near/wallet-selector/tree/main/packages/core#options) object with the custom URLs.
-For example:
-
-
-```js
-const my_network = {
- networkId: "my-custom-network",
- nodeUrl: "https://rpc.custom-rpc.com",
- helperUrl: "https://helper.custom-helper.com",
- explorerUrl: "https://custom-explorer.com",
- indexerUrl: "https://api.custom-indexer.com",
-};
-```
-
-
-
-### Creating an Access Key
-
-If you instantiated the `wallet-selector` passing an account id for the `createAccessKeyFor` parameter, then the wallet will create a [Function-Call Key](/protocol/access-keys#function-call-keys) and store it in the web's local storage.
-
-
-
-By default, such key enables to expend a maximum of `0.25β` on GAS calling methods in **the specified** contract **without prompting** the user to sign them.
-
-If, on the contrary, you do not create an access key, then the user will be asked to sign every single transaction (except calls to `view methods`, since those are always free).
-
-:::tip
-
-Please notice that this only applies to **non-payable** methods, if you attach deposit to any call the user will **always** be redirected to the wallet to confirm the transaction.
-
-:::
-
----
-
-## Calling View Methods
-
-Once the wallet-selector is up, we can start calling view methods, i.e., the methods that perform read-only operations.
-
-Because of their read-only nature, view methods are **free** to call, and do **not require** the user to be **logged in**. To make a view call, you simply need to import the `viewFunction` from the wallet selector hooks:
-
-
-
-
-
-Then, you can call any view method from any contract by providing the `contractId`, `methodName`, and arguments (`args`):
-
-
-
-
-
-Under the hood, `viewFunction` is actually making a **direct call to the RPC** using `near-api-js`.
-
-:::tip
-
-View methods have by default 200 TGAS for execution
-
-:::
-
----
-
-## User Sign-In / Sign-Out
-
-In order to interact with methods that modify data or make cross-contract calls it is necessary for the user to first sign in using a NEAR wallet.
-
-We can request the user sign in if `signedAccountId` is not present, the same simplicity applies to signing out.
-
-
-
-By assigning the `signIn` action to a button, when the user clicks it, the wallet selector modal will open:
-
-```jsx
-
-```
-
----
-
-## Calling Change Methods
-
-Once the user logs in they can start calling `change methods`. Programmatically, calling `change methods` is similar to calling `view methods`, only that now you can attach deposit to the call, and specify how much GAS you want to use.
-
-
-
-Under the hood, we are asking the **signedAccountId** to **sign a Function-Call transaction** for us.
-
-:::tip
-
-Remember that you can use the `callFunction` to call methods in **any** contract. If you did not ask for a function call key to be created, the user will simply be prompted to confirm the transaction.
-
-:::
-
-
-
-## Sending Multiple Transactions
-
-The wallet-selector hook also exposes a method that can be used to send multiple transactions at once:
-
-```js
-const { signAndSendTransactions } = useWalletSelector();
-
-const txs = await signAndSendTransactions({
- transactions: [{
- receiverId: "hello.near-examples.testnet",
- actions: [{
- type: "FunctionCall",
- params: {
- methodName: "set_greeting",
- args: {
- greeting: "Hello World"
- },
- gas: THIRTY_TGAS,
- deposit: NO_DEPOSIT
- }
- }]
- }]
-});
-```
-
-Transactions can either be sent as multiple separate transactions simultaneously or as a batch transaction made up of actions where if one of the actions fails, they are all reverted.
-
-An example of both can be seen [here](../../../tutorials/examples/frontend-multiple-contracts#dispatching-multiple-transactions).
-
----
-
-## Querying Account Balance
-
-By calling the `getBalance` method the user can get the balance of a given account.
-
-```js
-const { getBalance } = useWalletSelector();
-
-const balance = await getBalance("account.testnet");
-```
-
-
----
-
-## Get Access Keys
-
-The final method the wallet selector hooks exposes is `getAccessKeys`, which is used to return an object of all the access keys on the account that is currently logged in.
-
-```js
-const { getAccessKeys } = useWalletSelector();
-
-const keys = await getAccessKeys("account.testnet");
-```
-
-:::
-
-:::note Versioning for this article
-
-At the time of this writing, this example works with the following versions:
-
-- next: `15.0.3`
-- near-api-js: `^5.0.1`
-- wllet-selector/core: `^8.10.0`
-
-:::
diff --git a/docs/web3-apps/tutorials/web-login/web3-auth.md b/docs/web3-apps/tutorials/web-login/web3-auth.md
deleted file mode 100644
index ad4704b3cb6..00000000000
--- a/docs/web3-apps/tutorials/web-login/web3-auth.md
+++ /dev/null
@@ -1,213 +0,0 @@
----
-
-id: web3-auth
-title: Web3Auth Social Login Integration
-sidebar_label: Web3Auth Integration
----
-
-import {Github} from "@site/src/components/UI/Codetabs"
-
-
-# Integrating Web3Auth with NEAR
-
-This tutorial demonstrates how to integrate [Web3Auth](https://web3auth.io/) into a NEAR application, enabling users to log in with social accounts (Google, Facebook, Twitter, etc.) while maintaining full blockchain functionality.
-
-:::tip What is Web3Auth?
-
-Web3Auth is a pluggable authentication infrastructure that allows users to authenticate using familiar Web2 logins (OAuth providers like Google, Facebook, etc.) while generating a cryptographic key pair for Web3 interactions. This provides a seamless onboarding experience without requiring users to manage seed phrases or private keys directly.
-
-:::
-
-## Clone and Install
-
-Start by cloning the repository and installing dependencies:
-
-```bash
-git clone https://github.com/near-examples/hello-web3auth.git
-cd hello-web3auth/modal
-yarn install
-```
-
----
-
-
-## Get Web3Auth Credentials
-
-To enable social login, you need to create a Web3Auth project and obtain a Client ID.
-
-### Create a Web3Auth Account
-
-1. Go to [Web3Auth Dashboard](https://dashboard.web3auth.io/)
-2. Sign up or log in with your preferred method
-3. You'll be redirected to the dashboard
-
-### Create a New Project
-
-1. Click on **"Add new project"**
-2. Fill in the project details:
- - **Project Name**: Choose a descriptive name (e.g., "NEAR Social Login")
- - **Environment**: Select **"Sapphire Devnet"** for development
- - **Chain Namespace**: Choose **"Other"** (since NEAR is not natively supported)
-3. Click **"Create"**
-
-### Configure Your Project
-
-1. Once created, click on your project to open its settings.In this section you can find Client ID and Client Secret which will be used in the application configuration.
-2. Change the **Select Product** to **MPC Core Kit**
-3. Change **Project platform** to **Web Application**
-4. Go to the **"Domains"** tab
-5. Add your application's URLs:
- - **Whitelist URLs**: Add `http://localhost:5173` for local development
- - For production, add your deployed URL (e.g., `https://yourdomain.com`)
-
----
-
-## Configure Google OAuth (Optional but Recommended)
-
-While Web3Auth provides default OAuth providers, setting up your own Google OAuth gives you more control and branding.
-
-### Create a Google Cloud Project
-
-1. Open the [Google Cloud Console](https://console.cloud.google.com/).
-2. Click Select a project β New Project (or choose an existing project).
-3. Enter a project name (for example, NEAR Web3Auth) and click Create.
-4. In the left sidebar, go to **APIs & Services** β **OAuth consent screen** ([direct link](https://console.cloud.google.com/auth/overview/create)).
-
-
-### Configure OAuth Consent Screen
-
-1. Go to **"APIs & Services"** β **"OAuth consent screen"**
-2. Choose **"External"** (unless you have a Google Workspace)
-3. Fill in the required information:
- - **App name**: Your application name
- - **User support email**: Your email
- - **Developer contact**: Your email
-4. Click **"Save and Continue"**
-5. On the **Scopes** page, click **"Save and Continue"** (default scopes are fine)
-6. On the **Test users** page, add your email for testing
-7. Click **"Save and Continue"**
-
-### Create OAuth Credentials
-
-1. Go to **"APIs & Services"** β **"Credentials"**
-2. Click **"+ Create Credentials"** β **"OAuth client ID"** ([direct link](https://console.cloud.google.com/auth/clients/create))
-3. Select **"Web application"**
-4. Configure:
- - **Name**: Choose a descriptive name
- - **Authorized JavaScript origins**:
- - Add `http://localhost:5173` (for development)
- - Add your production domain (when ready)
- - **Authorized redirect URIs**:
- - Add `https://auth.web3auth.io/auth`
- - This is Web3Auth's callback URL
-5. Click **"Create"**
-6. Copy the **Client ID** and **Client Secret**
-
-### Add Google Credentials to Web3Auth
-
-1. Return to [Web3Auth Dashboard](https://dashboard.web3auth.io/)
-2. Go to the **Authentication** in left sidebar
-3. Click on **Google** in social Logins
-4. Click on **Add connection** and fill in the following details:
- - **Auth Connection ID***: Your desired connection ID (e.g., `near-login`),This use for verifier value in application configuration.
- - **Enter Google Client ID***: Your Google OAuth Client Secret from previous step.(e.g., `17426988624-32m2gh1o1n5qve6govq04ue91sioruk7WWapps.googleusercontent.com`)
-
----
-
-## Configure Your Application
-
-Now that you have your Web3Auth Client ID, update your application configuration.
-
-### Update the Config File
-
-Open `src/config.js` and replace the `clientId` with your own:
-
-
-
----
-
-## Run the Application
-
-Start the development server:
-
-```bash
-yarn run dev
-```
-
-Open your browser and navigate to `http://localhost:5173`.
-
-### Testing the Integration
-
-1. Click the **"Login"** button in the navigation bar
-2. The Web3Auth modal will appear with various login options
-3. Choose **"Continue with Google"** (or another provider)
-4. Complete the authentication flow
-5. Once logged in, you'll see:
- - Your derived NEAR account ID in the navigation
- - Your NEAR balance
- - A logout button with your email/name
-
----
-
-## Understanding the Implementation
-
-### Architecture Overview
-
-This integration uses two main components:
-
-1. **Web3Auth Modal** (`@web3auth/modal-react-hooks`): Provides the UI and authentication flow
-2. **NEAR Integration** (custom provider): Derives NEAR keys from Web3Auth and manages blockchain interactions
-
-### Key Components
-
-#### 1. Web3Auth Provider (`App.jsx`)
-
-
-
-The `Web3AuthProvider` wraps your application and provides authentication state.
-
-#### 2. NEAR Context Provider (`src/context/provider.jsx`)
-
-This custom provider bridges Web3Auth and NEAR:
-
-
-
-
-#### 3. Using the Context (`src/components/navigation.jsx`)
-
-Components can access both Web3Auth and NEAR state:
-
-
-
-### How It Works
-
-1. **User Authentication**: User logs in via Web3Auth (Google, etc.)
-2. **Key Derivation**: Web3Auth generates a private key based on the user's social login
-3. **NEAR Key Conversion**: The private key is converted to NEAR's ED25519 format
-4. **Account ID Generation**: A deterministic account ID is derived from the public key
-5. **Blockchain Interaction**: The NEAR account instance can now sign transactions
-
-:::warning NEAR Provider Implementation
-
-After a user logs in, they receive a provider from the Embedded Wallets SDK. However, there is no native provider for NEAR, so we use the private key to make RPC calls directly. This is why we extract the private key from Web3Auth's provider and create a custom NEAR account instance using `@near-js/accounts` and `@near-js/providers`.
-
-:::
-
----
-
-## Interacting with Smart Contracts
-
-Once authenticated, you can interact with NEAR smart contracts. Here's an example from `src/pages/hello_near.jsx`:
-
-
----
\ No newline at end of file
diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js
index 1e7d06cc39b..ea7afa46c0f 100644
--- a/website/docusaurus.config.js
+++ b/website/docusaurus.config.js
@@ -556,8 +556,8 @@ const config = {
icon: '/assets/docs/welcome-pages/near-cli.png',
},
{
- label: 'Wallet Selector',
- to: '/tools/wallet-selector',
+ label: 'NEAR Connect',
+ to: '/tools/near-connect',
description: 'Integrate multiple wallets into your application',
icon: '/assets/docs/welcome-pages/multiple.png',
},
diff --git a/website/package.json b/website/package.json
index f5300032bee..f0f0d9a71ab 100644
--- a/website/package.json
+++ b/website/package.json
@@ -31,6 +31,7 @@
"serve": "^14.2.4"
},
"dependencies": {
+ "@docsearch/core": "^4.5.0",
"@docusaurus/core": "3.9.2",
"@docusaurus/plugin-ideal-image": "3.9.2",
"@docusaurus/plugin-sitemap": "3.9.2",
diff --git a/website/sidebars.js b/website/sidebars.js
index d0e2a2532c7..ad9931107da 100644
--- a/website/sidebars.js
+++ b/website/sidebars.js
@@ -373,20 +373,12 @@ const sidebar = {
{
"Concepts": [
'web3-apps/concepts/web-login',
- 'web3-apps/concepts/eth-wallets-on-near',
'web3-apps/concepts/data-types'
]
},
{
"Tutorials": [
- {
- "Web Login": [
- 'web3-apps/tutorials/web-login/near-connector',
- 'web3-apps/tutorials/web-login/wallet-selector',
- 'web3-apps/tutorials/web-login/ethereum-wallets',
- 'web3-apps/tutorials/web-login/web3-auth',
- ]
- },
+ 'web3-apps/tutorials/wallet-login',
'tutorials/examples/frontend-multiple-contracts',
'web3-apps/backend/backend-login',
{
@@ -431,7 +423,11 @@ const sidebar = {
"Reference": [
'tools/near-api',
'tools/near-cli',
- 'tools/wallet-selector',
+ {
+ type: 'link',
+ label: 'NEAR Connect β',
+ href: 'https://github.com/azbang/near-connect'
+ },
]
}
],
diff --git a/website/src/components/MovingForwardSupportSection.js b/website/src/components/MovingForwardSupportSection.js
index 7ff44bbc5aa..bc6910fe3d6 100644
--- a/website/src/components/MovingForwardSupportSection.js
+++ b/website/src/components/MovingForwardSupportSection.js
@@ -7,16 +7,12 @@
import React from 'react';
const MovingForwardSupportSection = () => (
-