/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ import type { BscEstimateGas } from '../models/BscEstimateGas'; import type { CeloEstimateGas } from '../models/CeloEstimateGas'; import type { EstimateFee } from '../models/EstimateFee'; import type { EstimateFeeBatchMintNft } from '../models/EstimateFeeBatchMintNft'; import type { EstimateFeeDeployCustodialWallet } from '../models/EstimateFeeDeployCustodialWallet'; import type { EstimateFeeFromAddress } from '../models/EstimateFeeFromAddress'; import type { EstimateFeeFromUTXO } from '../models/EstimateFeeFromUTXO'; import type { EstimateFeeTransferFromCustodial } from '../models/EstimateFeeTransferFromCustodial'; import type { EthEstimateGas } from '../models/EthEstimateGas'; import type { EthEstimateGasArray } from '../models/EthEstimateGasArray'; import type { EthGasEstimation } from '../models/EthGasEstimation'; import type { EthGasEstimationBatch } from '../models/EthGasEstimationBatch'; import type { FeeBtc } from '../models/FeeBtc'; import type { FeeETH } from '../models/FeeETH'; import type { KcsEstimateGas } from '../models/KcsEstimateGas'; import type { KlaytnEstimateGas } from '../models/KlaytnEstimateGas'; import type { PolygonEstimateGas } from '../models/PolygonEstimateGas'; import type { TransactionFeeEgldBlockchain } from '../models/TransactionFeeEgldBlockchain'; import type { VetEstimateGas } from '../models/VetEstimateGas'; import type { XdcEstimateGas } from '../models/XdcEstimateGas'; import type { CancelablePromise } from '../core/CancelablePromise'; import { request as __request } from '../core/request'; export class BlockchainFeesService { /** * Estimate the fee for a transaction *

10 credits per API call.


*

Estimate current transaction fee for different operations.
* Supported blockchains: *

*

* * @param requestBody * @returns any OK * @throws ApiError */ public static estimateFeeBlockchain( requestBody: (EstimateFee | EstimateFeeBatchMintNft | EstimateFeeDeployCustodialWallet | EstimateFeeTransferFromCustodial | EstimateFeeFromAddress | EstimateFeeFromUTXO), ): CancelablePromise<(FeeBtc | FeeETH)> { return __request({ method: 'POST', path: `/v3/blockchain/estimate`, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.`, 401: `Unauthorized. Not valid or inactive subscription key present in the HTTP Header.`, 403: `Forbidden. The request is authenticated, but it is not possible to perform the required operation due to a logical error or invalid permissions.`, 500: `Internal server error. There was an error on the server while processing the request.`, }, }); } /** * Estimate Ethereum transaction fees *

10 credits per API call.


*

Estimate gasLimit and gasPrice of the Ethereum transaction. Gas price is obtained from multiple sources + calculated based on the latest N blocks and the current mempool state. The fast one is used by default. *

* * @param requestBody * @param xTestnetType Type of Ethereum testnet. Defaults to ethereum-sepolia. * @returns EthGasEstimation OK * @throws ApiError */ public static ethEstimateGas( requestBody: EthEstimateGas, xTestnetType: 'ethereum-sepolia' = 'ethereum-sepolia', ): CancelablePromise { return __request({ method: 'POST', path: `/v3/ethereum/gas`, headers: { 'x-testnet-type': xTestnetType, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.`, 401: `Unauthorized. Not valid or inactive subscription key present in the HTTP Header.`, 403: `Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.`, 500: `Internal server error. There was an error on the server while processing the request.`, }, }); } /** * Estimate multiple Ethereum transaction fees *

10 credits per API call + 10 credits per each gas estimation.


*

Estimate gasLimit and gasPrice of the Ethereum transaction. Gas price is obtained from multiple sources + calculated based on the latest N blocks and the current mempool state. * The fast one is used by default.
* Result is calculated in the order of the request array items. *

* * @param requestBody * @param xTestnetType Type of Ethereum testnet. Defaults to ethereum-sepolia. * @returns EthGasEstimationBatch OK * @throws ApiError */ public static ethEstimateGasBatch( requestBody: EthEstimateGasArray, xTestnetType: 'ethereum-sepolia' = 'ethereum-sepolia', ): CancelablePromise { return __request({ method: 'POST', path: `/v3/ethereum/gas/batch`, headers: { 'x-testnet-type': xTestnetType, }, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.`, 401: `Unauthorized. Not valid or inactive subscription key present in the HTTP Header.`, 403: `Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.`, 500: `Internal server error. There was an error on the server while processing the request.`, }, }); } /** * Estimate Polygon transaction fees *

2 credits per API call.


*

Estimate gasLimit and gasPrice of the Polygon transaction. Gas price is obtained from https://gasstation-mainnet.matic.network/. *

* * @param requestBody * @returns any OK * @throws ApiError */ public static polygonEstimateGas( requestBody: PolygonEstimateGas, ): CancelablePromise<{ /** * Gas limit for transaction in gas price. */ gasLimit: string; /** * Gas price in wei. */ gasPrice: string; }> { return __request({ method: 'POST', path: `/v3/polygon/gas`, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.`, 401: `Unauthorized. Not valid or inactive subscription key present in the HTTP Header.`, 403: `Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.`, 500: `Internal server error. There was an error on the server while processing the request.`, }, }); } /** * Estimate Celo Chain transaction fees *

2 credits per API call.


*

Estimate gasLimit and gasPrice of the CELO transaction. Gas price is obtained from https://explorer.bitquery.io/celo_rc1/gas. *

* * @param requestBody * @returns any OK * @throws ApiError */ public static celoEstimateGas( requestBody: CeloEstimateGas, ): CancelablePromise<{ /** * Gas limit for transaction in gas price. */ gasLimit: number; /** * Gas price in wei. */ gasPrice: string; }> { return __request({ method: 'POST', path: `/v3/celo/gas`, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.`, 401: `Unauthorized. Not valid or inactive subscription key present in the HTTP Header.`, 403: `Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.`, 500: `Internal server error. There was an error on the server while processing the request.`, }, }); } /** * Estimate BNB Smart Chain transaction fees *

2 credits per API call.


*

Estimate gasLimit and gasPrice of the BSC transaction. Gas price is obtained from https://explorer.bitquery.io/bsc/gas. *

* * @param requestBody * @returns any OK * @throws ApiError */ public static bscEstimateGas( requestBody: BscEstimateGas, ): CancelablePromise<{ /** * Gas limit for transaction in gas price. */ gasLimit: string; /** * Gas price in wei. */ gasPrice: string; }> { return __request({ method: 'POST', path: `/v3/bsc/gas`, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.`, 401: `Unauthorized. Not valid or inactive subscription key present in the HTTP Header.`, 403: `Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.`, 500: `Internal server error. There was an error on the server while processing the request.`, }, }); } /** * Estimate Klaytn transaction fees *

2 credits per API call.


*

Estimate gasLimit and gasPrice of the Klaytn transaction. Gas price is obtained from https://explorer.bitquery.io/klaytn/gas. *

* * @param requestBody * @returns any OK * @throws ApiError */ public static klaytnEstimateGas( requestBody: KlaytnEstimateGas, ): CancelablePromise<{ /** * Gas limit for transaction in gas price. */ gasLimit: string; /** * Gas price in peb. */ gasPrice: string; }> { return __request({ method: 'POST', path: `/v3/klaytn/gas`, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.`, 401: `Unauthorized. Not valid or inactive subscription key present in the HTTP Header.`, 403: `Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.`, 500: `Internal server error. There was an error on the server while processing the request.`, }, }); } /** * Estimate XinFin transaction fees *

2 credits per API call.


*

Estimate gasLimit and gasPrice of the XDC transaction. Gas price is obtained from https://rpc.xinfin.network/gasPrice. *

* * @param requestBody * @returns any OK * @throws ApiError */ public static xdcEstimateGas( requestBody: XdcEstimateGas, ): CancelablePromise<{ /** * Gas limit for transaction in gas price. */ gasLimit: string; /** * Gas price in wei. */ gasPrice: string; }> { return __request({ method: 'POST', path: `/v3/xdc/gas`, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.`, 401: `Unauthorized. Not valid or inactive subscription key present in the HTTP Header.`, 403: `Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.`, 500: `Internal server error. There was an error on the server while processing the request.`, }, }); } /** * Estimate KuCoin Community Chain transaction fees *

2 credits per API call.


*

Estimate gasLimit and gasPrice of the Kcs transaction. *

* * @param requestBody * @returns any OK * @throws ApiError */ public static kcsEstimateGas( requestBody: KcsEstimateGas, ): CancelablePromise<{ /** * Gas limit for transaction in gas price. */ gasLimit: string; /** * Gas price in wei. */ gasPrice: string; }> { return __request({ method: 'POST', path: `/v3/kcs/gas`, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.`, 401: `Unauthorized. Not valid or inactive subscription key present in the HTTP Header.`, 403: `Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.`, 500: `Internal server error. There was an error on the server while processing the request.`, }, }); } /** * Estimate VeChain Gas for transaction *

5 credits per API call.


Estimate gas required for transaction.

* @param requestBody * @returns number OK * @throws ApiError */ public static vetEstimateGas( requestBody: VetEstimateGas, ): CancelablePromise { return __request({ method: 'POST', path: `/v3/vet/transaction/gas`, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.`, 401: `Unauthorized. Not valid or inactive subscription key present in the HTTP Header.`, 403: `Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.`, 500: `Internal server error. There was an error on the server while processing the request.`, }, }); } /** * Estimate EGLD transaction fees *

2 credits per API call.


*

Estimate gasLimit and gasPrice of the EGLD transaction. Gas limit is obtained from https://gateway.elrond.com/transaction/cost. * Gas price is obtained from https://gateway.elrond.com/network/config. *

* * @param requestBody * @returns any OK * @throws ApiError */ public static egldEstimateGas( requestBody: TransactionFeeEgldBlockchain, ): CancelablePromise<{ /** * Gas limit for transaction in gas price. */ gasLimit: number; /** * Gas price. */ gasPrice: number; }> { return __request({ method: 'POST', path: `/v3/egld/gas`, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.`, 401: `Unauthorized. Not valid or inactive subscription key present in the HTTP Header.`, 403: `Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.`, 500: `Internal server error. There was an error on the server while processing the request.`, }, }); } }