From 14f3e41a9db1ac2fc1d933ad63071057adadcb1d Mon Sep 17 00:00:00 2001 From: mega123-art Date: Sat, 20 Jun 2026 15:51:16 +0530 Subject: [PATCH] fix(mobile): send owned skills payload for market --- surfaces/localhost/src/index.ts | 8 ++++++-- surfaces/webview/src/state/store.tsx | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/surfaces/localhost/src/index.ts b/surfaces/localhost/src/index.ts index 07fc958..aef71d1 100644 --- a/surfaces/localhost/src/index.ts +++ b/surfaces/localhost/src/index.ts @@ -467,8 +467,12 @@ function attachChat(id: string, c: Client, rt: AgentRuntime) { } case "ownedSkills": { try { - const r = await mkt.ownedSkills(); - c.send({ type: "ownedSkills", ...r }); + const names = mkt.ownedNftSkills ? await mkt.ownedNftSkills() : await mkt.ownedSkills(); + const [mints, disposedMints] = await Promise.all([ + mkt.ownedSkillMints ? mkt.ownedSkillMints().catch(() => ({})) : Promise.resolve({}), + mkt.disposedSkillMints ? mkt.disposedSkillMints().catch(() => ({})) : Promise.resolve({}), + ]); + c.send({ type: "ownedSkills", names, mints, disposedMints }); } catch (e) { c.send({ type: "toast", text: "Failed to load owned skills: " + (e as Error).message }); } diff --git a/surfaces/webview/src/state/store.tsx b/surfaces/webview/src/state/store.tsx index 838e91b..7c5b3b0 100644 --- a/surfaces/webview/src/state/store.tsx +++ b/surfaces/webview/src/state/store.tsx @@ -359,7 +359,7 @@ function reducer(state: State, ev: Action): State { buyCelebrate: ev.ok ? true : state.buyCelebrate, }; case "ownedSkills": - return { ...state, marketOwned: ev.names }; + return { ...state, marketOwned: Array.isArray(ev.names) ? ev.names : [] }; case "balance": return { ...state, marketBalance: ev.lamports }; case "rpcStatus":