inkathon
inkathon copied to clipboard
Replace `@727-ventures/typechain-*` with `@prosopo/typechain-*`
- [x] Type generation in
contracts/build-all.sh - [x] Frontend integration: Queries
- [ ] Frontend integration: Transactions
Issues
Unfortunately, I have discovered a set of errors with typechain-polkadot that still make it unusable at it's current stage:
- There are some unescaped control characters as part of the generated/stringified JSON (see
contracts/typed-contracts/contract-info/greeter.ts. This can be solved by removing them manually (see below) but that's a manual step that needs to be done after every new build/generation and therefore should be fixed within the typechain CLI:
/* eslint-disable no-control-regex */
export const ContractAbi = `{"source": ……… }`.replace(/[\u0000-\u0019]+/g, '')
- Transactions are somehow still not working:
typedContract.tx.setMessage("…")throws an error (but still sometimes runs through and updates state).
https://github.com/prosopo/typechain-polkadot/commit/675cd56647022b9c86c71efcea8cfd4fa9c533a0
⚠️ No Changeset found
Latest commit: cc581726820335483cc4644abb28b7b0205be378
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Updated (UTC) |
|---|---|---|---|
| inkathon-xyz | ✅ Ready (Inspect) | Visit Preview | May 2, 2024 10:45am |
gm @wottpal
Created a new branch for a forked prosopo repo here.
What I did so far:
- [x] Fixed the problem with unescaped control characters in this commit, and also provided an example to test typesafe greeter contract generation in
/examples/greeter. - [x] For transactions, I've debugged and found a potential issue. Basically inkathon and prosopo aren't using the same version of
@polkadot-api. This mismatch creates a type error inexamples/greeter/out/tx-sign-and-send/greeter.ts. See also screenshot below. Bumping up the version in prosopo package should solve this issue, but I'll check if it works fine or not.
CC/FYI @forgetso we'll probably do another small PR soonish :)
@wottpal Thanks for letting me know. The version changes with PJS are pretty tricky. We run into this issue constantly and we'll need to bump our own stuff to v11 as well.
We run into this issue constantly and we'll need to bump our own stuff to v11 as well.
Hi @forgetso , any plan to update PJS on typechain-polkadot to v11 ? It might help with resolving the issue above.