decentraland / decentraland/sdk
Support Ethers.js library
- 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
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