AstarNetwork / astar.js

Astar network Typescript SDK
Apache License 2.0
30 stars 9 forks source link

Compatibility with ink! 5.0.0 #78

Closed msh-systems closed 3 months ago

msh-systems commented 3 months ago

The problem Some newer contracts are written using ink! 5.X.X, and bundled version of @polkadot (currently "10.9.1") panics with: Unable to handle version 5.

Additional context It would be possible to use the newer version of @polkadot , however

import {options} from "@astar-network/astar-api";

doesn't support updated WsProvider from @polkadot/api "^10.12.4".

    const provider = new WsProvider('ws://localhost:9944');

    // Below will not work if `WsProvider` comes from @polkadot/api "^10.12.4"
    const api = new ApiPromise(options({ provider }));

I have a pretty big contract written with !ink 5.0.0, and downgrading to 4.X.X would be quite painful. Thanks.

msh-systems commented 3 months ago

Closing because found another solution, thanks.