Polkadot-API updates thread

Hi everyone! Victor here :waving_hand:

Here’s a quick update on the latest news around PAPI. Most of our current work is focused on stabilizing v2, which I covered in detail in the Introducing Polkadot-API v2 post. This update focuses on other PAPI-related work.

polkadot-api@1.23

We’ve released what will be the last v1 version, adding a few last features before fully focusing on v2.

tx-helper

We introduced a low-level utility in @polkadot-api/tx-utils that allows you to analyze transactions, such as mortality parameters, genesis hash, tip, asset, etc. There is also a helper to extract these values from a PolkadotJS JSON payload.

getBareTx

Based on popular demand, the Polkadot-API Transaction type now includes a .getBareTx() method to obtain an unsigned extrinsic ready to be submitted on-chain.

No more need to build unsigned extrinsics manually.

Whitelist rework

Now the whitelist can also be applied differently per-chain. Check out the docs to see how that’s done. It’s fully typed as well!

Additionally, a whitelist setting can now be added to the PAPI config, so it is automatically applied to every build.

PAPI Rescue

We’ve also been helping recover funds from compromised accounts. We now have an advanced solution that can prevent attackers from submitting transactions, recovering control of the compromised account and moving the funds to a safe one.

We’ll be sharing more details soon, with an official announcement coming next week. In the meantime, you can check out the original post where this all started: If you got hacked

If you know someone in a similar situation, please reach out ASAP, we may be able to help.

Upstream contributions

Since the last update, we’ve also contributed upstream to polkadot-sdk:

polkadot-api@2.0.0

We’re very close to the final 2.0.0 stable release. As mentioned earlier, check the Polkadot-API v2 post for a full overview of the changes.

Please give us your feedback, as it helps ensure the new API fits a wide range of use cases.

3 Likes