diff --git a/utils/sdk/Makefile b/utils/sdk/Makefile index 93fc8dd6..757197bc 100644 --- a/utils/sdk/Makefile +++ b/utils/sdk/Makefile @@ -20,8 +20,9 @@ POST_BUILD_HOOK = @true go: POST_BUILD_HOOK = (cd $(BUILD_DIR)/go && go mod edit -module github.com/letheanVPN/blockchain/utils/sdk/client/go && go mod tidy) # For the 'go' target, set the generator name correctly. -go: GENERATOR_NAME = go -php: GENERATOR_NAME = php-nextgen +go: GENERATOR_NAME=go +php: GENERATOR_NAME=php-nextgen +angular: GENERATOR_NAME=typescript-angular # --- Main Targets --- all: build diff --git a/utils/sdk/client/angular/.gitignore b/utils/sdk/client/angular/.gitignore new file mode 100644 index 00000000..149b5765 --- /dev/null +++ b/utils/sdk/client/angular/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/utils/sdk/client/angular/.openapi-generator-ignore b/utils/sdk/client/angular/.openapi-generator-ignore new file mode 100644 index 00000000..def5120f --- /dev/null +++ b/utils/sdk/client/angular/.openapi-generator-ignore @@ -0,0 +1,3 @@ +git_push.sh +.travis.yml +README.md diff --git a/utils/sdk/client/angular/.openapi-generator/FILES b/utils/sdk/client/angular/.openapi-generator/FILES new file mode 100644 index 00000000..9d101695 --- /dev/null +++ b/utils/sdk/client/angular/.openapi-generator/FILES @@ -0,0 +1,37 @@ +.gitignore +api.base.service.ts +api.module.ts +api/api.ts +api/block.service.ts +api/info.service.ts +configuration.ts +encoder.ts +index.ts +model/blockDetailsModel.ts +model/blockProcessingPerformanceModel.ts +model/blockTemplateModel.ts +model/blockTemplateRequestModel.ts +model/dbStatInfoModel.ts +model/heightModel.ts +model/infoModel.ts +model/maintainersInfoModel.ts +model/models.ts +model/performanceModel.ts +model/posEntryModel.ts +model/submitBlockRequestModel.ts +model/submitBlockResponseModel.ts +model/transactionAttachmentModel.ts +model/transactionDetailsModel.ts +model/transactionExtraModel.ts +model/transactionInputModel.ts +model/transactionOutputModel.ts +model/txGenerationContextModel.ts +model/txPoolPerformanceModel.ts +model/txProcessingPerformanceModel.ts +model/versionModel.ts +ng-package.json +package.json +param.ts +provide-api.ts +tsconfig.json +variables.ts diff --git a/utils/sdk/client/angular/.openapi-generator/VERSION b/utils/sdk/client/angular/.openapi-generator/VERSION new file mode 100644 index 00000000..971ecb25 --- /dev/null +++ b/utils/sdk/client/angular/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.16.0 diff --git a/utils/sdk/client/angular/api.base.service.ts b/utils/sdk/client/angular/api.base.service.ts new file mode 100644 index 00000000..6afb8f3a --- /dev/null +++ b/utils/sdk/client/angular/api.base.service.ts @@ -0,0 +1,83 @@ +/** + * Lethean Blockchain API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { HttpHeaders, HttpParams, HttpParameterCodec } from '@angular/common/http'; +import { CustomHttpParameterCodec } from './encoder'; +import { lthnConfiguration } from './configuration'; + +export class BaseService { + protected basePath = 'http://127.0.0.1:36943'; + public defaultHeaders = new HttpHeaders(); + public configuration: lthnConfiguration; + public encoder: HttpParameterCodec; + + constructor(basePath?: string|string[], configuration?: lthnConfiguration) { + this.configuration = configuration || new lthnConfiguration(); + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + protected canConsumeForm(consumes: string[]): boolean { + return consumes.indexOf('multipart/form-data') !== -1; + } + + protected addToHttpParams(httpParams: HttpParams, value: any, key?: string, isDeep: boolean = false): HttpParams { + // If the value is an object (but not a Date), recursively add its keys. + if (typeof value === 'object' && !(value instanceof Date)) { + return this.addToHttpParamsRecursive(httpParams, value, isDeep ? key : undefined, isDeep); + } + return this.addToHttpParamsRecursive(httpParams, value, key); + } + + protected addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string, isDeep: boolean = false): HttpParams { + if (value === null || value === undefined) { + return httpParams; + } + if (typeof value === 'object') { + // If JSON format is preferred, key must be provided. + if (key != null) { + return isDeep + ? Object.keys(value as Record).reduce( + (hp, k) => hp.append(`${key}[${k}]`, value[k]), + httpParams, + ) + : httpParams.append(key, JSON.stringify(value)); + } + // Otherwise, if it's an array, add each element. + if (Array.isArray(value)) { + value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, value.toISOString()); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach(k => { + const paramKey = key ? `${key}.${k}` : k; + httpParams = this.addToHttpParamsRecursive(httpParams, value[k], paramKey); + }); + } + return httpParams; + } else if (key != null) { + return httpParams.append(key, value); + } + throw Error("key may not be null if value is not object or array"); + } +} diff --git a/utils/sdk/client/angular/api.module.ts b/utils/sdk/client/angular/api.module.ts new file mode 100644 index 00000000..b0386c4e --- /dev/null +++ b/utils/sdk/client/angular/api.module.ts @@ -0,0 +1,30 @@ +import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; +import { lthnConfiguration } from './configuration'; +import { HttpClient } from '@angular/common/http'; + + +@NgModule({ + imports: [], + declarations: [], + exports: [], + providers: [] +}) +export class lthnApiModule { + public static forRoot(configurationFactory: () => lthnConfiguration): ModuleWithProviders { + return { + ngModule: lthnApiModule, + providers: [ { provide: lthnConfiguration, useFactory: configurationFactory } ] + }; + } + + constructor( @Optional() @SkipSelf() parentModule: lthnApiModule, + @Optional() http: HttpClient) { + if (parentModule) { + throw new Error('lthnApiModule is already loaded. Import in your base AppModule only.'); + } + if (!http) { + throw new Error('You need to import the HttpClientModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575'); + } + } +} diff --git a/utils/sdk/client/angular/api/api.ts b/utils/sdk/client/angular/api/api.ts new file mode 100644 index 00000000..99700c50 --- /dev/null +++ b/utils/sdk/client/angular/api/api.ts @@ -0,0 +1,5 @@ +export * from './block.service'; +import { BlockService } from './block.service'; +export * from './info.service'; +import { InfoService } from './info.service'; +export const APIS = [BlockService, InfoService]; diff --git a/utils/sdk/client/angular/api/block.service.ts b/utils/sdk/client/angular/api/block.service.ts new file mode 100644 index 00000000..1a5c029c --- /dev/null +++ b/utils/sdk/client/angular/api/block.service.ts @@ -0,0 +1,330 @@ +/** + * Lethean Blockchain API + * + * + * + * 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 { BlockDetailsModel } from '../model/blockDetailsModel'; +// @ts-ignore +import { BlockTemplateModel } from '../model/blockTemplateModel'; +// @ts-ignore +import { BlockTemplateRequestModel } from '../model/blockTemplateRequestModel'; +// @ts-ignore +import { HeightModel } from '../model/heightModel'; +// @ts-ignore +import { SubmitBlockRequestModel } from '../model/submitBlockRequestModel'; +// @ts-ignore +import { SubmitBlockResponseModel } from '../model/submitBlockResponseModel'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { lthnConfiguration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class BlockService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: lthnConfiguration) { + super(basePath, configuration); + } + + /** + * Create a block template for mining + * @param blockTemplateRequestModel + * @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 createBlockTemplate(blockTemplateRequestModel: BlockTemplateRequestModel, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public createBlockTemplate(blockTemplateRequestModel: BlockTemplateRequestModel, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createBlockTemplate(blockTemplateRequestModel: BlockTemplateRequestModel, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createBlockTemplate(blockTemplateRequestModel: BlockTemplateRequestModel, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (blockTemplateRequestModel === null || blockTemplateRequestModel === undefined) { + throw new Error('Required parameter blockTemplateRequestModel was null or undefined when calling createBlockTemplate.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // 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'; + } + } + + let localVarPath = `/block/template`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: blockTemplateRequestModel, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Get a block by its hash or height (ID) + * @param identifier The hash (hex string) or height (integer) of the block to retrieve. + * @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 getBlock(identifier: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getBlock(identifier: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getBlock(identifier: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getBlock(identifier: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (identifier === null || identifier === undefined) { + throw new Error('Required parameter identifier was null or undefined when calling getBlock.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + 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'; + } + } + + let localVarPath = `/block/${this.configuration.encodeParam({name: "identifier", value: identifier, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Get one or more blocks, with optional pagination. + * @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 getBlocks(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getBlocks(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getBlocks(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getBlocks(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + 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'; + } + } + + let localVarPath = `/block`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Get the current blockchain height + * @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 getHeight(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getHeight(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getHeight(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getHeight(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + 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'; + } + } + + let localVarPath = `/block/height`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Submit a new block to the network + * @param submitBlockRequestModel + * @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 submitBlock(submitBlockRequestModel: SubmitBlockRequestModel, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public submitBlock(submitBlockRequestModel: SubmitBlockRequestModel, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public submitBlock(submitBlockRequestModel: SubmitBlockRequestModel, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public submitBlock(submitBlockRequestModel: SubmitBlockRequestModel, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (submitBlockRequestModel === null || submitBlockRequestModel === undefined) { + throw new Error('Required parameter submitBlockRequestModel was null or undefined when calling submitBlock.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // 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'; + } + } + + let localVarPath = `/block/submit`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: submitBlockRequestModel, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + +} diff --git a/utils/sdk/client/angular/api/info.service.ts b/utils/sdk/client/angular/api/info.service.ts new file mode 100644 index 00000000..d387f7e1 --- /dev/null +++ b/utils/sdk/client/angular/api/info.service.ts @@ -0,0 +1,147 @@ +/** + * Lethean Blockchain API + * + * + * + * 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 { InfoModel } from '../model/infoModel'; +// @ts-ignore +import { VersionModel } from '../model/versionModel'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { lthnConfiguration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class InfoService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: lthnConfiguration) { + super(basePath, configuration); + } + + /** + * Get detailed information about the blockchain and daemon state + * @param flags Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. + * @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 getInfo(flags?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getInfo(flags?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInfo(flags?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInfo(flags?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + flags, 'flags'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + 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'; + } + } + + let localVarPath = `/info`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + + /** + * Get API version + * Returns the current version of the API. + * @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 version(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public version(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public version(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public version(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + 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'; + } + } + + let localVarPath = `/info/version`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + +} diff --git a/utils/sdk/client/angular/configuration.ts b/utils/sdk/client/angular/configuration.ts new file mode 100644 index 00000000..0aa41bcb --- /dev/null +++ b/utils/sdk/client/angular/configuration.ts @@ -0,0 +1,184 @@ +import { HttpHeaders, HttpParams, HttpParameterCodec } from '@angular/common/http'; +import { Param } from './param'; + +export interface lthnConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + /** + * Takes care of encoding query- and form-parameters. + */ + encoder?: HttpParameterCodec; + /** + * Override the default method for encoding path parameters in various + * styles. + *

