Skip to content

Commit 740923c

Browse files
authored
Starter getting started (#51)
* Starter getting started * Fixup some tags, reference useSubscription hook * Update deploy doc * more details on deploying
1 parent dd34b2f commit 740923c

File tree

1 file changed

+45
-1
lines changed

1 file changed

+45
-1
lines changed

src/App.tsx

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Layout } from "@stellar/design-system";
1+
import { Code, Layout } from "@stellar/design-system";
22
import "./App.module.css"
33
import ConnectAccount from "./components/ConnectAccount.tsx";
44

@@ -13,6 +13,50 @@ function App() {
1313
<Layout.Content>
1414
<Layout.Inset>
1515
<h1>Welcome to your app!</h1>
16+
17+
<p>
18+
This is a basic template to get your dapp started with the Stellar Design System and Soroban contracts.
19+
You can customize it further by adding your own contracts, components, and styles.
20+
</p>
21+
22+
<h2>Developing your contracts</h2>
23+
24+
<p>Your contracts are located in the contracts/ directory, and you can modify them to suit your needs.</p>
25+
26+
<p>As you update them, the <Code size="md">stellar scaffold watch</Code> command will automatically recompile them and update the dapp with the latest changes.</p>
27+
28+
<h2>Interacting with contracts from the frontend</h2>
29+
30+
Scaffold stellar automatically builds your contract packages, and you can import them in your frontend code like this:
31+
32+
<pre>
33+
<Code size="md">{`import soroban_hello_world_contract from "./contracts/soroban_hello_world_contract.ts";`}</Code>
34+
</pre>
35+
36+
<p>And then you can call the contract methods like this:</p>
37+
38+
<pre>
39+
<Code size="md">{`const statusMessage = await soroban_hello_world_contract.hello({"to": "world"});`}</Code>
40+
</pre>
41+
42+
<p>
43+
By doing this, you can use the contract methods in your components. If your contract emits events, check out the <Code size="md">useSubscription</Code> hook in the hooks/ folder to listen to them.
44+
</p>
45+
46+
<h2>Interacting with wallets</h2>
47+
48+
<p>
49+
This project is already integrated with Stellar Wallet Kit, and the {`useWallet`} hook is available for you to use in your components.
50+
You can use it to connect to get connected account information.
51+
</p>
52+
53+
<h2>Deploying your app</h2>
54+
55+
<p>
56+
To deploy your contracts, use the <Code size="md">stellar contract deploy</Code> command (<a href="https://developers.stellar.org/docs/build/guides/cli/install-deploy">docs</a>) to deploy to the appropriate Stellar network.
57+
</p>
58+
59+
<p>Build your frontend application code with <Code size="md">npm run build</Code> and deploying the output in the <Code size="md">dist/</Code> directory.</p>
1660
</Layout.Inset>
1761
</Layout.Content>
1862
<Layout.Footer>

0 commit comments

Comments
 (0)