Skip to content

Commit 8cb2301

Browse files
committed
spike: add dynamic fe wallet support
1 parent 0b5366c commit 8cb2301

35 files changed

+3718
-1299
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: {
@@ -55,16 +53,12 @@ export function createVerbsConfig(): VerbsConfig<'privy'> {
5553
}
5654
}
5755

58-
export function initializeVerbs(config?: VerbsConfig<'privy'>): void {
59-
const verbsConfig = config || createVerbsConfig()
60-
verbsInstance = new Verbs(verbsConfig)
56+
export function initializeVerbs() {
57+
return createVerbs(createVerbsConfig())
6158
}
6259

6360
export function getVerbs() {
64-
if (!verbsInstance) {
65-
throw new Error('Verbs SDK not initialized. Call initializeVerbs() first.')
66-
}
67-
return verbsInstance
61+
return initializeVerbs()
6862
}
6963

7064
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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,16 @@
1919
},
2020
"dependencies": {
2121
"@clerk/clerk-react": "^5.46.0",
22+
"@dynamic-labs/ethereum": "^4.31.4",
23+
"@dynamic-labs/sdk-react-core": "^4.31.4",
24+
"@dynamic-labs/wallet-connector-core": "^4.31.4",
25+
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
26+
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
2227
"@eth-optimism/verbs-sdk": "workspace:*",
2328
"@eth-optimism/verbs-service": "workspace:*",
2429
"@eth-optimism/viem": "^0.4.13",
2530
"@privy-io/react-auth": "^2.24.0",
31+
"eventemitter3": "^5",
2632
"react": "^18",
2733
"react-dom": "^18",
2834
"react-router": "7",

packages/demo/frontend/src/App.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +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 { ClerkProvider } from './providers/ClerkProvider'
5-
import { PrivyProvider } from './providers/PrivyProvider'
4+
import { DynamicProvider } from './providers/DynamicProvider'
65

76
function App() {
87
return (
9-
<ClerkProvider>
10-
<PrivyProvider>
8+
<DynamicProvider>
119
<Router>
1210
<div className="w-full h-screen bg-terminal-bg">
1311
<Routes>
@@ -16,8 +14,7 @@ function App() {
1614
</Routes>
1715
</div>
1816
</Router>
19-
</PrivyProvider>
20-
</ClerkProvider>
17+
</DynamicProvider>
2118
)
2219
}
2320

0 commit comments

Comments
 (0)