Created
September 7, 2018 14:46
-
-
Save luyzdeleon/1786ac641c70a32415d58e8b115fa3b7 to your computer and use it in GitHub Desktop.
Create query
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Queries are structured like JSON-RPC calls, all methods are supported except sendTransaction and sendRawTransaction | |
let queryParams = ["rpcMethod": "eth_getTransactionCount", "rpcParams": ["0x0", "latest"]] | |
// The decoder is going to be used to try and decode the response in case it's a hex or any other data type that needs decoding | |
// You can pass in nil and get the raw response from the blockchain | |
let decoder = ["returnTypes": ["uint256"]] | |
let query = try? PocketEth.createQuery(params: queryParams, decoder: decoder) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment