Skip to content

Commit 5094bec

Browse files
committed
Clean up example code comments, Finish documentation
1 parent 540d180 commit 5094bec

File tree

3 files changed

+113
-224
lines changed

3 files changed

+113
-224
lines changed

Client/Modules/Account.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ extension EtherscanClient {
4040
- parameter startBlock: Optional start block number
4141
- parameter endBlock: Optional end block number
4242
- parameter page: Optional page number. Use with offset. If set to nil, query will return up to 10000 transactions.
43-
- parameter offset: The number of transactions per page
43+
- parameter offset: Optional offset. The number of transactions per page
4444
- parameter completion: Callback for the outcome of the fetch.
4545
*/
4646
public func getTransaction(address: String? = nil, startBlock: String? = nil,
@@ -57,7 +57,7 @@ extension EtherscanClient {
5757
- parameter startBlock: Optional start block number
5858
- parameter endBlock: Optional end block number
5959
- parameter page: Optional page number. Use with offset. If set to nil, query will return up to 10000 transactions.
60-
- parameter offset: The number of transactions per page
60+
- parameter offset: Optional offset. The number of transactions per page
6161
- parameter completion: Callback for the outcome of the fetch.
6262
*/
6363
public func getInternalTransaction(address: String? = nil,
@@ -78,7 +78,7 @@ extension EtherscanClient {
7878
- parameter startBlock: Optional start block number
7979
- parameter endBlock: Optional end block number
8080
- parameter page: Optional page number. Use with offset. If set to nil, query will return up to 10000 transactions.
81-
- parameter offset: The number of transactions per page
81+
- parameter offset: Optional offset. The number of transactions per page
8282
- parameter contractAddress: The contract address of the ERC20 contract
8383
- parameter completion: Callback for the outcome of the fetch.
8484
*/

Example/EtherscanClient/ViewController.swift

Lines changed: 0 additions & 175 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@ import EtherscanClient
1111

1212
class ViewController: UITableViewController {
1313

14-
15-
let methods = [
16-
"getGasEstimationTime",
17-
18-
]
19-
20-
let cellId = "cellId"
21-
2214
override func viewDidLoad() {
2315
super.viewDidLoad()
2416

@@ -28,175 +20,8 @@ class ViewController: UITableViewController {
2820
navigationController?.navigationBar.prefersLargeTitles = true
2921
}
3022

31-
// Do any additional setup after loading the view.
3223
let client = EtherscanClient(apiKey: apiKey, accountAddress: "0x9dd134d14d1e65f84b706d6f205cd5b1cd03a46b")
33-
// client.getBlockCountDown(blockno: "16100000") { result in
34-
// switch result {
35-
// case .success(let result):
36-
// print(result)
37-
// case .failure(let error):
38-
// print(error)
39-
// }
40-
// }
41-
42-
43-
tableView.register(UITableViewCell.self, forCellReuseIdentifier: cellId)
44-
// client.getBlockReward(blockno: "2165403") { result in
45-
// switch result {
46-
// case .success(let result):
47-
// print(result)
48-
// case .failure(let error):
49-
// print(error)
50-
// }
51-
// }
52-
// client.getGasEstimationTime(gasPrice: "2000000000") { result in
53-
// switch result {
54-
// case .success(let result):
55-
// print(result)
56-
// case .failure(let error):
57-
// print(error)
58-
// }
59-
// }
60-
//
61-
// client.getGasOracle { result in
62-
// switch result {
63-
// case .success(let result):
64-
// print(result)
65-
// case .failure(let error):
66-
// print(error)
67-
// }
68-
// }
69-
70-
// client.getEventLog(fromBlock: "379224", toBlock: "latest", address: "0x33990122638b9132ca29c723bdf037f1a891a70c", topicx: .topic0, topicxbytes: "0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545") { result in
71-
// switch result {
72-
// case .success(let result):
73-
// print(result)
74-
// case .failure(let error):
75-
// print(error)
76-
// }
77-
// }
78-
// client.getEventLog(fromBlock: "379224", toBlock: "latest", address: "0x33990122638b9132ca29c723bdf037f1a891a70c", topicx: .topic0, topicxbytes: "0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545", topicOperator: .and, topicy: .topic1, topicybytes: "0x72657075746174696f6e00000000000000000000000000000000000000000000") { result in
79-
// switch result {
80-
// case .success(let result):
81-
// print(result)
82-
// case .failure(let error):
83-
// print(error)
84-
// }
85-
// }
86-
// client.getEthNodeSize(startDate: "2019-02-01", endDate: "2019-02-28", clientType: .geth) { result in
87-
// switch result {
88-
// case .success(let result):
89-
// print(result)
90-
// case .failure(let error):
91-
// print(error)
92-
// }
93-
// }
94-
95-
// client.getEthLastPrice { result in
96-
// switch result {
97-
// case .success(let result):
98-
// print(result)
99-
// case .failure(let error):
100-
// print(error)
101-
// }
102-
// }
103-
104-
// client.contract.getContractABI(address: "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413") { result in
105-
// switch result {
106-
// case .success(let result):
107-
// print(result)
108-
// case .failure(let error):
109-
// print(error)
110-
// }
111-
// }
112-
113-
// client.contract.getSourceCode(address: "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413") { result in
114-
// switch result {
115-
// case .success(let result):
116-
// print(result)
117-
// case .failure(let error):
118-
// print(error)
119-
// }
120-
// }
121-
122-
// client.token.getErc20TotalSupply(contractAddress: "0x57d90b64a1a57749b0f932f1a3395792e12e7055") { result in
123-
// switch result {
124-
// case .success(let result):
125-
// print(result)
126-
// case .failure(let error):
127-
// print(error.reason)
128-
// }
129-
// }
130-
// client.token.getErc20AccountBalance(contractAddress: "0x57d90b64a1a57749b0f932f1a3395792e12e7055", address: "0xe04f27eb70e025b78871a2ad7eabe85e61212761") { result in
131-
// switch result {
132-
// case .success(let result):
133-
// print(result)
134-
// case .failure(let error):
135-
// print(error.reason)
136-
// }
137-
// }
138-
// client.transaction.checkTranctionReceiptStatus(txHash: "0x513c1ba0bebf66436b5fed86ab668452b7805593c05073eb2d51d3a52f480a76") { result in
139-
// switch result {
140-
// case .success(let result):
141-
// print(result)
142-
// case .failure(let error):
143-
// print(error.reason)
144-
// }
145-
// }
146-
//
147-
// client.transaction.checkContractExecutionStatus(txHash: "0x15f8e5ea1079d9a0bb04a4c58ae5fe7654b5b2b4463375ff7ffb490aa0032f3a") { result in
148-
// switch result {
149-
// case .success(let result):
150-
// print(result)
151-
// case .failure(let error):
152-
// print(error.reason)
153-
// }
154-
// }
155-
156-
// client.account.getBalance { result in
157-
// switch result {
158-
// case .success(let result):
159-
// print(result)
160-
// case .failure(let error):
161-
// print(error.reason)
162-
// }
163-
// }
164-
// client.account.getBlocksMined(blockType: .uncles) { result in
165-
// switch result {
166-
// case .success(let result):
167-
// print(result)
168-
// case .failure(let error):
169-
// print(error.reason)
170-
// }
171-
// }
172-
173-
// client.account.getTransaction(page: 1, offset: 10) { result in
174-
// switch result {
175-
// case .success(let result):
176-
// print(result)
177-
// case .failure(let error):
178-
// print(error)
179-
// }
180-
// }
181-
182-
// client.account.getInternalTransaction(page: 1, offset: 100) { result in
183-
// switch result {
184-
// case .success(let result):
185-
// print(result)
186-
// case .failure(let error):
187-
// print(error)
188-
// }
189-
// }
190-
}
191-
192-
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
193-
return 15
194-
}
19524

196-
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
197-
let cell = tableView.dequeueReusableCell(withIdentifier: cellId, for: indexPath)
198-
cell.textLabel?.text = "Something"
199-
return cell
20025
}
20126
}
20227

0 commit comments

Comments
 (0)