/* tslint:disable */ /* eslint-disable */ /** * Fireblocks API * Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) * * The version of the OpenAPI document: 1.6.2 * Contact: developers@fireblocks.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { Configuration } from '../configuration'; import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; import { convertToFireblocksResponse } from "../response/fireblocksResponse"; // URLSearchParams not necessarily used // @ts-ignore import { URL, URLSearchParams } from 'url'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; import { assertParamExistsAndNotEmpty } from '../utils/validation_utils'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { ContractAbiResponseDto } from '../models'; // @ts-ignore import { ContractAddressResponse } from '../models'; // @ts-ignore import { ContractDataDecodeError } from '../models'; // @ts-ignore import { ContractDataDecodeRequest } from '../models'; // @ts-ignore import { ContractDataDecodedResponse } from '../models'; // @ts-ignore import { ErrorSchema } from '../models'; // @ts-ignore import { ParameterWithValueList } from '../models'; // @ts-ignore import { ReadCallFunctionDto } from '../models'; // @ts-ignore import { TransactionReceiptResponse } from '../models'; // @ts-ignore import { WriteCallFunctionDto } from '../models'; // @ts-ignore import { WriteCallFunctionResponseDto } from '../models'; /** * ContractInteractionsApi - axios parameter creator * @export */ export const ContractInteractionsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Decode a function call data, error, or event log from a deployed contract by blockchain native asset id and contract address. * @summary Decode a function call data, error, or event log * @param {ContractDataDecodeRequest} contractDataDecodeRequest * @param {string} contractAddress The contract\'s onchain address * @param {string} baseAssetId The blockchain native asset identifier * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ decodeContractData: async (contractDataDecodeRequest: ContractDataDecodeRequest, contractAddress: string, baseAssetId: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('decodeContractData', 'contractDataDecodeRequest', contractDataDecodeRequest) assertParamExistsAndNotEmpty('decodeContractData', 'contractAddress', contractAddress) assertParamExistsAndNotEmpty('decodeContractData', 'baseAssetId', baseAssetId) const localVarPath = `/contract_interactions/base_asset_id/{baseAssetId}/contract_address/{contractAddress}/decode` .replace(`{${"contractAddress"}}`, encodeURIComponent(String(contractAddress))) .replace(`{${"baseAssetId"}}`, encodeURIComponent(String(baseAssetId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'decodeContractData'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(contractDataDecodeRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Retrieve the contract address by blockchain native asset ID and transaction hash * @summary Get contract address by transaction hash * @param {string} baseAssetId The blockchain base assetId * @param {string} txHash The transaction hash * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getContractAddress: async (baseAssetId: string, txHash: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getContractAddress', 'baseAssetId', baseAssetId) assertParamExistsAndNotEmpty('getContractAddress', 'txHash', txHash) const localVarPath = `/contract_interactions/base_asset_id/{baseAssetId}/tx_hash/{txHash}` .replace(`{${"baseAssetId"}}`, encodeURIComponent(String(baseAssetId))) .replace(`{${"txHash"}}`, encodeURIComponent(String(txHash))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'getContractAddress'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Return deployed contract\'s ABI by blockchain native asset id and contract address. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, and Viewer. * @summary Return deployed contract\'s ABI * @param {string} contractAddress The contract\'s onchain address * @param {string} baseAssetId The blockchain base assetId * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDeployedContractAbi: async (contractAddress: string, baseAssetId: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getDeployedContractAbi', 'contractAddress', contractAddress) assertParamExistsAndNotEmpty('getDeployedContractAbi', 'baseAssetId', baseAssetId) const localVarPath = `/contract_interactions/base_asset_id/{baseAssetId}/contract_address/{contractAddress}/functions` .replace(`{${"contractAddress"}}`, encodeURIComponent(String(contractAddress))) .replace(`{${"baseAssetId"}}`, encodeURIComponent(String(baseAssetId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'getDeployedContractAbi'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Retrieve the transaction receipt by blockchain native asset ID and transaction hash > **Note** > This functionality is exclusively available for EVM (Ethereum Virtual Machine) compatible chains. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, and Viewer. * @summary Get transaction receipt * @param {string} baseAssetId The blockchain base assetId * @param {string} txHash The transaction hash * @param {*} [options] Override http request option. * @throws {RequiredError} */ getTransactionReceipt: async (baseAssetId: string, txHash: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getTransactionReceipt', 'baseAssetId', baseAssetId) assertParamExistsAndNotEmpty('getTransactionReceipt', 'txHash', txHash) const localVarPath = `/contract_interactions/base_asset_id/{baseAssetId}/tx_hash/{txHash}/receipt` .replace(`{${"baseAssetId"}}`, encodeURIComponent(String(baseAssetId))) .replace(`{${"txHash"}}`, encodeURIComponent(String(txHash))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'getTransactionReceipt'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Call a read function on a deployed contract by blockchain native asset id and contract address * @summary Call a read function on a deployed contract * @param {ReadCallFunctionDto} readCallFunctionDto * @param {string} contractAddress The contract\'s onchain address * @param {string} baseAssetId * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ readCallFunction: async (readCallFunctionDto: ReadCallFunctionDto, contractAddress: string, baseAssetId: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('readCallFunction', 'readCallFunctionDto', readCallFunctionDto) assertParamExistsAndNotEmpty('readCallFunction', 'contractAddress', contractAddress) assertParamExistsAndNotEmpty('readCallFunction', 'baseAssetId', baseAssetId) const localVarPath = `/contract_interactions/base_asset_id/{baseAssetId}/contract_address/{contractAddress}/functions/read` .replace(`{${"contractAddress"}}`, encodeURIComponent(String(contractAddress))) .replace(`{${"baseAssetId"}}`, encodeURIComponent(String(baseAssetId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'readCallFunction'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(readCallFunctionDto, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Call a write function on a deployed contract by blockchain native asset id and contract address. This creates an onchain transaction, thus it is an async operation. It returns a transaction id that can be polled for status check * @summary Call a write function on a deployed contract * @param {WriteCallFunctionDto} writeCallFunctionDto * @param {string} contractAddress The contract\'s onchain address * @param {string} baseAssetId * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ writeCallFunction: async (writeCallFunctionDto: WriteCallFunctionDto, contractAddress: string, baseAssetId: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExists('writeCallFunction', 'writeCallFunctionDto', writeCallFunctionDto) assertParamExistsAndNotEmpty('writeCallFunction', 'contractAddress', contractAddress) assertParamExistsAndNotEmpty('writeCallFunction', 'baseAssetId', baseAssetId) const localVarPath = `/contract_interactions/base_asset_id/{baseAssetId}/contract_address/{contractAddress}/functions/write` .replace(`{${"contractAddress"}}`, encodeURIComponent(String(contractAddress))) .replace(`{${"baseAssetId"}}`, encodeURIComponent(String(baseAssetId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'writeCallFunction'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(writeCallFunctionDto, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * ContractInteractionsApi - functional programming interface * @export */ export const ContractInteractionsApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = ContractInteractionsApiAxiosParamCreator(configuration) return { /** * Decode a function call data, error, or event log from a deployed contract by blockchain native asset id and contract address. * @summary Decode a function call data, error, or event log * @param {ContractDataDecodeRequest} contractDataDecodeRequest * @param {string} contractAddress The contract\'s onchain address * @param {string} baseAssetId The blockchain native asset identifier * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async decodeContractData(contractDataDecodeRequest: ContractDataDecodeRequest, contractAddress: string, baseAssetId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.decodeContractData(contractDataDecodeRequest, contractAddress, baseAssetId, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ContractInteractionsApi.decodeContractData']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Retrieve the contract address by blockchain native asset ID and transaction hash * @summary Get contract address by transaction hash * @param {string} baseAssetId The blockchain base assetId * @param {string} txHash The transaction hash * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getContractAddress(baseAssetId: string, txHash: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getContractAddress(baseAssetId, txHash, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ContractInteractionsApi.getContractAddress']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Return deployed contract\'s ABI by blockchain native asset id and contract address. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, and Viewer. * @summary Return deployed contract\'s ABI * @param {string} contractAddress The contract\'s onchain address * @param {string} baseAssetId The blockchain base assetId * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getDeployedContractAbi(contractAddress: string, baseAssetId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getDeployedContractAbi(contractAddress, baseAssetId, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ContractInteractionsApi.getDeployedContractAbi']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Retrieve the transaction receipt by blockchain native asset ID and transaction hash > **Note** > This functionality is exclusively available for EVM (Ethereum Virtual Machine) compatible chains. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, and Viewer. * @summary Get transaction receipt * @param {string} baseAssetId The blockchain base assetId * @param {string} txHash The transaction hash * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getTransactionReceipt(baseAssetId: string, txHash: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getTransactionReceipt(baseAssetId, txHash, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ContractInteractionsApi.getTransactionReceipt']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Call a read function on a deployed contract by blockchain native asset id and contract address * @summary Call a read function on a deployed contract * @param {ReadCallFunctionDto} readCallFunctionDto * @param {string} contractAddress The contract\'s onchain address * @param {string} baseAssetId * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async readCallFunction(readCallFunctionDto: ReadCallFunctionDto, contractAddress: string, baseAssetId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.readCallFunction(readCallFunctionDto, contractAddress, baseAssetId, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ContractInteractionsApi.readCallFunction']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * Call a write function on a deployed contract by blockchain native asset id and contract address. This creates an onchain transaction, thus it is an async operation. It returns a transaction id that can be polled for status check * @summary Call a write function on a deployed contract * @param {WriteCallFunctionDto} writeCallFunctionDto * @param {string} contractAddress The contract\'s onchain address * @param {string} baseAssetId * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async writeCallFunction(writeCallFunctionDto: WriteCallFunctionDto, contractAddress: string, baseAssetId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.writeCallFunction(writeCallFunctionDto, contractAddress, baseAssetId, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['ContractInteractionsApi.writeCallFunction']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, } }; /** * ContractInteractionsApi - factory interface * @export */ export const ContractInteractionsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = ContractInteractionsApiFp(configuration) return { /** * Decode a function call data, error, or event log from a deployed contract by blockchain native asset id and contract address. * @summary Decode a function call data, error, or event log * @param {ContractInteractionsApiDecodeContractDataRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ decodeContractData(requestParameters: ContractInteractionsApiDecodeContractDataRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.decodeContractData(requestParameters.contractDataDecodeRequest, requestParameters.contractAddress, requestParameters.baseAssetId, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Retrieve the contract address by blockchain native asset ID and transaction hash * @summary Get contract address by transaction hash * @param {ContractInteractionsApiGetContractAddressRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getContractAddress(requestParameters: ContractInteractionsApiGetContractAddressRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getContractAddress(requestParameters.baseAssetId, requestParameters.txHash, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Return deployed contract\'s ABI by blockchain native asset id and contract address. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, and Viewer. * @summary Return deployed contract\'s ABI * @param {ContractInteractionsApiGetDeployedContractAbiRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDeployedContractAbi(requestParameters: ContractInteractionsApiGetDeployedContractAbiRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getDeployedContractAbi(requestParameters.contractAddress, requestParameters.baseAssetId, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Retrieve the transaction receipt by blockchain native asset ID and transaction hash > **Note** > This functionality is exclusively available for EVM (Ethereum Virtual Machine) compatible chains. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, and Viewer. * @summary Get transaction receipt * @param {ContractInteractionsApiGetTransactionReceiptRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getTransactionReceipt(requestParameters: ContractInteractionsApiGetTransactionReceiptRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getTransactionReceipt(requestParameters.baseAssetId, requestParameters.txHash, options).then((request) => request(axios, basePath)); }, /** * Call a read function on a deployed contract by blockchain native asset id and contract address * @summary Call a read function on a deployed contract * @param {ContractInteractionsApiReadCallFunctionRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ readCallFunction(requestParameters: ContractInteractionsApiReadCallFunctionRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.readCallFunction(requestParameters.readCallFunctionDto, requestParameters.contractAddress, requestParameters.baseAssetId, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * Call a write function on a deployed contract by blockchain native asset id and contract address. This creates an onchain transaction, thus it is an async operation. It returns a transaction id that can be polled for status check * @summary Call a write function on a deployed contract * @param {ContractInteractionsApiWriteCallFunctionRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ writeCallFunction(requestParameters: ContractInteractionsApiWriteCallFunctionRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.writeCallFunction(requestParameters.writeCallFunctionDto, requestParameters.contractAddress, requestParameters.baseAssetId, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for decodeContractData operation in ContractInteractionsApi. * @export * @interface ContractInteractionsApiDecodeContractDataRequest */ export interface ContractInteractionsApiDecodeContractDataRequest { /** * * @type {ContractDataDecodeRequest} * @memberof ContractInteractionsApiDecodeContractData */ readonly contractDataDecodeRequest: ContractDataDecodeRequest /** * The contract\'s onchain address * @type {string} * @memberof ContractInteractionsApiDecodeContractData */ readonly contractAddress: string /** * The blockchain native asset identifier * @type {string} * @memberof ContractInteractionsApiDecodeContractData */ readonly baseAssetId: string /** * A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @type {string} * @memberof ContractInteractionsApiDecodeContractData */ readonly idempotencyKey?: string } /** * Request parameters for getContractAddress operation in ContractInteractionsApi. * @export * @interface ContractInteractionsApiGetContractAddressRequest */ export interface ContractInteractionsApiGetContractAddressRequest { /** * The blockchain base assetId * @type {string} * @memberof ContractInteractionsApiGetContractAddress */ readonly baseAssetId: string /** * The transaction hash * @type {string} * @memberof ContractInteractionsApiGetContractAddress */ readonly txHash: string /** * A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @type {string} * @memberof ContractInteractionsApiGetContractAddress */ readonly idempotencyKey?: string } /** * Request parameters for getDeployedContractAbi operation in ContractInteractionsApi. * @export * @interface ContractInteractionsApiGetDeployedContractAbiRequest */ export interface ContractInteractionsApiGetDeployedContractAbiRequest { /** * The contract\'s onchain address * @type {string} * @memberof ContractInteractionsApiGetDeployedContractAbi */ readonly contractAddress: string /** * The blockchain base assetId * @type {string} * @memberof ContractInteractionsApiGetDeployedContractAbi */ readonly baseAssetId: string /** * A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @type {string} * @memberof ContractInteractionsApiGetDeployedContractAbi */ readonly idempotencyKey?: string } /** * Request parameters for getTransactionReceipt operation in ContractInteractionsApi. * @export * @interface ContractInteractionsApiGetTransactionReceiptRequest */ export interface ContractInteractionsApiGetTransactionReceiptRequest { /** * The blockchain base assetId * @type {string} * @memberof ContractInteractionsApiGetTransactionReceipt */ readonly baseAssetId: string /** * The transaction hash * @type {string} * @memberof ContractInteractionsApiGetTransactionReceipt */ readonly txHash: string } /** * Request parameters for readCallFunction operation in ContractInteractionsApi. * @export * @interface ContractInteractionsApiReadCallFunctionRequest */ export interface ContractInteractionsApiReadCallFunctionRequest { /** * * @type {ReadCallFunctionDto} * @memberof ContractInteractionsApiReadCallFunction */ readonly readCallFunctionDto: ReadCallFunctionDto /** * The contract\'s onchain address * @type {string} * @memberof ContractInteractionsApiReadCallFunction */ readonly contractAddress: string /** * * @type {string} * @memberof ContractInteractionsApiReadCallFunction */ readonly baseAssetId: string /** * A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @type {string} * @memberof ContractInteractionsApiReadCallFunction */ readonly idempotencyKey?: string } /** * Request parameters for writeCallFunction operation in ContractInteractionsApi. * @export * @interface ContractInteractionsApiWriteCallFunctionRequest */ export interface ContractInteractionsApiWriteCallFunctionRequest { /** * * @type {WriteCallFunctionDto} * @memberof ContractInteractionsApiWriteCallFunction */ readonly writeCallFunctionDto: WriteCallFunctionDto /** * The contract\'s onchain address * @type {string} * @memberof ContractInteractionsApiWriteCallFunction */ readonly contractAddress: string /** * * @type {string} * @memberof ContractInteractionsApiWriteCallFunction */ readonly baseAssetId: string /** * A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @type {string} * @memberof ContractInteractionsApiWriteCallFunction */ readonly idempotencyKey?: string } /** * ContractInteractionsApi - object-oriented interface * @export * @class ContractInteractionsApi * @extends {BaseAPI} */ export class ContractInteractionsApi extends BaseAPI { /** * Decode a function call data, error, or event log from a deployed contract by blockchain native asset id and contract address. * @summary Decode a function call data, error, or event log * @param {ContractInteractionsApiDecodeContractDataRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ContractInteractionsApi */ public decodeContractData(requestParameters: ContractInteractionsApiDecodeContractDataRequest) { return ContractInteractionsApiFp(this.configuration).decodeContractData(requestParameters.contractDataDecodeRequest, requestParameters.contractAddress, requestParameters.baseAssetId, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Retrieve the contract address by blockchain native asset ID and transaction hash * @summary Get contract address by transaction hash * @param {ContractInteractionsApiGetContractAddressRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ContractInteractionsApi */ public getContractAddress(requestParameters: ContractInteractionsApiGetContractAddressRequest) { return ContractInteractionsApiFp(this.configuration).getContractAddress(requestParameters.baseAssetId, requestParameters.txHash, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Return deployed contract\'s ABI by blockchain native asset id and contract address. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, and Viewer. * @summary Return deployed contract\'s ABI * @param {ContractInteractionsApiGetDeployedContractAbiRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ContractInteractionsApi */ public getDeployedContractAbi(requestParameters: ContractInteractionsApiGetDeployedContractAbiRequest) { return ContractInteractionsApiFp(this.configuration).getDeployedContractAbi(requestParameters.contractAddress, requestParameters.baseAssetId, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Retrieve the transaction receipt by blockchain native asset ID and transaction hash > **Note** > This functionality is exclusively available for EVM (Ethereum Virtual Machine) compatible chains. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, and Viewer. * @summary Get transaction receipt * @param {ContractInteractionsApiGetTransactionReceiptRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ContractInteractionsApi */ public getTransactionReceipt(requestParameters: ContractInteractionsApiGetTransactionReceiptRequest) { return ContractInteractionsApiFp(this.configuration).getTransactionReceipt(requestParameters.baseAssetId, requestParameters.txHash).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Call a read function on a deployed contract by blockchain native asset id and contract address * @summary Call a read function on a deployed contract * @param {ContractInteractionsApiReadCallFunctionRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ContractInteractionsApi */ public readCallFunction(requestParameters: ContractInteractionsApiReadCallFunctionRequest) { return ContractInteractionsApiFp(this.configuration).readCallFunction(requestParameters.readCallFunctionDto, requestParameters.contractAddress, requestParameters.baseAssetId, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * Call a write function on a deployed contract by blockchain native asset id and contract address. This creates an onchain transaction, thus it is an async operation. It returns a transaction id that can be polled for status check * @summary Call a write function on a deployed contract * @param {ContractInteractionsApiWriteCallFunctionRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ContractInteractionsApi */ public writeCallFunction(requestParameters: ContractInteractionsApiWriteCallFunctionRequest) { return ContractInteractionsApiFp(this.configuration).writeCallFunction(requestParameters.writeCallFunctionDto, requestParameters.contractAddress, requestParameters.baseAssetId, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } }