You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/3.tutorials/auction/4-factory.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ import {Github, Language} from "@site/src/components/codetabs"
8
8
9
9
Since an auction contract hosts a single auction, each time you would like to host a new auction you will need to deploy a new contract. Rather than finding the compiled WASM file, creating a new account, deploying the contract, and then initializing it each time, you can use a factory contract to do this for you.
10
10
11
-
Luckily for us, there is already a [factory contract example](https://github.com/near-examples/factory-rust)! We will fork this example and slightly modify it to suit our use case. If you would like to learn more about how the factory contract works, you can take a look at the [associated documentation](https://docs.near.org/tutorials/examples/factory#generic-factory).
11
+
Luckily for us, there is already a [factory contract example](https://github.com/near-examples/factory-rust)! We will fork this example and slightly modify it to suit our use case. If you would like to learn more about how the factory contract works, you can take a look at the [associated documentation](/tutorials/examples/factory#generic-factory).
12
12
13
13
The factory example only comes in rust since, currently, the JavaScript SDK does not allow you to embed the WASM file in the contract. This is a limitation of the SDK and not the blockchain itself.
Copy file name to clipboardexpand all lines: docs/3.tutorials/crosswords/01-basics/00-overview.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ import rustGood from '/docs/assets/crosswords/rust-good--ksart.near.png';
11
11
12
12
# Basics overview
13
13
14
-
This first chapter of the crossword puzzle tutorial will introduce fundamental concepts to smart contract development in a beginner-friendly way. By the end of this chapter you'll have a proof-of-concept contract that can be interacted with via [NEAR CLI](https://docs.near.org/tools/near-cli) and a simple frontend that uses the [`near-api-js` library](https://www.npmjs.com/package/near-api-js).
14
+
This first chapter of the crossword puzzle tutorial will introduce fundamental concepts to smart contract development in a beginner-friendly way. By the end of this chapter you'll have a proof-of-concept contract that can be interacted with via [NEAR CLI](/tools/near-cli) and a simple frontend that uses the [`near-api-js` library](https://www.npmjs.com/package/near-api-js).
Copy file name to clipboardexpand all lines: docs/3.tutorials/crosswords/01-basics/02-add-functions-call.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ Before moving on, let's talk about these changes and how to think about them, be
33
33
constPUZZLE_NUMBER:u8=1;
34
34
```
35
35
36
-
This is an in-memory value, meaning that when the smart contract is spun up and executed in the virtual machine, the value `1` is contained in the contract code. This differs from the next change, where a field is added to the struct containing the `#[near]` macro. The field `crossword_solution` has the type of `String` and, like any other fields added to this struct, the value will live in **persistent storage**. With NEAR, storage is "paid for" via the native NEAR token (Ⓝ). It is not "state rent" but storage staking, paid once, and returned when storage is deleted. This helps incentivize users to keep their state clean, allowing for a more healthy chain. Read more about [storage staking here](https://docs.near.org/protocol/storage/storage-staking).
36
+
This is an in-memory value, meaning that when the smart contract is spun up and executed in the virtual machine, the value `1` is contained in the contract code. This differs from the next change, where a field is added to the struct containing the `#[near]` macro. The field `crossword_solution` has the type of `String` and, like any other fields added to this struct, the value will live in **persistent storage**. With NEAR, storage is "paid for" via the native NEAR token (Ⓝ). It is not "state rent" but storage staking, paid once, and returned when storage is deleted. This helps incentivize users to keep their state clean, allowing for a more healthy chain. Read more about [storage staking here](/protocol/storage/storage-staking).
As is covered in the [function section of these docs](../../../smart-contracts/anatomy/functions.md), a "view-only" function will have open parenthesis around `&self` while "change methods" or mutable functions will have `&mut self`. In the function above, the `PUZZLE_NUMBER` is returned. A user may call this method using the proper RPC endpoint without signing any transaction, since it's read-only. Think of it like a GET request, but using RPC endpoints that are [documented here](https://docs.near.org/api/rpc/contracts#call-a-contract-function).
46
+
As is covered in the [function section of these docs](../../../smart-contracts/anatomy/functions.md), a "view-only" function will have open parenthesis around `&self` while "change methods" or mutable functions will have `&mut self`. In the function above, the `PUZZLE_NUMBER` is returned. A user may call this method using the proper RPC endpoint without signing any transaction, since it's read-only. Think of it like a GET request, but using RPC endpoints that are [documented here](/api/rpc/contracts#call-a-contract-function).
47
47
48
48
Mutable functions, on the other hand, require a signed transaction. The first example is a typical approach where the user supplies a parameter that's assigned to a field:
49
49
@@ -135,7 +135,7 @@ See this visualization where two keys belonging to `mike.near` are able to creat
135
135
136
136
:::
137
137
138
-
We won't get into top-level accounts or implicit accounts, but you may read more [about that here](https://docs.near.org/docs/concepts/account).
138
+
We won't get into top-level accounts or implicit accounts, but you may read more [about that here](/protocol/account-model).
139
139
140
140
Now that we have a key pair for our subaccount, we can deploy the contract to `testnet` and interact with it!
141
141
@@ -256,7 +256,7 @@ Next, we'll add a crossword solution as a string (later we'll do this in a bette
256
256
</TabItem>
257
257
</Tabs>
258
258
259
-
Note that we used NEAR CLI's [`view` command](https://docs.near.org/docs/tools/near-cli#call), and didn't include an `--accountId` flag. As mentioned earlier, this is because we are not signing a transaction. This second method uses the NEAR CLI [`call` command](https://docs.near.org/docs/tools/near-cli#call) which does sign a transaction and requires the user to specify a NEAR account that will sign it, using the credentials files we looked at.
259
+
Note that we used NEAR CLI's [`view` command](/tools/near-cli#call), and didn't include an `--accountId` flag. As mentioned earlier, this is because we are not signing a transaction. This second method uses the NEAR CLI [`call` command](/tools/near-cli#call) which does sign a transaction and requires the user to specify a NEAR account that will sign it, using the credentials files we looked at.
260
260
261
261
The last method we have will check the argument against what is stored in state and write a log about whether the crossword solution is correct or incorrect.
262
262
@@ -358,9 +358,9 @@ You may hit an RPC endpoint corresponding to `view_state` and see for yourself.
358
358
359
359

360
360
361
-
More on this RPC endpoint in the [NEAR docs](https://docs.near.org/docs/api/rpc/contracts#view-contract-state).
361
+
More on this RPC endpoint in the [NEAR docs](/api/rpc/contracts#view-contract-state).
362
362
:::
363
363
364
-
In this section, we saved the crossword solution as plain text, which is likely not a great idea if we want to hide the solution to players of this crossword puzzle. Even though we don't have a function called `show_solution` that returns the struct's `crossword_solution` field, the value is stored transparently in state. We won't get into viewing contract state at this moment, but know it's rather easy [and documented here](https://docs.near.org/docs/api/rpc/contracts#view-contract-state).
364
+
In this section, we saved the crossword solution as plain text, which is likely not a great idea if we want to hide the solution to players of this crossword puzzle. Even though we don't have a function called `show_solution` that returns the struct's `crossword_solution` field, the value is stored transparently in state. We won't get into viewing contract state at this moment, but know it's rather easy [and documented here](/api/rpc/contracts#view-contract-state).
365
365
366
366
The next section will explore hiding the answer from end users playing the crossword puzzle.
Copy file name to clipboardexpand all lines: docs/3.tutorials/crosswords/01-basics/03-hashing-and-unit-tests.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -192,7 +192,7 @@ Here's a truncated snippet from a useful (though somewhat advanced) repository w
192
192
We'll get into Actions later in this tutorial, but in the meantime here's a handy [reference from the spec](https://nomicon.io/RuntimeSpec/Actions.html).
193
193
:::
194
194
195
-
As you can from the info bubble above, we can batch [Deploy](https://docs.rs/near-sdk/3.1.0/near_sdk/struct.Promise.html#method.deploy_contract) and [FunctionCall](https://docs.rs/near-sdk/3.1.0/near_sdk/struct.Promise.html#method.function_call) Actions. This is exactly what we want to do for our crossword puzzle, and luckily, NEAR CLI has a [flag especially for this](https://docs.near.org/tools/near-cli#near-deploy).
195
+
As you can from the info bubble above, we can batch [Deploy](https://docs.rs/near-sdk/3.1.0/near_sdk/struct.Promise.html#method.deploy_contract) and [FunctionCall](https://docs.rs/near-sdk/3.1.0/near_sdk/struct.Promise.html#method.function_call) Actions. This is exactly what we want to do for our crossword puzzle, and luckily, NEAR CLI has a [flag especially for this](/tools/near-cli#deploy).
196
196
197
197
Let's run this again with the handy `--initFunction` and `--initArgs` flags:
Copy file name to clipboardexpand all lines: docs/5.api/rpc/providers.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ As a user, if a dApp or wallet doesn't support RPC failover and the primary prov
51
51
52
52
## On NEAR.org RPC Deprecation
53
53
54
-
Please read the following announcement: [Future of Pagoda Services](https://docs.near.org/blog/2024-08-13-pagoda-services).
54
+
Please read the following announcement: [Future of Pagoda Services](/blog/2024-08-13-pagoda-services).
55
55
56
56
> 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.
Copy file name to clipboardexpand all lines: docs/6.integrations/accounts.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ Please see the [documentation for accounts](/protocol/account-model) for basic i
13
13
14
14
- For exchanges, NEAR supports [implicit account](https://nomicon.io/DataStructures/Account.html#implicit-account-ids) creation which allows the creation of accounts without paying for transactions.
15
15
- You can create an implicit account by following the steps in [this guide](/integrations/implicit-accounts).
16
-
- Accounts must have enough tokens to cover its storage which currently costs `0.0001 NEAR` per byte. This equates to a minimum balance of `0.00182 NEAR` for an account with one access key. You can query the live storage price using the [`protocol-config`](https://docs.near.org/api/rpc/setup#protocol-config) RPC endpoint. For more details on storage fees see [this section of the economics paper](https://pages.near.org/papers/economics-in-sharded-blockchain/#transaction-and-storage-fees).
16
+
- Accounts must have enough tokens to cover its storage which currently costs `0.0001 NEAR` per byte. This equates to a minimum balance of `0.00182 NEAR` for an account with one access key. You can query the live storage price using the [`protocol-config`](/api/rpc/protocol#protocol-config) RPC endpoint. For more details on storage fees see [this section of the economics paper](https://pages.near.org/papers/economics-in-sharded-blockchain/#transaction-and-storage-fees).
17
17
18
18
## Transfer from Function Call {#transfer-from-function-call}
Copy file name to clipboardexpand all lines: docs/6.integrations/balance.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -128,7 +128,7 @@ Alternatively, you can view account balances by [querying `view_account`](/api/r
128
128
}
129
129
```
130
130
131
-
**Note:** Gas prices can change between blocks. Even for transactions with deterministic gas cost the cost in NEAR could also be different. You can query the gas price for recent blocks using the [`gas_price` RPC endpoint](https://docs.near.org/api/rpc/setup#gas-price).
131
+
**Note:** Gas prices can change between blocks. Even for transactions with deterministic gas cost the cost in NEAR could also be different. You can query the gas price for recent blocks using the [`gas_price` RPC endpoint](/api/rpc/gas#gas-price).
At the top of this section is a link detailing how to [construct a transaction](/integrations/create-transactions#low-level----create-a-transaction) without the full abstraction of the [`near-api-js` library](https://www.npmjs.com/package/near-api-js). For this and future examples that use the [RPC method `broadcast_tx_commit`](https://docs.near.org/api/rpc/setup#send-transaction-await) we will provide a JSON-like object meant to act similar to [pseudocode](https://en.wikipedia.org/wiki/Pseudocode), only imparting high-level details of a transaction. This code block below is the first example of this, detailing what goes into the transaction discussed currently, involving the method `storage_deposit`.
300
+
At the top of this section is a link detailing how to [construct a transaction](/integrations/create-transactions#low-level----create-a-transaction) without the full abstraction of the [`near-api-js` library](https://www.npmjs.com/package/near-api-js). For this and future examples that use the [RPC method `broadcast_tx_commit`](/api/rpc/transactions#send-transaction-await) we will provide a JSON-like object meant to act similar to [pseudocode](https://en.wikipedia.org/wiki/Pseudocode), only imparting high-level details of a transaction. This code block below is the first example of this, detailing what goes into the transaction discussed currently, involving the method `storage_deposit`.
Copy file name to clipboardexpand all lines: docs/chain-abstraction/chain-signatures/getting-started.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -85,12 +85,12 @@ Chain Signatures can be used to build a wide range of applications that leverage
85
85
## How to Get Started?
86
86
87
87
1.**Familiarize Yourself with Chain Signatures:**
88
-
* Understand the [basics of Chain Signatures](https://docs.near.org/concepts/abstraction/chain-signatures) and how they simplify blockchain interactions.
88
+
* Understand the [basics of Chain Signatures](/chain-abstraction/chain-signatures) and how they simplify blockchain interactions.
89
89
* Review the technical [explainer](https://near.org/blog/unlocking-web3-usability-with-account-aggregation).
90
90
2.**Explore the Use Cases:**
91
91
* Review [examples of use cases for Chain Signatures](https://pages.near.org/blog/unlocking-multichain-web3-with-near-chain-signatures/), such as Multichain DAO, Multichain NFT Minter, and Bitcoin Runes Airdrop.
92
92
3.**Access Resources and Documentation:**
93
-
* Visit the [Chain Signatures documentation](https://docs.near.org/build/chain-abstraction/chain-signatures) for detailed technical information and code snippets.
93
+
* Visit the [Chain Signatures documentation](/chain-abstraction/chain-signatures) for detailed technical information and code snippets.
94
94
* Check out the [Linktree for Chain Signatures](https://linktr.ee/chainsignatures) for various resources, including demos and tutorials.
95
95
4.**Try the Demos:**
96
96
* Use the [command-line-based demo](https://github.com/near-examples/chainsig-script) to derive accounts and send transactions on Bitcoin, Ethereum, Doge, and Ripple.
Copy file name to clipboardexpand all lines: docs/chain-abstraction/omnibridge/overview.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ sidebar_label: Overview
4
4
title: Omni Bridge Overview
5
5
---
6
6
7
-
The [Omni Bridge](https://github.com/Near-One/omni-bridge) is a multi-chain asset bridge that facilitates secure and efficient asset transfers between different blockchain networks. It solves key challenges in cross-chain communication by leveraging [Chain Signatures](https://docs.near.org/concepts/abstraction/chain-signatures) and its decentralized [Multi-Party Computation (MPC) service](https://docs.near.org/concepts/abstraction/chain-signatures#multi-party-computation-service) to enable trustless cross-chain asset transfers.
7
+
The [Omni Bridge](https://github.com/Near-One/omni-bridge) is a multi-chain asset bridge that facilitates secure and efficient asset transfers between different blockchain networks. It solves key challenges in cross-chain communication by leveraging [Chain Signatures](/chain-abstraction/chain-signatures) and its decentralized [Multi-Party Computation (MPC) service](/chain-abstraction/chain-signatures#multi-party-computation-service) to enable trustless cross-chain asset transfers.
8
8
9
9
:::tip
10
10
To learn more see [How Omni Bridge Works](./how-it-works.md).
Copy file name to clipboardexpand all lines: docs/data-infrastructure/indexers.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -42,9 +42,9 @@ The dApp has a helper deployed somewhere off-chain, and this helper has code tha
42
42
43
43
### Getting the data from a blockchain from the external world
44
44
45
-
NEAR blockchain implements a [JSON-RPC endpoint](https://docs.near.org/api/rpc/introduction) for everyone to interact with the blockchain. Through the JSON-RPC API users can call smart contracts triggering them to be executed with given parameters. Also, users can view the data from the blockchain.
45
+
NEAR blockchain implements a [JSON-RPC endpoint](/api/rpc/introduction) for everyone to interact with the blockchain. Through the JSON-RPC API users can call smart contracts triggering them to be executed with given parameters. Also, users can view the data from the blockchain.
46
46
47
-
So, continuing with our example we can make our helper pull a [Block](https://docs.near.org/api/rpc/block-chunk#block) every second, then pull all the [Chunks](https://docs.near.org/api/rpc/block-chunk#chunk) and analyze the Transactions included in the Block to check if there is a transaction to our smart contract with "buy an e-book" function call. If we observe such a Transaction, we need to ensure it is successful, so we don't send the e-book to a user whose "buy e-book" Transaction failed.
47
+
So, continuing with our example we can make our helper pull a [Block](/api/rpc/block-chunk#block-details) every second, then pull all the [Chunks](/api/rpc/block-chunk#chunk-details) and analyze the Transactions included in the Block to check if there is a transaction to our smart contract with "buy an e-book" function call. If we observe such a Transaction, we need to ensure it is successful, so we don't send the e-book to a user whose "buy e-book" Transaction failed.
48
48
49
49
After the process is complete we can trigger the helper's code to send the user an email with the e-book they bought.
0 commit comments