File tree Expand file tree Collapse file tree 4 files changed +15
-4
lines changed Expand file tree Collapse file tree 4 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 1+ ## 0.4.5
2+
3+ - Support adding timeout on http request
4+
15## 0.4.4
26
37- Support abi float32 and float64
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import 'package:eosdart/eosdart.dart';
22
33main () {
44 EOSClient client = EOSClient ('https://eos.greymass.com' , 'v1' );
5- // EOSClient client = EOSClient('http://127.0.0.1:8888', 'v1');
5+ // EOSClient client = EOSClient('http://127.0.0.1:8888', 'v1', httpTimeout: 15 );
66
77 // Get EOS Node Info
88 client.getInfo ().then ((NodeInfo nodeInfo) {
Original file line number Diff line number Diff line change @@ -23,15 +23,21 @@ class EOSClient {
2323 final String _nodeURL;
2424 final String _version;
2525 int expirationInSec;
26+ int httpTimeout;
2627 Map <String , ecc.EOSPrivateKey > keys = Map ();
2728
2829 /// Converts abi files between binary and structured form (`abi.abi.json` ) */
2930 Map <String , Type > abiTypes;
3031 Map <String , Type > transactionTypes;
3132
3233 /// Construct the EOS client from eos node URL
33- EOSClient (this ._nodeURL, this ._version,
34- {this .expirationInSec = 180 , List <String > privateKeys = const []}) {
34+ EOSClient (
35+ this ._nodeURL,
36+ this ._version, {
37+ this .expirationInSec = 180 ,
38+ List <String > privateKeys = const [],
39+ this .httpTimeout = 10 ,
40+ }) {
3541 _mapKeys (privateKeys);
3642
3743 abiTypes = ser.getTypesFromAbi (
@@ -56,6 +62,7 @@ class EOSClient {
5662 http
5763 .post ('${this ._nodeURL }/${this ._version }${path }' ,
5864 body: json.encode (body))
65+ .timeout (Duration (seconds: this .httpTimeout))
5966 .then ((http.Response response) {
6067 if (response.statusCode >= 300 ) {
6168 completer.completeError (response.body);
Original file line number Diff line number Diff line change 11name : eosdart
22description : EOSIO-based blockchain RPC API client in Dart language
3- version : 0.4.4
3+ version : 0.4.5
44homepage : https://github.com/primes-network/eosdart
55author : primes-network <primes.ntwk@gmail.com>
66
You can’t perform that action at this time.
0 commit comments