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
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 <Codesize="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
+
<Codesize="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>
By doing this, you can use the contract methods in your components. If your contract emits events, check out the <Codesize="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 <Codesize="md">stellar contract deploy</Code> command (<ahref="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 <Codesize="md">npm run build</Code> and deploying the output in the <Codesize="md">dist/</Code> directory.</p>
0 commit comments