UNPKG

@openzeppelin/relayer-sdk

Version:
793 lines 84.3 kB
/* tslint:disable */ /* eslint-disable */ /** * OpenZeppelin Relayer API * OpenZeppelin Relayer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ 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()); }); }; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setBearerAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore import { BASE_PATH, BaseAPI, operationServerMap } from '../base'; /** * RelayersApi - axios parameter creator * @export */ export const RelayersApiAxiosParamCreator = function (configuration) { return { /** * * @summary Cancels a specific transaction by its ID. * @param {string} relayerId The unique identifier of the relayer * @param {string} transactionId The unique identifier of the transaction * @param {*} [options] Override http request option. * @throws {RequiredError} */ cancelTransaction: (relayerId_1, transactionId_1, ...args_1) => __awaiter(this, [relayerId_1, transactionId_1, ...args_1], void 0, function* (relayerId, transactionId, options = {}) { // verify required parameter 'relayerId' is not null or undefined assertParamExists('cancelTransaction', 'relayerId', relayerId); // verify required parameter 'transactionId' is not null or undefined assertParamExists('cancelTransaction', 'transactionId', transactionId); const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/{transaction_id}` .replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))) .replace(`{${"transaction_id"}}`, encodeURIComponent(String(transactionId))); // 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 = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication bearer_auth required // http bearer authentication required yield setBearerAuthToObject(localVarHeaderParameter, configuration); setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * * @summary Creates a new relayer. * @param {CreateRelayerRequest} createRelayerRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ createRelayer: (createRelayerRequest_1, ...args_1) => __awaiter(this, [createRelayerRequest_1, ...args_1], void 0, function* (createRelayerRequest, options = {}) { // verify required parameter 'createRelayerRequest' is not null or undefined assertParamExists('createRelayer', 'createRelayerRequest', createRelayerRequest); const localVarPath = `/api/v1/relayers`; // 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 = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication bearer_auth required // http bearer authentication required yield setBearerAuthToObject(localVarHeaderParameter, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = serializeDataIfNeeded(createRelayerRequest, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * * @summary Deletes all pending transactions for a specific relayer. * @param {string} relayerId The unique identifier of the relayer * @param {*} [options] Override http request option. * @throws {RequiredError} */ deletePendingTransactions: (relayerId_1, ...args_1) => __awaiter(this, [relayerId_1, ...args_1], void 0, function* (relayerId, options = {}) { // verify required parameter 'relayerId' is not null or undefined assertParamExists('deletePendingTransactions', 'relayerId', relayerId); const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/pending` .replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); // 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 = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication bearer_auth required // http bearer authentication required yield setBearerAuthToObject(localVarHeaderParameter, configuration); setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * * @summary Deletes a relayer by ID. * @param {string} relayerId The unique identifier of the relayer * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteRelayer: (relayerId_1, ...args_1) => __awaiter(this, [relayerId_1, ...args_1], void 0, function* (relayerId, options = {}) { // verify required parameter 'relayerId' is not null or undefined assertParamExists('deleteRelayer', 'relayerId', relayerId); const localVarPath = `/api/v1/relayers/{relayer_id}` .replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); // 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 = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication bearer_auth required // http bearer authentication required yield setBearerAuthToObject(localVarHeaderParameter, configuration); setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * * @summary Retrieves details of a specific relayer by ID. * @param {string} relayerId The unique identifier of the relayer * @param {*} [options] Override http request option. * @throws {RequiredError} */ getRelayer: (relayerId_1, ...args_1) => __awaiter(this, [relayerId_1, ...args_1], void 0, function* (relayerId, options = {}) { // verify required parameter 'relayerId' is not null or undefined assertParamExists('getRelayer', 'relayerId', relayerId); const localVarPath = `/api/v1/relayers/{relayer_id}` .replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); // 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 = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication bearer_auth required // http bearer authentication required yield setBearerAuthToObject(localVarHeaderParameter, configuration); setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * * @summary Retrieves the balance of a specific relayer. * @param {string} relayerId The unique identifier of the relayer * @param {*} [options] Override http request option. * @throws {RequiredError} */ getRelayerBalance: (relayerId_1, ...args_1) => __awaiter(this, [relayerId_1, ...args_1], void 0, function* (relayerId, options = {}) { // verify required parameter 'relayerId' is not null or undefined assertParamExists('getRelayerBalance', 'relayerId', relayerId); const localVarPath = `/api/v1/relayers/{relayer_id}/balance` .replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); // 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 = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication bearer_auth required // http bearer authentication required yield setBearerAuthToObject(localVarHeaderParameter, configuration); setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * * @summary Fetches the current status of a specific relayer. * @param {string} relayerId The unique identifier of the relayer * @param {*} [options] Override http request option. * @throws {RequiredError} */ getRelayerStatus: (relayerId_1, ...args_1) => __awaiter(this, [relayerId_1, ...args_1], void 0, function* (relayerId, options = {}) { // verify required parameter 'relayerId' is not null or undefined assertParamExists('getRelayerStatus', 'relayerId', relayerId); const localVarPath = `/api/v1/relayers/{relayer_id}/status` .replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); // 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 = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication bearer_auth required // http bearer authentication required yield setBearerAuthToObject(localVarHeaderParameter, configuration); setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * * @summary Retrieves a specific transaction by its ID. * @param {string} relayerId The unique identifier of the relayer * @param {string} transactionId The unique identifier of the transaction * @param {*} [options] Override http request option. * @throws {RequiredError} */ getTransactionById: (relayerId_1, transactionId_1, ...args_1) => __awaiter(this, [relayerId_1, transactionId_1, ...args_1], void 0, function* (relayerId, transactionId, options = {}) { // verify required parameter 'relayerId' is not null or undefined assertParamExists('getTransactionById', 'relayerId', relayerId); // verify required parameter 'transactionId' is not null or undefined assertParamExists('getTransactionById', 'transactionId', transactionId); const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/{transaction_id}` .replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))) .replace(`{${"transaction_id"}}`, encodeURIComponent(String(transactionId))); // 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 = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication bearer_auth required // http bearer authentication required yield setBearerAuthToObject(localVarHeaderParameter, configuration); setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * * @summary Retrieves a transaction by its nonce value. * @param {string} relayerId The unique identifier of the relayer * @param {number} nonce The nonce of the transaction * @param {*} [options] Override http request option. * @throws {RequiredError} */ getTransactionByNonce: (relayerId_1, nonce_1, ...args_1) => __awaiter(this, [relayerId_1, nonce_1, ...args_1], void 0, function* (relayerId, nonce, options = {}) { // verify required parameter 'relayerId' is not null or undefined assertParamExists('getTransactionByNonce', 'relayerId', relayerId); // verify required parameter 'nonce' is not null or undefined assertParamExists('getTransactionByNonce', 'nonce', nonce); const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/by-nonce/{nonce}` .replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))) .replace(`{${"nonce"}}`, encodeURIComponent(String(nonce))); // 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 = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication bearer_auth required // http bearer authentication required yield setBearerAuthToObject(localVarHeaderParameter, configuration); setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Lists all relayers with pagination support. * @summary Relayer routes implementation * @param {number} [page] Page number for pagination (starts at 1) * @param {number} [perPage] Number of items per page (default: 10) * @param {*} [options] Override http request option. * @throws {RequiredError} */ listRelayers: (page_1, perPage_1, ...args_1) => __awaiter(this, [page_1, perPage_1, ...args_1], void 0, function* (page, perPage, options = {}) { const localVarPath = `/api/v1/relayers`; // 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 = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication bearer_auth required // http bearer authentication required yield setBearerAuthToObject(localVarHeaderParameter, configuration); if (page !== undefined) { localVarQueryParameter['page'] = page; } if (perPage !== undefined) { localVarQueryParameter['per_page'] = perPage; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * * @summary Lists all transactions for a specific relayer with pagination. * @param {string} relayerId The unique identifier of the relayer * @param {number} [page] Page number for pagination (starts at 1) * @param {number} [perPage] Number of items per page (default: 10) * @param {*} [options] Override http request option. * @throws {RequiredError} */ listTransactions: (relayerId_1, page_1, perPage_1, ...args_1) => __awaiter(this, [relayerId_1, page_1, perPage_1, ...args_1], void 0, function* (relayerId, page, perPage, options = {}) { // verify required parameter 'relayerId' is not null or undefined assertParamExists('listTransactions', 'relayerId', relayerId); const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/` .replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); // 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 = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication bearer_auth required // http bearer authentication required yield setBearerAuthToObject(localVarHeaderParameter, configuration); if (page !== undefined) { localVarQueryParameter['page'] = page; } if (perPage !== undefined) { localVarQueryParameter['per_page'] = perPage; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * * @summary Replaces a specific transaction with a new one. * @param {string} relayerId The unique identifier of the relayer * @param {string} transactionId The unique identifier of the transaction * @param {NetworkTransactionRequest} networkTransactionRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ replaceTransaction: (relayerId_1, transactionId_1, networkTransactionRequest_1, ...args_1) => __awaiter(this, [relayerId_1, transactionId_1, networkTransactionRequest_1, ...args_1], void 0, function* (relayerId, transactionId, networkTransactionRequest, options = {}) { // verify required parameter 'relayerId' is not null or undefined assertParamExists('replaceTransaction', 'relayerId', relayerId); // verify required parameter 'transactionId' is not null or undefined assertParamExists('replaceTransaction', 'transactionId', transactionId); // verify required parameter 'networkTransactionRequest' is not null or undefined assertParamExists('replaceTransaction', 'networkTransactionRequest', networkTransactionRequest); const localVarPath = `/api/v1/relayers/{relayer_id}/transactions/{transaction_id}` .replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))) .replace(`{${"transaction_id"}}`, encodeURIComponent(String(transactionId))); // 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 = Object.assign(Object.assign({ method: 'PUT' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication bearer_auth required // http bearer authentication required yield setBearerAuthToObject(localVarHeaderParameter, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = serializeDataIfNeeded(networkTransactionRequest, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * * @summary Performs a JSON-RPC call using the specified relayer. * @param {string} relayerId The unique identifier of the relayer * @param {JsonRpcRequestNetworkRpcRequest} jsonRpcRequestNetworkRpcRequest JSON-RPC request with method and parameters * @param {*} [options] Override http request option. * @throws {RequiredError} */ rpc: (relayerId_1, jsonRpcRequestNetworkRpcRequest_1, ...args_1) => __awaiter(this, [relayerId_1, jsonRpcRequestNetworkRpcRequest_1, ...args_1], void 0, function* (relayerId, jsonRpcRequestNetworkRpcRequest, options = {}) { // verify required parameter 'relayerId' is not null or undefined assertParamExists('rpc', 'relayerId', relayerId); // verify required parameter 'jsonRpcRequestNetworkRpcRequest' is not null or undefined assertParamExists('rpc', 'jsonRpcRequestNetworkRpcRequest', jsonRpcRequestNetworkRpcRequest); const localVarPath = `/api/v1/relayers/{relayer_id}/rpc` .replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); // 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 = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication bearer_auth required // http bearer authentication required yield setBearerAuthToObject(localVarHeaderParameter, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = serializeDataIfNeeded(jsonRpcRequestNetworkRpcRequest, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * * @summary Sends a transaction through the specified relayer. * @param {string} relayerId The unique identifier of the relayer * @param {NetworkTransactionRequest} networkTransactionRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ sendTransaction: (relayerId_1, networkTransactionRequest_1, ...args_1) => __awaiter(this, [relayerId_1, networkTransactionRequest_1, ...args_1], void 0, function* (relayerId, networkTransactionRequest, options = {}) { // verify required parameter 'relayerId' is not null or undefined assertParamExists('sendTransaction', 'relayerId', relayerId); // verify required parameter 'networkTransactionRequest' is not null or undefined assertParamExists('sendTransaction', 'networkTransactionRequest', networkTransactionRequest); const localVarPath = `/api/v1/relayers/{relayer_id}/transactions` .replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); // 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 = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication bearer_auth required // http bearer authentication required yield setBearerAuthToObject(localVarHeaderParameter, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = serializeDataIfNeeded(networkTransactionRequest, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * * @summary Signs data using the specified relayer. * @param {string} relayerId The unique identifier of the relayer * @param {SignDataRequest} signDataRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ sign: (relayerId_1, signDataRequest_1, ...args_1) => __awaiter(this, [relayerId_1, signDataRequest_1, ...args_1], void 0, function* (relayerId, signDataRequest, options = {}) { // verify required parameter 'relayerId' is not null or undefined assertParamExists('sign', 'relayerId', relayerId); // verify required parameter 'signDataRequest' is not null or undefined assertParamExists('sign', 'signDataRequest', signDataRequest); const localVarPath = `/api/v1/relayers/{relayer_id}/sign` .replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); // 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 = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication bearer_auth required // http bearer authentication required yield setBearerAuthToObject(localVarHeaderParameter, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = serializeDataIfNeeded(signDataRequest, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * * @summary Signs a transaction using the specified relayer (Stellar only). * @param {string} relayerId The unique identifier of the relayer * @param {SignTransactionRequest} signTransactionRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ signTransaction: (relayerId_1, signTransactionRequest_1, ...args_1) => __awaiter(this, [relayerId_1, signTransactionRequest_1, ...args_1], void 0, function* (relayerId, signTransactionRequest, options = {}) { // verify required parameter 'relayerId' is not null or undefined assertParamExists('signTransaction', 'relayerId', relayerId); // verify required parameter 'signTransactionRequest' is not null or undefined assertParamExists('signTransaction', 'signTransactionRequest', signTransactionRequest); const localVarPath = `/api/v1/relayers/{relayer_id}/sign-transaction` .replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); // 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 = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication bearer_auth required // http bearer authentication required yield setBearerAuthToObject(localVarHeaderParameter, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = serializeDataIfNeeded(signTransactionRequest, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * * @summary Signs typed data using the specified relayer. * @param {string} relayerId The unique identifier of the relayer * @param {SignTypedDataRequest} signTypedDataRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ signTypedData: (relayerId_1, signTypedDataRequest_1, ...args_1) => __awaiter(this, [relayerId_1, signTypedDataRequest_1, ...args_1], void 0, function* (relayerId, signTypedDataRequest, options = {}) { // verify required parameter 'relayerId' is not null or undefined assertParamExists('signTypedData', 'relayerId', relayerId); // verify required parameter 'signTypedDataRequest' is not null or undefined assertParamExists('signTypedData', 'signTypedDataRequest', signTypedDataRequest); const localVarPath = `/api/v1/relayers/{relayer_id}/sign-typed-data` .replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); // 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 = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication bearer_auth required // http bearer authentication required yield setBearerAuthToObject(localVarHeaderParameter, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = serializeDataIfNeeded(signTypedDataRequest, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * * @summary Updates a relayer\'s information based on the provided update request. * @param {string} relayerId The unique identifier of the relayer * @param {UpdateRelayerRequest} updateRelayerRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateRelayer: (relayerId_1, updateRelayerRequest_1, ...args_1) => __awaiter(this, [relayerId_1, updateRelayerRequest_1, ...args_1], void 0, function* (relayerId, updateRelayerRequest, options = {}) { // verify required parameter 'relayerId' is not null or undefined assertParamExists('updateRelayer', 'relayerId', relayerId); // verify required parameter 'updateRelayerRequest' is not null or undefined assertParamExists('updateRelayer', 'updateRelayerRequest', updateRelayerRequest); const localVarPath = `/api/v1/relayers/{relayer_id}` .replace(`{${"relayer_id"}}`, encodeURIComponent(String(relayerId))); // 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 = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication bearer_auth required // http bearer authentication required yield setBearerAuthToObject(localVarHeaderParameter, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = serializeDataIfNeeded(updateRelayerRequest, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), }; }; /** * RelayersApi - functional programming interface * @export */ export const RelayersApiFp = function (configuration) { const localVarAxiosParamCreator = RelayersApiAxiosParamCreator(configuration); return { /** * * @summary Cancels a specific transaction by its ID. * @param {string} relayerId The unique identifier of the relayer * @param {string} transactionId The unique identifier of the transaction * @param {*} [options] Override http request option. * @throws {RequiredError} */ cancelTransaction(relayerId, transactionId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.cancelTransaction(relayerId, transactionId, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = operationServerMap['RelayersApi.cancelTransaction']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }); }, /** * * @summary Creates a new relayer. * @param {CreateRelayerRequest} createRelayerRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ createRelayer(createRelayerRequest, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.createRelayer(createRelayerRequest, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = operationServerMap['RelayersApi.createRelayer']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }); }, /** * * @summary Deletes all pending transactions for a specific relayer. * @param {string} relayerId The unique identifier of the relayer * @param {*} [options] Override http request option. * @throws {RequiredError} */ deletePendingTransactions(relayerId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.deletePendingTransactions(relayerId, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = operationServerMap['RelayersApi.deletePendingTransactions']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }); }, /** * * @summary Deletes a relayer by ID. * @param {string} relayerId The unique identifier of the relayer * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteRelayer(relayerId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteRelayer(relayerId, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = operationServerMap['RelayersApi.deleteRelayer']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }); }, /** * * @summary Retrieves details of a specific relayer by ID. * @param {string} relayerId The unique identifier of the relayer * @param {*} [options] Override http request option. * @throws {RequiredError} */ getRelayer(relayerId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.getRelayer(relayerId, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = operationServerMap['RelayersApi.getRelayer']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }); }, /** * * @summary Retrieves the balance of a specific relayer. * @param {string} relayerId The unique identifier of the relayer * @param {*} [options] Override http request option. * @throws {RequiredError} */ getRelayerBalance(relayerId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.getRelayerBalance(relayerId, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = operationServerMap['RelayersApi.getRelayerBalance']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }); }, /** * * @summary Fetches the current status of a specific relayer. * @param {string} relayerId The unique identifier of the relayer * @param {*} [options] Override http request option. * @throws {RequiredError} */ getRelayerStatus(relayerId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.getRelayerStatus(relayerId, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = operationServerMap['RelayersApi.getRelayerStatus']) === null || _b === void 0 ? void 0 : _b[localVarOperationSe