+ * See {@link README.md} for more details + *

+ */ + encodeParam?: (param: Param) => string; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; +} + +export class lthnConfiguration { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + /** + * Takes care of encoding query- and form-parameters. + */ + encoder?: HttpParameterCodec; + /** + * Encoding of various path parameter + * styles. + *

+ * See {@link README.md} for more details + *

+ */ + encodeParam: (param: Param) => string; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; + +constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: lthnConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; + } + if (username !== undefined) { + this.username = username; + } + if (password !== undefined) { + this.password = password; + } + if (accessToken !== undefined) { + this.accessToken = accessToken; + } + if (basePath !== undefined) { + this.basePath = basePath; + } + if (withCredentials !== undefined) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; + } + + /** + * Select the correct content-type to use for a request. + * Uses {@link lthnConfiguration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType (contentTypes: string[]): string | undefined { + if (contentTypes.length === 0) { + return undefined; + } + + const type = contentTypes.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return contentTypes[0]; + } + return type; + } + + /** + * Select the correct accept content-type to use for a request. + * Uses {@link lthnConfiguration#isJsonMime} to determine the correct accept content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param accepts - the array of content types that are available for selection. + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderAccept(accepts: string[]): string | undefined { + if (accepts.length === 0) { + return undefined; + } + + const type = accepts.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return accepts[0]; + } + return type; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } + + public addCredentialToHeaders(credentialKey: string, headerName: string, headers: HttpHeaders, prefix?: string): HttpHeaders { + const value = this.lookupCredential(credentialKey); + return value + ? headers.set(headerName, (prefix ?? '') + value) + : headers; + } + + public addCredentialToQuery(credentialKey: string, paramName: string, query: HttpParams): HttpParams { + const value = this.lookupCredential(credentialKey); + return value + ? query.set(paramName, value) + : query; + } + + private defaultEncodeParam(param: Param): string { + // This implementation exists as fallback for missing configuration + // and for backwards compatibility to older typescript-angular generator versions. + // It only works for the 'simple' parameter style. + // Date-handling only works for the 'date-time' format. + // All other styles and Date-formats are probably handled incorrectly. + // + // But: if that's all you need (i.e.: the most common use-case): no need for customization! + + const value = param.dataFormat === 'date-time' && param.value instanceof Date + ? (param.value as Date).toISOString() + : param.value; + + return encodeURIComponent(String(value)); + } +} diff --git a/utils/sdk/client/angular/encoder.ts b/utils/sdk/client/angular/encoder.ts new file mode 100644 index 00000000..138c4d5c --- /dev/null +++ b/utils/sdk/client/angular/encoder.ts @@ -0,0 +1,20 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +/** + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ +export class CustomHttpParameterCodec implements HttpParameterCodec { + encodeKey(k: string): string { + return encodeURIComponent(k); + } + encodeValue(v: string): string { + return encodeURIComponent(v); + } + decodeKey(k: string): string { + return decodeURIComponent(k); + } + decodeValue(v: string): string { + return decodeURIComponent(v); + } +} diff --git a/utils/sdk/client/angular/index.ts b/utils/sdk/client/angular/index.ts new file mode 100644 index 00000000..02cb7d43 --- /dev/null +++ b/utils/sdk/client/angular/index.ts @@ -0,0 +1,7 @@ +export * from './api/api'; +export * from './model/models'; +export * from './variables'; +export * from './configuration'; +export * from './api.module'; +export * from './provide-api'; +export * from './param'; diff --git a/utils/sdk/client/angular/model/blockDetailsModel.ts b/utils/sdk/client/angular/model/blockDetailsModel.ts new file mode 100644 index 00000000..b8875a36 --- /dev/null +++ b/utils/sdk/client/angular/model/blockDetailsModel.ts @@ -0,0 +1,40 @@ +/** + * Lethean Blockchain API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { TransactionDetailsModel } from './transactionDetailsModel'; + + +export interface BlockDetailsModel { + actual_timestamp?: number; + already_generated_coins?: string; + base_reward?: number; + blob?: string; + block_cumulative_size?: number; + block_tself_size?: number; + cumulative_diff_adjusted?: string; + cumulative_diff_precise?: string; + difficulty?: string; + effective_fee_median?: number; + height?: number; + id?: string; + is_orphan?: boolean; + miner_text_info?: string; + object_in_json?: string; + penalty?: number; + pow_seed?: string; + prev_id?: string; + summary_reward?: number; + this_block_fee_median?: number; + timestamp?: number; + total_fee?: number; + total_txs_size?: number; + transactions_details?: Array; + type?: number; +} + diff --git a/utils/sdk/client/angular/model/blockProcessingPerformanceModel.ts b/utils/sdk/client/angular/model/blockProcessingPerformanceModel.ts new file mode 100644 index 00000000..a09bb452 --- /dev/null +++ b/utils/sdk/client/angular/model/blockProcessingPerformanceModel.ts @@ -0,0 +1,30 @@ +/** + * Lethean Blockchain API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface BlockProcessingPerformanceModel { + block_processing_time_0?: number; + block_processing_time_1?: number; + target_calculating_time_2?: number; + longhash_calculating_time_3?: number; + all_txs_insert_time_5?: number; + etc_stuff_6?: number; + insert_time_4?: number; + raise_block_core_event?: number; + validate_miner_transaction_time?: number; + collect_rangeproofs_data_from_tx_time?: number; + verify_multiple_zc_outs_range_proofs_time?: number; + target_calculating_enum_blocks?: number; + target_calculating_calc?: number; + pos_validate_ki_search?: number; + pos_validate_get_out_keys_for_inputs?: number; + pos_validate_zvp?: number; +} + diff --git a/utils/sdk/client/angular/model/blockTemplateModel.ts b/utils/sdk/client/angular/model/blockTemplateModel.ts new file mode 100644 index 00000000..1a213474 --- /dev/null +++ b/utils/sdk/client/angular/model/blockTemplateModel.ts @@ -0,0 +1,24 @@ +/** + * Lethean Blockchain API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { TxGenerationContextModel } from './txGenerationContextModel'; + + +export interface BlockTemplateModel { + blocktemplate_blob?: string; + difficulty?: string; + height?: number; + miner_tx_tgc?: TxGenerationContextModel; + block_reward_without_fee?: number; + block_reward?: number; + txs_fee?: number; + prev_hash?: string; + seed?: string; +} + diff --git a/utils/sdk/client/angular/model/blockTemplateRequestModel.ts b/utils/sdk/client/angular/model/blockTemplateRequestModel.ts new file mode 100644 index 00000000..3a8de471 --- /dev/null +++ b/utils/sdk/client/angular/model/blockTemplateRequestModel.ts @@ -0,0 +1,22 @@ +/** + * Lethean Blockchain API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { PosEntryModel } from './posEntryModel'; + + +export interface BlockTemplateRequestModel { + miner_address?: string; + stakeholder_address?: string; + ex_nonce?: string; + pos_block?: boolean; + ignore_pow_ts_check?: boolean; + pe?: PosEntryModel; + explicit_txs?: Array; +} + diff --git a/utils/sdk/client/angular/model/dbStatInfoModel.ts b/utils/sdk/client/angular/model/dbStatInfoModel.ts new file mode 100644 index 00000000..59904da5 --- /dev/null +++ b/utils/sdk/client/angular/model/dbStatInfoModel.ts @@ -0,0 +1,17 @@ +/** + * Lethean Blockchain API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface DbStatInfoModel { + tx_count?: number; + write_tx_count?: number; + map_size?: number; +} + diff --git a/utils/sdk/client/angular/model/heightModel.ts b/utils/sdk/client/angular/model/heightModel.ts new file mode 100644 index 00000000..597d04d1 --- /dev/null +++ b/utils/sdk/client/angular/model/heightModel.ts @@ -0,0 +1,15 @@ +/** + * Lethean Blockchain API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface HeightModel { + height?: number; +} + diff --git a/utils/sdk/client/angular/model/infoModel.ts b/utils/sdk/client/angular/model/infoModel.ts new file mode 100644 index 00000000..a439bc8a --- /dev/null +++ b/utils/sdk/client/angular/model/infoModel.ts @@ -0,0 +1,62 @@ +/** + * Lethean Blockchain API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { MaintainersInfoModel } from './maintainersInfoModel'; +import { PerformanceModel } from './performanceModel'; + + +export interface InfoModel { + height?: number; + tx_count?: number; + tx_pool_size?: number; + alt_blocks_count?: number; + outgoing_connections_count?: number; + incoming_connections_count?: number; + synchronized_connections_count?: number; + white_peerlist_size?: number; + grey_peerlist_size?: number; + current_blocks_median?: number; + alias_count?: number; + current_max_allowed_block_size?: number; + daemon_network_state?: string; + synchronization_start_height?: number; + max_net_seen_height?: number; + mi?: MaintainersInfoModel; + pos_allowed?: boolean; + pos_difficulty?: string; + pow_difficulty?: number; + default_fee?: number; + minimum_fee?: number; + is_hardfork_active?: Array; + net_time_delta_median?: number; + current_network_hashrate_50?: number; + current_network_hashrate_350?: number; + seconds_for_10_blocks?: number; + seconds_for_30_blocks?: number; + transactions_cnt_per_day?: Array; + transactions_volume_per_day?: Array; + last_pos_timestamp?: number; + last_pow_timestamp?: number; + total_coins?: string; + last_block_size?: number; + tx_count_in_last_block?: number; + pos_sequence_factor?: number; + pow_sequence_factor?: number; + block_reward?: number; + last_block_total_reward?: number; + pos_diff_total_coins_rate?: number; + last_block_timestamp?: number; + last_block_hash?: string; + pos_block_ts_shift_vs_actual?: number; + outs_stat?: { [key: string]: number; }; + performance_data?: PerformanceModel; + offers_count?: number; + expiration_median_timestamp?: number; +} + diff --git a/utils/sdk/client/angular/model/maintainersInfoModel.ts b/utils/sdk/client/angular/model/maintainersInfoModel.ts new file mode 100644 index 00000000..194399ca --- /dev/null +++ b/utils/sdk/client/angular/model/maintainersInfoModel.ts @@ -0,0 +1,19 @@ +/** + * Lethean Blockchain API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface MaintainersInfoModel { + ver_major?: number; + ver_minor?: number; + ver_revision?: number; + build_no?: number; + mode?: number; +} + diff --git a/utils/sdk/client/angular/model/models.ts b/utils/sdk/client/angular/model/models.ts new file mode 100644 index 00000000..a266e14d --- /dev/null +++ b/utils/sdk/client/angular/model/models.ts @@ -0,0 +1,21 @@ +export * from './blockDetailsModel'; +export * from './blockProcessingPerformanceModel'; +export * from './blockTemplateModel'; +export * from './blockTemplateRequestModel'; +export * from './dbStatInfoModel'; +export * from './heightModel'; +export * from './infoModel'; +export * from './maintainersInfoModel'; +export * from './performanceModel'; +export * from './posEntryModel'; +export * from './submitBlockRequestModel'; +export * from './submitBlockResponseModel'; +export * from './transactionAttachmentModel'; +export * from './transactionDetailsModel'; +export * from './transactionExtraModel'; +export * from './transactionInputModel'; +export * from './transactionOutputModel'; +export * from './txGenerationContextModel'; +export * from './txPoolPerformanceModel'; +export * from './txProcessingPerformanceModel'; +export * from './versionModel'; diff --git a/utils/sdk/client/angular/model/performanceModel.ts b/utils/sdk/client/angular/model/performanceModel.ts new file mode 100644 index 00000000..e4dd98bb --- /dev/null +++ b/utils/sdk/client/angular/model/performanceModel.ts @@ -0,0 +1,22 @@ +/** + * Lethean Blockchain API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { BlockProcessingPerformanceModel } from './blockProcessingPerformanceModel'; +import { TxProcessingPerformanceModel } from './txProcessingPerformanceModel'; +import { DbStatInfoModel } from './dbStatInfoModel'; +import { TxPoolPerformanceModel } from './txPoolPerformanceModel'; + + +export interface PerformanceModel { + block_processing?: BlockProcessingPerformanceModel; + tx_processing?: TxProcessingPerformanceModel; + tx_pool?: TxPoolPerformanceModel; + db_stat_info?: DbStatInfoModel; +} + diff --git a/utils/sdk/client/angular/model/posEntryModel.ts b/utils/sdk/client/angular/model/posEntryModel.ts new file mode 100644 index 00000000..e4e35afc --- /dev/null +++ b/utils/sdk/client/angular/model/posEntryModel.ts @@ -0,0 +1,22 @@ +/** + * Lethean Blockchain API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface PosEntryModel { + amount?: number; + g_index?: number; + keyimage?: string; + block_timestamp?: number; + stake_unlock_time?: number; + tx_id?: string; + tx_out_index?: number; + wallet_index?: number; +} + diff --git a/utils/sdk/client/angular/model/submitBlockRequestModel.ts b/utils/sdk/client/angular/model/submitBlockRequestModel.ts new file mode 100644 index 00000000..1e6a3791 --- /dev/null +++ b/utils/sdk/client/angular/model/submitBlockRequestModel.ts @@ -0,0 +1,15 @@ +/** + * Lethean Blockchain API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface SubmitBlockRequestModel { + block_blob?: string; +} + diff --git a/utils/sdk/client/angular/model/submitBlockResponseModel.ts b/utils/sdk/client/angular/model/submitBlockResponseModel.ts new file mode 100644 index 00000000..5e17b03f --- /dev/null +++ b/utils/sdk/client/angular/model/submitBlockResponseModel.ts @@ -0,0 +1,15 @@ +/** + * Lethean Blockchain API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface SubmitBlockResponseModel { + status?: string; +} + diff --git a/utils/sdk/client/angular/model/transactionAttachmentModel.ts b/utils/sdk/client/angular/model/transactionAttachmentModel.ts new file mode 100644 index 00000000..da213619 --- /dev/null +++ b/utils/sdk/client/angular/model/transactionAttachmentModel.ts @@ -0,0 +1,17 @@ +/** + * Lethean Blockchain API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface TransactionAttachmentModel { + type?: string; + short_view?: string; + details_view?: string; +} + diff --git a/utils/sdk/client/angular/model/transactionDetailsModel.ts b/utils/sdk/client/angular/model/transactionDetailsModel.ts new file mode 100644 index 00000000..8fc6e9cd --- /dev/null +++ b/utils/sdk/client/angular/model/transactionDetailsModel.ts @@ -0,0 +1,31 @@ +/** + * Lethean Blockchain API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { TransactionAttachmentModel } from './transactionAttachmentModel'; +import { TransactionInputModel } from './transactionInputModel'; +import { TransactionExtraModel } from './transactionExtraModel'; +import { TransactionOutputModel } from './transactionOutputModel'; + + +export interface TransactionDetailsModel { + amount?: number; + attachments?: Array; + blob?: string; + blob_size?: number; + extra?: Array; + fee?: number; + id?: string; + ins?: Array; + keeper_block?: number; + object_in_json?: string; + outs?: Array; + pub_key?: string; + timestamp?: number; +} + diff --git a/utils/sdk/client/angular/model/transactionExtraModel.ts b/utils/sdk/client/angular/model/transactionExtraModel.ts new file mode 100644 index 00000000..331dbace --- /dev/null +++ b/utils/sdk/client/angular/model/transactionExtraModel.ts @@ -0,0 +1,17 @@ +/** + * Lethean Blockchain API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface TransactionExtraModel { + type?: string; + short_view?: string; + details_view?: string; +} + diff --git a/utils/sdk/client/angular/model/transactionInputModel.ts b/utils/sdk/client/angular/model/transactionInputModel.ts new file mode 100644 index 00000000..d80da457 --- /dev/null +++ b/utils/sdk/client/angular/model/transactionInputModel.ts @@ -0,0 +1,19 @@ +/** + * Lethean Blockchain API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface TransactionInputModel { + amount?: number; + global_indexes?: Array; + htlc_origin?: string; + kimage_or_ms_id?: string; + multisig_count?: number; +} + diff --git a/utils/sdk/client/angular/model/transactionOutputModel.ts b/utils/sdk/client/angular/model/transactionOutputModel.ts new file mode 100644 index 00000000..dc1c3798 --- /dev/null +++ b/utils/sdk/client/angular/model/transactionOutputModel.ts @@ -0,0 +1,19 @@ +/** + * Lethean Blockchain API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface TransactionOutputModel { + amount?: number; + global_index?: number; + is_spent?: boolean; + minimum_sigs?: number; + pub_keys?: Array; +} + diff --git a/utils/sdk/client/angular/model/txGenerationContextModel.ts b/utils/sdk/client/angular/model/txGenerationContextModel.ts new file mode 100644 index 00000000..2866a4bc --- /dev/null +++ b/utils/sdk/client/angular/model/txGenerationContextModel.ts @@ -0,0 +1,38 @@ +/** + * Lethean Blockchain API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface TxGenerationContextModel { + asset_ids?: Array; + blinded_asset_ids?: Array; + amount_commitments?: Array; + asset_id_blinding_masks?: Array; + amounts?: Array; + amount_blinding_masks?: Array; + pseudo_outs_blinded_asset_ids?: Array; + pseudo_outs_plus_real_out_blinding_masks?: Array; + real_zc_ins_asset_ids?: Array; + zc_input_amounts?: Array; + pseudo_out_amount_commitments_sum?: string; + pseudo_out_amount_blinding_masks_sum?: string; + real_in_asset_id_blinding_mask_x_amount_sum?: string; + amount_commitments_sum?: string; + amount_blinding_masks_sum?: string; + asset_id_blinding_mask_x_amount_sum?: string; + ao_asset_id?: string; + ao_asset_id_pt?: string; + ao_amount_commitment?: string; + ao_amount_blinding_mask?: string; + ao_commitment_in_outputs?: boolean; + tx_key_pub?: string; + tx_key_sec?: string; + tx_pub_key_p?: string; +} + diff --git a/utils/sdk/client/angular/model/txPoolPerformanceModel.ts b/utils/sdk/client/angular/model/txPoolPerformanceModel.ts new file mode 100644 index 00000000..69be0638 --- /dev/null +++ b/utils/sdk/client/angular/model/txPoolPerformanceModel.ts @@ -0,0 +1,25 @@ +/** + * Lethean Blockchain API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface TxPoolPerformanceModel { + tx_processing_time?: number; + check_inputs_types_supported_time?: number; + expiration_validate_time?: number; + validate_amount_time?: number; + validate_alias_time?: number; + check_keyimages_ws_ms_time?: number; + check_inputs_time?: number; + begin_tx_time?: number; + update_db_time?: number; + db_commit_time?: number; + check_post_hf4_balance?: number; +} + diff --git a/utils/sdk/client/angular/model/txProcessingPerformanceModel.ts b/utils/sdk/client/angular/model/txProcessingPerformanceModel.ts new file mode 100644 index 00000000..943651a3 --- /dev/null +++ b/utils/sdk/client/angular/model/txProcessingPerformanceModel.ts @@ -0,0 +1,39 @@ +/** + * Lethean Blockchain API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface TxProcessingPerformanceModel { + tx_check_inputs?: number; + tx_add_one_tx?: number; + tx_process_extra?: number; + tx_process_attachment?: number; + tx_process_inputs?: number; + tx_push_global_index?: number; + tx_check_exist?: number; + tx_print_log?: number; + tx_prapare_append?: number; + tx_append?: number; + tx_append_rl_wait?: number; + tx_append_is_expired?: number; + tx_store_db?: number; + tx_check_inputs_prefix_hash?: number; + tx_check_inputs_attachment_check?: number; + tx_check_inputs_loop?: number; + tx_check_inputs_loop_kimage_check?: number; + tx_check_inputs_loop_ch_in_val_sig?: number; + tx_check_inputs_loop_scan_outputkeys_get_item_size?: number; + tx_check_inputs_loop_scan_outputkeys_relative_to_absolute?: number; + tx_check_inputs_loop_scan_outputkeys_loop?: number; + tx_check_inputs_loop_scan_outputkeys_loop_get_subitem?: number; + tx_check_inputs_loop_scan_outputkeys_loop_find_tx?: number; + tx_check_inputs_loop_scan_outputkeys_loop_handle_output?: number; + tx_mixin_count?: number; +} + diff --git a/utils/sdk/client/angular/model/versionModel.ts b/utils/sdk/client/angular/model/versionModel.ts new file mode 100644 index 00000000..9de0ec61 --- /dev/null +++ b/utils/sdk/client/angular/model/versionModel.ts @@ -0,0 +1,19 @@ +/** + * Lethean Blockchain API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface VersionModel { + version?: string; + version_long?: string; + major?: string; + minor?: string; + revision?: string; +} + diff --git a/utils/sdk/client/angular/ng-package.json b/utils/sdk/client/angular/ng-package.json new file mode 100644 index 00000000..3b17900d --- /dev/null +++ b/utils/sdk/client/angular/ng-package.json @@ -0,0 +1,6 @@ +{ + "$schema": "./node_modules/ng-packagr/ng-package.schema.json", + "lib": { + "entryFile": "index.ts" + } +} diff --git a/utils/sdk/client/angular/package.json b/utils/sdk/client/angular/package.json new file mode 100644 index 00000000..077490d1 --- /dev/null +++ b/utils/sdk/client/angular/package.json @@ -0,0 +1,34 @@ +{ + "name": "@lthn/angular", + "version": "6.0.1", + "description": "OpenAPI client for @lthn/angular", + "author": "OpenAPI-Generator Contributors", + "repository": { + "type": "git", + "url": "https://github.com/letheanVPN/blockchain.git" + }, + "keywords": [ + "openapi-client", + "openapi-generator" + ], + "license": "Unlicense", + "scripts": { + "prepare": "npm run build", + "build": "ng-packagr -p ng-package.json" + }, + "peerDependencies": { + "@angular/core": "^20.0.0", + "rxjs": "^7.4.0" + }, + "devDependencies": { + "@angular/common": "^20.0.0", + "@angular/compiler": "^20.0.0", + "@angular/compiler-cli": "^20.0.0", + "@angular/core": "^20.0.0", + "@angular/platform-browser": "^20.0.0", + "ng-packagr": "^20.0.0", + "reflect-metadata": "^0.1.3", + "rxjs": "^7.4.0", + "typescript": ">=5.8.0 <5.9.0", + "zone.js": "^0.15.0" + }} diff --git a/utils/sdk/client/angular/param.ts b/utils/sdk/client/angular/param.ts new file mode 100644 index 00000000..78a2d20a --- /dev/null +++ b/utils/sdk/client/angular/param.ts @@ -0,0 +1,69 @@ +/** + * Standard parameter styles defined by OpenAPI spec + */ +export type StandardParamStyle = + | 'matrix' + | 'label' + | 'form' + | 'simple' + | 'spaceDelimited' + | 'pipeDelimited' + | 'deepObject' + ; + +/** + * The OpenAPI standard {@link StandardParamStyle}s may be extended by custom styles by the user. + */ +export type ParamStyle = StandardParamStyle | string; + +/** + * Standard parameter locations defined by OpenAPI spec + */ +export type ParamLocation = 'query' | 'header' | 'path' | 'cookie'; + +/** + * Standard types as defined in OpenAPI Specification: Data Types + */ +export type StandardDataType = + | "integer" + | "number" + | "boolean" + | "string" + | "object" + | "array" + ; + +/** + * Standard {@link DataType}s plus your own types/classes. + */ +export type DataType = StandardDataType | string; + +/** + * Standard formats as defined in OpenAPI Specification: Data Types + */ +export type StandardDataFormat = + | "int32" + | "int64" + | "float" + | "double" + | "byte" + | "binary" + | "date" + | "date-time" + | "password" + ; + +export type DataFormat = StandardDataFormat | string; + +/** + * The parameter to encode. + */ +export interface Param { + name: string; + value: unknown; + in: ParamLocation; + style: ParamStyle, + explode: boolean; + dataType: DataType; + dataFormat: DataFormat | undefined; +} diff --git a/utils/sdk/client/angular/provide-api.ts b/utils/sdk/client/angular/provide-api.ts new file mode 100644 index 00000000..038f6b2a --- /dev/null +++ b/utils/sdk/client/angular/provide-api.ts @@ -0,0 +1,15 @@ +import { EnvironmentProviders, makeEnvironmentProviders } from "@angular/core"; +import { lthnConfiguration, lthnConfigurationParameters } from './configuration'; +import { BASE_PATH } from './variables'; + +// Returns the service class providers, to be used in the [ApplicationConfig](https://angular.dev/api/core/ApplicationConfig). +export function provideApi(configOrBasePath: string | lthnConfigurationParameters): EnvironmentProviders { + return makeEnvironmentProviders([ + typeof configOrBasePath === "string" + ? { provide: BASE_PATH, useValue: configOrBasePath } + : { + provide: lthnConfiguration, + useValue: new lthnConfiguration({ ...configOrBasePath }), + }, + ]); +} \ No newline at end of file diff --git a/utils/sdk/client/angular/tsconfig.json b/utils/sdk/client/angular/tsconfig.json new file mode 100644 index 00000000..41165c30 --- /dev/null +++ b/utils/sdk/client/angular/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "noImplicitAny": false, + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "removeComments": true, + "strictNullChecks": true, + "exactOptionalPropertyTypes": true, + "sourceMap": true, + "outDir": "./dist", + "noLib": false, + "declaration": true, + "lib": [ "es6", "dom" ], + "typeRoots": [ + "node_modules/@types" + ] + }, + "exclude": [ + "node_modules", + "dist" + ], + "filesGlob": [ + "./model/*.ts", + "./api/*.ts" + ] +} diff --git a/utils/sdk/client/angular/variables.ts b/utils/sdk/client/angular/variables.ts new file mode 100644 index 00000000..6fe58549 --- /dev/null +++ b/utils/sdk/client/angular/variables.ts @@ -0,0 +1,9 @@ +import { InjectionToken } from '@angular/core'; + +export const BASE_PATH = new InjectionToken('basePath'); +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} diff --git a/utils/sdk/packages/angular.json b/utils/sdk/packages/angular.json new file mode 100644 index 00000000..12094d60 --- /dev/null +++ b/utils/sdk/packages/angular.json @@ -0,0 +1,8 @@ +{ + "additionalProperties": { + "apiModulePrefix":"lthn", + "configurationPrefix":"lthn", + "npmName":"@lthn/angular", + "ngVersion": 20 + } +} \ No newline at end of file diff --git a/utils/sdk/packages/typescript-angular.json b/utils/sdk/packages/typescript-angular.json deleted file mode 100644 index 77662033..00000000 --- a/utils/sdk/packages/typescript-angular.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "additionalProperties": { - "apiModulePrefix":"letheanchainsdk", - "configurationPrefix":"letheanchainsdk", - "npmName":"@snider/sdk-typescript-angular", - "ngVersion": 12 - } -} \ No newline at end of file