Skip to content

Commit

Permalink
fix(explorer): better observer decorator types (#3206)
Browse files Browse the repository at this point in the history
  • Loading branch information
holic authored Sep 19, 2024
1 parent 7ac2a0d commit 5a6c03c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/perfect-parrots-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@latticexyz/explorer": patch
---

Fixed `observer` decorator types so it can be used in more places.
9 changes: 5 additions & 4 deletions packages/explorer/src/observer/decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ export type ObserverOptions = {

let writeCounter = 0;

export function observer<transport extends Transport, chain extends Chain, account extends Account>({
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<transport, chain, account>,
) => Pick<WalletActions<chain, account>, "writeContract"> {
const emit = createBridge({ url: `${explorerUrl}/internal/observer-relay` });
Expand Down

0 comments on commit 5a6c03c

Please sign in to comment.