@sei-js/create-sei 0.0.1 → 0.0.3

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.
Files changed (155) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/CHANGELOG.md +12 -0
  3. package/README.md +16 -25
  4. package/biome.json +8 -0
  5. package/dist/main.js +162 -0
  6. package/dist/templates/next-cosmos-template/.eslintrc.json +3 -0
  7. package/dist/templates/next-cosmos-template/README.md +60 -0
  8. package/dist/templates/next-cosmos-template/next-env.d.ts +5 -0
  9. package/dist/templates/next-cosmos-template/next.config.mjs +14 -0
  10. package/dist/templates/next-cosmos-template/package.json +31 -0
  11. package/dist/templates/next-cosmos-template/public/next.svg +1 -0
  12. package/dist/templates/next-cosmos-template/public/sei-logotype.svg +15 -0
  13. package/dist/templates/next-cosmos-template/public/vercel.svg +1 -0
  14. package/dist/templates/next-cosmos-template/src/app/components/Homepage/Examples.tsx +168 -0
  15. package/dist/templates/next-cosmos-template/src/app/components/Homepage/Homepage.css +154 -0
  16. package/dist/templates/next-cosmos-template/src/app/components/Homepage/Homepage.tsx +83 -0
  17. package/dist/templates/next-cosmos-template/src/app/components/WalletConnectButton/WalletConnectButton.tsx +18 -0
  18. package/dist/templates/next-cosmos-template/src/app/components/Web3Provider.tsx +35 -0
  19. package/dist/templates/next-cosmos-template/src/app/components/index.ts +3 -0
  20. package/dist/templates/next-cosmos-template/src/app/constants/chain.ts +16 -0
  21. package/dist/templates/next-cosmos-template/src/app/constants/index.ts +1 -0
  22. package/dist/templates/next-cosmos-template/src/app/favicon.ico +0 -0
  23. package/dist/templates/next-cosmos-template/src/app/index.css +184 -0
  24. package/dist/templates/next-cosmos-template/src/app/layout.tsx +21 -0
  25. package/dist/templates/next-cosmos-template/src/app/page.tsx +17 -0
  26. package/dist/templates/next-cosmos-template/tsconfig.json +26 -0
  27. package/dist/templates/next-cosmos-template/yarn.lock +9814 -0
  28. package/dist/templates/next-wagmi-template/.eslintrc.json +3 -0
  29. package/dist/templates/next-wagmi-template/README.md +58 -0
  30. package/dist/templates/next-wagmi-template/next-env.d.ts +5 -0
  31. package/dist/templates/next-wagmi-template/next.config.mjs +4 -0
  32. package/dist/templates/next-wagmi-template/package.json +30 -0
  33. package/dist/templates/next-wagmi-template/public/sei-logotype.svg +15 -0
  34. package/dist/templates/next-wagmi-template/src/app/components/Homepage/Examples.tsx +257 -0
  35. package/dist/templates/next-wagmi-template/src/app/components/Homepage/Homepage.css +154 -0
  36. package/dist/templates/next-wagmi-template/src/app/components/Homepage/Homepage.tsx +87 -0
  37. package/dist/templates/next-wagmi-template/src/app/components/Web3Provider.tsx +74 -0
  38. package/dist/templates/next-wagmi-template/src/app/components/index.ts +2 -0
  39. package/dist/templates/next-wagmi-template/src/app/constants/chain.ts +7 -0
  40. package/dist/templates/next-wagmi-template/src/app/constants/index.ts +1 -0
  41. package/dist/templates/next-wagmi-template/src/app/favicon.ico +0 -0
  42. package/dist/templates/next-wagmi-template/src/app/index.css +184 -0
  43. package/dist/templates/next-wagmi-template/src/app/layout.tsx +21 -0
  44. package/dist/templates/next-wagmi-template/src/app/page.tsx +21 -0
  45. package/dist/templates/next-wagmi-template/tsconfig.json +26 -0
  46. package/dist/templates/next-wagmi-template/yarn.lock +4809 -0
  47. package/dist/templates/vite-cosmos-template/.eslintrc.cjs +11 -0
  48. package/dist/templates/vite-cosmos-template/README.md +72 -0
  49. package/dist/templates/vite-cosmos-template/favicon.ico +0 -0
  50. package/dist/templates/vite-cosmos-template/index.html +16 -0
  51. package/dist/templates/vite-cosmos-template/package.json +35 -0
  52. package/dist/templates/vite-cosmos-template/public/sei-logotype.svg +15 -0
  53. package/dist/templates/vite-cosmos-template/src/App.tsx +15 -0
  54. package/dist/templates/vite-cosmos-template/src/assets/react.svg +1 -0
  55. package/dist/templates/vite-cosmos-template/src/components/Homepage/Examples.tsx +168 -0
  56. package/dist/templates/vite-cosmos-template/src/components/Homepage/Homepage.css +154 -0
  57. package/dist/templates/vite-cosmos-template/src/components/Homepage/Homepage.tsx +77 -0
  58. package/dist/templates/vite-cosmos-template/src/components/WalletConnectButton/WalletConnectButton.tsx +18 -0
  59. package/dist/templates/vite-cosmos-template/src/components/Web3Provider.tsx +41 -0
  60. package/dist/templates/vite-cosmos-template/src/components/index.ts +4 -0
  61. package/dist/templates/vite-cosmos-template/src/constants/chain.ts +16 -0
  62. package/dist/templates/vite-cosmos-template/src/constants/index.ts +1 -0
  63. package/dist/templates/vite-cosmos-template/src/index.css +184 -0
  64. package/dist/templates/vite-cosmos-template/src/main.tsx +12 -0
  65. package/dist/templates/vite-cosmos-template/src/vite-env.d.ts +1 -0
  66. package/dist/templates/vite-cosmos-template/tsconfig.app.json +25 -0
  67. package/dist/templates/vite-cosmos-template/tsconfig.json +11 -0
  68. package/dist/templates/vite-cosmos-template/tsconfig.node.json +14 -0
  69. package/dist/templates/vite-cosmos-template/vite.config.ts +7 -0
  70. package/dist/templates/vite-cosmos-template/yarn.lock +9323 -0
  71. package/dist/templates/vite-wagmi-template/.eslintrc.cjs +11 -0
  72. package/dist/templates/vite-wagmi-template/README.md +72 -0
  73. package/dist/templates/vite-wagmi-template/favicon.ico +0 -0
  74. package/dist/templates/vite-wagmi-template/index.html +12 -0
  75. package/dist/templates/vite-wagmi-template/package.json +33 -0
  76. package/dist/templates/vite-wagmi-template/public/sei-logotype.svg +15 -0
  77. package/dist/templates/vite-wagmi-template/src/App.tsx +21 -0
  78. package/dist/templates/vite-wagmi-template/src/assets/react.svg +1 -0
  79. package/dist/templates/vite-wagmi-template/src/components/Homepage/Examples.tsx +255 -0
  80. package/dist/templates/vite-wagmi-template/src/components/Homepage/Homepage.css +154 -0
  81. package/dist/templates/vite-wagmi-template/src/components/Homepage/Homepage.tsx +81 -0
  82. package/dist/templates/vite-wagmi-template/src/components/Web3Provider.tsx +72 -0
  83. package/dist/templates/vite-wagmi-template/src/constants/chain.ts +6 -0
  84. package/dist/templates/vite-wagmi-template/src/constants/index.ts +1 -0
  85. package/dist/templates/vite-wagmi-template/src/index.css +183 -0
  86. package/dist/templates/vite-wagmi-template/src/main.tsx +12 -0
  87. package/dist/templates/vite-wagmi-template/src/vite-env.d.ts +1 -0
  88. package/dist/templates/vite-wagmi-template/tsconfig.app.json +25 -0
  89. package/dist/templates/vite-wagmi-template/tsconfig.json +11 -0
  90. package/dist/templates/vite-wagmi-template/tsconfig.node.json +14 -0
  91. package/dist/templates/vite-wagmi-template/vite.config.ts +10 -0
  92. package/dist/templates/vite-wagmi-template/yarn.lock +4603 -0
  93. package/package.json +3 -2
  94. package/src/main.ts +31 -33
  95. package/templates/next-cosmos-template/.eslintrc.json +1 -1
  96. package/templates/next-cosmos-template/next.config.mjs +9 -9
  97. package/templates/next-cosmos-template/package.json +29 -29
  98. package/templates/next-cosmos-template/src/app/components/Homepage/Examples.tsx +162 -171
  99. package/templates/next-cosmos-template/src/app/components/Homepage/Homepage.css +92 -94
  100. package/templates/next-cosmos-template/src/app/components/Homepage/Homepage.tsx +22 -49
  101. package/templates/next-cosmos-template/src/app/components/WalletConnectButton/WalletConnectButton.tsx +11 -19
  102. package/templates/next-cosmos-template/src/app/components/Web3Provider.tsx +13 -17
  103. package/templates/next-cosmos-template/src/app/components/index.ts +3 -3
  104. package/templates/next-cosmos-template/src/app/constants/chain.ts +9 -9
  105. package/templates/next-cosmos-template/src/app/constants/index.ts +1 -1
  106. package/templates/next-cosmos-template/src/app/index.css +99 -86
  107. package/templates/next-cosmos-template/src/app/layout.tsx +12 -12
  108. package/templates/next-cosmos-template/src/app/page.tsx +13 -13
  109. package/templates/next-cosmos-template/tsconfig.json +24 -24
  110. package/templates/next-wagmi-template/.eslintrc.json +1 -1
  111. package/templates/next-wagmi-template/package.json +28 -28
  112. package/templates/next-wagmi-template/src/app/components/Homepage/Examples.tsx +223 -237
  113. package/templates/next-wagmi-template/src/app/components/Homepage/Homepage.css +92 -94
  114. package/templates/next-wagmi-template/src/app/components/Homepage/Homepage.tsx +10 -36
  115. package/templates/next-wagmi-template/src/app/components/Web3Provider.tsx +29 -28
  116. package/templates/next-wagmi-template/src/app/components/index.ts +2 -2
  117. package/templates/next-wagmi-template/src/app/constants/chain.ts +2 -2
  118. package/templates/next-wagmi-template/src/app/constants/index.ts +1 -1
  119. package/templates/next-wagmi-template/src/app/index.css +99 -86
  120. package/templates/next-wagmi-template/src/app/layout.tsx +12 -12
  121. package/templates/next-wagmi-template/src/app/page.tsx +17 -17
  122. package/templates/next-wagmi-template/tsconfig.json +24 -24
  123. package/templates/vite-cosmos-template/.eslintrc.cjs +10 -17
  124. package/templates/vite-cosmos-template/package.json +33 -33
  125. package/templates/vite-cosmos-template/src/App.tsx +11 -12
  126. package/templates/vite-cosmos-template/src/components/Homepage/Examples.tsx +162 -171
  127. package/templates/vite-cosmos-template/src/components/Homepage/Homepage.css +92 -94
  128. package/templates/vite-cosmos-template/src/components/Homepage/Homepage.tsx +20 -45
  129. package/templates/vite-cosmos-template/src/components/WalletConnectButton/WalletConnectButton.tsx +11 -19
  130. package/templates/vite-cosmos-template/src/components/Web3Provider.tsx +14 -18
  131. package/templates/vite-cosmos-template/src/components/index.ts +4 -4
  132. package/templates/vite-cosmos-template/src/constants/chain.ts +9 -9
  133. package/templates/vite-cosmos-template/src/constants/index.ts +1 -1
  134. package/templates/vite-cosmos-template/src/index.css +99 -86
  135. package/templates/vite-cosmos-template/src/main.tsx +10 -10
  136. package/templates/vite-cosmos-template/tsconfig.app.json +21 -23
  137. package/templates/vite-cosmos-template/tsconfig.json +9 -9
  138. package/templates/vite-cosmos-template/tsconfig.node.json +11 -11
  139. package/templates/vite-cosmos-template/vite.config.ts +4 -4
  140. package/templates/vite-wagmi-template/.eslintrc.cjs +10 -17
  141. package/templates/vite-wagmi-template/package.json +31 -31
  142. package/templates/vite-wagmi-template/src/App.tsx +12 -13
  143. package/templates/vite-wagmi-template/src/components/Homepage/Examples.tsx +225 -239
  144. package/templates/vite-wagmi-template/src/components/Homepage/Homepage.css +92 -94
  145. package/templates/vite-wagmi-template/src/components/Homepage/Homepage.tsx +28 -53
  146. package/templates/vite-wagmi-template/src/components/Web3Provider.tsx +29 -28
  147. package/templates/vite-wagmi-template/src/constants/chain.ts +1 -1
  148. package/templates/vite-wagmi-template/src/constants/index.ts +1 -1
  149. package/templates/vite-wagmi-template/src/index.css +98 -85
  150. package/templates/vite-wagmi-template/src/main.tsx +10 -10
  151. package/templates/vite-wagmi-template/tsconfig.app.json +21 -23
  152. package/templates/vite-wagmi-template/tsconfig.json +9 -9
  153. package/templates/vite-wagmi-template/tsconfig.node.json +11 -11
  154. package/templates/vite-wagmi-template/vite.config.ts +7 -7
  155. package/tsconfig.json +24 -28
