From e561b15afe0d009d9d33b7f81d7c1908732a7127 Mon Sep 17 00:00:00 2001 From: Christian Rogobete Date: Mon, 4 Nov 2024 14:25:43 +0100 Subject: [PATCH] add protocol 22-rc3 support --- CHANGELOG.md | 6 ++++++ README.md | 2 +- lib/src/soroban/soroban_server.dart | 11 +++++++++-- lib/src/stellar_sdk.dart | 2 +- pubspec.yaml | 2 +- 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8cb732..7af2df7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [1.9.1-beta] - 31.Oct.2024. +- Improved Protocol 22 support backwards compatibility: +- revert createdAt to int in soroban TransactionInfo (getTransactions) +- make pagingToken in soroban EventInfo not nullable so it can still be used. +- Improve ErrorResponse object to contain the http response + ## [1.9.0-beta] - 24.Oct.2024. - Protocol 22 support diff --git a/README.md b/README.md index e86c125..2688e12 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Prepare for Protocol 22 upgrade: ``` dependencies: - stellar_flutter_sdk: ^1.9.0-beta + stellar_flutter_sdk: ^1.9.1-beta ``` 2. Install it (command line or IDE): diff --git a/lib/src/soroban/soroban_server.dart b/lib/src/soroban/soroban_server.dart index 5689c7b..2396e5f 100644 --- a/lib/src/soroban/soroban_server.dart +++ b/lib/src/soroban/soroban_server.dart @@ -1250,6 +1250,13 @@ class TransactionInfo { ? List.from(json['diagnosticEventsXdr'].map((e) => e)) : null; + int createdAt = 0; + if (json['createdAt'] is int) { + createdAt = json['createdAt']; + } else { + createdAt = convertInt(json['createdAt']) ?? 0; + } + return TransactionInfo( json['status'], json['applicationOrder'], @@ -1258,7 +1265,7 @@ class TransactionInfo { json['resultXdr'], json['resultMetaXdr'], json['ledger'], - json['createdAt'], + createdAt, json['txHash'], diagnosticEventsXdr, ); @@ -1470,7 +1477,7 @@ class EventInfo { value, json['inSuccessfulContractCall'], json['txHash'], - json['pagingToken'], + json['pagingToken'] ?? json['id'], ); } diff --git a/lib/src/stellar_sdk.dart b/lib/src/stellar_sdk.dart index 329379a..25ff16c 100644 --- a/lib/src/stellar_sdk.dart +++ b/lib/src/stellar_sdk.dart @@ -31,7 +31,7 @@ import 'requests/liquidity_pools_request_builder.dart'; /// Main class of the flutter stellar sdk. class StellarSDK { - static const versionNumber = "1.9.0-beta"; + static const versionNumber = "1.9.1-beta"; static final StellarSDK PUBLIC = StellarSDK("https://horizon.stellar.org"); static final StellarSDK TESTNET = diff --git a/pubspec.yaml b/pubspec.yaml index 0d86777..0d13046 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: stellar_flutter_sdk description: A stellar blockchain sdk that query's horizon, build, signs and submits transactions to the stellar network. -version: 1.9.0-beta +version: 1.9.1-beta homepage: https://github.com/Soneso/stellar_flutter_sdk environment: