Skip to content

Commit

Permalink
Merge branch 'master' into 2381-doc-improve-implementing-chain-signat…
Browse files Browse the repository at this point in the history
…ures-doc
  • Loading branch information
bucanero authored Jan 30, 2025
2 parents 3396540 + ff3a2a5 commit 68757ce
Show file tree
Hide file tree
Showing 32 changed files with 75 additions and 77 deletions.
2 changes: 1 addition & 1 deletion blog/2024-04-24.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ hide_table_of_contents: true
## Organic growth
Our documentation is the result of multiple people collaborating across the span of four very active years, and it has seen a lot of changes: [2942 commits and counting](https://github.com/near/docs/commits/master/).

In the beginning, our docs only needed to explain how to create [smart contracts](/build/smart-contracts/what-is), and how to [interact with them through a frontend](/build/web3-apps/quickstart). Fast forward to today, and we have more than 200 pages of documentation, covering topics such as [chain abstraction](/build/chain-abstraction/what-is), [on-chain components](/build/near-components/what-is), [data infrastructure](/build/data-infrastructure/what-is), and [primitives such as NFT, FT](/build/primitives/what-is).
In the beginning, our docs only needed to explain how to create [smart contracts](/build/smart-contracts/what-is), and how to [interact with them through a frontend](/build/web3-apps/quickstart). Fast forward to today, and we have more than 200 pages of documentation, covering topics such as [chain abstraction](/build/chain-abstraction/what-is), [data infrastructure](/build/data-infrastructure/what-is), and [primitives such as NFT, FT](/build/primitives/what-is).

The best thing is that new features are released every single month. However, all progress comes at a cost, and as our ecosystem grew, so did the disorganization of our documentation.

Expand Down
2 changes: 1 addition & 1 deletion blog/2024-07-01.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ If your application relies on community-contributed or unreviewed third-party co

If you are not relying on any untrusted component code, then **maybe**. You are not being forced to migrate and there are still teams actively building new applications leveraging B.O.S. Additionally, there are no plans to deprecate main B.O.S. gateways at [dev.near.org](https://dev.near.org), [near.social](https://near.social), [dapdap](https://dapdap.net) or [bos.gg](https://bos.gg). However, the underlying framework and virtual machine are no longer actively developed or maintained by the original team. Consequently, the pace at which new features are introduced and existing bugs or vulnerabilities are addressed may be slower than expected. We openly welcome new maintainers for [this codebase](https://github.com/nearsocial). However, as previously mentioned, we anticipate that additional security vulnerabilities may still be discovered.

We have updated [“Frontends for Web3 dApps” in docs.near.org](https://docs.near.org/build/web3-apps/frontend) to help you choose a solution that is right for you. If you need help, please reach out to one of our support channels on [Telegram](https://t.me/neardev) or [Discord](https://near.chat) and we will be happy to assist you or answer any questions you have.
We have updated [“Frontends for Web3 dApps” in docs.near.org](https://docs.near.org/build/web3-apps/integrate-contracts) to help you choose a solution that is right for you. If you need help, please reach out to one of our support channels on [Telegram](https://t.me/neardev) or [Discord](https://near.chat) and we will be happy to assist you or answer any questions you have.
2 changes: 1 addition & 1 deletion blog/2024-08-13.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ As the NEAR ecosystem continues to decentralize, Pagoda will cease operations wi
The critical services below will continue to be operated and maintained by Pagoda until they are smoothly transitioned to new operators in the NEAR ecosystem during the second half of 2024:

- [near.org RPC](https://docs.near.org/api/rpc/providers) ([Request for Proposals](https://dev.near.org/infrastructure-committee.near/widget/app?page=rfp&id=2))
- [NEAR Lake](https://docs.near.org/concepts/advanced/near-lake-framework) ([Request for Proposals](https://dev.near.org/infrastructure-committee.near/widget/app?page=rfp&id=3))
- [NEAR Lake](https://docs.near.org/build/data-infrastructure/lake-framework/near-lake-framework) ([Request for Proposals](https://dev.near.org/infrastructure-committee.near/widget/app?page=rfp&id=3))
- [BigQuery Public Dataset](https://docs.near.org/build/data-infrastructure/big-query) ([Request for Proposals](https://dev.near.org/infrastructure-committee.near/widget/app?page=rfp&id=4))
- [Node Snapshots](https://near-nodes.io/intro/node-data-snapshots)
- [State Sync](https://near-nodes.io/rpc/state-sync)
Expand Down
2 changes: 1 addition & 1 deletion docs/1.concepts/abstraction/chain-signatures.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ This contract has a `sign` method that takes two parameters:
For example, a user could request a signature to `send 0.1 ETH to 0x060f1...` **(transaction)** using the `ethereum-1` account **(path)**.


After a request is made, the `sign` method will [yield execution](/blog/yield-resume) waiting while the [MPC signing service](#multi-party-computation-service-mpc) signs the transaction.
After a request is made, the `sign` method will [yield execution](/blog/yield-resume) waiting while the [MPC signing service](#multi-party-computation-service) signs the transaction.

Once the signature is ready, the contract resumes computation and returns it to the user. This signature is a valid signed transaction that can be readily sent to the target blockchain to be executed.

Expand Down
4 changes: 2 additions & 2 deletions docs/1.concepts/abstraction/meta-tx.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ but will fail on Bob's shard.

## Function Call Access Keys in Meta Transactions

[Function Call Access Keys](../protocol/access-keys.md#function-call-keys-function-call-keys)
[Function Call Access Keys](../protocol/access-keys.md#function-call-keys)
are limited to signing transactions for specific methods on a specific contract.


Expand All @@ -175,4 +175,4 @@ make the call, the action is executed.

The allowance however is not checked, as all costs have been covered by the
relayer. Hence, the action will be executed even if the allowance is insufficient
to cover the costs.
to cover the costs.
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,15 @@ We provide code to derive the address, as it's a complex process that involves m

</Tabs>

We recommend hardcoding the derivation paths in your application to ensure the signature request is made to the correct account

:::tip

We recommend hardcoding the derivation paths in your application to ensure the signature request is made to the correct account
Here you can find MPC service public keys:

- **v1.signer-prod.testnet** (testnet): `secp256k1:4NfTiv3UsGahebgTaHyD9vF8KYKMBnfd6kh94mK6xv8fGBiJB8TBtFMP5WWXz6B89Ac1fbpzPwAvoyQebemHFwx3`
- **v1.signer-prod.testnet** ([testnet](https://testnet.nearblocks.io/address/v1.signer-prod.testnet)): `secp256k1:4NfTiv3UsGahebgTaHyD9vF8KYKMBnfd6kh94mK6xv8fGBiJB8TBtFMP5WWXz6B89Ac1fbpzPwAvoyQebemHFwx3`

- **v1.signer** (mainnet): `secp256k1:3tFRbMqmoa6AAALMrEFAYCEoHcqKxeW38YptwowBVBtXK1vo36HDbUWuR6EZmoK4JcH6HDkNMGGqP1ouV7VZUWya`
- **v1.signer** ([mainnet](https://nearblocks.io/address/v1.signer)): `secp256k1:3tFRbMqmoa6AAALMrEFAYCEoHcqKxeW38YptwowBVBtXK1vo36HDbUWuR6EZmoK4JcH6HDkNMGGqP1ouV7VZUWya`

:::

Expand Down
11 changes: 6 additions & 5 deletions docs/2.build/2.smart-contracts/anatomy/serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,23 @@ languages readily implement a JSON (de)serializer.
Let's look at this example, written only for educational purposes:

```rust
#[derive(Serialize)]
#[serde(crate = "near_sdk::serde")]
#[near(serializers = [json])]
pub struct A {
pub a_number: i32,
pub b_number: u128
}

#[derive(Serialize)]
#[serde(crate = "near_sdk::serde")]
#[near(serializers = [json])]
pub struct B {
pub success: bool,
pub other_number: i32
}

pub fn method(&self, struct_a: A): B {
return B{true, 0}
B {
success: true,
other_number: 0
}
}
```

Expand Down
4 changes: 2 additions & 2 deletions docs/2.build/5.primitives/ft/bos/check-balance.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:::info
Remember about fungible token precision. You may need this value to show a response of balance requests in an understandable-to-user way in your app. How to get precision value (decimals) you may find [above](#get-token-metadata).
Remember about fungible token precision. You may need this value to show a response of balance requests in an understandable-to-user way in your app. How to get precision value (decimals) you may find [here](/build/primitives/ft/bos/get-metadata).
:::

```js
Expand All @@ -19,4 +19,4 @@ const userTokenBalance = Near.view(tokenContract, "ft_balance_of", {

</p>

</details>
</details>
4 changes: 2 additions & 2 deletions docs/2.build/5.primitives/ft/web-app/check-balance.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


:::info
Remember about fungible token precision. You may need this value to show a response of balance requests in an understandable-to-user way in your app. How to get precision value (decimals) you may find [above](#get-token-metadata).
Remember about fungible token precision. You may need this value to show a response of balance requests in an understandable-to-user way in your app. How to get precision value (decimals) you may find [here](/build/primitives/ft/web-app/get-metadata).
:::

```js
Expand Down Expand Up @@ -31,4 +31,4 @@ await wallet.viewMethod({

</details>

_The `Wallet` object comes from our [quickstart template](https://github.com/near-examples/hello-near-examples/blob/main/frontend/near-wallet.js)_
_The `Wallet` object comes from our [quickstart template](https://github.com/near-examples/hello-near-examples/blob/main/frontend/near-wallet.js)_
4 changes: 2 additions & 2 deletions docs/2.build/5.primitives/oracles.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Here is a directory of third-party oracle services deployed on the NEAR blockcha

| Name | Creator | Description |
| -------------------------------------------------------------------------------------------------------- | --------------------------------------- | -------------------------------------------------- |
| [Price Oracle](#price-oracle) | [NearDefi](https://github.com/NearDeFi) | Open source oracle for real-time asset pricing |
| [Price Oracle](#price-oracle-by-neardefi) | [NearDefi](https://github.com/NearDeFi) | Open source oracle for real-time asset pricing |
| [Pyth Network Oracle](#pyth-network-oracle) | [Pyth Network](https://pyth.network/) | High-frequency, low-latency oracle for price feeds |
| **[[Your Project Here]](https://github.com/near/docs/edit/master/docs/2.build/5.primitives/oracles.md)** | - | - |

Expand Down Expand Up @@ -243,7 +243,7 @@ Although unused deposit will be refunded, you can calculate an estimate by calli

> Fetches the most recent price feed stored in the Pyth Oracle contract. Is a view method, so does not require a signature or payment.
- args: `price_identifier` _(unique [price feed identifier](#environment-variables))_
- args: `price_identifier` _(unique price feed identifier)_
- type: `object`
- example: `{ price_identifier: 'f9c0172ba10dfa8...' }`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sidebar_label: NFT Indexer

## The End

This tutorial ends with a working NFT indexer built on top [NEAR Lake Framework JS](/concepts/advanced/near-lake-framework). The indexer is watching for `nft_mint` [Events](https://nomicon.io/Standards/EventsFormat) and prints some relevant data:
This tutorial ends with a working NFT indexer built on top [NEAR Lake Framework JS](/build/data-infrastructure/lake-framework/near-lake-framework). The indexer is watching for `nft_mint` [Events](https://nomicon.io/Standards/EventsFormat) and prints some relevant data:
- `receiptId` of the [Receipt](/build/data-infrastructure/lake-data-structures/receipt) where the mint has happened
- Marketplace
- NFT owner account name
Expand All @@ -31,7 +31,7 @@ In this tutorial our goal is to show you how you can "listen" to the Events cont

As the example we will be building an indexer that watches all the NFTs minted following the [NEP-171 Events](https://nomicon.io/Standards/Tokens/NonFungibleToken/Event) standard, assuming we're collectors who don't want to miss a thing. Our indexer should notice every single NFT minted and give us a basic set of data like: in what Receipt it was minted, and show us the link to a marketplace (we'll cover [Paras](https://paras.id) and [Mintbase](https://mintbase.io) in our example).

We will use JS version of [NEAR Lake Framework](/concepts/advanced/near-lake-framework) in this tutorial. Though the concept is the same for Rust, but we want to show more people that it's not that complex to build your own indexer.
We will use JS version of [NEAR Lake Framework](/build/data-infrastructure/lake-framework/near-lake-framework) in this tutorial. Though the concept is the same for Rust, but we want to show more people that it's not that complex to build your own indexer.

## Preparation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sidebar_label: "NFT indexer for Python"

## The Goal

This tutorial ends with a working NFT indexer built on top [NEAR Lake Framework for Python](/concepts/advanced/near-lake-framework). The indexer is watching for `nft_mint` [Events](https://nomicon.io/Standards/EventsFormat) and prints some relevant data:
This tutorial ends with a working NFT indexer built on top [NEAR Lake Framework for Python](/build/data-infrastructure/lake-framework/near-lake-framework/). The indexer is watching for `nft_mint` [Events](https://nomicon.io/Standards/EventsFormat) and prints some relevant data:
- `receipt_id` of the [Receipt](/build/data-infrastructure/lake-data-structures/receipt) where the mint has happened
- Marketplace
- NFT owner account name
Expand All @@ -31,7 +31,7 @@ In this tutorial our goal is to show you how you can "listen" to the Events cont

As the example we will be building an indexer that watches all the NFTs minted following the [NEP-171 Events](https://nomicon.io/Standards/Tokens/NonFungibleToken/Event) standard, assuming we're collectors who don't want to miss a thing. Our indexer should notice every single NFT minted and give us a basic set of data like: in what Receipt it was minted, and show us the link to a marketplace (we'll cover [Paras](https://paras.id) and [Mintbase](https://mintbase.io) in our example).

We will use Python version of [NEAR Lake Framework](/concepts/advanced/near-lake-framework) in this tutorial. Though the concept is the same for Rust, but we want to show more people that it's not that complex to build your own indexer.
We will use Python version of [NEAR Lake Framework](/build/data-infrastructure/lake-framework/near-lake-framework) in this tutorial. Though the concept is the same for Rust, but we want to show more people that it's not that complex to build your own indexer.

## Preparation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sidebar_label: Migrating to NEAR Lake framework
# Migrating to NEAR Lake Framework


We encourage everyone who don't have a hard requirement to use [NEAR Indexer Framework](/concepts/advanced/near-indexer-framework) consider the migration to [NEAR Lake Framework](/concepts/advanced/near-lake-framework).
We encourage everyone who don't have a hard requirement to use [NEAR Indexer Framework](https://github.com/near/nearcore/tree/master/chain/indexer) consider the migration to [NEAR Lake Framework](/build/data-infrastructure/lake-framework/near-lake-framework).

In this tutorial we'll show you how to migrate the project using [indexer-tx-watcher-example](https://github.com/near-examples/indexer-tx-watcher-example) as a showcase.

Expand Down Expand Up @@ -83,7 +83,7 @@ near-lake-framework = "0.4.0"

## Change the clap configs

Currently we have structure `Opts` that has a subcommand with `Run` and `Init` command. Since [NEAR Lake Framework](/concepts/advanced/near-lake-framework) doesn't need `data` and config files we don't need `Init` at all. So we need to combine some structures into `Opts` itself.
Currently we have structure `Opts` that has a subcommand with `Run` and `Init` command. Since [NEAR Lake Framework](/build/data-infrastructure/lake-framework/near-lake-framework) doesn't need `data` and config files we don't need `Init` at all. So we need to combine some structures into `Opts` itself.

```rust title=src/config.rs
...
Expand Down Expand Up @@ -271,7 +271,7 @@ async fn main() -> Result<(), tokio::io::Error> {

```

Let's cast `LakeConfig` from `Opts` and instantiate [NEAR Lake Framework](/concepts/advanced/near-lake-framework)'s `stream`
Let's cast `LakeConfig` from `Opts` and instantiate [NEAR Lake Framework](/build/data-infrastructure/lake-framework/near-lake-framework)'s `stream`

```rust title=src/main.rs
#[tokio::main]
Expand Down Expand Up @@ -308,7 +308,7 @@ async fn main() -> Result<(), tokio::io::Error> {
.collect();
```

Now we can call `listen_blocks` function we have used before in our indexer while it was built on top of [NEAR Indexer Framework](/concepts/advanced/near-indexer-framework). And return `Ok(())` so our `main()` would be happy.
Now we can call `listen_blocks` function we have used before in our indexer while it was built on top of [NEAR Indexer Framework](https://github.com/near/nearcore/tree/master/chain/indexer). And return `Ok(())` so our `main()` would be happy.


### Final async main with NEAR Lake Framework stream
Expand Down Expand Up @@ -341,7 +341,7 @@ We're done. That's pretty much entire `main()` function. Drop the old one if you

## Changes in other function related to data types

Along with [NEAR Lake Framework](/concepts/advanced/near-lake-framework) release we have extracted the structures created for indexers into a separate crate. This was done in order to avoid dependency on `nearcore` as now you can depend on a separate crate that is already [published on crates.io](https://crates.io/crates/near-indexer-primitives) or on NEAR Lake Framework that exposes that crate.
Along with [NEAR Lake Framework](/build/data-infrastructure/lake-framework/near-lake-framework) release we have extracted the structures created for indexers into a separate crate. This was done in order to avoid dependency on `nearcore` as now you can depend on a separate crate that is already [published on crates.io](https://crates.io/crates/near-indexer-primitives) or on NEAR Lake Framework that exposes that crate.

### `listen_blocks`

Expand Down Expand Up @@ -394,7 +394,7 @@ fn is_tx_receiver_watched(

## Conclusion

And now we have a completely migrated to [NEAR Lake Framework](/concepts/advanced/near-lake-framework) indexer.
And now we have a completely migrated to [NEAR Lake Framework](/build/data-infrastructure/lake-framework/near-lake-framework) indexer.

We are posting the complete diffs for the reference

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ title: NEAR Lake Indexer Tutorial

:::info Version 0.2.0

The video is based on the [`near-lake-framework`](/concepts/advanced/near-lake-framework) version 0.2.0
The video is based on the [`near-lake-framework`](/build/data-infrastructure/lake-framework/near-lake-framework) version 0.2.0

At the same time we're keeping the source code up to date with the latest version of the published crate.

:::

We've created a video tutorial to empower the release announcement of [NEAR Lake Framework](/concepts/advanced/near-lake-framework).
We've created a video tutorial to empower the release announcement of [NEAR Lake Framework](/build/data-infrastructure/lake-framework/near-lake-framework).

In this tutorial you will build an indexer application to watch for any `StateChange`s affecting the account or a list of account provided.

Expand Down
Loading

0 comments on commit 68757ce

Please sign in to comment.