Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@


/**
* Given an application ID, return boxes in lexographical order by name. If the
* results must be truncated, a next-token is supplied to continue the request.
* Given an application ID, return all Box names. No particular ordering is
* guaranteed. Request fails when client or server-side configured limits prevent
* returning all Box names.
* /v2/applications/{application-id}/boxes
*/
public class GetApplicationBoxes extends Query {
Expand All @@ -26,42 +27,14 @@ public GetApplicationBoxes(Client client, Long applicationId) {
}

/**
* Maximum number of boxes to return. Server may impose a lower limit.
* Max number of box names to return. If max is not set, or max == 0, returns all
* box-names.
*/
public GetApplicationBoxes max(Long max) {
addQuery("max", String.valueOf(max));
return this;
}

/**
* A box name, in the goal app call arg form 'encoding:value'. When provided, the
* returned boxes begin (lexographically) with the supplied name. Callers may
* implement pagination by reinvoking the endpoint with the token from a previous
* call's next-token.
*/
public GetApplicationBoxes next(String next) {
addQuery("next", String.valueOf(next));
return this;
}

/**
* A box name prefix, in the goal app call arg form 'encoding:value'. For ints, use
* the form 'int:1234'. For raw bytes, use the form 'b64:A=='. For printable
* strings, use the form 'str:hello'. For addresses, use the form 'addr:XYZ...'.
*/
public GetApplicationBoxes prefix(String prefix) {
addQuery("prefix", String.valueOf(prefix));
return this;
}

/**
* If true, box values will be returned.
*/
public GetApplicationBoxes values(Boolean values) {
addQuery("values", String.valueOf(values));
return this;
}

/**
* Execute the query.
* @return the query response object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,9 @@ public GetApplicationByID GetApplicationByID(Long applicationId) {
}

/**
* Given an application ID, return boxes in lexographical order by name. If the
* results must be truncated, a next-token is supplied to continue the request.
* Given an application ID, return all Box names. No particular ordering is
* guaranteed. Request fails when client or server-side configured limits prevent
* returning all Box names.
* /v2/applications/{application-id}/boxes
*/
public GetApplicationBoxes GetApplicationBoxes(Long applicationId) {
Expand Down
7 changes: 2 additions & 5 deletions src/test/java/com/algorand/algosdk/unit/AlgodPaths.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,11 @@ public void getBoxByName(Long appID, String encodedBoxName) {
ps.q = algodClient.GetApplicationBoxByName(appID).name(encodedBoxName);
}

@When("we make a GetApplicationBoxes call for applicationID {long} with max {long} prefix {string} next {string} values {string}")
public void getApplicationBoxes(Long appId, Long max, String prefix, String next, String values) {
@When("we make a GetApplicationBoxes call for applicationID {long} with max {long}")
public void getApplicationBoxes(Long appId, Long max) {
GetApplicationBoxes q = algodClient.GetApplicationBoxes(appId);

if (TestingUtils.notEmpty(max)) q.max(max);
if (TestingUtils.notEmpty(prefix)) q.prefix(prefix);
if (TestingUtils.notEmpty(next)) q.next(next);
if (TestingUtils.notEmpty(values)) q.values(values.equals("true"));

ps.q = q;
}
Expand Down
Loading