@@ -1,177 +1,168 @@
1
- import { getCosmWasmClient, getQueryClient, getSigningCosmWasmClient, getStargateClient } from "@sei-js/cosmjs";
2
- import { useState } from "react";
3
- import { defaultUrls, selectedChain } from "../../constants";
4
- import { useChain } from "@cosmos-kit/react";
1
+ import { getCosmWasmClient, getQueryClient, getSigningCosmWasmClient, getStargateClient } from '@sei-js/cosmjs';
2
+ import { useState } from 'react';
3
+ import { defaultUrls, selectedChain } from '../../constants';
4
+ import { useChain } from '@cosmos-kit/react';
5
5
 
6
- import './Homepage.css'
6
+ import './Homepage.css';
7
7
  type ExampleProps = {
8
- chainId: string
9
- }
8
+ chainId: string;
9
+ };
10
10
 
11
11
  function Examples({ chainId }: ExampleProps) {
12
- const [balance, setBalance] = useState(0)
13
- const [pool, setPool] = useState({ bonded_tokens: 0, not_bonded_tokens: 0 });
14
- const [count, setCount] = useState(0)
15
-
16
- const { address, getOfflineSignerAmino } = useChain(selectedChain.chain_name);
17
-
18
- // Example of using the query client to query Sei modules
19
- const getStakingPool = async () => {
20
- const queryClient = await getQueryClient(defaultUrls[chainId].rest);
21
- const result = await queryClient.cosmos.staking.v1beta1.pool({});
22
- setPool(result.pool)
23
- }
24
-
25
- const renderStakingPoolExample = () => {
26
- return (
27
- <div className="card">
28
- <div className="card-header">
29
- <p className="card__title">Staking Pool</p>
30
- <small className="card__description">
31
- <a
32
- href="https://sei-protocol.github.io/sei-js/functions/cosmjs.getQueryClient.html"
33
- target="_blank">Sei QueryClient</a> query example
34
- </small>
35
- </div>
36
- <div className="card-body">
37
- <div className="content-background space-between">
38
- <small>Bonded Tokens</small>
39
- <p>{pool ? pool.bonded_tokens : '---'} SEI</p>
40
- </div>
41
- <div className="content-background space-between">
42
- <small>Unbonded Tokens</small>
43
- <p>{pool ? pool.not_bonded_tokens : '---'} SEI</p>
44
- </div>
45
- </div>
46
- <div className="card-footer">
47
- <button onClick={getStakingPool}>Fetch Staking Data</button>
48
- </div>
49
- </div>
50
- )
51
- }
52
-
53
- const getBalanceStargate = async () => {
54
- if (!address) {
55
- return undefined
56
- }
57
- const queryClient = await getStargateClient(defaultUrls[chainId].rpc);
58
- const useiBalance = await queryClient.getBalance(address, 'usei');
59
- const seiBalance = Number(useiBalance.amount) / 1000000
60
- setBalance(seiBalance);
61
- }
62
-
63
- const renderBalanceExample = () => {
64
- return (
65
- <div className="card">
66
- <div className="card-header">
67
- <p className="card__title">Wallet Balance</p>
68
- <small className="card__description">
69
- <a
70
- href="https://cosmos.github.io/cosmjs/latest/stargate/classes/StargateClient.html"
71
- target="_blank">Stargate Client</a> query example
72
- </small>
73
- </div>
74
- <div className="card-body">
75
- <div className="content-background space-between">
76
- <small>SEI</small>
77
- <p>{balance ? balance : '---' } SEI</p>
78
- </div>
79
- </div>
80
- <div className="card-footer">
81
- <button onClick={getBalanceStargate}>Fetch balance</button>
82
- </div>
83
- </div>
84
- )
85
- }
86
-
87
- const fetchCount = async () => {
88
- const cosmWasmClient = await getCosmWasmClient(defaultUrls[chainId].rpc);
89
- console.log(cosmWasmClient);
90
- const CONTRACT_ADDRESS =
91
- "sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m";
92
- const response = await cosmWasmClient.queryContractSmart(CONTRACT_ADDRESS, {
93
- get_count: {},
94
- });
95
- const result = response?.count;
96
- if (result) {
97
- setCount(result);
98
- }
99
- }
100
-
101
- const incrementCounter = async () => {
102
- if (!address) {
103
- return;
104
- }
105
- const offlineSigner = await getOfflineSignerAmino();
106
- const signingCosmWasmClient = await getSigningCosmWasmClient(
107
- defaultUrls[chainId].rpc,
108
- offlineSigner
109
- )
110
-
111
- try {
112
- const senderAddress = address;
113
- const CONTRACT_ADDRESS =
114
- "sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m";
115
-
116
- // Build message content
117
- const msg = { increment: {} };
118
-
119
- // Define gas price and limit
120
- const fee = {
121
- amount: [{ amount: "20000", denom: "usei" }],
122
- gas: "200000",
123
- };
124
-
125
- // Call smart contract execute msg
126
- await signingCosmWasmClient?.execute(senderAddress, CONTRACT_ADDRESS, msg, fee);
127
-
128
- await fetchCount();
129
-
130
- } catch (error) {
131
- console.log(error)
132
- }
133
- };
134
-
135
- const renderCounterContractExample = () => {
136
- return (
137
- <div className="card">
138
- <div className="card-header">
139
- <p className="card__title">Smart contract interaction</p>
140
- <small>
141
- <a
142
- href="https://cosmos.github.io/cosmjs/latest/cosmwasm-stargate/classes/SigningCosmWasmClient.html"
143
- target="_blank">
144
- CosmWasm Clients
145
- </a> example of smart
146
- contract interaction
147
- </small>
148
- </div>
149
- <div className="card-body">
150
- <div className="content-background space-between">
151
- <small>Count</small>
152
- <p>{count}</p>
153
- <button
154
- className="small outline"
155
- onClick={incrementCounter}
156
- >
157
- Increase
158
- </button>
159
- </div>
160
- </div>
161
- <div className="card-footer">
162
- <button onClick={fetchCount}>Fetch count</button>
163
- </div>
164
- </div>
165
- )
166
- }
167
-
168
- return (
169
- <div className="grid">
170
- {renderBalanceExample()}
171
- {renderStakingPoolExample()}
172
- {renderCounterContractExample()}
173
- </div>
174
- )
12
+ const [balance, setBalance] = useState(0);
13
+ const [pool, setPool] = useState({ bonded_tokens: 0, not_bonded_tokens: 0 });
14
+ const [count, setCount] = useState(0);
15
+
16
+ const { address, getOfflineSignerAmino } = useChain(selectedChain.chain_name);
17
+
18
+ // Example of using the query client to query Sei modules
19
+ const getStakingPool = async () => {
20
+ const queryClient = await getQueryClient(defaultUrls[chainId].rest);
21
+ const result = await queryClient.cosmos.staking.v1beta1.pool({});
22
+ setPool(result.pool);
23
+ };
24
+
25
+ const renderStakingPoolExample = () => {
26
+ return (
27
+ <div className="card">
28
+ <div className="card-header">
29
+ <p className="card__title">Staking Pool</p>
30
+ <small className="card__description">
31
+ <a href="https://sei-protocol.github.io/sei-js/functions/cosmjs.getQueryClient.html" target="_blank">
32
+ Sei QueryClient
33
+ </a>{' '}
34
+ query example
35
+ </small>
36
+ </div>
37
+ <div className="card-body">
38
+ <div className="content-background space-between">
39
+ <small>Bonded Tokens</small>
40
+ <p>{pool ? pool.bonded_tokens : '---'} SEI</p>
41
+ </div>
42
+ <div className="content-background space-between">
43
+ <small>Unbonded Tokens</small>
44
+ <p>{pool ? pool.not_bonded_tokens : '---'} SEI</p>
45
+ </div>
46
+ </div>
47
+ <div className="card-footer">
48
+ <button onClick={getStakingPool}>Fetch Staking Data</button>
49
+ </div>
50
+ </div>
51
+ );
52
+ };
53
+
54
+ const getBalanceStargate = async () => {
55
+ if (!address) {
56
+ return undefined;
57
+ }
58
+ const queryClient = await getStargateClient(defaultUrls[chainId].rpc);
59
+ const useiBalance = await queryClient.getBalance(address, 'usei');
60
+ const seiBalance = Number(useiBalance.amount) / 1000000;
61
+ setBalance(seiBalance);
62
+ };
63
+
64
+ const renderBalanceExample = () => {
65
+ return (
66
+ <div className="card">
67
+ <div className="card-header">
68
+ <p className="card__title">Wallet Balance</p>
69
+ <small className="card__description">
70
+ <a href="https://cosmos.github.io/cosmjs/latest/stargate/classes/StargateClient.html" target="_blank">
71
+ Stargate Client
72
+ </a>{' '}
73
+ query example
74
+ </small>
75
+ </div>
76
+ <div className="card-body">
77
+ <div className="content-background space-between">
78
+ <small>SEI</small>
79
+ <p>{balance ? balance : '---'} SEI</p>
80
+ </div>
81
+ </div>
82
+ <div className="card-footer">
83
+ <button onClick={getBalanceStargate}>Fetch balance</button>
84
+ </div>
85
+ </div>
86
+ );
87
+ };
88
+
89
+ const fetchCount = async () => {
90
+ const cosmWasmClient = await getCosmWasmClient(defaultUrls[chainId].rpc);
91
+ console.log(cosmWasmClient);
92
+ const CONTRACT_ADDRESS = 'sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m';
93
+ const response = await cosmWasmClient.queryContractSmart(CONTRACT_ADDRESS, {
94
+ get_count: {}
95
+ });
96
+ const result = response?.count;
97
+ if (result) {
98
+ setCount(result);
99
+ }
100
+ };
101
+
102
+ const incrementCounter = async () => {
103
+ if (!address) {
104
+ return;
105
+ }
106
+ const offlineSigner = await getOfflineSignerAmino();
107
+ const signingCosmWasmClient = await getSigningCosmWasmClient(defaultUrls[chainId].rpc, offlineSigner);
108
+
109
+ try {
110
+ const senderAddress = address;
111
+ const CONTRACT_ADDRESS = 'sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m';
112
+
113
+ // Build message content
114
+ const msg = { increment: {} };
115
+
116
+ // Define gas price and limit
117
+ const fee = {
118
+ amount: [{ amount: '20000', denom: 'usei' }],
119
+ gas: '200000'
120
+ };
121
+
122
+ // Call smart contract execute msg
123
+ await signingCosmWasmClient?.execute(senderAddress, CONTRACT_ADDRESS, msg, fee);
124
+
125
+ await fetchCount();
126
+ } catch (error) {
127
+ console.log(error);
128
+ }
129
+ };
130
+
131
+ const renderCounterContractExample = () => {
132
+ return (
133
+ <div className="card">
134
+ <div className="card-header">
135
+ <p className="card__title">Smart contract interaction</p>
136
+ <small>
137
+ <a href="https://cosmos.github.io/cosmjs/latest/cosmwasm-stargate/classes/SigningCosmWasmClient.html" target="_blank">
138
+ CosmWasm Clients
139
+ </a>{' '}
140
+ example of smart contract interaction
141
+ </small>
142
+ </div>
143
+ <div className="card-body">
144
+ <div className="content-background space-between">
145
+ <small>Count</small>
146
+ <p>{count}</p>
147
+ <button className="small outline" onClick={incrementCounter}>
148
+ Increase
149
+ </button>
150
+ </div>
151
+ </div>
152
+ <div className="card-footer">
153
+ <button onClick={fetchCount}>Fetch count</button>
154
+ </div>
155
+ </div>
156
+ );
157
+ };
158
+
159
+ return (
160
+ <div className="grid">
161
+ {renderBalanceExample()}
162
+ {renderStakingPoolExample()}
163
+ {renderCounterContractExample()}
164
+ </div>
165
+ );
175
166
  }
