Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix auction series docs #2237

Merged
merged 38 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
1a773f3
add auction series
Jul 16, 2024
e5e4afb
add more content
Jul 23, 2024
30c1d5c
updates
Jul 25, 2024
dc7d208
more additions
Jul 26, 2024
8c438f0
small changes
gagdiez Jul 26, 2024
a79aae1
add updates (#2190)
PiVortex Jul 30, 2024
e40022c
wip: proposal
gagdiez Jul 30, 2024
ea3bfe6
Wednesday changes
Jul 31, 2024
5a2f3a9
finish part 1 and part 2
Aug 5, 2024
75baadb
small changes + remove future tutorials from sidebar
Aug 7, 2024
e1b8fdf
fix spelling mistake
Aug 7, 2024
647f6cb
Merge branch 'master' into auction-series
gagdiez Aug 7, 2024
1506f0e
update part 3
Aug 9, 2024
d601a3c
hide nft tuotrial on intro page
Aug 9, 2024
0143d88
improved part 4
Aug 15, 2024
331815f
complete part 3 & 4 (hidden)
Aug 19, 2024
f61a12e
change cusd to dai
Aug 26, 2024
d4b3ce4
add frontend docs WIP
Aug 26, 2024
bd668a8
spelling
Aug 26, 2024
1b62851
update 5-frontend
Aug 29, 2024
f3bd686
add showSingleFName
Aug 30, 2024
4ed7520
Merge branch 'master' into auction-series
gagdiez Sep 2, 2024
01461c7
add factory contract docs
Sep 3, 2024
89ad010
wip: re-structuring
gagdiez Sep 6, 2024
cb431d2
add indexing page
Sep 9, 2024
12a49f7
finished 1st part
gagdiez Sep 9, 2024
e46e756
finished 1st part
gagdiez Sep 9, 2024
223f3e8
Merge branch 'auction-series' of github.com:near/docs into auction-se…
gagdiez Sep 9, 2024
8d94ea4
rename files
gagdiez Sep 9, 2024
ea8aa5a
fix: links
gagdiez Sep 9, 2024
6652854
Update docs/6.integrations/create-transactions.md
PiVortex Sep 13, 2024
7f2f6c6
fix suggested changes
Sep 17, 2024
edf98a6
resolve conflicts
Sep 17, 2024
d8c8e55
fix docs after tests updated
Sep 24, 2024
531aa81
resolve conflicts
Sep 24, 2024
5ea9a15
Update docs/3.tutorials/auction/0-intro.md
bucanero Sep 24, 2024
5befa5f
Apply suggestions from code review
bucanero Sep 24, 2024
8111a16
Update docs/3.tutorials/auction/3-nft.md
bucanero Sep 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions docs/3.tutorials/auction/0-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Welcome! In this guide we will help you navigate NEAR tech stack, so you can bui

We'll start from a simple auction contract and slowly build on top of it to create a full Web3 application to carry out on-chain auctions.

By the time you finish this tutorial, you will have learned several key concepts:
By the time you finish this tutorial, you will have learned several concepts and how to use many key privitives along the way:

- [Creating a simple smart contract](./1.1-basic.md)
- [Writing tests for a contract](./1.2-testing.md)
Expand Down Expand Up @@ -72,7 +72,7 @@ Before starting, make sure to set up your development environment!

</Tabs>

We will use [NEAR CLI](../../4.tools/cli.md) to interact with the blockchain through the terminal, and you can choose between JavaScript and Rust to write the contract.
We will be use [NEAR CLI](../../4.tools/cli.md) to interact with the blockchain through the terminal, and you can choose between JavaScript and Rust to write the contract.
bucanero marked this conversation as resolved.
Show resolved Hide resolved

---

Expand All @@ -91,7 +91,7 @@ This series will touch on different level of the NEAR tech stack. Each section w
#### 2. Frontend

1. Creating the frontend (soon): Lets learn how to connect a frontend with your smart contract
2. Easily query on-chain data (soon): Use open APIs to keep track of the users and their bidding price
2. Easily query on-chain data (soon) : Use open APIs to keep track of the users and their bidding price
bucanero marked this conversation as resolved.
Show resolved Hide resolved

#### 3. Factory
1. Creating a factory (soon): Allow users to easily deploy and initialize their own auction contracts
Expand All @@ -104,6 +104,8 @@ Ready to start? Let's jump to the [The Auction Contract](./1.1-basic.md) and beg

---

---

bucanero marked this conversation as resolved.
Show resolved Hide resolved
:::note Versioning for this article

- near-cli: `0.12.0`
Expand Down
4 changes: 2 additions & 2 deletions docs/3.tutorials/auction/2-locking.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ We will now also test the `claim` method. The test will check that the `auctione
<TabItem value="rust" label="🦀 Rust">

<Github fname="test_basics.rs" language="rust"
url="https://github.com/near-examples/auctions-tutorial/blob/main/contract-rs/02-owner-claims-money/tests/test_basics.rs#L89-L105"
start="89" end="105" />
url="https://github.com/near-examples/auctions-tutorial/blob/main/contract-rs/02-owner-claims-money/tests/test_basics.rs#L96-L112"
start="96" end="112" />

</TabItem>

Expand Down
14 changes: 7 additions & 7 deletions docs/3.tutorials/auction/3-nft.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ When we create an auction we need to list the NFT. To specify which NFT is being

## Transferring the NFT to the winner

When the method `claim` is called the NFT needs to be transferred to the highest bidder. Operations regarding NFTs live on the NFT contract, so we make a cross-contract call to the NFT contract telling it to swap the owner of the NFT to the highest bidder. The method on the NFT contract to do this is `nft_transfer`.
When the method `claim` is called the NFT needs to be transferred to the highest bidder. Operations regarding NFTs live on the NFT contract, so we make a cross-contract call to the NFT contract telling it to swap the owner of the NFT to the highest bidder. The method on the NFT contract to do this is `nft_transfer`.
bucanero marked this conversation as resolved.
Show resolved Hide resolved

<Tabs groupId="code-tabs">

Expand Down Expand Up @@ -107,8 +107,8 @@ To deploy the NFT contract, this time we're going to use `dev deploy` which crea
<TabItem value="rust" label="🦀 Rust">

<Github fname="test_basics.rs" language="rust"
url="https://github.com/near-examples/auctions-tutorial/blob/main/contract-rs/03-owner-claims-winner-gets-nft/tests/test_basics.rs#L23-L24"
start="23" end="32" />
url="https://github.com/near-examples/auctions-tutorial/blob/main/contract-rs/03-owner-claims-winner-gets-nft/tests/test_basics.rs#L30-L39"
start="30" end="39" />

</TabItem>

Expand All @@ -133,8 +133,8 @@ To start a proper auction the auction contract should own an NFT. To do this the
<TabItem value="rust" label="🦀 Rust">

<Github fname="test_basics.rs" language="rust"
url="https://github.com/near-examples/auctions-tutorial/blob/main/contract-rs/03-owner-claims-winner-gets-nft/tests/test_basics.rs#L35-L53"
start="35" end="53" />
url="https://github.com/near-examples/auctions-tutorial/blob/main/contract-rs/03-owner-claims-winner-gets-nft/tests/test_basics.rs#L42-L60"
start="42" end="60" />

</TabItem>

Expand All @@ -159,8 +159,8 @@ After `claim` is called, the test should verify that the auction winner now owns
<TabItem value="rust" label="🦀 Rust">

<Github fname="test_basics.rs" language="rust"
url="https://github.com/near-examples/auctions-tutorial/blob/main/contract-rs/03-owner-claims-winner-gets-nft/tests/test_basics.rs#L144-L157"
start="144" end="157" />
url="https://github.com/near-examples/auctions-tutorial/blob/main/contract-rs/03-owner-claims-winner-gets-nft/tests/test_basics.rs#L151-L164"
start="151" end="164" />

</TabItem>

Expand Down
38 changes: 19 additions & 19 deletions docs/3.tutorials/auction/4-ft.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ When the contract is deployed it is initialized with `new_default_meta` which se
<TabItem value="rust" label="🦀 Rust">

<Github fname="test_basics.rs" language="rust"
url="https://github.com/near-examples/auctions-tutorial/blob/main/contract-rs/04-ft-owner-claims-winner-gets-nft/tests/test_basics.rs#L26-L39"
start="26" end="39" />
url="https://github.com/near-examples/auctions-tutorial/blob/main/contract-rs/04-ft-owner-claims-winner-gets-nft/tests/test_basics.rs#L33-L46"
start="33" end="46" />

</TabItem>

Expand All @@ -238,8 +238,8 @@ In our tests, since we are creating a new fungible token and new accounts we wil
<TabItem value="rust" label="🦀 Rust">

<Github fname="test_basics.rs" language="rust"
url="https://github.com/near-examples/auctions-tutorial/blob/main/contract-rs/04-ft-owner-claims-winner-gets-nft/tests/test_basics.rs#L74-L90"
start="74" end="90" />
url="https://github.com/near-examples/auctions-tutorial/blob/main/contract-rs/04-ft-owner-claims-winner-gets-nft/tests/test_basics.rs#L81-L97"
start="81" end="97" />

</TabItem>

Expand All @@ -265,11 +265,11 @@ Then we will transfer the bidders FTs so they can use them to bid. A simple tran

<Language value="rust" language="rust">
<Github fname="Call ft_transfer"
url="https://github.com/near-examples/auctions-tutorial/blob/main/contract-rs/04-ft-owner-claims-winner-gets-nft/tests/test_basics.rs#L95-L100"
start="95" end="100" />
url="https://github.com/near-examples/auctions-tutorial/blob/main/contract-rs/04-ft-owner-claims-winner-gets-nft/tests/test_basics.rs#L100-L107"
start="100" end="107" />
<Github fname="ft_transfer definition"
url="https://github.com/near-examples/auctions-tutorial/blob/main/contract-rs/04-ft-owner-claims-winner-gets-nft/tests/test_basics.rs#L284-L300"
start="284" end="300" />
url="https://github.com/near-examples/auctions-tutorial/blob/main/contract-rs/04-ft-owner-claims-winner-gets-nft/tests/test_basics.rs#L291-L307"
start="291" end="307" />
</Language>

</TabItem>
Expand All @@ -296,11 +296,11 @@ As stated previously, to bid on the auction the bidder now calls `ft_transfer_ca

<Language value="rust" language="rust">
<Github fname="Call ft_transfer_call"
url="https://github.com/near-examples/auctions-tutorial/blob/main/contract-rs/04-ft-owner-claims-winner-gets-nft/tests/test_basics.rs#L142-L154"
start="142" end="154" />
url="https://github.com/near-examples/auctions-tutorial/blob/main/contract-rs/04-ft-owner-claims-winner-gets-nft/tests/test_basics.rs#L149-L161"
start="149" end="161" />
<Github fname="ft_transfer_call definition"
url="https://github.com/near-examples/auctions-tutorial/blob/main/contract-rs/04-ft-owner-claims-winner-gets-nft/tests/test_basics.rs#L315-L330"
start="315" end="330" />
url="https://github.com/near-examples/auctions-tutorial/blob/main/contract-rs/04-ft-owner-claims-winner-gets-nft/tests/test_basics.rs#L322-L337"
start="322" end="337" />
</Language>

</TabItem>
Expand All @@ -327,11 +327,11 @@ Previously, to check a user's $NEAR balance, we pulled the details from their ac

<Language value="rust" language="rust">
<Github fname="Call ft_balance_of"
url="https://github.com/near-examples/auctions-tutorial/blob/main/contract-rs/04-ft-owner-claims-winner-gets-nft/tests/test_basics.rs#L156-L159"
start="156" end="159" />
<Github fname="ft_transfer_call definition"
url="https://github.com/near-examples/auctions-tutorial/blob/main/contract-rs/04-ft-owner-claims-winner-gets-nft/tests/test_basics.rs#L302-L313"
start="302" end="313" />
url="https://github.com/near-examples/auctions-tutorial/blob/main/contract-rs/04-ft-owner-claims-winner-gets-nft/tests/test_basics.rs#L163-L166"
start="163" end="166" />
<Github fname="ft_balance_of definition"
url="https://github.com/near-examples/auctions-tutorial/blob/main/contract-rs/04-ft-owner-claims-winner-gets-nft/tests/test_basics.rs#L309-L320"
start="309" end="320" />
</Language>

</TabItem>
Expand Down Expand Up @@ -359,8 +359,8 @@ Previous to this, Bob made a bid of 60,000 and Alice was returned her bid bringi
<TabItem value="rust" label="🦀 Rust">

<Github fname="test_basics.rs" language="rust"
url="https://github.com/near-examples/auctions-tutorial/blob/main/contract-rs/04-ft-owner-claims-winner-gets-nft/tests/test_basics.rs#L183-L200"
start="183" end="200" />
url="https://github.com/near-examples/auctions-tutorial/blob/main/contract-rs/04-ft-owner-claims-winner-gets-nft/tests/test_basics.rs#L190-L207"
start="190" end="207" />

</TabItem>

Expand Down
Loading