Skip to content

Commit 8faebb0

Browse files
committed
spike: add dynamic fe wallet support
1 parent 584b9fd commit 8faebb0

File tree

13 files changed

+1472
-1034
lines changed

13 files changed

+1472
-1034
lines changed

packages/demo/backend/src/types/service.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import type { Address } from 'viem'
1111
export interface WalletData {
1212
/** Wallet address */
1313
address: Address
14-
/** Wallet ID */
15-
id: string
1614
}
1715

1816
/**

packages/demo/frontend/package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,18 @@
1818
"typecheck": "tsc --noEmit"
1919
},
2020
"dependencies": {
21+
"@clerk/clerk-react": "^5.46.0",
22+
"@dynamic-labs/ethereum": "4.32.0",
23+
"@dynamic-labs/sdk-react-core": "4.32.0",
24+
"@dynamic-labs/wallet-connector-core": "4.32.0",
25+
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
26+
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
2127
"@eth-optimism/verbs-sdk": "workspace:*",
2228
"@eth-optimism/verbs-service": "workspace:*",
2329
"@eth-optimism/viem": "^0.4.13",
2430
"@privy-io/react-auth": "^2.24.0",
2531
"buffer": "^6.0.3",
32+
"eventemitter3": "^5",
2633
"react": "^18",
2734
"react-dom": "^18",
2835
"react-router": "7",

packages/demo/frontend/src/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'
22
import Terminal from './components/Terminal'
33
import Home from './components/Home'
4-
import { PrivyProvider } from './providers/PrivyProvider'
4+
import { DynamicProvider } from './providers/DynamicProvider'
55

66
function App() {
77
return (
8-
<PrivyProvider>
8+
<DynamicProvider>
99
<Router>
1010
<div className="w-full h-screen bg-terminal-bg">
1111
<Routes>
@@ -14,7 +14,7 @@ function App() {
1414
</Routes>
1515
</div>
1616
</Router>
17-
</PrivyProvider>
17+
</DynamicProvider>
1818
)
1919
}
2020

Lines changed: 346 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,346 @@
1+
export const mintableErc20Abi = [
2+
{
3+
inputs: [],
4+
stateMutability: 'nonpayable',
5+
type: 'constructor',
6+
},
7+
{
8+
inputs: [
9+
{
10+
internalType: 'address',
11+
name: 'spender',
12+
type: 'address',
13+
},
14+
{
15+
internalType: 'uint256',
16+
name: 'allowance',
17+
type: 'uint256',
18+
},
19+
{
20+
internalType: 'uint256',
21+
name: 'needed',
22+
type: 'uint256',
23+
},
24+
],
25+
name: 'ERC20InsufficientAllowance',
26+
type: 'error',
27+
},
28+
{
29+
inputs: [
30+
{
31+
internalType: 'address',
32+
name: 'sender',
33+
type: 'address',
34+
},
35+
{
36+
internalType: 'uint256',
37+
name: 'balance',
38+
type: 'uint256',
39+
},
40+
{
41+
internalType: 'uint256',
42+
name: 'needed',
43+
type: 'uint256',
44+
},
45+
],
46+
name: 'ERC20InsufficientBalance',
47+
type: 'error',
48+
},
49+
{
50+
inputs: [
51+
{
52+
internalType: 'address',
53+
name: 'approver',
54+
type: 'address',
55+
},
56+
],
57+
name: 'ERC20InvalidApprover',
58+
type: 'error',
59+
},
60+
{
61+
inputs: [
62+
{
63+
internalType: 'address',
64+
name: 'receiver',
65+
type: 'address',
66+
},
67+
],
68+
name: 'ERC20InvalidReceiver',
69+
type: 'error',
70+
},
71+
{
72+
inputs: [
73+
{
74+
internalType: 'address',
75+
name: 'sender',
76+
type: 'address',
77+
},
78+
],
79+
name: 'ERC20InvalidSender',
80+
type: 'error',
81+
},
82+
{
83+
inputs: [
84+
{
85+
internalType: 'address',
86+
name: 'spender',
87+
type: 'address',
88+
},
89+
],
90+
name: 'ERC20InvalidSpender',
91+
type: 'error',
92+
},
93+
{
94+
anonymous: false,
95+
inputs: [
96+
{
97+
indexed: true,
98+
internalType: 'address',
99+
name: 'owner',
100+
type: 'address',
101+
},
102+
{
103+
indexed: true,
104+
internalType: 'address',
105+
name: 'spender',
106+
type: 'address',
107+
},
108+
{
109+
indexed: false,
110+
internalType: 'uint256',
111+
name: 'value',
112+
type: 'uint256',
113+
},
114+
],
115+
name: 'Approval',
116+
type: 'event',
117+
},
118+
{
119+
anonymous: false,
120+
inputs: [
121+
{
122+
indexed: true,
123+
internalType: 'address',
124+
name: 'from',
125+
type: 'address',
126+
},
127+
{
128+
indexed: true,
129+
internalType: 'address',
130+
name: 'to',
131+
type: 'address',
132+
},
133+
{
134+
indexed: false,
135+
internalType: 'uint256',
136+
name: 'value',
137+
type: 'uint256',
138+
},
139+
],
140+
name: 'Transfer',
141+
type: 'event',
142+
},
143+
{
144+
inputs: [
145+
{
146+
internalType: 'address',
147+
name: 'owner',
148+
type: 'address',
149+
},
150+
{
151+
internalType: 'address',
152+
name: 'spender',
153+
type: 'address',
154+
},
155+
],
156+
name: 'allowance',
157+
outputs: [
158+
{
159+
internalType: 'uint256',
160+
name: '',
161+
type: 'uint256',
162+
},
163+
],
164+
stateMutability: 'view',
165+
type: 'function',
166+
},
167+
{
168+
inputs: [
169+
{
170+
internalType: 'address',
171+
name: 'spender',
172+
type: 'address',
173+
},
174+
{
175+
internalType: 'uint256',
176+
name: 'value',
177+
type: 'uint256',
178+
},
179+
],
180+
name: 'approve',
181+
outputs: [
182+
{
183+
internalType: 'bool',
184+
name: '',
185+
type: 'bool',
186+
},
187+
],
188+
stateMutability: 'nonpayable',
189+
type: 'function',
190+
},
191+
{
192+
inputs: [
193+
{
194+
internalType: 'address',
195+
name: 'account',
196+
type: 'address',
197+
},
198+
],
199+
name: 'balanceOf',
200+
outputs: [
201+
{
202+
internalType: 'uint256',
203+
name: '',
204+
type: 'uint256',
205+
},
206+
],
207+
stateMutability: 'view',
208+
type: 'function',
209+
},
210+
{
211+
inputs: [
212+
{
213+
internalType: 'uint256',
214+
name: 'amount',
215+
type: 'uint256',
216+
},
217+
],
218+
name: 'burn',
219+
outputs: [],
220+
stateMutability: 'nonpayable',
221+
type: 'function',
222+
},
223+
{
224+
inputs: [],
225+
name: 'decimals',
226+
outputs: [
227+
{
228+
internalType: 'uint8',
229+
name: '',
230+
type: 'uint8',
231+
},
232+
],
233+
stateMutability: 'pure',
234+
type: 'function',
235+
},
236+
{
237+
inputs: [
238+
{
239+
internalType: 'address',
240+
name: 'to',
241+
type: 'address',
242+
},
243+
{
244+
internalType: 'uint256',
245+
name: 'amount',
246+
type: 'uint256',
247+
},
248+
],
249+
name: 'mint',
250+
outputs: [],
251+
stateMutability: 'nonpayable',
252+
type: 'function',
253+
},
254+
{
255+
inputs: [],
256+
name: 'name',
257+
outputs: [
258+
{
259+
internalType: 'string',
260+
name: '',
261+
type: 'string',
262+
},
263+
],
264+
stateMutability: 'view',
265+
type: 'function',
266+
},
267+
{
268+
inputs: [],
269+
name: 'symbol',
270+
outputs: [
271+
{
272+
internalType: 'string',
273+
name: '',
274+
type: 'string',
275+
},
276+
],
277+
stateMutability: 'view',
278+
type: 'function',
279+
},
280+
{
281+
inputs: [],
282+
name: 'totalSupply',
283+
outputs: [
284+
{
285+
internalType: 'uint256',
286+
name: '',
287+
type: 'uint256',
288+
},
289+
],
290+
stateMutability: 'view',
291+
type: 'function',
292+
},
293+
{
294+
inputs: [
295+
{
296+
internalType: 'address',
297+
name: 'to',
298+
type: 'address',
299+
},
300+
{
301+
internalType: 'uint256',
302+
name: 'value',
303+
type: 'uint256',
304+
},
305+
],
306+
name: 'transfer',
307+
outputs: [
308+
{
309+
internalType: 'bool',
310+
name: '',
311+
type: 'bool',
312+
},
313+
],
314+
stateMutability: 'nonpayable',
315+
type: 'function',
316+
},
317+
{
318+
inputs: [
319+
{
320+
internalType: 'address',
321+
name: 'from',
322+
type: 'address',
323+
},
324+
{
325+
internalType: 'address',
326+
name: 'to',
327+
type: 'address',
328+
},
329+
{
330+
internalType: 'uint256',
331+
name: 'value',
332+
type: 'uint256',
333+
},
334+
],
335+
name: 'transferFrom',
336+
outputs: [
337+
{
338+
internalType: 'bool',
339+
name: '',
340+
type: 'bool',
341+
},
342+
],
343+
stateMutability: 'nonpayable',
344+
type: 'function',
345+
},
346+
]

0 commit comments

Comments
 (0)