diff --git a/packages/engine/paima-sm/src/types.ts b/packages/engine/paima-sm/src/types.ts index d64ae56c..adffd7f6 100644 --- a/packages/engine/paima-sm/src/types.ts +++ b/packages/engine/paima-sm/src/types.ts @@ -658,7 +658,7 @@ export type GameStateTransitionFunction = ( ) => Promise<{ stateTransitions: SQLUpdate[]; events: { - address: string; + address: `0x${string}`; data: { name: string; fields: ResolvedPath & Event['type']; diff --git a/packages/paima-sdk/paima-events/src/app-events.ts b/packages/paima-sdk/paima-events/src/app-events.ts index 42c321b1..2b5c5afe 100644 --- a/packages/paima-sdk/paima-events/src/app-events.ts +++ b/packages/paima-sdk/paima-events/src/app-events.ts @@ -47,10 +47,13 @@ export const generateAppEvents = < // create payload for the stf from an object. export function createEventForStf>( - address: string, + address: `0x${string}`, event: T, fields: KeypairToObj -): { address: string; data: { name: string; fields: KeypairToObj; topic: string } } { +): { + address: `0x${string}`; + data: { name: string; fields: KeypairToObj; topic: string }; +} { return { address, data: { name: event.name, fields, topic: toTopicHash(event) } }; } @@ -76,7 +79,7 @@ type EmitFunction< T extends ReadonlyArray[]>>, Name extends string, > = { - emit: (name: Name, address: string, fields: UnionForOverloadedEvents) => void; + emit: (name: Name, address: `0x${string}`, fields: UnionForOverloadedEvents) => void; }; type EventQueue[]>>> = EmitFunction< @@ -84,7 +87,7 @@ type EventQueue[]>>> = T[number]['name'] > & { get: () => { - address: string; + address: `0x${string}`; data: { name: string; fields: KeypairToObj; topic: string }; }[]; }; @@ -185,7 +188,7 @@ export function eventQueueFactory< obj.buffer = buffer; obj.get = (): { - address: string; + address: `0x${string}`; data: { name: string; fields: KeypairToObj; topic: string }; } => { return buffer;