Skip to content

Commit

Permalink
Merge pull request #74 from a-bahdanau/guides-update
Browse files Browse the repository at this point in the history
feat: updated docs
  • Loading branch information
reveloper authored Nov 21, 2024
2 parents 541d4cf + e284378 commit 3cf2178
Show file tree
Hide file tree
Showing 24 changed files with 160 additions and 97 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ package.json
package-lock.json
node_modules
*.output.txt
temp
temp
tsconfig.json
8 changes: 7 additions & 1 deletion 01-wallet/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,13 @@ For a choice of IDE, you will need anything that has decent TypeScript support.
Let's create a new directory for our project and support TypeScript. Open terminal in the project directory and run the following:

```console
npm install ts-node
npm install typescript ts-node
```

Next, we're going to initialize Typescript project:

```console
npx tsc --init
```

---
Expand Down
4 changes: 3 additions & 1 deletion 01-wallet/test/npmton/index.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
set -ev
npm init --yes
npm install dotenv
npm install typescript
npx tsc --init
npm install ts-node
npm install @ton/ton @ton/crypto @ton/core
npm install @orbs-network/ton-access
Expand All @@ -9,4 +11,4 @@ diff step7.output.txt step7.expected.txt
npx ts-node step8.ts > step8.output.txt
diff step8.output.txt step8.expected.txt
npx ts-node step9.ts > step9.output.txt
diff step9.output.txt step9.expected.txt
diff step9.output.txt step9.expected.txt
4 changes: 3 additions & 1 deletion 01-wallet/test/tonweb/index.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
set -ev
npm init --yes
npm install dotenv
npm install typescript
npx tsc --init
npm install ts-node
npm install tonweb tonweb-mnemonic
npm install @orbs-network/ton-access
Expand All @@ -9,4 +11,4 @@ diff step7.output.txt step7.expected.txt
npx ts-node step8.ts > step8.output.txt
diff step8.output.txt step8.expected.txt
npx ts-node step9.ts > step9.output.txt
diff step9.output.txt step9.expected.txt
diff step9.output.txt step9.expected.txt
8 changes: 4 additions & 4 deletions 02-contract/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ network:testnet
```ts
import * as fs from "fs";
import { getHttpEndpoint } from "@orbs-network/ton-access";
import { mnemonicToWalletKey } from "ton-crypto";
import { mnemonicToWalletKey } from "@ton/crypto";
import { TonClient, Cell, WalletContractV4 } from "@ton/ton";
import Counter from "../wrappers/Counter"; // this is the interface class from step 7

Expand Down Expand Up @@ -286,7 +286,7 @@ network:mainnet
```ts
import * as fs from "fs";
import { getHttpEndpoint } from "@orbs-network/ton-access";
import { mnemonicToWalletKey } from "ton-crypto";
import { mnemonicToWalletKey } from "@ton/crypto";
import { TonClient, Cell, WalletContractV4 } from "@ton/ton";
import Counter from "../wrappers/Counter"; // this is the interface class from step 7

Expand Down Expand Up @@ -501,7 +501,7 @@ network:testnet
---
```ts
import { getHttpEndpoint } from "@orbs-network/ton-access";
import { mnemonicToWalletKey } from "ton-crypto";
import { mnemonicToWalletKey } from "@ton/crypto";
import { TonClient, WalletContractV4, Address } from "@ton/ton";
import Counter from "../wrappers/Counter"; // this is the interface class we just implemented

Expand Down Expand Up @@ -553,7 +553,7 @@ network:mainnet
---
```ts
import { getHttpEndpoint } from "@orbs-network/ton-access";
import { mnemonicToWalletKey } from "ton-crypto";
import { mnemonicToWalletKey } from "@ton/crypto";
import { TonClient, WalletContractV4, Address } from "@ton/ton";
import Counter from "../wrappers/Counter"; // this is the interface class we just implemented

