diff --git a/src/main/java/jota/IotaAPIProxy.java b/src/main/java/jota/IotaAPIProxy.java index f02a19c..5c036b6 100644 --- a/src/main/java/jota/IotaAPIProxy.java +++ b/src/main/java/jota/IotaAPIProxy.java @@ -693,7 +693,7 @@ public class IotaAPIProxy { * @method getBundle * @returns {list} bundle Transaction objects **/ - public Bundle getBundle(String transaction) throws ArgumentException, InvalidBundleException, InvalidSignatureException { + public GetBundleResponse getBundle(String transaction) throws ArgumentException, InvalidBundleException, InvalidSignatureException { Bundle bundle = traverseBundle(transaction, null, null); if (bundle == null) { @@ -762,7 +762,7 @@ public class IotaAPIProxy { if (!isValidSignature) throw new InvalidSignatureException(); } - return bundle; + return GetBundleResponse.create(bundle.getTransactions()); } /** diff --git a/src/main/java/jota/dto/response/GetBundleResponse.java b/src/main/java/jota/dto/response/GetBundleResponse.java index 34ffb89..eac6ed8 100644 --- a/src/main/java/jota/dto/response/GetBundleResponse.java +++ b/src/main/java/jota/dto/response/GetBundleResponse.java @@ -7,17 +7,16 @@ import java.util.List; public class GetBundleResponse extends AbstractResponse { - public GetBundleResponse(){ - - } - - public GetBundleResponse(List trxs){ - this.transactions = trxs; - } - private List transactions = new ArrayList<>(); + public static GetBundleResponse create (List transactions){ + GetBundleResponse res = new GetBundleResponse(); + res.transactions = transactions; + return res; + } + + public List getTransactions() { return transactions; } -} +} \ No newline at end of file