decentraland / decentraland/sdk

Support Ethers.js library

Open
#910 1 comment 1 reaction 0 assignees View on GitHub
bug devexp need validation
Dominant language
No language data
Stars
4
Forks
5
PR merge metrics
No merged PRs in 30d

Description

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](https://github.com/decentraland/sdk/files/12316218/ethers-tests.zip)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the import failure with the linked ethers-tests.zip scene and inspect the SDK sandbox/runtime setup mentioned in the issue. Check how the listed globals—atob, btoa, nextTick, setTimeout, and setImmediate—are provided and how the console type conflict arises. Done means the example imports ethers.js without the reported TypeScript error and the required globals are available.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.