Skip to content

Commit eba63f3

Browse files
committed
Rebase and fix build issues
1 parent 990eadd commit eba63f3

File tree

177 files changed

+1061
-15256
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+1061
-15256
lines changed
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
4-
"lib": ["dom", "dom.iterable", "esnext"],
5-
"allowJs": true,
3+
"target": "ESNext",
4+
"useDefineForClassFields": true,
5+
"lib": ["DOM", "DOM.Iterable", "ESNext"],
6+
"allowJs": false,
67
"skipLibCheck": true,
78
"esModuleInterop": true,
89
"allowSyntheticDefaultImports": true,
910
"strict": true,
1011
"forceConsistentCasingInFileNames": true,
11-
"noFallthroughCasesInSwitch": true,
12-
"module": "esnext",
13-
"moduleResolution": "node",
12+
"module": "ESNext",
13+
"moduleResolution": "Bundler",
1414
"resolveJsonModule": true,
1515
"isolatedModules": true,
1616
"noEmit": true,
17-
"jsx": "react-jsx",
18-
"noUnusedLocals": true
17+
"jsx": "react-jsx"
1918
},
20-
"include": ["src"]
19+
"include": ["src", "src/components/sendTransaction.tsx", "src/components/switchNetwork.tsx", "src/components/writeContract.tsx", "src/components/getBalance.tsx"],
20+
"references": [{ "path": "./tsconfig.node.json" }]
2121
}

web-modal-sdk/blockchain-connection-examples/linea-modal-example/tsconfig.node.json renamed to custom-authentication/grouped-connection/auth0-google-implicit-grouped-example/tsconfig.node.json

File renamed without changes.
Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,21 @@
11
{
22
"compilerOptions": {
3+
"target": "ESNext",
4+
"useDefineForClassFields": true,
5+
"lib": ["DOM", "DOM.Iterable", "ESNext"],
36
"allowJs": false,
4-
"allowSyntheticDefaultImports": true,
7+
"skipLibCheck": true,
58
"esModuleInterop": true,
9+
"allowSyntheticDefaultImports": true,
10+
"strict": true,
611
"forceConsistentCasingInFileNames": true,
12+
"module": "ESNext",
13+
"moduleResolution": "Bundler",
14+
"resolveJsonModule": true,
715
"isolatedModules": true,
8-
"jsx": "react-jsx",
9-
"lib": [
10-
"dom",
11-
"dom.iterable",
12-
"esnext"
13-
],
14-
"module": "esnext",
15-
"moduleResolution": "node",
1616
"noEmit": true,
17-
"noFallthroughCasesInSwitch": true,
18-
"resolveJsonModule": true,
19-
"skipLibCheck": true,
20-
"strict": true,
21-
"target": "ESNext",
22-
"types": [
23-
"vite/client"
24-
]
17+
"jsx": "react-jsx"
2518
},
26-
"include": [
27-
"src"
28-
]
29-
}
19+
"include": ["src", "src/components/sendTransaction.tsx", "src/components/switchNetwork.tsx", "src/components/writeContract.tsx", "src/components/getBalance.tsx"],
20+
"references": [{ "path": "./tsconfig.node.json" }]
21+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"compilerOptions": {
3+
"composite": true,
4+
"module": "ESNext",
5+
"moduleResolution": "Node",
6+
"allowSyntheticDefaultImports": true
7+
},
8+
"include": ["vite.config.ts"]
9+
}
Lines changed: 38 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,45 @@
1-
import { useAccount, useSendTransaction, useWaitForTransactionReceipt } from "wagmi";
2-
import { useState } from "react";
1+
import { FormEvent } from "react";
2+
import { useWaitForTransactionReceipt, useSendTransaction, BaseError } from "wagmi";
3+
import { Hex, parseEther } from "viem";
34