176
167
 
177
- export default Examples;
168
+ export default Examples;
@@ -1,156 +1,154 @@
1
1
  #root {
2
- display: flex;
3
- flex-direction: column;
4
- min-height: 100vh;
2
+ display: flex;
3
+ flex-direction: column;
4
+ min-height: 100vh;
5
5
  }
6
6
  .app {
7
- width: 100%;
8
- height: 100%;
7
+ width: 100%;
8
+ height: 100%;
9
9
  }
10
10
 
11
11
  .logo {
12
- width: 20%;
13
- align-self: center;
12
+ width: 20%;
13
+ align-self: center;
14
14
  }
15
15
 
16
16
  .container {
17
- margin: 0 auto;
18
- display: flex;
19
- flex-direction: column;
20
- gap: 3rem;
21
- width: 100%;
22
- padding: 1rem;
23
- height: -webkit-fill-available;
24
- flex-grow: 1;
25
- justify-content: center;
17
+ margin: 0 auto;
18
+ display: flex;
19
+ flex-direction: column;
20
+ gap: 3rem;
21
+ width: 100%;
22
+ padding: 1rem;
23
+ height: -webkit-fill-available;
24
+ flex-grow: 1;
25
+ justify-content: center;
26
26
  }
27
27
 
28
28
  .grid {
29
- width: 100%;
30
- display: grid;
31
- grid-template-columns: repeat(1, 1fr);
32
- gap: 1rem;
29
+ width: 100%;
30
+ display: grid;
31
+ grid-template-columns: repeat(1, 1fr);
32
+ gap: 1rem;
33
33
  }
