forked from lthn/blockchain
Add Angular SDK client generated from OpenAPI
Introduces a new Angular client SDK for the Lethean Blockchain API, generated via OpenAPI Generator. Includes all necessary Angular service, model, configuration, and packaging files, and updates the Makefile to support the 'angular' target for SDK generation.
This commit is contained in:
parent
c67fda3cfb
commit
2289d4e181
43 changed files with 1572 additions and 10 deletions
|
|
@ -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)
|
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.
|
# For the 'go' target, set the generator name correctly.
|
||||||
go: GENERATOR_NAME = go
|
go: GENERATOR_NAME=go
|
||||||
php: GENERATOR_NAME = php-nextgen
|
php: GENERATOR_NAME=php-nextgen
|
||||||
|
angular: GENERATOR_NAME=typescript-angular
|
||||||
# --- Main Targets ---
|
# --- Main Targets ---
|
||||||
|
|
||||||
all: build
|
all: build
|
||||||
|
|
|
||||||
4
utils/sdk/client/angular/.gitignore
generated
vendored
Normal file
4
utils/sdk/client/angular/.gitignore
generated
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
wwwroot/*.js
|
||||||
|
node_modules
|
||||||
|
typings
|
||||||
|
dist
|
||||||
3
utils/sdk/client/angular/.openapi-generator-ignore
generated
Normal file
3
utils/sdk/client/angular/.openapi-generator-ignore
generated
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
git_push.sh
|
||||||
|
.travis.yml
|
||||||
|
README.md
|
||||||
37
utils/sdk/client/angular/.openapi-generator/FILES
generated
Normal file
37
utils/sdk/client/angular/.openapi-generator/FILES
generated
Normal file
|
|
@ -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
|
||||||
1
utils/sdk/client/angular/.openapi-generator/VERSION
generated
Normal file
1
utils/sdk/client/angular/.openapi-generator/VERSION
generated
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
7.16.0
|
||||||
83
utils/sdk/client/angular/api.base.service.ts
generated
Normal file
83
utils/sdk/client/angular/api.base.service.ts
generated
Normal file
|
|
@ -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<string, any>).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");
|
||||||
|
}
|
||||||
|
}
|
||||||
30
utils/sdk/client/angular/api.module.ts
generated
Normal file
30
utils/sdk/client/angular/api.module.ts
generated
Normal file
|
|
@ -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<lthnApiModule> {
|
||||||
|
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');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
5
utils/sdk/client/angular/api/api.ts
generated
Normal file
5
utils/sdk/client/angular/api/api.ts
generated
Normal file
|
|
@ -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];
|
||||||
330
utils/sdk/client/angular/api/block.service.ts
generated
Normal file
330
utils/sdk/client/angular/api/block.service.ts
generated
Normal file
|
|
@ -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<BlockTemplateModel>;
|
||||||
|
public createBlockTemplate(blockTemplateRequestModel: BlockTemplateRequestModel, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<BlockTemplateModel>>;
|
||||||
|
public createBlockTemplate(blockTemplateRequestModel: BlockTemplateRequestModel, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<BlockTemplateModel>>;
|
||||||
|
public createBlockTemplate(blockTemplateRequestModel: BlockTemplateRequestModel, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||||
|
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<BlockTemplateModel>('post', `${basePath}${localVarPath}`,
|
||||||
|
{
|
||||||
|
context: localVarHttpContext,
|
||||||
|
body: blockTemplateRequestModel,
|
||||||
|
responseType: <any>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<BlockDetailsModel>;
|
||||||
|
public getBlock(identifier: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<BlockDetailsModel>>;
|
||||||
|
public getBlock(identifier: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<BlockDetailsModel>>;
|
||||||
|
public getBlock(identifier: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||||
|
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<BlockDetailsModel>('get', `${basePath}${localVarPath}`,
|
||||||
|
{
|
||||||
|
context: localVarHttpContext,
|
||||||
|
responseType: <any>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<Array<BlockDetailsModel>>;
|
||||||
|
public getBlocks(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<BlockDetailsModel>>>;
|
||||||
|
public getBlocks(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<BlockDetailsModel>>>;
|
||||||
|
public getBlocks(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||||
|
|
||||||
|
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<Array<BlockDetailsModel>>('get', `${basePath}${localVarPath}`,
|
||||||
|
{
|
||||||
|
context: localVarHttpContext,
|
||||||
|
responseType: <any>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<HeightModel>;
|
||||||
|
public getHeight(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<HeightModel>>;
|
||||||
|
public getHeight(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<HeightModel>>;
|
||||||
|
public getHeight(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||||
|
|
||||||
|
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<HeightModel>('get', `${basePath}${localVarPath}`,
|
||||||
|
{
|
||||||
|
context: localVarHttpContext,
|
||||||
|
responseType: <any>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<SubmitBlockResponseModel>;
|
||||||
|
public submitBlock(submitBlockRequestModel: SubmitBlockRequestModel, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<SubmitBlockResponseModel>>;
|
||||||
|
public submitBlock(submitBlockRequestModel: SubmitBlockRequestModel, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<SubmitBlockResponseModel>>;
|
||||||
|
public submitBlock(submitBlockRequestModel: SubmitBlockRequestModel, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||||
|
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<SubmitBlockResponseModel>('post', `${basePath}${localVarPath}`,
|
||||||
|
{
|
||||||
|
context: localVarHttpContext,
|
||||||
|
body: submitBlockRequestModel,
|
||||||
|
responseType: <any>responseType_,
|
||||||
|
...(withCredentials ? { withCredentials } : {}),
|
||||||
|
headers: localVarHeaders,
|
||||||
|
observe: observe,
|
||||||
|
transferCache: localVarTransferCache,
|
||||||
|
reportProgress: reportProgress
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
147
utils/sdk/client/angular/api/info.service.ts
generated
Normal file
147
utils/sdk/client/angular/api/info.service.ts
generated
Normal file
|
|
@ -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<InfoModel>;
|
||||||
|
public getInfo(flags?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<InfoModel>>;
|
||||||
|
public getInfo(flags?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<InfoModel>>;
|
||||||
|
public getInfo(flags?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||||
|
|
||||||
|
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
|
||||||
|
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
||||||
|
<any>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<InfoModel>('get', `${basePath}${localVarPath}`,
|
||||||
|
{
|
||||||
|
context: localVarHttpContext,
|
||||||
|
params: localVarQueryParameters,
|
||||||
|
responseType: <any>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<VersionModel>;
|
||||||
|
public version(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<VersionModel>>;
|
||||||
|
public version(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<VersionModel>>;
|
||||||
|
public version(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||||
|
|
||||||
|
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<VersionModel>('get', `${basePath}${localVarPath}`,
|
||||||
|
{
|
||||||
|
context: localVarHttpContext,
|
||||||
|
responseType: <any>responseType_,
|
||||||
|
...(withCredentials ? { withCredentials } : {}),
|
||||||
|
headers: localVarHeaders,
|
||||||
|
observe: observe,
|
||||||
|
transferCache: localVarTransferCache,
|
||||||
|
reportProgress: reportProgress
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
184
utils/sdk/client/angular/configuration.ts
generated
Normal file
184
utils/sdk/client/angular/configuration.ts
generated
Normal file
|
|
@ -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
|
||||||
|
* <a href="https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values">styles</a>.
|
||||||
|
* <p>
|
||||||
|
* See {@link README.md} for more details
|
||||||
|
* </p>
|
||||||
|
*/
|
||||||
|
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
|
||||||
|
* <a href="https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values">styles</a>.
|
||||||
|
* <p>
|
||||||
|
* See {@link README.md} for more details
|
||||||
|
* </p>
|
||||||
|
*/
|
||||||
|
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 <code>undefined</code> 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 <code>undefined</code> 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));
|
||||||
|
}
|
||||||
|
}
|
||||||
20
utils/sdk/client/angular/encoder.ts
generated
Normal file
20
utils/sdk/client/angular/encoder.ts
generated
Normal file
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
7
utils/sdk/client/angular/index.ts
generated
Normal file
7
utils/sdk/client/angular/index.ts
generated
Normal file
|
|
@ -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';
|
||||||
40
utils/sdk/client/angular/model/blockDetailsModel.ts
generated
Normal file
40
utils/sdk/client/angular/model/blockDetailsModel.ts
generated
Normal file
|
|
@ -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<TransactionDetailsModel>;
|
||||||
|
type?: number;
|
||||||
|
}
|
||||||
|
|
||||||
30
utils/sdk/client/angular/model/blockProcessingPerformanceModel.ts
generated
Normal file
30
utils/sdk/client/angular/model/blockProcessingPerformanceModel.ts
generated
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
24
utils/sdk/client/angular/model/blockTemplateModel.ts
generated
Normal file
24
utils/sdk/client/angular/model/blockTemplateModel.ts
generated
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
22
utils/sdk/client/angular/model/blockTemplateRequestModel.ts
generated
Normal file
22
utils/sdk/client/angular/model/blockTemplateRequestModel.ts
generated
Normal file
|
|
@ -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<string>;
|
||||||
|
}
|
||||||
|
|
||||||
17
utils/sdk/client/angular/model/dbStatInfoModel.ts
generated
Normal file
17
utils/sdk/client/angular/model/dbStatInfoModel.ts
generated
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
15
utils/sdk/client/angular/model/heightModel.ts
generated
Normal file
15
utils/sdk/client/angular/model/heightModel.ts
generated
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
62
utils/sdk/client/angular/model/infoModel.ts
generated
Normal file
62
utils/sdk/client/angular/model/infoModel.ts
generated
Normal file
|
|
@ -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<boolean>;
|
||||||
|
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<number>;
|
||||||
|
transactions_volume_per_day?: Array<number>;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
19
utils/sdk/client/angular/model/maintainersInfoModel.ts
generated
Normal file
19
utils/sdk/client/angular/model/maintainersInfoModel.ts
generated
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
21
utils/sdk/client/angular/model/models.ts
generated
Normal file
21
utils/sdk/client/angular/model/models.ts
generated
Normal file
|
|
@ -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';
|
||||||
22
utils/sdk/client/angular/model/performanceModel.ts
generated
Normal file
22
utils/sdk/client/angular/model/performanceModel.ts
generated
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
22
utils/sdk/client/angular/model/posEntryModel.ts
generated
Normal file
22
utils/sdk/client/angular/model/posEntryModel.ts
generated
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
15
utils/sdk/client/angular/model/submitBlockRequestModel.ts
generated
Normal file
15
utils/sdk/client/angular/model/submitBlockRequestModel.ts
generated
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
15
utils/sdk/client/angular/model/submitBlockResponseModel.ts
generated
Normal file
15
utils/sdk/client/angular/model/submitBlockResponseModel.ts
generated
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
17
utils/sdk/client/angular/model/transactionAttachmentModel.ts
generated
Normal file
17
utils/sdk/client/angular/model/transactionAttachmentModel.ts
generated
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
31
utils/sdk/client/angular/model/transactionDetailsModel.ts
generated
Normal file
31
utils/sdk/client/angular/model/transactionDetailsModel.ts
generated
Normal file
|
|
@ -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<TransactionAttachmentModel>;
|
||||||
|
blob?: string;
|
||||||
|
blob_size?: number;
|
||||||
|
extra?: Array<TransactionExtraModel>;
|
||||||
|
fee?: number;
|
||||||
|
id?: string;
|
||||||
|
ins?: Array<TransactionInputModel>;
|
||||||
|
keeper_block?: number;
|
||||||
|
object_in_json?: string;
|
||||||
|
outs?: Array<TransactionOutputModel>;
|
||||||
|
pub_key?: string;
|
||||||
|
timestamp?: number;
|
||||||
|
}
|
||||||
|
|
||||||
17
utils/sdk/client/angular/model/transactionExtraModel.ts
generated
Normal file
17
utils/sdk/client/angular/model/transactionExtraModel.ts
generated
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
19
utils/sdk/client/angular/model/transactionInputModel.ts
generated
Normal file
19
utils/sdk/client/angular/model/transactionInputModel.ts
generated
Normal file
|
|
@ -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<number>;
|
||||||
|
htlc_origin?: string;
|
||||||
|
kimage_or_ms_id?: string;
|
||||||
|
multisig_count?: number;
|
||||||
|
}
|
||||||
|
|
||||||
19
utils/sdk/client/angular/model/transactionOutputModel.ts
generated
Normal file
19
utils/sdk/client/angular/model/transactionOutputModel.ts
generated
Normal file
|
|
@ -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<string>;
|
||||||
|
}
|
||||||
|
|
||||||
38
utils/sdk/client/angular/model/txGenerationContextModel.ts
generated
Normal file
38
utils/sdk/client/angular/model/txGenerationContextModel.ts
generated
Normal file
|
|
@ -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<string>;
|
||||||
|
blinded_asset_ids?: Array<string>;
|
||||||
|
amount_commitments?: Array<string>;
|
||||||
|
asset_id_blinding_masks?: Array<string>;
|
||||||
|
amounts?: Array<string>;
|
||||||
|
amount_blinding_masks?: Array<string>;
|
||||||
|
pseudo_outs_blinded_asset_ids?: Array<string>;
|
||||||
|
pseudo_outs_plus_real_out_blinding_masks?: Array<string>;
|
||||||
|
real_zc_ins_asset_ids?: Array<string>;
|
||||||
|
zc_input_amounts?: Array<number>;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
25
utils/sdk/client/angular/model/txPoolPerformanceModel.ts
generated
Normal file
25
utils/sdk/client/angular/model/txPoolPerformanceModel.ts
generated
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
39
utils/sdk/client/angular/model/txProcessingPerformanceModel.ts
generated
Normal file
39
utils/sdk/client/angular/model/txProcessingPerformanceModel.ts
generated
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
19
utils/sdk/client/angular/model/versionModel.ts
generated
Normal file
19
utils/sdk/client/angular/model/versionModel.ts
generated
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
6
utils/sdk/client/angular/ng-package.json
generated
Normal file
6
utils/sdk/client/angular/ng-package.json
generated
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"$schema": "./node_modules/ng-packagr/ng-package.schema.json",
|
||||||
|
"lib": {
|
||||||
|
"entryFile": "index.ts"
|
||||||
|
}
|
||||||
|
}
|
||||||
34
utils/sdk/client/angular/package.json
generated
Normal file
34
utils/sdk/client/angular/package.json
generated
Normal file
|
|
@ -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"
|
||||||
|
}}
|
||||||
69
utils/sdk/client/angular/param.ts
generated
Normal file
69
utils/sdk/client/angular/param.ts
generated
Normal file
|
|
@ -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 <a href="https://swagger.io/specification/#data-types">OpenAPI Specification: Data Types</a>
|
||||||
|
*/
|
||||||
|
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 <a href="https://swagger.io/specification/#data-types">OpenAPI Specification: Data Types</a>
|
||||||
|
*/
|
||||||
|
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;
|
||||||
|
}
|
||||||
15
utils/sdk/client/angular/provide-api.ts
generated
Normal file
15
utils/sdk/client/angular/provide-api.ts
generated
Normal file
|
|
@ -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 }),
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
}
|
||||||
29
utils/sdk/client/angular/tsconfig.json
generated
Normal file
29
utils/sdk/client/angular/tsconfig.json
generated
Normal file
|
|
@ -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"
|
||||||
|
]
|
||||||
|
}
|
||||||
9
utils/sdk/client/angular/variables.ts
generated
Normal file
9
utils/sdk/client/angular/variables.ts
generated
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
import { InjectionToken } from '@angular/core';
|
||||||
|
|
||||||
|
export const BASE_PATH = new InjectionToken<string>('basePath');
|
||||||
|
export const COLLECTION_FORMATS = {
|
||||||
|
'csv': ',',
|
||||||
|
'tsv': ' ',
|
||||||
|
'ssv': ' ',
|
||||||
|
'pipes': '|'
|
||||||
|
}
|
||||||
8
utils/sdk/packages/angular.json
Normal file
8
utils/sdk/packages/angular.json
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"additionalProperties": {
|
||||||
|
"apiModulePrefix":"lthn",
|
||||||
|
"configurationPrefix":"lthn",
|
||||||
|
"npmName":"@lthn/angular",
|
||||||
|
"ngVersion": 20
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"additionalProperties": {
|
|
||||||
"apiModulePrefix":"letheanchainsdk",
|
|
||||||
"configurationPrefix":"letheanchainsdk",
|
|
||||||
"npmName":"@snider/sdk-typescript-angular",
|
|
||||||
"ngVersion": 12
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Add table
Reference in a new issue