Skip to content

Commit 3e94854

Browse files
committed
spike: add dynamic fe wallet support
1 parent 1559535 commit 3e94854

File tree

13 files changed

+1367
-1042
lines changed

13 files changed

+1367
-1042
lines changed

packages/demo/backend/src/config/verbs.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import { Verbs, type VerbsConfig } from '@eth-optimism/verbs-sdk'
1+
import { createVerbs, type VerbsConfig } from '@eth-optimism/verbs-sdk/node'
22
import { PrivyClient } from '@privy-io/server-auth'
33
import { baseSepolia, unichain } from 'viem/chains'
44

55
import { env } from './env.js'
66

7-
let verbsInstance: Verbs<'privy'>
8-
97
export function createVerbsConfig(): VerbsConfig<'privy'> {
108
return {
119
wallet: {
@@ -53,16 +51,12 @@ export function createVerbsConfig(): VerbsConfig<'privy'> {
5351
}
5452
}
5553

56-
export function initializeVerbs(config?: VerbsConfig<'privy'>): void {
57-
const verbsConfig = config || createVerbsConfig()
58-
verbsInstance = new Verbs(verbsConfig)
54+
export function initializeVerbs() {
55+
return createVerbs(createVerbsConfig())
5956
}
6057

6158
export function getVerbs() {
62-
if (!verbsInstance) {
63-
throw new Error('Verbs SDK not initialized. Call initializeVerbs() first.')
64-
}
65-
return verbsInstance
59+
return initializeVerbs()
6660
}
6761

6862
export function getPrivyClient() {

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

0 commit comments

Comments
 (0)