ethers.js icon indicating copy to clipboard operation
ethers.js copied to clipboard

Export createGetUrl function with browser fetch version

Open tornadocontrib opened this issue 11 months ago • 2 comments

Ethers Version

6.x

Search Terms

No response

Describe the Problem

Currently only createGetUrl from node http request version is exported from ethers.js and it is impossible to use fetch version of it from node.js

Would be great if you could export this as well, to avoid reimplementing the whole code like this https://github.com/tornadocontrib/tornado-scripts/blob/main/src/providers.ts#L129

Code Snippet


Contract ABI


Errors


Environment

No response

Environment (Other)

No response

tornadocontrib avatar Jan 24 '25 14:01 tornadocontrib

You want the browser implementation of createGetUrl exported in node environments?

I have been planning to use the “modern” node exports for another feature, I could add this as well, something akin to import { createGetUrl } from "ethers/utils-browser";. Or possibly just "ethers/browser"?

ricmoo avatar Jan 24 '25 22:01 ricmoo

@ricmoo Yes import { createGetUrl } from "ethers/utils-browser"; would sound ideal

tornadocontrib avatar Jan 25 '25 05:01 tornadocontrib