Expand Down
4 changes: 3 additions & 1 deletion 02-contract/test/index.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
set -ev
npm init --yes
npm install dotenv
npm install typescript
npx tsc --init
npm install ts-node
npm install @ton-community/func-js
npm install @ton/ton @ton/core @ton/crypto
Expand All @@ -10,4 +12,4 @@ npx ts-node deploy.step8.ts > deploy.step8.output.txt
COUNTER_ADDRESS=`cut -d : -s -f 2 < deploy.step8.output.txt` npx ts-node getCounter.ts > getCounter.output.txt
diff getCounter.output.txt getCounter.expected.txt
COUNTER_ADDRESS=`cut -d : -s -f 2 < deploy.step8.output.txt` npx ts-node sendIncrement.ts > sendIncrement.output.txt
diff sendIncrement.output.txt sendIncrement.expected.txt
diff sendIncrement.output.txt sendIncrement.expected.txt
2 changes: 2 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
npm init --yes
npm install ts-node
npm install typescript
npx tsc --init --target es2020
npm pkg set scripts.watch="sass -w styles.scss docs/assets/styles.css"
npm install ejs @types/ejs
npm install sass
Expand Down
52 changes: 32 additions & 20 deletions docs/01-wallet/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
<div class="rightcol">
<div class="menu">
<div class="selectboxes">

<div class="selectbox" data-select="network">
<h3 class="selectbox-title">Network</h3>
<div class="selectbox-selected">
<h3></h3>
<img src = '../assets/arrow-down.svg' />
</div>
<ul class="options">

<li data-value="testnet" class="option">
<div class="option-name">
<h4>Testnet</h4>
Expand All @@ -44,7 +44,7 @@ <h4>Testnet</h4>
<p class="cons">Cons: less reliable, requires special wallets</p>
</div>
</li>

<li data-value="mainnet" class="option">
<div class="option-name">
<h4>Mainnet</h4>
Expand All @@ -55,18 +55,18 @@ <h4>Mainnet</h4>
<p class="cons">Cons: not free to use (but very cheap)</p>
</div>
</li>

</ul>
</div>

<div class="selectbox" data-select="library">
<h3 class="selectbox-title">Library</h3>
<div class="selectbox-selected">
<h3></h3>
<img src = '../assets/arrow-down.svg' />
</div>
<ul class="options">

<li data-value="npmton" class="option">
<div class="option-name">
<h4>npm ton (JavaScript)</h4>
Expand All @@ -77,7 +77,7 @@ <h4>npm ton (JavaScript)</h4>
<p class="cons">Cons: no support for all ton services</p>
</div>
</li>

<li data-value="tonweb" class="option">
<div class="option-name">
<h4>TonWeb (JavaScript)</h4>
Expand All @@ -88,10 +88,10 @@ <h4>TonWeb (JavaScript)</h4>
<p class="cons">Cons: mediocre TypeScript support</p>
</div>
</li>

</ul>
</div>

</div>
<div class="more">
<h3>Tutorials</h3>
Expand All @@ -111,7 +111,7 @@ <h3>Help</h3>
</div>
</div>
<div class="posts">

