-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
467 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
src/main/java/com/algorand/algosdk/v2/client/algod/GetBlockLogs.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package com.algorand.algosdk.v2.client.algod; | ||
|
||
import com.algorand.algosdk.v2.client.common.Client; | ||
import com.algorand.algosdk.v2.client.common.HttpMethod; | ||
import com.algorand.algosdk.v2.client.common.Query; | ||
import com.algorand.algosdk.v2.client.common.QueryData; | ||
import com.algorand.algosdk.v2.client.common.Response; | ||
import com.algorand.algosdk.v2.client.model.BlockLogsResponse; | ||
|
||
|
||
/** | ||
* Get all of the logs from outer and inner app calls in the given round | ||
* /v2/blocks/{round}/logs | ||
*/ | ||
public class GetBlockLogs extends Query { | ||
|
||
private Long round; | ||
|
||
/** | ||
* @param round The round from which to fetch block log information. | ||
*/ | ||
public GetBlockLogs(Client client, Long round) { | ||
super(client, new HttpMethod("get")); | ||
this.round = round; | ||
} | ||
|
||
/** | ||
* Execute the query. | ||
* @return the query response object. | ||
* @throws Exception | ||
*/ | ||
@Override | ||
public Response<BlockLogsResponse> execute() throws Exception { | ||
Response<BlockLogsResponse> resp = baseExecute(); | ||
resp.setValueType(BlockLogsResponse.class); | ||
return resp; | ||
} | ||
|
||
/** | ||
* Execute the query with custom headers, there must be an equal number of keys and values | ||
* or else an error will be generated. | ||
* @param headers an array of header keys | ||
* @param values an array of header values | ||
* @return the query response object. | ||
* @throws Exception | ||
*/ | ||
@Override | ||
public Response<BlockLogsResponse> execute(String[] headers, String[] values) throws Exception { | ||
Response<BlockLogsResponse> resp = baseExecute(headers, values); | ||
resp.setValueType(BlockLogsResponse.class); | ||
return resp; | ||
} | ||
|
||
protected QueryData getRequestString() { | ||
if (this.round == null) { | ||
throw new RuntimeException("round is not set. It is a required parameter."); | ||
} | ||
addPathSegment(String.valueOf("v2")); | ||
addPathSegment(String.valueOf("blocks")); | ||
addPathSegment(String.valueOf(round)); | ||
addPathSegment(String.valueOf("logs")); | ||
|
||
return qd; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/main/java/com/algorand/algosdk/v2/client/model/AccountAssetHolding.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.algorand.algosdk.v2.client.model; | ||
|
||
import java.util.Objects; | ||
|
||
import com.algorand.algosdk.v2.client.common.PathResponse; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* AccountAssetHolding describes the account's asset holding and asset parameters | ||
* (if either exist) for a specific asset ID. | ||
*/ | ||
public class AccountAssetHolding extends PathResponse { | ||
|
||
/** | ||
* (asset) Details about the asset held by this account. | ||
* The raw account uses `AssetHolding` for this type. | ||
*/ | ||
@JsonProperty("asset-holding") | ||
public AssetHolding assetHolding; | ||
|
||
/** | ||
* (apar) parameters of the asset held by this account. | ||
* The raw account uses `AssetParams` for this type. | ||
*/ | ||
@JsonProperty("asset-params") | ||
public AssetParams assetParams; | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
|
||
if (this == o) return true; | ||
if (o == null) return false; | ||
|
||
AccountAssetHolding other = (AccountAssetHolding) o; | ||
if (!Objects.deepEquals(this.assetHolding, other.assetHolding)) return false; | ||
if (!Objects.deepEquals(this.assetParams, other.assetParams)) return false; | ||
|
||
return true; | ||
} | ||
} |
Oops, something went wrong.