Skip to content

Commit

Permalink
remove warnings and prepare release
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-rogobete committed Jun 28, 2020
1 parent 4414b7d commit 13c578d
Show file tree
Hide file tree
Showing 28 changed files with 220 additions and 202 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [0.8.2] - 28.Jun.2020.
- Add query tests for accounts, efffects, ledgers.
- Fix ledger response parsing.
- Extend EffectsRequestBuilder for order, limit, cursor.
- remove many warnings/hints

## [0.8.1] - 27.Jun.2020.
- Add examples, app and more documentation.
- Restructuring of the project.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# [Stellar SDK for Flutter](https://github.com/Soneso/stellar_flutter_sdk)

![Beta Version](https://img.shields.io/badge/Beta-v0.8.1-yellow.svg)
![Beta Version](https://img.shields.io/badge/Beta-v0.8.2-yellow.svg)
![Dart](https://img.shields.io/badge/Dart-green.svg)
![Flutter](https://img.shields.io/badge/Flutter-blue.svg)
![Supports Stellar Horizon v1.4.0](https://img.shields.io/badge/Horizon-v1.4.0-blue.svg)
![Supports Stellar Core v13](https://img.shields.io/badge/Core-v13-blue.svg)

The Soneso open source Stellar SDK for Flutter is build with Dart and provides APIs to build and sign transactions, connect and query [Horizon](https://github.com/stellar/horizon).

The SDK is currently in beta stage - v. 0.8.1.
The SDK is currently in beta stage - v. 0.8.2.

## Installation

### From pub.dev
1. Add the dependency to your pubspec.yaml file:
```
dependencies:
stellar_flutter_sdk: ^0.8.1
stellar_flutter_sdk: ^0.8.2
```
2. Install it (command line or IDE):
```
Expand Down
4 changes: 2 additions & 2 deletions lib/src/manage_buy_offer_operation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class ManageBuyOfferOperation extends Operation {
/// [buying] is the asset the offer creator is buying.
/// [amount] is the amount of buying being bought. Set to 0 if you want to delete an existing offer.
/// [price] is the price of 1 unit of buying in terms of selling. (e.g. "0.1" => pay up to 0.1 asset selling for 1 unit asset of buying).
ManageBuyOfferOperation(Asset selling, Asset buying, String amount,
String price, int offerId) {
ManageBuyOfferOperation(
Asset selling, Asset buying, String amount, String price, int offerId) {
this._selling = checkNotNull(selling, "selling cannot be null");
this._buying = checkNotNull(buying, "buying cannot be null");
this._amount = checkNotNull(amount, "amount cannot be null");
Expand Down
4 changes: 2 additions & 2 deletions lib/src/manage_sell_offer_operation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class ManageSellOfferOperation extends Operation {
String _price;
int _offerId;

ManageSellOfferOperation(Asset selling, Asset buying, String amount,
String price, int offerId) {
ManageSellOfferOperation(
Asset selling, Asset buying, String amount, String price, int offerId) {
this._selling = checkNotNull(selling, "selling cannot be null");
this._buying = checkNotNull(buying, "buying cannot be null");
this._amount = checkNotNull(amount, "amount cannot be null");
Expand Down
2 changes: 1 addition & 1 deletion lib/src/operation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ abstract class Operation {

String _sourceAccount;

static final BigInt ONE = BigInt.from(10).pow(7);
static final BigInt one = BigInt.from(10).pow(7);

static int toXdrAmount(String value) {
value = checkNotNull(value, "value cannot be null");
Expand Down
2 changes: 1 addition & 1 deletion lib/src/requests/request_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ErrorResponse implements Exception {
ErrorResponse(this._code, this._body);

String toString() {
return "Error response from the server. Code: ${_code} - Body: $body";
return "Error response from the server. Code: $_code - Body: $body";
}

int get code => _code;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/responses/submit_transaction_response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class SubmitTransactionUnknownResponseException implements Exception {
SubmitTransactionUnknownResponseException(this._code, this._body);

String toString() {
return "Unknown response from Horizon - code: ${code} - body:$body";
return "Unknown response from Horizon - code: $code - body:$body";
}

int get code => _code;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/stellar_sdk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import 'requests/trades_request_builder.dart';

/// Main class of the flutter stellar sdk.
class StellarSDK {
static const versionNumber = "0.8.0";
static const versionNumber = "0.8.2";

static final StellarSDK PUBLIC =
new StellarSDK("https://horizon.stellar.org");
Expand Down
1 change: 0 additions & 1 deletion lib/src/str_key.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import 'transaction.dart';
import 'xdr/xdr_data_io.dart';
import 'xdr/xdr_signing.dart';
import 'xdr/xdr_type.dart';
import 'xdr/xdr_other.dart';

class VersionByte {
final _value;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/transaction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import 'account.dart';
abstract class AbstractTransaction {
Network _mNetwork;
List<XdrDecoratedSignature> _mSignatures;
static final int MIN_BASE_FEE = 100;
static const int MIN_BASE_FEE = 100;

AbstractTransaction(Network network) {
_mNetwork = checkNotNull(network, "network cannot be null");
Expand Down
2 changes: 1 addition & 1 deletion lib/src/xdr/xdr_bucket.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ class XdrBucketEntry {
}
return decodedBucketEntry;
}
}
}
2 changes: 1 addition & 1 deletion lib/src/xdr/xdr_data_entry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ class XdrDataValue {
decodedDataValue.dataValue = stream.readBytes(dataValuesize);
return decodedDataValue;
}
}
}
1 change: 0 additions & 1 deletion lib/src/xdr/xdr_data_io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ class DataInput {
}
}


class DataOutput {
List<int> data = List();
int offset = 0;
Expand Down
3 changes: 1 addition & 2 deletions lib/src/xdr/xdr_error.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class XdrErrorCode {
}
}


class XdrError {
XdrError();
XdrErrorCode _code;
Expand All @@ -62,4 +61,4 @@ class XdrError {
decodedError.msg = stream.readString();
return decodedError;
}
}
}
12 changes: 6 additions & 6 deletions lib/src/xdr/xdr_history.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class XdrTransactionHistoryEntry {

static XdrTransactionHistoryEntry decode(XdrDataInputStream stream) {
XdrTransactionHistoryEntry decodedTransactionHistoryEntry =
XdrTransactionHistoryEntry();
XdrTransactionHistoryEntry();
decodedTransactionHistoryEntry.ledgerSeq = XdrUint32.decode(stream);
decodedTransactionHistoryEntry.txSet = XdrTransactionSet.decode(stream);
decodedTransactionHistoryEntry.ext =
Expand All @@ -126,7 +126,7 @@ class XdrTransactionHistoryEntryExt {

static XdrTransactionHistoryEntryExt decode(XdrDataInputStream stream) {
XdrTransactionHistoryEntryExt decodedTransactionHistoryEntryExt =
XdrTransactionHistoryEntryExt();
XdrTransactionHistoryEntryExt();
int discriminant = stream.readInt();
decodedTransactionHistoryEntryExt.discriminant = discriminant;
switch (decodedTransactionHistoryEntryExt.discriminant) {
Expand Down Expand Up @@ -162,7 +162,7 @@ class XdrTransactionHistoryResultEntry {

static XdrTransactionHistoryResultEntry decode(XdrDataInputStream stream) {
XdrTransactionHistoryResultEntry decodedTransactionHistoryResultEntry =
XdrTransactionHistoryResultEntry();
XdrTransactionHistoryResultEntry();
decodedTransactionHistoryResultEntry.ledgerSeq = XdrUint32.decode(stream);
decodedTransactionHistoryResultEntry.txResultSet =
XdrTransactionResultSet.decode(stream);
Expand All @@ -181,7 +181,7 @@ class XdrTransactionHistoryResultEntryExt {
static void encode(
XdrDataOutputStream stream,
XdrTransactionHistoryResultEntryExt
encodedTransactionHistoryResultEntryExt) {
encodedTransactionHistoryResultEntryExt) {
stream.writeInt(encodedTransactionHistoryResultEntryExt.discriminant);
switch (encodedTransactionHistoryResultEntryExt.discriminant) {
case 0:
Expand All @@ -191,8 +191,8 @@ class XdrTransactionHistoryResultEntryExt {

static XdrTransactionHistoryResultEntryExt decode(XdrDataInputStream stream) {
XdrTransactionHistoryResultEntryExt
decodedTransactionHistoryResultEntryExt =
XdrTransactionHistoryResultEntryExt();
decodedTransactionHistoryResultEntryExt =
XdrTransactionHistoryResultEntryExt();
int discriminant = stream.readInt();
decodedTransactionHistoryResultEntryExt.discriminant = discriminant;
switch (decodedTransactionHistoryResultEntryExt.discriminant) {
Expand Down
22 changes: 10 additions & 12 deletions lib/src/xdr/xdr_ledger.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import 'xdr_asset.dart';
import 'xdr_scp.dart';
import 'xdr_account.dart';


class XdrLedgerEntryChangeType {
final _value;
const XdrLedgerEntryChangeType._internal(this._value);
Expand All @@ -21,11 +20,11 @@ class XdrLedgerEntryChangeType {
get value => this._value;

static const LEDGER_ENTRY_CREATED =
const XdrLedgerEntryChangeType._internal(0);
const XdrLedgerEntryChangeType._internal(0);
static const LEDGER_ENTRY_UPDATED =
const XdrLedgerEntryChangeType._internal(1);
const XdrLedgerEntryChangeType._internal(1);
static const LEDGER_ENTRY_REMOVED =
const XdrLedgerEntryChangeType._internal(2);
const XdrLedgerEntryChangeType._internal(2);
static const LEDGER_ENTRY_STATE = const XdrLedgerEntryChangeType._internal(3);

static XdrLedgerEntryChangeType decode(XdrDataInputStream stream) {
Expand Down Expand Up @@ -92,11 +91,11 @@ class XdrLedgerUpgradeType {

static const LEDGER_UPGRADE_VERSION = const XdrLedgerUpgradeType._internal(1);
static const LEDGER_UPGRADE_BASE_FEE =
const XdrLedgerUpgradeType._internal(2);
const XdrLedgerUpgradeType._internal(2);
static const LEDGER_UPGRADE_MAX_TX_SET_SIZE =
const XdrLedgerUpgradeType._internal(3);
const XdrLedgerUpgradeType._internal(3);
static const LEDGER_UPGRADE_BASE_RESERVE =
const XdrLedgerUpgradeType._internal(4);
const XdrLedgerUpgradeType._internal(4);

static XdrLedgerUpgradeType decode(XdrDataInputStream stream) {
int value = stream.readInt();
Expand Down Expand Up @@ -503,7 +502,6 @@ class XdrLedgerUpgrade {
}
}


class XdrLedgerEntry {
XdrLedgerEntry();
XdrUint32 _lastModifiedLedgerSeq;
Expand Down Expand Up @@ -669,7 +667,7 @@ class XdrLedgerEntryChange {
static XdrLedgerEntryChange decode(XdrDataInputStream stream) {
XdrLedgerEntryChange decodedLedgerEntryChange = XdrLedgerEntryChange();
XdrLedgerEntryChangeType discriminant =
XdrLedgerEntryChangeType.decode(stream);
XdrLedgerEntryChangeType.decode(stream);
decodedLedgerEntryChange.discriminant = discriminant;
switch (decodedLedgerEntryChange.discriminant) {
case XdrLedgerEntryChangeType.LEDGER_ENTRY_CREATED:
Expand Down Expand Up @@ -743,7 +741,7 @@ class XdrLedgerHeaderHistoryEntry {

static XdrLedgerHeaderHistoryEntry decode(XdrDataInputStream stream) {
XdrLedgerHeaderHistoryEntry decodedLedgerHeaderHistoryEntry =
XdrLedgerHeaderHistoryEntry();
XdrLedgerHeaderHistoryEntry();
decodedLedgerHeaderHistoryEntry.hash = XdrHash.decode(stream);
decodedLedgerHeaderHistoryEntry.header = XdrLedgerHeader.decode(stream);
decodedLedgerHeaderHistoryEntry.ext =
Expand All @@ -769,7 +767,7 @@ class XdrLedgerHeaderHistoryEntryExt {

static XdrLedgerHeaderHistoryEntryExt decode(XdrDataInputStream stream) {
XdrLedgerHeaderHistoryEntryExt decodedLedgerHeaderHistoryEntryExt =
XdrLedgerHeaderHistoryEntryExt();
XdrLedgerHeaderHistoryEntryExt();
int discriminant = stream.readInt();
decodedLedgerHeaderHistoryEntryExt.discriminant = discriminant;
switch (decodedLedgerHeaderHistoryEntryExt.discriminant) {
Expand All @@ -778,4 +776,4 @@ class XdrLedgerHeaderHistoryEntryExt {
}
return decodedLedgerHeaderHistoryEntryExt;
}
}
}
3 changes: 1 addition & 2 deletions lib/src/xdr/xdr_memo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class XdrMemoType {
}
}


class XdrMemo {
XdrMemo();
XdrMemoType _type;
Expand Down Expand Up @@ -106,4 +105,4 @@ class XdrMemo {
}
return decodedMemo;
}
}
}
Loading

0 comments on commit 13c578d

Please sign in to comment.