<div class="post" data-combination="mainnet-npmton">
<h1 id="tonhelloworldpart1stepbystepguideforworkingwithyourfirsttonwallet">TON Hello World part 1: Step by step guide for working with your first TON wallet</h1>
<div class="author">
Expand Down Expand Up @@ -169,9 +169,12 @@ <h2 id="step6setupyourlocalmachineforcoding">Step 6: Set up your local machine f
<p>The libraries we're going to rely on are implemented in JavaScript. Accordingly, our scripts will be executed by an engine called Nodejs. The installation instructions are <a href="https://nodejs.org/">here</a>. We will need a fairly recent version of node like v16 or v17. You can verify your nodejs version by running <code>node -v</code> in terminal.</p>
<p>For a choice of IDE, you will need anything that has decent TypeScript support. I recommend <a href="https://code.visualstudio.com">Visual Studio Code</a> - it's free and open source.</p>
<p>Let's create a new directory for our project and support TypeScript. Open terminal in the project directory and run the following:</p>
<pre><code class="console language-console">npm install ts-node
<pre><code class="console language-console">npm install typescript ts-node
</code></pre>
<p>Next, we're going to initialize Typescript project:</p>
<pre><code class="console language-console">npx tsc --init
</code></pre>
<p>Next, we're going to install a JavaScript package named <a href="https://www.npmjs.com/package/@ton/ton">ton</a> that will allow us to make TON API calls and manipulate TON objects. Install the package by opening terminal in the project directory and running:</p>
<p>Next, we're going to install a JavaScript package named <a href="https://www.npmjs.com/package/@ton/ton">@ton/ton</a> that will allow us to make TON API calls and manipulate TON objects. Install the package by opening terminal in the project directory and running:</p>
<pre><code class="console language-console">npm install @ton/ton @ton/crypto @ton/core
</code></pre>
<h2 id="step7getthewalletaddressprogrammatically">Step 7: Get the wallet address programmatically</h2>
Expand Down Expand Up @@ -306,7 +309,7 @@ <h2 id="conclusion">Conclusion</h2>
<p>If you found a mistake in this tutorial, please <a href="https://github.com/ton-community/tutorials/pulls">submit a PR</a> and help us fix it. This tutorial platform is fully open source and available on <a href="https://github.com/ton-community/tutorials">https://github.com/ton-community/tutorials</a>.</p>
<p>Happy coding!</p>
</div>

<div class="post" data-combination="mainnet-tonweb">
<h1 id="tonhelloworldpart1stepbystepguideforworkingwithyourfirsttonwallet">TON Hello World part 1: Step by step guide for working with your first TON wallet</h1>
<div class="author">
Expand Down Expand Up @@ -364,7 +367,10 @@ <h2 id="step6setupyourlocalmachineforcoding">Step 6: Set up your local machine f
<p>The libraries we're going to rely on are implemented in JavaScript. Accordingly, our scripts will be executed by an engine called Nodejs. The installation instructions are <a href="https://nodejs.org/">here</a>. We will need a fairly recent version of node like v16 or v17. You can verify your nodejs version by running <code>node -v</code> in terminal.</p>
<p>For a choice of IDE, you will need anything that has decent TypeScript support. I recommend <a href="https://code.visualstudio.com">Visual Studio Code</a> - it's free and open source.</p>
<p>Let's create a new directory for our project and support TypeScript. Open terminal in the project directory and run the following:</p>
<pre><code class="console language-console">npm install ts-node
<pre><code class="console language-console">npm install typescript ts-node
</code></pre>
<p>Next, we're going to initialize Typescript project:</p>
<pre><code class="console language-console">npx tsc --init
</code></pre>
<p>Next, we're going to install a JavaScript package named <a href="https://github.com/toncenter/tonweb">TonWeb</a> that will allow us to make TON API calls and manipulate TON objects. Install the package by opening terminal in the project directory and running:</p>
<pre><code class="console language-console">npm install tonweb tonweb-mnemonic
Expand Down Expand Up @@ -499,7 +505,7 @@ <h2 id="conclusion">Conclusion</h2>
<p>If you found a mistake in this tutorial, please <a href="https://github.com/ton-community/tutorials/pulls">submit a PR</a> and help us fix it. This tutorial platform is fully open source and available on <a href="https://github.com/ton-community/tutorials">https://github.com/ton-community/tutorials</a>.</p>
<p>Happy coding!</p>
</div>

