From 40b974a10e907d88d582052a171e04239261a540 Mon Sep 17 00:00:00 2001
From: Junior_Gx <71051032+goffxnca@users.noreply.github.com>
Date: Mon, 2 Dec 2024 21:38:35 +0700
Subject: [PATCH 01/35] docs: add empty support channel section to help page
(#2329)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* docs: add empty support channel section to help page
* docs: add all support channels
#2328
* docs: group telegram chats as groups
#2328
Co-authored-by: DamiΓ‘n Parrino
* docs: add sub sections between tables
---
docs/help.md | 76 +++++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 70 insertions(+), 6 deletions(-)
diff --git a/docs/help.md b/docs/help.md
index 72de6f17ead..a2d8739edc9 100644
--- a/docs/help.md
+++ b/docs/help.md
@@ -16,12 +16,76 @@ NEAR is dedicated to providing the best developer experience possible for buildi
**Get involved!** π please select one of the options above or contribute to one of the essential developer repositories listed below π
-:::info Contact Us
-- [Developer Hub](https://neardevhub.org/)
-- [Telegram Support](https://t.me/neardev)
-- [Discord](https://near.chat)
-- [Zulip](https://near.zulipchat.com)
-:::
+---
+
+### π¬ Support Channels
+
+If youβre new or unsure where to start, these are the main support channels to connect with the NEAR community. They are great entry points for general questions and discussions.
+
+| Channel | Description | Link |
+| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
+| **Telegram (Near Dev)** | NEAR Developers community chat | [Join](https://t.me/neardev) |
+| **Discord** | Primary discussion and support forum. Weekly Q&A sessions: Thursdays at 11 AM UTC & 6 PM UTC. Also accessible via [near.chat](https://near.chat). | [Join](https://discord.gg/nearprotocol) |
+| **X (Twitter)** | Official Twitter account for NEAR Protocol. | [Visit](https://x.com/nearprotocol) |
+| **Zulip** | Topic-based discussions for detailed conversations. | [Join](https://near.zulipchat.com) |
+| **Developer Hub** | Centralized developer resources for NEAR, including announcements, blog and discussions. | [Visit](https://neardevhub.org/) |
+| **Telegram (General)** | General discussions for anyone interested in NEAR Protocol. | [Join](https://t.me/cryptonear) |
+
+
+
+The Telegram chats are organized into two groups to make it easier to navigate and find the right discussions:
+
+#### Group 1: Telegram Folder (21 chats)
+
+Discover 21 NEAR-related in this [Telegram groups folder](https://t.me/addlist/VWPcqJDOmXdkZTQ5), or explore and join individual chats below based on your interests.
+
+| # | Topic | Chat | Link |
+| --- | -------------------- | --------------------------------- | -------------------------------------------------- |
+| 1 | General | Near Dev | [Join](https://t.me/neardev) |
+| 2 | | NEAR Protocol Community Group | [Join](https://t.me/NEAR_Protocol_Community_Group) |
+| 3 | Tools & Tech | NEAR Tools Community Group | [Join](https://t.me/NEAR_Tools_Community_Group) |
+| 4 | | NEAR Python Tooling Community | [Join](https://t.me/nearpythontooling) |
+| 5 | Development | Aurora Dev | [Join](https://t.me/auroraisneardev) |
+| 6 | | Bitte Dev | [Join](https://t.me/mintdev) |
+| 7 | | NEAR Chain Abstraction Dev Group | [Join](https://t.me/chain_abstraction) |
+| 8 | Social Protocol | Near Social (near.social) | [Join](https://t.me/NearSocialDev) |
+| 9 | | BOS VM Dev (near.social) | [Join](https://t.me/NearSocialDev) |
+| 10 | Frontend Development | BOS Decentralized Frontends | [Join](https://t.me/NEARisBOS) |
+| 11 | Technical Resources | NEAR Docs Community Group | [Join](https://t.me/neardocscg) |
+| 12 | | BOS Web Engine Testing | [Join](https://t.me/bos_web_testing) |
+| 13 | | NEAR Validators | [Join](https://t.me/near_validators) |
+| 14 | Finance & DeFi | NEAR DeFi Founders | [Join](https://t.me/+Lu68Q6V-T2AxNDkx) |
+| 15 | Announcements | NEAR DevHub | [Join](https://t.me/NEARDevHub) |
+| 16 | Indexing & Data | NEAR Indexer Builder Group | [Join](https://t.me/+tZps5gkh17RmNTZh) |
+| 17 | | NEAR Data Guild | [Join](https://t.me/NEARdata) |
+| 18 | Wallets & Standards | NEAR Wallet Builder Group | [Join](https://t.me/+8s315V2dlYFkMmUx) |
+| 19 | | NEAR Contract Standards Community | [Join](https://t.me/nearnft) |
+| 20 | NFTs & Creative Tech | NEAR NFT Builder Group | [Join](https://t.me/+_odQLYGusEU0MzAx) |
+| 21 | | Jutsu.ai - Public | [Join](https://t.me/tryjutsu) |
+
+
+
+#### Group 2: NearBuilders Only (15 chats)
+
+These community groups are part of the 31 chats from [nearbuilders.com](https://nearbuilders.com) and do not overlap with the previous group. They offer great collaboration opportunities. Verify external links to stay safe.
+
+| # | Topic | Chat | Link |
+| --- | -------------------- | ----------------------------------- | ----------------------------------------------- |
+| 1 | General | Near DevHub Hacks | [Join](https://t.me/neardevhubhacks) |
+| 2 | AI & Advanced Topics | NEAR AI Builder Group | [Join](https://t.me/+iN9e_WZntCE3YTU5) |
+| 3 | | NEAR Zero Knowledge Community Group | [Join](https://t.me/NearZeroKnowledge) |
+| 4 | DAO & Community | NEAR DAO Builder Group | [Join](https://t.me/+94DGFAazvdpiMDZh) |
+| 5 | | Onboard DAO | [Join](https://t.me/+TYGncu1CaAc4YjAx) |
+| 6 | | Build DAO | [Join](https://t.me/+bQmGfDqcAT9iYTcx) |
+| 7 | | NEAR Impact Collective π± | [Join](https://t.me/+crolW0imGSQ4NjYx) |
+| 8 | | Creatives DAO Builder Group | [Join](https://t.me/+OG7gOkgjc6M3ZDAx) |
+| 9 | Tools & Tech | NEAR Tools Community Group | [Join](https://t.me/NEAR_Tools_Community_Group) |
+| 10 | | NEAR Python Tooling Community | [Join](https://t.me/nearpythontooling) |
+| 11 | | NEAR x IBC (Cosmos) | [Join](https://t.me/+0NKv1RrSeY42Yzdh) |
+| 12 | Gaming & NFTs | NEAR Games Community | [Join](https://t.me/NearGamesChat) |
+| 13 | | Bridging NFTs β | [Join](https://t.me/+lCgwUHprzhQ2YmE5) |
+| 14 | | NEAR Multitoken Standard Discussion | [Join](https://t.me/+-pduFDM84hFmMGU5) |
+| 15 | Privacy | Privacy on NEAR | [Join](https://t.me/+lf7vb2MAEgdjOGQx) |
---
From 85e6149363ce18c63701654b42a4723199446ef6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dami=C3=A1n=20Parrino?=
Date: Mon, 2 Dec 2024 13:39:48 -0300
Subject: [PATCH 02/35] Remove stale.yml (#2343)
* Delete .github/workflows/stale.yml
---
.github/workflows/stale.yml | 28 ----------------------------
1 file changed, 28 deletions(-)
delete mode 100644 .github/workflows/stale.yml
diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml
deleted file mode 100644
index 8f50f4d1053..00000000000
--- a/.github/workflows/stale.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-name: Close Stale Issues & Pull Requests
-
-on:
- schedule:
- - cron: '0 0 * * 5' # Run at midnight on Fridays
-
-permissions:
- issues: write
- pull-requests: write
-
-jobs:
- close_stale_prs:
- runs-on: ubuntu-latest
- steps:
- - name: Close stale pull requests
- uses: actions/stale@v9.0.0
-
- with:
- repo-token: ${{ secrets.GITHUB_TOKEN }}
- days-before-issue-stale: 180
- days-before-pr-stale: 45
- days-before-close: 0
- close-issue-message: 'This issue has been automatically closed because it has been
-inactive for more than 180 days. Please reopen and prioritize this for development if it is
-essential.'
- close-pr-message: 'This pull request has been automatically closed because it has been
-inactive for more than 45 days. Please reopen and see this PR through its review if it is
-essential.'
From 1fac9b464b34ae40d21bb5ea2257c353d18554a5 Mon Sep 17 00:00:00 2001
From: Guille
Date: Mon, 2 Dec 2024 17:53:06 +0100
Subject: [PATCH 03/35] Delete .github/workflows/translation.yml (#2344)
---
.github/workflows/translation.yml | 56 -------------------------------
1 file changed, 56 deletions(-)
delete mode 100644 .github/workflows/translation.yml
diff --git a/.github/workflows/translation.yml b/.github/workflows/translation.yml
deleted file mode 100644
index 6030a7a3d1f..00000000000
--- a/.github/workflows/translation.yml
+++ /dev/null
@@ -1,56 +0,0 @@
-name: Download translation and build docs
-
-on:
- schedule:
- - cron: "0 9 * * 1"
- workflow_dispatch:
-
-jobs:
- merge_job:
- runs-on: ubuntu-latest
- permissions:
- contents: write
-
- steps:
- - uses: actions/checkout@v4
- with:
- fetch-depth: "0"
-
- - uses: actions/cache@v3
- with:
- path: |
- ${{ github.workspace }}/**/.cache
- key: |
- ${{ runner.os }}-docusaurus-${{ hashFiles('**/yarn.lock') }}
- restore-keys: |
- ${{ runner.os }}-docusaurus-${{ hashFiles('**/yarn.lock') }}
-
- - name: Set Git config
- run: |
- git config --local user.email "actions@github.com"
- git config --local user.name "Github Actions"
-
- - name: Checkout and pull build
- run: |
- git fetch
- git checkout build
- git pull
-
- - name: Install dependencies and build
- run: |
- cd website
- yarn
- yarn crowdin:download
- yarn build
-
- - name: Commit build
- run: |
- git add -f ./website/build ./website/.docusaurus ./website/i18n
- if git commit -m "add new build";then
- git push
- else
- echo "Nothing to commit"
- fi
- env:
- NODE_OPTIONS: --max-old-space-size=8192
- CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
From af28746edfe0d75604c620b8aa8645ea008e7d52 Mon Sep 17 00:00:00 2001
From: rusttech
Date: Wed, 4 Dec 2024 06:25:59 +0800
Subject: [PATCH 04/35] chore: fix some typos in comment (#2346)
Signed-off-by: rusttech
---
docs/2.build/4.web3-apps/integrate-contracts.md | 2 +-
docs/3.tutorials/examples/donation.md | 2 +-
docs/3.tutorials/nfts/2-minting.md | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/2.build/4.web3-apps/integrate-contracts.md b/docs/2.build/4.web3-apps/integrate-contracts.md
index 0b109441666..1bf00c5c704 100644
--- a/docs/2.build/4.web3-apps/integrate-contracts.md
+++ b/docs/2.build/4.web3-apps/integrate-contracts.md
@@ -212,7 +212,7 @@ Remember that you can use the `wallet` to call methods in **any** contract. If y
### Wallet Redirection
-When calling a change call with **attatched deposit** (or any change call if no function call key was created), then the user will be prompted to sign the transaction in the wallet.
+When calling a change call with **attached deposit** (or any change call if no function call key was created), then the user will be prompted to sign the transaction in the wallet.
If using a web wallet, as opposed to an extension, the user will be redirected to the wallet's website to sign the transaction.
After accepting, the user will be brought back to your application, with the resulting transaction hash being passed as part of the URL (i.e. `your-website.com/?transactionHashes=...`).
diff --git a/docs/3.tutorials/examples/donation.md b/docs/3.tutorials/examples/donation.md
index de79d8296fe..43c7e84bf8c 100644
--- a/docs/3.tutorials/examples/donation.md
+++ b/docs/3.tutorials/examples/donation.md
@@ -8,7 +8,7 @@ import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import MovingForwardSupportSection from '@site/src/components/MovingForwardSupportSection';
-Our donation example enables to forward NEAR Tokens to an account while keeping track of it. It is one of the simplest examples on making a contract handle tranfers.
+Our donation example enables to forward NEAR Tokens to an account while keeping track of it. It is one of the simplest examples on making a contract handle transfers.
![img](/docs/assets/examples/donation.png)
_Frontend of the Donation App_
diff --git a/docs/3.tutorials/nfts/2-minting.md b/docs/3.tutorials/nfts/2-minting.md
index c3476c9c05a..79d8d5bbea6 100644
--- a/docs/3.tutorials/nfts/2-minting.md
+++ b/docs/3.tutorials/nfts/2-minting.md
@@ -184,7 +184,7 @@ Add the following to your newly created `internal.rs` file.
You may notice more functions in the `internal.rs` file than we need for now. You may ignore them, we'll come back to them later.
:::
-Let's now quickly move to the `lib.rs` file and make the functions we just created invokable in other files. We'll add the internal crates and mod the file as shown below:
+Let's now quickly move to the `lib.rs` file and make the functions we just created invocable in other files. We'll add the internal crates and mod the file as shown below:
From 5d2ffde80913aae99f883ea38b3bfefccc247b4a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dami=C3=A1n=20Parrino?=
Date: Fri, 6 Dec 2024 11:33:53 -0300
Subject: [PATCH 05/35] Update welcome.md (#2350)
---
docs/welcome.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/welcome.md b/docs/welcome.md
index 3d7b0581911..ab24bf233cd 100644
--- a/docs/welcome.md
+++ b/docs/welcome.md
@@ -8,7 +8,7 @@ hide_table_of_contents: true
import {FeatureList, Column, Feature} from "@site/src/components/featurelist";
import {Container, Card} from "@site/src/components/cards";
-Imagine a place were you can build Web3 apps with the simplicity of Web2. Imagine a place were you can empower communities, supercharge AI and easily integrate your app with other chains. Welcome to NEAR, you're gonna like it here.
+Imagine a place where you can build Web3 apps with the simplicity of Web2. Imagine a place where you can empower communities, supercharge AI, and easily integrate your app with other chains. Welcome to NEAR; you're going to like it here.
Date: Mon, 9 Dec 2024 16:07:28 -0800
Subject: [PATCH 06/35] Update providers.md (#2355)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Update providers.md
Remove Pagoda's endpoint.
Add Deprecation note for near.org endpoints
* Apply suggestions from code review
Co-authored-by: DamiΓ‘n Parrino
---------
Co-authored-by: DamiΓ‘n Parrino
---
docs/5.api/rpc/providers.md | 40 +++++++++++++++++++++++++++++++++----
1 file changed, 36 insertions(+), 4 deletions(-)
diff --git a/docs/5.api/rpc/providers.md b/docs/5.api/rpc/providers.md
index 33afa905944..59f8b6e6ca2 100644
--- a/docs/5.api/rpc/providers.md
+++ b/docs/5.api/rpc/providers.md
@@ -17,8 +17,7 @@ If you want to use a custom RPC provider with NEAR Wallet Selector, [check this
| Provider | Endpoint Root |
| -------------------------------------------------------------------------- | ------------------------------------------------------------ |
-| [NEAR](setup.md) | `https://rpc.mainnet.near.org` |
-| [Pagoda](https://www.pagoda.co/console) | `https://rpc.mainnet.pagoda.co` |
+| [NEAR.org (deprecated)](setup.md) | `https://rpc.mainnet.near.org` |
| [1RPC](https://docs.1rpc.io/overview/about-1rpc) | `https://1rpc.io/near` |
| [All That Node](https://docs.allthatnode.com/protocols/near/) | `https://near-mainnet-rpc.allthatnode.com:3030` |
| [ankr.com](https://www.ankr.com/docs/rpc-service/chains/chains-list/#near) | `https://rpc.ankr.com/near` |
@@ -41,8 +40,7 @@ If you want to use a custom RPC provider with NEAR Wallet Selector, [check this
| Provider | Endpoint Root |
| -------------------------------------------------------------------------- | ------------------------------------------------------------ |
-| [NEAR](setup.md) | `https://rpc.testnet.near.org` |
-| [Pagoda](https://www.pagoda.co/console) | `https://rpc.testnet.pagoda.co` |
+| [NEAR.org (deprecated)](setup.md) | `https://rpc.testnet.near.org` |
| [FASTNEAR](https://fastnear.com) | `https://test.rpc.fastnear.com` |
## RPC Failover
@@ -50,3 +48,37 @@ If you want to use a custom RPC provider with NEAR Wallet Selector, [check this
In `near-api-js` you can use [`FailoverRpcProvider`](../../4.tools/near-api-js/quick-reference.md#rpc-failover) to automatically switch RPC providers when one provider is experiencing downtime, or implement an RPC selection widget that allows users to add their own RPC provider.
As a user, if a dApp or wallet doesn't support RPC failover and the primary provider is down, you can use an RPC Selector browser extension to redirect all requests to an RPC provider of your choice.
+
+## On NEAR.org RPC Deprecation
+
+Please read the following announcement: [Future of Pagoda Services](https://docs.near.org/blog/2024-08-13-pagoda-services).
+
+> The Infrastructure Committee feels that Pagoda's fully-subsidized near.org RPC service is getting in the way of decentralization efforts and is preventing high-quality commercial RPC offerings from gaining traction. If a NEAR core team continues to support a free-to-use near.org RPC service, it will be required to gradually lower its rate limits over the coming months to prevent abuse. In light of this proposed change, high-traffic near.org RPC users should start making plans to switch to other RPC providers.
+
+### The current rate-limits of NEAR.org RPC endpoints
+
+Starting December 1st, 2024:
+
+* **RPC Mainnet**: 2000 requests/30s per IP
+* **RPC Testnet**: 900 requests/30s per IP
+* **Archival-RPC Mainnet**: 200 requests/30s IP
+* **Archival-RPC Testnet**: 400 requests/30s per IP
+
+Starting January 1st, 2025:
+
+* **RPC Mainnet**: 500 requests/30s per IP or referrer
+* **RPC Testnet**: 600 requests/30s per IP or referrer
+* **Archival-RPC Mainnet**: 100 requests/30s per IP or referrer
+* **Archival-RPC Testnet**: 200 requests/30s per IP or referrer
+
+Starting February 1st, 2025
+
+* **RPC Mainnet**: 150 req/30s per IP or referrer
+* **RPC Testnet**: 300 requests/30s per IP or referrer
+* **Archival-RPC Mainnet**: 20 requests/30s per IP or referrer
+* **Archival-RPC Testnet**: 100 requests/30s per IP or referrer
+
+:::note
+Rate limits will be applied by IP or by the HTTP `Referer` header, whichever hits first. Frontend applications will likely be rate-limited by the referrer, while backend applications will likely be rate-limited by the IP address.
+:::
+
From 65362b93046874ff8678ae3b36bbb2ae0d718fc4 Mon Sep 17 00:00:00 2001
From: Lyudmil Ivanov <55487633+flmel@users.noreply.github.com>
Date: Tue, 10 Dec 2024 02:08:02 +0200
Subject: [PATCH 07/35] Update integration-test.md (#2354)
* Update integration-test.md
Add correct missing snippet to fast forward in workspaces-js
* link
* revert-line wrong numbers
---
docs/2.build/2.smart-contracts/testing/integration-test.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/2.build/2.smart-contracts/testing/integration-test.md b/docs/2.build/2.smart-contracts/testing/integration-test.md
index 4790b180b5e..550596eee21 100644
--- a/docs/2.build/2.smart-contracts/testing/integration-test.md
+++ b/docs/2.build/2.smart-contracts/testing/integration-test.md
@@ -234,7 +234,7 @@ This approach is more complex to do and also cannot be performed without restart
From 3749ca7c530aa14be4e60d805d31b2bf0e4c1b80 Mon Sep 17 00:00:00 2001
From: Amira Nasri
Date: Tue, 10 Dec 2024 01:11:44 +0100
Subject: [PATCH 08/35] Update Build Commands in Documentation (#2357)
* update build command with no docker flag
* add no docker flag to build command
---
docs/2.build/2.smart-contracts/quickstart.md | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/docs/2.build/2.smart-contracts/quickstart.md b/docs/2.build/2.smart-contracts/quickstart.md
index 65f92b96791..d6ca139d4f6 100644
--- a/docs/2.build/2.smart-contracts/quickstart.md
+++ b/docs/2.build/2.smart-contracts/quickstart.md
@@ -262,14 +262,18 @@ Remember that you can create a named account through any wallet (i.e. [MyNearWal
## Build the Contract
-When you are ready to create a build of the contract run a one-line command depending on your environment.
-
+If you encounter issues with Docker or prefer not to use Docker for building contracts, you can pass the --no-docker flag to certain commands (where applicable).
```bash
npm run build
```
+ Or
+
+ ```bash
+ npm run build --no-docker
+ ```
@@ -278,6 +282,11 @@ When you are ready to create a build of the contract run a one-line command depe
```bash
cargo near build
```
+ Or
+
+ ```bash
+ cargo near build --no-docker
+ ```
From daf6bca50c457f611ef067ae267d7bb56333955b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dami=C3=A1n=20Parrino?=
Date: Wed, 11 Dec 2024 08:02:10 -0300
Subject: [PATCH 09/35] Add 3rd party data APIs (#2347)
* apis
* Update nearblocks-api.md
* Update fastnear-api.md
* Update pikespeak-api.md
---
docs/4.tools/ecosystem-apis/fastnear-api.md | 151 ++++++++++++++++++
docs/4.tools/ecosystem-apis/nearblocks-api.md | 86 ++++++++++
docs/4.tools/ecosystem-apis/pikespeak-api.md | 149 +++++++++++++++++
docs/4.tools/fastnear-api.md | 53 ------
website/sidebars.js | 22 ++-
5 files changed, 401 insertions(+), 60 deletions(-)
create mode 100644 docs/4.tools/ecosystem-apis/fastnear-api.md
create mode 100644 docs/4.tools/ecosystem-apis/nearblocks-api.md
create mode 100644 docs/4.tools/ecosystem-apis/pikespeak-api.md
delete mode 100644 docs/4.tools/fastnear-api.md
diff --git a/docs/4.tools/ecosystem-apis/fastnear-api.md b/docs/4.tools/ecosystem-apis/fastnear-api.md
new file mode 100644
index 00000000000..1db492f16c0
--- /dev/null
+++ b/docs/4.tools/ecosystem-apis/fastnear-api.md
@@ -0,0 +1,151 @@
+---
+id: fastnear-api
+title: FastNEAR API
+sidebar_label: FastNEAR API
+---
+
+[FastNEAR](https://fastnear.com/) provides high-performance infrastructure enabling seamless blockchain interactions.
+
+## Overview
+
+[FastNEAR](https://fastnear.com/) exposes low-latency APIs for wallets and explorers. Their API allows you to easily query the NEAR blockchain to get an account's assets, map keys into account IDs, explore a block's transactions, etc.
+
+:::info More info
+
+Find more information about the FastNear API in their [services page](https://fastnear.com/services).
+
+:::
+
+## RPC implementation
+
+[Fast-Near](https://github.com/fastnear/fast-near) aims to provide the fastest RPC implementation for NEAR Protocol using high-performance storage backends:
+ - in-memory storage in [Redis](https://redis.io/).
+ - SSD optimized storage using [LMDB](https://www.symas.com/lmdb).
+
+It is optimized for `view` call performance and ease of deploy and scaling.
+
+
+:::note About data sync
+FastNear doesn't sync with the NEAR blockchain on its own. Data needs to be loaded either from [NEAR Lake](https://github.com/near/near-lake-indexer) or from [Near State Indexer](https://github.com/vgrichina/near-state-indexer).
+:::
+
+---
+
+## Endpoints
+
+The [FastNEAR API server](https://github.com/fastnear/fastnear-api-server-rs) provides a low-latency RPC API for wallets and explorers.
+
+- Mainnet: `https://api.fastnear.com`
+- Testnet: `https://test.api.fastnear.com`
+
+#### Public Key
+
+- Public Key to Account ID mapping.
+- Full Access Public Key to Account ID mapping.
+- Any Public Key to Account ID mapping.
+
+#### Account ID
+
+- Account ID to delegated staking pools (validators).
+- Account ID to fungible tokens (FT contracts).
+- Account ID to non-fungible tokens (NFT contracts).
+
+#### Token ID
+
+- Token ID to top 100 accounts by balance (for FT contracts).
+
+
+:::tip V1 API
+
+[Click here](https://github.com/fastnear/fastnear-api-server-rs?tab=readme-ov-file#api-v1) to see the complete list of API endpoints and usage examples.
+
+:::
+
+## Examples
+
+### [Blockchain Data](https://github.com/fastnear/neardata-server/)
+
+- Query last block produced
+
+```bash
+# Query last block produced
+curl https://mainnet.neardata.xyz/v0/last_block/final
+```
+
+
+ Response
+
+```json
+ {
+ "block": {
+ "author": "aurora.pool.near",
+ "header": {
+ "height": 129311487,
+ "prev_height": 129311486,
+ ...
+ }
+ }
+ }
+```
+
+
+
+### [User Queries](https://github.com/fastnear/fastnear-api-server-rs)
+
+- Query user's FTs
+
+```bash
+# Query user's FTs
+curl https://api.fastnear.com/v1/account/root.near/ft
+```
+
+
+ Response
+
+```json
+{"account_id":"root.near","tokens":[{"balance":"199462092","contract_id":"pixeltoken.near","last_update_block_height":null},...
+```
+
+
+
+---
+
+- Query user's NFTs
+
+```sh
+# Query user's NFTs
+curl https://api.fastnear.com/v1/account/root.near/nft
+```
+
+
+ Response
+
+```json
+{"account_id":"root.near","tokens":[{"contract_id":"nft.goodfortunefelines.near","last_update_block_height":null},...
+```
+
+
+
+---
+
+- Query all user's assets
+
+```sh
+# Query all user's assets
+curl https://api.fastnear.com/v1/account/root.near/full
+```
+
+
+ Response
+
+```json
+ {
+ "account_id": "root.near",
+ "tokens": [
+ { "balance": "199462092", "contract_id": "the-token.near" },
+ ...
+ ]
+ }
+```
+
+
diff --git a/docs/4.tools/ecosystem-apis/nearblocks-api.md b/docs/4.tools/ecosystem-apis/nearblocks-api.md
new file mode 100644
index 00000000000..ed86fae01ed
--- /dev/null
+++ b/docs/4.tools/ecosystem-apis/nearblocks-api.md
@@ -0,0 +1,86 @@
+---
+id: nearblocks-api
+title: NearBlocks API
+sidebar_label: NearBlocks API
+---
+
+The [NearBlocks API](https://api.nearblocks.io/api-docs/) provides a simple way to query actions that happened on a NEAR account, such as function calls, token transfers, etc.
+
+## Overview
+
+The [NearBlocks](https://nearblocks.io/) Developer [REST APIs](https://nearblocks.io/apis) are provided as a community service and without warranty, so please use what you need and no more.
+
+NearBlocks also provides an API Pro plan which is a monthly subscription-based API service that provides higher rate limits for power users and commercial solutions. To upgrade to a paid API Plan, head over to the APIs page and select a plan that suits your needs. Once payment has been made, you can create API keys to make requests to our end points.
+
+## Endpoints
+
+You can find the complete API endpoint list in [this page](https://api.nearblocks.io/api-docs/).
+You can access the REST APIs using [cURL](http://curl.se), or any HTTP client.
+
+- Mainnet: `https://api.nearblocks.io`
+- Testnet: `https://api-testnet.nearblocks.io`
+
+:::note
+NearBlocks API supports `GET` requests only.
+:::
+
+If you have a Pro subscription, you can pass the API key into a REST API call as `Authorization` header with the following format. Replace `API_KEY` with the key string of your API key. For example, to pass an API key for an Account API:
+
+```sh
+ curl -X GET -H "Authorization: Bearer API_KEY" "https://api.nearblocks.io/v1/account/wrap.near"
+ ```
+
+:::tip More info
+
+Check the [API documentation](https://api.nearblocks.io/api-docs/) for more information about the NearBlocks API.
+:::
+
+## Examples
+
+- All the times **anyone** called `create_drop` on Keypom
+
+```bash
+# All the times **anyone** called "create_drop" on Keypom
+curl -X GET "https://api.nearblocks.io/v1/account/v2.keypom.near/txns?method=create_drop"
+```
+
+
+ Response
+
+```json
+{"cursor":"10055367839","txns":[{"id":"10830753377","receipt_id":"5F79mMVCnRrHRbdYmrSPjRwnAgUBc3H2okMHo69cZcJV","predecessor_account_id":"dragov.near","receiver_account_id":"v2.keypom.near","receipt_kind":"ACTION","receipt_block":{"block_hash":"E3KaP9w1y8CzWFajYBjx9oJFuhjjXuM8vaNPdnAXJeHp","block_height":134346961,"block_timestamp":1733475275522260000},"receipt_outcome":{"gas_burnt":5361098685764,"tokens_burnt":536109868576400000000,"executor_account_id":"v2.keypom.near","status":true},"transaction_hash":"9Y6WvywzX23YLCEuoXDqcaYJMRYihpXWwb4gsBwuXJFX","included_in_block_hash":"yfiq5z1JK6xUzdJk71W1N8yiK65Xt7xFXs6aiKLDtSH","block_timestamp":"1733475274374657534","block":{"block_height":134346960},"receipt_conversion_tokens_burnt":"31845454987000000000","actions":[{"action":"FUNCTION_CALL","method":"create_drop","deposit":1.0426e+24,"fee":536109868576400000000,"args":"{\"drop_id\": \"1733475264350\", \"metadata\": \"{\\\\\\\\\\\\\\\"dropName\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"Vrscert NEAR account creation \\\\\\\\\\\\\\\"}\", \"public_keys\": [\"ed25519:DJrjp8VpUKn3dnfV7Yyt2BHCC3wujjjjynUHhkrJWpVQ\"], \"deposit_per_use\": \"1000000000000000000000000\"}"}],"actions_agg":{"deposit":1.0426e+24},"outcomes":{"status":true},"outcomes_agg":{"transaction_fee":588989004589500000000}}, ...
+```
+
+
+
+---
+
+- All the times that `gagdiez.near` called `create_drop` on Keypom
+
+```sh
+# All the times that gagdiez.near called "create_drop" on Keypom
+curl -X GET "https://api.nearblocks.io/v1/account/v2.keypom.near/txns?method=create_drop&from=gagdiez.near"
+```
+
+
+
+ Response
+
+```json
+{
+ "txns": [
+ {
+ "predecessor_account_id": "gagdiez.near",
+ "receiver_account_id": "v2.keypom.near",
+ "receipt_kind": "ACTION",
+ "receipt_outcome": {
+ "status": true,
+ ...
+ },
+ ...
+ }
+ ]
+}
+```
+
+
diff --git a/docs/4.tools/ecosystem-apis/pikespeak-api.md b/docs/4.tools/ecosystem-apis/pikespeak-api.md
new file mode 100644
index 00000000000..dcfe4e3639e
--- /dev/null
+++ b/docs/4.tools/ecosystem-apis/pikespeak-api.md
@@ -0,0 +1,149 @@
+---
+id: pikespeak-api
+title: Pikespeak API
+sidebar_label: Pikespeak API
+---
+
+[Pikespeak](https://pikespeak.ai) offers an enterprise-grade API where you can fetch blockchain events and aggregated analytics on wallets, validators, delegators, money transfers, dApps activity, and more.
+
+## Overview
+
+Pikespeak is a Data & Analytics solution built on NEAR Protocol.
+Since inception, Pikespeak has recorded over 1 billion on-chain events and generated over 40 data points for more than 60 million accounts. Actionable data that can supercharge Web3 projects, allowing them to take action.
+The solution provides:
+
+- Dashboards and visualizations of the most fundamental Web3 use cases;
+- An API with 50+ endpoints to consume live, historical data, and insights in a programmatic way.
+
+
+## Endpoints
+
+To access the Pikespeak API you'll need to [register and create an account](https://pikespeak.ai/plans). Once you're registered, under the [`My Account`](https://pikespeak.ai/myaccount) page you can get your API key.
+
+You can find the complete API endpoint list in [this page](https://doc.pikespeak.ai/).
+You can access the REST APIs using [cURL](http://curl.se), or any HTTP client.
+
+- Mainnet: `https://api.pikespeak.ai`
+
+:::tip More info
+
+Check the [API documentation](https://doc.pikespeak.ai/) for more information about the Pikespeak API.
+:::
+
+## Examples
+
+- Account balance for `root.near`:
+
+```sh
+curl -X 'GET' \
+ 'https://api.pikespeak.ai/account/balance/root.near' \
+ -H 'accept: application/json' \
+ -H 'x-api-key: YOUR-PIKESPEAK-API-KEY'
+```
+
+
+ Response
+
+```json
+[
+ {
+ "contract": "Near",
+ "amount": 5796.337470826706,
+ "symbol": "NEAR",
+ "isParsed": true,
+ "icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA2AAAANgCAIAAADF8JzzAAA...
+ }
+]
+```
+
+
+
+---
+
+- Most active wallets NEAR senders:
+
+```sh
+curl -X 'GET' \
+ 'https://api.pikespeak.ai/hot-wallets/near' \
+ -H 'accept: application/json' \
+ -H 'x-api-key: YOUR-PIKESPEAK-API-KEY'
+```
+
+
+ Response
+
+```json
+{
+ "totalAmount": "43620883.893401468080059376309428",
+ "totalUSDValue": "0",
+ "topAccounts": [
+ {
+ "account": "jap1m48ko2uu.users.kaiching",
+ "amount": "0.00642925390730650000000",
+ "txCount": "1",
+ "usdValue": "0"
+ },
+ {
+ "account": "jb6050zkcoky.users.kaiching",
+ "amount": "0.00924935417618550000000",
+ "txCount": "1",
+ "usdValue": "0"
+ },
+ ...
+ ]
+}
+```
+
+
+
+---
+
+- Get historic account events for `keypom.near`:
+
+```sh
+curl -X 'GET' \
+ 'https://api.pikespeak.ai/event-historic/keypom.near' \
+ -H 'accept: application/json' \
+ -H 'x-api-key: YOUR-PIKESPEAK-API-KEY'
+```
+
+
+ Response
+
+```json
+[
+ {
+ "direction": "send",
+ "transaction_id": "Beh3TGHXWveH7n2aWmPoVUsFMuMSWUyKStZNccYbnUJA",
+ "receipt_id": "DvMhKedP25koZTw2RJ2DW3A8Ch4C7FsrZQZFv8hNCRkk",
+ "index": 0,
+ "sender": "keypom.near",
+ "receiver": "chaotictempest.near",
+ "type": "NEAR_TRANSFER",
+ "block_height": "132716642",
+ "timestamp": "1731632151999",
+ "transaction_type": "SEND_RECEIVE",
+ "token": null,
+ "2fa": false,
+ "amount": "5.00000000000000000000000",
+ "transaction_view": {
+ "type": "NEAR_TRANSFER",
+ "index": 0,
+ "amount": 5,
+ "sender": "keypom.near",
+ "status": true,
+ "two_fa": false,
+ "receiver": "chaotictempest.near",
+ "timestamp": 1731635751999756300,
+ "receipt_id": "DvMhKedP25koZTw2RJ2DW3A8Ch4C7FsrZQZFv8hNCRkk",
+ "block_height": 132716642,
+ "transaction_id": "Beh3TGHXWveH7n2aWmPoVUsFMuMSWUyKStZNccYbnUJA",
+ "transaction_type": "SEND_RECEIVE"
+ },
+ "amount_numeric": "5.00000000000000000000000"
+ },
+ ...
+]
+```
+
+
diff --git a/docs/4.tools/fastnear-api.md b/docs/4.tools/fastnear-api.md
deleted file mode 100644
index 220f82227ec..00000000000
--- a/docs/4.tools/fastnear-api.md
+++ /dev/null
@@ -1,53 +0,0 @@
----
-id: fastnear-api
-title: FastNEAR API
-sidebar_label: FastNEAR API
----
-
-A fast RPC for the NEAR blockchain, based on [Redis](https://redis.io/) and [LMDB](https://www.symas.com/lmdb).
-
-## About FastNEAR
-
-[Fast-Near](https://github.com/fastnear/fast-near) aims to provide the fastest RPC implementation for NEAR Protocol using high-performance storage backends:
- - in-memory storage in Redis.
- - SSD optimized storage using LMDB.
-
-It is optimized for `view` call performance and ease of deploy and scaling.
-
-
-:::info Note about data sync
-FastNear doesn't sync with the NEAR blockchain on its own. Data needs to be loaded either from [NEAR Lake](https://github.com/near/near-lake-indexer) or from [Near State Indexer](https://github.com/vgrichina/near-state-indexer).
-:::
-
----
-
-
-
-## FastNEAR API
-
-The [FastNEAR API server](https://github.com/fastnear/fastnear-api-server-rs) provides a low-latency RPC API for wallets and explorers.
-
-### Supported APIs
-
-#### Public Key
-
-- Public Key to Account ID mapping.
-- Full Access Public Key to Account ID mapping.
-- Any Public Key to Account ID mapping.
-
-#### Account ID
-
-- Account ID to delegated staking pools (validators).
-- Account ID to fungible tokens (FT contracts).
-- Account ID to non-fungible tokens (NFT contracts).
-
-#### Token ID
-
-- Token ID to top 100 accounts by balance (for FT contracts).
-
-
-:::tip V1 API
-
-[Click here](https://github.com/fastnear/fastnear-api-server-rs?tab=readme-ov-file#api-v1) to see the complete list of API endpoints and usage examples.
-
-:::
\ No newline at end of file
diff --git a/website/sidebars.js b/website/sidebars.js
index 4c3538e9011..5a3bf381326 100644
--- a/website/sidebars.js
+++ b/website/sidebars.js
@@ -555,13 +555,9 @@ const sidebar = {
"type": "category",
"label": "Wallets",
"items": [
+ "tools/wallets",
"tools/wallet-selector",
"tools/ethereum-wallets",
- {
- "type": "link",
- "label": "Remix IDE Plugin",
- "href": "https://docs.welldonestudio.io/code/getting-started"
- }
]
},
{
@@ -572,7 +568,20 @@ const sidebar = {
"type": "html",
"value": " Ecosystem Tools "
},
- "tools/wallets",
+ {
+ "type": "category",
+ "label": "Data APIs",
+ "items": [
+ 'tools/ecosystem-apis/fastnear-api',
+ 'tools/ecosystem-apis/nearblocks-api',
+ 'tools/ecosystem-apis/pikespeak-api',
+ ]
+ },
+ {
+ "type": "link",
+ "label": "Remix IDE Plugin",
+ "href": "https://docs.welldonestudio.io/code/getting-started"
+ },
{
"type": "link",
"label": "Testnet Faucet",
@@ -583,7 +592,6 @@ const sidebar = {
"label": "Keypom",
"href": "https://keypom.xyz/"
},
- 'tools/fastnear-api',
"tools/explorer",
"tools/indexing"
],
From fa175b94f9297b08f467b4e9646454d074bc8bd7 Mon Sep 17 00:00:00 2001
From: Amira Nasri
Date: Wed, 11 Dec 2024 15:15:51 +0100
Subject: [PATCH 10/35] Testnet account warning admonition (#2361)
* update build command with no docker flag
* add no docker flag to build command
* add warning to test account creation
* Apply suggestions from code review
---------
Co-authored-by: Guille
---
docs/2.build/2.smart-contracts/quickstart.md | 25 ++++++++++++--------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/docs/2.build/2.smart-contracts/quickstart.md b/docs/2.build/2.smart-contracts/quickstart.md
index d6ca139d4f6..a1c0d8e7b03 100644
--- a/docs/2.build/2.smart-contracts/quickstart.md
+++ b/docs/2.build/2.smart-contracts/quickstart.md
@@ -258,22 +258,25 @@ Remember that you can create a named account through any wallet (i.e. [MyNearWal
:::
+:::warning
+
+When running the near account create-account command in a headless Linux environment (e.g., WSL), the `save-to-keychain` option may fail due to platform limitations. Use `save-to-legacy-keychain` instead of `save-to-keychain` to ensure compatibility.
+
+:::
+
+
---
## Build the Contract
-If you encounter issues with Docker or prefer not to use Docker for building contracts, you can pass the --no-docker flag to certain commands (where applicable).
+When you are ready to create a build of the contract run a one-line command depending on your environment.
+
```bash
npm run build
```
- Or
-
- ```bash
- npm run build --no-docker
- ```
@@ -282,11 +285,13 @@ If you encounter issues with Docker or prefer not to use Docker for building con
```bash
cargo near build
```
- Or
+
- ```bash
- cargo near build --no-docker
- ```
+ :::info
+
+ If you encounter issues with Docker you can use the `--no-docker` flag to skip creating a reproducible build
+
+ :::
From faa6eb912474bfc6166c5dfb85b435c6e3db130a Mon Sep 17 00:00:00 2001
From: Amira Nasri
Date: Wed, 11 Dec 2024 15:48:36 +0100
Subject: [PATCH 11/35] Update Deployment Documentation to Use Correct Contract
Filename (generated.wasm) (#2362)
---
docs/2.build/2.smart-contracts/quickstart.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/2.build/2.smart-contracts/quickstart.md b/docs/2.build/2.smart-contracts/quickstart.md
index a1c0d8e7b03..f1ca02128fb 100644
--- a/docs/2.build/2.smart-contracts/quickstart.md
+++ b/docs/2.build/2.smart-contracts/quickstart.md
@@ -334,7 +334,7 @@ Having our account created, we can now deploy the contract:
```bash
- near deploy ./target/wasm32-unknown-unknown/release/hello.wasm
+ near deploy ./target/wasm32-unknown-unknown/release/.wasm
```
@@ -342,7 +342,7 @@ Having our account created, we can now deploy the contract:
```bash
- near contract deploy use-file ./target/wasm32-unknown-unknown/release/hello.wasm without-init-call network-config testnet sign-with-keychain send
+ near contract deploy use-file ./target/wasm32-unknown-unknown/release/.wasm without-init-call network-config testnet sign-with-keychain send
```
From 5ecdb3ac171ff902cf782dde9611b990d76ee2ba Mon Sep 17 00:00:00 2001
From: garikbesson
Date: Wed, 11 Dec 2024 18:25:46 +0300
Subject: [PATCH 12/35] Adding low-level way to make XCC (#2365)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* added low-level way to make xcc (#2364)
* change links
---------
Co-authored-by: Guille
Co-authored-by: DamiΓ‘n Parrino
---
.../anatomy/crosscontract.md | 65 +++++++++++++++----
1 file changed, 51 insertions(+), 14 deletions(-)
diff --git a/docs/2.build/2.smart-contracts/anatomy/crosscontract.md b/docs/2.build/2.smart-contracts/anatomy/crosscontract.md
index c7ef0e2dd47..c709902edbb 100644
--- a/docs/2.build/2.smart-contracts/anatomy/crosscontract.md
+++ b/docs/2.build/2.smart-contracts/anatomy/crosscontract.md
@@ -40,10 +40,16 @@ While making your contract, it is likely that you will want to query information
-
+ start="1" end="29" />
+
+
+
@@ -65,10 +71,16 @@ Calling another contract passing information is also a common scenario. Below yo
-
+ start="1" end="29" />
+
+
+
@@ -117,7 +129,7 @@ To create a cross-contract call with a callback, create two promises and use the
- There is a helper macro that allows you to make cross-contract calls with the syntax `#[ext_contract(...)]`. It takes a Rust Trait and converts it to a module with static methods. Each of these static methods takes positional arguments defined by the Trait, then the `receiver_id`, the attached deposit and the amount of gas and returns a new `Promise`.
+ There is a helper macro that allows you to make cross-contract calls with the syntax `#[ext_contract(...)]`. It takes a Rust Trait and converts it to a module with static methods. Each of these static methods takes positional arguments defined by the Trait, then the `receiver_id`, the attached deposit and the amount of gas and returns a new `Promise`. *That's the high-level way to make cross-contract calls.*
```rust
#[ext_contract(external_trait)]
@@ -139,6 +151,31 @@ To create a cross-contract call with a callback, create two promises and use the
```
+
+
+ There is another way to achieve the same result. You can create a new `Promise` without using a helper macro. *It's the low-level way to make cross-contract calls.*
+
+ ```rust
+ let arguments = json!({ "foo": "bar" })
+ .to_string()
+ .into_bytes();
+
+ let promise = Promise::new("external_address").function_call(
+ "function_name".to_owned(),
+ arguments,
+ DEPOSIT,
+ GAS
+ );
+
+ promise.then(
+ // Create a promise to callback query_greeting_callback
+ Self::ext(env::current_account_id())
+ .with_static_gas(GAS)
+ .callback_name(),
+ );
+
+ ```
+
Gas
@@ -179,9 +216,9 @@ In the callback function you will have access to the result, which will contain
-
+
@@ -247,14 +284,14 @@ An important property of batch calls is that they **act as a unit**: they execut
+ start="5" end="17" />
+ start="8" end="20" />
From 0728315bbbd7ff793b94f76bad28a371fe7f975f Mon Sep 17 00:00:00 2001
From: Guille
Date: Wed, 11 Dec 2024 20:44:32 +0100
Subject: [PATCH 13/35] Update Algolia Public Key
---
website/docusaurus.config.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js
index 6f799a78148..565bd570106 100644
--- a/website/docusaurus.config.js
+++ b/website/docusaurus.config.js
@@ -247,7 +247,7 @@ const config = {
// The application ID provided by Algolia
appId: '0LUM67N2P2',
// Public API key: it is safe to commit it
- apiKey: '50a400220b38e2d4bef996c7d0ed4b90',
+ apiKey: '41e2feb6ffa0d3450ca9d0a0c1826c1c',
indexName: 'near',
// Optional: see doc section below
contextualSearch: true,
From 70e394fcc544412371f5a659e651c1339f7aa153 Mon Sep 17 00:00:00 2001
From: "Hoa \"Rin\" Nguyen"
Date: Fri, 13 Dec 2024 04:17:34 +1100
Subject: [PATCH 14/35] Fix typo functions.md (#2367)
---
docs/2.build/2.smart-contracts/anatomy/functions.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/2.build/2.smart-contracts/anatomy/functions.md b/docs/2.build/2.smart-contracts/anatomy/functions.md
index 60fd134ad7c..bdc29b2cd1c 100644
--- a/docs/2.build/2.smart-contracts/anatomy/functions.md
+++ b/docs/2.build/2.smart-contracts/anatomy/functions.md
@@ -132,7 +132,7 @@ These functions are marked as `private` in the contract's code, and can only be
#### `decorator({privateFunction: true})`
-Private functions are marked by setting `privateFunction: true` in the `@call` or `@initialization` decorators.
+Private functions are marked by setting `privateFunction: true` in the `@call` or `@initialize` decorators.
From f5c0d233f93bfe2170a6a7ccc14f152af1047a1a Mon Sep 17 00:00:00 2001
From: omahs <73983677+omahs@users.noreply.github.com>
Date: Fri, 20 Dec 2024 22:09:40 +0100
Subject: [PATCH 15/35] Fix typos (#2383)
* fix typos
---
.../crosswords/03-intermediate/01-access-key-solution.md | 4 ++--
docs/3.tutorials/nfts/4-core.md | 4 ++--
docs/5.api/rpc/transactions.md | 2 +-
docs/help.md | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/docs/3.tutorials/crosswords/03-intermediate/01-access-key-solution.md b/docs/3.tutorials/crosswords/03-intermediate/01-access-key-solution.md
index ebafb205977..735a0ff9f9e 100644
--- a/docs/3.tutorials/crosswords/03-intermediate/01-access-key-solution.md
+++ b/docs/3.tutorials/crosswords/03-intermediate/01-access-key-solution.md
@@ -31,7 +31,7 @@ There have been several incidents of this and it continues to be an issue.
## How?
-We're doing to do something unique β and frankly unusual β with our crossword puzzle. We're going to use function-call access keys in a new way.
+We're going to do something unique β and frankly unusual β with our crossword puzzle. We're going to use function-call access keys in a new way.
Our crossword puzzle smart contract will add a function-call access key to itself. The private key is derived from the solution, used as a seed phrase.
@@ -45,7 +45,7 @@ A seed phrase is a series of words (usually 12 or 24 words) that create a privat
Seed phrases typically use a [BIP-30 wordlist](https://github.com/bitcoin/bips/blob/master/bip-0039/bip-0039-wordlists.md), but *they do not need to* use a wordlist or have a certain number of words. As long as the words create entropy, a crossword puzzle solution can act as a deterministic seed phrase.
:::
-So when we add a new puzzle, we'll use the `AddKey` Action to add a limited, function-call access key can that *only* call the `submit_solution` method.
+So when we add a new puzzle, we'll use the `AddKey` Action to add a limited, function-call access key that can *only* call the `submit_solution` method.
The first user to solve the puzzle will essentially "discover" the private key and call that method. Think of it like a safe that contains a function-call access key.
diff --git a/docs/3.tutorials/nfts/4-core.md b/docs/3.tutorials/nfts/4-core.md
index da3201a57bc..56970e90b86 100644
--- a/docs/3.tutorials/nfts/4-core.md
+++ b/docs/3.tutorials/nfts/4-core.md
@@ -126,11 +126,11 @@ This way, we can effectively **attach an NFT to a function call**.
The function will first assert that the caller attached exactly 1 yocto for security purposes. It will then transfer the NFT using `internal_transfer` and start the cross contract call. It will call the method `nft_on_transfer` on the `receiver_id`'s contract, and create a promise to call back `nft_resolve_transfer` with the result. This is a very common workflow when dealing with [cross contract calls](../../2.build/2.smart-contracts/anatomy/crosscontract.md).
-As dictated by the core standard, the function we are calling (`nft_on_transfer`) needs to return a boolean stating whether or not you should return the NFT to it's original owner.
+As dictated by the core standard, the function we are calling (`nft_on_transfer`) needs to return a boolean stating whether or not you should return the NFT to its original owner.
-If `nft_on_transfer` returned true or the called failed, you should send the token back to it's original owner. On the contrary, if false was returned, no extra logic is needed.
+If `nft_on_transfer` returned true or the called failed, you should send the token back to its original owner. On the contrary, if false was returned, no extra logic is needed.
As for the return value of our function `nft_resolve_transfer`, the standard dictates that the function should return a boolean indicating whether or not the receiver successfully received the token or not.
diff --git a/docs/5.api/rpc/transactions.md b/docs/5.api/rpc/transactions.md
index 8bd08b2e0ef..d0f509b2557 100644
--- a/docs/5.api/rpc/transactions.md
+++ b/docs/5.api/rpc/transactions.md
@@ -877,7 +877,7 @@ Here is the exhaustive list of the error variants that can be returned by `EXPER
### Receipt by ID {#receipt-by-id}
-> Fetches a receipt by it's ID (as is, without a status or execution outcome)
+> Fetches a receipt by its ID (as is, without a status or execution outcome)
- method: `EXPERIMENTAL_receipt`
- params:
diff --git a/docs/help.md b/docs/help.md
index a2d8739edc9..c4b741d670b 100644
--- a/docs/help.md
+++ b/docs/help.md
@@ -110,7 +110,7 @@ These community groups are part of the 31 chats from [nearbuilders.com](https://
### π Decentralized Frontend Stack
-> Create decentralized frontend components by storing it's source code on the blockchain π€―.
+> Create decentralized frontend components by storing its source code on the blockchain π€―.
| Name | Description | Repo | Latest Release |
| ----------- | ----------- | --- |--|
From eb98f4ac482362f00e9d86ac0700633aac591c3f Mon Sep 17 00:00:00 2001
From: Dmitry <98899785+mdqst@users.noreply.github.com>
Date: Sat, 21 Dec 2024 20:12:55 +0300
Subject: [PATCH 16/35] docs: fixed name of the API Update
bos-ethersjs-best-practices.md (#2384)
---
docs/3.tutorials/near-components/bos-ethersjs-best-practices.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/3.tutorials/near-components/bos-ethersjs-best-practices.md b/docs/3.tutorials/near-components/bos-ethersjs-best-practices.md
index e63067a91ed..f455166d660 100644
--- a/docs/3.tutorials/near-components/bos-ethersjs-best-practices.md
+++ b/docs/3.tutorials/near-components/bos-ethersjs-best-practices.md
@@ -156,7 +156,7 @@ const loadTokensData = () => {
});
tokens.map((tokenId) => {
- const tokenData = loadCoingeckData(tokenId);
+ const tokenData = loadCoingeckoData(tokenId);
// save balance of every token to the state
State.update({ [tokenId]: { ...tokenData, ...state[tokenId] } });
});
From c4745d66830af2983e0852bfb0d32a5063ab7d1c Mon Sep 17 00:00:00 2001
From: Dmitry <98899785+mdqst@users.noreply.github.com>
Date: Sat, 21 Dec 2024 20:49:34 +0300
Subject: [PATCH 17/35] docs: fix typo Update validators.md (#2385)
---
docs/1.concepts/basics/validators.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/1.concepts/basics/validators.md b/docs/1.concepts/basics/validators.md
index 4d4c1686015..6fdf9ab42c1 100644
--- a/docs/1.concepts/basics/validators.md
+++ b/docs/1.concepts/basics/validators.md
@@ -39,7 +39,7 @@ You can view the list of currently active validators on platforms like [NEAR-STA
We don't need GPU support as we are a POS chain and we require very little compute power.
-You can read more about our consensus strategy on our Validator Quickstart and Staking FA.
+You can read more about our consensus strategy on our Validator Quickstart and Staking FAQ.
## Block & Chunk producers
From cb41f562fdb5086fa4acc71d226d4c613d2aa4dc Mon Sep 17 00:00:00 2001
From: Dmitry <98899785+mdqst@users.noreply.github.com>
Date: Sun, 22 Dec 2024 00:41:07 +0300
Subject: [PATCH 18/35] docs: fix typo Update chain-signatures.md (#2386)
---
.../1.chain-abstraction/chain-signatures/chain-signatures.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/2.build/1.chain-abstraction/chain-signatures/chain-signatures.md b/docs/2.build/1.chain-abstraction/chain-signatures/chain-signatures.md
index 0420319a862..231b93238b1 100644
--- a/docs/2.build/1.chain-abstraction/chain-signatures/chain-signatures.md
+++ b/docs/2.build/1.chain-abstraction/chain-signatures/chain-signatures.md
@@ -59,7 +59,7 @@ Chain Signatures use [`derivation paths`](/concepts/abstraction/chain-signatures
- The NEAR address (e.g., `example.near`, `example.testnet`, etc.)
- A derivation path (a string such as `ethereum-1`, `ethereum-2`, etc.)
-- The MPC service's public key (see the tip bellow for the MPC service public keys)
+- The MPC service's public key (see the tip below for the MPC service public keys)
We provide code to derive the address, as it's a complex process that involves multiple steps of hashing and encoding:
From 36a29543e822fb74e288ab6bb15ff935e68c91aa Mon Sep 17 00:00:00 2001
From: wizard <112275929+famouswizard@users.noreply.github.com>
Date: Sun, 22 Dec 2024 00:41:38 +0300
Subject: [PATCH 19/35] typo fix Update quickstart.md (#2387)
---
docs/2.build/2.smart-contracts/quickstart.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/2.build/2.smart-contracts/quickstart.md b/docs/2.build/2.smart-contracts/quickstart.md
index f1ca02128fb..94d9d5dcb6f 100644
--- a/docs/2.build/2.smart-contracts/quickstart.md
+++ b/docs/2.build/2.smart-contracts/quickstart.md
@@ -95,7 +95,7 @@ _Creating a project using `create-near-app`_
This will generate a project with the following structure:
```bash
-βββ sandbox-test # sanbox testing
+βββ sandbox-test # sandbox testing
β βββ main.ava.js
βββ src # contract's code
β βββ contract.ts
From 28ff3fedc85629ad7755248e2b86cb1a6daa1283 Mon Sep 17 00:00:00 2001
From: Lyudmil Ivanov <55487633+flmel@users.noreply.github.com>
Date: Mon, 23 Dec 2024 15:20:10 +0200
Subject: [PATCH 20/35] chore: update commands to latest cargo-near (#2390)
---
docs/2.build/2.smart-contracts/quickstart.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/2.build/2.smart-contracts/quickstart.md b/docs/2.build/2.smart-contracts/quickstart.md
index 94d9d5dcb6f..f601615290c 100644
--- a/docs/2.build/2.smart-contracts/quickstart.md
+++ b/docs/2.build/2.smart-contracts/quickstart.md
@@ -289,7 +289,7 @@ When you are ready to create a build of the contract run a one-line command depe
:::info
- If you encounter issues with Docker you can use the `--no-docker` flag to skip creating a reproducible build
+ If you encounter issues with Docker you can use the `non-reproducible-wasm` option to skip creating a reproducible build
:::
@@ -319,7 +319,7 @@ Having our account created, we can now deploy the contract:
```bash
- near contract deploy use-file ./target/wasm32-unknown-unknown/release/hello.wasm without-init-call network-config testnet sign-with-keychain send
+ near contract deploy use-file ./target/near/hello.wasm without-init-call network-config testnet sign-with-keychain send
```
@@ -334,7 +334,7 @@ Having our account created, we can now deploy the contract:
```bash
- near deploy ./target/wasm32-unknown-unknown/release/.wasm
+ near deploy ./target/near/.wasm
```
@@ -342,7 +342,7 @@ Having our account created, we can now deploy the contract:
```bash
- near contract deploy use-file ./target/wasm32-unknown-unknown/release/.wasm without-init-call network-config testnet sign-with-keychain send
+ near contract deploy use-file ./target/near/.wasm without-init-call network-config testnet sign-with-keychain send
```
From 0fd673b315bc1d6ceb218a6ca45836df01725bec Mon Sep 17 00:00:00 2001
From: Amira Nasri
Date: Mon, 30 Dec 2024 17:37:00 +0100
Subject: [PATCH 21/35] Replace --amount with --deposit (#2399)
* fix--amount
* Apply suggestions from code review
---------
Co-authored-by: Guille
---
docs/3.tutorials/auction/1.3-deploy.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/3.tutorials/auction/1.3-deploy.md b/docs/3.tutorials/auction/1.3-deploy.md
index 5bac133dbae..a8c6f365830 100644
--- a/docs/3.tutorials/auction/1.3-deploy.md
+++ b/docs/3.tutorials/auction/1.3-deploy.md
@@ -114,7 +114,7 @@ We are now ready to start bidding by calling the `bid` function on the contract.
```bash
# call the contract to bid
-near call bid --accountId --amount 1
+near call bid --accountId --depositYocto 1
# get the highest bid
near view get_highest_bid
From a64f6b096591bb7a8fa07ec935f8d7b1f77eae66 Mon Sep 17 00:00:00 2001
From: Dmitry <98899785+mdqst@users.noreply.github.com>
Date: Mon, 30 Dec 2024 23:31:33 +0300
Subject: [PATCH 22/35] docs: Fixed grammar issue in Hue account creation
instructions (#2389)
---
docs/pagoda/alerts/webhooks.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/pagoda/alerts/webhooks.md b/docs/pagoda/alerts/webhooks.md
index 61c82ebc2dc..b854819f359 100644
--- a/docs/pagoda/alerts/webhooks.md
+++ b/docs/pagoda/alerts/webhooks.md
@@ -108,7 +108,7 @@ Select Turn On Lights
Select the lights of your choosing but I will simply do all lights.
-If you haven't already create and connect your Hue Account
+If you haven't already created and connected your Hue Account
From ba9c84102fbfe93c44b512b22b29e361e41513f3 Mon Sep 17 00:00:00 2001
From: Guille
Date: Tue, 31 Dec 2024 10:40:23 +0100
Subject: [PATCH 23/35] Fixed deposit parameter (#2401)
---
docs/3.tutorials/auction/1.3-deploy.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/3.tutorials/auction/1.3-deploy.md b/docs/3.tutorials/auction/1.3-deploy.md
index a8c6f365830..d6cc7234e24 100644
--- a/docs/3.tutorials/auction/1.3-deploy.md
+++ b/docs/3.tutorials/auction/1.3-deploy.md
@@ -114,7 +114,7 @@ We are now ready to start bidding by calling the `bid` function on the contract.
```bash
# call the contract to bid
-near call bid --accountId --depositYocto 1
+near call bid --accountId --deposit 1
# get the highest bid
near view get_highest_bid
@@ -138,4 +138,4 @@ Do not use testnet as your **only way** to test contracts. Always test your cont
Generally, you will use the CLI only to deploy and initialize the contract. Afterward, all interactions will be made from a frontend. This is why in the [next section](./2.1-frontend.md) we'll move on to creating a frontend to interact with the contract.
-:::
\ No newline at end of file
+:::
From 704e759a666da44be1593ea3d0d12213c24c1985 Mon Sep 17 00:00:00 2001
From: Wenderson Pires
Date: Thu, 2 Jan 2025 06:57:13 -0300
Subject: [PATCH 24/35] Update backend.md (#2402)
- Add `Payload` class and `payloadSchema` object for clarification;
- Add a better explanation of the type for `payloadSchema.callbackUrl` and why the payloadSchema needs a `tag` prop.
---
docs/2.build/4.web3-apps/backend/backend.md | 23 +++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/docs/2.build/4.web3-apps/backend/backend.md b/docs/2.build/4.web3-apps/backend/backend.md
index 5101ed6933e..ef5478b45a0 100644
--- a/docs/2.build/4.web3-apps/backend/backend.md
+++ b/docs/2.build/4.web3-apps/backend/backend.md
@@ -64,6 +64,29 @@ Once the user has signed the challenge, the wallet will call the `callbackUrl` w
const naj = require('near-api-js')
const js_sha256 = require("js-sha256")
+class Payload {
+ constructor({ message, nonce, recipient, callbackUrl }) {
+ // The tag's value is a hardcoded value as per
+ // defined in the NEP [NEP413](https://github.com/near/NEPs/blob/master/neps/nep-0413.md)
+ this.tag = 2147484061;
+ this.message = message;
+ this.nonce = nonce;
+ this.recipient = recipient;
+ if (callbackUrl) { this.callbackUrl = callbackUrl }
+ }
+}
+
+const payloadSchema = {
+ struct: {
+ tag: "u32",
+ message: "string",
+ nonce: { array: { type: "u8", len: 32 } },
+ recipient: "string",
+ // Must be of type { option: "string" }
+ callbackUrl: { option: "string" },
+ },
+ };
+
export async function authenticate({ accountId, publicKey, signature }) {
// A user is correctly authenticated if:
// - The key used to sign belongs to the user and is a Full Access Key
From f3dddd510d30989876e4a33a023d7612ab62dafe Mon Sep 17 00:00:00 2001
From: garikbesson
Date: Thu, 2 Jan 2025 18:01:44 +0300
Subject: [PATCH 25/35] NEAR API section (ex. JavaScript API) (#2251)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* js + rust overview
* minor improvements
* style fixes
* add most of rust
* api additions
* quick fix
* swapping to code snippets
* complete rust + javascript api docs
* change sidebars
* fix links
* fix: minor fixes
* New NEAR API section - Python examples (#2358)
* feat(near-api/python): Install, account and utilities examples
* feat(near-api/python): Missing examples added
* fix: added snippet for python
---------
Co-authored-by: gagdiez
Co-authored-by: DamiΓ‘n Parrino
Co-authored-by: Lyudmil Ivanov <55487633+flmel@users.noreply.github.com>
Co-authored-by: PiVortex
Co-authored-by: Guillermo Alejandro Gallardo Diez
Co-authored-by: Reza Rahemtola <49811529+RezaRahemtola@users.noreply.github.com>
---
.../2.smart-contracts/release/upgrade.md | 4 +-
docs/2.build/4.web3-apps/frontend.md | 4 +-
docs/4.tools/near-api-js/cookbook.md | 26 -
docs/4.tools/near-api-js/faq.md | 434 --------
docs/4.tools/near-api-js/naj-account.md | 160 ---
docs/4.tools/near-api-js/naj-contract.md | 128 ---
docs/4.tools/near-api-js/naj-utils.md | 27 -
docs/4.tools/near-api-js/naj-wallet.md | 140 ---
docs/4.tools/near-api-js/quick-reference.md | 258 -----
docs/4.tools/near-api.md | 990 ++++++++++++++++++
docs/5.api/rpc/providers.md | 2 +-
website/docusaurus.config.js | 2 +-
website/sidebars.js | 23 +-
13 files changed, 997 insertions(+), 1201 deletions(-)
delete mode 100644 docs/4.tools/near-api-js/cookbook.md
delete mode 100644 docs/4.tools/near-api-js/faq.md
delete mode 100644 docs/4.tools/near-api-js/naj-account.md
delete mode 100644 docs/4.tools/near-api-js/naj-contract.md
delete mode 100644 docs/4.tools/near-api-js/naj-utils.md
delete mode 100644 docs/4.tools/near-api-js/naj-wallet.md
delete mode 100644 docs/4.tools/near-api-js/quick-reference.md
create mode 100644 docs/4.tools/near-api.md
diff --git a/docs/2.build/2.smart-contracts/release/upgrade.md b/docs/2.build/2.smart-contracts/release/upgrade.md
index 28b3db0c8b2..ece58a4914a 100644
--- a/docs/2.build/2.smart-contracts/release/upgrade.md
+++ b/docs/2.build/2.smart-contracts/release/upgrade.md
@@ -11,8 +11,8 @@ allowing the code to be changed.
Contract's can be updated in two ways:
-1. **Through tools** such as [NEAR CLI](../../../4.tools/cli.md) or
- [near-api-js](../../../4.tools/near-api-js/quick-reference.md) (if you hold
+1. **Through tools** such as [NEAR CLI](../../../4.tools/cli.md) or the
+ [NEAR API](../../../4.tools/near-api.md) (if you hold
the account's
[full access key](../../../1.concepts/protocol/access-keys.md)).
2. **Programmatically**, by implementing a method that
diff --git a/docs/2.build/4.web3-apps/frontend.md b/docs/2.build/4.web3-apps/frontend.md
index b4e27a0ea33..2fae10c11cc 100644
--- a/docs/2.build/4.web3-apps/frontend.md
+++ b/docs/2.build/4.web3-apps/frontend.md
@@ -29,12 +29,12 @@ While your user interface layer will remain centralized, the backend layerβinc
When building a frontend that can connect with the NEAR blockchain using standard web2 tooling will require you to import two dependencies:
-- [NEAR API JS](../../4.tools/near-api-js/quick-reference.md) - A JavaScript API tool that allows frontend clients the ability to view and retrieve data directly from the blockchain.
+- [NEAR API JS](../../4.tools/near-api.md) - A JavaScript API tool that allows frontend clients the ability to view and retrieve data directly from the blockchain.
- [Wallet Selector](../../4.tools/wallet-selector.md) - Wallet integration tool allowing developers to choose which wallets are supported and allows users to choose which wallet they would like to connect with.
:::tip
-[Checkout this article](integrate-contracts.md) to learn how to integrate smart contracts to your frontend, using [Wallet Selector](../../4.tools/wallet-selector.md) and [NEAR API JS](../../4.tools/near-api-js/quick-reference.md).
+[Checkout this article](integrate-contracts.md) to learn how to integrate smart contracts to your frontend, using [Wallet Selector](../../4.tools/wallet-selector.md) and [NEAR API JS](../../4.tools/near-api.md).
:::
diff --git a/docs/4.tools/near-api-js/cookbook.md b/docs/4.tools/near-api-js/cookbook.md
deleted file mode 100644
index b13a4c7e1c7..00000000000
--- a/docs/4.tools/near-api-js/cookbook.md
+++ /dev/null
@@ -1,26 +0,0 @@
----
-id: cookbook
-title: Common Use Cases
-sidebar_label: Cookbook
----
-
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-
-The repository contains [many recipes](https://github.com/near/near-api-js/blob/master/packages/cookbook) that you can readily use to solve common case scenarios.
-
-| Name | Description |
-|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ----------------------------------------------------------------------------------------------------------- |
-| **ACCOUNTS** | |
-| [Create Account](https://github.com/near/near-api-js/blob/master/packages/cookbook/accounts/create-testnet-account.js) | Create [NEAR accounts](/concepts/protocol/account-model) without using NEAR Wallet. |
-| [Access Key Rotation](https://github.com/near/near-api-js/tree/master/packages/cookbook/accounts/access-keys) | Create and delete [access keys](/concepts/protocol/access-keys) for added security. |
-| **TRANSACTIONS** | |
-| [Get Transaction Status](https://github.com/near/near-api-js/blob/master/packages/cookbook/transactions/get-tx-status.ts) | Gets transaction status using a tx hash and associated account/contract ID. |
-| [Recent Transaction Details](https://github.com/near/near-api-js/blob/master/packages/cookbook/transactions/get-tx-detail.js) | Get recent transaction details without using an [indexing](/concepts/advanced/near-indexer-framework) service. |
-| [Batch Transactions](https://github.com/near/near-api-js/blob/master/packages/cookbook/transactions/batch-transactions.js) | Sign and send multiple [transactions](/concepts/protocol/transactions). |
-| **UTILS** | |
-| [Deploy Contract](https://github.com/near/near-api-js/blob/master/packages/cookbook/utils/deploy-contract.js) | Deploys a smart contract using a pre-compiled WASM file. |
-| [Calculate Gas](https://github.com/near/near-api-js/blob/master/packages/cookbook/utils/calculate-gas.js) | Calculate [gas burnt](/concepts/protocol/gas) from any contract call. |
-| [Read State w/o Account](https://github.com/near/near-api-js/blob/master/packages/cookbook/utils/get-state.js) | Read state of a contract without instantiating an account. |
-| [Wrap](https://github.com/near/near-api-js/blob/master/packages/cookbook/utils/wrap-near.js) & [Unwrap](https://github.com/near/near-api-js/blob/master/packages/cookbook/utils/unwrap-near.js) NEAR | Wrap and unwrap NEAR using the `wrap.near` smart contract. |
-| [Verify Signature](https://github.com/near/near-api-js/blob/master/packages/cookbook/utils/verify-signature.js) | Verify a key pair signature. |
diff --git a/docs/4.tools/near-api-js/faq.md b/docs/4.tools/near-api-js/faq.md
deleted file mode 100644
index 55647966db9..00000000000
--- a/docs/4.tools/near-api-js/faq.md
+++ /dev/null
@@ -1,434 +0,0 @@
----
-id: faq
-title: FAQ for NEAR JavaScript API
-sidebar_label: FAQ
----
-
-A collection of Frequently Asked Questions by the community.
-
-
-## General {#general}
-
-### Can I use `near-api-js` on a static html page? {#can-i-use-near-api-js-on-a-static-html-page}
-
-You can load the script from a CDN.
-
-```html
-
-```
-
-:::note
-Make sure you load the latest version.
-
-Versions list is on [npmjs.com](https://www.npmjs.com/package/near-api-js)
-:::
-
-
-Example Implementation
-
-
-```html
-
-
-
-
-
-
-
- Document
-
-
-
-
-
-
-
-
-
-
-
-```
-
-
-
-
----
-
-### What front-end frameworks can I use the JavaScript API with?
-
-The JavaScript API is framework-agnostic. You can include it in any front-end framework, such as React, Vue, Angular, and others.
-
-You can use [`create-near-app`](https://github.com/near/create-near-app) to quickly bootstrap projects with different templates:
-
- npx create-near-app
-
-### Can I use the JavaScript API with mobile JavaScript frameworks such as React Native?
-
-The JavaScript API can be used in most JavaScript runtimes, and under the hood, itβs an abstraction over NEARβs [RPC API](/api/rpc/introduction). However, notice that the Wallet canβt be used everywhere. For example, in React Native apps youβll be able to use the Wallet in web versions of the apps, but it wonβt work in the native app deployments.
-
-You can use the Wallet in `WebView` components in iOS or Android, however be aware that it uses `LocalStorage` for `KeyStore`, and itβs your responsibility to persist the storage when you manage loading of `WebView` components.
-
----
-
-## Transactions {#transactions}
-
-### How to check the status of transaction
-
-Please refer to examples about transactions in the [Cookbook](/tools/near-api-js/cookbook).
-
-### How transactions are signed and sent by near-api-js
-
-There are a few steps involved before transaction data is communicated to the network and eventually included in a block. The following steps are taken when creating, signing and ultimately a transaction from a user's account:
-
-1. The user creates a transaction object using the [`account.signAndSendTransaction` method](https://github.com/near/near-api-js/blob/f78616480ba84c73f681211fe6266bd2ed2b9da1/packages/near-api-js/src/account.ts#L200). This method accepts an array of actions and returns an object for the outcome of the transaction.
-2. The transaction is signed using the [`account.signTransaction` method](https://github.com/near/near-api-js/blob/f78616480ba84c73f681211fe6266bd2ed2b9da1/packages/near-api-js/src/account.ts#L204). This method accepts an array of actions and returns a signed transaction object.
-3. The signed transaction object is sent to the network using the [`account.connection.provider.sendTransaction` method](https://github.com/near/near-api-js/blob/f78616480ba84c73f681211fe6266bd2ed2b9da1/packages/near-api-js/src/account.ts#L208). This method accepts a signed transaction object and returns a transaction hash. This step [performs the borsh serialization of the transaction object](https://github.com/near/near-api-js/blob/f78616480ba84c73f681211fe6266bd2ed2b9da1/packages/near-api-js/src/providers/json-rpc-provider.ts#L80) and calls the [`broadcast_tx_commit` JSON RPC method with the serialized transaction object encoded in base64](https://github.com/near/near-api-js/blob/f78616480ba84c73f681211fe6266bd2ed2b9da1/packages/near-api-js/src/providers/json-rpc-provider.ts#L81).
-
-### How to send batch transactions
-
-You may batch send transactions by using the `signAndSendTransaction({})` method from `account`. This method takes an array of transaction actions, and if one fails, the entire operation will fail. Here's a simple example:
-
-```js
-const { connect, transactions, keyStores } = require("near-api-js");
-const fs = require("fs");
-const path = require("path");
-const homedir = require("os").homedir();
-
-const CREDENTIALS_DIR = ".near-credentials";
-const CONTRACT_NAME = "spf.idea404.testnet";
-const WASM_PATH = path.join(__dirname, "../build/uninitialized_nft.wasm");
-
-const credentialsPath = path.join(homedir, CREDENTIALS_DIR);
-const keyStore = new keyStores.UnencryptedFileSystemKeyStore(credentialsPath);
-
-const config = {
- keyStore,
- networkId: "testnet",
- nodeUrl: "https://rpc.testnet.near.org",
-};
-
-sendTransactions();
-
-async function sendTransactions() {
- const near = await connect({ ...config, keyStore });
- const account = await near.account(CONTRACT_NAME);
- const args = { some_field: 1, another_field: "hello" };
-
- const balanceBefore = await account.getAccountBalance();
- console.log("Balance before:", balanceBefore);
-
- try {
- const result = await account.signAndSendTransaction({
- receiverId: CONTRACT_NAME,
- actions: [
- transactions.deployContract(fs.readFileSync(WASM_PATH)), // Contract does not get deployed
- transactions.functionCall("new", Buffer.from(JSON.stringify(args)), 10000000000000, "0"), // this call fails
- transactions.transfer("1" + "0".repeat(24)), // 1 NEAR is not transferred either
- ],
- });
- console.log(result);
- } catch (e) {
- console.log("Error:", e);
- }
-
- const balanceAfter = await account.getAccountBalance();
- console.log("Balance after:", balanceAfter);
-}
-```
-
-```
-Balance before: {
- total: '49987878054959838200000000',
- stateStaked: '4555390000000000000000000',
- staked: '0',
- available: '45432488054959838200000000'
-}
-Receipts: 2PPueY6gnA4YmmQUzc8DytNBp4PUpgTDhmEjRSHHVHBd, 3isLCW9SBH1MrPjeEPAmG9saHLj9Z2g7HxzfBdHmaSaG
- Failure [spf.idea404.testnet]: Error: {"index":1,"kind":{"ExecutionError":"Smart contract panicked: panicked at 'Failed to deserialize input from JSON.: Error(\"missing field `owner_id`\", line: 1, column: 40)', nft/src/lib.rs:47:1"}}
-Error: ServerTransactionError: {"index":1,"kind":{"ExecutionError":"Smart contract panicked: panicked at 'Failed to deserialize input from JSON.: Error(\"missing field `owner_id`\", line: 1, column: 40)', nft/src/lib.rs:47:1"}}
- at parseResultError (/Users/dennis/Code/naj-test/node_modules/near-api-js/lib/utils/rpc_errors.js:31:29)
- at Account. (/Users/dennis/Code/naj-test/node_modules/near-api-js/lib/account.js:156:61)
- at Generator.next ()
- at fulfilled (/Users/dennis/Code/naj-test/node_modules/near-api-js/lib/account.js:5:58)
- at processTicksAndRejections (node:internal/process/task_queues:96:5) {
- type: 'FunctionCallError',
- context: undefined,
- index: 1,
- kind: {
- ExecutionError: 'Smart contract panicked: panicked at \'Failed to deserialize input from JSON.: Error("missing field `owner_id`", line: 1, column: 40)\', nft/src/lib.rs:47:1'
- },
- transaction_outcome: {
- block_hash: '5SUhYcXjXR1svCxL5BhCuw88XNdEjKXqWgA9X4XZW1dW',
- id: 'SKQqAgnSN27fyHpncaX3fCUxWknBrMtxxytWLRDQfT3',
- outcome: {
- executor_id: 'spf.idea404.testnet',
- gas_burnt: 4839199843770,
- logs: [],
- metadata: [Object],
- receipt_ids: [Array],
- status: [Object],
- tokens_burnt: '483919984377000000000'
- },
- proof: [ [Object], [Object], [Object], [Object], [Object] ]
- }
-}
-Balance after: {
- total: '49985119959346682700000000',
- stateStaked: '4555390000000000000000000',
- staked: '0',
- available: '45429729959346682700000000'
-}
-
-```
-
-You may also find an example of batch transactions in the [Cookbook](/tools/near-api-js/cookbook).
-
----
-
-## Accounts {#accounts}
-
-### Whatβs the difference between `Account` and `ConnectedWalletAccount`?
-
-Interaction with the wallet is only possible in a web-browser environment because NEARβs Wallet is web-based.
-The difference between `Account` and `ConnectedWalletAccount` is mostly about the way it signs transactions. The `ConnectedWalletAccount` uses the wallet to approve transactions.
-Under the hood the `ConnectedWalletAccount` inherits and overrides some methods of `Account`.
-
-### How to create implicit accounts?
-
-You can read about it in the article about [Implicit Accounts](https://docs.near.org/integrations/implicit-accounts).
-
----
-
-## Contracts {#contracts}
-
-### How do I attach gas / a deposit? {#how-do-i-attach-gas--a-deposit}
-
-After [contract is instantiated](/tools/near-api-js/contract#load-contract) you can then call the contract and specify the amount of attached gas.
-
-```js
-await contract.method_name(
- {
- arg_name: "value", // argument name and value - pass empty object if no args required
- },
- "300000000000000", // attached GAS (optional)
- "1000000000000000000000000" // attached deposit in yoctoNEAR (optional)
-);
-```
-
----
-
-## Common Errors {#common-errors}
-
-### RPC Errors
-
-Refer to the exhaustive [list of error messages](https://github.com/near/near-api-js/blob/16ba17251ff7d9c8454261001cd6b87e9a994789/packages/near-api-js/src/res/error_messages.json)
-that RPC endpoints throws and JavaScript API propagates.
-
-### Missing contract methods {#missing-contract-method}
-
-When constructing a `Contract` instance on the client-side, you need to specify
-the contract's methods. If you misspell, mismatch, or miss method names - you'll
-receive errors about missing methods.
-
-There are a few cases of missing or wrong methods:
-- When you call a method you didn't specify in the constructor.
-- When you call a method that doesn't exist on the blockchain's contract (but you did specify it in the client-side constructor).
-- When you mismatch between `viewMethods` and `changeMethods`.
-
-For example, let's look at the following contract code.
-It contains one `view` and one `call` method:
-
-```js
-@NearBindgen
-class MyContract extends NearContract {
- constructor() { super(); }
-
- @view
- method_A_view(): string {
- return 'Hi';
- }
-
- @call
- method_B_call(): void {}
-}
-```
-
-#### Client-side errors for missing methods
-
-##### `TypeError: contract.METHOD_NAME is not a function`
-
-The following contract constructor declares only `method_A_view`, it doesn't declare `method_B_call`
-```js
-const contract = await new nearAPI.Contract(
- walletConnection.account(), 'guest-book.testnet',
- {
- viewMethods: ['method_A_view'], // <=== Notice this
- changeMethods: [], // <=== Notice this
- sender: walletConnection.getAccountId(),
- }
-);
-
-// This will work because we declared `method_A_view` in constructor
-await contract.method_A_view();
-
-// This will throw `TypeError: contract.method_B_call is not a function`
-// because we didn't declare `method_B_call` in constructor,
-// even if it exists in the real contract.
-await contract.method_B_call();
-
-// This will also throw `TypeError: contract.method_C is not a function`,
-// not because `method_C` doesn't exist on the contract, but because we didn't declare it
-// in the client-side constructor.
-await contract.method_C();
-```
-
-#### RPC errors for missing methods
-
-##### `wasm execution failed with error: FunctionCallError(MethodResolveError(MethodNotFound))`
-
-In this example we specify and call a method, but this method doesn't exist on the blockchain:
-```js
-const contract = await new nearAPI.Contract(
- // ...
- {
- viewMethods: ["method_C"], // <=== method_C doesn't exist on the contract above
- changeMethods: [],
- // ...
- }
-);
-// We did specify `method_C` name in constructor, so this function exists on client-side `contract` instance,
-// but a method with this name does not exist on the actual contract on the blockchain.
-// This will return an error from RPC call `FunctionCallError(MethodResolveError(MethodNotFound))`
-// and will throw it on the client-side
-await contract.method_C();
-
-// Notice: if we call `method_A_view` we get `TypeError: contract.method_A_view is not a function`.
-// Even though the method exists on the actual blockchain contract,
-// we didn't specify `method_A_view` in the contract's client-side constructor.
-await contract.method_A_view();
-```
-
-##### `wasm execution failed with error: FunctionCallError(HostError(ProhibitedInView { method_name: "storage_write" }))`
-
-Last case is when you mismatch `viewMethods` and `changeMethods`.
-
-In the contract above we declared:
-- A `@view` method named `method_A_view`
-- A `@call` method named `method_B_call`
-
-In a client-side constructor, the contract's `@view` method names must be specified under `viewMethods`,
-and the contract's `@call` method names must be specified under `changeMethods`.
-If we mismatch between the types we will receive errors.
-
-For example:
-```js
-const contract = await new nearAPI.Contract(
- // ...
- {
- viewMethods: ['method_B_call'], // <=== here should be `method_A_view`
- changeMethods: ['method_A_view'], // <=== and here should be `method_B_call`
- // ...
- }
-);
-
-// This will return an error from RPC call and throw:
-// `wasm execution failed with error: FunctionCallError(HostError(ProhibitedInView { method_name: "storage_write" }))`
-// This error indicates that we are trying to call a state-changing method but declare it as a read-only method in client-side.
-await contract.method_B_call();
-
-// The following behavior is undefined and might not work as expected.
-// `method_A_veiw` should be declared under `viewMethods` and in our example here we declare it under `changeMethods`.
-await contract.method_A_view();
-```
-
-### Class `{X}` is missing in schema: publicKey
-
-There is currently a known issue with the JavaScript API library, when you `import` it more than once
-it might cause a namespace collision.
-
-A temporary workaround: make sure you don't re-import it, for example when running tests.
-
----
-
-### `regeneratorRuntime` is not defined {#regeneratorruntime-is-not-defined}
-
-You are probably using [Parcel](https://parceljs.org/) like we do in [other examples](https://github.com/near-examples). Please make sure you have this line at the top of your main JS file. (Most likely `index.js`):
-
-```js
-import "regenerator-runtime/runtime";
-```
-
-- Also, ensure the dependencies for this are added to the project by checking the dev dependencies in your `package.json`. If not found you can install this by running the following in your terminal:
-
-```bash
-npm install regenerator-runtime --save-dev
-```
-
----
-
-### Window error using `Node.js` {#window-error-using-nodejs}
-
-You're maybe using a KeyStore that's for the browser. Instead, use a [filesystem key](/tools/near-api-js/quick-reference#key-store) or private key string.
-
-**Browser KeyStore:**
-
-```js
-const { keyStores } = require("near-api-js");
-const keyStore = new keyStores.BrowserLocalStorageKeyStore();
-```
-
-**FileSystem KeyStore:**
-
-```js
-const { keyStores } = require("near-api-js");
-const KEY_PATH = "~./near-credentials/testnet/example-account.json";
-const keyStore = new keyStores.UnencryptedFileSystemKeyStore(KEY_PATH);
-```
diff --git a/docs/4.tools/near-api-js/naj-account.md b/docs/4.tools/near-api-js/naj-account.md
deleted file mode 100644
index 8c762fcb23b..00000000000
--- a/docs/4.tools/near-api-js/naj-account.md
+++ /dev/null
@@ -1,160 +0,0 @@
----
-id: account
-title: Account
-sidebar_label: Account
----
-
-You can interact with, create or delete NEAR accounts.
-
-### Load Account {#load-account}
-
-This will return an Account object for you to interact with.
-
-```js
-const account = await nearConnection.account("example-account.testnet");
-```
-
-[ Class `Account`](https://near.github.io/near-api-js/classes/near_api_js.account.Account.html)
-
-### Create Account {#create-account}
-
-Create a sub-account.
-
-```js
-// creates a sub-account using funds from the account used to create it.
-const account = await nearConnection.account("example-account.testnet");
-await account.createAccount(
- "sub.example-account.testnet", // sub-account name
- "8hSHprDq2StXwMtNd43wDTXQYsjXcD4MJTXQYsjXcc", // public key for sub account
- "10000000000000000000" // initial balance for new account in yoctoNEAR
-);
-```
-
-[ Method `Account.createAccount`](https://near.github.io/near-api-js/classes/near_api_js.account.Account.html#createAccount)
-
-For creating .near or .testnet accounts please refer to the [cookbook](https://github.com/near/near-api-js/tree/master/packages/cookbook/accounts).
-
-### Delete Account {#delete-account}
-
-```js
-// deletes account found in the `account` object
-// transfers remaining account balance to the accountId passed as an argument
-const account = await nearConnection.account("example-account.testnet");
-await account.deleteAccount("beneficiary-account.testnet");
-```
-
-[ Method `Account.deleteAccount`](https://near.github.io/near-api-js/classes/near_api_js.account.Account.html#deleteAccount)
-
-### Get Account Balance {#get-account-balance}
-
-```js
-// gets account balance
-const account = await nearConnection.account("example-account.testnet");
-await account.getAccountBalance();
-```
-
-[ Method `Account.getAccountBalance`](https://near.github.io/near-api-js/classes/near_api_js.account.Account.html#getAccountBalance)
-
-### Get Account details {#get-account-details}
-
-Returns information about an account, such as authorized apps.
-
-```js
-// gets account details in terms of authorized apps and transactions
-const account = await nearConnection.account("example-account.testnet");
-await account.getAccountDetails();
-```
-
-[ Method `Account.getAccountDetails`](https://near.github.io/near-api-js/classes/near_api_js.account.Account.html#getAccountDetails)
-
-### Deploy a Contract {#deploy-a-contract}
-
-You can deploy a contract from a compiled WASM file. This returns an object with transaction and receipts outcomes and status.
-
-```js
-const account = await nearConnection.account("example-account.testnet");
-const transactionOutcome = await account.deployContract(
- fs.readFileSync("example-file.wasm")
-);
-```
-
-[ Method `Account.deployContract`](https://near.github.io/near-api-js/classes/near_api_js.account.Account.html#deployContract)
-
-[ Interface `FinalExecutionOutcome`](https://near.github.io/near-api-js/interfaces/_near_js_types.provider_response.FinalExecutionOutcome.html)
-
-### Send Tokens {#send-tokens}
-
-Transfer NEAR tokens between accounts. This returns an object with transaction and receipts outcomes and status.
-
-```js
-const account = await nearConnection.account("sender-account.testnet");
-await account.sendMoney(
- "receiver-account.testnet", // receiver account
- "1000000000000000000000000" // amount in yoctoNEAR
-);
-```
-
-[ Method `Account.sendMoney`](https://near.github.io/near-api-js/classes/near_api_js.account.Account.html#sendMoney)
-
-[ Interface `FinalExecutionOutcome`](https://near.github.io/near-api-js/interfaces/_near_js_types.provider_response.FinalExecutionOutcome.html)
-
-### State {#state}
-
-Get basic account information, such as amount of tokens the account has or the amount of storage it uses.
-
-```js
-const account = await nearConnection.account("example-account.testnet");
-const accountState = await account.state();
-```
-
-[ Method `Account.state`](https://near.github.io/near-api-js/classes/near_api_js.account.Account.html#state)
-
-[ Interface `AccountView`](https://near.github.io/near-api-js/interfaces/near_api_js.providers_provider.AccountView.html)
-
-### Access Keys {#access-keys}
-
-You can get and manage keys for an account.
-
-#### Add Full Access Key {#add-full-access-key}
-
-```js
-// takes public key as string for argument
-const account = await nearConnection.account("example-account.testnet");
-await account.addKey("8hSHprDq2StXwMtNd43wDTXQYsjXcD4MJTXQYsjXcc");
-```
-
-[ Method `Account.addKey`](https://near.github.io/near-api-js/classes/near_api_js.account.Account.html#addKey)
-
-#### Add Function Access Key {#add-function-access-key}
-
-```js
-const account = await nearConnection.account("example-account.testnet");
-await account.addKey(
- "8hSHprDq2StXwMtNd43wDTXQYsjXcD4MJTXQYsjXcc", // public key for new account
- "example-account.testnet", // contract this key is allowed to call (optional)
- "example_method", // methods this key is allowed to call (optional)
- "2500000000000" // allowance key can use to call methods (optional)
-);
-```
-
-[ Method `Account.addKey`](https://near.github.io/near-api-js/classes/near_api_js.account.Account.html#addKey)
-
-#### Get All Access Keys {#get-all-access-keys}
-
-```js
-const account = await nearConnection.account("example-account.testnet");
-await account.getAccessKeys();
-```
-
-[ Method `Account.getAccessKeys`](https://near.github.io/near-api-js/classes/near_api_js.account.Account.html#getAccessKeys)
-
-[ Interface `AccessKeyInfoView`](https://near.github.io/near-api-js/interfaces/near_api_js.providers_provider.AccessKeyInfoView.html)
-
-#### Delete Access Key {#delete-access-key}
-
-```js
-const account = await nearConnection.account("example-account.testnet");
-await account.deleteKey("8hSHprDq2StXwMtNd43wDTXQYsjXcD4MJTXQYsjXcc");
-```
-
-[ Method `Account.deleteKey`](https://near.github.io/near-api-js/classes/near_api_js.account.Account.html#deleteKey)
diff --git a/docs/4.tools/near-api-js/naj-contract.md b/docs/4.tools/near-api-js/naj-contract.md
deleted file mode 100644
index 60b2af055dc..00000000000
--- a/docs/4.tools/near-api-js/naj-contract.md
+++ /dev/null
@@ -1,128 +0,0 @@
----
-id: contract
-title: Contract
-sidebar_label: Contract
----
-
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-
-When you instantiate an instance of `Contract` you need to specify the names of the functions you have on your smart contract.
-Then the new instance of `Contract` will have methods with the same names as your smart contract functions.
-For example if you deployed a contract with `my_smart_contract_function` function on it, then this will work:
-
-```js
-const contract = new Contract(account, "example-contract.testnet", {
- changeMethods: ["my_smart_contract_function"], // your smart-contract has a function `my_smart_contract_function`
-});
-// `contract` object has `my_smart_contract_function` function on it:
-contract.my_smart_contract_function();
-```
-
-### Load Contract {#load-contract}
-
-
-
-
-```js
-const { Contract } = nearAPI;
-
-const contract = new Contract(
- account, // the account object that is connecting
- "example-contract.testnet",
- {
- // name of contract you're connecting to
- viewMethods: ["getMessages"], // view methods do not change state but usually return a value
- changeMethods: ["addMessage"], // change methods modify state
- }
-);
-```
-
-[ Class `Contract`](https://near.github.io/near-api-js/classes/_near_js_accounts.contract.Contract.html)
-
-
-
-
-```js
-const { Contract } = nearAPI;
-
-const contract = new Contract(
- wallet.account(), // the account object that is connecting
- "example-contract.testnet",
- {
- // name of contract you're connecting to
- viewMethods: ["getMessages"], // view methods do not change state but usually return a value
- changeMethods: ["addMessage"], // change methods modify state
- }
-);
-```
-
-[ Class `Contract`](https://near.github.io/near-api-js/classes/_near_js_accounts.contract.Contract.html)
-
-
-
-
-### Call Contract {#call-contract}
-
-
-
-
-```js
-const contract = new Contract(account, "example-contract.testnet", {
- changeMethods: ["method_name"],
-});
-await contract.method_name(
- {
- arg_name: "value", // argument name and value - pass empty object if no args required
- },
- "300000000000000", // attached GAS (optional)
- "1000000000000000000000000" // attached deposit in yoctoNEAR (optional)
-);
-```
-
-
-
-
-```js
-const contract = new Contract(account, "example-contract.testnet", {
- changeMethods: ["method_name"],
-});
-await contract.method_name({
- callbackUrl: "https://example.com/callback", // callbackUrl after the transaction approved (optional)
- meta: "some info", // meta information NEAR Wallet will send back to the application. `meta` will be attached to the `callbackUrl` as a url param
- args: {
- arg_name: "value", // argument name and value - pass empty object if no args required
- },
- gas: 300000000000000, // attached GAS (optional)
- amount: 1000000000000000000000000, // attached deposit in yoctoNEAR (optional)
-});
-```
-
-
-
-
-```js
-const contract = new Contract(account, "example-contract.testnet", {
- viewMethods: ["view_method_name"],
-});
-const response = await contract.view_method_name();
-```
-
-
-
-
-```js
-const contract = new Contract(account, "example-contract.testnet", {
- viewMethods: ["view_method_name"],
-});
-const response = await contract.view_method_name({ arg_name: "arg_value" });
-```
-
-
-
-
-[ Class `Contract`](https://near.github.io/near-api-js/classes/_near_js_accounts.contract.Contract.html)
-
-[//]: # "## Transactions {#transactions}"
-[//]: # "A [Transaction](/concepts/protocol/transactions) is a collection of Actions, and there are few types of Actions."
-[//]: # "For every type of Action there is a function on Account that you can use to invoke the Action, but Account also exposes `signAndSendTransaction` function which you can use to build and invoke a batch transaction."
diff --git a/docs/4.tools/near-api-js/naj-utils.md b/docs/4.tools/near-api-js/naj-utils.md
deleted file mode 100644
index e20f3a95177..00000000000
--- a/docs/4.tools/near-api-js/naj-utils.md
+++ /dev/null
@@ -1,27 +0,0 @@
----
-id: utils
-title: Utilities
-sidebar_label: Utilities
----
-
-### NEAR => yoctoNEAR {#near--yoctonear}
-
-```js
-// converts NEAR amount into yoctoNEAR (10^-24)
-
-const { utils } = nearAPI;
-const amountInYocto = utils.format.parseNearAmount("1");
-```
-
-[ Function `parseNearAmount`](https://near.github.io/near-api-js/functions/_near_js_utils.format.parseNearAmount.html)
-
-### YoctoNEAR => NEAR {#yoctonear--near}
-
-```js
-// converts yoctoNEAR (10^-24) amount into NEAR
-
-const { utils } = nearAPI;
-const amountInNEAR = utils.format.formatNearAmount("1000000000000000000000000");
-```
-
-[ Function `formatNearAmount`](https://near.github.io/near-api-js/functions/_near_js_utils.format.formatNearAmount.html)
diff --git a/docs/4.tools/near-api-js/naj-wallet.md b/docs/4.tools/near-api-js/naj-wallet.md
deleted file mode 100644
index 47355d83e88..00000000000
--- a/docs/4.tools/near-api-js/naj-wallet.md
+++ /dev/null
@@ -1,140 +0,0 @@
----
-id: wallet
-title: Interacting with the Wallet
-sidebar_label: Wallet
----
-
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-
-Wallet interaction is possible only in the browser, because NEAR's Wallet is web-based.
-
-Most frequent action is Sign In. Your user is redirected to the Wallet page to authorize your application.
-Once the user has Signed In, an access key is saved in browser's LocalStorage.
-All following actions that require the access key will be allowed.
-In case a user needs to authorize a transaction that has a deposit attached, your user will be automatically redirected to the Wallet again.
-
-### Creating Wallet Connection {#wallet-connection}
-
-In Wallet connection you use a LocalStorage [`KeyStore`](/tools/near-api-js/quick-reference#key-store).
-
-
-
-
-```js
-const { connect, keyStores, WalletConnection } = nearAPI;
-
-const connectionConfig = {
- networkId: "testnet",
- keyStore: new keyStores.BrowserLocalStorageKeyStore(),
- nodeUrl: "https://rpc.testnet.near.org",
- walletUrl: "https://testnet.mynearwallet.com/",
- helperUrl: "https://helper.testnet.near.org",
- explorerUrl: "https://testnet.nearblocks.io",
-};
-
-// connect to NEAR
-const nearConnection = await connect(connectionConfig);
-
-// create wallet connection
-// provide a prefix for the key
-const walletConnection = new WalletConnection(nearConnection, "example-prefix");
-```
-
-
-
-
-```js
-const { connect, keyStores, WalletConnection } = nearAPI;
-
-const connectionConfig = {
- networkId: "mainnet",
- keyStore: new keyStores.BrowserLocalStorageKeyStore(),
- nodeUrl: "https://rpc.mainnet.near.org",
- walletUrl: "https://wallet.mainnet.near.org",
- helperUrl: "https://helper.mainnet.near.org",
- explorerUrl: "https://nearblocks.io",
-};
-
-// connect to NEAR
-const nearConnection = await connect(connectionConfig);
-
-// create wallet connection
-const walletConnection = new WalletConnection(nearConnection);
-```
-
-
-
-
-
-[ Module `browserConnect`](https://near.github.io/near-api-js/modules/near_api_js.browserConnect.html)
-
-[ Class `WalletConnection`](https://near.github.io/near-api-js/classes/_near_js_wallet_account.walletAccount.WalletConnection.html)
-
-### Ask your user to Sign In {#sign-in}
-
-You first create a [WalletConnection](#wallet-connection), and then call `requestSignIn`.
-This will redirect the current page to the Wallet authentication page. You can optionally configure success and failure redirect URLs.
-
-When you create a wallet connection you have the option to create a [function call access key](/concepts/protocol/access-keys#function-call-keys) for a specific contract to be used by your application. This allows the app to automatically sign `non-payable methods` for the user without having to sign each transaction manually in the wallet. You can also decide to specify a list of `methodNames` that will restrict the key to sign only certain methods on the specified contract. Passing an empty array will allow all methods to be signed.
-
-```js
-// const walletConnection = new WalletConnection(nearConnection);
-// all parameters are optional
-walletConnection.requestSignIn({
- contractId: "example-contract.testnet.REPLACE_ME", // optional
- methodNames: [], // optional
- successUrl: "REPLACE_ME://.com/success", // optional redirect URL on success
- failureUrl: "REPLACE_ME://.com/failure", // optional redirect URL on failure
-});
-```
-
-[ Method `WalletConnection.requestSignIn`](https://near.github.io/near-api-js/classes/_near_js_wallet_account.walletAccount.WalletConnection.html#requestSignIn)
-
-:::tip
-Sign In is **_not required_** if you are using an alternative key store to local storage, or you are not signing transactions (meaning - you are only calling read-only _view_ methods on a contract)
-:::
-
-### Sign Out your user {#sign-out}
-
-```js
-// const walletConnection = new WalletConnection(nearConnection);
-walletConnection.signOut();
-```
-
-[ Method `WalletConnection.signOut`](https://near.github.io/near-api-js/classes/_near_js_wallet_account.walletAccount.WalletConnection.html#signOut)
-
-### Check if Signed In {#check-if-signed-in}
-
-```js
-// const walletConnection = new WalletConnection(nearConnection);
-if (walletConnection.isSignedIn()) {
- // user is signed in
-}
-```
-
-[ Method `WalletConnection.isSignedId`](https://near.github.io/near-api-js/classes/_near_js_wallet_account.walletAccount.WalletConnection.html#isSignedIn)
-
-### Get Wallet Account {#get-authorized-account}
-
-Get the [Account](naj-account.md) your user has signed in with in the Wallet.
-
-#### Get Account ID (as string) {#get-authorized-account-id}
-
-```js
-// const walletConnection = new WalletConnection(nearConnection);
-const walletAccountId = walletConnection.getAccountId();
-```
-
-[ Method `WalletConnection.getAccountId`](https://near.github.io/near-api-js/classes/_near_js_wallet_account.walletAccount.WalletConnection.html#getAccountId)
-
-#### Get Account Object {#get-authorized-account-object}
-
-```js
-// const walletConnection = new WalletConnection(nearConnection);
-const walletAccountObj = walletConnection.account();
-```
-
-[ Method `WalletConnection.account`](https://near.github.io/near-api-js/classes/_near_js_wallet_account.walletAccount.WalletConnection.html#account)
-
-[ Class `ConnectedWalletAccount`](https://near.github.io/near-api-js/classes/_near_js_wallet_account.walletAccount.ConnectedWalletAccount.html)
diff --git a/docs/4.tools/near-api-js/quick-reference.md b/docs/4.tools/near-api-js/quick-reference.md
deleted file mode 100644
index d8de49d4789..00000000000
--- a/docs/4.tools/near-api-js/quick-reference.md
+++ /dev/null
@@ -1,258 +0,0 @@
----
-id: quick-reference
-title: Using JavaScript API to interact with NEAR
-sidebar_label: Using JavaScript API
----
-
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-
-## Quick Reference
-
-- [Installation](#install)
-- [Interacting with the Wallet](naj-wallet.md)
-- [Accounts](naj-account.md)
-- [Contracts](naj-contract.md)
-- [Utilities](naj-utils.md)
-
-## What is `near-api-js`
-
-`near-api-js` is a complete library to interact with the NEAR blockchain. You can use it in the browser, or in Node.js runtime.
-
-You'll typically first create a connection to NEAR with [`connect`](#connect) using a [`KeyStore`](#key-store).
-With the connection object you now can:
-
-- Interact with the [Wallet](naj-wallet.md) in a browser.
-- Instantiate an [Account](naj-account.md) object to:
- - Send tokens
- - Deploy contracts
- - Inspect, create or delete accounts
- - Manage keys for accounts.
-- Instantiate a [Contract](naj-contract.md) object to call smart contract methods.
-
-The library also contains some [utility functions](naj-utils.md).
-
-:::tip
-To quickly get started with integrating NEAR in a web browser, read our [Web Frontend integration](/build/web3-apps/integrate-contracts) article.
-:::
-
-:::info
-Note the difference between `near-api-js` and `near-sdk-js`:
-
-The JavaScript _SDK_ is a library for developing smart contracts. It contains classes and functions you use to write your smart contract code.
-
-The JavaScript _API_ is a complete library for all possible commands to interact with NEAR. Itβs a wrapper for the RPC endpoints, a library to interact with NEAR Wallet in the browser, and a tool for keys management.
-:::
-
----
-
-## Install {#install}
-
-Include `near-api-js` as a dependency in your package.
-
-```bash
-npm i --save near-api-js
-```
-
-## Import {#import}
-
-You can use the API library in the browser, or in Node.js runtime. Some features are available only in one of the environments.
-For example, the `WalletConnection` is only for the browser, and there are different `KeyStore` providers for each environment.
-
-
-
-
-```js
-import * as nearAPI from "near-api-js";
-```
-
-
-
-
-```js
-const nearAPI = require("near-api-js");
-```
-
-
-
-
-## Key Store {#key-store}
-
-If you sign transactions, you need to create a _Key Store_. In the browser, the LocalStorage KeyStore will be used once you ask your user to Sign In with the Wallet.
-
-
-
-
-```js
-// creates keyStore using private key in local storage
-
-const { keyStores } = nearAPI;
-const myKeyStore = new keyStores.BrowserLocalStorageKeyStore();
-```
-
-[ Class `BrowserLocalStorageKeyStore`](https://near.github.io/near-api-js/classes/_near_js_keystores_browser.browser_local_storage_key_store.BrowserLocalStorageKeyStore.html)
-
-
-
-
-```js
-// creates a keyStore that searches for keys in .near-credentials
-// requires credentials stored locally by using a NEAR-CLI command: `near login`
-// https://docs.near.org/tools/cli#near-login
-
-const { keyStores } = nearAPI;
-const homedir = require("os").homedir();
-const CREDENTIALS_DIR = ".near-credentials";
-const credentialsPath = require("path").join(homedir, CREDENTIALS_DIR);
-const myKeyStore = new keyStores.UnencryptedFileSystemKeyStore(credentialsPath);
-```
-
-[ Class `UnencryptedFileSystemKeyStore`](https://near.github.io/near-api-js/classes/_near_js_keystores_node.unencrypted_file_system_keystore.UnencryptedFileSystemKeyStore.html)
-
-
-
-
-```js
-// creates keyStore from a provided file
-// you will need to pass the location of the .json key pair
-
-const { KeyPair, keyStores } = require("near-api-js");
-const fs = require("fs");
-const homedir = require("os").homedir();
-
-const ACCOUNT_ID = "near-example.testnet"; // NEAR account tied to the keyPair
-const NETWORK_ID = "testnet";
-// path to your custom keyPair location (ex. function access key for example account)
-const KEY_PATH = "/.near-credentials/near-example-testnet/get_token_price.json";
-
-const credentials = JSON.parse(fs.readFileSync(homedir + KEY_PATH));
-const myKeyStore = new keyStores.InMemoryKeyStore();
-myKeyStore.setKey(
- NETWORK_ID,
- ACCOUNT_ID,
- KeyPair.fromString(credentials.private_key)
-);
-```
-
-[ Class `InMemoryKeyStore`](https://near.github.io/near-api-js/classes/_near_js_keystores.in_memory_key_store.InMemoryKeyStore.html)
-
-[ Class `KeyPair`](https://near.github.io/near-api-js/classes/_near_js_crypto.key_pair.KeyPair.html)
-
-
-
-
-```js
-// creates keyStore from a private key string
-// you can define your key here or use an environment variable
-
-const { keyStores, KeyPair } = nearAPI;
-const myKeyStore = new keyStores.InMemoryKeyStore();
-const PRIVATE_KEY =
- "by8kdJoJHu7uUkKfoaLd2J2Dp1q1TigeWMG123pHdu9UREqPcshCM223kWadm";
-// creates a public / private key pair using the provided private key
-const keyPair = KeyPair.fromString(PRIVATE_KEY);
-// adds the keyPair you created to keyStore
-await myKeyStore.setKey("testnet", "example-account.testnet", keyPair);
-```
-
-[ Class `InMemoryKeyStore`](https://near.github.io/near-api-js/classes/_near_js_keystores.in_memory_key_store.InMemoryKeyStore.html)
-
-[ Class `KeyPair`](https://near.github.io/near-api-js/classes/_near_js_crypto.key_pair.KeyPair.html)
-
-
-
-
-## Connecting to NEAR {#connect}
-
-The object returned from `connect` is your entry-point for all commands in the API.
-To sign a transaction you'll need a [`KeyStore`](#key-store) to create a connection.
-
-
-
-
-```js
-const { connect } = nearAPI;
-
-const connectionConfig = {
- networkId: "testnet",
- keyStore: myKeyStore, // first create a key store
- nodeUrl: "https://rpc.testnet.near.org",
- walletUrl: "https://testnet.mynearwallet.com/",
- helperUrl: "https://helper.testnet.near.org",
- explorerUrl: "https://testnet.nearblocks.io",
-};
-const nearConnection = await connect(connectionConfig);
-```
-
-
-
-
-```js
-const { connect } = nearAPI;
-
-const connectionConfig = {
- networkId: "mainnet",
- keyStore: myKeyStore, // first create a key store
- nodeUrl: "https://rpc.mainnet.near.org",
- walletUrl: "https://wallet.mainnet.near.org",
- helperUrl: "https://helper.mainnet.near.org",
- explorerUrl: "https://nearblocks.io",
-};
-const nearConnection = await connect(connectionConfig);
-```
-
-
-
-
-
-```js
-const { connect } = nearAPI;
-const connectionConfig = {
- networkId: "local",
- nodeUrl: "http://localhost:3030",
- walletUrl: "http://localhost:4000/wallet",
-};
-const nearConnection = await connect(connectionConfig);
-```
-
-
-
-
-[ Module `connect`](https://near.github.io/near-api-js/modules/near_api_js.connect.html)
-
-## RPC Failover
-
-RPC providers can experience intermittent downtime, connectivity issues, or rate limits that cause client transactions to fail. This can be prevented by using the `FailoverRpcProvider` that supports multiple RPC providers.
-
-
-
-
-```js
-const jsonProviders = [
- new JsonRpcProvider({
- url: 'https://rpc.mainnet.near.org',
- }),
- new JsonRpcProvider(
- {
- url: 'https://another-rpc.cloud.com',
- headers: { 'X-Api-Key': 'some string' },
- },
- { retries: 3, backoff: 2, wait: 500 }
- ),
-];
-const provider = new FailoverRpcProvider(jsonProviders);
-
-await connect({
- networkId: 'mainnet',
- provider: provider,
- // this isn't used if `provider` is specified, but is still required for backward compatibility
- nodeUrl: 'https://rpc.mainnet.near.org',
-});
-```
-
-
-
-
-
-
-[ Class `FailoverRpcProvider `](https://near.github.io/near-api-js/classes/near_api_js.providers_failover_rpc_provider.FailoverRpcProvider.html)
diff --git a/docs/4.tools/near-api.md b/docs/4.tools/near-api.md
new file mode 100644
index 00000000000..ecac66fd6fc
--- /dev/null
+++ b/docs/4.tools/near-api.md
@@ -0,0 +1,990 @@
+---
+id: near-api
+title: NEAR API
+sidebar_label: NEAR API
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+import {Github, Language} from "@site/src/components/codetabs"
+
+The NEAR API is a set of libraries that allow you to interact with the NEAR blockchain. You can use it to create accounts, send tokens, deploy contracts, and more.
+
+The API is available in multiple languages, including:
+- JavaScript: [`near-api-js`](https://github.com/near/near-api-js)
+- Rust: [`near-api-rs`](https://github.com/near/near-api-rs)
+- Python: [`py-near`](https://github.com/pvolnov/py-near)
+
+For example, you could use [`near-api-js`](https://github.com/near/near-api-js) to create web applications or backend services written in node.js servers.
+
+:::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](/build/web3-apps/integrate-contracts) article
+:::
+
+These examples are references to code snippets, feel free to explore the full code examples in context by clicking `See full example on GitHub` below each example.
+
+---
+
+## Install
+
+
+
+ Include `near-api-js` as a dependency in your package.
+
+ ```bash
+ npm i near-api-js
+ ```
+
+ :::tip Static HTML
+ If you are building a site without using `npm`, you can include the library directly in your HTML file through a CDN.
+
+ ```html
+
+ ```
+ :::
+
+
+
+
+ ```bash
+ cargo add near-api
+ ```
+
+
+
+ ```shell
+ pip install py-near
+ ```
+
+
+
+
+
+### Import {#import}
+
+
+
+ You can use the API library in the browser, or in Node.js runtime.
+
+
+
+
+ Using the API in Node.js
+
+ All these examples are written for the browser, to use these examples in Node.js you should convert the project to an ES module. To do this, add the following to your `package.json`:
+
+
+
+
+
+
+
+
+ The methods to interact with the NEAR API are available through the `prelude` module.
+
+
+
+
+
+
+ You can use the NEAR API by importing the `py_near` package, either entirely
+ ```python
+ import py_near
+ ```
+
+ or only the parts you need, for example:
+ ```python
+ from py_near.account import Account
+ from py_near.providers import JsonProvider
+ ```
+
+
+
+
+
+### Connecting to NEAR {#connect}
+
+
+
+
+ The object returned from `connect` is your entry-point for all commands in the API.
+ To transactions you'll need a [`KeyStore`](#signers).
+
+
+
+
+ Mainnet/Localnet connection
+
+ ```js
+ // Mainnet config example
+ const connectionConfig = {
+ networkId: "mainnet",
+ keyStore: myKeyStore,
+ nodeUrl: "https://rpc.mainnet.near.org",
+ };
+
+ // Localnet config example
+ const connectionConfig = {
+ networkId: "local",
+ nodeUrl: "http://localhost:3030",
+ };
+ ```
+
+
+
+
+
+ To interact with the blockchain you'll need to create a `NetworkConfig` object.
+
+ Preset connections `mainnet` and `testnet` are available that come with standard configurations for each network.
+
+
+
+ You can also create your own custom connection.
+
+
+
+
+
+
+
+
+### Key Handlers: Stores & Signers
+
+
+
+
+ To sign transactions you'll need to a `KeyStore` with valid keypairs.
+
+
+
+
+ `BrowserLocalStorageKeyStore` can only be used in the browser, it uses the browser's local storage to store the keys.
+
+ ```js
+ // Creates keyStore using private key in local storage
+
+ const { keyStores } = nearAPI;
+ const myKeyStore = new keyStores.BrowserLocalStorageKeyStore();
+ ```
+
+
+
+
+ `UnencryptedFileSystemKeyStore` can be used is used to load keys from the legacy credentials directory used by the NEAR CLI.
+
+
+
+
+
+
+ Keystores can be created by loading a private key from a json file.
+
+
+
+
+
+
+ Keystores can be created by using a private key string.
+
+ Private keys have the format "ed25519:5Fg2...".
+
+
+
+
+
+
+ Keystores can be created by using a seed phrase. To parse the seed phrase into a private key, the `near-seed-phrase` library is needed.
+
+ ```bash
+ npm i near-seed-phrase
+ ```
+
+ Seed phrases have the format "shoe three gate ..." and are usually 12 words long.
+
+
+
+
+
+
+
+
+
+ To sign transactions you'll need to create a `Signer` that holds a valid keypair.
+
+
+
+
+ Signers can be created using the Keystore that is also used as the standard for saving keys with the NEAR CLI.
+
+
+
+
+
+
+ Signers can be created using the credentials directory which is the legacy option for saving keys with the NEAR CLI.
+
+
+
+
+
+
+ Signers can be created by loading a public and private key from a file.
+
+
+
+
+
+
+ Signers can be created by using a private key string.
+
+ Private keys have the format "ed25519:5Fg2...".
+
+
+
+
+
+
+ Signers can be created by using a seed phrase.
+
+ Seed phrases have the format "shoe three gate ..." and are usually 12 words long.
+
+
+
+
+
+
+
+
+ TODO: not exactly the same in Python, it's more and account + RPC URL, or a JSON RPC provider
+
+
+
+
+
+
+ ### RPC Failover
+
+ RPC providers can experience intermittent downtime, connectivity issues, or rate limits that cause client transactions to fail. This can be prevented by using the `FailoverRpcProvider` that supports multiple RPC providers.
+
+
+
+
+
+
+
+
+ You can pass multiple RPC providers to `JsonRpcProvider`
+
+ ```python
+ from py_near.providers import JsonProvider
+
+ provider = JsonProvider(["https://test.rpc.fastnear.com", "https://rpc.testnet.pagoda.co"])
+ ```
+
+
+
+---
+
+## Account
+
+### Instantiate Account {#instantiate-account}
+
+This will return an Account object for you to interact with.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ You can instantiate any account with the following code:
+
+ ```python
+ from py_near.account import Account
+
+ account = Account(account_id="example-account.testnet", rpc_addr="https://rpc.testnet.pagoda.co")
+ await account.startup()
+ ```
+
+ If you want to use it to submit transactions later, you need to also pass the `private_key` param:
+
+ ```python
+ account = Account(account_id="example-account.testnet", private_key="ed25519:...", rpc_addr="https://rpc.testnet.pagoda.co")
+ ```
+
+
+
+
+
+### Get Balance {#get-balance}
+
+Gets the available and staked balance of an account in yoctoNEAR.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ```python
+ from py_near.account import Account
+
+ account = Account(account_id="example-account.testnet", rpc_addr="https://rpc.testnet.pagoda.co")
+ await account.startup()
+
+ account_balance = account.get_balance()
+ ```
+
+
+
+
+
+### Get State {#get-state}
+
+Get basic account information, such as its code hash and storage usage.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ```python
+ from py_near.account import Account
+
+ account = Account(account_id="example-account.testnet", rpc_addr="https://rpc.testnet.pagoda.co")
+ await account.startup()
+
+ account_state = account.fetch_state()
+ ```
+
+
+
+
+
+### Get Details {#get-details}
+
+Returns the authorized apps of an account. This is a list of contracts that the account has function call access keys for.
+
+
+
+
+
+
+
+
+
+
+
+### Create an Account {#create-account}
+
+In order to create .near or .testnet accounts, you need to make a function call to the top-level-domain account (i.e. `near` or `testnet`), calling `create_account`. In this example we generate a new public key for the account by generating a random private key.
+
+The deposit determines the initial balance of the account.
+
+
+
+
+
+
+
+ Creating an account from a seed phrase
+
+ You can also create an account with a public key that is derived from a randomly generated seed phrase.
+
+
+
+
+
+
+
+
+
+
+
+ Creating an account from a seed phrase
+
+ You can also create an account via a randomly generated seed phrase.
+
+
+
+
+
+
+
+
+ ```python
+ await account.function_call("testnet", "create_account", {"new_account_id": "example-account.testnet", "new_public_key": "ed25519:..."}, "30000000000000", 1 * NEAR)
+ ```
+
+
+
+
+
+
+
+### Create a Sub-Account {#create-sub-account}
+
+Accounts can create sub-accounts of themselves, which are useful for creating separate accounts for different purposes. It is important to remark that the parent account has no control over any of its sub-accounts.
+
+The deposit determines the initial balance of the account.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Create a sub-account and fund it with your main account:
+
+ ```python
+ from py_near.account import Account
+ from py_near.dapps.core import NEAR
+
+ account = Account(account_id="example-account.testnet", private_key="ed25519:...", rpc_addr="https://rpc.testnet.pagoda.co")
+ await account.startup()
+
+ res = account.create_account(account_id="sub.example-account.testnet", public_key="...", initial_balance=1 * NEAR))
+ ```
+
+
+
+
+
+### Delete Account {#delete-account}
+
+When deleting an account, you need to specify a beneficiary account id. This is the account that will receive the remaining NEAR balance of the account being deleted.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+:::warning
+
+Only NEAR tokens will be transferred to the beneficiary, so you should transfer all your FTs, NFTs, etc. to another account before deleting.
+
+:::
+
+:::danger
+
+If the beneficiary account does not exist, the NEAR tokens will be burned
+
+:::
+
+---
+
+## Transactions
+
+### Send Tokens {#send-tokens}
+
+Transfer NEAR tokens between accounts.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ```python
+ from py_near.account import Account
+ from py_near.dapps.core import NEAR
+
+ account = Account(account_id="example-account.testnet", private_key="ed25519:...", rpc_addr="https://rpc.testnet.pagoda.co")
+ await account.startup()
+
+ await account.send_money("receiver-account.testnet", 1 * NEAR))
+ ```
+
+
+
+
+
+### Call Function
+
+A call function changes the contract's state and requires a signer/keypair.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ```python
+ await account.function_call("usn.near", "ft_transfer", {"receiver_id": "bob.near", "amount": "1000000000000000000000000"})
+ ```
+
+
+
+
+
+### Batch Actions
+
+You can send multiple [actions](../1.concepts/protocol/transaction-anatomy.md#actions) in a batch to a single receiver. If one action fails then the entire batch of actions will be reverted.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+### Simultaneous Transactions
+
+Transactions can be sent in parallel to the network, so you don't have to wait for one transaction to complete before sending the next one. Note that these one transaction could be successful and the other one could fail.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ```python
+ import asyncio
+ from py_near.account import Account
+
+ account = Account(account_id="example-account.testnet", private_key="ed25519:...", rpc_addr="https://rpc.testnet.pagoda.co")
+ await account.startup()
+
+ # Prepare the transactions
+ tx1 = account.function_call("guestbook.near-examples.testnet", "add_message", { "text": "Hello, world!" })
+ tx2 = account.function_call("counter.near-examples.testnet", "increment", {})
+
+ # Send the transactions simultaneously
+ const transactionsResults = await asyncio.gather(tx1, tx2)
+ ```
+
+
+
+
+
+
+### Deploy a Contract {#deploy-a-contract}
+
+You can deploy a contract from a compiled WASM file.
+
+
+
+
+
+
+
+
+
+ Note that the `signer` here needs to be a signer for the same `account_id` as the one used to construct the `Contract` object.
+
+
+
+
+
+
+ ```python
+ import asyncio
+ from py_near.account import Account
+
+ account = Account(account_id="example-account.testnet", private_key="ed25519:...", rpc_addr="https://rpc.testnet.pagoda.co")
+ await account.startup()
+
+ with open("contract.wasm", "rb") as f:
+ contract_code = f.read()
+ await account.deploy_contract(contract_code)
+ ```
+
+
+
+---
+
+## View Function
+
+View functions are read-only functions that don't change the state of the contract. We can call these functions without a signer / keypair or any gas.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ```python
+ view_call_result = await account.view_function("guestbook.near-examples.testnet", "total_messages", {})
+ # If args are required, they can be passed in like this in the 3rd argument:
+ # {
+ # "from_index": "0",
+ # "limit": "10"
+ # }
+ print(view_call_result)
+ ```
+
+
+
+---
+
+## Keys
+
+### Get All Access Keys {#get-all-access-keys}
+
+List all the access keys for an account.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ```python
+ keys = await account.get_access_key_list()
+ ```
+
+
+
+
+
+### Add Full Access Key {#add-full-access-key}
+
+Add a new [full access key](../1.concepts/protocol/access-keys.md#full-access-keys) to an account. Here we generate a random keypair, alternatively you can use a keypair from a seed phrase.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ```python
+ keys = await account.add_full_access_public_key("5X9WvUbRV3aSd9Py1LK7HAndqoktZtcgYdRjMt86SxMj")
+ ```
+
+
+
+
+
+### Add Function Call Key {#add-function-call-key}
+
+Add a new [function call key](../1.concepts/protocol/access-keys.md#function-call-keys) to an account. When adding the key you should specify the contract id the key can call, an array of methods the key is allowed to call, and the allowance in gas for the key.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ```python
+ await account.add_public_key(
+ "5X9WvUbRV3aSd9Py1LK7HAndqoktZtcgYdRjMt86SxMj",
+ "example-contract.testnet", # Contract this key is allowed to call
+ ["example_method"], # Methods this key is allowed to call (optional)
+ 0.25 * NEAR # Gas allowance key can use to call methods (optional)
+ )
+ ```
+
+
+
+
+
+
+### Delete Access Key {#delete-access-key}
+
+When deleting an access key, you need to specify the public key of the key you want to delete.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ```python
+ await account.delete_public_key("5X9WvUbRV3aSd9Py1LK7HAndqoktZtcgYdRjMt86SxMj")
+ ```
+
+
+
+---
+
+## Utilities
+
+### NEAR to yoctoNEAR {#near-to-yoctonear}
+
+Convert an amount in NEAR to an amount in yoctoNEAR.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ```python
+ from py_near.dapps.core import NEAR
+
+ amount_in_yocto = 1 * NEAR
+ ```
+
+
+
+
+
+
+### Format Amount {#format-amount}
+
+
+
+
+ Format an amount in yoctoNEAR to an amount in NEAR.
+
+
+
+
+
+
+ Format an amount of NEAR into a string of NEAR or yoctoNEAR depending on the amount.
+
+
+
+
+
+
+---
+
+## Additional resources
+
+
+
+
+ - [Documentation](https://near.github.io/near-api-js)
+ - [Github](https://github.com/near/near-api-js)
+ - [Full Examples](https://github.com/PiVortex/near-api-examples/tree/main/javascript)
+ - [Cookbook](https://github.com/near/near-api-js/tree/master/packages/cookbook) which contains examples using the near-js/client package, a wrapper tree shakable package for near-api-js.
+
+
+
+
+ - [Documentation](https://docs.rs/near-api/latest/near_api/)
+ - [Github](https://github.com/near/near-api-rs)
+ - [Full Examples](https://github.com/PiVortex/near-api-examples/tree/main/rust)
+
+
+
+
+ - [Phone number transfer](https://py-near.readthedocs.io/en/latest/clients/phone.html)
+
+
+
diff --git a/docs/5.api/rpc/providers.md b/docs/5.api/rpc/providers.md
index 59f8b6e6ca2..4b00449033e 100644
--- a/docs/5.api/rpc/providers.md
+++ b/docs/5.api/rpc/providers.md
@@ -45,7 +45,7 @@ If you want to use a custom RPC provider with NEAR Wallet Selector, [check this
## RPC Failover
-In `near-api-js` you can use [`FailoverRpcProvider`](../../4.tools/near-api-js/quick-reference.md#rpc-failover) to automatically switch RPC providers when one provider is experiencing downtime, or implement an RPC selection widget that allows users to add their own RPC provider.
+In `near-api-js` you can use [`FailoverRpcProvider`](../../4.tools/near-api.md#rpc-failover) to automatically switch RPC providers when one provider is experiencing downtime, or implement an RPC selection widget that allows users to add their own RPC provider.
As a user, if a dApp or wallet doesn't support RPC failover and the primary provider is down, you can use an RPC Selector browser extension to redirect all requests to an RPC provider of your choice.
diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js
index 565bd570106..17978313b09 100644
--- a/website/docusaurus.config.js
+++ b/website/docusaurus.config.js
@@ -148,7 +148,7 @@ const config = {
type: 'html',
value: ' Essentials ',
},
- { label: 'NEAR API', to: '/tools/near-api-js/quick-reference' },
+ { label: 'NEAR API', to: '/tools/near-api' },
{ label: 'NEAR SDK', to: '/tools/sdk' },
{ label: 'NEAR CLI', to: '/tools/near-cli' },
{
diff --git a/website/sidebars.js b/website/sidebars.js
index 5a3bf381326..69a328599c6 100644
--- a/website/sidebars.js
+++ b/website/sidebars.js
@@ -516,28 +516,7 @@ const sidebar = {
"type": "html",
"value": " Developer Tools "
},
- {
- "type": "category",
- "label": "JavaScript API",
- "items": [
- "tools/near-api-js/quick-reference",
- "tools/near-api-js/wallet",
- "tools/near-api-js/account",
- "tools/near-api-js/contract",
- "tools/near-api-js/utils",
- "tools/near-api-js/faq",
- {
- "type": "link",
- "label": "Handling Passphrases",
- "href": "https://github.com/near/near-seed-phrase"
- },
- {
- "type": "link",
- "label": "Type Docs",
- "href": "https://near.github.io/near-api-js"
- }
- ]
- },
+ "tools/near-api",
"tools/sdk",
"tools/near-cli",
{
From 6407f26606d769bf96ec4ff4cf2b5ddaa2b7279e Mon Sep 17 00:00:00 2001
From: matiasbenary
Date: Thu, 2 Jan 2025 15:09:11 -0300
Subject: [PATCH 26/35] fix(chain-abstraction): code update displayed (#2398)
---
.../chain-signatures/chain-signatures.md | 24 +++++++++----------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/docs/2.build/1.chain-abstraction/chain-signatures/chain-signatures.md b/docs/2.build/1.chain-abstraction/chain-signatures/chain-signatures.md
index 231b93238b1..9a7369b5683 100644
--- a/docs/2.build/1.chain-abstraction/chain-signatures/chain-signatures.md
+++ b/docs/2.build/1.chain-abstraction/chain-signatures/chain-signatures.md
@@ -66,13 +66,13 @@ We provide code to derive the address, as it's a complex process that involves m
+ url="https://github.com/near-examples/near-multichain/blob/main/src/services/ethereum.js" start="18" end="21" />
+ url="https://github.com/near-examples/near-multichain/blob/main/src/services/bitcoin.js" start="17" end="25" />
@@ -107,7 +107,7 @@ Constructing the transaction to be signed (transaction, message, data, etc.) var
+ start="47" end="73" />
In Ethereum, constructing the transaction is simple since you only need to specify the address of the receiver and how much you want to send.
@@ -116,7 +116,7 @@ In Ethereum, constructing the transaction is simple since you only need to speci
+ start="41" end="53" />
In bitcoin, you construct a new transaction by using all the Unspent Transaction Outputs (UTXOs) of the account as input, and then specify the output address and amount you want to send.
@@ -139,14 +139,14 @@ The method requires two parameters:
+ start="75" end="87" />
+ start="55" end="118" />
For bitcoin, all UTXOs are signed independently and then combined into a single transaction.
@@ -182,16 +182,16 @@ This allows the contract to generalize the signing process for multiple blockcha
+ start="89" end="100" />
In Ethereum, the signature is reconstructed by concatenating the `r`, `s`, and `v` values returned by the contract.
-
+
+ start="86" end="99" />
In Bitcoin, the signature is reconstructed by concatenating the `r` and `s` values returned by the contract.
@@ -209,14 +209,14 @@ Once we have reconstructed the signature, we can relay it to the corresponding n
+ start="109" end="115" />
-
+
+ start="120" end="133" />
From 02f25257649be830a8ece6d7bde0a66b4e7aa449 Mon Sep 17 00:00:00 2001
From: Guille
Date: Fri, 3 Jan 2025 17:02:31 +0100
Subject: [PATCH 27/35] feat: minor edits to introductions & fastauth
deprecation (#2403)
* feat: minor edits to introductions
* fix link
---------
Co-authored-by: Guillermo Alejandro Gallardo Diez
---
docs/1.concepts/basics/protocol.md | 13 +-
docs/1.concepts/protocol/access-keys.md | 38 ++-
docs/1.concepts/protocol/account-id.md | 20 +-
docs/1.concepts/protocol/account-model.md | 24 +-
docs/1.concepts/protocol/gas.md | 19 +-
.../1.chain-abstraction/fastauth-sdk.md | 262 +-----------------
docs/2.build/1.chain-abstraction/what-is.md | 22 +-
website/src/css/custom.scss | 4 +
yarn.lock | 4 -
9 files changed, 79 insertions(+), 327 deletions(-)
delete mode 100644 yarn.lock
diff --git a/docs/1.concepts/basics/protocol.md b/docs/1.concepts/basics/protocol.md
index cf400a6cb3c..40d7b0f7acf 100644
--- a/docs/1.concepts/basics/protocol.md
+++ b/docs/1.concepts/basics/protocol.md
@@ -3,12 +3,13 @@ id: protocol
title: What is NEAR?
---
-NEAR is a **user-friendly** and [**carbon-neutral**](https://near.org/blog/near-climate-neutral-product/) blockchain, built to be [fast, secure, and able to grow without limits](https://www.leewayhertz.com/comparison-of-blockchain-protocols#Parallel-comparison-of-various-blockchain-networks).
+NEAR is a **user-friendly** and [**carbon-neutral**](https://near.org/blog/near-climate-neutral-product/) blockchain, built to be [fast, secure, and infinitely scalable](https://www.leewayhertz.com/comparison-of-blockchain-protocols#Parallel-comparison-of-various-blockchain-networks).
![img](@site/static/docs/assets/welcome-pages/protocol.png)
+In technical terms, NEAR is a [layer one](https://coinmarketcap.com/academy/glossary/layer-1-blockchain), [sharded](https://near.org/blog/near-launches-nightshade-sharding-paving-the-way-for-mass-adoption), [proof-of-stake](https://en.wikipedia.org/wiki/Proof_of_stake) blockchain built with usability in mind.
-NEAR is the **blockchain for everyone**.
+In simpler terms, NEAR is the **blockchain for everyone**.
@@ -36,14 +37,14 @@ NEAR is a technical marvel, offering built-in features such as named accounts an
2. Simple sign-up: make an account using [email](https://dev.near.org/signup) or [telegram](https://web.telegram.org/k/#@herewalletbot)
3. Transactions are **fast** _(~1.3s transactions)_ and **cheap** _(< 1Β’ in fees)_
4. You don't need to buy crypto thanks to **built-in account abstraction**
-5. [Access Keys](../protocol/access-keys.md) make it safe and easy to use.
+5. [Access Keys](../protocol/access-keys.md) make it safe and easy to use
6. Control accounts on **other chains** thanks to [chain signatures](../abstraction/chain-signatures.md)
### π‘οΈ Battle-Tested
-1. 4 years of **100% uptime** with more than [**800M** transactions](https://pikespeak.ai/near-world/overview) processed
-2. NEAR has sustained peaks of [>13M transactions](https://pikespeak.ai/near-world/overview) in a day
-3. In March 2024, the top three monthly [dApps](https://dappradar.com/rankings?range=30d), based on unique active wallets, were built on NEAR:
+1. 4 years of **100% uptime** and [**3 Billion** transactions](https://pikespeak.ai/near-world/overview) processed
+2. NEAR has sustained peaks of [>13M transactions](https://pikespeak.ai/near-world/overview) in a single day
+3. NEAR is home to decentralized apps with [millions of users](https://dappradar.com/rankings?range=30d):
- [Kai-ching](https://cosmose.ai/)
- [Sweat](https://sweateconomy.com/)
- [Hot Wallet](https://t.me/herewalletbot/)
diff --git a/docs/1.concepts/protocol/access-keys.md b/docs/1.concepts/protocol/access-keys.md
index 2a87dd3d9c4..ed8613d0490 100644
--- a/docs/1.concepts/protocol/access-keys.md
+++ b/docs/1.concepts/protocol/access-keys.md
@@ -2,14 +2,14 @@
id: access-keys
title: Access Keys
---
-In all blockchains, users control their accounts by holding a `private key` (a secret only they know) and using it to sign [transactions](./transactions.md).
+In all blockchains, users control their accounts by holding a [`private key`](https://en.wikipedia.org/wiki/Public-key_cryptography) (a secret only they know) and using it to sign [transactions](./transactions.md).
![img](@site/static/docs/assets/welcome-pages/access-keys.png)
-NEAR accounts present the **unique** feature of being able to hold multiple [Access Keys](https://en.wikipedia.org/wiki/Public-key_cryptography), each with its **own set of permissions**. We distinguish two types of Keys:
+NEAR accounts present the **unique** feature of being able to hold **multiple Access Keys**, each with its **own set of permissions**. We distinguish two types of Keys:
1. `Full-Access Keys`: Have full control over the account, and should **never be shared**
-2. `Function-Call Keys`: Can sign calls to specific contract, and are **meant to be shared**
+2. `Function-Call Keys`: Can only sign calls for specific contracts, and are **meant to be shared**
---
@@ -25,22 +25,24 @@ As the name suggests, `Full-Access` keys have full control of an account, meanin
You should never share your `Full-Access`, otherwise you are giving **total control over the account**.
:::tip
-The **first** Full-Access Key of an account is added when the account is **created**
+[Implicit accounts](./account-id.md#implicit-address) already have a `Full-Access Key` by default, while for [`named accounts`](./account-id.md#named-address) their first `Full-Access Key` is added on creation
:::
---
## Function-Call Keys {#function-call-keys}
-`Function-Call` keys can only sign transactions calling a **specific contract**, and do **not allow** to **attach NEAR tokens** to the call. They are defined by three attributes:
-1. `receiver_id`: The **contract** which the key allows to call. No other contract can be called using this key
-2. `method_names` (Optional): The contract's **methods** the key allows to call. If omitted, all methods can be called
-3. `allowance` (Optional): The **amount of NEAR** allowed to be spent on [gas](gas.md). If omitted, the key can consume **unlimited** as gas
+`Function-Call` keys can only sign transactions calling a **specific contract**, and do **not allow** to **attach NEAR tokens** to the call.
-Function-Call keys have the main purpose of being shared, so third-parties can make contract calls in your name. This is useful in [multiple scenarios as we will see below](#benefits-of-function-call-keys).
+They are defined by three attributes:
+1. `receiver_id`: The **only contract** which the key allows to call, no other contract can be called with this key
+2. `method_names` (Optional): The contract's **methods** the key allows to call. If omitted, all contract's methods can be called
+3. `allowance` (Optional): The **amount of NEAR** allowed to be spent on [gas](gas.md). If omitted, the key can consume **unlimited** gas
+
+`Function Call Keys` are meant to be shared with applications, so third-parties can make contract calls in your name. This is useful in [multiple scenarios as we will see below](#benefits-of-function-call-keys).
:::tip
-`Function-Call` keys are secure to share, as they only permit calls to a specific contract and prohibit NEAR token transfers.
+`Function-Call` keys are secure to share, as they only permit calls to a specific contract and prohibit NEAR token transfers
:::
---
@@ -62,11 +64,19 @@ Sharing this key is safe for the user, because even in the case of somebody stea
### Simple Onboarding
-Another common use-case of `Function-Call` keys is to simplify the **onboarding** process for new users. It works as follows:
+Another common use-case of `Function-Call` keys is to simplify the **onboarding** process for new users.
+
+It works as follows:
+
+1. Create a contract that has a method called `create_account`
+ - This method should only be callable by the contract itself and
+ - When executed, the method should create a new account and transfer some tokens to it
-First create a contract that has a method called `create_account`. This method should only be callable by the contract itself and, when executed, should create a new account and transfer some tokens to it.
+2. Add multiple `Function Call Keys` in the contract's account, that **only allow to call `create_account`**
-You can then create multiple `Function-Call` in the contract's account, that only allow to call `create_account`. Drop these keys to your friends, so they can call the method, and easily create an account with some tokens.
+3. Give these keys to your friends! They will be able to call the method, and easily create an account with some tokens
+
+Your main account and your funds will never be at risk, as the keys can only be used to call the `create_account` method.
:::tip
This is the basic principle behind [NEAR Drops](../../2.build/5.primitives/linkdrop.md), a way to distribute assets to a large number of users
@@ -94,4 +104,4 @@ Locking an account is very useful when one wants to deploy a contract, and let t
:::warning
An account could still add keys to itself through a smart contract, effectively allowing the contract to unlock the account. Notice that this can only be done if the contract is deployed before the account is locked
-:::
\ No newline at end of file
+:::
diff --git a/docs/1.concepts/protocol/account-id.md b/docs/1.concepts/protocol/account-id.md
index 32b2c6cc18d..2022bcc9c3e 100644
--- a/docs/1.concepts/protocol/account-id.md
+++ b/docs/1.concepts/protocol/account-id.md
@@ -6,12 +6,12 @@ title: Address (Account ID)
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
-NEAR accounts are identified by a unique address, which take one of two forms:
-1. [**Implicit addresses**](#implicit-address), which are 64 characters long (e.g. `fb9243ce...`)
-2. [**Named addresses**](#named-address), which are simpler to remember and act as domains (e.g. `alice.near`)
+NEAR accounts are identified by a unique address, which takes one of two forms:
+1. [**Implicit address**](#implicit-address), which are 64 characters long (e.g. `fb9243ce...`)
+2. [**Named address**](#named-address), which act as domains (e.g. `alice.near`)
:::tip Searching to create an account?
-You have multiple ways to create an account, you can [sign-up using your email](https://dev.near.org/signup) (note: email-based accounts currently have limited ability to transfer funds or sign transactions), get a mobile wallet through [telegram](https://web.telegram.org/k/#@herewalletbot), or create a [web wallet](https://app.mynearwallet.com).
+You have multiple ways to create an account, you can [sign-up using your email](https://dev.near.org/signup), get a mobile wallet through [telegram](https://web.telegram.org/k/#@herewalletbot), or create a [web wallet](https://wallet.meteorwallet.app/wallet).
:::
---
@@ -24,7 +24,13 @@ For example:
- Corresponds to the public key: `ed25519:CQLP1o1F3Jbdttek3GoRJYhzfT...`
- And controls the account: `a96ad3cb539b653e4b869bd7cf26590690e8971...`
-Implicit accounts always *exist*, and thus do not need to be created. However, in order to use the account you will still need to fund it with NEAR tokens (or get somebody to pay the gas for your transaction).
+Implicit accounts always *exist*, and thus do not need to be created. However, in order to use the account you will still need to fund it with NEAR tokens (or get a relayer to pay your transaction's [gas](./gas.md)).
+
+:::tip
+
+In NEAR, you can delete the private key of an implicit account, which effectively locks the account and prevents anyone to control it
+
+:::
@@ -46,9 +52,9 @@ near account create-account fund-later use-auto-generation save-to-folder ~/.nea
---
## Named Address
-In NEAR, users can register **named accounts** (e.g. `bob.near`) which are simpler to share and remember.
+Users can register **named accounts** (e.g. `bob.near`) which are easy to remember and share.
-Another advantage of named accounts is that they can create **sub-accounts** of themselves, effectively working as domains:
+An awesome feature of named accounts is that they can create **sub-accounts** of themselves, effectively working as domains:
1. The [`registrar`](https://nearblocks.io/address/registrar) account can create top-level accounts (e.g. `near`, `sweat`, `kaiching`).
2. The `near` account can create sub-accounts such as `bob.near` or `alice.near`
diff --git a/docs/1.concepts/protocol/account-model.md b/docs/1.concepts/protocol/account-model.md
index e4e6a31ffa0..99395dc244f 100644
--- a/docs/1.concepts/protocol/account-model.md
+++ b/docs/1.concepts/protocol/account-model.md
@@ -14,7 +14,7 @@ By signing [transactions](./transactions.md) with their account, users can:
4. Help onboard new users by **covering the costs** of their transactions (gas fees)
:::tip Want to create an account?
-You have multiple ways to create an account, you can [sign-up using your email](https://dev.near.org/signup) (note: email-based accounts currently have limited ability to transfer funds or sign transactions), get a mobile wallet through [telegram](https://web.telegram.org/k/#@herewalletbot), or create a [web wallet](https://app.mynearwallet.com).
+You have multiple ways to create an account, you can [sign-up using your email](https://dev.near.org/signup), get a mobile wallet through [telegram](https://web.telegram.org/k/#@herewalletbot), or create a [web wallet](wallet.meteorwallet.app)
:::
---
@@ -27,13 +27,17 @@ Let's take a closer look at the different elements that compose the NEAR account
#### [Account ID](account-id.md)
-NEAR implements two types of accounts IDs: **named accounts** such as `alice.near`, which are simple to remember and share, and the classic alphanumeric IDs (`fb9243ce...`) that other chains also implement.
+NEAR **natively** implements two types of accounts:
+1. **Named accounts** such as `alice.near`, which are simple to remember and share
+2. **Implicit accounts** such as `0xfb9243ce...`, which are derived from a private key
#### [Permissions Through Access Keys](access-keys.md)
-NEAR accounts can have multiple [keys](access-keys.md), each with their own set of permissions. This allows to easily swap keys if one gets compromised, and to use keys as authorization tokens for third-parties.
+NEAR accounts can have multiple [keys](access-keys.md), each with their own set of permissions:
+- You can easily swap keys if one gets compromised
+- You can use keys as authorization tokens for third-party applications
#### [Simple to Develop Smart Contracts](../../2.build/2.smart-contracts/what-is.md)
-NEAR accounts can optionally hold a simple program, known as a [smart contract](../../2.build/2.smart-contracts/what-is.md). In NEAR, developers can create smart contracts using languages such as Javascript or Rust.
+NEAR accounts can optionally hold an application - known as a [smart contract](../../2.build/2.smart-contracts/what-is.md) - which can be written in Javascript or Rust.
---
@@ -41,8 +45,10 @@ NEAR accounts can optionally hold a simple program, known as a [smart contract](
If you're familiar with development on Ethereum, it's worth making a quick note about how accounts are different. The table below summarizes some key differences:
-| | Ethereum Wallet | NEAR Account |
-|-------------------|---------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|
-| Public Identifier | Public Key (`0x123...`) | Named IDs (`alice.near`) and implicit accounts (Public Key `0x123...`) |
-| Secret Key | Private Key (`0x456...`) | Multiple key-pairs with permissions: - `FullAccess` key - `FunctionCall` key |
-| Characteristics | - Private key gives full access - Account doesn't have to be created via a transaction | - Permission-based keypair - Account ID must be created via blockchain transaction |
+| | Ethereum Account | NEAR Account |
+|-----------------|--------------------------|----------------------------------------------------------------------------------------|
+| Account ID | Public Key (`0x123...`) | - Native named accounts (`alice.near`) - Implicit accounts (`0x123...`) |
+| Secret Key | Private Key (`0x456...`) | Multiple key-pairs with permissions: - `FullAccess` key - `FunctionCall` key |
+| Smart Contracts | Synchronous execution | Asynchronous execution |
+| Gas Fees | In the order of dollars | In the order of tenths of a cent |
+| Block Time | ~12 seconds | ~1.3 second |
diff --git a/docs/1.concepts/protocol/gas.md b/docs/1.concepts/protocol/gas.md
index 8fb7993e2bd..c0872ee6eeb 100644
--- a/docs/1.concepts/protocol/gas.md
+++ b/docs/1.concepts/protocol/gas.md
@@ -198,25 +198,8 @@ Notice that the fee comes from the gas burned during the function execution, and
## Estimating Costs for a Call
-:::warning
-This section will soon be moved from here to the [build documentation](../../2.build/2.smart-contracts/anatomy/environment.md).
-:::
-
If you're developing a smart contract, you might want to estimate how much gas a function call will consume. This is useful to estimate limits for your function and avoid running into out-of-gas errors.
One of the most accurate ways to estimate gas costs is by running your function in `testnet`. To know exactly how much gas a specific part of your function uses, you can use the `used_gas` method from our SDK.
-Another option is to use `Sandbox Testing` (available in [Rust](https://github.com/near/workspaces-rs/tree/main/examples/src) and [JavaScript](https://github.com/near/workspaces-js)), which simulates the NEAR network. There you can access the gas burnt after each function call.
-
-Finally, you can obtain gas cost estimates for a given function call using `api.gasbuddy.tech`. This API is experimental and may be removed in the future. One can obtain a gas cost estimate for a given function call by sending a POST request to `https://api.gasbuddy.tech/profile` with the following JSON body:
-
-```json
-{
- "contract_id": "",
- "method": "",
- "args": {
- "arg1": "value1",
- "arg2": "value2"
- }
-}
-```
+Another option is to use `Sandbox Testing` (available in [Rust](https://github.com/near/workspaces-rs/tree/main/examples/src) and [JavaScript](https://github.com/near/workspaces-js)), which simulates the NEAR network. There you can access the gas burnt after each function call.
\ No newline at end of file
diff --git a/docs/2.build/1.chain-abstraction/fastauth-sdk.md b/docs/2.build/1.chain-abstraction/fastauth-sdk.md
index d7381e2da0a..7248f4a9b28 100644
--- a/docs/2.build/1.chain-abstraction/fastauth-sdk.md
+++ b/docs/2.build/1.chain-abstraction/fastauth-sdk.md
@@ -4,264 +4,10 @@ title: FastAuth SDK
sidebar_label: FastAuth (Email Login)
---
-FastAuth is a key management system that allows users to **recover or sign-up for** a NEAR account using their **email address**. Furthermore, it allows to subsidize gas for a certain smart contract, so users can interact with it without having to fund their account.
+FastAuth is a key management system that allows users to **recover or sign-up for** a NEAR account using their **email address**.
-:::info Closed access beta
+:::warning
-FastAuth is currently in a private beta stage. If you want to try it out during this early development stage, please [contact us on Telegram](https://t.me/neardev).
+FastAuth is being deprecated, stay tuned for updates
-:::
-
----
-
-## FastAuth Components
-
-FastAuth is comprised of 3 main elements:
-
-1. **FastAuth Signer App**: A module that allow FastAuth users to sign transactions.
-2. **MPC Recovery Service**: A service to create and restore user accounts, as well as signing transactions on behalf of the user.
-3. **Transaction Relayer**: A server that relays transactions to the NEAR network on behalf of the user.
-
----
-
-### Setting up Firebase
-
-#### Create a project
-
-- Go to [Firebase](https://firebase.com)
-- Create or sign in to an account
-- Go to "Get started", then "Add project"
-- Call this project `my-fastauth-issuer`
-- Disable Google Analytics (recommended)
-- Click on "Create project"
-
-#### Set up passwordless authentication
-
-- Go to "Authentication", then "Get started", and "Add new provider"
-- Enable "Email/Password" and "Email link (passwordless sign-in)"
-- Hit "Save"
-
-#### Add user device information to Firestore
-
-- Return to "Project Overview"
-- Go to "Cloud Firestore", then "Create database"
-- Select "Start in production mode", then "Next"
-- Select your preferred location, then "Enable"
-- Go to the "Rules" tab
-- Change the rules to the following:
-
-```
-rules_version = '2';
-
-service cloud.firestore {
- match /databases/{database}/documents {
- match /users/{userId}/{document=**} {
- allow create, read, update, delete: if request.auth != null && request.auth.uid == userId;
- }
- match /publicKeys/{publicKey} {
- allow create, delete: if request.auth != null;
- allow read : if true;
- allow update: if false;
- }
- }
-}
-```
-
-- Hit "Publish"
-- Go to the "Data" tab
-- Click on "Start collection"
-- Set the Collection ID to `users` and hit "Next"
-- Add a Document ID of `root` and press "Save"
-- Click on "Start collection"
-- Set the Collection ID to `publicKeys` and hit "Next"
-- Add a Document ID of `root` and press "Save"
-
-#### Get the application credentials
-
-- Press the gear button next to "Project Overview", and go to "Project settings"
-- Under "Your apps", click on the `>` button
-- Set the app nickname as `issuer-gcp` and hit "Register app"
-- You should see the code needed for initialization and authentication of Firestore, such as:
-```js
-// Import the functions you need from the SDKs you need
-import { initializeApp } from "firebase/app";
-
-// TODO: Add SDKs for Firebase products that you want to use
-// https://firebase.google.com/docs/web/setup#available-libraries
-// Your web app's Firebase configuration
-
-const firebaseConfig = {
- apiKey: "apikey",
- authDomain: "my-fastauth-issuer-123.firebaseapp.com",
- projectId: "my-fastauth-issuer-123",
- storageBucket: "my-fastauth-issuer-123.appspot.com",
- messagingSenderId: "12345678910",
- appId: "1:12345678910:web:12345678910"
-};
-
-// Initialize Firebase
-const app = initializeApp(firebaseConfig);
-```
-
-### Setting up your relayer
-
-#### Setting up a NEAR account
-
-First ensure that `cargo` is installed on your local machine. Try [rustup](https://rustup.rs/) if you haven't already installed it.
-
-```bash
-cargo install near-cli-rs
-NEAR_ENV=mainnet
-near account create-account fund-later use-auto-generation save-to-folder ~/.near-credentials/implicit
-```
-
-This should output something like:
-
-```bash
-The file "~/.near-credentials/implicit/275f14eecb0afcb1f46f2b71b7933afd2de6d4ae8b08e9b11fc538a5a81406b7.json" was saved successfully
-```
-
-In this example. `275f14eecb0afcb1f46f2b71b7933afd2de6d4ae8b08e9b11fc538a5a81406b7` is your funded account. We'll refer to this as `$FUNDED_ACCOUNT` from now on.
-
-Send some NEAR to this address.
-
-#### Adding multiple keys (Recommended)
-
-This account has been created with one key. However, due to [this](https://near.zulipchat.com/#narrow/stream/295302-general/topic/.E2.9C.94.20The.20trouble.20with.20nonces/near/389649443), you should create an account with `N` keys where `N` is the number of requests you expect to get in a second, at peak load.
-
-To generate an additional key, run the following command:
-
-```bash
-near account add-key $FUNDED_ACCOUNT grant-full-access autogenerate-new-keypair save-to-keychain network-config mainnet sign-with-access-key-file ~/.near-credentials/implicit/$FUNDED_ACCOUNT.json send
-```
-
-
-#### Deploying the relayer
-
-Run the following command:
-
-```bash
-git clone https://github.com/near/pagoda-relayer-rs
-```
-
-Go to `config.toml` and change:
-
-```toml
-network = "mainnet"
-num_keys = 3 # correlates to the number of keys in `keys_filenames`. Will be optional in the future.
-relayer_account_id = "$FUNDED_ACCOUNT"
-keys_filenames = [
- # The original account
- "~/.near-credentials/mainnet/$FUNDED_ACCOUNT.json",
-
- # Other keys you've optionally created. This will allow rotating through each key as to avoid nonce races.
- "~/.near-credentials/mainnet/$FUNDED_ACCOUNT/ed25519_4ryLkp4AuzBD8yuyRJKb91hvHZ4zgqouWcJzu1gNEvLv.json",
- "~/.near-credentials/mainnet/$FUNDED_ACCOUNT/ed25519_7K3jF8Ft5dKFEPYRH1T4mncvsZGgSoGKsvsnnKEmqubT.json"
-]
-```
-
-Optionally, if you need to generate additional access keys for the `$FUNDED_ACCOUNT`, run the following command N times. Note that this will create keys for implicit accounts, but we'll then tie them to `$FUNDED_ACCOUNT`.
-
-```bash
-near generate-key
-near add-key $FUNDED_ACCOUNT exampleImplicitPublicKeyCxg2wgFYrdLTEkMu6j5D6aEZqTb3kXbmJygS48ZKbo1S
-```
-
-Then run:
-
-```bash
-docker compose up
-```
-
-You should do this on a VM server of your choice. We will refer to the URL of this VM as `$RELAYER_URL` from now on.
-
-### Setting up the frontend
-
-#### Deploying the signer app
-
-- Go to GCP's Cloud Run console and press "Create Service".
-- In the field "Container image URL", paste `nearprotocol/fast-auth-sdk-frontend:latest`.
-- Under **Container(s), Volumes, Networking, Security** set **Container port** to `80`
-- Go to the "Container, Networking, Security" fold out and then "Environment Variables"
-- Click on "Add Variable"
-- Set the following environment variables from the `firebaseConfig` you generated earlier.
-
-```yaml
-NETWORK_ID: 'mainnet',
-RELAYER_URL: '$RELAYER_URL',
-FIREBASE_API_KEY: 'apikey',
-FIREBASE_AUTH_DOMAIN: 'my-fastauth-issuer-123.firebaseapp.com',
-FIREBASE_PROJECT_ID: 'my-fastauth-issuer-123',
-FIREBASE_STORAGE_BUCKET: 'my-fastauth-issuer-123.appspot.com',
-FIREBASE_MESSAGING_SENDER_ID: '12345678910',
-FIREBASE_APP_ID: '1:12345678910:web:12345678910',
-```
-
-Alternatively if you're doing a `testnet` deployment, do:
-
-```yaml
-NETWORK_ID: 'testnet',
-RELAYER_URL_TESTNET: '$RELAYER_URL',
-FIREBASE_API_KEY_TESTNET: 'apikey',
-FIREBASE_AUTH_DOMAIN_TESTNET: 'my-fastauth-issuer-123.firebaseapp.com',
-FIREBASE_PROJECT_ID_TESTNET: 'my-fastauth-issuer-123',
-FIREBASE_STORAGE_BUCKET_TESTNET: 'my-fastauth-issuer-123.appspot.com',
-FIREBASE_MESSAGING_SENDER_ID_TESTNET: '12345678910',
-FIREBASE_APP_ID_TESTNET: '1:12345678910:web:12345678910',
-```
-
-- Click on "Create Application"
-- Then, inside your app's control panel copy the app's URL, such as `https://signer-app-123456-ab.a.run.app`. We will refer to the deploy URL as `$WALLET_URL`.
-
-#### Authorizing a domain on Firebase
-
-- Go back to the Firebase Console
-- Go to "Authentication" in the sidebar, and then the "Settings" tab
-- Click on the "Authorized domains" menu item
-- Add `$WALLET_URL` to the list
-
-#### Deploying your application frontend
-
-First, install the `@near-js/iframe-rpc` package from the NPM registry.
-
-```js
-import { setupFastAuthWallet } from 'near-fastauth-wallet';
-import { setupWalletSelector } from '@near-wallet-selector/core';
-
-// Initialize wallet selector
-const selector = setupWalletSelector({
- network: networkId,
- modules: [
- setupFastAuthWallet({
- relayerUrl: "$RELAYER_URL",
- walletUrl: "$WALLET_URL"
- })
- ]
- })
-
-// EITHER setup onClick function for login
-const onCLick = () => selector.then((selector: any) => selector.wallet('fast-auth-wallet'))
- .then((fastAuthWallet: any) =>
- fastAuthWallet.signIn({
- contractId: "$CONTRACT_ID",
- email: "",
- isRecovery: true,
- }),);
-
-// OR setup onClick function for login
-const onCLick = () => selector.then((selector: any) => selector.wallet('fast-auth-wallet'))
- .then((fastAuthWallet: any) =>
- fastAuthWallet.signIn({
- contractId: "$CONTRACT_ID",
- email: "",
- accountId: ".near"
- isRecovery: false,
- }),);
-```
-
-Whenever the user tries to login, call `onClick`.
-
-### Getting added to the MPC recovery service
-
-As a last step, we'll need to add your app to our MPC recovery service.
-To get added, please send us your `$FIREBASE_PROJECT_ID`, `$RELAYER_API_KEY` and `$RELAYER_URL` through this [form](https://forms.gle/cDfXj2D5bm9sohBx6).
+:::
\ No newline at end of file
diff --git a/docs/2.build/1.chain-abstraction/what-is.md b/docs/2.build/1.chain-abstraction/what-is.md
index 412095b58f3..c5adf3e7652 100644
--- a/docs/2.build/1.chain-abstraction/what-is.md
+++ b/docs/2.build/1.chain-abstraction/what-is.md
@@ -15,17 +15,6 @@ To help on this task, NEAR Protocol provides services that allow to **create** a
---
-## Fast-Auth: Email onboarding
-One of the first barriers that new users face when entering the world of Web3 is the need to create a crypto wallet. This generally implies the need to choose a wallet, create and store a recovery phrase, and obtain deposit funds to start using the account.
-
-With FastAuth, users only need to provide an email address to create a NEAR account. Using the same email address the user will be able to use their account across applications and devices.
-
-:::info
-FastAuth accounts are kept safe through multi-party computation (MPC) on a decentralized network. This means that the user's private key is never stored in a single location, and thus it is never exposed to any single party.
-:::
-
-
-
## Relayers: Cover gas fees
Allowing users to start using a dApp without having to acquire funds is a powerful tool to increase user adoption. NEAR Protocol provides a service that allows developers to subsidize gas fees for their users.
@@ -46,6 +35,17 @@ NEAR Protocol provides a multi-chain signature service that allows users to use
Multi-chain signatures work by combining **smart contracts** that produce signatures, with indexers that listen for these signatures, and relayers that submit the transactions to other networks. This allows users to hold assets and use applications in **any** network, only needing to have a single NEAR account.
:::
+
+
+## Fast-Auth: Email onboarding
+One of the first barriers that new users face when entering the world of Web3 is the need to create a crypto wallet. This generally implies the need to choose a wallet, create and store a recovery phrase, and obtain deposit funds to start using the account.
+
+With FastAuth, users only need to provide an email address to create a NEAR account. Using the same email address the user will be able to use their account across applications and devices.
+
+:::warning
+FastAuth is being deprecated, stay tuned for updates
+:::
+
---
## Chain Abstraction: The Holistic View
diff --git a/website/src/css/custom.scss b/website/src/css/custom.scss
index 85a7be5f458..6e3f6cb5415 100644
--- a/website/src/css/custom.scss
+++ b/website/src/css/custom.scss
@@ -40,6 +40,10 @@ body {
content: "";
}
+code {
+ padding: 0 0.2rem;
+}
+
hr {
height: 1px;
border-radius: 0;
diff --git a/yarn.lock b/yarn.lock
deleted file mode 100644
index fb57ccd13af..00000000000
--- a/yarn.lock
+++ /dev/null
@@ -1,4 +0,0 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
-# yarn lockfile v1
-
-
From c25ae82bda12a7ed482a994256f43a0c61fda774 Mon Sep 17 00:00:00 2001
From: Dmitry <98899785+mdqst@users.noreply.github.com>
Date: Fri, 3 Jan 2025 19:04:23 +0300
Subject: [PATCH 28/35] docs: fix typo in script Update best-practices.md
(#2388)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: DamiΓ‘n Parrino
---
docs/2.build/2.smart-contracts/anatomy/best-practices.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/2.build/2.smart-contracts/anatomy/best-practices.md b/docs/2.build/2.smart-contracts/anatomy/best-practices.md
index 79f72f99e6a..aecbb9a5f3a 100644
--- a/docs/2.build/2.smart-contracts/anatomy/best-practices.md
+++ b/docs/2.build/2.smart-contracts/anatomy/best-practices.md
@@ -19,7 +19,7 @@ overflow-checks = true
Try to validate the input, context, state and access using `require!` before taking any actions. The earlier you panic, the more [gas](https://docs.near.org/concepts/protocol/gas) you will save for the caller.
```rust
-#[nearn]
+#[near]
impl Contract {
pub fn set_fee(&mut self, new_fee: Fee) {
require!(env::predecessor_account_id() == self.owner_id, "Owner's method");
@@ -136,4 +136,4 @@ impl Contract {
## Use workspaces
Workspaces allow you to automate workflows and run tests for multiple contracts and cross-contract calls in a sandbox or testnet environment.
-Read more, [workspaces-rs](https://github.com/near/workspaces-rs) or [workspaces-js](https://github.com/near/workspaces-js).
\ No newline at end of file
+Read more, [workspaces-rs](https://github.com/near/workspaces-rs) or [workspaces-js](https://github.com/near/workspaces-js).
From 66cbb9535a7343ba4f266d13e2a380b1ac844709 Mon Sep 17 00:00:00 2001
From: Nazar Mokrynskyi
Date: Sat, 4 Jan 2025 00:19:43 +0200
Subject: [PATCH 29/35] `mut &self` -> `&mut self` (#2404)
---
docs/2.build/2.smart-contracts/anatomy/functions.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/2.build/2.smart-contracts/anatomy/functions.md b/docs/2.build/2.smart-contracts/anatomy/functions.md
index bdc29b2cd1c..b49382304b4 100644
--- a/docs/2.build/2.smart-contracts/anatomy/functions.md
+++ b/docs/2.build/2.smart-contracts/anatomy/functions.md
@@ -82,7 +82,7 @@ State changing functions are marked with the `@call` decorator.
-#### `mut &self`
+#### `&mut self`
State changing functions are those that take a **mutable** reference to `self` in Rust.
@@ -258,7 +258,7 @@ const SOME_VALUE: u64 = 8;
#[near]
impl MyContractStructure {
- fn internal_helper(mut &self, params... ){
+ fn internal_helper(&mut self, params... ){
// this function cannot be called from the outside
}
From 53a929908a56535f45e9206ad55e1cbc601f213a Mon Sep 17 00:00:00 2001
From: Guille
Date: Sat, 4 Jan 2025 19:55:57 +0100
Subject: [PATCH 30/35] fix: hardcode project name (#2406)
Co-authored-by: Guillermo Alejandro Gallardo Diez
---
docs/2.build/2.smart-contracts/quickstart.md | 80 ++++++++++----------
1 file changed, 42 insertions(+), 38 deletions(-)
diff --git a/docs/2.build/2.smart-contracts/quickstart.md b/docs/2.build/2.smart-contracts/quickstart.md
index f601615290c..2fc0fb3193d 100644
--- a/docs/2.build/2.smart-contracts/quickstart.md
+++ b/docs/2.build/2.smart-contracts/quickstart.md
@@ -95,6 +95,7 @@ _Creating a project using `create-near-app`_
This will generate a project with the following structure:
```bash
+hello-near
βββ sandbox-test # sandbox testing
β βββ main.ava.js
βββ src # contract's code
@@ -104,12 +105,18 @@ This will generate a project with the following structure:
βββ tsconfig.json
```
+:::tip
+
+We recommend you to name your project `hello-near` for this tutorial, but feel free to use any name you prefer
+
+:::
+
```bash
- cargo near new
+ cargo near new hello-near
```
![img](@site/static/docs/hello-near-rs.gif)
@@ -118,6 +125,7 @@ _Creating a project using `cargo near new`_
This will generate a project with the following structure:
```bash
+hello-near
βββ src # contract's code
β βββ lib.rs
βββ tests # sandbox testing
@@ -127,6 +135,12 @@ This will generate a project with the following structure:
βββ rust-toolchain.toml
```
+:::tip
+
+`hello-near` is the name we chose for this project so the tutorial is simpler to follow, but for future projects feel free to use any name you prefer
+
+:::
+
@@ -289,7 +303,7 @@ When you are ready to create a build of the contract run a one-line command depe
:::info
- If you encounter issues with Docker you can use the `non-reproducible-wasm` option to skip creating a reproducible build
+ For this tutorial we will use the `non-reproducible-wasm` option when building the contract, but please know that you can create a reproducible build if you have `Docker` installed
:::
@@ -303,54 +317,45 @@ When you are ready to create a build of the contract run a one-line command depe
Having our account created, we can now deploy the contract:
-
+
+
-
-
-
- ```bash
- near deploy build/hello_near.wasm
- ```
+ ```bash
+ near deploy ./build/hello_near.wasm
+ ```
-
+
+
-
-
- ```bash
- near contract deploy use-file ./target/near/hello.wasm without-init-call network-config testnet sign-with-keychain send
- ```
-
-
-
-
+ ```bash
+ near contract deploy use-file ./build/hello_near.wasm without-init-call network-config testnet sign-with-keychain send
+ ```
+
+
-
-
-
+
+
- ```bash
- near deploy ./target/near/.wasm
- ```
+ ```bash
+ near deploy ./target/near/hello_near.wasm
+ ```
-
+
-
+
- ```bash
- near contract deploy use-file ./target/near/.wasm without-init-call network-config testnet sign-with-keychain send
- ```
+ ```bash
+ near contract deploy use-file ./target/near/hello_near.wasm without-init-call network-config testnet sign-with-keychain send
+ ```
+
+
-
-
-
-
-
**Congrats**! Your contract now lives in the NEAR testnet network.
@@ -364,8 +369,7 @@ To interact with your deployed smart contract, you can call its functions throug
#### Get Greeting
-
-The `get_greeting` function only reads from the contract's state, and can thus be called for **free**.
+Let's start by fetching the greeting stored in the contract. The `get_greeting` function only reads from the contract's state, and can thus be called for **free**.
@@ -389,7 +393,7 @@ The `get_greeting` function only reads from the contract's state, and can thus b
#### Set Greeting
-The `set_greeting` method writes on the contract's [storage](./anatomy/storage.md), and thus requires a user to sign a transaction in order to be executed.
+We can now change the greeting stored in the contract. The `set_greeting` method writes on the contract's [storage](./anatomy/storage.md), and thus requires a user to sign a transaction in order to be executed.
From c2d4f990fb2cccf8a7c27f464c1ef7341b79a270 Mon Sep 17 00:00:00 2001
From: Guille
Date: Sat, 4 Jan 2025 21:28:38 +0100
Subject: [PATCH 31/35] Fix links (#2407)
* fix: hardcode project name
* fix: links
* fix: links
* fix: links
* fix: links
---------
Co-authored-by: Guillermo Alejandro Gallardo Diez
---
docs/1.concepts/protocol/account-model.md | 2 +-
docs/1.concepts/web3/economics.md | 2 +-
docs/1.concepts/web3/nfts.md | 2 +-
docs/2.build/4.web3-apps/chain-ui-tutorial.md | 3 +--
docs/2.build/4.web3-apps/integrate-contracts.md | 2 +-
.../2.build/6.data-infrastructure/lake-framework/near-lake.md | 2 +-
docs/3.tutorials/crosswords/01-basics/04-simple-frontend.md | 2 +-
docs/4.tools/explorer.md | 1 -
docs/4.tools/indexing-tools.md | 2 +-
docs/4.tools/welcome.md | 2 +-
docs/5.api/rpc/introduction.md | 2 +-
docs/5.api/rpc/setup.md | 4 ++--
docs/6.integrations/faq.md | 2 +-
docs/pagoda/rpc/setup.md | 4 ++--
website/linkinator.config.json | 4 +++-
website/src/theme/Footer/index.js | 2 +-
16 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/docs/1.concepts/protocol/account-model.md b/docs/1.concepts/protocol/account-model.md
index 99395dc244f..d300a090cb9 100644
--- a/docs/1.concepts/protocol/account-model.md
+++ b/docs/1.concepts/protocol/account-model.md
@@ -14,7 +14,7 @@ By signing [transactions](./transactions.md) with their account, users can:
4. Help onboard new users by **covering the costs** of their transactions (gas fees)
:::tip Want to create an account?
-You have multiple ways to create an account, you can [sign-up using your email](https://dev.near.org/signup), get a mobile wallet through [telegram](https://web.telegram.org/k/#@herewalletbot), or create a [web wallet](wallet.meteorwallet.app)
+You have multiple ways to create an account, you can [sign-up using your email](https://dev.near.org/signup), get a mobile wallet through [telegram](https://web.telegram.org/k/#@herewalletbot), or create a [web wallet](https://wallet.meteorwallet.app)
:::
---
diff --git a/docs/1.concepts/web3/economics.md b/docs/1.concepts/web3/economics.md
index 319075e8db4..e48e42fb426 100644
--- a/docs/1.concepts/web3/economics.md
+++ b/docs/1.concepts/web3/economics.md
@@ -47,6 +47,6 @@ Similarly to NFTs, fungible tokens are also just a piece of data stored in a sma
Smart Contracts can define allowed operations - like transfer or payment using this token. [NEAR defines a standard](https://nomicon.io/Standards/FungibleToken/Core) for fungible tokens and provides a [default implementation](https://docs.rs/near-contract-standards/latest/near_contract_standards/fungible_token/index.html).
Since an application is fully in control over emission and circulation of such tokens, a full fledged application economy can be created. For example, users can earn FTs for performing actions, and spend them to buy or mint new NFTs.
-Another exciting option is creation of [Decentralized Autonomous Organizations](https://near.org/use-cases/dao/) (DAOs), in which FTs can be used as a membership (or governance) tool. In such scenarios, tokens are awarded to members and can be used to vote on decisions or participate in community events.
+Another exciting option is creation of [Decentralized Autonomous Organizations](../../2.build/5.primitives/dao.md) (DAOs), in which FTs can be used as a membership (or governance) tool. In such scenarios, tokens are awarded to members and can be used to vote on decisions or participate in community events.
But we can push our tokens even further, by tying them to other cryptocurrencies and giving them a real-life monetary value. Thatβs where [Decentralized Finance](https://www.investopedia.com/decentralized-finance-defi-5113835) (DeFi), and especially [Decentralized Exchanges](https://en.wikipedia.org/wiki/Decentralized_exchange) (DEX) come into play. We wonβt go into details here, but at the core a [liquidity pool](https://academy.binance.com/en/articles/what-are-liquidity-pools-in-defi) for a Fungible Token can be created on DEX, which allows trades of this token for other tokens or [stablecoins](https://en.wikipedia.org/wiki/Stablecoin). This opens the door for a new gaming model - [Play-to-Earn](https://en.wikipedia.org/wiki/Blockchain_game), where players can earn real-life money just by playing a game.
diff --git a/docs/1.concepts/web3/nfts.md b/docs/1.concepts/web3/nfts.md
index e36329c58d1..f6013b1cd9b 100644
--- a/docs/1.concepts/web3/nfts.md
+++ b/docs/1.concepts/web3/nfts.md
@@ -478,7 +478,7 @@ If we need read-level access only, we can simply use the [REST API](https://docs
* In case of a Functional Call key, it can be obtained from the wallet and used directly by the client.
* In case of a Full Access key, the user should be redirected to the wallet to approve a transaction.
-A [JavaScript API](/tools/near-api-js/quick-reference) exists to cover all of these scenarios. It has all of the necessary functionality to integrate Web/Node.JS applications with blockchain. This SDK is a perfect choice for the Web-based clients, but itβs not suitable for desktop or mobile based clients. Other libraries can be used for them:
+A [JavaScript API](../../4.tools/near-api.md) exists to cover all of these scenarios. It has all of the necessary functionality to integrate Web/Node.JS applications with blockchain. This SDK is a perfect choice for the Web-based clients, but itβs not suitable for desktop or mobile based clients. Other libraries can be used for them:
diff --git a/docs/2.build/4.web3-apps/chain-ui-tutorial.md b/docs/2.build/4.web3-apps/chain-ui-tutorial.md
index 9c59fc8905d..df63550e626 100644
--- a/docs/2.build/4.web3-apps/chain-ui-tutorial.md
+++ b/docs/2.build/4.web3-apps/chain-ui-tutorial.md
@@ -154,11 +154,10 @@ react-example deployment calculated to cost 4.08204 N {
? Estimated cost to deploy is 4.08204 N. Continue? (y/N)
```
-Once you've deployed your frontend, you can load the web application at `https://chain-hosted-ui.near.dev////`
+Once you've deployed your frontend, you can load the web application at `gateway-url////`
- ``: `v1.chain-hosted-ui.testnet` or `v1.chainui.near`
- ``: the NEAR account used to deploy, e.g. `myaccount.testnet`
- ``: the application name you defined, e.g. `react-example`
- - [Check this deployed example](https://chain-hosted-ui.near.dev/v1.chain-hosted-ui.testnet/solops2.testnet/react-example)
### Redeployment
diff --git a/docs/2.build/4.web3-apps/integrate-contracts.md b/docs/2.build/4.web3-apps/integrate-contracts.md
index 1bf00c5c704..4fcda9f50fb 100644
--- a/docs/2.build/4.web3-apps/integrate-contracts.md
+++ b/docs/2.build/4.web3-apps/integrate-contracts.md
@@ -330,4 +330,4 @@ NEAR API JS does not limit itself to simply calling methods in a contract. In fa
- **[Create batch transactions](https://github.com/near/near-api-js/tree/master/packages/cookbook/transactions/batch-transactions.ts)**: this enables to link multiple [actions](../../1.concepts/protocol/transaction-anatomy.md#actions) (e.g. multiple function calls). If one of the transactions fails, then they are all reverted.
- **[Create accounts](https://github.com/near/near-api-js/tree/master/packages/cookbook/accounts/create-testnet-account.ts)**: deploy accounts for your users!
-Check the [cookbook](/tools/near-api-js/cookbook) to learn how to supercharge your web-app.
+Check the [NEAR API](../../4.tools/near-api.md) section to learn how to supercharge your web-app.
diff --git a/docs/2.build/6.data-infrastructure/lake-framework/near-lake.md b/docs/2.build/6.data-infrastructure/lake-framework/near-lake.md
index 7379e49799b..4bda47886dc 100644
--- a/docs/2.build/6.data-infrastructure/lake-framework/near-lake.md
+++ b/docs/2.build/6.data-infrastructure/lake-framework/near-lake.md
@@ -16,7 +16,7 @@ You can find the Lake Indexer source code in [this GitHub repository](https://gi
:::tip
-[Pagoda Inc.](https://pagoda.co) runs NEAR Lake nodes to store the data in JSON format on AWS S3.
+[Pagoda Inc.](https://www.pagoda.co) runs NEAR Lake nodes to store the data in JSON format on AWS S3.
There is no need to run your own NEAR Lake unless you have specific reasons to do that.
:::
diff --git a/docs/3.tutorials/crosswords/01-basics/04-simple-frontend.md b/docs/3.tutorials/crosswords/01-basics/04-simple-frontend.md
index 757788df7d2..85be144970d 100644
--- a/docs/3.tutorials/crosswords/01-basics/04-simple-frontend.md
+++ b/docs/3.tutorials/crosswords/01-basics/04-simple-frontend.md
@@ -11,7 +11,7 @@ import nearReactFriends from '/docs/assets/crosswords/near-and-react--dakila.nea
# Add a simple frontend
-This will be the final section in this chapter, where we'll add a simple frontend using React and [`near-api-js`](https://docs.near.org/tools/near-api-js/quick-reference) to communicate with the smart contract.
+This will be the final section in this chapter, where we'll add a simple frontend using React and [`near-api-js`](../../../4.tools/near-api.md) to communicate with the smart contract.
```bash
-cargo near deploy $NEAR_ACCT with-init-call new json-args '{"owner_id": "'$NEAR_ACCT'", "creator_account": "testnet"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
+cargo near deploy build-non-reproducible-wasm $NEAR_ACCT with-init-call new json-args '{"owner_id": "'$NEAR_ACCT'", "creator_account": "testnet"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
```
diff --git a/docs/3.tutorials/examples/advanced-xcc.md b/docs/3.tutorials/examples/advanced-xcc.md
index 1329a6dfc20..e2edac64fc0 100644
--- a/docs/3.tutorials/examples/advanced-xcc.md
+++ b/docs/3.tutorials/examples/advanced-xcc.md
@@ -290,9 +290,7 @@ In order to deploy the contract you will need to create a NEAR account.
Go into the directory containing the smart contract (`cd contract-advanced-ts` or `cd contract-advanced-rs`), build and deploy it:
```bash
-cargo near build
-
-cargo near deploy with-init-call new json-args '{"hello_account":"hello.near-example.testnet","guestbook_account":"guestbook_account.near-example.testnet","counter_account":"counter_account.near-example.testnet"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
+cargo near deploy build-non-reproducible-wasm with-init-call new json-args '{"hello_account":"hello.near-example.testnet","guestbook_account":"guestbook_account.near-example.testnet","counter_account":"counter_account.near-example.testnet"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
```
diff --git a/docs/3.tutorials/examples/count-near.md b/docs/3.tutorials/examples/count-near.md
index 8a5e191d9c0..e5e9db885d8 100644
--- a/docs/3.tutorials/examples/count-near.md
+++ b/docs/3.tutorials/examples/count-near.md
@@ -183,9 +183,7 @@ In order to deploy the contract you will need to create a NEAR account.
Go into the directory containing the smart contract (`cd contract-ts` or `cd contract-rs`), build and deploy it:
```bash
-cargo near build
-
-cargo near deploy
+cargo near deploy build-non-reproducible-wasm
```
:::tip
To interact with your contract from the [frontend](#frontend), simply replace the value of the `testnet` key in the `config.js` file.
diff --git a/docs/3.tutorials/examples/donation.md b/docs/3.tutorials/examples/donation.md
index 43c7e84bf8c..95bd637a8b7 100644
--- a/docs/3.tutorials/examples/donation.md
+++ b/docs/3.tutorials/examples/donation.md
@@ -186,9 +186,7 @@ In order to deploy the contract you will need to create a NEAR account.
Go into the directory containing the smart contract (`cd contract-ts` or `cd contract-rs`), build and deploy it:
```bash
-cargo near build
-
-cargo near deploy
+cargo near deploy build-non-reproducible-wasm
```
:::tip
diff --git a/docs/3.tutorials/examples/guest-book.md b/docs/3.tutorials/examples/guest-book.md
index 416642aeddc..86be34a066e 100644
--- a/docs/3.tutorials/examples/guest-book.md
+++ b/docs/3.tutorials/examples/guest-book.md
@@ -184,9 +184,7 @@ In order to deploy the contract you will need to create a NEAR account.
Go into the directory containing the smart contract (`cd contract-ts` or `cd contract-rs`), build and deploy it:
```bash
-cargo near build
-
-cargo near deploy
+cargo near deploy build-non-reproducible-wasm
```
:::tip
diff --git a/docs/3.tutorials/examples/xcc.md b/docs/3.tutorials/examples/xcc.md
index d77bc75038a..f0af14951ce 100644
--- a/docs/3.tutorials/examples/xcc.md
+++ b/docs/3.tutorials/examples/xcc.md
@@ -168,9 +168,7 @@ In order to deploy the contract you will need to create a NEAR account.
Go into the directory containing the smart contract (`cd contract-advanced-ts` or `cd contract-advanced-rs`), build and deploy it:
```bash
-cargo near build
-
-cargo near deploy with-init-call new json-args '{"hello_account":"hello.near-example.testnet"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
+cargo near deploy build-non-reproducible-wasm with-init-call new json-args '{"hello_account":"hello.near-example.testnet"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
```
diff --git a/docs/3.tutorials/fts/1-skeleton.md b/docs/3.tutorials/fts/1-skeleton.md
index 851e8b9b967..1efd4496ebf 100644
--- a/docs/3.tutorials/fts/1-skeleton.md
+++ b/docs/3.tutorials/fts/1-skeleton.md
@@ -181,5 +181,5 @@ At the time of this writing, this example works with the following versions:
- rustc: `1.77.1`
- near-sdk-rs: `5.1.0` (with enabled `legacy` feature)
-- cargo-near: `0.6.1`
+- cargo-near: `0.13.2`
:::
diff --git a/docs/3.tutorials/fts/2-define-a-token.md b/docs/3.tutorials/fts/2-define-a-token.md
index 9d2a03b28ee..35e60609978 100644
--- a/docs/3.tutorials/fts/2-define-a-token.md
+++ b/docs/3.tutorials/fts/2-define-a-token.md
@@ -118,7 +118,7 @@ echo $FT_CONTRACT_ID
Verify that the correct account ID is printed in the terminal. If everything looks correct you can now deploy your contract. For simplicity, let's call the default metadata initialization function you wrote earlier so that you don't have to type the metadata manually in the CLI. In the root of your FT project run the following command to deploy your smart contract.
```bash
-cargo near deploy $FT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$FT_CONTRACT_ID'", "total_supply": "0"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
+cargo near deploy build-non-reproducible-wasm $FT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$FT_CONTRACT_ID'", "total_supply": "0"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
```
At this point, the contract should have been deployed to your account and initialized.
@@ -186,6 +186,6 @@ At the time of this writing, this example works with the following versions:
- rustc: `1.77.1`
- near-sdk-rs: `5.1.0` (with enabled `legacy` feature)
-- cargo-near: `0.6.1`
+- cargo-near: `0.13.2`
- near-cli-rs: `0.17.0`
:::
diff --git a/docs/3.tutorials/fts/3-circulating-supply.md b/docs/3.tutorials/fts/3-circulating-supply.md
index f53e5d81e99..5dd764621b1 100644
--- a/docs/3.tutorials/fts/3-circulating-supply.md
+++ b/docs/3.tutorials/fts/3-circulating-supply.md
@@ -267,7 +267,7 @@ cargo near build
It's time to deploy the contract, initialize it and mint the total supply. Let's create an initial supply of 1000 `gtNEAR`. Since it has 24 decimal places, you should put `1000` followed by 24 zeros in the total supply field.
```bash
-cargo near deploy $EVENTS_FT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$EVENTS_FT_CONTRACT_ID'", "total_supply": "1000000000000000000000000000"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
+cargo near deploy build-non-reproducible-wasm $EVENTS_FT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$EVENTS_FT_CONTRACT_ID'", "total_supply": "1000000000000000000000000000"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
```
You can check to see if everything went through properly by looking at the output in your CLI:
@@ -385,6 +385,7 @@ At the time of this writing, this example works with the following versions:
- rustc: `1.77.1`
- near-sdk-rs: `5.1.0` (with enabled `legacy` feature)
+- cargo-near: `0.13.2`
- cargo-near: `0.6.1`
- near-cli-rs: `0.17.0`
:::
diff --git a/docs/3.tutorials/fts/4.storage.md b/docs/3.tutorials/fts/4.storage.md
index aff6d8b39bf..8ec07dde4f9 100644
--- a/docs/3.tutorials/fts/4.storage.md
+++ b/docs/3.tutorials/fts/4.storage.md
@@ -171,7 +171,7 @@ cargo near build
It's time to deploy the contract, initialize it and mint the total supply. Let's once again create an initial supply of 1000 `gtNEAR`.
```bash
-cargo near deploy $STORAGE_FT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$STORAGE_FT_CONTRACT_ID'", "total_supply": "1000000000000000000000000000"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
+cargo near deploy build-non-reproducible-wasm $STORAGE_FT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$STORAGE_FT_CONTRACT_ID'", "total_supply": "1000000000000000000000000000"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
```
If you now query for the storage paid by the owner, you should see that they're registered!
@@ -235,6 +235,6 @@ At the time of this writing, this example works with the following versions:
- rustc: `1.77.1`
- near-sdk-rs: `5.1.0` (with enabled `legacy` feature)
-- cargo-near: `0.6.1`
+- cargo-near: `0.13.2`
- near-cli-rs: `0.17.0`
:::
diff --git a/docs/3.tutorials/fts/5.transfers.md b/docs/3.tutorials/fts/5.transfers.md
index 680d67866f9..022945a3b22 100644
--- a/docs/3.tutorials/fts/5.transfers.md
+++ b/docs/3.tutorials/fts/5.transfers.md
@@ -163,7 +163,7 @@ cargo near build
It's time to deploy the contract, initialize it and mint the total supply. Let's once again create an initial supply of 1000 `gtNEAR`.
```bash
-cargo near deploy $TRANSFER_FT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$TRANSFER_FT_CONTRACT_ID'", "total_supply": "1000000000000000000000000000"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
+cargo near deploy build-non-reproducible-wasm $TRANSFER_FT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$TRANSFER_FT_CONTRACT_ID'", "total_supply": "1000000000000000000000000000"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
```
You can check if you own the FTs by running the following command:
@@ -380,6 +380,6 @@ At the time of this writing, this example works with the following versions:
- rustc: `1.77.1`
- near-sdk-rs: `5.1.0` (with enabled `legacy` feature)
-- cargo-near: `0.6.1`
+- cargo-near: `0.13.2`
- near-cli-rs: `0.17.0`
:::
diff --git a/docs/3.tutorials/fts/6-marketplace.md b/docs/3.tutorials/fts/6-marketplace.md
index 177dbd3a253..c8017da3833 100644
--- a/docs/3.tutorials/fts/6-marketplace.md
+++ b/docs/3.tutorials/fts/6-marketplace.md
@@ -42,7 +42,7 @@ Let's start by building both the finished FT contract and the marketplace contra
```bash
-cd market-contract && cargo near build && cd ..
+cd market-contract && cargo near build non-reproducible-wasm && cd ..
```
This will install the dependencies for the marketplace contract as well as the FT contract. Note that there's also `ft-tutorial/out` directory with pre-build nft contract wasm file which you'll use to place the NFTs for sale.
@@ -174,7 +174,7 @@ Now that you *hopefully* have a good understanding of how the marketplace contra
The first thing you'll want to do is deploy a new FT, NFT, and marketplace contract.
```bash
-cd market-contract && cargo near build && cd ..
+cd market-contract && cargo near build non-reproducible-wasm && cd ..
```
To deploy the FT contract and export an environment variable, run the following command:
@@ -182,7 +182,7 @@ To deploy the FT contract and export an environment variable, run the following
```bash
export FT_CONTRACT=
near create-account $FT_CONTRACT --useFaucet
-cd 5.transfers/ && cargo near deploy $FT_CONTRACT with-init-call new_default_meta json-args '{"owner_id": "'$FT_CONTRACT'", "total_supply": "1000000000000000000000000000"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send && cd ../
+cd 5.transfers/ && cargo near deploy build-non-reproducible-wasm $FT_CONTRACT with-init-call new_default_meta json-args '{"owner_id": "'$FT_CONTRACT'", "total_supply": "1000000000000000000000000000"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send && cd ../
```
Next, you'll deploy the NFT and marketplace contracts.
@@ -196,7 +196,7 @@ near deploy $NFT_CONTRACT out/nft-contract.wasm
```bash
export MARKETPLACE_CONTRACT=
near create-account $MARKETPLACE_CONTRACT --useFaucet
-cd market-contract/ && cargo near deploy $MARKETPLACE_CONTRACT with-init-call new json-args '{"owner_id": "'$MARKETPLACE_CONTRACT'", "ft_id": "'$FT_CONTRACT'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send && cd ../
+cd market-contract/ && cargo near deploy build-non-reproducible-wasm $MARKETPLACE_CONTRACT with-init-call new json-args '{"owner_id": "'$MARKETPLACE_CONTRACT'", "ft_id": "'$FT_CONTRACT'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send && cd ../
```
Check and see if your environment variables are all correct by running the following command. Each output should be different.
@@ -613,6 +613,6 @@ At the time of this writing, this example works with the following versions:
- rustc: `1.77.1`
- near-sdk-rs: `5.1.0` (with enabled `legacy` feature)
-- cargo-near: `0.6.1`
+- cargo-near: `0.13.2`
- near-cli: `4.0.13`
:::
diff --git a/docs/3.tutorials/nfts/1-skeleton.md b/docs/3.tutorials/nfts/1-skeleton.md
index b7fa67f9e79..5e284e0b815 100644
--- a/docs/3.tutorials/nfts/1-skeleton.md
+++ b/docs/3.tutorials/nfts/1-skeleton.md
@@ -263,7 +263,7 @@ At the time of this writing, this example works with the following versions:
- rustc: `1.76.0`
- near-sdk-rs: `5.1.0`
-- cargo-near: `0.6.1`
+- cargo-near: `0.13.2`
- NFT standard: [NEP171](https://nomicon.io/Standards/Tokens/NonFungibleToken/Core), version `1.0.0`
:::
diff --git a/docs/3.tutorials/nfts/2-minting.md b/docs/3.tutorials/nfts/2-minting.md
index fe44ac23e69..87f620fdfa8 100644
--- a/docs/3.tutorials/nfts/2-minting.md
+++ b/docs/3.tutorials/nfts/2-minting.md
@@ -251,7 +251,7 @@ Verify that the correct account ID is printed in the terminal. If everything loo
In the root of your NFT project run the following command to deploy your smart contract and answer questions:
```bash
-cargo near deploy $NFT_CONTRACT_ID
+cargo near deploy build-non-reproducible-wasm $NFT_CONTRACT_ID
> Select the need for initialization: with-init-call - Add an initialize
> What is the name of the function? new_default_meta
@@ -267,7 +267,7 @@ cargo near deploy $NFT_CONTRACT_ID
You don't need to answer these questions every time. If you look at the results you will find the message `Here is the console command if you ever need to re-run it again`. The next line is the command which you may use instead of answering to interactive questions:
```bash
-cargo near deploy $NFT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$NFT_CONTRACT_ID'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
+cargo near deploy build-non-reproducible-wasm $NFT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$NFT_CONTRACT_ID'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
```
You've just deployed and initialized the contract with some default metadata and set your account ID as the owner. At this point, you're ready to call your first view function.
diff --git a/docs/3.tutorials/nfts/2-upgrade.md b/docs/3.tutorials/nfts/2-upgrade.md
index fad585637b4..35d340210d7 100644
--- a/docs/3.tutorials/nfts/2-upgrade.md
+++ b/docs/3.tutorials/nfts/2-upgrade.md
@@ -48,7 +48,7 @@ Let's move over to the `enumeration.rs` file and implement that logic:
Now that you've implemented the necessary logic for `nft_tokens_for_owner`, it's time to build and re-deploy the contract to your account. Using the cargo-near, deploy the contract as you did in the previous tutorial:
```bash
-cargo near deploy $NFT_CONTRACT_ID without-init-call network-config testnet sign-with-keychain send
+cargo near deploy build-non-reproducible-wasm $NFT_CONTRACT_ID without-init-call network-config testnet sign-with-keychain send
```
Once the contract has been redeployed, let's test and see if the state migrated correctly by running a simple view function:
diff --git a/docs/3.tutorials/nfts/3-enumeration.md b/docs/3.tutorials/nfts/3-enumeration.md
index 677ff25d649..8b0b2a3d959 100644
--- a/docs/3.tutorials/nfts/3-enumeration.md
+++ b/docs/3.tutorials/nfts/3-enumeration.md
@@ -56,7 +56,7 @@ Next, you can use the CLI to query these new methods and validate that they work
Now that you've implemented the necessary logic for `nft_tokens_for_owner`, it's time to build and re-deploy the contract to your account. Using the cargo-near, deploy the contract as you did in the previous tutorials:
```bash
-cargo near deploy $NFT_CONTRACT_ID without-init-call network-config testnet sign-with-keychain send
+cargo near deploy build-non-reproducible-wasm $NFT_CONTRACT_ID without-init-call network-config testnet sign-with-keychain send
```
---
diff --git a/docs/3.tutorials/nfts/4-core.md b/docs/3.tutorials/nfts/4-core.md
index b822ca1a0d1..eb2e6ca1100 100644
--- a/docs/3.tutorials/nfts/4-core.md
+++ b/docs/3.tutorials/nfts/4-core.md
@@ -145,7 +145,7 @@ With that finished, you've now successfully added the necessary logic to allow u
Using cargo-near, deploy the contract as you did in the previous tutorials:
```bash
-cargo near deploy $NFT_CONTRACT_ID without-init-call network-config testnet sign-with-keychain send
+cargo near deploy build-non-reproducible-wasm $NFT_CONTRACT_ID without-init-call network-config testnet sign-with-keychain send
```
:::tip
diff --git a/docs/3.tutorials/nfts/5-approval.md b/docs/3.tutorials/nfts/5-approval.md
index 91ce732314a..79b5f83aeca 100644
--- a/docs/3.tutorials/nfts/5-approval.md
+++ b/docs/3.tutorials/nfts/5-approval.md
@@ -288,7 +288,7 @@ Next, you'll deploy this contract to the network.
Using the cargo-near, deploy and initialize the contract as you did in the previous tutorials:
```bash
-cargo near deploy $APPROVAL_NFT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$APPROVAL_NFT_CONTRACT_ID'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
+cargo near deploy build-non-reproducible-wasm $APPROVAL_NFT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$APPROVAL_NFT_CONTRACT_ID'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
```
diff --git a/docs/3.tutorials/nfts/6-royalty.md b/docs/3.tutorials/nfts/6-royalty.md
index 434f21d9b88..73d535f7315 100644
--- a/docs/3.tutorials/nfts/6-royalty.md
+++ b/docs/3.tutorials/nfts/6-royalty.md
@@ -166,7 +166,7 @@ Next, you'll deploy this contract to the network.
Using the cargo-near, deploy and initialize the contract as you did in the previous tutorials:
```bash
-cargo near deploy $ROYALTY_NFT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$ROYALTY_NFT_CONTRACT_ID'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
+cargo near deploy build-non-reproducible-wasm $ROYALTY_NFT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$ROYALTY_NFT_CONTRACT_ID'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
```
### Minting {#minting}
diff --git a/docs/3.tutorials/nfts/7-events.md b/docs/3.tutorials/nfts/7-events.md
index 0800e063002..7e7b1a10cb2 100644
--- a/docs/3.tutorials/nfts/7-events.md
+++ b/docs/3.tutorials/nfts/7-events.md
@@ -207,7 +207,7 @@ Next, you'll deploy this contract to the network.
Using the cargo-near, deploy and initialize the contract as you did in the previous tutorials:
```bash
-cargo near deploy $EVENTS_NFT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$EVENTS_NFT_CONTRACT_ID'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
+cargo near deploy build-non-reproducible-wasm $EVENTS_NFT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$EVENTS_NFT_CONTRACT_ID'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
```
diff --git a/docs/3.tutorials/nfts/8-marketplace.md b/docs/3.tutorials/nfts/8-marketplace.md
index fca75d6e4b7..8db4f6da0e2 100644
--- a/docs/3.tutorials/nfts/8-marketplace.md
+++ b/docs/3.tutorials/nfts/8-marketplace.md
@@ -191,7 +191,7 @@ Next, you'll deploy this contract to the network.
Using the build script, deploy the contract as you did in the previous tutorials:
```bash
-cargo near deploy $MARKETPLACE_CONTRACT_ID with-init-call new json-args '{"owner_id": "'$MARKETPLACE_CONTRACT_ID'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
+cargo near deploy build-non-reproducible-wasm $MARKETPLACE_CONTRACT_ID with-init-call new json-args '{"owner_id": "'$MARKETPLACE_CONTRACT_ID'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
```
diff --git a/docs/3.tutorials/nfts/9-series.md b/docs/3.tutorials/nfts/9-series.md
index 3914fe298c6..3887969e17b 100644
--- a/docs/3.tutorials/nfts/9-series.md
+++ b/docs/3.tutorials/nfts/9-series.md
@@ -316,7 +316,7 @@ echo $NFT_CONTRACT_ID
This should return your ``. The next step is to initialize the contract with some default metadata.
```bash
-cargo near deploy $NFT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$NFT_CONTRACT_ID'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
+cargo near deploy build-non-reproducible-wasm $NFT_CONTRACT_ID with-init-call new_default_meta json-args '{"owner_id": "'$NFT_CONTRACT_ID'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
```
If you now query for the metadata of the contract, it should return our default metadata.
diff --git a/docs/3.tutorials/nfts/js/2-minting.md b/docs/3.tutorials/nfts/js/2-minting.md
index e82458a0b29..2b19705b496 100644
--- a/docs/3.tutorials/nfts/js/2-minting.md
+++ b/docs/3.tutorials/nfts/js/2-minting.md
@@ -222,7 +222,7 @@ Verify that the correct account ID is printed in the terminal. If everything loo
In the root of your NFT project run the following command to deploy your smart contract.
```bash
-cargo near deploy $NFT_CONTRACT_ID
+cargo near deploy build-non-reproducible-wasm $NFT_CONTRACT_ID
```
At this point, the contract should have been deployed to your account and you're ready to move onto testing and minting NFTs.
From e079f0981365c665e1f6e4fc89d0be826fc644a4 Mon Sep 17 00:00:00 2001
From: Guille
Date: Sat, 4 Jan 2025 22:02:40 +0100
Subject: [PATCH 34/35] fix deploy commands for js examples (#2408)
Co-authored-by: Guillermo Alejandro Gallardo Diez
---
docs/3.tutorials/examples/advanced-xcc.md | 22 ++++++++++++++++---
docs/3.tutorials/examples/count-near.md | 26 +++++++++++++++++++----
docs/3.tutorials/examples/donation.md | 22 ++++++++++++++++---
docs/3.tutorials/examples/guest-book.md | 24 +++++++++++++++++----
docs/3.tutorials/examples/xcc.md | 23 +++++++++++++++++---
5 files changed, 100 insertions(+), 17 deletions(-)
diff --git a/docs/3.tutorials/examples/advanced-xcc.md b/docs/3.tutorials/examples/advanced-xcc.md
index e2edac64fc0..eae98efc9b9 100644
--- a/docs/3.tutorials/examples/advanced-xcc.md
+++ b/docs/3.tutorials/examples/advanced-xcc.md
@@ -289,9 +289,25 @@ In order to deploy the contract you will need to create a NEAR account.
Go into the directory containing the smart contract (`cd contract-advanced-ts` or `cd contract-advanced-rs`), build and deploy it:
-```bash
-cargo near deploy build-non-reproducible-wasm with-init-call new json-args '{"hello_account":"hello.near-example.testnet","guestbook_account":"guestbook_account.near-example.testnet","counter_account":"counter_account.near-example.testnet"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
-```
+
+
+
+
+ ```bash
+ npm run build
+ near deploy ./build/cross_contract.wasm --initFunction new --initArgs '{"hello_account":"hello.near-example.testnet","guestbook_account":"guestbook_account.near-example.testnet","counter_account":"counter_account.near-example.testnet"}'
+ ```
+
+
+
+
+ ```bash
+ cargo near deploy build-non-reproducible-wasm with-init-call new json-args '{"hello_account":"hello.near-example.testnet","guestbook_account":"guestbook_account.near-example.testnet","counter_account":"counter_account.near-example.testnet"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
+ ```
+
+
+
+
diff --git a/docs/3.tutorials/examples/count-near.md b/docs/3.tutorials/examples/count-near.md
index e5e9db885d8..52e045d09c1 100644
--- a/docs/3.tutorials/examples/count-near.md
+++ b/docs/3.tutorials/examples/count-near.md
@@ -116,7 +116,7 @@ The contract presents 4 methods: `get_num`, `increment`, `decrement`, and `reset
+ start="3" end="33" />
-```
+
+
+
+
+ ```bash
+ npm run build
+ near deploy ./build/counter.wasm
+ ```
+
+
+
+
+ ```bash
+ cargo near deploy build-non-reproducible-wasm
+ ```
+
+
+
+
+
:::tip
To interact with your contract from the [frontend](#frontend), simply replace the value of the `testnet` key in the `config.js` file.
:::
+
### CLI: Interacting with the Contract
diff --git a/docs/3.tutorials/examples/donation.md b/docs/3.tutorials/examples/donation.md
index 95bd637a8b7..1175a4c97e3 100644
--- a/docs/3.tutorials/examples/donation.md
+++ b/docs/3.tutorials/examples/donation.md
@@ -185,9 +185,25 @@ In order to deploy the contract you will need to create a NEAR account.
Go into the directory containing the smart contract (`cd contract-ts` or `cd contract-rs`), build and deploy it:
-```bash
-cargo near deploy build-non-reproducible-wasm
-```
+
+
+
+
+ ```bash
+ npm run build
+ near deploy ./build/donation.wasm
+ ```
+
+
+
+
+ ```bash
+ cargo near deploy build-non-reproducible-wasm
+ ```
+
+
+
+
:::tip
To interact with your contract from the [frontend](#frontend), simply replace the variable `CONTRACT_NAME` in the `index.js` file.
diff --git a/docs/3.tutorials/examples/guest-book.md b/docs/3.tutorials/examples/guest-book.md
index 86be34a066e..78ea630f316 100644
--- a/docs/3.tutorials/examples/guest-book.md
+++ b/docs/3.tutorials/examples/guest-book.md
@@ -25,7 +25,7 @@ You have two options to start the Guest book Example.
2. Clone the repository locally and use it from your computer.
| Codespaces | Clone locally |
-| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
+|-----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------|
| [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/near-examples/guest-book-examples) | π `https://github.com/near-examples/guest-book-examples` |
---
@@ -183,9 +183,25 @@ In order to deploy the contract you will need to create a NEAR account.
Go into the directory containing the smart contract (`cd contract-ts` or `cd contract-rs`), build and deploy it:
-```bash
-cargo near deploy build-non-reproducible-wasm
-```
+
+
+
+
+ ```bash
+ npm run build
+ near deploy ./build/guest_book.wasm
+ ```
+
+
+
+
+ ```bash
+ cargo near deploy build-non-reproducible-wasm
+ ```
+
+
+
+
:::tip
To interact with your contract from the [frontend](#frontend), simply replace the variable `CONTRACT_NAME` in the `index.js` file.
diff --git a/docs/3.tutorials/examples/xcc.md b/docs/3.tutorials/examples/xcc.md
index f0af14951ce..71d5fe0a189 100644
--- a/docs/3.tutorials/examples/xcc.md
+++ b/docs/3.tutorials/examples/xcc.md
@@ -167,9 +167,26 @@ In order to deploy the contract you will need to create a NEAR account.
Go into the directory containing the smart contract (`cd contract-advanced-ts` or `cd contract-advanced-rs`), build and deploy it:
-```bash
-cargo near deploy build-non-reproducible-wasm with-init-call new json-args '{"hello_account":"hello.near-example.testnet"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
-```
+
+
+
+
+ ```bash
+ npm run build
+ near deploy ./build/cross_contract.wasm --initFunction new --initArgs '{"hello_account":"hello.near-example.testnet"}'
+ ```
+
+
+
+
+ ```bash
+ cargo near deploy build-non-reproducible-wasm with-init-call new json-args '{"hello_account":"hello.near-example.testnet"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' network-config testnet sign-with-keychain send
+
+ ```
+
+
+
+
From 0384e45e0a4601f90836114e63d3660d2298411e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dami=C3=A1n=20Parrino?=
Date: Sat, 4 Jan 2025 19:00:35 -0300
Subject: [PATCH 35/35] Clean up NFT articles and tutorials (#2371)
* update
* update
* Update nft.md
* update
* Update docs/3.tutorials/nfts/minting-nfts.md
* Apply suggestions from code review
* chore: merged nav links into group
---------
Co-authored-by: Guille
Co-authored-by: Guillermo Alejandro Gallardo Diez
---
docs/2.build/5.primitives/nft.md | 18 +-
docs/3.tutorials/nfts/minecraft-nfts.md | 319 ------------------
docs/3.tutorials/nfts/minting-nfts.md | 22 +-
.../nfts/simple-nft-minting-example.md | 69 ----
website/sidebars.js | 43 ++-
5 files changed, 56 insertions(+), 415 deletions(-)
delete mode 100644 docs/3.tutorials/nfts/minecraft-nfts.md
delete mode 100644 docs/3.tutorials/nfts/simple-nft-minting-example.md
diff --git a/docs/2.build/5.primitives/nft.md b/docs/2.build/5.primitives/nft.md
index 2323fc13666..7fb4af482ec 100644
--- a/docs/2.build/5.primitives/nft.md
+++ b/docs/2.build/5.primitives/nft.md
@@ -56,7 +56,7 @@ The easiest way to create and handle NFTs is by using one of the existing commun
---
## Deploying a NFT Contract
-If you want to deploy your own NFT contract, you can create one using our [reference implementation](https://github.com/near-examples/NFT)
+If you want to deploy your own NFT contract, you can create one using our [reference implementation](https://github.com/near-examples/NFT)
Simply personalize it and deploy it to your account.
@@ -159,7 +159,7 @@ In both cases, it is necessary to invoke the `nft_transfer` method, indicating t
-
+
@@ -240,9 +240,9 @@ Basic NFT contracts following [the NEP-171 and NEP-177 standards](https://nomico
For this purpose, there are ecosystem apps such as [Paras](https://paras.id/) or [Mintbase](https://www.mintbase.xyz/), that use dedicated marketplace contracts.
-In order to put a NFT for a sale on a marketplace you need to do two actions:
+In order to put a NFT for a sale on a marketplace you need to do two actions:
-1. Cover data storage costs in the marketplace contract.
+1. Cover data storage costs in the marketplace contract.
2. Approve the marketplace to sell the NFT in your NFT contract.
@@ -284,11 +284,15 @@ For this purpose, there are ecosystem apps such as [Paras](https://paras.id/) or
---
+## Tutorials
+
+- [NFT Tutorial](/tutorials/nfts/js/introduction) _Zero to Hero_ (JavaScript SDK) - a set of tutorials that cover how to create a NFT contract using JavaScript.
+- [NFT Tutorial](/tutorials/nfts/introduction) _Zero to Hero_ (Rust SDK) - a set of tutorials that cover how to create a NFT contract using Rust.
+
+
## Additional Resources
-1. [NFT Tutorial](/tutorials/nfts/js/introduction) (NEAR examples, JavaScript SDK) - a set of tutorials that cover how to create a NFT contract using JavaScript.
-2. [NFT Tutorial](/tutorials/nfts/introduction) (NEAR examples, Rust SDK) - a set of tutorials that cover how to create a NFT contract using Rust.
3. [NFT Tutorial by Keypom](https://github.com/keypom/nft-tutorial-series) (a fork of the NEAR example tutorial).
4. [Paras API documentation](https://parashq.github.io/).
5. [Mintbase API documentation](https://docs.mintbase.xyz/dev/mintbase-graph).
-6. [Mintbase JS SDK](https://docs.mintbase.xyz/dev/mintbase-sdk-ref) - a set of methods to get data from blockchain, interact with Mintbase contracts, etc.
\ No newline at end of file
+6. [Mintbase JS SDK](https://docs.mintbase.xyz/dev/mintbase-sdk-ref) - a set of methods to get data from blockchain, interact with Mintbase contracts, etc.
diff --git a/docs/3.tutorials/nfts/minecraft-nfts.md b/docs/3.tutorials/nfts/minecraft-nfts.md
deleted file mode 100644
index 0ba2f7c2bd6..00000000000
--- a/docs/3.tutorials/nfts/minecraft-nfts.md
+++ /dev/null
@@ -1,319 +0,0 @@
----
-id: minecraft-nfts
-title: Create NFTs in Minecraft
-sidebar_label: Minecraft NFTs
----
-
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-
-> In this tutorial you'll learn how to take your custom Minecraft creations and mint the schematics into NFTs on the NEAR blockchain!
-
-## Overview
-
-This tutorial will run you through minting Minecraft structures of any size onto the NEAR blockchain. It will allow you to copy and paste the designs into your own worlds. For this, we will be using WorldEdit to download and read the schematics and we'll put them on-chain using [IPFS](https://ipfs.io/).
-
-## Prerequisites
-
-:::info
-It is recommended that you first complete the introductory **[minting NFTs tutorial](/tutorials/nfts/minting-nfts)**
-:::
-
-To complete this tutorial successfully, you'll need:
-
-- [A Minecraft account](https://www.minecraft.net/)
-- [WorldEdit installed](https://worldedit.enginehub.org/en/latest/install/)
-- [A NEAR account](#wallet)
-- [NEAR command-line interface](/tools/near-cli#installation) (`near-cli`)
-
-## Creating a Schematic
-
-In this section, we'll be creating the Minecraft schematic to put on chain.
-
-### Setup
-
-- Once you have [WorldEdit](https://worldedit.enginehub.org/en/latest/install/) installed and Minecraft loaded up, let's check if WorldEdit is working properly by running:
-
-```bash
-//pos1
-```
-
-If WorldEdit is properly installed, it should output `First position set to (X, Y, Z).` where X, Y, and Z are coordinates.
-
-For this tutorial, we will be minting a small village house. To follow along, choose any structure that you'd like to mint as shown below:
-
-![Village House Minecraft](/docs/assets/nfts/village-house-minecraft.png)
-
-You'll then want to choose the boundaries of the structure that you'd like to copy. We will turn these into schematics which will be placed on chain for you or others to download and paste in your own worlds.
-
-- To do this, we'll need to outline the boundaries of the build using WorldEdit. Stand in the bottom left corner of your build and run:
-
-```bash
-//pos1
-```
-
-- You can then move to the top right corner and run:
-
-```bash
-//pos2
-```
-
-Setting these two positions has now created a cube around your build.
-
-- We can now copy the contents of that build by running:
-
-```bash
-//copy
-```
-
-The output should look something like this:
-
-![Copy Chat Message](/docs/assets/nfts/copy-chat-message-minecraft.png)
-
-:::info TIP
-Remember to note the position of your player when copying. If you copy the build and lets say you're standing on the roof, when you paste the build it will paste the build in a way that will result in you standing on the roof.
-:::
-
-### Sanity Check
-
-We can check and see if our build is fine by pasting what we just copied elsewhere in our world.
-
-- Go to a location that you would like to paste the build and run:
-
-```bash
-//paste
-```
-
-In the example below, we pasted the village house floating above a coral reef biome. You should also see a response notifying you that the clipboard has been pasted. (See example below)
-
-![Pasted Minecraft House](/docs/assets/nfts/pasted-minecraft-house.png)
-
-### Creating the Schematics File
-
-When you're happy with the build you've just copied and pasted, it's time to create the schematic file that we'll mint into an NFT. To do this we'll run a WorldEdit command that will save the schematic file on our local machine.
-
-- To do this, run the command `schematic save FILE_NAME` replacing `FILE_NAME` with a name of your choosing.
-
-This will save the file to your Minecraft folder with under `minecraft/config/worldedit/schematics` witha `.schem` extension.
-
-- Now test your file by loading the schematic we just saved using `schematic load FILE_NAME`.
-
-This will load the schematic to our clipboard and we're free to paste it in our world.
-
-## Minting the Schematic
-
-In this section, we'll mint the schematics file, we've just created and put it on the blockchain using IPFS and web3.storage. In order to proceed, you need to locate the `FILE_NAME.schem` we created in the last section. This file can be found in your Minecraft folder under `minecraft/config/worldedit/schematics`. The location of your minecraft folder differs depending on your OS.
-
-### Uploading the schematic
-
-To upload the schematic, we are going to use the free [web3.storage](https://web3.storage/) service built for storing off-chain data.
-Web3.storage offers free decentralized storage and bandwidth on [IPFS](https://ipfs.io/) and [Filecoin](https://filecoin.io/).
-
-#### Steps
-
-1. Register an account and log in to [web3.storage](https://web3.storage/) either via email or your GitHub.
-
-2. Go to the [Files](https://web3.storage/) section, and click on the [Upload more Files](https://web3.storage/) button.
-
- ![web3.storage](/docs/assets/nfts/web3-storage-upload.png)
-
-3. Once you have uploaded your file, you'll get a unique `CID` for your content, and a URL similar to:
- ```
- https://bafybeidadhfilezx23dcdaueo3bjuafqeehokw33vyepkjtppigorrhbpy.ipfs.dweb.link/
- ```
-
-:::info
-See the [web3.storage docs](https://docs.web3.storage/) for information on uploading multiple files and available API endpoints.
-:::
-
-### Interacting With the Contract
-
-NEAR has already deployed a contract to the account `nft.examples.testnet` which allows users to freely mint tokens. This is the account we'll be interacting with to mint our NFTs. Alternatively, if you've deployed a contract when following the original tutorial, you can use that as well.
-
-:::info
-We'll be using the IPFS link we got in step three of the uploading process above as the media value when calling `nft_mint`.
-:::
-
-- Run the following command and replace the `receiver_id` field and the `--accountId` flag with the account ID you're [logged into](../../4.tools/cli.md#import) with NEAR CLI:
-
-
-
-
- ```bash
- near call nft.examples.testnet nft_mint '{"token_id": "my-token-unique-id", "receiver_id": "YOUR_ACCOUNT", "metadata": { "title": "YOUR NFT TITLE", "description": "YOUR NFT DESCRIPTION", "media": "https://bafybeidadhfilezx23dcdaueo3bjuafqeehokw33vyepkjtppigorrhbpy.ipfs.dweb.link/", "copies": 1}}' --accountId YOUR_ACCOUNT --deposit 0.1
- ```
-
-
-
-
- ```bash
- near contract call-function as-transaction nft.examples.testnet nft_mint json-args '{"token_id": "my-token-unique-id", "receiver_id": "YOUR_ACCOUNT", "metadata": { "title": "YOUR NFT TITLE", "description": "YOUR NFT DESCRIPTION", "media": "https://bafybeidadhfilezx23dcdaueo3bjuafqeehokw33vyepkjtppigorrhbpy.ipfs.dweb.link/", "copies": 1}}' prepaid-gas '100.0 Tgas' attached-deposit '0.1 NEAR' sign-as YOUR_ACCOUNT network-config testnet sign-with-keychain send
- ```
-
-
-
-- Be sure to replace the title, description and media URL with your own.
-
-
-Example response:
-
-
-
-- To view tokens owned by an account on the `example-nft` contract, you can call the contract with the following `near-cli` command:
-
-
-
-
- ```bash
- near view nft.examples.testnet nft_tokens_for_owner '{"account_id": "YOUR_ACCOUNT"}'
- ```
-
-
-
-
- ```bash
- near contract call-function as-read-only nft.examples.testnet nft_tokens_for_owner json-args '{"account_id": "YOUR_ACCOUNT"}' network-config testnet now
- ```
-
-
-
-
-Example response:
-
-
-
-## Using the Village Schematic
-
-Now that you've uploaded your schematic to the blockchain, all someone would need to do to paste it in their own world would be to download the `*.schem` file associated with the IPFS link we minted the NFT with and place it in their schematics folder.
-
-As a test, we've minted an NFT that contains the village schematic we've been working with so that you can download it and paste it in your world.
-
-### Getting the Schematics File
-
-The first thing you'll need to do is view the metadata for the token we've minted that contains the IPFS link to the village schematic. We've minted a token with the ID `village-schematic` under the account `village-schematic.testnet`.
-
-- To get the media link, run the following command:
-
-
-
-
- ```bash
- near view nft.examples.testnet nft_tokens_for_owner '{"account_id": "village-schematic.testnet"}'
- ```
-
-
-
-
- ```bash
- near contract call-function as-read-only nft.examples.testnet nft_tokens_for_owner json-args '{"account_id": "village-schematic.testnet"}' network-config testnet now
- ```
-
-
-
-
-Expected response:
-
-
-
-- You can then take the media link and paste it into your browser. It should send you to a page that looks similar to this:
-
-![IPFS Village Schem](/docs/assets/nfts/IPFS-village-schem.png)
-
-- If you click on the file called `village-house.schem`, it will download the file.
-- You can then copy the schematics file and paste it into your `minecraft/config/worldedit/schematics` folder.
-
-### Loading the Schematics File in Minecraft
-
-- After you've pasted the schematics file into the `minecraft/config/worldedit/schematics` folder, you can then load the schematic into your clipboard by running the following command in your minecraft world:
-
-```bash
-//schematics load village-house
-```
-
-- You can now paste the file anywhere in your world by simply using the `//paste` command and voila! You should see something similar to this:
-
-![Final Village Pasting](/docs/assets/nfts/final-village-pasting.png)
-
-Congratulations! You've just learned how to mint a Mincraft schematic NFT and load it into your world!
-
-## Versioning for this article
-
-At the time of this writing, this example works with the following versions:
-
-- near-cli: `2.1.1`
diff --git a/docs/3.tutorials/nfts/minting-nfts.md b/docs/3.tutorials/nfts/minting-nfts.md
index 4129d7ef657..aa732e9c981 100644
--- a/docs/3.tutorials/nfts/minting-nfts.md
+++ b/docs/3.tutorials/nfts/minting-nfts.md
@@ -138,19 +138,21 @@ self.owner_by_id.insert(&token_id, &owner_id);
To build your contract run the following command in your terminal which builds your contract using Rust's `cargo`.
```bash
-./scripts/build.sh
+cargo near build
```
This will generate WASM binaries into your `res/` directory. This WASM file is the smart contract we'll be deploying onto the NEAR blockchain.
-> **Tip:** If you run into errors make sure you have [Rust installed](/build/smart-contracts/quickstart#prerequisites) and are in the root directory of the NFT example.
+:::tip
+If you run into errors make sure you have [Rust installed](/build/smart-contracts/quickstart#prerequisites) and are in the root directory of the NFT example.
+:::
### Testing the contract {#testing-the-contract}
Written in the smart contract there are pre-written tests that you can run. Run the following command in your terminal to perform these simple tests to verify that your contract code is working.
```bash
-cargo test -- --nocapture
+cargo test
```
> **Note:** the more complex simulation tests aren't performed with this command but you can find them in `tests/sim`.
@@ -399,14 +401,12 @@ Finally, if you are new to Rust and want to dive into smart contract development
**_Happy minting!_** πͺ
-## Blockcraft - a Practical Extension
-
-If you'd like to learn how to use Minecraft to mint NFTs and copy/paste builds across different worlds while storing all your data on-chain, be sure to check out our [Minecraft tutorial](/tutorials/nfts/minecraft-nfts)
-
-## Versioning for this article {#versioning-for-this-article}
+:::note Versioning for this article
At the time of this writing, this example works with the following versions:
-- cargo: `cargo 1.54.0 (5ae8d74b3 2021-06-22)`
-- rustc: `rustc 1.54.0 (a178d0322 2021-07-26)`
-- near-cli: `2.1.1`
+- cargo: `cargo 1.83.0 (5ffbef321 2024-10-29)`
+- rustc: `rustc 1.83.0 (90b35a623 2024-11-26)`
+- near-cli-rs: `0.16.1`
+
+:::
diff --git a/docs/3.tutorials/nfts/simple-nft-minting-example.md b/docs/3.tutorials/nfts/simple-nft-minting-example.md
deleted file mode 100644
index fd68d09eea2..00000000000
--- a/docs/3.tutorials/nfts/simple-nft-minting-example.md
+++ /dev/null
@@ -1,69 +0,0 @@
----
-id: minting-nft-frontend
-title: Minting NFT Front-end
-sidebar_label: Minting Front-end
----
-import {Github} from "@site/src/components/codetabs"
-
-# NFT Minting Front-end
-
-> In this tutorial you'll learn how to create a simple NFT front-end and mint a "Go Team" NFT on the NEAR blockchain straight from your web browser.
-
-## App Overview
-
-The app is fairly simple: the user signs in and hits the Mint NFT button. Once the user hits the mint button, a "Go Team" NFT is minted and sent to their NEAR Wallet.
-
-![Front-end](/docs/assets/nfts/nft-mint-frontend.png)
-
-## Smart Contract code
-
-The code for the NFT smart contract can be found in the [Zero to Hero NFT tutorial](/tutorials/nfts/introduction)'s [GitHub repository](https://github.com/near-examples/nft-tutorial/tree/main/nft-contract/src), under the `main` branch.
-
-The contract methods used in this application are as follows:
-
-- `nft_mint`: Function used to mint tokens.
-- `check_token`: Custom function created to check for the existence of a token. This helps to ensure one token per user.
-
-## Front-end
-
-The front-end of the contract was implemented using `create-near-app`. [React Bootstrap](https://react-bootstrap.github.io/) was used for the styling of the application.
-
-To bootstrap your React front-end, run the following command on your terminal:
-
-```sh
-npx create-near-app --frontend react --contract rust
-```
-
-Then, simply import the contract files from the `main` branch, and you'll have the needed structure to run the application.
-
-### Start
-
-Upon mounting the application's components, the app checks for the existence of a non-fungible token.
-
-
-
-If no prior NFT has been minted, the mint button will be available for use.
-
-### Mint button
-
-Here is the function behind the mint button. The meta data has been filled out for the user already:
-
-- `token_id` is set by the user's account id,
-- and the `media` link is hard-coded to a `goteam-gif.gif` hosted on IPFS.
-
-
-
-After hitting the Mint NFT button the user will be able to check out the newly minted NFT at [wallet.testnet.near.org](https://testnet.mynearwallet.com//?tab=collectibles), under the Wallet's `Collectibles` tab.
-
-## Final remarks
-
-You can find the complete application repository [on GitHub](https://github.com/near-examples/nft-tutorial-frontend) to clone and run.
-In the configuration folder you can see that this smart contract has been deployed to `nft-frontend-simple-mint.blockhead.testnet`:
-
-
-
-You can also check out the [explorer link here](https://testnet.nearblocks.io/address/nft-frontend-simple-mint.blockhead.testnet) to see how many individuals have been minting their own _Go Team_ NFTs. _**Happy Minting!**_
-
-:::tip
-Clone and run this example from https://github.com/near-examples/nft-tutorial-frontend
-:::
diff --git a/website/sidebars.js b/website/sidebars.js
index 69a328599c6..ec61f00fc17 100644
--- a/website/sidebars.js
+++ b/website/sidebars.js
@@ -248,8 +248,40 @@ const sidebar = {
"build/primitives/what-is",
{
"Primitives & Standards": [
- "build/primitives/ft",
- "build/primitives/nft",
+ {
+ type: 'category',
+ label: 'Fungible Tokens (FT)',
+ items: [
+ "build/primitives/ft",
+ {
+ "type": "link",
+ "label": "Tutorial: Zero to Hero (Rust) β",
+ "href": "/tutorials/fts/introduction"
+ },
+ ]
+ },
+ {
+ type: 'category',
+ label: 'Non Fungible Tokens (NFT)',
+ items: [
+ "build/primitives/nft",
+ {
+ "type": "link",
+ "label": "Tutorial: Minting NFTs β",
+ "href": "/tutorials/nfts/minting-nfts"
+ },
+ {
+ "type": "link",
+ "label": "Tutorial: Zero to Hero (JS) β",
+ "href": "/tutorials/nfts/js/introduction"
+ },
+ {
+ "type": "link",
+ "label": "Tutorial: Zero to Hero (Rust) β",
+ "href": "/tutorials/nfts/introduction"
+ },
+ ]
+ },
"build/primitives/linkdrop",
"build/primitives/oracles",
"build/primitives/dao",
@@ -400,13 +432,6 @@ const sidebar = {
{
"Non-Fungible Tokens (NFT)": [
"tutorials/nfts/minting-nfts",
- "tutorials/nfts/minting-nft-frontend",
- "tutorials/nfts/minecraft-nfts",
- {
- "type": "link",
- "label": "Building a Frontend",
- "href": "https://github.com/near-examples/nft-tutorial-frontend"
- },
{
"type": "html",
"value": ""