diff --git a/.changeset/perfect-parrots-wonder.md b/.changeset/perfect-parrots-wonder.md new file mode 100644 index 0000000000..5c4d6cd035 --- /dev/null +++ b/.changeset/perfect-parrots-wonder.md @@ -0,0 +1,5 @@ +--- +"@latticexyz/explorer": patch +--- + +Fixed `observer` decorator types so it can be used in more places. diff --git a/packages/explorer/src/observer/decorator.ts b/packages/explorer/src/observer/decorator.ts index f23c15c203..c54394589e 100644 --- a/packages/explorer/src/observer/decorator.ts +++ b/packages/explorer/src/observer/decorator.ts @@ -13,10 +13,11 @@ export type ObserverOptions = { let writeCounter = 0; -export function observer({ - explorerUrl = "http://localhost:13690", - waitForStateChange, -}: ObserverOptions = {}): ( +export function observer({ explorerUrl = "http://localhost:13690", waitForStateChange }: ObserverOptions = {}): < + transport extends Transport, + chain extends Chain | undefined = Chain | undefined, + account extends Account | undefined = Account | undefined, +>( client: Client, ) => Pick, "writeContract"> { const emit = createBridge({ url: `${explorerUrl}/internal/observer-relay` });