/** * App client API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /* tslint:disable:no-unused-variable member-ordering */ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, HttpResponse, HttpEvent, HttpParameterCodec, HttpContext } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; // @ts-ignore import { OpenPoolNotificationSubscriptionRequest } from '../model/openPoolNotificationSubscriptionRequest'; // @ts-ignore import { PartialUnstakeTicket } from '../model/partialUnstakeTicket'; // @ts-ignore import { StakeRequest } from '../model/stakeRequest'; // @ts-ignore import { StakingAccountInfo } from '../model/stakingAccountInfo'; // @ts-ignore import { StakingChartIntervalType } from '../model/stakingChartIntervalType'; // @ts-ignore import { StakingDeposit } from '../model/stakingDeposit'; // @ts-ignore import { StakingDepositAutomationRequest } from '../model/stakingDepositAutomationRequest'; // @ts-ignore import { StakingDepositFundsRequest } from '../model/stakingDepositFundsRequest'; // @ts-ignore import { StakingGetPerformance200ResponseInnerInner } from '../model/stakingGetPerformance200ResponseInnerInner'; // @ts-ignore import { StakingGetTransactions200ResponseInnerInner } from '../model/stakingGetTransactions200ResponseInnerInner'; // @ts-ignore import { StakingPartialUnstakeRequest } from '../model/stakingPartialUnstakeRequest'; // @ts-ignore import { StakingPlan } from '../model/stakingPlan'; // @ts-ignore import { StakingRedeemRequest } from '../model/stakingRedeemRequest'; // @ts-ignore import { StakingRedemptionPolicyInfo } from '../model/stakingRedemptionPolicyInfo'; // @ts-ignore import { StakingRedemptionPolicyType } from '../model/stakingRedemptionPolicyType'; // @ts-ignore import { StakingReward } from '../model/stakingReward'; // @ts-ignore import { StakingStatisticsElement } from '../model/stakingStatisticsElement'; // @ts-ignore import { StakingSubscription } from '../model/stakingSubscription'; // @ts-ignore import { StakingSubscriptionQueueStateResponse } from '../model/stakingSubscriptionQueueStateResponse'; // @ts-ignore import { StakingTransactionType } from '../model/stakingTransactionType'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; @Injectable({ providedIn: 'root' }) export class StakingService { protected basePath = 'http://localhost:5001/v1'; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); public encoder: HttpParameterCodec; constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { if (configuration) { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { if (typeof basePath !== 'string') { basePath = this.basePath; } this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { if (typeof value === "object" && value instanceof Date === false) { httpParams = this.addToHttpParamsRecursive(httpParams, value); } else { httpParams = this.addToHttpParamsRecursive(httpParams, value, key); } return httpParams; } private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { if (value == null) { return httpParams; } if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); } else if (value instanceof Date) { if (key != null) { httpParams = httpParams.append(key, (value as Date).toISOString().substr(0, 10)); } else { throw Error("key may not be null if value is Date"); } } else { Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( httpParams, value[k], key != null ? `${key}.${k}` : k)); } } else if (key != null) { httpParams = httpParams.append(key, value); } else { throw Error("key may not be null if value is not object or array"); } return httpParams; } /** * @param id * @param accountId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public stakingCancelSubscription(id: number, accountId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; public stakingCancelSubscription(id: number, accountId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; public stakingCancelSubscription(id: number, accountId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; public stakingCancelSubscription(id: number, accountId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling stakingCancelSubscription.'); } if (accountId === null || accountId === undefined) { throw new Error('Required parameter accountId was null or undefined when calling stakingCancelSubscription.'); } let localVarQueryParameters = new HttpParams({encoder: this.encoder}); if (accountId !== undefined && accountId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, accountId, 'accountId'); } let localVarHeaders = this.defaultHeaders; let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext: HttpContext | undefined = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } return this.httpClient.post(`${this.configuration.basePath}/user/staking/subscriptions/${encodeURIComponent(String(id))}/cancel`, null, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, reportProgress: reportProgress } ); } /** * @param id * @param accountId * @param stakingDepositFundsRequest * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public stakingDepositFunds(id: number, accountId: number, stakingDepositFundsRequest?: StakingDepositFundsRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; public stakingDepositFunds(id: number, accountId: number, stakingDepositFundsRequest?: StakingDepositFundsRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; public stakingDepositFunds(id: number, accountId: number, stakingDepositFundsRequest?: StakingDepositFundsRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; public stakingDepositFunds(id: number, accountId: number, stakingDepositFundsRequest?: StakingDepositFundsRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling stakingDepositFunds.'); } if (accountId === null || accountId === undefined) { throw new Error('Required parameter accountId was null or undefined when calling stakingDepositFunds.'); } let localVarQueryParameters = new HttpParams({encoder: this.encoder}); if (accountId !== undefined && accountId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, accountId, 'accountId'); } let localVarHeaders = this.defaultHeaders; let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext: HttpContext | undefined = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } // to determine the Content-Type header const consumes: string[] = [ 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } return this.httpClient.post(`${this.configuration.basePath}/user/staking/subscriptions/${encodeURIComponent(String(id))}/deposit`, stakingDepositFundsRequest, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, reportProgress: reportProgress } ); } /** * @param accountId * @param baseFiatId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public stakingGetAccountInfo(accountId: number, baseFiatId?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable; public stakingGetAccountInfo(accountId: number, baseFiatId?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; public stakingGetAccountInfo(accountId: number, baseFiatId?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; public stakingGetAccountInfo(accountId: number, baseFiatId?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { if (accountId === null || accountId === undefined) { throw new Error('Required parameter accountId was null or undefined when calling stakingGetAccountInfo.'); } let localVarQueryParameters = new HttpParams({encoder: this.encoder}); if (accountId !== undefined && accountId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, accountId, 'accountId'); } if (baseFiatId !== undefined && baseFiatId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, baseFiatId, 'baseFiatId'); } let localVarHeaders = this.defaultHeaders; let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts: string[] = [ 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext: HttpContext | undefined = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } return this.httpClient.get(`${this.configuration.basePath}/user/staking/info`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, reportProgress: reportProgress } ); } /** * @param page * @param size * @param accountId * @param productId * @param baseFiatId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public stakingGetAllRewards(page: number, size: number, accountId: number, productId: number, baseFiatId?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; public stakingGetAllRewards(page: number, size: number, accountId: number, productId: number, baseFiatId?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; public stakingGetAllRewards(page: number, size: number, accountId: number, productId: number, baseFiatId?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; public stakingGetAllRewards(page: number, size: number, accountId: number, productId: number, baseFiatId?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { if (page === null || page === undefined) { throw new Error('Required parameter page was null or undefined when calling stakingGetAllRewards.'); } if (size === null || size === undefined) { throw new Error('Required parameter size was null or undefined when calling stakingGetAllRewards.'); } if (accountId === null || accountId === undefined) { throw new Error('Required parameter accountId was null or undefined when calling stakingGetAllRewards.'); } if (productId === null || productId === undefined) { throw new Error('Required parameter productId was null or undefined when calling stakingGetAllRewards.'); } let localVarQueryParameters = new HttpParams({encoder: this.encoder}); if (page !== undefined && page !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, page, 'page'); } if (size !== undefined && size !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, size, 'size'); } if (accountId !== undefined && accountId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, accountId, 'accountId'); } if (productId !== undefined && productId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, productId, 'productId'); } if (baseFiatId !== undefined && baseFiatId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, baseFiatId, 'baseFiatId'); } let localVarHeaders = this.defaultHeaders; let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts: string[] = [ 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext: HttpContext | undefined = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } return this.httpClient.get>(`${this.configuration.basePath}/user/staking/rewards`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, reportProgress: reportProgress } ); } /** * @param accountId * @param interval * @param baseFiatId * @param productIds * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public stakingGetPerformance(accountId: number, interval: StakingChartIntervalType, baseFiatId: number, productIds?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; public stakingGetPerformance(accountId: number, interval: StakingChartIntervalType, baseFiatId: number, productIds?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>>; public stakingGetPerformance(accountId: number, interval: StakingChartIntervalType, baseFiatId: number, productIds?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>>; public stakingGetPerformance(accountId: number, interval: StakingChartIntervalType, baseFiatId: number, productIds?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { if (accountId === null || accountId === undefined) { throw new Error('Required parameter accountId was null or undefined when calling stakingGetPerformance.'); } if (interval === null || interval === undefined) { throw new Error('Required parameter interval was null or undefined when calling stakingGetPerformance.'); } if (baseFiatId === null || baseFiatId === undefined) { throw new Error('Required parameter baseFiatId was null or undefined when calling stakingGetPerformance.'); } let localVarQueryParameters = new HttpParams({encoder: this.encoder}); if (accountId !== undefined && accountId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, accountId, 'accountId'); } if (interval !== undefined && interval !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, interval, 'interval'); } if (baseFiatId !== undefined && baseFiatId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, baseFiatId, 'baseFiatId'); } if (productIds !== undefined && productIds !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, productIds, 'productIds'); } let localVarHeaders = this.defaultHeaders; let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts: string[] = [ 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext: HttpContext | undefined = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } return this.httpClient.get>>(`${this.configuration.basePath}/user/staking/performance`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, reportProgress: reportProgress } ); } /** * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public stakingGetPlans(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; public stakingGetPlans(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; public stakingGetPlans(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; public stakingGetPlans(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { let localVarHeaders = this.defaultHeaders; let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts: string[] = [ 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext: HttpContext | undefined = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } return this.httpClient.get>(`${this.configuration.basePath}/user/staking/plans`, { context: localVarHttpContext, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, reportProgress: reportProgress } ); } /** * @param id * @param policyType * @param accountId * @param unstakeAmount * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public stakingGetRedemptionPolicyInfo(id: number, policyType: StakingRedemptionPolicyType, accountId: number, unstakeAmount?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable; public stakingGetRedemptionPolicyInfo(id: number, policyType: StakingRedemptionPolicyType, accountId: number, unstakeAmount?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; public stakingGetRedemptionPolicyInfo(id: number, policyType: StakingRedemptionPolicyType, accountId: number, unstakeAmount?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; public stakingGetRedemptionPolicyInfo(id: number, policyType: StakingRedemptionPolicyType, accountId: number, unstakeAmount?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling stakingGetRedemptionPolicyInfo.'); } if (policyType === null || policyType === undefined) { throw new Error('Required parameter policyType was null or undefined when calling stakingGetRedemptionPolicyInfo.'); } if (accountId === null || accountId === undefined) { throw new Error('Required parameter accountId was null or undefined when calling stakingGetRedemptionPolicyInfo.'); } let localVarQueryParameters = new HttpParams({encoder: this.encoder}); if (accountId !== undefined && accountId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, accountId, 'accountId'); } if (unstakeAmount !== undefined && unstakeAmount !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, unstakeAmount, 'unstakeAmount'); } let localVarHeaders = this.defaultHeaders; let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts: string[] = [ 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext: HttpContext | undefined = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } return this.httpClient.get(`${this.configuration.basePath}/user/staking/subscriptions/${encodeURIComponent(String(id))}/redemption-policies/${encodeURIComponent(String(policyType))}/info`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, reportProgress: reportProgress } ); } /** * @param accountId * @param baseFiatId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public stakingGetStatistics(accountId: number, baseFiatId?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; public stakingGetStatistics(accountId: number, baseFiatId?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; public stakingGetStatistics(accountId: number, baseFiatId?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; public stakingGetStatistics(accountId: number, baseFiatId?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { if (accountId === null || accountId === undefined) { throw new Error('Required parameter accountId was null or undefined when calling stakingGetStatistics.'); } let localVarQueryParameters = new HttpParams({encoder: this.encoder}); if (accountId !== undefined && accountId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, accountId, 'accountId'); } if (baseFiatId !== undefined && baseFiatId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, baseFiatId, 'baseFiatId'); } let localVarHeaders = this.defaultHeaders; let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts: string[] = [ 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext: HttpContext | undefined = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } return this.httpClient.get>(`${this.configuration.basePath}/user/staking/statistics`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, reportProgress: reportProgress } ); } /** * @param id * @param page * @param size * @param accountId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public stakingGetSubscriptionDeposits(id: number, page: number, size: number, accountId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; public stakingGetSubscriptionDeposits(id: number, page: number, size: number, accountId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; public stakingGetSubscriptionDeposits(id: number, page: number, size: number, accountId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; public stakingGetSubscriptionDeposits(id: number, page: number, size: number, accountId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling stakingGetSubscriptionDeposits.'); } if (page === null || page === undefined) { throw new Error('Required parameter page was null or undefined when calling stakingGetSubscriptionDeposits.'); } if (size === null || size === undefined) { throw new Error('Required parameter size was null or undefined when calling stakingGetSubscriptionDeposits.'); } if (accountId === null || accountId === undefined) { throw new Error('Required parameter accountId was null or undefined when calling stakingGetSubscriptionDeposits.'); } let localVarQueryParameters = new HttpParams({encoder: this.encoder}); if (page !== undefined && page !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, page, 'page'); } if (size !== undefined && size !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, size, 'size'); } if (accountId !== undefined && accountId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, accountId, 'accountId'); } let localVarHeaders = this.defaultHeaders; let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts: string[] = [ 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext: HttpContext | undefined = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } return this.httpClient.get>(`${this.configuration.basePath}/user/staking/subscriptions/${encodeURIComponent(String(id))}/deposits`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, reportProgress: reportProgress } ); } /** * @param id * @param page * @param size * @param accountId * @param baseFiatId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public stakingGetSubscriptionPartialUnstakeTickets(id: number, page: number, size: number, accountId: number, baseFiatId?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; public stakingGetSubscriptionPartialUnstakeTickets(id: number, page: number, size: number, accountId: number, baseFiatId?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; public stakingGetSubscriptionPartialUnstakeTickets(id: number, page: number, size: number, accountId: number, baseFiatId?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; public stakingGetSubscriptionPartialUnstakeTickets(id: number, page: number, size: number, accountId: number, baseFiatId?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling stakingGetSubscriptionPartialUnstakeTickets.'); } if (page === null || page === undefined) { throw new Error('Required parameter page was null or undefined when calling stakingGetSubscriptionPartialUnstakeTickets.'); } if (size === null || size === undefined) { throw new Error('Required parameter size was null or undefined when calling stakingGetSubscriptionPartialUnstakeTickets.'); } if (accountId === null || accountId === undefined) { throw new Error('Required parameter accountId was null or undefined when calling stakingGetSubscriptionPartialUnstakeTickets.'); } let localVarQueryParameters = new HttpParams({encoder: this.encoder}); if (page !== undefined && page !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, page, 'page'); } if (size !== undefined && size !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, size, 'size'); } if (accountId !== undefined && accountId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, accountId, 'accountId'); } if (baseFiatId !== undefined && baseFiatId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, baseFiatId, 'baseFiatId'); } let localVarHeaders = this.defaultHeaders; let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts: string[] = [ 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext: HttpContext | undefined = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } return this.httpClient.get>(`${this.configuration.basePath}/user/staking/subscriptions/${encodeURIComponent(String(id))}/partial-unstake-tickets`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, reportProgress: reportProgress } ); } /** * @param id * @param page * @param size * @param accountId * @param baseFiatId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public stakingGetSubscriptionRewards(id: number, page: number, size: number, accountId: number, baseFiatId?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; public stakingGetSubscriptionRewards(id: number, page: number, size: number, accountId: number, baseFiatId?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; public stakingGetSubscriptionRewards(id: number, page: number, size: number, accountId: number, baseFiatId?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; public stakingGetSubscriptionRewards(id: number, page: number, size: number, accountId: number, baseFiatId?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling stakingGetSubscriptionRewards.'); } if (page === null || page === undefined) { throw new Error('Required parameter page was null or undefined when calling stakingGetSubscriptionRewards.'); } if (size === null || size === undefined) { throw new Error('Required parameter size was null or undefined when calling stakingGetSubscriptionRewards.'); } if (accountId === null || accountId === undefined) { throw new Error('Required parameter accountId was null or undefined when calling stakingGetSubscriptionRewards.'); } let localVarQueryParameters = new HttpParams({encoder: this.encoder}); if (page !== undefined && page !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, page, 'page'); } if (size !== undefined && size !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, size, 'size'); } if (accountId !== undefined && accountId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, accountId, 'accountId'); } if (baseFiatId !== undefined && baseFiatId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, baseFiatId, 'baseFiatId'); } let localVarHeaders = this.defaultHeaders; let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts: string[] = [ 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext: HttpContext | undefined = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } return this.httpClient.get>(`${this.configuration.basePath}/user/staking/subscriptions/${encodeURIComponent(String(id))}/rewards`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, reportProgress: reportProgress } ); } /** * @param accountId * @param page * @param size * @param baseFiatId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public stakingGetSubscriptions(accountId: number, page?: number, size?: number, baseFiatId?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; public stakingGetSubscriptions(accountId: number, page?: number, size?: number, baseFiatId?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; public stakingGetSubscriptions(accountId: number, page?: number, size?: number, baseFiatId?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; public stakingGetSubscriptions(accountId: number, page?: number, size?: number, baseFiatId?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { if (accountId === null || accountId === undefined) { throw new Error('Required parameter accountId was null or undefined when calling stakingGetSubscriptions.'); } let localVarQueryParameters = new HttpParams({encoder: this.encoder}); if (accountId !== undefined && accountId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, accountId, 'accountId'); } if (page !== undefined && page !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, page, 'page'); } if (size !== undefined && size !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, size, 'size'); } if (baseFiatId !== undefined && baseFiatId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, baseFiatId, 'baseFiatId'); } let localVarHeaders = this.defaultHeaders; let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts: string[] = [ 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext: HttpContext | undefined = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } return this.httpClient.get>(`${this.configuration.basePath}/user/staking/subscriptions`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, reportProgress: reportProgress } ); } /** * @param accountId * @param ids * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public stakingGetSubscriptionsQueueState(accountId: number, ids?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; public stakingGetSubscriptionsQueueState(accountId: number, ids?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; public stakingGetSubscriptionsQueueState(accountId: number, ids?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; public stakingGetSubscriptionsQueueState(accountId: number, ids?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { if (accountId === null || accountId === undefined) { throw new Error('Required parameter accountId was null or undefined when calling stakingGetSubscriptionsQueueState.'); } let localVarQueryParameters = new HttpParams({encoder: this.encoder}); if (accountId !== undefined && accountId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, accountId, 'accountId'); } if (ids !== undefined && ids !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, ids, 'ids'); } let localVarHeaders = this.defaultHeaders; let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts: string[] = [ 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext: HttpContext | undefined = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } return this.httpClient.get>(`${this.configuration.basePath}/user/staking/queue-state`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, reportProgress: reportProgress } ); } /** * @param page * @param size * @param accountId * @param type * @param currency * @param from * @param to * @param timezoneOffset * @param baseFiatId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public stakingGetTransactions(page: number, size: number, accountId: number, type?: StakingTransactionType, currency?: number, from?: string, to?: string, timezoneOffset?: number, baseFiatId?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; public stakingGetTransactions(page: number, size: number, accountId: number, type?: StakingTransactionType, currency?: number, from?: string, to?: string, timezoneOffset?: number, baseFiatId?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>>; public stakingGetTransactions(page: number, size: number, accountId: number, type?: StakingTransactionType, currency?: number, from?: string, to?: string, timezoneOffset?: number, baseFiatId?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>>; public stakingGetTransactions(page: number, size: number, accountId: number, type?: StakingTransactionType, currency?: number, from?: string, to?: string, timezoneOffset?: number, baseFiatId?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { if (page === null || page === undefined) { throw new Error('Required parameter page was null or undefined when calling stakingGetTransactions.'); } if (size === null || size === undefined) { throw new Error('Required parameter size was null or undefined when calling stakingGetTransactions.'); } if (accountId === null || accountId === undefined) { throw new Error('Required parameter accountId was null or undefined when calling stakingGetTransactions.'); } let localVarQueryParameters = new HttpParams({encoder: this.encoder}); if (page !== undefined && page !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, page, 'page'); } if (size !== undefined && size !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, size, 'size'); } if (accountId !== undefined && accountId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, accountId, 'accountId'); } if (type !== undefined && type !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, type, 'type'); } if (currency !== undefined && currency !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, currency, 'currency'); } if (from !== undefined && from !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, from, 'from'); } if (to !== undefined && to !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, to, 'to'); } if (timezoneOffset !== undefined && timezoneOffset !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, timezoneOffset, 'timezoneOffset'); } if (baseFiatId !== undefined && baseFiatId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, baseFiatId, 'baseFiatId'); } let localVarHeaders = this.defaultHeaders; let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts: string[] = [ 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext: HttpContext | undefined = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } return this.httpClient.get>>(`${this.configuration.basePath}/user/staking/transactions`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, reportProgress: reportProgress } ); } /** * @param accountId * @param id * @param stakingPartialUnstakeRequest * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public stakingPartialUnstake(accountId: number, id: number, stakingPartialUnstakeRequest?: StakingPartialUnstakeRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; public stakingPartialUnstake(accountId: number, id: number, stakingPartialUnstakeRequest?: StakingPartialUnstakeRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; public stakingPartialUnstake(accountId: number, id: number, stakingPartialUnstakeRequest?: StakingPartialUnstakeRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; public stakingPartialUnstake(accountId: number, id: number, stakingPartialUnstakeRequest?: StakingPartialUnstakeRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { if (accountId === null || accountId === undefined) { throw new Error('Required parameter accountId was null or undefined when calling stakingPartialUnstake.'); } if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling stakingPartialUnstake.'); } let localVarQueryParameters = new HttpParams({encoder: this.encoder}); if (accountId !== undefined && accountId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, accountId, 'accountId'); } let localVarHeaders = this.defaultHeaders; let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext: HttpContext | undefined = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } // to determine the Content-Type header const consumes: string[] = [ 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } return this.httpClient.post(`${this.configuration.basePath}/user/staking/subscriptions/${encodeURIComponent(String(id))}/partial-unstake`, stakingPartialUnstakeRequest, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, reportProgress: reportProgress } ); } /** * @param id * @param accountId * @param stakingRedeemRequest * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public stakingRedeem(id: number, accountId: number, stakingRedeemRequest?: StakingRedeemRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; public stakingRedeem(id: number, accountId: number, stakingRedeemRequest?: StakingRedeemRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; public stakingRedeem(id: number, accountId: number, stakingRedeemRequest?: StakingRedeemRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; public stakingRedeem(id: number, accountId: number, stakingRedeemRequest?: StakingRedeemRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling stakingRedeem.'); } if (accountId === null || accountId === undefined) { throw new Error('Required parameter accountId was null or undefined when calling stakingRedeem.'); } let localVarQueryParameters = new HttpParams({encoder: this.encoder}); if (accountId !== undefined && accountId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, accountId, 'accountId'); } let localVarHeaders = this.defaultHeaders; let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext: HttpContext | undefined = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } // to determine the Content-Type header const consumes: string[] = [ 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } return this.httpClient.post(`${this.configuration.basePath}/user/staking/subscriptions/${encodeURIComponent(String(id))}/redeem`, stakingRedeemRequest, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, reportProgress: reportProgress } ); } /** * @param id * @param accountId * @param baseFiatId * @param stakingDepositAutomationRequest * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public stakingSetDepositAutomation(id: number, accountId: number, baseFiatId?: number, stakingDepositAutomationRequest?: StakingDepositAutomationRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable; public stakingSetDepositAutomation(id: number, accountId: number, baseFiatId?: number, stakingDepositAutomationRequest?: StakingDepositAutomationRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; public stakingSetDepositAutomation(id: number, accountId: number, baseFiatId?: number, stakingDepositAutomationRequest?: StakingDepositAutomationRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; public stakingSetDepositAutomation(id: number, accountId: number, baseFiatId?: number, stakingDepositAutomationRequest?: StakingDepositAutomationRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling stakingSetDepositAutomation.'); } if (accountId === null || accountId === undefined) { throw new Error('Required parameter accountId was null or undefined when calling stakingSetDepositAutomation.'); } let localVarQueryParameters = new HttpParams({encoder: this.encoder}); if (accountId !== undefined && accountId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, accountId, 'accountId'); } if (baseFiatId !== undefined && baseFiatId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, baseFiatId, 'baseFiatId'); } let localVarHeaders = this.defaultHeaders; let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts: string[] = [ 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext: HttpContext | undefined = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } // to determine the Content-Type header const consumes: string[] = [ 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } return this.httpClient.post(`${this.configuration.basePath}/user/staking/subscriptions/${encodeURIComponent(String(id))}/deposit-automation`, stakingDepositAutomationRequest, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, reportProgress: reportProgress } ); } /** * @param accountId * @param baseFiatId * @param stakeRequest * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public stakingStake(accountId: number, baseFiatId?: number, stakeRequest?: StakeRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable; public stakingStake(accountId: number, baseFiatId?: number, stakeRequest?: StakeRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; public stakingStake(accountId: number, baseFiatId?: number, stakeRequest?: StakeRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; public stakingStake(accountId: number, baseFiatId?: number, stakeRequest?: StakeRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { if (accountId === null || accountId === undefined) { throw new Error('Required parameter accountId was null or undefined when calling stakingStake.'); } let localVarQueryParameters = new HttpParams({encoder: this.encoder}); if (accountId !== undefined && accountId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, accountId, 'accountId'); } if (baseFiatId !== undefined && baseFiatId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, baseFiatId, 'baseFiatId'); } let localVarHeaders = this.defaultHeaders; let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts: string[] = [ 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext: HttpContext | undefined = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } // to determine the Content-Type header const consumes: string[] = [ 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } return this.httpClient.post(`${this.configuration.basePath}/user/staking/stake`, stakeRequest, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, reportProgress: reportProgress } ); } /** * @param openPoolNotificationSubscriptionRequest * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public stakingSubscribeOnOpenPoolNotification(openPoolNotificationSubscriptionRequest?: OpenPoolNotificationSubscriptionRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; public stakingSubscribeOnOpenPoolNotification(openPoolNotificationSubscriptionRequest?: OpenPoolNotificationSubscriptionRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; public stakingSubscribeOnOpenPoolNotification(openPoolNotificationSubscriptionRequest?: OpenPoolNotificationSubscriptionRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; public stakingSubscribeOnOpenPoolNotification(openPoolNotificationSubscriptionRequest?: OpenPoolNotificationSubscriptionRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { let localVarHeaders = this.defaultHeaders; let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts: string[] = [ ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext: HttpContext | undefined = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } // to determine the Content-Type header const consumes: string[] = [ 'application/json' ]; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } return this.httpClient.post(`${this.configuration.basePath}/user/staking/open-pool-notification`, openPoolNotificationSubscriptionRequest, { context: localVarHttpContext, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, reportProgress: reportProgress } ); } }