Skip to content

Commit 70fdaad

Browse files
authored
feat: use KeyManager.http (#13)
* feat: use KeyManager.http('https://keystore.tempo.xyz') * chore: up * fix: set webAuthn rpId to top-level domain * fix: use keys.tempo.xyz
1 parent f977b49 commit 70fdaad

4 files changed

Lines changed: 17 additions & 9 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"sql-formatter": "^15.6.12",
3131
"tailwind-merge": "^3.4.0",
3232
"tailwindcss": "^4.1.18",
33-
"tempo.ts": "^0.13.0",
33+
"tempo.ts": "^0.14.0",
3434
"unplugin-auto-import": "^20.3.0",
3535
"unplugin-icons": "^22.5.0",
3636
"viem": "^2.44.4",

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/snippets/wagmi.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { KeyManager, webAuthn } from 'wagmi/tempo'
1111
export const config = createConfig({
1212
connectors: [
1313
webAuthn({
14-
keyManager: KeyManager.localStorage(),
14+
keyManager: KeyManager.http('https://keys.tempo.xyz'),
1515
}),
1616
],
1717
chains: [tempoModerato],
@@ -33,7 +33,7 @@ import { KeyManager, webAuthn } from 'wagmi/tempo'
3333
export const config = createConfig({
3434
connectors: [
3535
webAuthn({
36-
keyManager: KeyManager.localStorage(),
36+
keyManager: KeyManager.http('https://keys.tempo.xyz'),
3737
}),
3838
],
3939
chains: [tempoModerato],

src/wagmi.config.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ import { KeyManager, webAuthn } from 'wagmi/tempo'
66

77
const feeToken = '0x20c0000000000000000000000000000000000001'
88

9+
const rpId = (() => {
10+
const hostname = globalThis.location?.hostname
11+
if (!hostname) return undefined
12+
const parts = hostname.split('.')
13+
return parts.length > 2 ? parts.slice(-2).join('.') : hostname
14+
})()
15+
916
export function getConfig(options: getConfig.Options = {}) {
1017
const { multiInjectedProviderDiscovery } = options
1118
return createConfig({
@@ -22,7 +29,8 @@ export function getConfig(options: getConfig.Options = {}) {
2229
connectors: [
2330
webAuthn({
2431
grantAccessKey: true,
25-
keyManager: KeyManager.localStorage(),
32+
keyManager: KeyManager.http('https://keys.tempo.xyz'),
33+
rpId,
2634
}),
2735
],
2836
multiInjectedProviderDiscovery,

0 commit comments

Comments
 (0)