scallop-io / sui-scallop-sdk

This is the typescript sdk for the scallop lending platform on SUI network
Apache License 2.0
23 stars 6 forks source link

Errors after importing @scallop-io/sui-scallop-sdk #145

Open hokage229 opened 1 month ago

hokage229 commented 1 month ago

Hello,

I'm encountering errors after importing the @scallop-io/sui-scallop-sdk package into my project.

Import statement:

import { SupportPoolCoins } from '@scallop-io/sui-scallop-sdk';

Error Output:

>>> tsc

Found 10 errors in 3 files.

Errors  Files
     1  node_modules/@scallop-io/sui-kit/node_modules/@mysten/sui.js/src/client/rpc-websocket-client.ts:157
     2  node_modules/@scallop-io/sui-kit/node_modules/@mysten/sui.js/src/transactions/TransactionBlock.ts:831
     7  node_modules/@scallop-io/sui-kit/node_modules/@mysten/sui.js/src/transactions/TransactionBlockData.ts:78

Neither skipLibCheck nor exclude options in tsconfig.json resolve the issue.

Currently, I have temporarily fixed it using:

const scallop = require('@scallop-io/sui-scallop-sdk');

However, I still need TypeScript typings.

Any help would be appreciated!

Thank you.

nicetomeetyou1 commented 1 month ago

Hello @hokage229, Have you already installed @mysten/sui.js in your project? and Which version are you currently using?

hokage229 commented 1 month ago

No, I use instead @mysten/sui in my project. And @mysten/sui.js@0.52.0 installed in node modules as dependency of @scallop-io/sui-scallop-sdk

nicetomeetyou1 commented 1 month ago

I tried updating my tsconfig with target: "ESNext", and it works fine when running the build.