<div class="post" data-combination="testnet-npmton">
<h1 id="tonhelloworldpart1stepbystepguideforworkingwithyourfirsttonwallet">TON Hello World part 1: Step by step guide for working with your first TON wallet</h1>
<div class="author">
Expand Down Expand Up @@ -559,9 +565,12 @@ <h2 id="step6setupyourlocalmachineforcoding">Step 6: Set up your local machine f
<p>The libraries we're going to rely on are implemented in JavaScript. Accordingly, our scripts will be executed by an engine called Nodejs. The installation instructions are <a href="https://nodejs.org/">here</a>. We will need a fairly recent version of node like v16 or v17. You can verify your nodejs version by running <code>node -v</code> in terminal.</p>
<p>For a choice of IDE, you will need anything that has decent TypeScript support. I recommend <a href="https://code.visualstudio.com">Visual Studio Code</a> - it's free and open source.</p>
<p>Let's create a new directory for our project and support TypeScript. Open terminal in the project directory and run the following:</p>
<pre><code class="console language-console">npm install ts-node
<pre><code class="console language-console">npm install typescript ts-node
</code></pre>
<p>Next, we're going to install a JavaScript package named <a href="https://www.npmjs.com/package/@ton/ton">ton</a> that will allow us to make TON API calls and manipulate TON objects. Install the package by opening terminal in the project directory and running:</p>
<p>Next, we're going to initialize Typescript project:</p>
<pre><code class="console language-console">npx tsc --init
</code></pre>
<p>Next, we're going to install a JavaScript package named <a href="https://www.npmjs.com/package/@ton/ton">@ton/ton</a> that will allow us to make TON API calls and manipulate TON objects. Install the package by opening terminal in the project directory and running:</p>
<pre><code class="console language-console">npm install @ton/ton @ton/crypto @ton/core
</code></pre>
<h2 id="step7getthewalletaddressprogrammatically">Step 7: Get the wallet address programmatically</h2>
Expand Down Expand Up @@ -696,7 +705,7 @@ <h2 id="conclusion">Conclusion</h2>
<p>If you found a mistake in this tutorial, please <a href="https://github.com/ton-community/tutorials/pulls">submit a PR</a> and help us fix it. This tutorial platform is fully open source and available on <a href="https://github.com/ton-community/tutorials">https://github.com/ton-community/tutorials</a>.</p>
<p>Happy coding!</p>
</div>

<div class="post" data-combination="testnet-tonweb">
<h1 id="tonhelloworldpart1stepbystepguideforworkingwithyourfirsttonwallet">TON Hello World part 1: Step by step guide for working with your first TON wallet</h1>
<div class="author">
Expand Down Expand Up @@ -756,7 +765,10 @@ <h2 id="step6setupyourlocalmachineforcoding">Step 6: Set up your local machine f
<p>The libraries we're going to rely on are implemented in JavaScript. Accordingly, our scripts will be executed by an engine called Nodejs. The installation instructions are <a href="https://nodejs.org/">here</a>. We will need a fairly recent version of node like v16 or v17. You can verify your nodejs version by running <code>node -v</code> in terminal.</p>
<p>For a choice of IDE, you will need anything that has decent TypeScript support. I recommend <a href="https://code.visualstudio.com">Visual Studio Code</a> - it's free and open source.</p>
<p>Let's create a new directory for our project and support TypeScript. Open terminal in the project directory and run the following:</p>
<pre><code class="console language-console">npm install ts-node
<pre><code class="console language-console">npm install typescript ts-node
</code></pre>
<p>Next, we're going to initialize Typescript project:</p>
<pre><code class="console language-console">npx tsc --init
</code></pre>
<p>Next, we're going to install a JavaScript package named <a href="https://github.com/toncenter/tonweb">TonWeb</a> that will allow us to make TON API calls and manipulate TON objects. Install the package by opening terminal in the project directory and running:</p>
<pre><code class="console language-console">npm install tonweb tonweb-mnemonic
Expand Down Expand Up @@ -891,7 +903,7 @@ <h2 id="conclusion">Conclusion</h2>
<p>If you found a mistake in this tutorial, please <a href="https://github.com/ton-community/tutorials/pulls">submit a PR</a> and help us fix it. This tutorial platform is fully open source and available on <a href="https://github.com/ton-community/tutorials">https://github.com/ton-community/tutorials</a>.</p>
<p>Happy coding!</p>
</div>

