diff --git a/package.json b/package.json index f60fae6..3d29070 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "sql-formatter": "^15.6.12", "tailwind-merge": "^3.4.0", "tailwindcss": "^4.1.18", - "tempo.ts": "^0.13.0", + "tempo.ts": "^0.14.0", "unplugin-auto-import": "^20.3.0", "unplugin-icons": "^22.5.0", "viem": "^2.44.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0d81f1a..a831064 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -63,8 +63,8 @@ importers: specifier: ^4.1.18 version: 4.1.18 tempo.ts: - specifier: ^0.13.0 - version: 0.13.0(@remix-run/headers@0.17.2)(@remix-run/route-pattern@0.15.3)(@remix-run/session@0.4.1)(typescript@5.9.3)(viem@2.44.4(typescript@5.9.3)(zod@4.3.5))(zod@4.3.5) + specifier: ^0.14.0 + version: 0.14.0(@remix-run/headers@0.17.2)(@remix-run/route-pattern@0.15.3)(@remix-run/session@0.4.1)(typescript@5.9.3)(viem@2.44.4(typescript@5.9.3)(zod@4.3.5))(zod@4.3.5) unplugin-auto-import: specifier: ^20.3.0 version: 20.3.0 @@ -2960,8 +2960,8 @@ packages: resolution: {integrity: sha512-hctwP0Nb4AB60bj8WQgRYaMOuJYRAPMGiQUAotms5igN8ppfQM+IvjQ5HcKu1MaZh2Wy2KWVTe563Yj8dfc14w==} engines: {node: '>=18'} - tempo.ts@0.13.0: - resolution: {integrity: sha512-Y61NOIL/qS6kgwoLz5NlDRU5mPx9OPCIUuvBeb5XbQYhtzh1AWiKws3jlK6dOIrqWDBo3imHjtgKO8qAjcb15A==} + tempo.ts@0.14.0: + resolution: {integrity: sha512-tyNg6pomYGqXpiRm0PDLwzOcifd//C9J+B+4rvbIHIwvwqxE1jres1YuaVSayo0JE0hzmXi/HZjJOsbSRdu+kg==} peerDependencies: viem: '>=2.43.3' peerDependenciesMeta: @@ -6598,7 +6598,7 @@ snapshots: mkdirp: 3.0.1 yallist: 5.0.0 - tempo.ts@0.13.0(@remix-run/headers@0.17.2)(@remix-run/route-pattern@0.15.3)(@remix-run/session@0.4.1)(typescript@5.9.3)(viem@2.44.4(typescript@5.9.3)(zod@4.3.5))(zod@4.3.5): + tempo.ts@0.14.0(@remix-run/headers@0.17.2)(@remix-run/route-pattern@0.15.3)(@remix-run/session@0.4.1)(typescript@5.9.3)(viem@2.44.4(typescript@5.9.3)(zod@4.3.5))(zod@4.3.5): dependencies: '@remix-run/fetch-router': 0.12.0(@remix-run/headers@0.17.2)(@remix-run/route-pattern@0.15.3)(@remix-run/session@0.4.1) ox: 0.11.3(typescript@5.9.3)(zod@4.3.5) diff --git a/src/snippets/wagmi.config.ts b/src/snippets/wagmi.config.ts index 74ccde7..2620b8b 100644 --- a/src/snippets/wagmi.config.ts +++ b/src/snippets/wagmi.config.ts @@ -11,7 +11,7 @@ import { KeyManager, webAuthn } from 'wagmi/tempo' export const config = createConfig({ connectors: [ webAuthn({ - keyManager: KeyManager.localStorage(), + keyManager: KeyManager.http('https://keys.tempo.xyz'), }), ], chains: [tempoModerato], @@ -33,7 +33,7 @@ import { KeyManager, webAuthn } from 'wagmi/tempo' export const config = createConfig({ connectors: [ webAuthn({ - keyManager: KeyManager.localStorage(), + keyManager: KeyManager.http('https://keys.tempo.xyz'), }), ], chains: [tempoModerato], diff --git a/src/wagmi.config.ts b/src/wagmi.config.ts index 49b6b62..045bef4 100644 --- a/src/wagmi.config.ts +++ b/src/wagmi.config.ts @@ -6,6 +6,13 @@ import { KeyManager, webAuthn } from 'wagmi/tempo' const feeToken = '0x20c0000000000000000000000000000000000001' +const rpId = (() => { + const hostname = globalThis.location?.hostname + if (!hostname) return undefined + const parts = hostname.split('.') + return parts.length > 2 ? parts.slice(-2).join('.') : hostname +})() + export function getConfig(options: getConfig.Options = {}) { const { multiInjectedProviderDiscovery } = options return createConfig({ @@ -22,7 +29,8 @@ export function getConfig(options: getConfig.Options = {}) { connectors: [ webAuthn({ grantAccessKey: true, - keyManager: KeyManager.localStorage(), + keyManager: KeyManager.http('https://keys.tempo.xyz'), + rpId, }), ], multiInjectedProviderDiscovery, diff --git a/vite.config.ts b/vite.config.ts index 2eafcb3..96bbb99 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -38,9 +38,7 @@ function syncTips(): Plugin { console.log('→ syncing TIPs from GitHub...') - const res = await fetch( - `https://api.github.com/repos/${repo}/contents/tips`, - ) + const res = await fetch(`https://api.github.com/repos/${repo}/contents/tips`) if (!res.ok) { console.error('✗ failed to fetch TIPs directory:', res.statusText) return