All Downloads are FREE. Search and download functionalities are using the official Maven repository.

live.radix.gateway.client.TransactionApi Maven / Gradle / Ivy

The newest version!
/*
 * Radix Gateway API - Babylon
 * This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission.  It is designed for use by wallets and explorers, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up.  The Gateway API is implemented by the [Network Gateway](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network.  This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own.  ## Migration guide  Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases).  ## Integration and forward compatibility guarantees  All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects.  When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out.  On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway.  The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare. 
 *
 * The version of the OpenAPI document: v1.6.3
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

package live.radix.gateway.client;

import com.fasterxml.jackson.core.type.TypeReference;

import live.radix.gateway.ApiException;
import live.radix.gateway.ApiClient;
import live.radix.gateway.BaseApi;
import live.radix.gateway.Configuration;
import live.radix.gateway.Pair;

import live.radix.gateway.model.AccountDepositPreValidationRequest;
import live.radix.gateway.model.AccountDepositPreValidationResponse;
import live.radix.gateway.model.ErrorResponse;
import live.radix.gateway.model.TransactionCommittedDetailsRequest;
import live.radix.gateway.model.TransactionCommittedDetailsResponse;
import live.radix.gateway.model.TransactionConstructionResponse;
import live.radix.gateway.model.TransactionPreviewRequest;
import live.radix.gateway.model.TransactionPreviewResponse;
import live.radix.gateway.model.TransactionStatusRequest;
import live.radix.gateway.model.TransactionStatusResponse;
import live.radix.gateway.model.TransactionSubmitRequest;
import live.radix.gateway.model.TransactionSubmitResponse;


import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.StringJoiner;

@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-08-15T00:18:13.130575900+03:00[Europe/Kiev]", comments = "Generator version: 7.7.0")
public class TransactionApi extends BaseApi {

  public TransactionApi() {
    super(Configuration.getDefaultApiClient());
  }

  public TransactionApi(ApiClient apiClient) {
    super(apiClient);
  }

  /**
   * PreValidate deposit of resources to an account
   * Helper endpoint that allows pre-validation if a deposit of certain resources to a given account can succeed or not. It is only meant for pre-validation usage, it does not guarantee that execution will succeed. 
   * @param accountDepositPreValidationRequest  (required)
   * @return AccountDepositPreValidationResponse
   * @throws ApiException if fails to make API call
   */
  public AccountDepositPreValidationResponse accountDepositPreValidation(AccountDepositPreValidationRequest accountDepositPreValidationRequest) throws ApiException {
    return this.accountDepositPreValidation(accountDepositPreValidationRequest, Collections.emptyMap());
  }


  /**
   * PreValidate deposit of resources to an account
   * Helper endpoint that allows pre-validation if a deposit of certain resources to a given account can succeed or not. It is only meant for pre-validation usage, it does not guarantee that execution will succeed. 
   * @param accountDepositPreValidationRequest  (required)
   * @param additionalHeaders additionalHeaders for this call
   * @return AccountDepositPreValidationResponse
   * @throws ApiException if fails to make API call
   */
  public AccountDepositPreValidationResponse accountDepositPreValidation(AccountDepositPreValidationRequest accountDepositPreValidationRequest, Map additionalHeaders) throws ApiException {
    Object localVarPostBody = accountDepositPreValidationRequest;
    
    // verify the required parameter 'accountDepositPreValidationRequest' is set
    if (accountDepositPreValidationRequest == null) {
      throw new ApiException(400, "Missing the required parameter 'accountDepositPreValidationRequest' when calling accountDepositPreValidation");
    }
    
    // create path and map variables
    String localVarPath = "/transaction/account-deposit-pre-validation";

    StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
    String localVarQueryParameterBaseName;
    List localVarQueryParams = new ArrayList();
    List localVarCollectionQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    Map localVarCookieParams = new HashMap();
    Map localVarFormParams = new HashMap();

    
    localVarHeaderParams.putAll(additionalHeaders);

    
    
    final String[] localVarAccepts = {
      "application/json"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

    final String[] localVarContentTypes = {
      "application/json"
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

    String[] localVarAuthNames = new String[] {  };

    TypeReference localVarReturnType = new TypeReference() {};
    return apiClient.invokeAPI(
        localVarPath,
        "POST",
        localVarQueryParams,
        localVarCollectionQueryParams,
        localVarQueryStringJoiner.toString(),
        localVarPostBody,
        localVarHeaderParams,
        localVarCookieParams,
        localVarFormParams,
        localVarAccept,
        localVarContentType,
        localVarAuthNames,
        localVarReturnType
    );
  }

  /**
   * Get Committed Transaction Details
   * Returns the committed details and receipt of the transaction for a given transaction identifier. Transaction identifiers which don't correspond to a committed transaction will return a `TransactionNotFoundError`. 
   * @param transactionCommittedDetailsRequest  (required)
   * @return TransactionCommittedDetailsResponse
   * @throws ApiException if fails to make API call
   */
  public TransactionCommittedDetailsResponse transactionCommittedDetails(TransactionCommittedDetailsRequest transactionCommittedDetailsRequest) throws ApiException {
    return this.transactionCommittedDetails(transactionCommittedDetailsRequest, Collections.emptyMap());
  }


  /**
   * Get Committed Transaction Details
   * Returns the committed details and receipt of the transaction for a given transaction identifier. Transaction identifiers which don't correspond to a committed transaction will return a `TransactionNotFoundError`. 
   * @param transactionCommittedDetailsRequest  (required)
   * @param additionalHeaders additionalHeaders for this call
   * @return TransactionCommittedDetailsResponse
   * @throws ApiException if fails to make API call
   */
  public TransactionCommittedDetailsResponse transactionCommittedDetails(TransactionCommittedDetailsRequest transactionCommittedDetailsRequest, Map additionalHeaders) throws ApiException {
    Object localVarPostBody = transactionCommittedDetailsRequest;
    
    // verify the required parameter 'transactionCommittedDetailsRequest' is set
    if (transactionCommittedDetailsRequest == null) {
      throw new ApiException(400, "Missing the required parameter 'transactionCommittedDetailsRequest' when calling transactionCommittedDetails");
    }
    
    // create path and map variables
    String localVarPath = "/transaction/committed-details";

    StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
    String localVarQueryParameterBaseName;
    List localVarQueryParams = new ArrayList();
    List localVarCollectionQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    Map localVarCookieParams = new HashMap();
    Map localVarFormParams = new HashMap();

    
    localVarHeaderParams.putAll(additionalHeaders);

    
    
    final String[] localVarAccepts = {
      "application/json"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

    final String[] localVarContentTypes = {
      "application/json"
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

    String[] localVarAuthNames = new String[] {  };

    TypeReference localVarReturnType = new TypeReference() {};
    return apiClient.invokeAPI(
        localVarPath,
        "POST",
        localVarQueryParams,
        localVarCollectionQueryParams,
        localVarQueryStringJoiner.toString(),
        localVarPostBody,
        localVarHeaderParams,
        localVarCookieParams,
        localVarFormParams,
        localVarAccept,
        localVarContentType,
        localVarAuthNames,
        localVarReturnType
    );
  }

  /**
   * Get Construction Metadata
   * Returns information needed to construct a new transaction including current `epoch` number. 
   * @return TransactionConstructionResponse
   * @throws ApiException if fails to make API call
   */
  public TransactionConstructionResponse transactionConstruction() throws ApiException {
    return this.transactionConstruction(Collections.emptyMap());
  }


  /**
   * Get Construction Metadata
   * Returns information needed to construct a new transaction including current `epoch` number. 
   * @param additionalHeaders additionalHeaders for this call
   * @return TransactionConstructionResponse
   * @throws ApiException if fails to make API call
   */
  public TransactionConstructionResponse transactionConstruction(Map additionalHeaders) throws ApiException {
    Object localVarPostBody = null;
    
    // create path and map variables
    String localVarPath = "/transaction/construction";

    StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
    String localVarQueryParameterBaseName;
    List localVarQueryParams = new ArrayList();
    List localVarCollectionQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    Map localVarCookieParams = new HashMap();
    Map localVarFormParams = new HashMap();

    
    localVarHeaderParams.putAll(additionalHeaders);

    
    
    final String[] localVarAccepts = {
      "application/json"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

    final String[] localVarContentTypes = {
      
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

    String[] localVarAuthNames = new String[] {  };

    TypeReference localVarReturnType = new TypeReference() {};
    return apiClient.invokeAPI(
        localVarPath,
        "POST",
        localVarQueryParams,
        localVarCollectionQueryParams,
        localVarQueryStringJoiner.toString(),
        localVarPostBody,
        localVarHeaderParams,
        localVarCookieParams,
        localVarFormParams,
        localVarAccept,
        localVarContentType,
        localVarAuthNames,
        localVarReturnType
    );
  }

  /**
   * Preview Transaction
   * Previews transaction against the network. This endpoint is effectively a proxy towards the Core API `/v0/transaction/preview` endpoint. See the Core API documentation for more details. 
   * @param transactionPreviewRequest  (required)
   * @return TransactionPreviewResponse
   * @throws ApiException if fails to make API call
   */
  public TransactionPreviewResponse transactionPreview(TransactionPreviewRequest transactionPreviewRequest) throws ApiException {
    return this.transactionPreview(transactionPreviewRequest, Collections.emptyMap());
  }


  /**
   * Preview Transaction
   * Previews transaction against the network. This endpoint is effectively a proxy towards the Core API `/v0/transaction/preview` endpoint. See the Core API documentation for more details. 
   * @param transactionPreviewRequest  (required)
   * @param additionalHeaders additionalHeaders for this call
   * @return TransactionPreviewResponse
   * @throws ApiException if fails to make API call
   */
  public TransactionPreviewResponse transactionPreview(TransactionPreviewRequest transactionPreviewRequest, Map additionalHeaders) throws ApiException {
    Object localVarPostBody = transactionPreviewRequest;
    
    // verify the required parameter 'transactionPreviewRequest' is set
    if (transactionPreviewRequest == null) {
      throw new ApiException(400, "Missing the required parameter 'transactionPreviewRequest' when calling transactionPreview");
    }
    
    // create path and map variables
    String localVarPath = "/transaction/preview";

    StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
    String localVarQueryParameterBaseName;
    List localVarQueryParams = new ArrayList();
    List localVarCollectionQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    Map localVarCookieParams = new HashMap();
    Map localVarFormParams = new HashMap();

    
    localVarHeaderParams.putAll(additionalHeaders);

    
    
    final String[] localVarAccepts = {
      "application/json"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

    final String[] localVarContentTypes = {
      "application/json"
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

    String[] localVarAuthNames = new String[] {  };

    TypeReference localVarReturnType = new TypeReference() {};
    return apiClient.invokeAPI(
        localVarPath,
        "POST",
        localVarQueryParams,
        localVarCollectionQueryParams,
        localVarQueryStringJoiner.toString(),
        localVarPostBody,
        localVarHeaderParams,
        localVarCookieParams,
        localVarFormParams,
        localVarAccept,
        localVarContentType,
        localVarAuthNames,
        localVarReturnType
    );
  }

  /**
   * Get Transaction Status
   * Returns overall transaction status and all of its known payloads based on supplied intent hash. 
   * @param transactionStatusRequest  (required)
   * @return TransactionStatusResponse
   * @throws ApiException if fails to make API call
   */
  public TransactionStatusResponse transactionStatus(TransactionStatusRequest transactionStatusRequest) throws ApiException {
    return this.transactionStatus(transactionStatusRequest, Collections.emptyMap());
  }


  /**
   * Get Transaction Status
   * Returns overall transaction status and all of its known payloads based on supplied intent hash. 
   * @param transactionStatusRequest  (required)
   * @param additionalHeaders additionalHeaders for this call
   * @return TransactionStatusResponse
   * @throws ApiException if fails to make API call
   */
  public TransactionStatusResponse transactionStatus(TransactionStatusRequest transactionStatusRequest, Map additionalHeaders) throws ApiException {
    Object localVarPostBody = transactionStatusRequest;
    
    // verify the required parameter 'transactionStatusRequest' is set
    if (transactionStatusRequest == null) {
      throw new ApiException(400, "Missing the required parameter 'transactionStatusRequest' when calling transactionStatus");
    }
    
    // create path and map variables
    String localVarPath = "/transaction/status";

    StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
    String localVarQueryParameterBaseName;
    List localVarQueryParams = new ArrayList();
    List localVarCollectionQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    Map localVarCookieParams = new HashMap();
    Map localVarFormParams = new HashMap();

    
    localVarHeaderParams.putAll(additionalHeaders);

    
    
    final String[] localVarAccepts = {
      "application/json"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

    final String[] localVarContentTypes = {
      "application/json"
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

    String[] localVarAuthNames = new String[] {  };

    TypeReference localVarReturnType = new TypeReference() {};
    return apiClient.invokeAPI(
        localVarPath,
        "POST",
        localVarQueryParams,
        localVarCollectionQueryParams,
        localVarQueryStringJoiner.toString(),
        localVarPostBody,
        localVarHeaderParams,
        localVarCookieParams,
        localVarFormParams,
        localVarAccept,
        localVarContentType,
        localVarAuthNames,
        localVarReturnType
    );
  }

  /**
   * Submit Transaction
   * Submits a signed transaction payload to the network. 
   * @param transactionSubmitRequest  (required)
   * @return TransactionSubmitResponse
   * @throws ApiException if fails to make API call
   */
  public TransactionSubmitResponse transactionSubmit(TransactionSubmitRequest transactionSubmitRequest) throws ApiException {
    return this.transactionSubmit(transactionSubmitRequest, Collections.emptyMap());
  }


  /**
   * Submit Transaction
   * Submits a signed transaction payload to the network. 
   * @param transactionSubmitRequest  (required)
   * @param additionalHeaders additionalHeaders for this call
   * @return TransactionSubmitResponse
   * @throws ApiException if fails to make API call
   */
  public TransactionSubmitResponse transactionSubmit(TransactionSubmitRequest transactionSubmitRequest, Map additionalHeaders) throws ApiException {
    Object localVarPostBody = transactionSubmitRequest;
    
    // verify the required parameter 'transactionSubmitRequest' is set
    if (transactionSubmitRequest == null) {
      throw new ApiException(400, "Missing the required parameter 'transactionSubmitRequest' when calling transactionSubmit");
    }
    
    // create path and map variables
    String localVarPath = "/transaction/submit";

    StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
    String localVarQueryParameterBaseName;
    List localVarQueryParams = new ArrayList();
    List localVarCollectionQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    Map localVarCookieParams = new HashMap();
    Map localVarFormParams = new HashMap();

    
    localVarHeaderParams.putAll(additionalHeaders);

    
    
    final String[] localVarAccepts = {
      "application/json"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

    final String[] localVarContentTypes = {
      "application/json"
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

    String[] localVarAuthNames = new String[] {  };

    TypeReference localVarReturnType = new TypeReference() {};
    return apiClient.invokeAPI(
        localVarPath,
        "POST",
        localVarQueryParams,
        localVarCollectionQueryParams,
        localVarQueryStringJoiner.toString(),
        localVarPostBody,
        localVarHeaderParams,
        localVarCookieParams,
        localVarFormParams,
        localVarAccept,
        localVarContentType,
        localVarAuthNames,
        localVarReturnType
    );
  }

  @Override
  public  T invokeAPI(String url, String method, Object request, TypeReference returnType, Map additionalHeaders) throws ApiException {
    String localVarPath = url.replace(apiClient.getBaseURL(), "");
    StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
    List localVarQueryParams = new ArrayList();
    List localVarCollectionQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    Map localVarCookieParams = new HashMap();
    Map localVarFormParams = new HashMap();

    localVarHeaderParams.putAll(additionalHeaders);

    final String[] localVarAccepts = {
      "application/json"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

    final String[] localVarContentTypes = {
      "application/json"
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

    String[] localVarAuthNames = new String[] {  };

    return apiClient.invokeAPI(
      localVarPath,
        method,
        localVarQueryParams,
        localVarCollectionQueryParams,
        localVarQueryStringJoiner.toString(),
        request,
        localVarHeaderParams,
        localVarCookieParams,
        localVarFormParams,
        localVarAccept,
        localVarContentType,
        localVarAuthNames,
        returnType
    );
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy