forked from anchorpw/ethereum-kit-swift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
103 additions
and
132 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
## Etherscan Requests | ||
|
||
#### `GetTransactions` | ||
|
||
Return a list of transactions of specified address | ||
|
||
##### Parameters | ||
|
||
1. `address` - the Address you want to get a balance of. | ||
2. `sort` - asc or des | ||
3. `startblock` - from which block you want to search | ||
4. `endblock` - to which block you want to search | ||
|
||
##### Returns | ||
|
||
List of `Transaction` of specified address. | ||
|
||
##### Example | ||
```swift | ||
let geth = Geth(network: .test) | ||
geth.getTransactions(address: "0x91c79f31De5208fadCbF83f0a7B0A9b6d8aBA90F", sort: .asc, startBlock: 0, endBlock: 9999999) { result in | ||
// do something... | ||
} | ||
``` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
## JSONRPC Requests | ||
|
||
#### `GetBalance` | ||
|
||
Return a balance of specified address based on the `BlockParameter`. | ||
|
||
##### Parameters | ||
|
||
1. `address` - the Address you want to get a balance of. | ||
2. `blockParameter`: based on what block parameter you want to see a balance. default is `latest`. see the [default block parameter](#the-default-block-parameter). | ||
|
||
##### Returns | ||
|
||
`Balance` of specified address. | ||
|
||
##### Example | ||
```swift | ||
let geth = Geth(network: .test) | ||
geth.getAccount(address: "0x91c79f31De5208fadCbF83f0a7B0A9b6d8aBA90F") { result in | ||
// do something... | ||
} | ||
``` | ||
|
||
*** | ||
|
||
#### `GetAccount` | ||
|
||
Returns a balance of specified address and map it to `Account` model. | ||
|
||
##### Parameters | ||
|
||
1. `address` - the Address you want to get a balance of. | ||
2. `blockParameter`: based on what block parameter you want to see a balance. default is `latest`. see the [default block parameter](#the-default-block-parameter). | ||
|
||
##### Returns | ||
|
||
`Account` of specified address. | ||
|
||
##### Example | ||
```swift | ||
let geth = Geth(network: .test) | ||
geth.getAccount(address: "0x91c79f31De5208fadCbF83f0a7B0A9b6d8aBA90F") { result in | ||
// do something... | ||
} | ||
``` | ||
|
||
*** | ||
|
||
#### `GetTransactionCount` | ||
|
||
Returns a number of transactions that a specified address has. | ||
|
||
##### Parameters | ||
|
||
1. `address` - the Address you want to get a balance of. | ||
2. `blockParameter`: based on what block parameter you want to see a balance. default is `latest`. see the [default block parameter](#the-default-block-parameter). | ||
|
||
##### Returns | ||
|
||
A number of transactions the specified address has. | ||
|
||
##### Example | ||
```swift | ||
let geth = Geth(network: .test) | ||
geth.getTransactionCount(address: "0x91c79f31De5208fadCbF83f0a7B0A9b6d8aBA90F") { result in | ||
// do something... | ||
} | ||
``` |