Skip to content

Commit

Permalink
PromiseKit updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
keefertaylor authored Mar 19, 2019
1 parent 656c6f0 commit 1040725
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

TezosKit is a Swift library that is compatible with the [Tezos Blockchain](https://tezos.com). TezosKit implements communication with the blockchain via the JSON API.

[TOC]

Donations help me find time to work on TezosKit. If you find the library useful, please consider donating to support ongoing develoment.

|Currency| Address |
Expand Down Expand Up @@ -60,6 +62,8 @@ github "keefertaylor/TezosKit"

## Getting Started

TezosKit supports `Promise` style RPCs (in the `PromiseKit` variant), or block based callback's with `Result` types. All RPCs support both variants out of the box.

### Create a Network Client

```swift
Expand Down Expand Up @@ -221,6 +225,18 @@ tezosNodeClient.send(
}
```

### PromiseKit Variants

All RPCs can also be done with Promises. For instance, to retrieve a balance:
```
nodeClient.getBalance(address: "KT1BVAXZQUc4BGo3WTJ7UML6diVaEbe4bLZA").done { result in
let balance = Double(result.humanReadableRepresentation)!
print("The balance of the contract is \(balance)")
} .catch { _ in
print("Couldn't get balance.")
}
```

## Detailed Documentation

### Overview
Expand All @@ -242,7 +258,7 @@ The `OperationFees` object encapsulates the fee, gas limit and storage limit to

## Contributing

I am happy to accept pull requests.
Please open PRs or issues against the library.

## License

Expand Down

0 comments on commit 1040725

Please sign in to comment.