45
export function SendTransaction() {
5-
const { address } = useAccount();
6-
const [to, setTo] = useState<string>(address || "");
7-
const [amount, setAmount] = useState<string>("0.001");
6+
const { data: hash, error, isPending, sendTransaction } = useSendTransaction()
87

9-
const { data: hash, sendTransaction } = useSendTransaction();
10-
11-
const { isLoading, isSuccess } = useWaitForTransactionReceipt({
12-
hash,
13-
});
14-
15-
function handleSubmit(e: React.FormEvent<HTMLFormElement>) {
16-
e.preventDefault();
17-
sendTransaction({
18-
to: to,
19-
value: BigInt(parseFloat(amount) * 10 ** 18),
20-
});
8+
async function submit(e: FormEvent<HTMLFormElement>) {
9+
e.preventDefault()
10+
const formData = new FormData(e.target as HTMLFormElement)
11+
const to = formData.get('address') as Hex
12+
const value = formData.get('value') as string
13+
sendTransaction({ to, value: parseEther(value) })
2114
}
22-
15+
16+
const { isLoading: isConfirming, isSuccess: isConfirmed } =
17+
useWaitForTransactionReceipt({
18+
hash,
19+
})
20+
2321
return (
24-
<div className="flex-container">
25-
<form onSubmit={handleSubmit}>
26-
<div style={{ display: "flex", flexDirection: "column", gap: "10px" }}>
27-
<input
28-
placeholder="Receiver address"
29-
onChange={(e) => setTo(e.target.value)}
30-
value={to}
31-
className="card"
32-
/>
33-
<input
34-
placeholder="Amount in ETH"
35-
onChange={(e) => setAmount(e.target.value)}
36-
value={amount}
37-
className="card"
38-
/>
39-
<button type="submit" className="card">
40-
Send Transaction
41-
</button>
42-
</div>
22+
<div>
23+
<h2>Send Transaction</h2>
24+
<form onSubmit={submit}>
25+
<input name="address" placeholder="Address" required />
26+
<input
27+
name="value"
28+
placeholder="Amount (ETH)"
29+
type="number"
30+
step="0.000000001"
31+
required
32+
/>
33+
<button disabled={isPending} type="submit">
34+
{isPending ? 'Confirming...' : 'Send'}
35+
</button>
4336
</form>
44-
<div>
45-
{isLoading && <div>Confirming...</div>}
46-
{isSuccess && (
47-
<div>
48-
Successfully sent {amount} ETH to {to}
49-
<div>
50-
<a href={`https://polygonscan.com/tx/${hash}`} target="_blank" rel="noreferrer">
51-
View on Polygonscan
52-
</a>
53-
</div>
54-
</div>
55-
)}
56-
</div>
37+
{hash && <div>Transaction Hash: {hash}</div>}
38+
{isConfirming && 'Waiting for confirmation...'}
39+
{isConfirmed && 'Transaction confirmed.'}
40+
{error && (
41+
<div>Error: {(error as BaseError).shortMessage || error.message}</div>
42+
)}
5743
</div>
58-
);
59-
}
44+
)
45+
}
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
4-
"lib": ["dom", "dom.iterable", "esnext"],
5-
"allowJs": true,
3+
"target": "ESNext",
4+
"useDefineForClassFields": true,
5+
"lib": ["DOM", "DOM.Iterable", "ESNext"],
6+
"allowJs": false,
67
"skipLibCheck": true,
78
"esModuleInterop": true,
89
"allowSyntheticDefaultImports": true,
910
"strict": true,
1011
"forceConsistentCasingInFileNames": true,
11-
"noFallthroughCasesInSwitch": true,
12-
"module": "esnext",
13-
"moduleResolution": "node",
12+
"module": "ESNext",
13+
"moduleResolution": "Bundler",
1414
"resolveJsonModule": true,
1515
"isolatedModules": true,
1616
"noEmit": true,
17-
"jsx": "react-jsx",
18-
"noUnusedLocals": true
17+
"jsx": "react-jsx"
1918
},
20-
"include": ["src"]
19+
"include": ["src", "src/components/sendTransaction.tsx", "src/components/switchNetwork.tsx", "src/components/writeContract.tsx", "src/components/getBalance.tsx"],
20+
"references": [{ "path": "./tsconfig.node.json" }]
2121
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"compilerOptions": {
3+
"composite": true,
4+
"module": "ESNext",
5+
"moduleResolution": "Node",
6+
"allowSyntheticDefaultImports": true
7+
},
8+
"include": ["vite.config.ts"]
9+
}
Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,21 @@
11
{
22
"compilerOptions": {
3+
"target": "ESNext",
4+
"useDefineForClassFields": true,
5+
"lib": ["DOM", "DOM.Iterable", "ESNext"],
36
"allowJs": false,
4-
"allowSyntheticDefaultImports": true,
7+
"skipLibCheck": true,
58
"esModuleInterop": true,
9+
"allowSyntheticDefaultImports": true,
10+
"strict": true,
611
"forceConsistentCasingInFileNames": true,
12+
"module": "ESNext",
13+
"moduleResolution": "Bundler",
14+
"resolveJsonModule": true,
715
"isolatedModules": true,
8-
"jsx": "react-jsx",
9-
"lib": [
10-
"dom",
11-
"dom.iterable",
12-
"esnext"
13-
],
14-
"module": "esnext",
15-
"moduleResolution": "node",
1616
"noEmit": true,
17-
"noFallthroughCasesInSwitch": true,
18-
"resolveJsonModule": true,
19-
"skipLibCheck": true,
20-
"strict": true,
21-
"target": "ESNext",
22-
"types": [
23-
"vite/client"
24-
]
17+
"jsx": "react-jsx"
2518
},
26-
"include": [
27-
"src"
28-
]
29-
}
19+
"include": ["src", "src/components/sendTransaction.tsx", "src/components/switchNetwork.tsx", "src/components/writeContract.tsx", "src/components/getBalance.tsx"],
20+
"references": [{ "path": "./tsconfig.node.json" }]
21+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"compilerOptions": {
3+
"composite": true,
4+
"module": "ESNext",
5+
"moduleResolution": "Node",
6+
"allowSyntheticDefaultImports": true
7+
},
8+
"include": ["vite.config.ts"]
9+
}
Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,21 @@
11
{
22
"compilerOptions": {
3+
"target": "ESNext",
4+
"useDefineForClassFields": true,
5+
"lib": ["DOM", "DOM.Iterable", "ESNext"],
36
"allowJs": false,
4-
"allowSyntheticDefaultImports": true,
7+
"skipLibCheck": true,
58
"esModuleInterop": true,
9+
"allowSyntheticDefaultImports": true,
10+
"strict": true,
611
"forceConsistentCasingInFileNames": true,
12+
"module": "ESNext",
13+
"moduleResolution": "Bundler",
14+
"resolveJsonModule": true,
715
"isolatedModules": true,
8-
"jsx": "react-jsx",
9-
"lib": [
10-
"dom",
11-
"dom.iterable",
12-
"esnext"
13-
],
14-
"module": "esnext",
15-
"moduleResolution": "node",
1616
"noEmit": true,
17-
"noFallthroughCasesInSwitch": true,
18-
"resolveJsonModule": true,
19-
"skipLibCheck": true,
20-
"strict": true,
21-
"target": "ESNext",
22-
"types": [
23-
"vite/client"
24-
]
17+
"jsx": "react-jsx"
2518
},
26-
"include": [
27-
"src"
28-
]
29-
}
19+
"include": ["src", "src/components/sendTransaction.tsx", "src/components/switchNetwork.tsx", "src/components/writeContract.tsx", "src/components/getBalance.tsx"],
20+
"references": [{ "path": "./tsconfig.node.json" }]
21+
}

0 commit comments

Comments
 (0)