Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.4.5

- Support adding timeout on http request

## 0.4.4

- Support abi float32 and float64
Expand Down
2 changes: 1 addition & 1 deletion example/eosdart_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:eosdart/eosdart.dart';

main() {
EOSClient client = EOSClient('https://eos.greymass.com', 'v1');
// EOSClient client = EOSClient('http://127.0.0.1:8888', 'v1');
// EOSClient client = EOSClient('http://127.0.0.1:8888', 'v1', httpTimeout: 15);

// Get EOS Node Info
client.getInfo().then((NodeInfo nodeInfo) {
Expand Down
11 changes: 9 additions & 2 deletions lib/src/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,21 @@ class EOSClient {
final String _nodeURL;
final String _version;
int expirationInSec;
int httpTimeout;
Map<String, ecc.EOSPrivateKey> keys = Map();

/// Converts abi files between binary and structured form (`abi.abi.json`) */
Map<String, Type> abiTypes;
Map<String, Type> transactionTypes;

/// Construct the EOS client from eos node URL
EOSClient(this._nodeURL, this._version,
{this.expirationInSec = 180, List<String> privateKeys = const []}) {
EOSClient(
this._nodeURL,
this._version, {
this.expirationInSec = 180,
List<String> privateKeys = const [],
this.httpTimeout = 10,
}) {
_mapKeys(privateKeys);

abiTypes = ser.getTypesFromAbi(
Expand All @@ -56,6 +62,7 @@ class EOSClient {
http
.post('${this._nodeURL}/${this._version}${path}',
body: json.encode(body))
.timeout(Duration(seconds: this.httpTimeout))
.then((http.Response response) {
if (response.statusCode >= 300) {
completer.completeError(response.body);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: eosdart
description: EOSIO-based blockchain RPC API client in Dart language
version: 0.4.4
version: 0.4.5
homepage: https://github.com/primes-network/eosdart
author: primes-network <primes.ntwk@gmail.com>

Expand Down