Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make batchCall easier to work with in the client #1728

Open
holic opened this issue Oct 10, 2023 · 3 comments
Open

make batchCall easier to work with in the client #1728

holic opened this issue Oct 10, 2023 · 3 comments

Comments

@holic
Copy link
Member

holic commented Oct 10, 2023

there's several places in #1611 that I avoided wiring up batchCall because it was trickier to use

it would be nice if we had a typed helper for batchCall that would take in a list of abi-typed calls (like writeContract) and execute them through batchCall

@yonadaaa
Copy link
Contributor

For me the ideal API is:

batchCall([
  {
    resource: { type: "system", namespace: "", name: "RegisterSystem" },
    functionName: "register",
    args: [match]
  },
  {
    resource: { type: "system", namespace: "", name: "NameSystem" },
    functionName: "setName",
    args: [name]
  },
]);

@holic
Copy link
Member Author

holic commented Jan 18, 2024

done here: #1745

edit: nevermind, these helpers are just for single system calls, not batch calls

@holic holic closed this as completed Jan 18, 2024
@holic holic reopened this Jan 18, 2024
@yonadaaa
Copy link
Contributor

yonadaaa commented Jan 18, 2024

@holic They are for batch calls! https://github.com/latticexyz/skystrife-public/blob/main/packages/client/src/app/amalgema-ui/SummonIsland/Footer.tsx#L79-L97

The encodeSystemCalls name is somewhat misleading, should maybe be encodeBatchCall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants