decentraland / sdk

PM repository for SDK
Apache License 2.0
4 stars 4 forks source link

Support Ethers.js library #910

Open nearnshaw opened 1 year ago

nearnshaw commented 1 year ago

When trying to import the ethers.js library, we get some import errors.

We get this error:

node_modules/@dcl/js-runtime/index.d.ts:86:13 - error TS2403: Subsequent variable declarations must have the same type. Variable ‘console’ must be of type ‘Console’, but here has type ‘{ log(message?: any, ...optionalParams: any[]): void; error(message?: any, ...optionalParams: any[]): void; }’.

From an old conversation with Gonzalo:

to use the ethers library we need atob, btoa, nextTick, setTimeout setImmediate is missing also, we need to added it to the sandbox

Here's an example scene that attempts to use it:

ethers-tests.zip

lwtsn commented 1 year ago

Is there an update to this, it seems there is no blockchain connection in SDK7 currently