34
34
  .grid.docs {
35
- grid-template-columns: repeat(1, 1fr);
35
+ grid-template-columns: repeat(1, 1fr);
36
36
  }
37
37
 
38
38
  .card {
39
- width: 100%;
40
- padding: 1.5em;
41
- border-radius: 1rem;
42
- background: var(--card);
43
- color: var(--card-foreground);
44
- box-shadow: 0px 4px 6px 0px rgba(0, 0, 0, 0.09);
39
+ width: 100%;
40
+ padding: 1.5em;
41
+ border-radius: 1rem;
42
+ background: var(--card);
43
+ color: var(--card-foreground);
44
+ box-shadow: 0px 4px 6px 0px rgba(0, 0, 0, 0.09);
45
45
  }
46
46
 
47
47
  .card.secondary {
48
- background: transparent;
49
- border: 1px solid var(--border);
50
- box-shadow: none;
48
+ background: transparent;
49
+ border: 1px solid var(--border);
50
+ box-shadow: none;
51
51
  }
52
52
  .card.intro {
53
- display: flex;
54
- flex-direction: column;
55
- gap: 1rem;
56
- justify-content: space-between;
57
- align-items: flex-start;
53
+ display: flex;
54
+ flex-direction: column;
55
+ gap: 1rem;
56
+ justify-content: space-between;
57
+ align-items: flex-start;
58
58
  }
