-
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.
Merge branch 'release/1.13.0-beta-1'
- Loading branch information
Showing
28 changed files
with
1,309 additions
and
38 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
76 changes: 76 additions & 0 deletions
76
src/main/java/com/algorand/algosdk/v2/client/algod/AccountApplicationInformation.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,76 @@ | ||
package com.algorand.algosdk.v2.client.algod; | ||
|
||
import com.algorand.algosdk.crypto.Address; | ||
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.AccountApplicationResponse; | ||
|
||
|
||
/** | ||
* Given a specific account public key and application ID, this call returns the | ||
* account's application local state and global state (AppLocalState and AppParams, | ||
* if either exists). Global state will only be returned if the provided address is | ||
* the application's creator. | ||
* /v2/accounts/{address}/applications/{application-id} | ||
*/ | ||
public class AccountApplicationInformation extends Query { | ||
|
||
private Address address; | ||
private Long applicationId; | ||
|
||
/** | ||
* @param address An account public key | ||
* @param applicationId An application identifier | ||
*/ | ||
public AccountApplicationInformation(Client client, Address address, Long applicationId) { | ||
super(client, new HttpMethod("get")); | ||
this.address = address; | ||
this.applicationId = applicationId; | ||
} | ||
|
||
/** | ||
* Execute the query. | ||
* @return the query response object. | ||
* @throws Exception | ||
*/ | ||
@Override | ||
public Response<AccountApplicationResponse> execute() throws Exception { | ||
Response<AccountApplicationResponse> resp = baseExecute(); | ||
resp.setValueType(AccountApplicationResponse.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<AccountApplicationResponse> execute(String[] headers, String[] values) throws Exception { | ||
Response<AccountApplicationResponse> resp = baseExecute(headers, values); | ||
resp.setValueType(AccountApplicationResponse.class); | ||
return resp; | ||
} | ||
|
||
protected QueryData getRequestString() { | ||
if (this.address == null) { | ||
throw new RuntimeException("address is not set. It is a required parameter."); | ||
} | ||
if (this.applicationId == null) { | ||
throw new RuntimeException("application-id is not set. It is a required parameter."); | ||
} | ||
addPathSegment(String.valueOf("v2")); | ||
addPathSegment(String.valueOf("accounts")); | ||
addPathSegment(String.valueOf(address)); | ||
addPathSegment(String.valueOf("applications")); | ||
addPathSegment(String.valueOf(applicationId)); | ||
|
||
return qd; | ||
} | ||
} |
75 changes: 75 additions & 0 deletions
75
src/main/java/com/algorand/algosdk/v2/client/algod/AccountAssetInformation.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,75 @@ | ||
package com.algorand.algosdk.v2.client.algod; | ||
|
||
import com.algorand.algosdk.crypto.Address; | ||
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.AccountAssetResponse; | ||
|
||
|
||
/** | ||
* Given a specific account public key and asset ID, this call returns the | ||
* account's asset holding and asset parameters (if either exist). Asset parameters | ||
* will only be returned if the provided address is the asset's creator. | ||
* /v2/accounts/{address}/assets/{asset-id} | ||
*/ | ||
public class AccountAssetInformation extends Query { | ||
|
||
private Address address; | ||
private Long assetId; | ||
|
||
/** | ||
* @param address An account public key | ||
* @param assetId An asset identifier | ||
*/ | ||
public AccountAssetInformation(Client client, Address address, Long assetId) { | ||
super(client, new HttpMethod("get")); | ||
this.address = address; | ||
this.assetId = assetId; | ||
} | ||
|
||
/** | ||
* Execute the query. | ||
* @return the query response object. | ||
* @throws Exception | ||
*/ | ||
@Override | ||
public Response<AccountAssetResponse> execute() throws Exception { | ||
Response<AccountAssetResponse> resp = baseExecute(); | ||
resp.setValueType(AccountAssetResponse.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<AccountAssetResponse> execute(String[] headers, String[] values) throws Exception { | ||
Response<AccountAssetResponse> resp = baseExecute(headers, values); | ||
resp.setValueType(AccountAssetResponse.class); | ||
return resp; | ||
} | ||
|
||
protected QueryData getRequestString() { | ||
if (this.address == null) { | ||
throw new RuntimeException("address is not set. It is a required parameter."); | ||
} | ||
if (this.assetId == null) { | ||
throw new RuntimeException("asset-id is not set. It is a required parameter."); | ||
} | ||
addPathSegment(String.valueOf("v2")); | ||
addPathSegment(String.valueOf("accounts")); | ||
addPathSegment(String.valueOf(address)); | ||
addPathSegment(String.valueOf("assets")); | ||
addPathSegment(String.valueOf(assetId)); | ||
|
||
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
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
Oops, something went wrong.