warp-contracts / warp

An implementation of the Arweave SmartWeave smart contracts protocol.
MIT License
157 stars 44 forks source link

Arweave-js dependency needs to be updated #159

Closed luckyr13 closed 2 years ago

luckyr13 commented 2 years ago

Hello guys! Today I updated my js libraries in my project and I noticed that redstone-smartweave v0.5.9 is using arweave-js 1.10.23 but the latest Arweave-js version is 1.11.4.

https://github.com/redstone-finance/redstone-smartcontracts/blob/main/package.json#L69

This is causing the next error in this line:

const smartweave = SmartWeaveWebFactory.memCachedBased(arweave)
    .useRedStoneGateway( {confirmed: true} )
    .build();

The error:

error TS2345: Argument of type 'import("node_modules/arweave/node/common").default' is not assignable to parameter of type 'import("node_modules/redstone-smartweave/node_modules/arweave/node/common").default'.
  Types of property 'api' are incompatible.
    Type 'import("node_modules/arweave/node/lib/api").default' is not assignable to type 'import("node_modules/redstone-smartweave/node_modules/arweave/node/lib/api").default'.
      Types have separate declarations of a private property 'mergeDefaults'.

My guess is that a solution would be to update the arweave-js dependency for the next release. Thanks in advance, I love your tools!!

asiaziola commented 2 years ago

Hey @luckyr13 :) I've tried updating arweave-js in the sdk but our tests failed due to the arlocal error. I reported it on their gh and will wait for their reply. As for now, you could simply add following property to the package.json:

"resolutions": {
    "redstone-smartweave/arweave": "1.10.23"
  }

It works under yarn, I believe newest npm's equivalent is overrides

"overrides": {
    "redstone-smartweave/arweave": "1.10.23"
  }
asiaziola commented 2 years ago

@luckyr13 fixed in 0.5.11