@openzeppelin/relayer-sdk
Version:
OpenZeppelin Relayer SDK
777 lines • 86.8 kB
JavaScript
"use strict";
/* 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());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.RelayersApi = exports.RelayersApiFactory = exports.RelayersApiFp = exports.RelayersApiAxiosParamCreator = void 0;
const axios_1 = require("axios");
// Some imports not used depending on template conditions
// @ts-ignore
const common_1 = require("../common");
// @ts-ignore
const base_1 = require("../base");
/**
* RelayersApi - axios parameter creator
* @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
(0, common_1.assertParamExists)('cancelTransaction', 'relayerId', relayerId);
// verify required parameter 'transactionId' is not null or undefined
(0, common_1.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, common_1.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 (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.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
(0, common_1.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, common_1.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 (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createRelayerRequest, localVarRequestOptions, configuration);
return {
url: (0, common_1.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
(0, common_1.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, common_1.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 (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.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
(0, common_1.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, common_1.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 (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.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
(0, common_1.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, common_1.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 (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.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
(0, common_1.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, common_1.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 (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.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
(0, common_1.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, common_1.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 (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.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
(0, common_1.assertParamExists)('getTransactionById', 'relayerId', relayerId);
// verify required parameter 'transactionId' is not null or undefined
(0, common_1.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, common_1.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 (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.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
(0, common_1.assertParamExists)('getTransactionByNonce', 'relayerId', relayerId);
// verify required parameter 'nonce' is not null or undefined
(0, common_1.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, common_1.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 (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.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, common_1.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 (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (perPage !== undefined) {
localVarQueryParameter['per_page'] = perPage;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.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
(0, common_1.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, common_1.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 (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (perPage !== undefined) {
localVarQueryParameter['per_page'] = perPage;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.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
(0, common_1.assertParamExists)('replaceTransaction', 'relayerId', relayerId);
// verify required parameter 'transactionId' is not null or undefined
(0, common_1.assertParamExists)('replaceTransaction', 'transactionId', transactionId);
// verify required parameter 'networkTransactionRequest' is not null or undefined
(0, common_1.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, common_1.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 (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(networkTransactionRequest, localVarRequestOptions, configuration);
return {
url: (0, common_1.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
(0, common_1.assertParamExists)('rpc', 'relayerId', relayerId);
// verify required parameter 'jsonRpcRequestNetworkRpcRequest' is not null or undefined
(0, common_1.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, common_1.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 (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(jsonRpcRequestNetworkRpcRequest, localVarRequestOptions, configuration);
return {
url: (0, common_1.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
(0, common_1.assertParamExists)('sendTransaction', 'relayerId', relayerId);
// verify required parameter 'networkTransactionRequest' is not null or undefined
(0, common_1.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, common_1.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 (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(networkTransactionRequest, localVarRequestOptions, configuration);
return {
url: (0, common_1.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
(0, common_1.assertParamExists)('sign', 'relayerId', relayerId);
// verify required parameter 'signDataRequest' is not null or undefined
(0, common_1.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, common_1.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 (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(signDataRequest, localVarRequestOptions, configuration);
return {
url: (0, common_1.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
(0, common_1.assertParamExists)('signTransaction', 'relayerId', relayerId);
// verify required parameter 'signTransactionRequest' is not null or undefined
(0, common_1.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, common_1.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 (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(signTransactionRequest, localVarRequestOptions, configuration);
return {
url: (0, common_1.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
(0, common_1.assertParamExists)('signTypedData', 'relayerId', relayerId);
// verify required parameter 'signTypedDataRequest' is not null or undefined
(0, common_1.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, common_1.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 (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(signTypedDataRequest, localVarRequestOptions, configuration);
return {
url: (0, common_1.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
(0, common_1.assertParamExists)('updateRelayer', 'relayerId', relayerId);
// verify required parameter 'updateRelayerRequest' is not null or undefined
(0, common_1.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, common_1.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 (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(updateRelayerRequest, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
};
};
exports.RelayersApiAxiosParamCreator = RelayersApiAxiosParamCreator;
/**
* RelayersApi - functional programming interface
* @export
*/
const RelayersApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.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 = base_1.operationServerMap['RelayersApi.cancelTransaction']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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 = base_1.operationServerMap['RelayersApi.createRelayer']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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 = base_1.operationServerMap['RelayersApi.deletePendingTransactions']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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 = base_1.operationServerMap['RelayersApi.deleteRelayer']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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 = base_1.operationServerMap['RelayersApi.getRelayer']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.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, vo