debank-open-api
Version:
JavaScript library for DeBank OpenAPI
930 lines (882 loc) • 45.3 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* DeBank OpenAPI
* Build for DeFi Developers.
*
* 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, { AxiosPromise, AxiosInstance } 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';
/**
* UserApi - axios parameter creator
* @export
*/
export const UserApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* Get list of protocols with user portfolio details
* @param {string} id User Address
* @param {string} [chainId] ChainID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getUserComplexProtocolList: async (id: string, chainId?: string, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new RequiredError('id','Required parameter id was null or undefined when calling getUserComplexProtocolList.');
}
const localVarPath = `/v1/user/complex_protocol_list`;
// 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 = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (id !== undefined) {
localVarQueryParameter['id'] = id;
}
if (chainId !== undefined) {
localVarQueryParameter['chain_id'] = chainId;
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.query) {
query.set(key, options.query[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,
};
},
/**
* Get user nft list
* @param {string} id Address
* @param {string} chainId ChainID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getUserNftList: async (id: string, chainId: string, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new RequiredError('id','Required parameter id was null or undefined when calling getUserNftList.');
}
// verify required parameter 'chainId' is not null or undefined
if (chainId === null || chainId === undefined) {
throw new RequiredError('chainId','Required parameter chainId was null or undefined when calling getUserNftList.');
}
const localVarPath = `/v1/user/nft_list`;
// 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 = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (id !== undefined) {
localVarQueryParameter['id'] = id;
}
if (chainId !== undefined) {
localVarQueryParameter['chain_id'] = chainId;
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.query) {
query.set(key, options.query[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,
};
},
/**
* Get the user's portfolio in the protocol
* @param {string} id User Address
* @param {string} protocolId protocol id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getUserProtocol: async (id: string, protocolId: string, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new RequiredError('id','Required parameter id was null or undefined when calling getUserProtocol.');
}
// verify required parameter 'protocolId' is not null or undefined
if (protocolId === null || protocolId === undefined) {
throw new RequiredError('protocolId','Required parameter protocolId was null or undefined when calling getUserProtocol.');
}
const localVarPath = `/v1/user/protocol`;
// 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 = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (id !== undefined) {
localVarQueryParameter['id'] = id;
}
if (protocolId !== undefined) {
localVarQueryParameter['protocol_id'] = protocolId;
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.query) {
query.set(key, options.query[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,
};
},
/**
* Stats the user's protocol assets on a chain
* @param {string} id User Address
* @param {string} [chainId] ChainID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getUserSimpleProtocolList: async (id: string, chainId?: string, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new RequiredError('id','Required parameter id was null or undefined when calling getUserSimpleProtocolList.');
}
const localVarPath = `/v1/user/simple_protocol_list`;
// 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 = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (id !== undefined) {
localVarQueryParameter['id'] = id;
}
if (chainId !== undefined) {
localVarQueryParameter['chain_id'] = chainId;
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.query) {
query.set(key, options.query[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,
};
},
/**
* Get user token balance
* @param {string} id Address
* @param {string} tokenId token id
* @param {string} [chainId] ChainID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getUserToken: async (id: string, tokenId: string, chainId?: string, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new RequiredError('id','Required parameter id was null or undefined when calling getUserToken.');
}
// verify required parameter 'tokenId' is not null or undefined
if (tokenId === null || tokenId === undefined) {
throw new RequiredError('tokenId','Required parameter tokenId was null or undefined when calling getUserToken.');
}
const localVarPath = `/v1/user/token`;
// 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 = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (id !== undefined) {
localVarQueryParameter['id'] = id;
}
if (chainId !== undefined) {
localVarQueryParameter['chain_id'] = chainId;
}
if (tokenId !== undefined) {
localVarQueryParameter['token_id'] = tokenId;
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.query) {
query.set(key, options.query[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,
};
},
/**
* Show the user's risk exposure of approved token on a chain
* @param {string} id User Address
* @param {string} chainId ChainID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getUserTokenAuthorizedList: async (id: string, chainId: string, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new RequiredError('id','Required parameter id was null or undefined when calling getUserTokenAuthorizedList.');
}
// verify required parameter 'chainId' is not null or undefined
if (chainId === null || chainId === undefined) {
throw new RequiredError('chainId','Required parameter chainId was null or undefined when calling getUserTokenAuthorizedList.');
}
const localVarPath = `/v1/user/token_authorized_list`;
// 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 = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (id !== undefined) {
localVarQueryParameter['id'] = id;
}
if (chainId !== undefined) {
localVarQueryParameter['chain_id'] = chainId;
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.query) {
query.set(key, options.query[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,
};
},
/**
* Get user token balance
* @param {string} id Address
* @param {string} [chainId] ChainID
* @param {boolean} [isAll] If true, all tokens are returned, including protocol-derived tokens
* @param {boolean} [hasBalance] If true, only token with balance will returned
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getUserTokenList: async (id: string, chainId?: string, isAll?: boolean, hasBalance?: boolean, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new RequiredError('id','Required parameter id was null or undefined when calling getUserTokenList.');
}
const localVarPath = `/v1/user/token_list`;
// 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 = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (id !== undefined) {
localVarQueryParameter['id'] = id;
}
if (chainId !== undefined) {
localVarQueryParameter['chain_id'] = chainId;
}
if (isAll !== undefined) {
localVarQueryParameter['is_all'] = isAll;
}
if (hasBalance !== undefined) {
localVarQueryParameter['has_balance'] = hasBalance;
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.query) {
query.set(key, options.query[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,
};
},
/**
* Get Tokens By Filter
* @param {string} id User Address
* @param {string} q filter args
* @param {string} [chainId] ChainID
* @param {boolean} [hasBalance] If true, only token with balance will returned
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getUserTokenSearch: async (id: string, q: string, chainId?: string, hasBalance?: boolean, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new RequiredError('id','Required parameter id was null or undefined when calling getUserTokenSearch.');
}
// verify required parameter 'q' is not null or undefined
if (q === null || q === undefined) {
throw new RequiredError('q','Required parameter q was null or undefined when calling getUserTokenSearch.');
}
const localVarPath = `/v1/user/token_search`;
// 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 = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (chainId !== undefined) {
localVarQueryParameter['chain_id'] = chainId;
}
if (id !== undefined) {
localVarQueryParameter['id'] = id;
}
if (q !== undefined) {
localVarQueryParameter['q'] = q;
}
if (hasBalance !== undefined) {
localVarQueryParameter['has_balance'] = hasBalance;
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.query) {
query.set(key, options.query[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,
};
},
/**
* Get the net assets of a chain
* @param {string} id User Address
* @param {string} chainId ChainID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getUserTotalBalance: async (id: string, chainId: string, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new RequiredError('id','Required parameter id was null or undefined when calling getUserTotalBalance.');
}
// verify required parameter 'chainId' is not null or undefined
if (chainId === null || chainId === undefined) {
throw new RequiredError('chainId','Required parameter chainId was null or undefined when calling getUserTotalBalance.');
}
const localVarPath = `/v1/user/chain_balance`;
// 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 = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (id !== undefined) {
localVarQueryParameter['id'] = id;
}
if (chainId !== undefined) {
localVarQueryParameter['chain_id'] = chainId;
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.query) {
query.set(key, options.query[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,
};
},
/**
* Get net assets on multiple chains, including tokens and protocols
* @param {string} id User Address
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getUserTotalBalance_1: async (id: string, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new RequiredError('id','Required parameter id was null or undefined when calling getUserTotalBalance_1.');
}
const localVarPath = `/v1/user/total_balance`;
// 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 = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (id !== undefined) {
localVarQueryParameter['id'] = id;
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.query) {
query.set(key, options.query[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,
};
},
}
};
/**
* UserApi - functional programming interface
* @export
*/
export const UserApiFp = function(configuration?: Configuration) {
return {
/**
* Get list of protocols with user portfolio details
* @param {string} id User Address
* @param {string} [chainId] ChainID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getUserComplexProtocolList(id: string, chainId?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).getUserComplexProtocolList(id, chainId, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* Get user nft list
* @param {string} id Address
* @param {string} chainId ChainID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getUserNftList(id: string, chainId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).getUserNftList(id, chainId, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* Get the user's portfolio in the protocol
* @param {string} id User Address
* @param {string} protocolId protocol id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getUserProtocol(id: string, protocolId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).getUserProtocol(id, protocolId, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* Stats the user's protocol assets on a chain
* @param {string} id User Address
* @param {string} [chainId] ChainID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getUserSimpleProtocolList(id: string, chainId?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).getUserSimpleProtocolList(id, chainId, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* Get user token balance
* @param {string} id Address
* @param {string} tokenId token id
* @param {string} [chainId] ChainID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getUserToken(id: string, tokenId: string, chainId?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).getUserToken(id, tokenId, chainId, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* Show the user's risk exposure of approved token on a chain
* @param {string} id User Address
* @param {string} chainId ChainID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getUserTokenAuthorizedList(id: string, chainId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).getUserTokenAuthorizedList(id, chainId, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* Get user token balance
* @param {string} id Address
* @param {string} [chainId] ChainID
* @param {boolean} [isAll] If true, all tokens are returned, including protocol-derived tokens
* @param {boolean} [hasBalance] If true, only token with balance will returned
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getUserTokenList(id: string, chainId?: string, isAll?: boolean, hasBalance?: boolean, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).getUserTokenList(id, chainId, isAll, hasBalance, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* Get Tokens By Filter
* @param {string} id User Address
* @param {string} q filter args
* @param {string} [chainId] ChainID
* @param {boolean} [hasBalance] If true, only token with balance will returned
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getUserTokenSearch(id: string, q: string, chainId?: string, hasBalance?: boolean, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).getUserTokenSearch(id, q, chainId, hasBalance, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* Get the net assets of a chain
* @param {string} id User Address
* @param {string} chainId ChainID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getUserTotalBalance(id: string, chainId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).getUserTotalBalance(id, chainId, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* Get net assets on multiple chains, including tokens and protocols
* @param {string} id User Address
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getUserTotalBalance_1(id: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).getUserTotalBalance_1(id, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
}
};
/**
* UserApi - factory interface
* @export
*/
export const UserApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
return {
/**
* Get list of protocols with user portfolio details
* @param {string} id User Address
* @param {string} [chainId] ChainID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getUserComplexProtocolList(id: string, chainId?: string, options?: any): AxiosPromise<void> {
return UserApiFp(configuration).getUserComplexProtocolList(id, chainId, options).then((request) => request(axios, basePath));
},
/**
* Get user nft list
* @param {string} id Address
* @param {string} chainId ChainID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getUserNftList(id: string, chainId: string, options?: any): AxiosPromise<void> {
return UserApiFp(configuration).getUserNftList(id, chainId, options).then((request) => request(axios, basePath));
},
/**
* Get the user's portfolio in the protocol
* @param {string} id User Address
* @param {string} protocolId protocol id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getUserProtocol(id: string, protocolId: string, options?: any): AxiosPromise<void> {
return UserApiFp(configuration).getUserProtocol(id, protocolId, options).then((request) => request(axios, basePath));
},
/**
* Stats the user's protocol assets on a chain
* @param {string} id User Address
* @param {string} [chainId] ChainID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getUserSimpleProtocolList(id: string, chainId?: string, options?: any): AxiosPromise<void> {
return UserApiFp(configuration).getUserSimpleProtocolList(id, chainId, options).then((request) => request(axios, basePath));
},
/**
* Get user token balance
* @param {string} id Address
* @param {string} tokenId token id
* @param {string} [chainId] ChainID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getUserToken(id: string, tokenId: string, chainId?: string, options?: any): AxiosPromise<void> {
return UserApiFp(configuration).getUserToken(id, tokenId, chainId, options).then((request) => request(axios, basePath));
},
/**
* Show the user's risk exposure of approved token on a chain
* @param {string} id User Address
* @param {string} chainId ChainID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getUserTokenAuthorizedList(id: string, chainId: string, options?: any): AxiosPromise<void> {
return UserApiFp(configuration).getUserTokenAuthorizedList(id, chainId, options).then((request) => request(axios, basePath));
},
/**
* Get user token balance
* @param {string} id Address
* @param {string} [chainId] ChainID
* @param {boolean} [isAll] If true, all tokens are returned, including protocol-derived tokens
* @param {boolean} [hasBalance] If true, only token with balance will returned
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getUserTokenList(id: string, chainId?: string, isAll?: boolean, hasBalance?: boolean, options?: any): AxiosPromise<void> {
return UserApiFp(configuration).getUserTokenList(id, chainId, isAll, hasBalance, options).then((request) => request(axios, basePath));
},
/**
* Get Tokens By Filter
* @param {string} id User Address
* @param {string} q filter args
* @param {string} [chainId] ChainID
* @param {boolean} [hasBalance] If true, only token with balance will returned
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getUserTokenSearch(id: string, q: string, chainId?: string, hasBalance?: boolean, options?: any): AxiosPromise<void> {
return UserApiFp(configuration).getUserTokenSearch(id, q, chainId, hasBalance, options).then((request) => request(axios, basePath));
},
/**
* Get the net assets of a chain
* @param {string} id User Address
* @param {string} chainId ChainID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getUserTotalBalance(id: string, chainId: string, options?: any): AxiosPromise<void> {
return UserApiFp(configuration).getUserTotalBalance(id, chainId, options).then((request) => request(axios, basePath));
},
/**
* Get net assets on multiple chains, including tokens and protocols
* @param {string} id User Address
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getUserTotalBalance_1(id: string, options?: any): AxiosPromise<void> {
return UserApiFp(configuration).getUserTotalBalance_1(id, options).then((request) => request(axios, basePath));
},
};
};
/**
* UserApi - object-oriented interface
* @export
* @class UserApi
* @extends {BaseAPI}
*/
export class UserApi extends BaseAPI {
/**
* Get list of protocols with user portfolio details
* @param {string} id User Address
* @param {string} [chainId] ChainID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UserApi
*/
public getUserComplexProtocolList(id: string, chainId?: string, options?: any) {
return UserApiFp(this.configuration).getUserComplexProtocolList(id, chainId, options).then((request) => request(this.axios, this.basePath));
}
/**
* Get user nft list
* @param {string} id Address
* @param {string} chainId ChainID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UserApi
*/
public getUserNftList(id: string, chainId: string, options?: any) {
return UserApiFp(this.configuration).getUserNftList(id, chainId, options).then((request) => request(this.axios, this.basePath));
}
/**
* Get the user's portfolio in the protocol
* @param {string} id User Address
* @param {string} protocolId protocol id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UserApi
*/
public getUserProtocol(id: string, protocolId: string, options?: any) {
return UserApiFp(this.configuration).getUserProtocol(id, protocolId, options).then((request) => request(this.axios, this.basePath));
}
/**
* Stats the user's protocol assets on a chain
* @param {string} id User Address
* @param {string} [chainId] ChainID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UserApi
*/
public getUserSimpleProtocolList(id: string, chainId?: string, options?: any) {
return UserApiFp(this.configuration).getUserSimpleProtocolList(id, chainId, options).then((request) => request(this.axios, this.basePath));
}
/**
* Get user token balance
* @param {string} id Address
* @param {string} tokenId token id
* @param {string} [chainId] ChainID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UserApi
*/
public getUserToken(id: string, tokenId: string, chainId?: string, options?: any) {
return UserApiFp(this.configuration).getUserToken(id, tokenId, chainId, options).then((request) => request(this.axios, this.basePath));
}
/**
* Show the user's risk exposure of approved token on a chain
* @param {string} id User Address
* @param {string} chainId ChainID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UserApi
*/
public getUserTokenAuthorizedList(id: string, chainId: string, options?: any) {
return UserApiFp(this.configuration).getUserTokenAuthorizedList(id, chainId, options).then((request) => request(this.axios, this.basePath));
}
/**
* Get user token balance
* @param {string} id Address
* @param {string} [chainId] ChainID
* @param {boolean} [isAll] If true, all tokens are returned, including protocol-derived tokens
* @param {boolean} [hasBalance] If true, only token with balance will returned
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UserApi
*/
public getUserTokenList(id: string, chainId?: string, isAll?: boolean, hasBalance?: boolean, options?: any) {
return UserApiFp(this.configuration).getUserTokenList(id, chainId, isAll, hasBalance, options).then((request) => request(this.axios, this.basePath));
}
/**
* Get Tokens By Filter
* @param {string} id User Address
* @param {string} q filter args
* @param {string} [chainId] ChainID
* @param {boolean} [hasBalance] If true, only token with balance will returned
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UserApi
*/
public getUserTokenSearch(id: string, q: string, chainId?: string, hasBalance?: boolean, options?: any) {
return UserApiFp(this.configuration).getUserTokenSearch(id, q, chainId, hasBalance, options).then((request) => request(this.axios, this.basePath));
}
/**
* Get the net assets of a chain
* @param {string} id User Address
* @param {string} chainId ChainID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UserApi
*/
public getUserTotalBalance(id: string, chainId: string, options?: any) {
return UserApiFp(this.configuration).getUserTotalBalance(id, chainId, options).then((request) => request(this.axios, this.basePath));
}
/**
* Get net assets on multiple chains, including tokens and protocols
* @param {string} id User Address
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UserApi
*/
public getUserTotalBalance_1(id: string, options?: any) {
return UserApiFp(this.configuration).getUserTotalBalance_1(id, options).then((request) => request(this.axios, this.basePath));
}
}