From ffc30b41671fd29c7e230635ab6c254c198f6c60 Mon Sep 17 00:00:00 2001 From: Valentin Dosimont Date: Mon, 6 Jan 2025 07:11:05 +0100 Subject: [PATCH] fix: build-examples --- examples/example-vite-react-sdk/src/App.tsx | 48 ++++++++++--------- .../src/historical-events.tsx | 24 +++++----- .../src/starknet-provider.tsx | 4 +- .../src/typescript/contracts.gen.ts | 9 +--- .../src/typescript/models.gen.ts | 4 +- .../example-vite-react-sdk/src/useModel.tsx | 6 +-- .../tsconfig.app.tsbuildinfo | 2 +- packages/predeployed-connector/src/index.ts | 6 ++- packages/sdk/src/types.ts | 22 ++++----- 9 files changed, 63 insertions(+), 62 deletions(-) diff --git a/examples/example-vite-react-sdk/src/App.tsx b/examples/example-vite-react-sdk/src/App.tsx index 4ea5c014..89ddc8a4 100644 --- a/examples/example-vite-react-sdk/src/App.tsx +++ b/examples/example-vite-react-sdk/src/App.tsx @@ -1,12 +1,12 @@ import { useEffect, useMemo } from "react"; -import { QueryBuilder, SDK, createDojoStore } from "@dojoengine/sdk"; -import { getEntityIdFromKeys } from "@dojoengine/utils"; import { - AccountInterface, - addAddressPadding, - CairoOption, - CairoOptionVariant, -} from "starknet"; + ParsedEntity, + QueryBuilder, + SDK, + createDojoStore, +} from "@dojoengine/sdk"; +import { getEntityIdFromKeys } from "@dojoengine/utils"; +import { AccountInterface, addAddressPadding } from "starknet"; import { Direction, @@ -16,7 +16,7 @@ import { import { useDojo } from "./useDojo.tsx"; import useModel from "./useModel.tsx"; import { useSystemCalls } from "./useSystemCalls.ts"; -import { useAccount, useConnect } from "@starknet-react/core"; +import { useAccount } from "@starknet-react/core"; import { WalletAccount } from "./wallet-account.tsx"; import { HistoricalEvents } from "./historical-events.tsx"; @@ -70,17 +70,14 @@ function App({ sdk }: { sdk: SDK }) { ) ) .build(), - callback: (response) => { - if (response.error) { - console.error( - "Error setting up entity sync:", - response.error - ); + callback: ({ error, data }) => { + if (error) { + console.error("Error setting up entity sync:", error); } else if ( - response.data && - response.data[0].entityId !== "0x0" + data && + (data[0] as ParsedEntity).entityId !== "0x0" ) { - state.updateEntity(response.data[0]); + state.updateEntity(data[0] as ParsedEntity); } }, }); @@ -122,7 +119,9 @@ function App({ sdk }: { sdk: SDK }) { return; } if (resp.data) { - state.setEntities(resp.data); + state.setEntities( + resp.data as ParsedEntity[] + ); } }, }); @@ -248,8 +247,8 @@ function App({ sdk }: { sdk: SDK }) { const moves = entity.models.dojo_starter.Moves; const lastDirection = - moves?.last_direction.isSome() - ? moves.last_direction.unwrap() + moves?.last_direction?.isSome() + ? moves.last_direction?.unwrap() : "N/A"; return ( @@ -264,10 +263,12 @@ function App({ sdk }: { sdk: SDK }) { {position?.player ?? "N/A"} - {position?.vec?.x ?? "N/A"} + {position?.vec?.x.toString() ?? + "N/A"} - {position?.vec?.y ?? "N/A"} + {position?.vec?.y.toString() ?? + "N/A"} {moves?.can_move?.toString() ?? @@ -277,7 +278,8 @@ function App({ sdk }: { sdk: SDK }) { {lastDirection} - {moves?.remaining ?? "N/A"} + {moves?.remaining?.toString() ?? + "N/A"} ); diff --git a/examples/example-vite-react-sdk/src/historical-events.tsx b/examples/example-vite-react-sdk/src/historical-events.tsx index ecdccf60..f49a3c73 100644 --- a/examples/example-vite-react-sdk/src/historical-events.tsx +++ b/examples/example-vite-react-sdk/src/historical-events.tsx @@ -1,13 +1,14 @@ -import { SDK } from "@dojoengine/sdk"; +import { ParsedEntity, SDK } from "@dojoengine/sdk"; import { useAccount } from "@starknet-react/core"; import { SchemaType } from "./typescript/models.gen"; import { AccountInterface, addAddressPadding } from "starknet"; import { useEffect, useState } from "react"; +import { Subscription } from "@dojoengine/torii-client"; export function HistoricalEvents({ sdk }: { sdk: SDK }) { const { account } = useAccount(); - const [events, setEvents] = useState([]); - const [unsubscribe, setSubscription] = useState(null); + const [events, setEvents] = useState[][]>([]); + const [subscription, setSubscription] = useState(null); useEffect(() => { async function getHistoricalEvents(account: AccountInterface) { @@ -24,6 +25,7 @@ export function HistoricalEvents({ sdk }: { sdk: SDK }) { callback: () => {}, historical: true, }); + // @ts-expect-error FIX: type here setEvents(e); } catch (error) { setEvents([]); @@ -34,7 +36,7 @@ export function HistoricalEvents({ sdk }: { sdk: SDK }) { if (account) { getHistoricalEvents(account); } - }, [account, setEvents]); + }, [account, setEvents, sdk]); useEffect(() => { async function subscribeHistoricalEvent(account: AccountInterface) { @@ -48,16 +50,16 @@ export function HistoricalEvents({ sdk }: { sdk: SDK }) { // } // }, query: { entityIds: [addAddressPadding(account.address)] }, - callback: (resp, error) => { - console.log(resp, error); + callback: ({ data, error }) => { + console.log(data, error); }, historical: true, }); setSubscription(s); } catch (error) { setEvents([]); - if (unsubscribe) { - unsubscribe(); + if (subscription) { + subscription.free(); } console.error(error); } @@ -78,20 +80,20 @@ export function HistoricalEvents({ sdk }: { sdk: SDK }) { return (

Player Events :

- {events.map((e, key) => { + {events.map((e: ParsedEntity[], key) => { return ; })}
); } -function Event({ event }) { +function Event({ event }: { event: ParsedEntity }) { if (!event) return null; const player = event.models?.dojo_starter?.Moved?.player; const direction = event.models?.dojo_starter?.Moved?.direction; return (
-
{event.entityId}
+
{event.entityId.toString()}
Player: {player}
Direction: {direction}
diff --git a/examples/example-vite-react-sdk/src/starknet-provider.tsx b/examples/example-vite-react-sdk/src/starknet-provider.tsx index 3aaf8ef2..50da5139 100644 --- a/examples/example-vite-react-sdk/src/starknet-provider.tsx +++ b/examples/example-vite-react-sdk/src/starknet-provider.tsx @@ -1,5 +1,5 @@ import type { PropsWithChildren } from "react"; -import { Chain, mainnet } from "@starknet-react/chains"; +import { mainnet } from "@starknet-react/chains"; import { jsonRpcProvider, StarknetConfig, voyager } from "@starknet-react/core"; import { dojoConfig } from "../dojoConfig"; import { @@ -16,7 +16,7 @@ predeployedAccounts({ export default function StarknetProvider({ children }: PropsWithChildren) { const provider = jsonRpcProvider({ - rpc: (chain: Chain) => ({ nodeUrl: dojoConfig.rpcUrl as string }), + rpc: () => ({ nodeUrl: dojoConfig.rpcUrl as string }), }); return ( diff --git a/examples/example-vite-react-sdk/src/typescript/contracts.gen.ts b/examples/example-vite-react-sdk/src/typescript/contracts.gen.ts index 4e050947..aeffdc60 100644 --- a/examples/example-vite-react-sdk/src/typescript/contracts.gen.ts +++ b/examples/example-vite-react-sdk/src/typescript/contracts.gen.ts @@ -1,12 +1,5 @@ import { DojoProvider } from "@dojoengine/core"; -import { - Account, - AccountInterface, - BigNumberish, - CairoOption, - CairoCustomEnum, - ByteArray, -} from "starknet"; +import { Account, AccountInterface } from "starknet"; import * as models from "./models.gen"; export function setupWorld(provider: DojoProvider) { diff --git a/examples/example-vite-react-sdk/src/typescript/models.gen.ts b/examples/example-vite-react-sdk/src/typescript/models.gen.ts index 3208eca1..004351f6 100644 --- a/examples/example-vite-react-sdk/src/typescript/models.gen.ts +++ b/examples/example-vite-react-sdk/src/typescript/models.gen.ts @@ -106,11 +106,11 @@ export const schema: SchemaType = { Position: { fieldOrder: ["player", "vec"], player: "", - vec: { fieldOrder: ["x", "y"], x: 0, y: 0 }, + vec: { x: 0, y: 0 }, }, PositionValue: { fieldOrder: ["vec"], - vec: { fieldOrder: ["x", "y"], x: 0, y: 0 }, + vec: { x: 0, y: 0 }, }, Vec2: { fieldOrder: ["x", "y"], diff --git a/examples/example-vite-react-sdk/src/useModel.tsx b/examples/example-vite-react-sdk/src/useModel.tsx index 15c8dc5f..b3efe5da 100644 --- a/examples/example-vite-react-sdk/src/useModel.tsx +++ b/examples/example-vite-react-sdk/src/useModel.tsx @@ -18,9 +18,9 @@ function useModel< // Select only the specific model data for the given entityId const modelData = useDojoStore( (state) => - state.entities[entityId]?.models?.[namespace]?.[modelName] as - | SchemaType[N][M] - | undefined + state.entities[entityId.toString()]?.models?.[namespace]?.[ + modelName + ] as SchemaType[N][M] | undefined ); return modelData; diff --git a/examples/example-vite-react-sdk/tsconfig.app.tsbuildinfo b/examples/example-vite-react-sdk/tsconfig.app.tsbuildinfo index 75be23fb..a6d16e06 100644 --- a/examples/example-vite-react-sdk/tsconfig.app.tsbuildinfo +++ b/examples/example-vite-react-sdk/tsconfig.app.tsbuildinfo @@ -1 +1 @@ -{"root":["./src/app.tsx","./src/dojocontext.tsx","./src/bindings.ts","./src/contracts.gen.ts","./src/main.tsx","./src/usedojo.tsx","./src/usemodel.tsx","./src/usesystemcalls.ts","./src/vite-env.d.ts"],"version":"5.7.2"} \ No newline at end of file +{"root":["./src/app.tsx","./src/dojocontext.tsx","./src/historical-events.tsx","./src/main.tsx","./src/starknet-provider.tsx","./src/usedojo.tsx","./src/usemodel.tsx","./src/usesystemcalls.ts","./src/vite-env.d.ts","./src/wallet-account.tsx","./src/typescript/contracts.gen.ts","./src/typescript/models.gen.ts"],"version":"5.7.2"} \ No newline at end of file diff --git a/packages/predeployed-connector/src/index.ts b/packages/predeployed-connector/src/index.ts index de8e613d..77761b4b 100644 --- a/packages/predeployed-connector/src/index.ts +++ b/packages/predeployed-connector/src/index.ts @@ -30,6 +30,8 @@ export type PredeployedAccountsConnectorOptions = { id: string; name: string; rpc: string; +}; +export type WithAccount = T & { account: PredeployedWalletAccount; }; @@ -45,7 +47,9 @@ const icon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAABkyAAAZMgGvFqWRAAAAB3RJTUUH6AkEFwsj7EvbJQAAAAZiS0dEAP8A/wD/oL2nkwAAK45JREFUeNrt3XmUXVWBqPE42+3Qj5hQ995zb1WlUqkkVZlIAhnJPIKAIogICEGGtlugFVBaxAbsVgw+FWlooEFtRFAmZRbClDAlICAg4MTQDY4MAiIy6X5nX8JrQQippKruOef+vrW+Zf9hr2XOsPd3T52z96BBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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uTi/k593MJPmaPl8uly9Kx87t/OJHIUiSpFqqVD7jqQBJvqJ3p7/2D4tjpRkDRY6BrjQGDi6/sOXwc258kk1oHPuuiWNhHBPNDGg6Wlpa3pZe/PMrlcrh6Y1wXnzZxcBAsoDeG8e4uFZ/HPPi2GcGAF5GfaXBUqmnVK1uVS6X90n9bOp/pTfQuakr4h7X6X/+qJwk95BkQ41j0Qtj0or6GJWOVekPmiPj2BXHsDiWxTHNyA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATcP/A/VYuD9l6UjwAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDI0LTA5LTA0VDIzOjExOjM1KzAwOjAw9BAQcQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyNC0wOS0wNFQyMzoxMTozNSswMDowMIVNqM0AAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb7jwaAAAAV3pUWHRSYXcgcHJvZmlsZSB0eXBlIGlwdGMAAHic4/IMCHFWKCjKT8vMSeVSAAMjCy5jCxMjE0uTFAMTIESANMNkAyOzVCDL2NTIxMzEHMQHy4BIoEouAOoXEXTyQjWVAAAAAElFTkSuQmCC"; export class PredeployedAccountsConnector extends InjectedConnector { - constructor(private options: PredeployedAccountsConnectorOptions) { + constructor( + private options: WithAccount + ) { super({ options: { id: options.id, name: options.name } }); } diff --git a/packages/sdk/src/types.ts b/packages/sdk/src/types.ts index 62f10d79..93531b4e 100644 --- a/packages/sdk/src/types.ts +++ b/packages/sdk/src/types.ts @@ -143,17 +143,17 @@ export interface QueryWhereOptions extends QueryOptions { * - An object containing at least one SubscriptionWhereOptions condition to filter the subscription results. * - Alternatively, an array of strings representing specific values to subscribe to. */ -export type SubscriptionQueryType = { - entityIds?: string[]; -} & { - [K in keyof T]?: { - [L in keyof T[K]]?: - | AtLeastOne<{ - $: SubscriptionWhereOptions; - }> - | string[]; - }; -}; +export type SubscriptionQueryType = + | BaseQueryType + | { + [K in keyof T]?: { + [L in keyof T[K]]?: + | AtLeastOne<{ + $: SubscriptionWhereOptions; + }> + | string[]; + }; + }; export type BaseQueryType = { entityIds?: string[];