Skip to content
Open
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
@@ -1,17 +1,31 @@
package com.algorand.algosdk.v2.client.algod;

import java.util.List;

import org.apache.commons.lang3.StringUtils;

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.BoxesResponse;
import com.algorand.algosdk.v2.client.model.Enums;


/**
* Given an application ID, return all Box names. No particular ordering is
* 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.
* returning all box names.
* Pagination mode is enabled when any of the following parameters are provided:
* limit, next, prefix, include, or round. In pagination mode box values can be
* requested and results are returned in sorted order.
* To paginate: use the next-token from a previous response as the next parameter
* in the following request. Pin the round parameter to the round value from the
* first page's response to ensure consistent results across pages. The server
* enforces a per-response byte limit, so fewer results than limit may be returned
* even when more exist; the presence of next-token is the only reliable signal
* that more data is available.
* /v2/applications/{application-id}/boxes
*/
public class GetApplicationBoxes extends Query {
Expand All @@ -26,6 +40,23 @@ public GetApplicationBoxes(Client client, Long applicationId) {
this.applicationId = applicationId;
}

/**
* Include additional items in the response. Use `values` to include box values.
* Multiple values can be comma-separated.
*/
public GetApplicationBoxes include(List<Enums.Include> include) {
addQuery("include", StringUtils.join(include, ","));
return this;
}

/**
* Maximum number of boxes to return per page.
*/
public GetApplicationBoxes limit(Long limit) {
addQuery("limit", String.valueOf(limit));
return this;
}

/**
* Max number of box names to return. If max is not set, or max == 0, returns all
* box-names.
Expand All @@ -35,6 +66,34 @@ public GetApplicationBoxes max(Long max) {
return this;
}

/**
* A box name, in the goal app call arg form 'encoding:value', representing the
* earliest box name to include in results. Use the next-token from a previous
* response.
*/
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', to filter
* results by. Only boxes whose names start with this prefix will be returned.
*/
public GetApplicationBoxes prefix(String prefix) {
addQuery("prefix", String.valueOf(prefix));
return this;
}

/**
* Return box data from the given round. The round must be within the node's
* available range.
*/
public GetApplicationBoxes round(java.math.BigInteger round) {
addQuery("round", String.valueOf(round));
return this;
}

/**
* Execute the query.
* @return the query response object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ public RawTransaction rawtxn(byte[] rawtxn) {
return this;
}

/**
* Skip post-quantum address checks, including the check that rejects TEAL v13 or
* later LogicSig escrow addresses whose program hash is an Edwards25519 curve
* point. This should only be used if you understand the risks and know what you
* are doing.
*/
public RawTransaction skipPqAddressCheck(Boolean skipPqAddressCheck) {
addQuery("skip-pq-address-check", String.valueOf(skipPqAddressCheck));
return this;
}

/**
* Execute the query.
* @return the query response object.
Expand Down
69 changes: 0 additions & 69 deletions src/main/java/com/algorand/algosdk/v2/client/algod/TealDryrun.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import com.algorand.algosdk.v2.client.algod.SetSyncRound;
import com.algorand.algosdk.v2.client.algod.TealCompile;
import com.algorand.algosdk.v2.client.algod.TealDisassemble;
import com.algorand.algosdk.v2.client.algod.TealDryrun;
import com.algorand.algosdk.v2.client.algod.GetBlockTimeStampOffset;
import com.algorand.algosdk.v2.client.algod.SetBlockTimeStampOffset;
import com.algorand.algosdk.crypto.Address;
Expand Down Expand Up @@ -342,9 +341,18 @@ public GetApplicationByID GetApplicationByID(Long applicationId) {
}

/**
* Given an application ID, return all Box names. No particular ordering is
* 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.
* returning all box names.
* Pagination mode is enabled when any of the following parameters are provided:
* limit, next, prefix, include, or round. In pagination mode box values can be
* requested and results are returned in sorted order.
* To paginate: use the next-token from a previous response as the next parameter
* in the following request. Pin the round parameter to the round value from the
* first page's response to ensure consistent results across pages. The server
* enforces a per-response byte limit, so fewer results than limit may be returned
* even when more exist; the presence of next-token is the only reliable signal
* that more data is available.
* /v2/applications/{application-id}/boxes
*/
public GetApplicationBoxes GetApplicationBoxes(Long applicationId) {
Expand Down Expand Up @@ -416,16 +424,6 @@ public TealDisassemble TealDisassemble() {
return new TealDisassemble((Client) this);
}

/**
* Executes TEAL program(s) in context and returns debugging information about the
* execution. This endpoint is only enabled when a node's configuration file sets
* EnableDeveloperAPI to true.
* /v2/teal/dryrun
*/
public TealDryrun TealDryrun() {
return new TealDryrun((Client) this);
}

/**
* Gets the current timestamp offset.
* /v2/devmode/blocks/offset
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
package com.algorand.algosdk.v2.client.indexer;

import java.util.List;

import org.apache.commons.lang3.StringUtils;

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.BoxesResponse;
import com.algorand.algosdk.v2.client.model.Enums;


/**
Expand All @@ -25,6 +30,15 @@ public SearchForApplicationBoxes(Client client, Long applicationId) {
this.applicationId = applicationId;
}

/**
* Include additional items in the response. Use `values` to include box values.
* Multiple values can be comma-separated.
*/
public SearchForApplicationBoxes include(List<Enums.Include> include) {
addQuery("include", StringUtils.join(include, ","));
return this;
}

/**
* Maximum number of results to return. There could be additional pages even if the
* limit is not reached.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Box descriptor describes an app box without a value.
* Box descriptor describes an app box.
*/
public class BoxDescriptor extends PathResponse {

Expand All @@ -23,6 +23,19 @@ public String name() {
}
public byte[] name;

/**
* Base64 encoded box value. Present only when the `values` query parameter is set
* to true.
*/
@JsonProperty("value")
public void value(String base64Encoded) {
this.value = Encoder.decodeFromBase64(base64Encoded);
}
public String value() {
return Encoder.encodeToBase64(this.value);
}
public byte[] value;

@Override
public boolean equals(Object o) {

Expand All @@ -31,6 +44,7 @@ public boolean equals(Object o) {

BoxDescriptor other = (BoxDescriptor) o;
if (!Objects.deepEquals(this.name, other.name)) return false;
if (!Objects.deepEquals(this.value, other.value)) return false;

return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ public class BoxesResponse extends PathResponse {
@JsonProperty("next-token")
public String nextToken;

/**
* The round for which this information is relevant.
*/
@JsonProperty("round")
public Long round;

@Override
public boolean equals(Object o) {

Expand All @@ -38,6 +44,7 @@ public boolean equals(Object o) {
if (!Objects.deepEquals(this.applicationId, other.applicationId)) return false;
if (!Objects.deepEquals(this.boxes, other.boxes)) return false;
if (!Objects.deepEquals(this.nextToken, other.nextToken)) return false;
if (!Objects.deepEquals(this.round, other.round)) return false;

return true;
}
Expand Down

This file was deleted.

Loading