Skip to content

Commit 484364e

Browse files
chore: pr review
1 parent 2f59df4 commit 484364e

46 files changed

Lines changed: 51 additions & 87 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/iframe/src/components/interface/permissions/useAppsWithPermissions.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import { entries } from "@happy.tech/common"
21
import { use$ } from "@legendapp/state/react"
3-
import { useAtomValue } from "jotai"
4-
import { useAccount } from "wagmi"
52
import { type AppPermissions, permissionsMapLegend } from "#src/state/permissions"
63
import { type AppURL, isWallet } from "#src/utils/appURL"
74

apps/iframe/src/state/permissions.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { createUUID } from "@happy.tech/common"
2-
import type { Address, UUID } from "@happy.tech/common"
1+
import type { Address } from "@happy.tech/common"
32
import { logger } from "@happy.tech/wallet-common"
43
import { observable } from "@legendapp/state"
54
import { ObservablePersistLocalStorage } from "@legendapp/state/persist-plugins/local-storage"
@@ -51,7 +50,7 @@ export type WalletPermission = {
5150
// The app to which the permission is granted.
5251
invoker: AppURL
5352
// This is the EIP-1193 request that this permission is mapped to.
54-
parentCapability: "eth_accounts" | string // TODO only string or make specific
53+
parentCapability: string
5554
caveats: WalletPermissionCaveat[]
5655
date: number
5756
// Not in the EIP, but Viem wants this.
@@ -88,14 +87,9 @@ export type SessionKeyRequest = {
8887
*/
8988
export type PermissionsRequest = string | PermissionRequestObject
9089

91-
type PermissionCheckParams = {
92-
permissionsRequest: PermissionsRequest
93-
app: AppURL
94-
}
95-
9690
export const permissionsMapLegend = observable(
9791
syncedCrud({
98-
list: async ({ lastSync }) => {
92+
list: async () => {
9993
const user = getUser()
10094
if (!user) return []
10195
const response = await fetch(`http://localhost:3000/api/v1/settings/list?user=${user.address}`)
@@ -125,7 +119,7 @@ export const permissionsMapLegend = observable(
125119
},
126120
subscribe: ({ refresh }) => {
127121
// Set up an interval to refresh messages every 5 seconds
128-
const intervalId = setInterval(() => {
122+
setInterval(() => {
129123
console.log("Refreshing config (5-second interval)")
130124
refresh()
131125
}, 5000)
@@ -352,7 +346,6 @@ export function grantPermissions(app: AppURL, permissionRequest: PermissionsRequ
352346
parentCapability: name,
353347
date: Date.now(),
354348
id,
355-
deleted: false,
356349
updatedAt: Date.now(),
357350
createdAt: Date.now(),
358351
type: "WalletPermissions",

apps/settings-service/.env.example

Whitespace-only changes.

apps/sync-service/.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
NODE_ENV=development
2+
APP_PORT=3000
3+
SETTINGS_DB_URL=settings.sqlite
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ include ../../makefiles/formatting.mk
55
include ../../makefiles/bundling.mk
66
include ../../makefiles/help.mk
77

8-
start: ## Starts the settings service
8+
dev: ## Starts the settings service
99
bun run --hot src/index.ts
10-
.PHONY: start
10+
.PHONY: dev
1111

1212
migrate: ## Runs pending migrations
1313
bun run src/migrate.ts
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@happy.tech/settings-service",
2+
"name": "@happy.tech/sync-service",
33
"private": true,
44
"version": "0.1.0",
55
"type": "module",
@@ -11,18 +11,14 @@
1111
},
1212
"dependencies": {
1313
"@happy.tech/common": "workspace:0.1.0",
14-
"@hono/node-server": "^1.13.8",
1514
"@scalar/hono-api-reference": "^0.5.175",
1615
"hono": "^4.7.2",
1716
"hono-openapi": "^0.4.4",
1817
"neverthrow": "^8.1.0",
19-
"uuid": "^11.1.0",
2018
"zod": "^3.23.8",
2119
"zod-openapi": "^4.2.3"
2220
},
2321
"devDependencies": {
24-
"@happy.tech/happybuild": "workspace:0.1.1",
25-
"typescript": "^5.6.2",
26-
"hono-openapi": "^0.4.4"
22+
"@happy.tech/happybuild": "workspace:0.1.1"
2723
}
2824
}

apps/settings-service/src/db/migrations/Migration20250515123000.ts renamed to apps/sync-service/src/db/migrations/Migration20250515123000.ts

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)