Skip to content

Commit

Permalink
update for stable p20
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-rogobete committed Oct 24, 2023
1 parent e622cee commit 717443d
Show file tree
Hide file tree
Showing 20 changed files with 345 additions and 353 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [1.6.6] - 24.Oct.2023.
- update stable version of p20

## [1.6.5] - 03.Oct.2023.
- update horizon responses for p20
- remove soroban experimental flag
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The Soneso open source Stellar SDK for Flutter is build with Dart and provides A
1. Add the dependency to your pubspec.yaml file:
```
dependencies:
stellar_flutter_sdk: ^1.6.5
stellar_flutter_sdk: ^1.6.6
```
2. Install it (command line or IDE):
```
Expand Down
Binary file modified documentation/sdk_api_doc.zip
Binary file not shown.
21 changes: 12 additions & 9 deletions lib/src/extend_footprint_ttl_operation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,42 @@ class ExtendFootprintTTLOperation extends Operation {
@override
XdrOperationBody toOperationBody() {
XdrOperationBody body =
XdrOperationBody(XdrOperationType.EXTEND_FOOTPRINT_TTL);
body.bumpExpirationOp = XdrExtendFootprintTTLOp(XdrExtensionPoint(0), XdrUint32(this._extendTo));
XdrOperationBody(XdrOperationType.EXTEND_FOOTPRINT_TTL);
body.bumpExpirationOp = XdrExtendFootprintTTLOp(
XdrExtensionPoint(0), XdrUint32(this._extendTo));
return body;
}

static ExtendFootrintTTLOperationBuilder builder(XdrExtendFootprintTTLOp op) {
return ExtendFootrintTTLOperationBuilder(op.extendTo.uint32);
static ExtendFootprintTTLOperationBuilder builder(
XdrExtendFootprintTTLOp op) {
return ExtendFootprintTTLOperationBuilder(op.extendTo.uint32);
}
}

class ExtendFootrintTTLOperationBuilder {
class ExtendFootprintTTLOperationBuilder {
int _extendTo;
MuxedAccount? _mSourceAccount;

ExtendFootrintTTLOperationBuilder(this._extendTo);
ExtendFootprintTTLOperationBuilder(this._extendTo);

/// Sets the source account for this operation represented by [sourceAccountId].
ExtendFootrintTTLOperationBuilder setSourceAccount(String sourceAccountId) {
ExtendFootprintTTLOperationBuilder setSourceAccount(String sourceAccountId) {
MuxedAccount? sa = MuxedAccount.fromAccountId(sourceAccountId);
_mSourceAccount = checkNotNull(sa, "invalid sourceAccountId");
return this;
}

/// Sets the muxed source account for this operation represented by [sourceAccount].
ExtendFootrintTTLOperationBuilder setMuxedSourceAccount(
ExtendFootprintTTLOperationBuilder setMuxedSourceAccount(
MuxedAccount sourceAccount) {
_mSourceAccount = sourceAccount;
return this;
}

///Builds an operation
ExtendFootprintTTLOperation build() {
ExtendFootprintTTLOperation operation = ExtendFootprintTTLOperation(_extendTo);
ExtendFootprintTTLOperation operation =
ExtendFootprintTTLOperation(_extendTo);
if (_mSourceAccount != null) {
operation.sourceAccount = _mSourceAccount;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/src/invoke_host_function_operation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ abstract class HostFunction {
wasmId,
salt: xdr.createContract!.contractIDPreimage.salt!);
} else if (xdr.createContract!.executable.type ==
XdrContractExecutableType.CONTRACT_EXECUTABLE_TOKEN) {
XdrContractExecutableType.CONTRACT_EXECUTABLE_STELLAR_ASSET) {
return DeploySACWithSourceAccountHostFunction(
Address.fromXdr(
xdr.createContract!.contractIDPreimage.address!),
Expand All @@ -66,7 +66,7 @@ abstract class HostFunction {
} else if (xdr.createContract!.contractIDPreimage.type ==
XdrContractIDPreimageType.CONTRACT_ID_PREIMAGE_FROM_ASSET &&
xdr.createContract!.executable.type ==
XdrContractExecutableType.CONTRACT_EXECUTABLE_TOKEN) {
XdrContractExecutableType.CONTRACT_EXECUTABLE_STELLAR_ASSET) {
return DeploySACWithAssetHostFunction(Asset.fromXdr(
xdr.createContract!.contractIDPreimage.fromAsset!));
}
Expand Down
6 changes: 3 additions & 3 deletions lib/src/operation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import 'set_trustline_flags_operation.dart';
import 'liquidity_pool_deposit_operation.dart';
import 'liquidity_pool_withdraw_operation.dart';
import 'invoke_host_function_operation.dart';
import 'bump_footprint_expiration_operation.dart';
import 'extend_footprint_ttl_operation.dart';
import 'restore_footprint_operation.dart';

/// Abstract class for operations.
Expand Down Expand Up @@ -207,9 +207,9 @@ abstract class Operation {
InvokeHostFunctionOperation.builder(body.invokeHostFunctionOp!)
.build();
break;
case XdrOperationType.BUMP_FOOTPRINT_EXPIRATION:
case XdrOperationType.EXTEND_FOOTPRINT_TTL:
operation =
BumpFootprintExpirationOperation.builder(body.bumpExpirationOp!)
ExtendFootprintTTLOperation.builder(body.bumpExpirationOp!)
.build();
break;
case XdrOperationType.RESTORE_FOOTPRINT:
Expand Down
4 changes: 2 additions & 2 deletions lib/src/responses/operations/operation_responses.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import 'clawback_operations_responses.dart';
import 'set_trustline_flags_operation_response.dart';
import 'liquidity_pool_operations_responses.dart';
import 'invoke_host_function_operation_response.dart';
import 'bump_footprint_expiration_operation_response.dart';
import 'extend_footprint_ttl_operation_response.dart';
import 'restore_footprint_operation_response.dart';

/// Abstract class for operation responses.
Expand Down Expand Up @@ -94,7 +94,7 @@ abstract class OperationResponse extends Response {
case 24:
return InvokeHostFunctionOperationResponse.fromJson(json);
case 25:
return BumpFootprintExpirationOperationResponse.fromJson(json);
return ExtendFootprintTTLOperationResponse.fromJson(json);
case 26:
return RestoreFootprintOperationResponse.fromJson(json);
default:
Expand Down
Loading

0 comments on commit 717443d

Please sign in to comment.