java.lang.Object
tech.deplant.java4ever.binding.Net

public class Net extends Object
  • 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 filter
      result - Projection (result) string
      order - Sorting order
      limit - 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 filter
      fields - 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 filter
      result - Projection (result) string
      timeout - 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 filter
      result - Projection (result) string
    • suspend

      public static CompletableFuture<Void> suspend(@NonNull @NonNull Context context)
      Suspends network module to stop any network activity
    • resume

      public static CompletableFuture<Void> resume(@NonNull @NonNull Context context)
      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

      public static CompletableFuture<Net.EndpointsSet> fetchEndpoints(@NonNull @NonNull Context context)
      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 address
      result - Projection (result) string
      first - Number of counterparties to return
      after - `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 handle
      limit - 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.