Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
c53c4e4
Delete untyped decode methods.
yaroslavyaroslav Apr 28, 2022
e4012bf
Add generic encodeHex methods to `(Un)KeyedEncodingContainer`
yaroslavyaroslav May 3, 2022
d86583b
Update `Encodable+Extensions` to be generic.
yaroslavyaroslav May 10, 2022
24dc3a8
Making memos to methods.
yaroslavyaroslav May 13, 2022
cd751ee
`JSONRPCParam` enum implementation.
yaroslavyaroslav May 14, 2022
fb4c10d
`JSONRPCparams` replaced with `[JSONRPCParameter]` in outgoing API ca…
yaroslavyaroslav May 15, 2022
88c84bb
To create `JSONRPCrequest` parameters should conforms `JSONRPCParamet…
yaroslavyaroslav May 17, 2022
72e7ad9
Move JSONRPCParameter to separate file.
yaroslavyaroslav May 18, 2022
9f79702
Update UInt64 to UInt since this accuracy isn't required.
yaroslavyaroslav May 19, 2022
d7953dc
Change UInt64 to UInt.
yaroslavyaroslav May 22, 2022
e439b04
Remove commented out piece of code
yaroslavyaroslav May 22, 2022
1a7734e
Make Counter.increment() static method mode clear
yaroslavyaroslav May 22, 2022
8398c5d
Fix feeHistory logic bug
yaroslavyaroslav May 22, 2022
8c0e119
Make async/await internal API consistent
yaroslavyaroslav May 22, 2022
dfe4f72
Delete duplicate BlockNumber enum in FeeHistory.
yaroslavyaroslav May 22, 2022
e4fcc1d
Add EthJSONRPC enum to encapsulate REST logic.
yaroslavyaroslav May 23, 2022
f1ab07d
Method `sendRequest<U>(with call: EthJSONRPC) async throws -> EthResp…
yaroslavyaroslav May 24, 2022
9e0343c
Rename request types
yaroslavyaroslav May 24, 2022
5db2272
Implement most of required protocols to make decoding responses to ge…
yaroslavyaroslav May 25, 2022
245cc0d
Make `APIRequestParameterType` internal.
yaroslavyaroslav May 25, 2022
2a54eec
Refactor API a bit.
yaroslavyaroslav May 26, 2022
4e69483
Update for new Network layer:
yaroslavyaroslav May 26, 2022
635009a
Update for network layer:
yaroslavyaroslav May 27, 2022
27a28e2
Update clients code for changes made
yaroslavyaroslav May 27, 2022
351b671
Update for network layer:
yaroslavyaroslav May 27, 2022
7c5126a
Refactor code a bit.
yaroslavyaroslav May 27, 2022
412972b
Update for network layer:
yaroslavyaroslav May 27, 2022
2de0d21
Revert `BigUInt` to `UInt` type changes.
yaroslavyaroslav May 27, 2022
8207727
Rename API calls files and folder
yaroslavyaroslav May 27, 2022
216686e
Encapsulate request methods into APIRequest enum.
yaroslavyaroslav May 31, 2022
dddf1f2
Rename `getTransactionCount(address:, onBlock:)` to `getTransactionCo…
yaroslavyaroslav May 31, 2022
65c5a53
Add TxPool and getLog implementation
yaroslavyaroslav May 31, 2022
b24948f
Temporary disable Websocket provider.
yaroslavyaroslav May 31, 2022
0bc450b
Delete old HTTP(S) network code.
yaroslavyaroslav May 31, 2022
983d084
Temporary comment out not failed to build tests.
yaroslavyaroslav May 31, 2022
bbe64ef
Comment out some duplicating code.
yaroslavyaroslav May 31, 2022
16d6f1c
Delete `Web3+Eth.swift` since its purpose were to make Promise method…
yaroslavyaroslav May 31, 2022
6611999
Rename deleted methods in tests and BrowserFunctions to new one.
yaroslavyaroslav May 31, 2022
fec0bc0
Little code formatting
yaroslavyaroslav Jun 1, 2022
78301bd
Fix wrong sendTransaction request bug.
yaroslavyaroslav Jun 2, 2022
41ac98f
Fix `gasLimit` and `gasPrice` request bug.
yaroslavyaroslav Jun 2, 2022
23ef94a
Add Data type support by conforming `LiteralInitiableFromString` prot…
yaroslavyaroslav Jun 2, 2022
fa80d43
Implement `GetLogs` call.
yaroslavyaroslav Jun 3, 2022
90e2061
Update Web3HTTPProvider
yaroslavyaroslav Jun 5, 2022
55732ab
Delete unused `URLSession.data` method method.
yaroslavyaroslav Jun 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Making memos to methods.
  • Loading branch information
yaroslavyaroslav committed May 26, 2022
commit 24dc3a854365f28450dfe3229cae268ce76dbd19
12 changes: 11 additions & 1 deletion Sources/web3swift/Web3/Web3+JSONRPC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,15 @@ public struct JSONRPCresponse: Decodable{
self.init(id: id, jsonrpc: jsonrpc, result: nil, error: errorMessage)
return
}
// TODO: refactor me
// TODO: make me generic (DecodableFromHex or Decodable)
/// This is all available types of `result` to init
/// Now its type is `Any?`, since you're typecasting this any to exact each response,
/// coz you're knowing response to what request it would be,
/// and you're could be sure about API Response structure.
///
/// So since we're typecasting this explicitly each tyme, `result` property could be set
/// to protocol type like `Decodable` or `DevodableFromHex` or something,
/// and this code could be reduced so hard.
var result: Any? = nil
if let rawValue = try? container.decodeIfPresent(String.self, forKey: .result) {
result = rawValue
Expand Down Expand Up @@ -171,6 +179,7 @@ public struct JSONRPCresponse: Decodable{
}

// FIXME: Make me a real generic
// MARK: - This fits for DecodableFromHex
/// Get the JSON RCP reponse value by deserializing it into some native <T> class.
///
/// Returns nil if serialization fails
Expand Down Expand Up @@ -281,6 +290,7 @@ public struct JSONRPCparams: Encodable{
// TODO: Rewrite me to generic
public var params = [Any]()

// FIXME: Make me generic with encodableToHex (watch out bool)
public func encode(to encoder: Encoder) throws {
var container = encoder.unkeyedContainer()
for par in params {
Expand Down