ClaimableBalancesRequestBuilder class
Builds requests to query claimable balances from Horizon.
Claimable balances are amounts of assets that have been set aside by a sender for a recipient to claim. They can have conditions attached that must be met before they can be claimed, such as time-based conditions or authorization.
This builder supports filtering claimable balances by sponsor, claimant, asset, and balance ID. Pagination is supported but streaming is not available.
Example:
// Get claimable balances for a specific claimant
final balances = await sdk.claimableBalances
.forClaimant('GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B')
.execute();
// Get a specific claimable balance by ID
final balance = await sdk.claimableBalances
.forBalanceId('00000000...');
// Filter by asset
final usdBalances = await sdk.claimableBalances
.forAsset(Asset.createNonNativeAsset('USD', issuerId))
.execute();
See also:
- Stellar developer docs
- ClaimableBalanceResponse for response structure
- Inheritance
-
- Object
- RequestBuilder
- ClaimableBalancesRequestBuilder
Constructors
- ClaimableBalancesRequestBuilder(Client httpClient, Uri serverURI)
- Creates a ClaimableBalancesRequestBuilder for querying claimable balances from Horizon.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- httpClient ↔ Client
-
getter/setter pairinherited
-
queryParameters
↔ Map<
String, String> -
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- uriBuilder ↔ Uri
-
getter/setter pairinherited
Methods
-
buildUri(
) → Uri -
Constructs the complete URI for the API request.
inherited
-
claimableBalance(
Uri uri) → Future< ClaimableBalanceResponse> -
Requests specific
uriand returns ClaimableBalancesResponse. This method is helpful for getting the links. -
cursor(
String token) → ClaimableBalancesRequestBuilder -
Sets the cursor for pagination.
override
-
encodeAsset(
Asset asset) → String -
Encodes an asset to its string representation for API requests.
inherited
-
encodeAssets(
List< Asset> assets) → String -
Encodes a list of assets to comma-separated string for API requests.
inherited
-
execute(
) → Future< Page< ClaimableBalanceResponse> > - Build and execute request.
-
forAsset(
Asset asset) → ClaimableBalancesRequestBuilder - Returns all claimable balances for an asset. See: Stellar developer docs
-
forBalanceId(
String balanceId) → Future< ClaimableBalanceResponse> -
Requests details about the claimable balance to fetch by
balanceId. See Stellar developer docs -
forClaimant(
String claimantAccountId) → ClaimableBalancesRequestBuilder - Returns all claimable balances for the accountId of a claimant. See: Stellar developer docs
-
forSponsor(
String signerAccountId) → ClaimableBalancesRequestBuilder - Returns all claimable balances for the account id of the sponsor who is paying the reserves for this claimable balances. See: Stellar developer docs
-
limit(
int number) → ClaimableBalancesRequestBuilder -
Sets the maximum number of claimable balances to return.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
order(
RequestBuilderOrder direction) → ClaimableBalancesRequestBuilder -
Sets the order of returned claimable balances.
override
-
setSegments(
List< String> segments) → RequestBuilder -
Sets the URL path segments for this request.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
requestExecute(
Client httpClient, Uri uri) → Future< Page< ClaimableBalanceResponse> > - Requests specific uri and returns Page of ClaimableBalanceResponse. This method is helpful for getting the next set of results.
Constants
- ASSET_PARAMETER_NAME → const String
- CLAIMANT_PARAMETER_NAME → const String
- SPONSOR_PARAMETER_NAME → const String