-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static enum
static class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaggregateCollection
(@NonNull Context context, @NonNull String collection, Map<String, Object> filter, Net.FieldAggregation[] fields) Aggregates collection data.batchQuery
(@NonNull Context context, @NonNull Net.ParamsOfQueryOperation[] operations) Performs multiple queries per single fetch.createBlockIterator
(@NonNull Context context, Number startTime, Number endTime, String[] shardFilter, String result) Creates block iterator.createTransactionIterator
(@NonNull Context context, Number startTime, Number endTime, String[] shardFilter, String[] accountsFilter, String result, Boolean includeTransfers) Creates transaction iterator.static CompletableFuture<Net.EndpointsSet>
fetchEndpoints
(@NonNull Context context) Requests the list of alternative endpoints from serverfindLastShardBlock
(@NonNull Context context, @NonNull String address) Returns ID of the last block in a specified account shardgetEndpoints
(@NonNull Context context) Requests the list of alternative endpoints from serveriteratorNext
(@NonNull Context context, @NonNull Number iterator, Number limit, Boolean returnResumeState) Returns next available items.static CompletableFuture<Net.ResultOfQuery>
Performs DAppServer GraphQL query.queryCollection
(@NonNull Context context, @NonNull String collection, Map<String, Object> filter, @NonNull String result, Net.OrderBy[] order, Number limit) Queries collection dataqueryCounterparties
(@NonNull Context context, @NonNull String account, @NonNull String result, Number first, String after) Allows to query and paginate through the list of accounts that the specified account has interacted with, sorted by the time of the last internal message between accountsqueryTransactionTree
(@NonNull Context context, @NonNull String inMsg, Abi.ABI[] abiRegistry, Number timeout) Returns a tree of transactions triggered by a specific message.static CompletableFuture<Void>
removeIterator
(@NonNull Context context, @NonNull Number handle) Removes an iteratorstatic CompletableFuture<Void>
Resumes network module to enable network activityresumeBlockIterator
(@NonNull Context context, @NonNull Map<String, Object> resumeState) Resumes block iterator.resumeTransactionIterator
(@NonNull Context context, @NonNull Map<String, Object> resumeState, String[] accountsFilter) Resumes transaction iterator.static CompletableFuture<Void>
setEndpoints
(@NonNull Context context, @NonNull String[] endpoints) Sets the list of endpoints to use on reinitsubscribeCollection
(@NonNull Context context, @NonNull String collection, Map<String, Object> filter, @NonNull String result, Consumer<SubscribeCollectionEvent> consumer) Creates a subscriptionstatic CompletableFuture<Void>
Suspends network module to stop any network activitystatic CompletableFuture<Void>
unsubscribe
(@NonNull Context context, @NonNull Number handle) Cancels a subscriptionwaitForCollection
(@NonNull Context context, @NonNull String collection, Map<String, Object> filter, @NonNull String result, Number timeout) Returns an object that fulfills the conditions or waits for its appearance
-
Constructor Details
-
Net
public Net()
-
-
Method Details
-
query
public static CompletableFuture<Net.ResultOfQuery> query(@NonNull @NonNull Context context, @NonNull @NonNull String query, Map<String, Object> variables) Performs DAppServer GraphQL query.- Parameters:
query
- GraphQL query text.variables
- Variables used in query. Must be a map with named values that can be used in query.
-
batchQuery
public static CompletableFuture<Net.ResultOfBatchQuery> batchQuery(@NonNull @NonNull Context context, @NonNull @NonNull Net.ParamsOfQueryOperation[] operations) Performs multiple queries per single fetch.- Parameters:
operations
- List of query operations that must be performed per single fetch.
-
queryCollection
public static CompletableFuture<Net.ResultOfQueryCollection> queryCollection(@NonNull @NonNull Context context, @NonNull @NonNull String collection, Map<String, Object> filter, @NonNull @NonNull String result, Net.OrderBy[] order, Number limit) Queries collection data- Parameters:
collection
- Collection name (accounts, blocks, transactions, messages, block_signatures)filter
- Collection filterresult
- Projection (result) stringorder
- Sorting orderlimit
- Number of documents to return
-
aggregateCollection
public static CompletableFuture<Net.ResultOfAggregateCollection> aggregateCollection(@NonNull @NonNull Context context, @NonNull @NonNull String collection, Map<String, Object> filter, Net.FieldAggregation[] fields) Aggregates collection data.- Parameters:
collection
- Collection name (accounts, blocks, transactions, messages, block_signatures)filter
- Collection filterfields
- Projection (result) string
-
waitForCollection
public static CompletableFuture<Net.ResultOfWaitForCollection> waitForCollection(@NonNull @NonNull Context context, @NonNull @NonNull String collection, Map<String, Object> filter, @NonNull @NonNull String result, Number timeout) Returns an object that fulfills the conditions or waits for its appearance- Parameters:
collection
- Collection name (accounts, blocks, transactions, messages, block_signatures)filter
- Collection filterresult
- Projection (result) stringtimeout
- Query timeout
-
unsubscribe
public static CompletableFuture<Void> unsubscribe(@NonNull @NonNull Context context, @NonNull @NonNull Number handle) Cancels a subscription- Parameters:
handle
- Subscription handle. Must be closed with `unsubscribe`
-
subscribeCollection
public static CompletableFuture<Net.ResultOfSubscribeCollection> subscribeCollection(@NonNull @NonNull Context context, @NonNull @NonNull String collection, Map<String, Object> filter, @NonNull @NonNull String result, Consumer<SubscribeCollectionEvent> consumer) Creates a subscription- Parameters:
collection
- Collection name (accounts, blocks, transactions, messages, block_signatures)filter
- Collection filterresult
- Projection (result) string
-
suspend
Suspends network module to stop any network activity -
resume
Resumes network module to enable network activity -
findLastShardBlock
public static CompletableFuture<Net.ResultOfFindLastShardBlock> findLastShardBlock(@NonNull @NonNull Context context, @NonNull @NonNull String address) Returns ID of the last block in a specified account shard- Parameters:
address
- Account address
-
fetchEndpoints
Requests the list of alternative endpoints from server -
setEndpoints
public static CompletableFuture<Void> setEndpoints(@NonNull @NonNull Context context, @NonNull @NonNull String[] endpoints) Sets the list of endpoints to use on reinit- Parameters:
endpoints
- List of endpoints provided by server
-
getEndpoints
public static CompletableFuture<Net.ResultOfGetEndpoints> getEndpoints(@NonNull @NonNull Context context) Requests the list of alternative endpoints from server -
queryCounterparties
public static CompletableFuture<Net.ResultOfQueryCollection> queryCounterparties(@NonNull @NonNull Context context, @NonNull @NonNull String account, @NonNull @NonNull String result, Number first, String after) Allows to query and paginate through the list of accounts that the specified account has interacted with, sorted by the time of the last internal message between accounts- Parameters:
account
- Account addressresult
- Projection (result) stringfirst
- Number of counterparties to returnafter
- `cursor` field of the last received result
-
queryTransactionTree
public static CompletableFuture<Net.ResultOfQueryTransactionTree> queryTransactionTree(@NonNull @NonNull Context context, @NonNull @NonNull String inMsg, Abi.ABI[] abiRegistry, Number timeout) Returns a tree of transactions triggered by a specific message.- Parameters:
inMsg
- Input message id.abiRegistry
- List of contract ABIs that will be used to decode message bodies. Library will try to decode each returned message body using any ABI from the registry.timeout
- Timeout used to limit waiting time for the missing messages and transaction. If some of the following messages and transactions are missing yetThe maximum waiting time is regulated by this option.Default value is 60000 (1 min).
-
createBlockIterator
public static CompletableFuture<Net.RegisteredIterator> createBlockIterator(@NonNull @NonNull Context context, Number startTime, Number endTime, String[] shardFilter, String result) Creates block iterator.- Parameters:
startTime
- Starting time to iterate from. If the application specifies this parameter then the iterationincludes blocks with `gen_utime` >= `start_time`.Otherwise the iteration starts from zero state.Must be specified in seconds.
endTime
- Optional end time to iterate for. If the application specifies this parameter then the iterationincludes blocks with `gen_utime` < `end_time`.Otherwise the iteration never stops.Must be specified in seconds.
shardFilter
- Shard prefix filter. If the application specifies this parameter and it is not the empty arraythen the iteration will include items related to accounts that belongs tothe specified shard prefixes.Shard prefix must be represented as a string "workchain:prefix".Where `workchain` is a signed integer and the `prefix` if a hexadecimalrepresentation if the 64-bit unsigned integer with tagged shard prefix.For example: "0:3800000000000000".result
- Projection (result) string. List of the fields that must be returned for iterated items.This field is the same as the `result` parameter ofthe `query_collection` function.Note that iterated items can contains additional fields that arenot requested in the `result`.
-
resumeBlockIterator
public static CompletableFuture<Net.RegisteredIterator> resumeBlockIterator(@NonNull @NonNull Context context, @NonNull @NonNull Map<String, Object> resumeState) Resumes block iterator.- Parameters:
resumeState
- Iterator state from which to resume. Same as value returned from `iterator_next`.
-
createTransactionIterator
public static CompletableFuture<Net.RegisteredIterator> createTransactionIterator(@NonNull @NonNull Context context, Number startTime, Number endTime, String[] shardFilter, String[] accountsFilter, String result, Boolean includeTransfers) Creates transaction iterator.- Parameters:
startTime
- Starting time to iterate from. If the application specifies this parameter then the iterationincludes blocks with `gen_utime` >= `start_time`.Otherwise the iteration starts from zero state.Must be specified in seconds.
endTime
- Optional end time to iterate for. If the application specifies this parameter then the iterationincludes blocks with `gen_utime` < `end_time`.Otherwise the iteration never stops.Must be specified in seconds.
shardFilter
- Shard prefix filters. If the application specifies this parameter and it is not an empty arraythen the iteration will include items related to accounts that belongs tothe specified shard prefixes.Shard prefix must be represented as a string "workchain:prefix".Where `workchain` is a signed integer and the `prefix` if a hexadecimalrepresentation if the 64-bit unsigned integer with tagged shard prefix.For example: "0:3800000000000000".Account address conforms to the shard filter ifit belongs to the filter workchain and the first bits of address match tothe shard prefix. Only transactions with suitable account addresses are iterated.accountsFilter
- Account address filter. Application can specify the list of accounts for whichit wants to iterate transactions.If this parameter is missing or an empty list then the library iteratestransactions for all accounts that pass the shard filter.
Note that the library doesn't detect conflicts between the account filter and the shard filterif both are specified.So it is an application responsibility to specify the correct filter combination.
result
- Projection (result) string. List of the fields that must be returned for iterated items.This field is the same as the `result` parameter ofthe `query_collection` function.Note that iterated items can contain additional fields that arenot requested in the `result`.includeTransfers
- Include `transfers` field in iterated transactions. If this parameter is `true` then each transaction contains field`transfers` with list of transfer. See more about this structure in function description.
-
resumeTransactionIterator
public static CompletableFuture<Net.RegisteredIterator> resumeTransactionIterator(@NonNull @NonNull Context context, @NonNull @NonNull Map<String, Object> resumeState, String[] accountsFilter) Resumes transaction iterator.- Parameters:
resumeState
- Iterator state from which to resume. Same as value returned from `iterator_next`.accountsFilter
- Account address filter. Application can specify the list of accounts for whichit wants to iterate transactions.If this parameter is missing or an empty list then the library iteratestransactions for all accounts that passes the shard filter.
Note that the library doesn't detect conflicts between the account filter and the shard filterif both are specified.So it is the application's responsibility to specify the correct filter combination.
-
iteratorNext
public static CompletableFuture<Net.ResultOfIteratorNext> iteratorNext(@NonNull @NonNull Context context, @NonNull @NonNull Number iterator, Number limit, Boolean returnResumeState) Returns next available items.- Parameters:
iterator
- Iterator handlelimit
- Maximum count of the returned items. If value is missing or is less than 1 the library uses 1.returnResumeState
- Indicates that function must return the iterator state that can be used for resuming iteration.
-
removeIterator
public static CompletableFuture<Void> removeIterator(@NonNull @NonNull Context context, @NonNull @NonNull Number handle) Removes an iterator- Parameters:
handle
- Iterator handle. Must be removed using `remove_iterator`when it is no more needed for the application.
-