59
59
  .card-header {
60
- display: flex;
61
- flex-direction: column;
62
- justify-content: space-between;
63
- gap: 0.25rem;
60
+ display: flex;
61
+ flex-direction: column;
62
+ justify-content: space-between;
63
+ gap: 0.25rem;
64
64
  }
65
65
  .card-body {
66
- display: flex;
67
- flex-direction: column;
68
- justify-content: space-between;
69
- margin: 1.5rem 0;
66
+ display: flex;
67
+ flex-direction: column;
68
+ justify-content: space-between;
69
+ margin: 1.5rem 0;
70
70
  }
71
71
 
72
72
  .card-footer {
73
- display: flex;
74
- flex-direction: row;
75
- gap: 0.5rem;
73
+ display: flex;
74
+ flex-direction: row;
75
+ gap: 0.5rem;
76
76
  }
77
77
 
78
78
  .card__title {
79
- font-size: 1.15rem;
80
- font-weight: 600;
79
+ font-size: 1.15rem;
80
+ font-weight: 600;
81
81
  }
82
82
  .content-background {
83
- overflow: hidden;
84
- background: #fafaf9;
85
- border-radius: 4rem;
86
- padding: 0 1rem;
87
- height: 3.5rem;
88
- display: flex;
89
- align-items: center;
83
+ overflow: hidden;
84
+ background: #fafaf9;
85
+ border-radius: 4rem;
86
+ padding: 0 1rem;
87
+ height: 3.5rem;
88
+ display: flex;
89
+ align-items: center;
90
90
  }
