"use strict";
/* 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.
 */
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (this && this.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (g && (g = 0, op[0] && (_ = 0)), _) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContractInteractionsApi = exports.ContractInteractionsApiFactory = exports.ContractInteractionsApiFp = exports.ContractInteractionsApiAxiosParamCreator = void 0;
var axios_1 = __importDefault(require("axios"));
var fireblocksResponse_1 = require("../response/fireblocksResponse");
// URLSearchParams not necessarily used
// @ts-ignore
var url_1 = require("url");
// Some imports not used depending on template conditions
// @ts-ignore
var common_1 = require("../common");
var validation_utils_1 = require("../utils/validation_utils");
// @ts-ignore
var base_1 = require("../base");
/**
 * ContractInteractionsApi - axios parameter creator
 * @export
 */
var ContractInteractionsApiAxiosParamCreator = function (configuration) {
    var _this = this;
    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\&#39;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: function (contractDataDecodeRequest, contractAddress, baseAssetId, idempotencyKey, options) {
            if (options === void 0) { options = {}; }
            return __awaiter(_this, void 0, void 0, function () {
                var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
                return __generator(this, function (_a) {
                    (0, common_1.assertParamExists)('decodeContractData', 'contractDataDecodeRequest', contractDataDecodeRequest);
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('decodeContractData', 'contractAddress', contractAddress);
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('decodeContractData', 'baseAssetId', baseAssetId);
                    localVarPath = "/contract_interactions/base_asset_id/{baseAssetId}/contract_address/{contractAddress}/decode"
                        .replace("{".concat("contractAddress", "}"), encodeURIComponent(String(contractAddress)))
                        .replace("{".concat("baseAssetId", "}"), encodeURIComponent(String(baseAssetId)));
                    localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
                    if (configuration) {
                        baseOptions = configuration.baseOptions;
                    }
                    localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
                    localVarHeaderParameter = {};
                    localVarQueryParameter = {};
                    if (idempotencyKey != null) {
                        localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
                    }
                    localVarHeaderParameter['Content-Type'] = 'application/json';
                    (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
                    headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
                    localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
                    localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(contractDataDecodeRequest, localVarRequestOptions, configuration);
                    return [2 /*return*/, {
                            url: (0, common_1.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: function (baseAssetId, txHash, idempotencyKey, options) {
            if (options === void 0) { options = {}; }
            return __awaiter(_this, void 0, void 0, function () {
                var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
                return __generator(this, function (_a) {
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('getContractAddress', 'baseAssetId', baseAssetId);
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('getContractAddress', 'txHash', txHash);
                    localVarPath = "/contract_interactions/base_asset_id/{baseAssetId}/tx_hash/{txHash}"
                        .replace("{".concat("baseAssetId", "}"), encodeURIComponent(String(baseAssetId)))
                        .replace("{".concat("txHash", "}"), encodeURIComponent(String(txHash)));
                    localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
                    if (configuration) {
                        baseOptions = configuration.baseOptions;
                    }
                    localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
                    localVarHeaderParameter = {};
                    localVarQueryParameter = {};
                    if (idempotencyKey != null) {
                        localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
                    }
                    (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
                    headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
                    localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
                    return [2 /*return*/, {
                            url: (0, common_1.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\&#39;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: function (contractAddress, baseAssetId, idempotencyKey, options) {
            if (options === void 0) { options = {}; }
            return __awaiter(_this, void 0, void 0, function () {
                var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
                return __generator(this, function (_a) {
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('getDeployedContractAbi', 'contractAddress', contractAddress);
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('getDeployedContractAbi', 'baseAssetId', baseAssetId);
                    localVarPath = "/contract_interactions/base_asset_id/{baseAssetId}/contract_address/{contractAddress}/functions"
                        .replace("{".concat("contractAddress", "}"), encodeURIComponent(String(contractAddress)))
                        .replace("{".concat("baseAssetId", "}"), encodeURIComponent(String(baseAssetId)));
                    localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
                    if (configuration) {
                        baseOptions = configuration.baseOptions;
                    }
                    localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
                    localVarHeaderParameter = {};
                    localVarQueryParameter = {};
                    if (idempotencyKey != null) {
                        localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
                    }
                    (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
                    headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
                    localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
                    return [2 /*return*/, {
                            url: (0, common_1.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: function (baseAssetId, txHash, options) {
            if (options === void 0) { options = {}; }
            return __awaiter(_this, void 0, void 0, function () {
                var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
                return __generator(this, function (_a) {
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('getTransactionReceipt', 'baseAssetId', baseAssetId);
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('getTransactionReceipt', 'txHash', txHash);
                    localVarPath = "/contract_interactions/base_asset_id/{baseAssetId}/tx_hash/{txHash}/receipt"
                        .replace("{".concat("baseAssetId", "}"), encodeURIComponent(String(baseAssetId)))
                        .replace("{".concat("txHash", "}"), encodeURIComponent(String(txHash)));
                    localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
                    if (configuration) {
                        baseOptions = configuration.baseOptions;
                    }
                    localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
                    localVarHeaderParameter = {};
                    localVarQueryParameter = {};
                    (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
                    headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
                    localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
                    return [2 /*return*/, {
                            url: (0, common_1.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\&#39;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: function (readCallFunctionDto, contractAddress, baseAssetId, idempotencyKey, options) {
            if (options === void 0) { options = {}; }
            return __awaiter(_this, void 0, void 0, function () {
                var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
                return __generator(this, function (_a) {
                    (0, common_1.assertParamExists)('readCallFunction', 'readCallFunctionDto', readCallFunctionDto);
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('readCallFunction', 'contractAddress', contractAddress);
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('readCallFunction', 'baseAssetId', baseAssetId);
                    localVarPath = "/contract_interactions/base_asset_id/{baseAssetId}/contract_address/{contractAddress}/functions/read"
                        .replace("{".concat("contractAddress", "}"), encodeURIComponent(String(contractAddress)))
                        .replace("{".concat("baseAssetId", "}"), encodeURIComponent(String(baseAssetId)));
                    localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
                    if (configuration) {
                        baseOptions = configuration.baseOptions;
                    }
                    localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
                    localVarHeaderParameter = {};
                    localVarQueryParameter = {};
                    if (idempotencyKey != null) {
                        localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
                    }
                    localVarHeaderParameter['Content-Type'] = 'application/json';
                    (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
                    headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
                    localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
                    localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(readCallFunctionDto, localVarRequestOptions, configuration);
                    return [2 /*return*/, {
                            url: (0, common_1.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\&#39;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: function (writeCallFunctionDto, contractAddress, baseAssetId, idempotencyKey, options) {
            if (options === void 0) { options = {}; }
            return __awaiter(_this, void 0, void 0, function () {
                var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
                return __generator(this, function (_a) {
                    (0, common_1.assertParamExists)('writeCallFunction', 'writeCallFunctionDto', writeCallFunctionDto);
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('writeCallFunction', 'contractAddress', contractAddress);
                    (0, validation_utils_1.assertParamExistsAndNotEmpty)('writeCallFunction', 'baseAssetId', baseAssetId);
                    localVarPath = "/contract_interactions/base_asset_id/{baseAssetId}/contract_address/{contractAddress}/functions/write"
                        .replace("{".concat("contractAddress", "}"), encodeURIComponent(String(contractAddress)))
                        .replace("{".concat("baseAssetId", "}"), encodeURIComponent(String(baseAssetId)));
                    localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
                    if (configuration) {
                        baseOptions = configuration.baseOptions;
                    }
                    localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
                    localVarHeaderParameter = {};
                    localVarQueryParameter = {};
                    if (idempotencyKey != null) {
                        localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
                    }
                    localVarHeaderParameter['Content-Type'] = 'application/json';
                    (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
                    headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
                    localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
                    localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(writeCallFunctionDto, localVarRequestOptions, configuration);
                    return [2 /*return*/, {
                            url: (0, common_1.toPathString)(localVarUrlObj),
                            options: localVarRequestOptions,
                        }];
                });
            });
        },
    };
};
exports.ContractInteractionsApiAxiosParamCreator = ContractInteractionsApiAxiosParamCreator;
/**
 * ContractInteractionsApi - functional programming interface
 * @export
 */
var ContractInteractionsApiFp = function (configuration) {
    var localVarAxiosParamCreator = (0, exports.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\&#39;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: function (contractDataDecodeRequest, contractAddress, baseAssetId, idempotencyKey, options) {
            var _a, _b, _c;
            return __awaiter(this, void 0, void 0, function () {
                var localVarAxiosArgs, index, operationBasePath;
                return __generator(this, function (_d) {
                    switch (_d.label) {
                        case 0: return [4 /*yield*/, localVarAxiosParamCreator.decodeContractData(contractDataDecodeRequest, contractAddress, baseAssetId, idempotencyKey, options)];
                        case 1:
                            localVarAxiosArgs = _d.sent();
                            index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
                            operationBasePath = (_c = (_b = base_1.operationServerMap['ContractInteractionsApi.decodeContractData']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
                            return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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}
         */
        getContractAddress: function (baseAssetId, txHash, idempotencyKey, options) {
            var _a, _b, _c;
            return __awaiter(this, void 0, void 0, function () {
                var localVarAxiosArgs, index, operationBasePath;
                return __generator(this, function (_d) {
                    switch (_d.label) {
                        case 0: return [4 /*yield*/, localVarAxiosParamCreator.getContractAddress(baseAssetId, txHash, idempotencyKey, options)];
                        case 1:
                            localVarAxiosArgs = _d.sent();
                            index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
                            operationBasePath = (_c = (_b = base_1.operationServerMap['ContractInteractionsApi.getContractAddress']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
                            return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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\&#39;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: function (contractAddress, baseAssetId, idempotencyKey, options) {
            var _a, _b, _c;
            return __awaiter(this, void 0, void 0, function () {
                var localVarAxiosArgs, index, operationBasePath;
                return __generator(this, function (_d) {
                    switch (_d.label) {
                        case 0: return [4 /*yield*/, localVarAxiosParamCreator.getDeployedContractAbi(contractAddress, baseAssetId, idempotencyKey, options)];
                        case 1:
                            localVarAxiosArgs = _d.sent();
                            index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
                            operationBasePath = (_c = (_b = base_1.operationServerMap['ContractInteractionsApi.getDeployedContractAbi']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
                            return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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}
         */
        getTransactionReceipt: function (baseAssetId, txHash, options) {
            var _a, _b, _c;
            return __awaiter(this, void 0, void 0, function () {
                var localVarAxiosArgs, index, operationBasePath;
                return __generator(this, function (_d) {
                    switch (_d.label) {
                        case 0: return [4 /*yield*/, localVarAxiosParamCreator.getTransactionReceipt(baseAssetId, txHash, options)];
                        case 1:
                            localVarAxiosArgs = _d.sent();
                            index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
                            operationBasePath = (_c = (_b = base_1.operationServerMap['ContractInteractionsApi.getTransactionReceipt']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
                            return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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\&#39;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: function (readCallFunctionDto, contractAddress, baseAssetId, idempotencyKey, options) {
            var _a, _b, _c;
            return __awaiter(this, void 0, void 0, function () {
                var localVarAxiosArgs, index, operationBasePath;
                return __generator(this, function (_d) {
                    switch (_d.label) {
                        case 0: return [4 /*yield*/, localVarAxiosParamCreator.readCallFunction(readCallFunctionDto, contractAddress, baseAssetId, idempotencyKey, options)];
                        case 1:
                            localVarAxiosArgs = _d.sent();
                            index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
                            operationBasePath = (_c = (_b = base_1.operationServerMap['ContractInteractionsApi.readCallFunction']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
                            return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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\&#39;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: function (writeCallFunctionDto, contractAddress, baseAssetId, idempotencyKey, options) {
            var _a, _b, _c;
            return __awaiter(this, void 0, void 0, function () {
                var localVarAxiosArgs, index, operationBasePath;
                return __generator(this, function (_d) {
                    switch (_d.label) {
                        case 0: return [4 /*yield*/, localVarAxiosParamCreator.writeCallFunction(writeCallFunctionDto, contractAddress, baseAssetId, idempotencyKey, options)];
                        case 1:
                            localVarAxiosArgs = _d.sent();
                            index = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
                            operationBasePath = (_c = (_b = base_1.operationServerMap['ContractInteractionsApi.writeCallFunction']) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.url;
                            return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, operationBasePath || basePath); }];
                    }
                });
            });
        },
    };
};
exports.ContractInteractionsApiFp = ContractInteractionsApiFp;
/**
 * ContractInteractionsApi - factory interface
 * @export
 */
var ContractInteractionsApiFactory = function (configuration, basePath, axios) {
    var localVarFp = (0, exports.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: function (requestParameters, options) {
            return localVarFp.decodeContractData(requestParameters.contractDataDecodeRequest, requestParameters.contractAddress, requestParameters.baseAssetId, requestParameters.idempotencyKey, options).then(function (request) { return 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: function (requestParameters, options) {
            return localVarFp.getContractAddress(requestParameters.baseAssetId, requestParameters.txHash, requestParameters.idempotencyKey, options).then(function (request) { return 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: function (requestParameters, options) {
            return localVarFp.getDeployedContractAbi(requestParameters.contractAddress, requestParameters.baseAssetId, requestParameters.idempotencyKey, options).then(function (request) { return 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: function (requestParameters, options) {
            return localVarFp.getTransactionReceipt(requestParameters.baseAssetId, requestParameters.txHash, options).then(function (request) { return 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: function (requestParameters, options) {
            return localVarFp.readCallFunction(requestParameters.readCallFunctionDto, requestParameters.contractAddress, requestParameters.baseAssetId, requestParameters.idempotencyKey, options).then(function (request) { return 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: function (requestParameters, options) {
            return localVarFp.writeCallFunction(requestParameters.writeCallFunctionDto, requestParameters.contractAddress, requestParameters.baseAssetId, requestParameters.idempotencyKey, options).then(function (request) { return request(axios, basePath); });
        },
    };
};
exports.ContractInteractionsApiFactory = ContractInteractionsApiFactory;
/**
 * ContractInteractionsApi - object-oriented interface
 * @export
 * @class ContractInteractionsApi
 * @extends {BaseAPI}
 */
var ContractInteractionsApi = /** @class */ (function (_super) {
    __extends(ContractInteractionsApi, _super);
    function ContractInteractionsApi() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    /**
     * 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
     */
    ContractInteractionsApi.prototype.decodeContractData = function (requestParameters) {
        var _this = this;
        return (0, exports.ContractInteractionsApiFp)(this.configuration).decodeContractData(requestParameters.contractDataDecodeRequest, requestParameters.contractAddress, requestParameters.baseAssetId, requestParameters.idempotencyKey).then(function (request) { return request(_this.axios, _this.basePath); }).then(fireblocksResponse_1.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
     */
    ContractInteractionsApi.prototype.getContractAddress = function (requestParameters) {
        var _this = this;
        return (0, exports.ContractInteractionsApiFp)(this.configuration).getContractAddress(requestParameters.baseAssetId, requestParameters.txHash, requestParameters.idempotencyKey).then(function (request) { return request(_this.axios, _this.basePath); }).then(fireblocksResponse_1.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
     */
    ContractInteractionsApi.prototype.getDeployedContractAbi = function (requestParameters) {
        var _this = this;
        return (0, exports.ContractInteractionsApiFp)(this.configuration).getDeployedContractAbi(requestParameters.contractAddress, requestParameters.baseAssetId, requestParameters.idempotencyKey).then(function (request) { return request(_this.axios, _this.basePath); }).then(fireblocksResponse_1.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
     */
    ContractInteractionsApi.prototype.getTransactionReceipt = function (requestParameters) {
        var _this = this;
        return (0, exports.ContractInteractionsApiFp)(this.configuration).getTransactionReceipt(requestParameters.baseAssetId, requestParameters.txHash).then(function (request) { return request(_this.axios, _this.basePath); }).then(fireblocksResponse_1.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
     */
    ContractInteractionsApi.prototype.readCallFunction = function (requestParameters) {
        var _this = this;
        return (0, exports.ContractInteractionsApiFp)(this.configuration).readCallFunction(requestParameters.readCallFunctionDto, requestParameters.contractAddress, requestParameters.baseAssetId, requestParameters.idempotencyKey).then(function (request) { return request(_this.axios, _this.basePath); }).then(fireblocksResponse_1.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
     */
    ContractInteractionsApi.prototype.writeCallFunction = function (requestParameters) {
        var _this = this;
        return (0, exports.ContractInteractionsApiFp)(this.configuration).writeCallFunction(requestParameters.writeCallFunctionDto, requestParameters.contractAddress, requestParameters.baseAssetId, requestParameters.idempotencyKey).then(function (request) { return request(_this.axios, _this.basePath); }).then(fireblocksResponse_1.convertToFireblocksResponse);
    };
    return ContractInteractionsApi;
}(base_1.BaseAPI));
exports.ContractInteractionsApi = ContractInteractionsApi;
//# sourceMappingURL=contract-interactions-api.js.map