@iota/create-dapp 0.4.5 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/package.json +5 -5
- package/templates/react-client-dapp/README.md +2 -2
- package/templates/react-client-dapp/index.html +11 -57
- package/templates/react-client-dapp/package.json +29 -35
- package/templates/react-client-dapp/src/App.tsx +15 -34
- package/templates/react-client-dapp/src/OwnedObjects.tsx +34 -35
- package/templates/react-client-dapp/src/WalletStatus.tsx +17 -18
- package/templates/react-client-dapp/src/index.css +9 -0
- package/templates/react-client-dapp/src/main.tsx +18 -21
- package/templates/react-client-dapp/src/networkConfig.ts +7 -8
- package/templates/react-client-dapp/tsconfig.json +20 -21
- package/templates/react-client-dapp/vite.config.ts +4 -3
- package/templates/react-e2e-counter/README.md +4 -4
- package/templates/react-e2e-counter/index.html +11 -57
- package/templates/react-e2e-counter/package.json +29 -36
- package/templates/react-e2e-counter/src/App.tsx +36 -55
- package/templates/react-e2e-counter/src/Counter.tsx +84 -90
- package/templates/react-e2e-counter/src/CreateCounter.tsx +47 -57
- package/templates/react-e2e-counter/src/constants.ts +3 -3
- package/templates/react-e2e-counter/src/index.css +9 -0
- package/templates/react-e2e-counter/src/main.tsx +18 -21
- package/templates/react-e2e-counter/src/networkConfig.ts +20 -21
- package/templates/react-e2e-counter/tsconfig.json +20 -21
- package/templates/react-e2e-counter/vite.config.ts +4 -3
- package/templates/react-client-dapp/eslint.config.js +0 -28
- package/templates/react-client-dapp/prettier.config.cjs +0 -4
- package/templates/react-client-dapp/tsconfig.node.json +0 -10
- package/templates/react-e2e-counter/eslint.config.js +0 -28
- package/templates/react-e2e-counter/prettier.config.cjs +0 -4
- package/templates/react-e2e-counter/tsconfig.node.json +0 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# @iota/create-dapp
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 355d021: Overhaul of create-dapp. Switches eslint and prettier to oxlint and oxfmt. Removes
|
|
8
|
+
radix and adds tailwind, removes unnecessary config files, simplifies code and has less deps.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- 7eba749: Format templates.
|
|
13
|
+
- Updated dependencies [76ab06f]
|
|
14
|
+
- Updated dependencies [3b04d23]
|
|
15
|
+
- Updated dependencies [3b178c6]
|
|
16
|
+
- Updated dependencies [6ba7cf0]
|
|
17
|
+
- Updated dependencies [2223521]
|
|
18
|
+
- Updated dependencies [8043617]
|
|
19
|
+
- Updated dependencies [c4e159b]
|
|
20
|
+
- @iota/iota-sdk@1.14.0
|
|
21
|
+
- @iota/dapp-kit@0.10.2
|
|
22
|
+
|
|
23
|
+
## 0.4.6
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies [c6ec123]
|
|
28
|
+
- Updated dependencies [b933a08]
|
|
29
|
+
- Updated dependencies [f15c61d]
|
|
30
|
+
- Updated dependencies [22e7eb8]
|
|
31
|
+
- @iota/iota-sdk@1.13.0
|
|
32
|
+
- @iota/dapp-kit@0.10.1
|
|
33
|
+
|
|
3
34
|
## 0.4.5
|
|
4
35
|
|
|
5
36
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
"author": "IOTA Foundation <info@iota.org>",
|
|
4
4
|
"description": "A CLI for creating new IOTA dApps",
|
|
5
5
|
"homepage": "https://docs.iota.org/ts-sdk/typescript/",
|
|
6
|
-
"repository": "https://github.com/iotaledger/
|
|
7
|
-
"version": "0.
|
|
6
|
+
"repository": "https://github.com/iotaledger/ts-packages",
|
|
7
|
+
"version": "0.5.0",
|
|
8
8
|
"license": "Apache-2.0",
|
|
9
9
|
"files": [
|
|
10
10
|
"CHANGELOG.md",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"module": "./dist/esm/index.js",
|
|
20
20
|
"types": "./dist/cjs/index.d.ts",
|
|
21
21
|
"bugs": {
|
|
22
|
-
"url": "https://github.com/iotaledger/
|
|
22
|
+
"url": "https://github.com/iotaledger/ts-packages/issues/new"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"typescript": "^5.5.3",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@types/node": "^24.0.0",
|
|
30
30
|
"enquirer": "^2.4.1",
|
|
31
|
-
"@iota/dapp-kit": "0.10.
|
|
32
|
-
"@iota/iota-sdk": "1.
|
|
31
|
+
"@iota/dapp-kit": "0.10.2",
|
|
32
|
+
"@iota/iota-sdk": "1.14.0"
|
|
33
33
|
},
|
|
34
34
|
"sideEffects": false,
|
|
35
35
|
"bin": "./bin/index.js",
|
|
@@ -6,8 +6,8 @@ Client dApp using the following tools:
|
|
|
6
6
|
- [React](https://react.dev/) as the UI framework
|
|
7
7
|
- [TypeScript](https://www.typescriptlang.org/) for type checking
|
|
8
8
|
- [Vite](https://vitejs.dev/) for build tooling
|
|
9
|
-
- [
|
|
10
|
-
- [
|
|
9
|
+
- [Tailwind CSS](https://tailwindcss.com/) for styling
|
|
10
|
+
- [oxlint](https://oxc.rs/docs/guide/usage/linter) for linting
|
|
11
11
|
- [`@iota/dapp-kit`](https://docs.iota.org/developer/ts-sdk/dapp-kit) for
|
|
12
12
|
connecting to wallets and loading data
|
|
13
13
|
- [pnpm](https://pnpm.io/) for package management
|
|
@@ -1,59 +1,13 @@
|
|
|
1
1
|
<!doctype html>
|
|
2
|
-
<html lang="en"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*/
|
|
14
|
-
*,
|
|
15
|
-
*::before,
|
|
16
|
-
*::after {
|
|
17
|
-
box-sizing: border-box;
|
|
18
|
-
}
|
|
19
|
-
* {
|
|
20
|
-
margin: 0;
|
|
21
|
-
}
|
|
22
|
-
body {
|
|
23
|
-
line-height: 1.5;
|
|
24
|
-
-webkit-font-smoothing: antialiased;
|
|
25
|
-
}
|
|
26
|
-
img,
|
|
27
|
-
picture,
|
|
28
|
-
video,
|
|
29
|
-
canvas,
|
|
30
|
-
svg {
|
|
31
|
-
display: block;
|
|
32
|
-
max-width: 100%;
|
|
33
|
-
}
|
|
34
|
-
input,
|
|
35
|
-
button,
|
|
36
|
-
textarea,
|
|
37
|
-
select {
|
|
38
|
-
font: inherit;
|
|
39
|
-
}
|
|
40
|
-
p,
|
|
41
|
-
h1,
|
|
42
|
-
h2,
|
|
43
|
-
h3,
|
|
44
|
-
h4,
|
|
45
|
-
h5,
|
|
46
|
-
h6 {
|
|
47
|
-
overflow-wrap: break-word;
|
|
48
|
-
}
|
|
49
|
-
#root,
|
|
50
|
-
#__next {
|
|
51
|
-
isolation: isolate;
|
|
52
|
-
}
|
|
53
|
-
</style>
|
|
54
|
-
</head>
|
|
55
|
-
<body>
|
|
56
|
-
<div id="root"></div>
|
|
57
|
-
<script type="module" src="/src/main.tsx"></script>
|
|
58
|
-
</body>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>IOTA dApp Starter</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
+
</body>
|
|
59
13
|
</html>
|
|
@@ -1,37 +1,31 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"eslint-plugin-react": "^7.37.2",
|
|
32
|
-
"typescript-eslint": "^8.18.0",
|
|
33
|
-
"prettier": "^3.3.2",
|
|
34
|
-
"typescript": "^5.5.3",
|
|
35
|
-
"vite": "^5.4.12"
|
|
36
|
-
}
|
|
2
|
+
"name": "@iota/template-react-client-app",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "tsc && vite build",
|
|
9
|
+
"lint": "oxlint .",
|
|
10
|
+
"format": "oxfmt --write src/",
|
|
11
|
+
"preview": "vite preview"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@iota/dapp-kit": "workspace:*",
|
|
15
|
+
"@iota/iota-sdk": "workspace:*",
|
|
16
|
+
"@tanstack/react-query": "^5.91.2",
|
|
17
|
+
"react": "^18.3.1",
|
|
18
|
+
"react-dom": "^18.3.1"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@tailwindcss/vite": "^4.2.2",
|
|
22
|
+
"@types/react": "^18.3.28",
|
|
23
|
+
"@types/react-dom": "^18.3.7",
|
|
24
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
25
|
+
"oxfmt": "^0.41.0",
|
|
26
|
+
"oxlint": "^1.56.0",
|
|
27
|
+
"tailwindcss": "^4.2.2",
|
|
28
|
+
"typescript": "^5.9.3",
|
|
29
|
+
"vite": "^8.0.1"
|
|
30
|
+
}
|
|
37
31
|
}
|
|
@@ -1,39 +1,20 @@
|
|
|
1
|
-
import { ConnectButton } from
|
|
2
|
-
import {
|
|
3
|
-
import { WalletStatus } from "./WalletStatus";
|
|
1
|
+
import { ConnectButton } from '@iota/dapp-kit';
|
|
2
|
+
import { WalletStatus } from './WalletStatus';
|
|
4
3
|
|
|
5
4
|
function App() {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
</Box>
|
|
20
|
-
|
|
21
|
-
<Box>
|
|
22
|
-
<ConnectButton />
|
|
23
|
-
</Box>
|
|
24
|
-
</Flex>
|
|
25
|
-
<Container>
|
|
26
|
-
<Container
|
|
27
|
-
mt="5"
|
|
28
|
-
pt="2"
|
|
29
|
-
px="4"
|
|
30
|
-
style={{ background: "var(--gray-a2)", minHeight: 500 }}
|
|
31
|
-
>
|
|
32
|
-
<WalletStatus />
|
|
33
|
-
</Container>
|
|
34
|
-
</Container>
|
|
35
|
-
</>
|
|
36
|
-
);
|
|
5
|
+
return (
|
|
6
|
+
<>
|
|
7
|
+
<div className="sticky top-0 flex px-4 py-2 justify-between items-center border-b border-gray-800 bg-gray-950">
|
|
8
|
+
<h1 className="text-2xl font-bold">dApp Starter Template</h1>
|
|
9
|
+
<ConnectButton />
|
|
10
|
+
</div>
|
|
11
|
+
<div className="max-w-4xl mx-auto">
|
|
12
|
+
<div className="mt-5 pt-2 px-4 bg-gray-900 min-h-[500px] rounded">
|
|
13
|
+
<WalletStatus />
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</>
|
|
17
|
+
);
|
|
37
18
|
}
|
|
38
19
|
|
|
39
20
|
export default App;
|
|
@@ -1,42 +1,41 @@
|
|
|
1
|
-
import { useCurrentAccount, useIotaClientQuery } from
|
|
2
|
-
import { Flex, Heading, Text } from "@radix-ui/themes";
|
|
1
|
+
import { useCurrentAccount, useIotaClientQuery } from '@iota/dapp-kit';
|
|
3
2
|
|
|
4
3
|
export function OwnedObjects() {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
const account = useCurrentAccount();
|
|
5
|
+
const { data, isPending, error } = useIotaClientQuery(
|
|
6
|
+
'getOwnedObjects',
|
|
7
|
+
{
|
|
8
|
+
owner: account?.address as string,
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
enabled: !!account,
|
|
12
|
+
},
|
|
13
|
+
);
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
if (!account) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
if (error) {
|
|
20
|
+
return <div className="flex">Error: {error.message}</div>;
|
|
21
|
+
}
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
if (isPending || !data) {
|
|
24
|
+
return <div className="flex">Loading...</div>;
|
|
25
|
+
}
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
27
|
+
return (
|
|
28
|
+
<div className="flex flex-col my-2">
|
|
29
|
+
{data.data.length === 0 ? (
|
|
30
|
+
<p className="text-gray-300">No objects owned by the connected wallet</p>
|
|
31
|
+
) : (
|
|
32
|
+
<h3 className="text-lg font-semibold">Objects owned by the connected wallet</h3>
|
|
33
|
+
)}
|
|
34
|
+
{data.data.map((object) => (
|
|
35
|
+
<div className="flex" key={object.data?.objectId}>
|
|
36
|
+
<p className="text-gray-300">Object ID: {object.data?.objectId}</p>
|
|
37
|
+
</div>
|
|
38
|
+
))}
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
42
41
|
}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { useCurrentAccount } from
|
|
2
|
-
import {
|
|
3
|
-
import { OwnedObjects } from "./OwnedObjects";
|
|
1
|
+
import { useCurrentAccount } from '@iota/dapp-kit';
|
|
2
|
+
import { OwnedObjects } from './OwnedObjects';
|
|
4
3
|
|
|
5
4
|
export function WalletStatus() {
|
|
6
|
-
|
|
5
|
+
const account = useCurrentAccount();
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
return (
|
|
8
|
+
<div className="my-2">
|
|
9
|
+
<h2 className="text-xl font-semibold mb-2">Wallet Status</h2>
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
11
|
+
{account ? (
|
|
12
|
+
<div className="flex flex-col">
|
|
13
|
+
<p className="text-gray-300">Wallet connected</p>
|
|
14
|
+
<p className="text-gray-300">Address: {account.address}</p>
|
|
15
|
+
</div>
|
|
16
|
+
) : (
|
|
17
|
+
<p className="text-gray-300">Wallet not connected</p>
|
|
18
|
+
)}
|
|
19
|
+
<OwnedObjects />
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
23
22
|
}
|
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import ReactDOM from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom/client';
|
|
3
|
+
import '@iota/dapp-kit/dist/index.css';
|
|
4
|
+
import './index.css';
|
|
5
5
|
|
|
6
|
-
import { IotaClientProvider, WalletProvider } from
|
|
7
|
-
import { QueryClient, QueryClientProvider } from
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { networkConfig } from "./networkConfig.ts";
|
|
6
|
+
import { IotaClientProvider, WalletProvider } from '@iota/dapp-kit';
|
|
7
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
8
|
+
import App from './App.tsx';
|
|
9
|
+
import { networkConfig } from './networkConfig.ts';
|
|
11
10
|
|
|
12
11
|
const queryClient = new QueryClient();
|
|
13
12
|
|
|
14
|
-
ReactDOM.createRoot(document.getElementById(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</
|
|
23
|
-
|
|
24
|
-
</Theme>
|
|
25
|
-
</React.StrictMode>,
|
|
13
|
+
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
14
|
+
<React.StrictMode>
|
|
15
|
+
<QueryClientProvider client={queryClient}>
|
|
16
|
+
<IotaClientProvider networks={networkConfig} defaultNetwork="testnet">
|
|
17
|
+
<WalletProvider autoConnect>
|
|
18
|
+
<App />
|
|
19
|
+
</WalletProvider>
|
|
20
|
+
</IotaClientProvider>
|
|
21
|
+
</QueryClientProvider>
|
|
22
|
+
</React.StrictMode>,
|
|
26
23
|
);
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { getFullnodeUrl } from
|
|
2
|
-
import { createNetworkConfig } from
|
|
1
|
+
import { getFullnodeUrl } from '@iota/iota-sdk/client';
|
|
2
|
+
import { createNetworkConfig } from '@iota/dapp-kit';
|
|
3
3
|
|
|
4
|
-
const { networkConfig, useNetworkVariable, useNetworkVariables } =
|
|
5
|
-
createNetworkConfig({
|
|
4
|
+
const { networkConfig, useNetworkVariable, useNetworkVariables } = createNetworkConfig({
|
|
6
5
|
devnet: {
|
|
7
|
-
|
|
6
|
+
url: getFullnodeUrl('devnet'),
|
|
8
7
|
},
|
|
9
8
|
testnet: {
|
|
10
|
-
|
|
9
|
+
url: getFullnodeUrl('testnet'),
|
|
11
10
|
},
|
|
12
11
|
mainnet: {
|
|
13
|
-
|
|
12
|
+
url: getFullnodeUrl('mainnet'),
|
|
14
13
|
},
|
|
15
|
-
|
|
14
|
+
});
|
|
16
15
|
|
|
17
16
|
export { useNetworkVariable, useNetworkVariables, networkConfig };
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"skipLibCheck": true,
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
/* Bundler mode */
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"allowImportingTsExtensions": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
"jsx": "react-jsx",
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"references": [{ "path": "./tsconfig.node.json" }]
|
|
17
|
+
/* Linting */
|
|
18
|
+
"strict": true,
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"noUnusedParameters": true,
|
|
21
|
+
"noFallthroughCasesInSwitch": true
|
|
22
|
+
},
|
|
23
|
+
"include": ["src", "vite.config.ts"]
|
|
25
24
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { defineConfig } from
|
|
2
|
-
import react from
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
import react from '@vitejs/plugin-react';
|
|
3
|
+
import tailwindcss from '@tailwindcss/vite';
|
|
3
4
|
|
|
4
5
|
// https://vitejs.dev/config/
|
|
5
6
|
export default defineConfig({
|
|
6
|
-
|
|
7
|
+
plugins: [react(), tailwindcss()],
|
|
7
8
|
});
|
|
@@ -6,8 +6,8 @@ Client dApp using the following tools:
|
|
|
6
6
|
- [React](https://react.dev/) as the UI framework
|
|
7
7
|
- [TypeScript](https://www.typescriptlang.org/) for type checking
|
|
8
8
|
- [Vite](https://vitejs.dev/) for build tooling
|
|
9
|
-
- [
|
|
10
|
-
- [
|
|
9
|
+
- [Tailwind CSS](https://tailwindcss.com/) for styling
|
|
10
|
+
- [oxlint](https://oxc.rs/docs/guide/usage/linter) for linting
|
|
11
11
|
- [`@iota/dapp-kit`](https://docs.iota.org/developer/ts-sdk/dapp-kit) for
|
|
12
12
|
connecting to wallets and loading data
|
|
13
13
|
- [pnpm](https://pnpm.io/) for package management
|
|
@@ -25,7 +25,7 @@ This template uses `testnet` by default, so we'll need to set up a testnet
|
|
|
25
25
|
environment in the CLI:
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
iota client new-env --alias testnet --rpc https://
|
|
28
|
+
iota client new-env --alias testnet --rpc https://api.testnet.iota.cafe
|
|
29
29
|
iota client switch --env testnet
|
|
30
30
|
```
|
|
31
31
|
|
|
@@ -48,7 +48,7 @@ We can ensure we have some IOTA in our new wallet by requesting IOTA from the
|
|
|
48
48
|
faucet (make sure to replace the address with your address):
|
|
49
49
|
|
|
50
50
|
```bash
|
|
51
|
-
curl --location --request POST 'https://faucet.testnet.iota.
|
|
51
|
+
curl --location --request POST 'https://faucet.testnet.iota.cafe/gas' \
|
|
52
52
|
--header 'Content-Type: application/json' \
|
|
53
53
|
--data-raw '{
|
|
54
54
|
"FixedAmountRequest": {
|
|
@@ -1,59 +1,13 @@
|
|
|
1
1
|
<!doctype html>
|
|
2
|
-
<html lang="en"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*/
|
|
14
|
-
*,
|
|
15
|
-
*::before,
|
|
16
|
-
*::after {
|
|
17
|
-
box-sizing: border-box;
|
|
18
|
-
}
|
|
19
|
-
* {
|
|
20
|
-
margin: 0;
|
|
21
|
-
}
|
|
22
|
-
body {
|
|
23
|
-
line-height: 1.5;
|
|
24
|
-
-webkit-font-smoothing: antialiased;
|
|
25
|
-
}
|
|
26
|
-
img,
|
|
27
|
-
picture,
|
|
28
|
-
video,
|
|
29
|
-
canvas,
|
|
30
|
-
svg {
|
|
31
|
-
display: block;
|
|
32
|
-
max-width: 100%;
|
|
33
|
-
}
|
|
34
|
-
input,
|
|
35
|
-
button,
|
|
36
|
-
textarea,
|
|
37
|
-
select {
|
|
38
|
-
font: inherit;
|
|
39
|
-
}
|
|
40
|
-
p,
|
|
41
|
-
h1,
|
|
42
|
-
h2,
|
|
43
|
-
h3,
|
|
44
|
-
h4,
|
|
45
|
-
h5,
|
|
46
|
-
h6 {
|
|
47
|
-
overflow-wrap: break-word;
|
|
48
|
-
}
|
|
49
|
-
#root,
|
|
50
|
-
#__next {
|
|
51
|
-
isolation: isolate;
|
|
52
|
-
}
|
|
53
|
-
</style>
|
|
54
|
-
</head>
|
|
55
|
-
<body>
|
|
56
|
-
<div id="root"></div>
|
|
57
|
-
<script type="module" src="/src/main.tsx"></script>
|
|
58
|
-
</body>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>IOTA dApp Starter</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
+
</body>
|
|
59
13
|
</html>
|