Comments (7)
@0xpolarzero No worries at all, thank you for diving in and participating/contributing. :)
I'm open to improving the ergonomics if you have ideas in the future too.
Please share what you end up building with WhatsABI, would love to see it and showcase it. :)
from whatsabi.
@shazow I'll let you know if there is anything I believe might help/improve.
And yes absolutely, I was actually planning on sharing it to you very soon. It's a Tevm example, my PR is currently being reviewed. And I'm integrating it inside a personal project as well.
I'll send you the link with a TLDR + a Vercel preview once it's ready!
from whatsabi.
@0xpolarzero Hmm this is not intended behaviour, thanks for flagging it. Definitely open to a PR if you'd like to try to fix it. :)
I'm trying to understand what's happening, so I'm going to rephrase what you explained to make sure we're on the same page:
https://repo.sourcify.dev/contracts/full_match/10/0x4200000000000000000000000000000000000042/metadata.json
gets hit first, which returns 404- This try/catch gets hit: https://github.com/shazow/whatsabi/blob/main/src/loaders.ts#L140-L142
if (!isSourcifyNotFound(error)) throw error;
- Since it's a 404, it should not throw (note the negating
!
in front), and fall through to the partial block, no?
Is isSourcifyNotFound
incorrect? Or am I confusing some other call flow condition?
from whatsabi.
@shazow Oh, I completely overlooked the !
in front, sorry about that... It should definitely get to the second block then. Thanks for making it clearer.
Please let me play with it a bit to try to exhibit the issue. I'll gladly submit a PR if I can find it!
from whatsabi.
@0xpolarzero Awesome, thank you!
from whatsabi.
@shazow Ok, that was due to a silly mistake/misunderstanding from my end, truly sorry for wasting your time...
The core issue was making the request from my Next.js app on the client side; the 404 status of the issue was due to the usual CORS header ‘Access-Control-Allow-Origin’ missing
. I was too quick to attribute it to WhatsABI.
So basically, the request needs to be done on the server side—e.g. via an API route. Which unfortunately makes the use of the callbacks (onProgress
, onError
) not possible. But that's purely a React/Next/client components problem.
I'm not sure about that, but from my understanding, these are the few solutions (for documentation/in case anyone else faces this):
- make the call (e.g.
autoload
) inside an API route, and just call that route from the client side—you won't be able to pass it any function, for instance a callback on error/progress; - serve the Sourcify server yourself with a flexible/customized CORS policy (see here);
from whatsabi.
Very cool! @roninjin10 will be so hyped
from whatsabi.
Related Issues (20)
- upstream: Add whatsabi support to Safe tx-builder app
- Invalid JSON output: keys and values missing double quotes HOT 3
- Add empty "name" keys to ABI results HOT 3
- Two bugs we encountered during our usage HOT 3
- Some proxies failed to resolve. HOT 2
- Publish generated documentation
- autoload: Behave on non-contract address
- Accuracy and speed results from EVMole benchmark HOT 2
- proxy: Resolve EIP-1967 transparent proxy with custom slot
- disasm: Add selectors-only escape hatch HOT 1
- bug test case: eth:0x000000000090d2b159528c290616CF919B24e1d9 HOT 2
- Pass an optional baseUrl or chainId to defaultWithApiKeys HOT 2
- Option to call etherscan's `getsourcecode` instead of `getabi` HOT 8
- Add an example env HOT 2
- disasm: Consider using evmole as an optional backend? HOT 16
- Some contracts return [0x00000001, 0x00000002] selectors HOT 1
- proxies: Load additional candidates from recent transactions? HOT 4
- Listing @noble/hashes as a depenency. HOT 6
- loaders: Add anyabi.xyz
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from whatsabi.