tangle-network / dapp

Monorepo for the Tangle ecosystem.
https://app.tangle.tools
Apache License 2.0
29 stars 15 forks source link

[BUG] Tangle dapp: `Extrinsic staking.bond expects 2 arguments, got 3` #2036

Closed yurixander closed 6 months ago

yurixander commented 9 months ago

A strange type error is ocurring when calling Polkadot API's api.staking.bond function. Its complaining about a missing argument, but that shouldn't be the case. A 'temporary' workaround was done by @vutuanlinh2k2 (who was originally experiencing this issue) by importing import '@webb-tools/tangle-substrate-types' in the apps/tangle-dapp/types/index.ts file.

However, this issue might still be relevant as I just experienced the same issue, and the import did not resolve the error in my case (I had to revert some of my changes to get it compiling again). It might be worth to look into the exact cause behind this in the future, in case that it comes up again.

See my recent PR where I spoke more about this issue.

yurixander commented 8 months ago

On this topic, I should note that the reason why @webb-tools/tangle-substrate-types being imported has an effect, is because it seems to be overriding function signatures from the Polkadot JS API.

This makes sense, as Tangle is built on top of Substrate, so overriding the function signatures might be to account for chain custom functionality that has been added or modified.

Here's a screenshot of it declaring global modules:

Screenshot @Visual Studio Code

github-actions[bot] commented 6 months ago

This issue is stale because it has been open for 60 days with no activity.

AtelyPham commented 6 months ago

Is this issue still present on the Tangle dApp, @yurixander? If so, please inform me if you have the bandwidth to address it. Otherwise, feel free to reassign it to me. If it is no longer considered a bug, you may proceed to close it. I think I've resolved the tange-substrate-type issue on the dApp.