Safari-Wallet / core

17 stars 3 forks source link

Etherscan Client #8

Closed bejitono closed 2 years ago

bejitono commented 2 years ago

This PR implements an etherscan client to fetch contract details (contract name and ABI) to be able to parse transaction inputs and provide more useful information (e.g. contract invocations and params).

ronaldmannak commented 2 years ago

Do we need the Alamofire dependency? Alamofire is only included temporary with the idea it would be removed when Nathan's Swift code is updated. I don't think we want to add more code that's dependent on Alamofire.

bejitono commented 2 years ago

Do we need the Alamofire dependency? Alamofire is only included temporary with the idea it would be removed when Nathan's Swift code is updated. I don't think we want to add more code that's dependent on Alamofire.

Yeah agreed. I'll remove it.

bejitono commented 2 years ago

@ronaldmannak I think the current base client only handles rpc requests, so I went ahead and implemented a separate REST-based client. Is that ok for you?

ronaldmannak commented 2 years ago

Yes, that sounds like a great idea.

ronaldmannak commented 2 years ago

I believe ObjC.io has a useful async/await version of their minimalistic and generic networking client. It might be useful to check it out.

https://twitter.com/objcio/status/1469321254238781442?s=21

bejitono commented 2 years ago

Nice, objc.io is great resource! Did you mean this library: https://github.com/objcio/tiny-networking. It also has an async/await extension.

The link you posted was relating to async URLSession delegates which would be great for download tasks, which we don't need (yet).