@hubbleprotocol/carpool-typescript-client
Version:
OpenAPI TypeScript client for Carpool
861 lines (792 loc) • 81.8 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* Carpool Query
* The Carpool Query API
*
* OpenAPI spec version: 1.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
import { Configuration } from '../configuration';
// Some imports not used depending on template conditions
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
import { InstructionAggregateRequest } from '../models';
import { InstructionSearchRequest } from '../models';
/**
* InstructionsApi - axios parameter creator
* @export
*/
export const InstructionsApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* See <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html\" target=\"_blank\">the Elasticsearch docs</a> for a list of aggregations. <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html#filter-context\" target=\"_blank\">Queries</a> and slots can be used to narrow aggregation range.
* @summary Perform aggregations of instructions of a program.
* @param {InstructionAggregateRequest} body
* @param {string} xApiKey
* @param {string} programId
* @param {string} instructionName
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
instructionsControllerAggregateInstructions: async (body: InstructionAggregateRequest, xApiKey: string, programId: string, instructionName: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError('body','Required parameter body was null or undefined when calling instructionsControllerAggregateInstructions.');
}
// verify required parameter 'xApiKey' is not null or undefined
if (xApiKey === null || xApiKey === undefined) {
throw new RequiredError('xApiKey','Required parameter xApiKey was null or undefined when calling instructionsControllerAggregateInstructions.');
}
// verify required parameter 'programId' is not null or undefined
if (programId === null || programId === undefined) {
throw new RequiredError('programId','Required parameter programId was null or undefined when calling instructionsControllerAggregateInstructions.');
}
// verify required parameter 'instructionName' is not null or undefined
if (instructionName === null || instructionName === undefined) {
throw new RequiredError('instructionName','Required parameter instructionName was null or undefined when calling instructionsControllerAggregateInstructions.');
}
const localVarPath = `/devnet/instructions/{programId}/aggregate/{instructionName}`
.replace(`{${"programId"}}`, encodeURIComponent(String(programId)))
.replace(`{${"instructionName"}}`, encodeURIComponent(String(instructionName)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (xApiKey !== undefined && xApiKey !== null) {
localVarHeaderParameter['x-api-key'] = String(xApiKey);
}
localVarHeaderParameter['Content-Type'] = 'application/json';
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
* See <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html\" target=\"_blank\">the Elasticsearch docs</a> for a list of aggregations. <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html#filter-context\" target=\"_blank\">Queries</a> and slots can be used to narrow aggregation range.
* @summary Perform aggregations of instructions of a program.
* @param {InstructionAggregateRequest} body
* @param {string} xApiKey
* @param {string} programId
* @param {string} instructionName
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
instructionsControllerAggregateInstructions_1: async (body: InstructionAggregateRequest, xApiKey: string, programId: string, instructionName: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError('body','Required parameter body was null or undefined when calling instructionsControllerAggregateInstructions_1.');
}
// verify required parameter 'xApiKey' is not null or undefined
if (xApiKey === null || xApiKey === undefined) {
throw new RequiredError('xApiKey','Required parameter xApiKey was null or undefined when calling instructionsControllerAggregateInstructions_1.');
}
// verify required parameter 'programId' is not null or undefined
if (programId === null || programId === undefined) {
throw new RequiredError('programId','Required parameter programId was null or undefined when calling instructionsControllerAggregateInstructions_1.');
}
// verify required parameter 'instructionName' is not null or undefined
if (instructionName === null || instructionName === undefined) {
throw new RequiredError('instructionName','Required parameter instructionName was null or undefined when calling instructionsControllerAggregateInstructions_1.');
}
const localVarPath = `/mainnet/instructions/{programId}/aggregate/{instructionName}`
.replace(`{${"programId"}}`, encodeURIComponent(String(programId)))
.replace(`{${"instructionName"}}`, encodeURIComponent(String(instructionName)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (xApiKey !== undefined && xApiKey !== null) {
localVarHeaderParameter['x-api-key'] = String(xApiKey);
}
localVarHeaderParameter['Content-Type'] = 'application/json';
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
*
* @summary List instructions of a program which involved a particular account.
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountId
* @param {string} [instructionName] A specific instruction name to search though.
* @param {string} [accountName] A particular account field that the account ID should appear in (specified in IDL).
* @param {number} [size] Number of entries to return. Default is 10.
* @param {number} [from] Pagination starting point.
* @param {number} [start] A starting slot for the search (inclusive)
* @param {number} [end] An ending slot for the search (exclusive)
* @param {string} [sort] Slot sort order for results. Defaults to \"desc\".
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
instructionsControllerFindInstructionsWithAccount: async (xApiKey: string, programId: string, accountId: string, instructionName?: string, accountName?: string, size?: number, from?: number, start?: number, end?: number, sort?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'xApiKey' is not null or undefined
if (xApiKey === null || xApiKey === undefined) {
throw new RequiredError('xApiKey','Required parameter xApiKey was null or undefined when calling instructionsControllerFindInstructionsWithAccount.');
}
// verify required parameter 'programId' is not null or undefined
if (programId === null || programId === undefined) {
throw new RequiredError('programId','Required parameter programId was null or undefined when calling instructionsControllerFindInstructionsWithAccount.');
}
// verify required parameter 'accountId' is not null or undefined
if (accountId === null || accountId === undefined) {
throw new RequiredError('accountId','Required parameter accountId was null or undefined when calling instructionsControllerFindInstructionsWithAccount.');
}
const localVarPath = `/devnet/instructions/{programId}/account/{accountId}`
.replace(`{${"programId"}}`, encodeURIComponent(String(programId)))
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (instructionName !== undefined) {
localVarQueryParameter['instructionName'] = instructionName;
}
if (accountName !== undefined) {
localVarQueryParameter['accountName'] = accountName;
}
if (size !== undefined) {
localVarQueryParameter['size'] = size;
}
if (from !== undefined) {
localVarQueryParameter['from'] = from;
}
if (start !== undefined) {
localVarQueryParameter['start'] = start;
}
if (end !== undefined) {
localVarQueryParameter['end'] = end;
}
if (sort !== undefined) {
localVarQueryParameter['sort'] = sort;
}
if (xApiKey !== undefined && xApiKey !== null) {
localVarHeaderParameter['x-api-key'] = String(xApiKey);
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
*
* @summary List instructions of a program which involved a particular account.
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountId
* @param {string} [instructionName] A specific instruction name to search though.
* @param {string} [accountName] A particular account field that the account ID should appear in (specified in IDL).
* @param {number} [size] Number of entries to return. Default is 10.
* @param {number} [from] Pagination starting point.
* @param {number} [start] A starting slot for the search (inclusive)
* @param {number} [end] An ending slot for the search (exclusive)
* @param {string} [sort] Slot sort order for results. Defaults to \"desc\".
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
instructionsControllerFindInstructionsWithAccount_2: async (xApiKey: string, programId: string, accountId: string, instructionName?: string, accountName?: string, size?: number, from?: number, start?: number, end?: number, sort?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'xApiKey' is not null or undefined
if (xApiKey === null || xApiKey === undefined) {
throw new RequiredError('xApiKey','Required parameter xApiKey was null or undefined when calling instructionsControllerFindInstructionsWithAccount_2.');
}
// verify required parameter 'programId' is not null or undefined
if (programId === null || programId === undefined) {
throw new RequiredError('programId','Required parameter programId was null or undefined when calling instructionsControllerFindInstructionsWithAccount_2.');
}
// verify required parameter 'accountId' is not null or undefined
if (accountId === null || accountId === undefined) {
throw new RequiredError('accountId','Required parameter accountId was null or undefined when calling instructionsControllerFindInstructionsWithAccount_2.');
}
const localVarPath = `/mainnet/instructions/{programId}/account/{accountId}`
.replace(`{${"programId"}}`, encodeURIComponent(String(programId)))
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (instructionName !== undefined) {
localVarQueryParameter['instructionName'] = instructionName;
}
if (accountName !== undefined) {
localVarQueryParameter['accountName'] = accountName;
}
if (size !== undefined) {
localVarQueryParameter['size'] = size;
}
if (from !== undefined) {
localVarQueryParameter['from'] = from;
}
if (start !== undefined) {
localVarQueryParameter['start'] = start;
}
if (end !== undefined) {
localVarQueryParameter['end'] = end;
}
if (sort !== undefined) {
localVarQueryParameter['sort'] = sort;
}
if (xApiKey !== undefined && xApiKey !== null) {
localVarHeaderParameter['x-api-key'] = String(xApiKey);
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
*
* @summary List instructions of a program which took place in a particular transaction.
* @param {string} xApiKey
* @param {string} programId
* @param {string} txHash
* @param {string} [instructionName] A specific instruction name to search though.
* @param {number} [size] Number of entries to return. Default is 10.
* @param {number} [from] Pagination starting point.
* @param {string} [sort] Slot sort order for results. Defaults to \"desc\".
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
instructionsControllerGetInstructionsWithHash: async (xApiKey: string, programId: string, txHash: string, instructionName?: string, size?: number, from?: number, sort?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'xApiKey' is not null or undefined
if (xApiKey === null || xApiKey === undefined) {
throw new RequiredError('xApiKey','Required parameter xApiKey was null or undefined when calling instructionsControllerGetInstructionsWithHash.');
}
// verify required parameter 'programId' is not null or undefined
if (programId === null || programId === undefined) {
throw new RequiredError('programId','Required parameter programId was null or undefined when calling instructionsControllerGetInstructionsWithHash.');
}
// verify required parameter 'txHash' is not null or undefined
if (txHash === null || txHash === undefined) {
throw new RequiredError('txHash','Required parameter txHash was null or undefined when calling instructionsControllerGetInstructionsWithHash.');
}
const localVarPath = `/devnet/instructions/{programId}/hash/{txHash}`
.replace(`{${"programId"}}`, encodeURIComponent(String(programId)))
.replace(`{${"txHash"}}`, encodeURIComponent(String(txHash)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (instructionName !== undefined) {
localVarQueryParameter['instructionName'] = instructionName;
}
if (size !== undefined) {
localVarQueryParameter['size'] = size;
}
if (from !== undefined) {
localVarQueryParameter['from'] = from;
}
if (sort !== undefined) {
localVarQueryParameter['sort'] = sort;
}
if (xApiKey !== undefined && xApiKey !== null) {
localVarHeaderParameter['x-api-key'] = String(xApiKey);
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
*
* @summary List instructions of a program which took place in a particular transaction.
* @param {string} xApiKey
* @param {string} programId
* @param {string} txHash
* @param {string} [instructionName] A specific instruction name to search though.
* @param {number} [size] Number of entries to return. Default is 10.
* @param {number} [from] Pagination starting point.
* @param {string} [sort] Slot sort order for results. Defaults to \"desc\".
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
instructionsControllerGetInstructionsWithHash_3: async (xApiKey: string, programId: string, txHash: string, instructionName?: string, size?: number, from?: number, sort?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'xApiKey' is not null or undefined
if (xApiKey === null || xApiKey === undefined) {
throw new RequiredError('xApiKey','Required parameter xApiKey was null or undefined when calling instructionsControllerGetInstructionsWithHash_3.');
}
// verify required parameter 'programId' is not null or undefined
if (programId === null || programId === undefined) {
throw new RequiredError('programId','Required parameter programId was null or undefined when calling instructionsControllerGetInstructionsWithHash_3.');
}
// verify required parameter 'txHash' is not null or undefined
if (txHash === null || txHash === undefined) {
throw new RequiredError('txHash','Required parameter txHash was null or undefined when calling instructionsControllerGetInstructionsWithHash_3.');
}
const localVarPath = `/mainnet/instructions/{programId}/hash/{txHash}`
.replace(`{${"programId"}}`, encodeURIComponent(String(programId)))
.replace(`{${"txHash"}}`, encodeURIComponent(String(txHash)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (instructionName !== undefined) {
localVarQueryParameter['instructionName'] = instructionName;
}
if (size !== undefined) {
localVarQueryParameter['size'] = size;
}
if (from !== undefined) {
localVarQueryParameter['from'] = from;
}
if (sort !== undefined) {
localVarQueryParameter['sort'] = sort;
}
if (xApiKey !== undefined && xApiKey !== null) {
localVarHeaderParameter['x-api-key'] = String(xApiKey);
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
*
* @summary List instructions of a program.
* @param {string} xApiKey
* @param {string} programId
* @param {string} [instructionName] A specific instruction name to search though.
* @param {number} [size] Number of entries to return. Default is 10.
* @param {number} [from] Pagination starting point.
* @param {number} [start] A starting slot for the search (inclusive)
* @param {number} [end] An ending slot for the search (exclusive)
* @param {string} [sort] Slot sort order for results. Defaults to \"desc\".
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
instructionsControllerListInstructions: async (xApiKey: string, programId: string, instructionName?: string, size?: number, from?: number, start?: number, end?: number, sort?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'xApiKey' is not null or undefined
if (xApiKey === null || xApiKey === undefined) {
throw new RequiredError('xApiKey','Required parameter xApiKey was null or undefined when calling instructionsControllerListInstructions.');
}
// verify required parameter 'programId' is not null or undefined
if (programId === null || programId === undefined) {
throw new RequiredError('programId','Required parameter programId was null or undefined when calling instructionsControllerListInstructions.');
}
const localVarPath = `/devnet/instructions/{programId}`
.replace(`{${"programId"}}`, encodeURIComponent(String(programId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (instructionName !== undefined) {
localVarQueryParameter['instructionName'] = instructionName;
}
if (size !== undefined) {
localVarQueryParameter['size'] = size;
}
if (from !== undefined) {
localVarQueryParameter['from'] = from;
}
if (start !== undefined) {
localVarQueryParameter['start'] = start;
}
if (end !== undefined) {
localVarQueryParameter['end'] = end;
}
if (sort !== undefined) {
localVarQueryParameter['sort'] = sort;
}
if (xApiKey !== undefined && xApiKey !== null) {
localVarHeaderParameter['x-api-key'] = String(xApiKey);
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
*
* @summary List instructions of a program.
* @param {string} xApiKey
* @param {string} programId
* @param {string} [instructionName] A specific instruction name to search though.
* @param {number} [size] Number of entries to return. Default is 10.
* @param {number} [from] Pagination starting point.
* @param {number} [start] A starting slot for the search (inclusive)
* @param {number} [end] An ending slot for the search (exclusive)
* @param {string} [sort] Slot sort order for results. Defaults to \"desc\".
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
instructionsControllerListInstructions_4: async (xApiKey: string, programId: string, instructionName?: string, size?: number, from?: number, start?: number, end?: number, sort?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'xApiKey' is not null or undefined
if (xApiKey === null || xApiKey === undefined) {
throw new RequiredError('xApiKey','Required parameter xApiKey was null or undefined when calling instructionsControllerListInstructions_4.');
}
// verify required parameter 'programId' is not null or undefined
if (programId === null || programId === undefined) {
throw new RequiredError('programId','Required parameter programId was null or undefined when calling instructionsControllerListInstructions_4.');
}
const localVarPath = `/mainnet/instructions/{programId}`
.replace(`{${"programId"}}`, encodeURIComponent(String(programId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (instructionName !== undefined) {
localVarQueryParameter['instructionName'] = instructionName;
}
if (size !== undefined) {
localVarQueryParameter['size'] = size;
}
if (from !== undefined) {
localVarQueryParameter['from'] = from;
}
if (start !== undefined) {
localVarQueryParameter['start'] = start;
}
if (end !== undefined) {
localVarQueryParameter['end'] = end;
}
if (sort !== undefined) {
localVarQueryParameter['sort'] = sort;
}
if (xApiKey !== undefined && xApiKey !== null) {
localVarHeaderParameter['x-api-key'] = String(xApiKey);
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
* See <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html#filter-context\" target=\"_blank\">the Elasticsearch docs</a> for a list of query types.
* @summary Search instructions of a program using Elasticsearch DSL.
* @param {InstructionSearchRequest} body
* @param {string} xApiKey
* @param {string} programId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
instructionsControllerSearchInstructions: async (body: InstructionSearchRequest, xApiKey: string, programId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError('body','Required parameter body was null or undefined when calling instructionsControllerSearchInstructions.');
}
// verify required parameter 'xApiKey' is not null or undefined
if (xApiKey === null || xApiKey === undefined) {
throw new RequiredError('xApiKey','Required parameter xApiKey was null or undefined when calling instructionsControllerSearchInstructions.');
}
// verify required parameter 'programId' is not null or undefined
if (programId === null || programId === undefined) {
throw new RequiredError('programId','Required parameter programId was null or undefined when calling instructionsControllerSearchInstructions.');
}
const localVarPath = `/devnet/instructions/{programId}/search`
.replace(`{${"programId"}}`, encodeURIComponent(String(programId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (xApiKey !== undefined && xApiKey !== null) {
localVarHeaderParameter['x-api-key'] = String(xApiKey);
}
localVarHeaderParameter['Content-Type'] = 'application/json';
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
* See <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html#filter-context\" target=\"_blank\">the Elasticsearch docs</a> for a list of query types.
* @summary Search instructions of a program using Elasticsearch DSL.
* @param {InstructionSearchRequest} body
* @param {string} xApiKey
* @param {string} programId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
instructionsControllerSearchInstructions_5: async (body: InstructionSearchRequest, xApiKey: string, programId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError('body','Required parameter body was null or undefined when calling instructionsControllerSearchInstructions_5.');
}
// verify required parameter 'xApiKey' is not null or undefined
if (xApiKey === null || xApiKey === undefined) {
throw new RequiredError('xApiKey','Required parameter xApiKey was null or undefined when calling instructionsControllerSearchInstructions_5.');
}
// verify required parameter 'programId' is not null or undefined
if (programId === null || programId === undefined) {
throw new RequiredError('programId','Required parameter programId was null or undefined when calling instructionsControllerSearchInstructions_5.');
}
const localVarPath = `/mainnet/instructions/{programId}/search`
.replace(`{${"programId"}}`, encodeURIComponent(String(programId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (xApiKey !== undefined && xApiKey !== null) {
localVarHeaderParameter['x-api-key'] = String(xApiKey);
}
localVarHeaderParameter['Content-Type'] = 'application/json';
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
}
};
/**
* InstructionsApi - functional programming interface
* @export
*/
export const InstructionsApiFp = function(configuration?: Configuration) {
return {
/**
* See <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html\" target=\"_blank\">the Elasticsearch docs</a> for a list of aggregations. <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html#filter-context\" target=\"_blank\">Queries</a> and slots can be used to narrow aggregation range.
* @summary Perform aggregations of instructions of a program.
* @param {InstructionAggregateRequest} body
* @param {string} xApiKey
* @param {string} programId
* @param {string} instructionName
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async instructionsControllerAggregateInstructions(body: InstructionAggregateRequest, xApiKey: string, programId: string, instructionName: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await InstructionsApiAxiosParamCreator(configuration).instructionsControllerAggregateInstructions(body, xApiKey, programId, instructionName, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* See <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html\" target=\"_blank\">the Elasticsearch docs</a> for a list of aggregations. <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html#filter-context\" target=\"_blank\">Queries</a> and slots can be used to narrow aggregation range.
* @summary Perform aggregations of instructions of a program.
* @param {InstructionAggregateRequest} body
* @param {string} xApiKey
* @param {string} programId
* @param {string} instructionName
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async instructionsControllerAggregateInstructions_1(body: InstructionAggregateRequest, xApiKey: string, programId: string, instructionName: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await InstructionsApiAxiosParamCreator(configuration).instructionsControllerAggregateInstructions_1(body, xApiKey, programId, instructionName, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary List instructions of a program which involved a particular account.
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountId
* @param {string} [instructionName] A specific instruction name to search though.
* @param {string} [accountName] A particular account field that the account ID should appear in (specified in IDL).
* @param {number} [size] Number of entries to return. Default is 10.
* @param {number} [from] Pagination starting point.
* @param {number} [start] A starting slot for the search (inclusive)
* @param {number} [end] An ending slot for the search (exclusive)
* @param {string} [sort] Slot sort order for results. Defaults to \"desc\".
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async instructionsControllerFindInstructionsWithAccount(xApiKey: string, programId: string, accountId: string, instructionName?: string, accountName?: string, size?: number, from?: number, start?: number, end?: number, sort?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await InstructionsApiAxiosParamCreator(configuration).instructionsControllerFindInstructionsWithAccount(xApiKey, programId, accountId, instructionName, accountName, size, from, start, end, sort, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary List instructions of a program which involved a particular account.
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountId
* @param {string} [instructionName] A specific instruction name to search though.
* @param {string} [accountName] A particular account field that the account ID should appear in (specified in IDL).
* @param {number} [size] Number of entries to return. Default is 10.
* @param {number} [from] Pagination starting point.
* @param {number} [start] A starting slot for the search (inclusive)
* @param {number} [end] An ending slot for the search (exclusive)
* @param {string} [sort] Slot sort order for results. Defaults to \"desc\".
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async instructionsControllerFindInstructionsWithAccount_2(xApiKey: string, programId: string, accountId: string, instructionName?: string, accountName?: string, size?: number, from?: number, start?: number, end?: number, sort?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await InstructionsApiAxiosParamCreator(configuration).instructionsControllerFindInstructionsWithAccount_2(xApiKey, programId, accountId, instructionName, accountName, size, from, start, end, sort, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary List instructions of a program which took place in a particular transaction.
* @param {string} xApiKey
* @param {string} programId
* @param {string} txHash
* @param {string} [instructionName] A specific instruction name to search though.
* @param {number} [size] Number of entries to return. Default is 10.
* @param {number} [from] Pagination starting point.
* @param {string} [sort] Slot sort order for results. Defaults to \"desc\".
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async instructionsControllerGetInstructionsWithHash(xApiKey: string, programId: string, tx