</div>
</div>
</body>
Expand Down
7 changes: 5 additions & 2 deletions docs/01-wallet/mainnet-npmton.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ <h2 id="step6setupyourlocalmachineforcoding">Step 6: Set up your local machine f
<p>The libraries we're going to rely on are implemented in JavaScript. Accordingly, our scripts will be executed by an engine called Nodejs. The installation instructions are <a href="https://nodejs.org/">here</a>. We will need a fairly recent version of node like v16 or v17. You can verify your nodejs version by running <code>node -v</code> in terminal.</p>
<p>For a choice of IDE, you will need anything that has decent TypeScript support. I recommend <a href="https://code.visualstudio.com">Visual Studio Code</a> - it's free and open source.</p>
<p>Let's create a new directory for our project and support TypeScript. Open terminal in the project directory and run the following:</p>
<pre><code class="console language-console">npm install ts-node
<pre><code class="console language-console">npm install typescript ts-node
</code></pre>
<p>Next, we're going to install a JavaScript package named <a href="https://www.npmjs.com/package/@ton/ton">ton</a> that will allow us to make TON API calls and manipulate TON objects. Install the package by opening terminal in the project directory and running:</p>
<p>Next, we're going to initialize Typescript project:</p>
<pre><code class="console language-console">npx tsc --init
</code></pre>
<p>Next, we're going to install a JavaScript package named <a href="https://www.npmjs.com/package/@ton/ton">@ton/ton</a> that will allow us to make TON API calls and manipulate TON objects. Install the package by opening terminal in the project directory and running:</p>
<pre><code class="console language-console">npm install @ton/ton @ton/crypto @ton/core
</code></pre>
<h2 id="step7getthewalletaddressprogrammatically">Step 7: Get the wallet address programmatically</h2>
Expand Down
8 changes: 7 additions & 1 deletion docs/01-wallet/mainnet-npmton.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,13 @@ For a choice of IDE, you will need anything that has decent TypeScript support.
Let's create a new directory for our project and support TypeScript. Open terminal in the project directory and run the following:

```console
npm install ts-node
npm install typescript ts-node
```

Next, we're going to initialize Typescript project:

```console
npx tsc --init
```

Next, we're going to install a JavaScript package named [@ton/ton](https://www.npmjs.com/package/@ton/ton) that will allow us to make TON API calls and manipulate TON objects. Install the package by opening terminal in the project directory and running:
Expand Down
5 changes: 4 additions & 1 deletion docs/01-wallet/mainnet-tonweb.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ <h2 id="step6setupyourlocalmachineforcoding">Step 6: Set up your local machine f
<p>The libraries we're going to rely on are implemented in JavaScript. Accordingly, our scripts will be executed by an engine called Nodejs. The installation instructions are <a href="https://nodejs.org/">here</a>. We will need a fairly recent version of node like v16 or v17. You can verify your nodejs version by running <code>node -v</code> in terminal.</p>
<p>For a choice of IDE, you will need anything that has decent TypeScript support. I recommend <a href="https://code.visualstudio.com">Visual Studio Code</a> - it's free and open source.</p>
<p>Let's create a new directory for our project and support TypeScript. Open terminal in the project directory and run the following:</p>
<pre><code class="console language-console">npm install ts-node
<pre><code class="console language-console">npm install typescript ts-node
</code></pre>
<p>Next, we're going to initialize Typescript project:</p>
<pre><code class="console language-console">npx tsc --init
</code></pre>
<p>Next, we're going to install a JavaScript package named <a href="https://github.com/toncenter/tonweb">TonWeb</a> that will allow us to make TON API calls and manipulate TON objects. Install the package by opening terminal in the project directory and running:</p>
<pre><code class="console language-console">npm install tonweb tonweb-mnemonic
Expand Down
8 changes: 7 additions & 1 deletion docs/01-wallet/mainnet-tonweb.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,13 @@ For a choice of IDE, you will need anything that has decent TypeScript support.
Let's create a new directory for our project and support TypeScript. Open terminal in the project directory and run the following:

```console
npm install ts-node
npm install typescript ts-node
```

Next, we're going to initialize Typescript project:

```console
npx tsc --init
```

Next, we're going to install a JavaScript package named [TonWeb](https://github.com/toncenter/tonweb) that will allow us to make TON API calls and manipulate TON objects. Install the package by opening terminal in the project directory and running:
Expand Down
Loading

0 comments on commit 3cf2178

Please sign in to comment.