91
91
 
92
92
  .wallet-address {
93
- text-wrap: anywhere;
94
- line-break: anywhere;
93
+ text-wrap: anywhere;
94
+ line-break: anywhere;
95
95
  }
96
96
 
97
97
  .space-between {
98
- justify-content: space-between;
99
- gap: 1rem;
98
+ justify-content: space-between;
99
+ gap: 1rem;
100
100
  }
101
101
 
102
102
  .hide-on-mobile {
103
- display: none;
103
+ display: none;
104
104
  }
105
105
 
106
106
  .hide-on-desktop {
107
- display: block;
107
+ display: block;
108
108
  }
109
109
 
110
110
  .external-link {
111
- display: inline-flex;
112
- gap: 0.25rem;
111
+ display: inline-flex;
112
+ gap: 0.25rem;
113
113
  }
114
114
 
115
115
  .get-started {
116
- text-align: center;
116
+ text-align: center;
117
117
  }
118
118
 
119
119
  .wallet-connect {
120
- display: flex;
121
- gap: 1rem;
122
- align-items: center;
120
+ display: flex;
121
+ gap: 1rem;
122
+ align-items: center;
123
123
  }
124
124
 
125
-
126
125
  @media (min-width: 768px) {
127
-
128
- .card.intro {
129
- grid-column: span 2;
130
- flex-direction: row;
131
- align-items: center;
132
- }
133
- .hide-on-mobile {
134
- display: block;
135
- }
136
- .hide-on-desktop {
137
- display: none;
138
- }
139
-
140
- .container {
141
- max-width: 96rem;
142
- padding: 2rem;
143
- }
144
- .grid {
145
- grid-template-columns: repeat(3, 1fr);
146
- }
147
- .grid.docs {
148
- grid-template-columns: repeat(3, 1fr);
149
- }
126
+ .card.intro {
127
+ grid-column: span 2;
128
+ flex-direction: row;
129
+ align-items: center;
130
+ }
131
+ .hide-on-mobile {
132
+ display: block;
133
+ }
134
+ .hide-on-desktop {
135
+ display: none;
136
+ }
137
+
138
+ .container {
139
+ max-width: 96rem;
140
+ padding: 2rem;
141
+ }
142
+ .grid {
143
+ grid-template-columns: repeat(3, 1fr);
144
+ }
145
+ .grid.docs {
146
+ grid-template-columns: repeat(3, 1fr);
147
+ }
150
148
  }
151
149
 
152
150
  @media (min-width: 1024px) {
153
- .container {
154
- max-width: 80rem;
155
- }
151
+ .container {
152
+ max-width: 80rem;
153
+ }
156
154
  }