diff --git a/lib/skyapi/typescript-angular/.gitignore b/lib/skyapi/typescript-angular/.gitignore new file mode 100644 index 0000000..149b576 --- /dev/null +++ b/lib/skyapi/typescript-angular/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/lib/skyapi/typescript-angular/.openapi-generator-ignore b/lib/skyapi/typescript-angular/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/lib/skyapi/typescript-angular/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/lib/skyapi/typescript-angular/.openapi-generator/VERSION b/lib/skyapi/typescript-angular/.openapi-generator/VERSION new file mode 100644 index 0000000..f9dfe82 --- /dev/null +++ b/lib/skyapi/typescript-angular/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.0.0-beta2 \ No newline at end of file diff --git a/lib/skyapi/typescript-angular/README.md b/lib/skyapi/typescript-angular/README.md new file mode 100644 index 0000000..fe3df5f --- /dev/null +++ b/lib/skyapi/typescript-angular/README.md @@ -0,0 +1,178 @@ +## libsky-angular@0.25.1 + +### Building + +To install the required dependencies and to build the typescript sources run: +``` +npm install +npm run build +``` + +### publishing + +First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) + +### consuming + +Navigate to the folder of your consuming project and run one of next commands. + +_published:_ + +``` +npm install libsky-angular@0.25.1 --save +``` + +_without publishing (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE/dist --save +``` + +_using `npm link`:_ + +In PATH_TO_GENERATED_PACKAGE/dist: +``` +npm link +``` + +In your project: +``` +npm link libsky-angular +``` + +__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. +Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround. +Published packages are not effected by this issue. + + +#### General usage + +In your Angular project: + + +``` +// without configuring providers +import { ApiModule } from 'libsky-angular'; +import { HttpClientModule } from '@angular/common/http'; + + +@NgModule({ + imports: [ + ApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +// configuring providers +import { ApiModule, Configuration, ConfigurationParameters } from 'libsky-angular'; + +export function apiConfigFactory (): Configuration => { + const params: ConfigurationParameters = { + // set configuration parameters here. + } + return new Configuration(params); +} + +@NgModule({ + imports: [ ApiModule.forRoot(apiConfigFactory) ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +import { DefaultApi } from 'libsky-angular'; + +export class AppComponent { + constructor(private apiGateway: DefaultApi) { } +} +``` + +Note: The ApiModule is restricted to being instantiated once app wide. +This is to ensure that all services are treated as singletons. + +#### Using multiple OpenAPI files / APIs / ApiModules +In order to use multiple `ApiModules` generated from different OpenAPI files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: +``` +import { ApiModule } from 'my-api-path'; +import { ApiModule as OtherApiModule } from 'my-other-api-path'; +import { HttpClientModule } from '@angular/common/http'; + + +@NgModule({ + imports: [ + ApiModule, + OtherApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ] +}) +export class AppModule { + +} +``` + + +### Set service base path +If different than the generated base path, during app bootstrap, you can provide the base path to your service. + +``` +import { BASE_PATH } from 'libsky-angular'; + +bootstrap(AppComponent, [ + { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, +]); +``` +or + +``` +import { BASE_PATH } from 'libsky-angular'; + +@NgModule({ + imports: [], + declarations: [ AppComponent ], + providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + + +#### Using @angular/cli +First extend your `src/environments/*.ts` files by adding the corresponding base path: + +``` +export const environment = { + production: false, + API_BASE_PATH: 'http://127.0.0.1:8080' +}; +``` + +In the src/app/app.module.ts: +``` +import { BASE_PATH } from 'libsky-angular'; +import { environment } from '../environments/environment'; + +@NgModule({ + declarations: [ + AppComponent + ], + imports: [ ], + providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }], + bootstrap: [ AppComponent ] +}) +export class AppModule { } +``` diff --git a/lib/skyapi/typescript-angular/api.module.ts b/lib/skyapi/typescript-angular/api.module.ts new file mode 100644 index 0000000..48da2df --- /dev/null +++ b/lib/skyapi/typescript-angular/api.module.ts @@ -0,0 +1,33 @@ +import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; +import { Configuration } from './configuration'; +import { HttpClient } from '@angular/common/http'; + + +import { DefaultService } from './api/default.service'; + +@NgModule({ + imports: [], + declarations: [], + exports: [], + providers: [ + DefaultService ] +}) +export class ApiModule { + public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { + return { + ngModule: ApiModule, + providers: [ { provide: Configuration, useFactory: configurationFactory } ] + }; + } + + constructor( @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: HttpClient) { + if (parentModule) { + throw new Error('ApiModule 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/lib/skyapi/typescript-angular/api/api.ts b/lib/skyapi/typescript-angular/api/api.ts new file mode 100644 index 0000000..8e76619 --- /dev/null +++ b/lib/skyapi/typescript-angular/api/api.ts @@ -0,0 +1,3 @@ +export * from './default.service'; +import { DefaultService } from './default.service'; +export const APIS = [DefaultService]; diff --git a/lib/skyapi/typescript-angular/api/default.service.ts b/lib/skyapi/typescript-angular/api/default.service.ts new file mode 100644 index 0000000..df8a5fd --- /dev/null +++ b/lib/skyapi/typescript-angular/api/default.service.ts @@ -0,0 +1,2474 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * 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 } from '@angular/common/http'; +import { CustomHttpUrlEncodingCodec } from '../encoder'; + +import { Observable } from 'rxjs/Observable'; + +import { InlineObject } from '../model/inlineObject'; +import { InlineResponse200 } from '../model/inlineResponse200'; +import { InlineResponse2001 } from '../model/inlineResponse2001'; +import { InlineResponse2002 } from '../model/inlineResponse2002'; +import { InlineResponse2003 } from '../model/inlineResponse2003'; +import { InlineResponse2004 } from '../model/inlineResponse2004'; +import { InlineResponse2005 } from '../model/inlineResponse2005'; +import { InlineResponse2006 } from '../model/inlineResponse2006'; +import { InlineResponse2007 } from '../model/inlineResponse2007'; +import { InlineResponseDefault } from '../model/inlineResponseDefault'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + +@Injectable() +export class DefaultService { + + protected basePath = 'http://127.0.0.1:6420'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + + if (configuration) { + this.configuration = configuration; + this.configuration.basePath = configuration.basePath || basePath || this.basePath; + + } else { + this.configuration.basePath = basePath || this.basePath; + } + } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + for (const consume of consumes) { + if (form === consume) { + return true; + } + } + return false; + } + + + /** + * Returns the total number of unique address that have coins. + * + * @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 addressCount(observe?: 'body', reportProgress?: boolean): Observable; + public addressCount(observe?: 'response', reportProgress?: boolean): Observable>; + public addressCount(observe?: 'events', reportProgress?: boolean): Observable>; + public addressCount(observe: any = 'body', reportProgress: boolean = false ): Observable { + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.configuration.basePath}/api/v1/addresscount`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * + * Returns the historical, spent outputs associated with an address + * @param address address to filter by + * @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 addressUxouts(address: string, observe?: 'body', reportProgress?: boolean): Observable>; + public addressUxouts(address: string, observe?: 'response', reportProgress?: boolean): Observable>>; + public addressUxouts(address: string, observe?: 'events', reportProgress?: boolean): Observable>>; + public addressUxouts(address: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (address === null || address === undefined) { + throw new Error('Required parameter address was null or undefined when calling addressUxouts.'); + } + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (address !== undefined && address !== null) { + queryParameters = queryParameters.set('address', address); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get>(`${this.configuration.basePath}/api/v1/address_uxouts`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Returns the balance of one or more addresses, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. + * + * @param addrs command separated list of addresses + * @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 balanceGet(addrs: string, observe?: 'body', reportProgress?: boolean): Observable; + public balanceGet(addrs: string, observe?: 'response', reportProgress?: boolean): Observable>; + public balanceGet(addrs: string, observe?: 'events', reportProgress?: boolean): Observable>; + public balanceGet(addrs: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (addrs === null || addrs === undefined) { + throw new Error('Required parameter addrs was null or undefined when calling balanceGet.'); + } + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (addrs !== undefined && addrs !== null) { + queryParameters = queryParameters.set('addrs', addrs); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.configuration.basePath}/api/v1/balance`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Returns the balance of one or more addresses, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. + * + * @param addrs command separated list of addresses + * @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 balancePost(addrs: string, observe?: 'body', reportProgress?: boolean): Observable; + public balancePost(addrs: string, observe?: 'response', reportProgress?: boolean): Observable>; + public balancePost(addrs: string, observe?: 'events', reportProgress?: boolean): Observable>; + public balancePost(addrs: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (addrs === null || addrs === undefined) { + throw new Error('Required parameter addrs was null or undefined when calling balancePost.'); + } + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (addrs !== undefined && addrs !== null) { + queryParameters = queryParameters.set('addrs', addrs); + } + + let headers = this.defaultHeaders; + + // authentication (csrfAuth) required + if (this.configuration.apiKeys && this.configuration.apiKeys["X-CSRF-TOKEN"]) { + headers = headers.set('X-CSRF-TOKEN', this.configuration.apiKeys["X-CSRF-TOKEN"]); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.post(`${this.configuration.basePath}/api/v1/balance`, + null, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * + * Returns a block by hash or seq. Note: only one of hash or seq is allowed + * @param hash + * @param seq + * @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 block(hash?: string, seq?: number, observe?: 'body', reportProgress?: boolean): Observable; + public block(hash?: string, seq?: number, observe?: 'response', reportProgress?: boolean): Observable>; + public block(hash?: string, seq?: number, observe?: 'events', reportProgress?: boolean): Observable>; + public block(hash?: string, seq?: number, observe: any = 'body', reportProgress: boolean = false ): Observable { + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (hash !== undefined && hash !== null) { + queryParameters = queryParameters.set('hash', hash); + } + if (seq !== undefined && seq !== null) { + queryParameters = queryParameters.set('seq', seq); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.configuration.basePath}/api/v1/block`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Returns the blockchain metadata. + * + * @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 blockchainMetadata(observe?: 'body', reportProgress?: boolean): Observable; + public blockchainMetadata(observe?: 'response', reportProgress?: boolean): Observable>; + public blockchainMetadata(observe?: 'events', reportProgress?: boolean): Observable>; + public blockchainMetadata(observe: any = 'body', reportProgress: boolean = false ): Observable { + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.configuration.basePath}/api/v1/blockchain/metadata`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Returns the blockchain sync progress. + * + * @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 blockchainProgress(observe?: 'body', reportProgress?: boolean): Observable; + public blockchainProgress(observe?: 'response', reportProgress?: boolean): Observable>; + public blockchainProgress(observe?: 'events', reportProgress?: boolean): Observable>; + public blockchainProgress(observe: any = 'body', reportProgress: boolean = false ): Observable { + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.configuration.basePath}/api/v1/blockchain/progress`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * blocksHandler returns blocks between a start and end point, + * or an explicit list of sequences. If using start and end, the block sequences include both the start and end point. Explicit sequences cannot be combined with start and end. Without verbose. + * @param start + * @param end + * @param seqs + * @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 blocksGet(start?: number, end?: number, seqs?: Array, observe?: 'body', reportProgress?: boolean): Observable; + public blocksGet(start?: number, end?: number, seqs?: Array, observe?: 'response', reportProgress?: boolean): Observable>; + public blocksGet(start?: number, end?: number, seqs?: Array, observe?: 'events', reportProgress?: boolean): Observable>; + public blocksGet(start?: number, end?: number, seqs?: Array, observe: any = 'body', reportProgress: boolean = false ): Observable { + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (start !== undefined && start !== null) { + queryParameters = queryParameters.set('start', start); + } + if (end !== undefined && end !== null) { + queryParameters = queryParameters.set('end', end); + } + if (seqs) { + queryParameters = queryParameters.set('seqs', seqs.join(COLLECTION_FORMATS['csv'])); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.configuration.basePath}/api/v1/blocks`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * blocksHandler returns blocks between a start and end point, + * or an explicit list of sequences. If using start and end, the block sequences include both the start and end point. Explicit sequences cannot be combined with start and end. Without verbose + * @param start + * @param end + * @param seqs + * @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 blocksPost(start?: number, end?: number, seqs?: Array, observe?: 'body', reportProgress?: boolean): Observable; + public blocksPost(start?: number, end?: number, seqs?: Array, observe?: 'response', reportProgress?: boolean): Observable>; + public blocksPost(start?: number, end?: number, seqs?: Array, observe?: 'events', reportProgress?: boolean): Observable>; + public blocksPost(start?: number, end?: number, seqs?: Array, observe: any = 'body', reportProgress: boolean = false ): Observable { + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (start !== undefined && start !== null) { + queryParameters = queryParameters.set('start', start); + } + if (end !== undefined && end !== null) { + queryParameters = queryParameters.set('end', end); + } + if (seqs) { + queryParameters = queryParameters.set('seqs', seqs.join(COLLECTION_FORMATS['csv'])); + } + + let headers = this.defaultHeaders; + + // authentication (csrfAuth) required + if (this.configuration.apiKeys && this.configuration.apiKeys["X-CSRF-TOKEN"]) { + headers = headers.set('X-CSRF-TOKEN', this.configuration.apiKeys["X-CSRF-TOKEN"]); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.post(`${this.configuration.basePath}/api/v1/blocks`, + null, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * + * coinSupplyHandler returns coin distribution supply stats + * @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 coinSupply(observe?: 'body', reportProgress?: boolean): Observable; + public coinSupply(observe?: 'response', reportProgress?: boolean): Observable>; + public coinSupply(observe?: 'events', reportProgress?: boolean): Observable>; + public coinSupply(observe: any = 'body', reportProgress: boolean = false ): Observable { + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.configuration.basePath}/api/v1/coinSupply`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Creates a new CSRF token. Previous CSRF tokens are invalidated by this call. + * + * @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 csrf(observe?: 'body', reportProgress?: boolean): Observable; + public csrf(observe?: 'response', reportProgress?: boolean): Observable>; + public csrf(observe?: 'events', reportProgress?: boolean): Observable>; + public csrf(observe: any = 'body', reportProgress: boolean = false ): Observable { + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.configuration.basePath}/api/v1/csrf`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * defaultConnectionsHandler returns the list of default hardcoded bootstrap addresses.\\n They are not necessarily connected to. + * + * @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 defaultConnections(observe?: 'body', reportProgress?: boolean): Observable>; + public defaultConnections(observe?: 'response', reportProgress?: boolean): Observable>>; + public defaultConnections(observe?: 'events', reportProgress?: boolean): Observable>>; + public defaultConnections(observe: any = 'body', reportProgress: boolean = false ): Observable { + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get>(`${this.configuration.basePath}/api/v1/network/defaultConnections`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * + * Returns all transactions (confirmed and unconfirmed) for an address + * @param address tags to filter by + * @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 explorerAddress(address?: string, observe?: 'body', reportProgress?: boolean): Observable>; + public explorerAddress(address?: string, observe?: 'response', reportProgress?: boolean): Observable>>; + public explorerAddress(address?: string, observe?: 'events', reportProgress?: boolean): Observable>>; + public explorerAddress(address?: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (address !== undefined && address !== null) { + queryParameters = queryParameters.set('address', address); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get>(`${this.configuration.basePath}/api/v1/explorer/address`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Returns node health data. + * + * @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 health(observe?: 'body', reportProgress?: boolean): Observable; + public health(observe?: 'response', reportProgress?: boolean): Observable>; + public health(observe?: 'events', reportProgress?: boolean): Observable>; + public health(observe: any = 'body', reportProgress: boolean = false ): Observable { + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.configuration.basePath}/api/v1/health`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * + * Returns the most recent N blocks on the blockchain + * @param num + * @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 lastBlocks(num: number, observe?: 'body', reportProgress?: boolean): Observable; + public lastBlocks(num: number, observe?: 'response', reportProgress?: boolean): Observable>; + public lastBlocks(num: number, observe?: 'events', reportProgress?: boolean): Observable>; + public lastBlocks(num: number, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (num === null || num === undefined) { + throw new Error('Required parameter num was null or undefined when calling lastBlocks.'); + } + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (num !== undefined && num !== null) { + queryParameters = queryParameters.set('num', num); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.configuration.basePath}/api/v1/last_blocks`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * This endpoint returns a specific connection. + * + * @param addr Address port + * @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 networkConnection(addr: string, observe?: 'body', reportProgress?: boolean): Observable; + public networkConnection(addr: string, observe?: 'response', reportProgress?: boolean): Observable>; + public networkConnection(addr: string, observe?: 'events', reportProgress?: boolean): Observable>; + public networkConnection(addr: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (addr === null || addr === undefined) { + throw new Error('Required parameter addr was null or undefined when calling networkConnection.'); + } + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (addr !== undefined && addr !== null) { + queryParameters = queryParameters.set('addr', addr); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.configuration.basePath}/api/v1/network/connection`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * This endpoint returns all outgoings connections. + * + * @param states Connection status. + * @param direction Direction of the connection. + * @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 networkConnections(states?: 'pending' | 'connected' | 'introduced', direction?: 'connected' | 'introduced', observe?: 'body', reportProgress?: boolean): Observable>; + public networkConnections(states?: 'pending' | 'connected' | 'introduced', direction?: 'connected' | 'introduced', observe?: 'response', reportProgress?: boolean): Observable>>; + public networkConnections(states?: 'pending' | 'connected' | 'introduced', direction?: 'connected' | 'introduced', observe?: 'events', reportProgress?: boolean): Observable>>; + public networkConnections(states?: 'pending' | 'connected' | 'introduced', direction?: 'connected' | 'introduced', observe: any = 'body', reportProgress: boolean = false ): Observable { + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (states !== undefined && states !== null) { + queryParameters = queryParameters.set('states', states); + } + if (direction !== undefined && direction !== null) { + queryParameters = queryParameters.set('direction', direction); + } + + let headers = this.defaultHeaders; + + // authentication (csrfAuth) required + if (this.configuration.apiKeys && this.configuration.apiKeys["X-CSRF-TOKEN"]) { + headers = headers.set('X-CSRF-TOKEN', this.configuration.apiKeys["X-CSRF-TOKEN"]); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get>(`${this.configuration.basePath}/api/v1/network/connections`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * + * This endpoint disconnects a connection by ID or address + * @param id Address id. + * @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 networkConnectionsDisconnect(id: string, observe?: 'body', reportProgress?: boolean): Observable; + public networkConnectionsDisconnect(id: string, observe?: 'response', reportProgress?: boolean): Observable>; + public networkConnectionsDisconnect(id: string, observe?: 'events', reportProgress?: boolean): Observable>; + public networkConnectionsDisconnect(id: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling networkConnectionsDisconnect.'); + } + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (id !== undefined && id !== null) { + queryParameters = queryParameters.set('id', id); + } + + let headers = this.defaultHeaders; + + // authentication (csrfAuth) required + if (this.configuration.apiKeys && this.configuration.apiKeys["X-CSRF-TOKEN"]) { + headers = headers.set('X-CSRF-TOKEN', this.configuration.apiKeys["X-CSRF-TOKEN"]); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.post(`${this.configuration.basePath}/api/v1/network/connection/disconnect`, + null, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * + * This endpoint returns all connections found through peer exchange + * @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 networkConnectionsExchange(observe?: 'body', reportProgress?: boolean): Observable>; + public networkConnectionsExchange(observe?: 'response', reportProgress?: boolean): Observable>>; + public networkConnectionsExchange(observe?: 'events', reportProgress?: boolean): Observable>>; + public networkConnectionsExchange(observe: any = 'body', reportProgress: boolean = false ): Observable { + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get>(`${this.configuration.basePath}/api/v1/network/connections/exchange`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * trustConnectionsHandler returns all trusted connections.\\n They are not necessarily connected to. In the default configuration, these will be a subset of the default hardcoded bootstrap addresses. + * + * @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 networkConnectionsTrust(observe?: 'body', reportProgress?: boolean): Observable>; + public networkConnectionsTrust(observe?: 'response', reportProgress?: boolean): Observable>>; + public networkConnectionsTrust(observe?: 'events', reportProgress?: boolean): Observable>>; + public networkConnectionsTrust(observe: any = 'body', reportProgress: boolean = false ): Observable { + + let headers = this.defaultHeaders; + + // authentication (csrfAuth) required + if (this.configuration.apiKeys && this.configuration.apiKeys["X-CSRF-TOKEN"]) { + headers = headers.set('X-CSRF-TOKEN', this.configuration.apiKeys["X-CSRF-TOKEN"]); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get>(`${this.configuration.basePath}/api/v1/network/connections/trust`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * If neither addrs nor hashes are specificed, return all unspent outputs. If only one filter is specified, then return outputs match the filter. Both filters cannot be specified. + * + * @param address + * @param hash + * @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 outputsGet(address?: Array, hash?: Array, observe?: 'body', reportProgress?: boolean): Observable; + public outputsGet(address?: Array, hash?: Array, observe?: 'response', reportProgress?: boolean): Observable>; + public outputsGet(address?: Array, hash?: Array, observe?: 'events', reportProgress?: boolean): Observable>; + public outputsGet(address?: Array, hash?: Array, observe: any = 'body', reportProgress: boolean = false ): Observable { + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (address) { + queryParameters = queryParameters.set('address', address.join(COLLECTION_FORMATS['csv'])); + } + if (hash) { + queryParameters = queryParameters.set('hash', hash.join(COLLECTION_FORMATS['csv'])); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.configuration.basePath}/api/v1/outputs`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * If neither addrs nor hashes are specificed, return all unspent outputs. If only one filter is specified, then return outputs match the filter. Both filters cannot be specified. + * + * @param address + * @param hash + * @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 outputsPost(address?: string, hash?: string, observe?: 'body', reportProgress?: boolean): Observable; + public outputsPost(address?: string, hash?: string, observe?: 'response', reportProgress?: boolean): Observable>; + public outputsPost(address?: string, hash?: string, observe?: 'events', reportProgress?: boolean): Observable>; + public outputsPost(address?: string, hash?: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (address !== undefined && address !== null) { + queryParameters = queryParameters.set('address', address); + } + if (hash !== undefined && hash !== null) { + queryParameters = queryParameters.set('hash', hash); + } + + let headers = this.defaultHeaders; + + // authentication (csrfAuth) required + if (this.configuration.apiKeys && this.configuration.apiKeys["X-CSRF-TOKEN"]) { + headers = headers.set('X-CSRF-TOKEN', this.configuration.apiKeys["X-CSRF-TOKEN"]); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.post(`${this.configuration.basePath}/api/v1/outputs`, + null, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * + * Returns pending (unconfirmed) transactions without verbose + * @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 pendingTxs(observe?: 'body', reportProgress?: boolean): Observable>; + public pendingTxs(observe?: 'response', reportProgress?: boolean): Observable>>; + public pendingTxs(observe?: 'events', reportProgress?: boolean): Observable>>; + public pendingTxs(observe: any = 'body', reportProgress: boolean = false ): Observable { + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get>(`${this.configuration.basePath}/api/v1/pendingTxs`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * + * Broadcasts all unconfirmed transactions from the unconfirmed transaction pool + * @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 resendUnconfirmedTxns(observe?: 'body', reportProgress?: boolean): Observable; + public resendUnconfirmedTxns(observe?: 'response', reportProgress?: boolean): Observable>; + public resendUnconfirmedTxns(observe?: 'events', reportProgress?: boolean): Observable>; + public resendUnconfirmedTxns(observe: any = 'body', reportProgress: boolean = false ): Observable { + + let headers = this.defaultHeaders; + + // authentication (csrfAuth) required + if (this.configuration.apiKeys && this.configuration.apiKeys["X-CSRF-TOKEN"]) { + headers = headers.set('X-CSRF-TOKEN', this.configuration.apiKeys["X-CSRF-TOKEN"]); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.post(`${this.configuration.basePath}/api/v1/resendUnconfirmedTxns`, + null, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Returns the top skycoin holders. + * + * @param includeDistribution include distribution addresses or not, default value false + * @param n include distribution addresses or not, default value false + * @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 richlist(includeDistribution?: boolean, n?: string, observe?: 'body', reportProgress?: boolean): Observable; + public richlist(includeDistribution?: boolean, n?: string, observe?: 'response', reportProgress?: boolean): Observable>; + public richlist(includeDistribution?: boolean, n?: string, observe?: 'events', reportProgress?: boolean): Observable>; + public richlist(includeDistribution?: boolean, n?: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (includeDistribution !== undefined && includeDistribution !== null) { + queryParameters = queryParameters.set('include-distribution', includeDistribution); + } + if (n !== undefined && n !== null) { + queryParameters = queryParameters.set('n', n); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.configuration.basePath}/api/v1/richlist`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * + * Returns a transaction identified by its txid hash with just id + * @param txid transaction hash + * @param encoded return as a raw encoded transaction. + * @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 transaction(txid: string, encoded?: boolean, observe?: 'body', reportProgress?: boolean): Observable; + public transaction(txid: string, encoded?: boolean, observe?: 'response', reportProgress?: boolean): Observable>; + public transaction(txid: string, encoded?: boolean, observe?: 'events', reportProgress?: boolean): Observable>; + public transaction(txid: string, encoded?: boolean, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (txid === null || txid === undefined) { + throw new Error('Required parameter txid was null or undefined when calling transaction.'); + } + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (txid !== undefined && txid !== null) { + queryParameters = queryParameters.set('txid', txid); + } + if (encoded !== undefined && encoded !== null) { + queryParameters = queryParameters.set('encoded', encoded); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.configuration.basePath}/api/v1/transaction`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Broadcast a hex-encoded, serialized transaction to the network. + * + * @param rawtx hex-encoded serialized transaction string. + * @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 transactionInject(rawtx: string, observe?: 'body', reportProgress?: boolean): Observable; + public transactionInject(rawtx: string, observe?: 'response', reportProgress?: boolean): Observable>; + public transactionInject(rawtx: string, observe?: 'events', reportProgress?: boolean): Observable>; + public transactionInject(rawtx: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (rawtx === null || rawtx === undefined) { + throw new Error('Required parameter rawtx was null or undefined when calling transactionInject.'); + } + + let headers = this.defaultHeaders; + if (rawtx !== undefined && rawtx !== null) { + headers = headers.set('rawtx', String(rawtx)); + } + + // authentication (csrfAuth) required + if (this.configuration.apiKeys && this.configuration.apiKeys["X-CSRF-TOKEN"]) { + headers = headers.set('X-CSRF-TOKEN', this.configuration.apiKeys["X-CSRF-TOKEN"]); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.post(`${this.configuration.basePath}/api/v2/transaction/inject`, + null, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Returns the hex-encoded byte serialization of a transaction. The transaction may be confirmed or unconfirmed. + * + * @param txid Transaction id hash + * @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 transactionRaw(txid?: string, observe?: 'body', reportProgress?: boolean): Observable; + public transactionRaw(txid?: string, observe?: 'response', reportProgress?: boolean): Observable>; + public transactionRaw(txid?: string, observe?: 'events', reportProgress?: boolean): Observable>; + public transactionRaw(txid?: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (txid !== undefined && txid !== null) { + queryParameters = queryParameters.set('txid', txid); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.configuration.basePath}/api/v2/transaction/raw`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * + * Decode and verify an encoded transaction + * @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 transactionVerify(observe?: 'body', reportProgress?: boolean): Observable; + public transactionVerify(observe?: 'response', reportProgress?: boolean): Observable>; + public transactionVerify(observe?: 'events', reportProgress?: boolean): Observable>; + public transactionVerify(observe: any = 'body', reportProgress: boolean = false ): Observable { + + let headers = this.defaultHeaders; + + // authentication (csrfAuth) required + if (this.configuration.apiKeys && this.configuration.apiKeys["X-CSRF-TOKEN"]) { + headers = headers.set('X-CSRF-TOKEN', this.configuration.apiKeys["X-CSRF-TOKEN"]); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.post(`${this.configuration.basePath}/api/v2/transaction/verify`, + null, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Returns transactions that match the filters. + * + * @param addrs command separated list of addresses + * @param confirmed Whether the transactions should be confirmed [optional, must be 0 or 1; if not provided, returns all] + * @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 transactionsGet(addrs?: string, confirmed?: string, observe?: 'body', reportProgress?: boolean): Observable; + public transactionsGet(addrs?: string, confirmed?: string, observe?: 'response', reportProgress?: boolean): Observable>; + public transactionsGet(addrs?: string, confirmed?: string, observe?: 'events', reportProgress?: boolean): Observable>; + public transactionsGet(addrs?: string, confirmed?: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (addrs !== undefined && addrs !== null) { + queryParameters = queryParameters.set('addrs', addrs); + } + if (confirmed !== undefined && confirmed !== null) { + queryParameters = queryParameters.set('confirmed', confirmed); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.configuration.basePath}/api/v1/transactions`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Returns transactions that match the filters. + * + * @param addrs command separated list of addresses + * @param confirmed Whether the transactions should be confirmed [optional, must be 0 or 1; if not provided, returns all] + * @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 transactionsPost(addrs?: string, confirmed?: string, observe?: 'body', reportProgress?: boolean): Observable; + public transactionsPost(addrs?: string, confirmed?: string, observe?: 'response', reportProgress?: boolean): Observable>; + public transactionsPost(addrs?: string, confirmed?: string, observe?: 'events', reportProgress?: boolean): Observable>; + public transactionsPost(addrs?: string, confirmed?: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (addrs !== undefined && addrs !== null) { + queryParameters = queryParameters.set('addrs', addrs); + } + if (confirmed !== undefined && confirmed !== null) { + queryParameters = queryParameters.set('confirmed', confirmed); + } + + let headers = this.defaultHeaders; + + // authentication (csrfAuth) required + if (this.configuration.apiKeys && this.configuration.apiKeys["X-CSRF-TOKEN"]) { + headers = headers.set('X-CSRF-TOKEN', this.configuration.apiKeys["X-CSRF-TOKEN"]); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.post(`${this.configuration.basePath}/api/v1/transactions`, + null, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Returns an unspent output by ID. + * + * @param uxid uxid to filter by + * @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 uxout(uxid?: string, observe?: 'body', reportProgress?: boolean): Observable; + public uxout(uxid?: string, observe?: 'response', reportProgress?: boolean): Observable>; + public uxout(uxid?: string, observe?: 'events', reportProgress?: boolean): Observable>; + public uxout(uxid?: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (uxid !== undefined && uxid !== null) { + queryParameters = queryParameters.set('uxid', uxid); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.configuration.basePath}/api/v1/uxout`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Verifies a Skycoin address. + * + * @param address Address id. + * @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 verifyAddress(address: string, observe?: 'body', reportProgress?: boolean): Observable; + public verifyAddress(address: string, observe?: 'response', reportProgress?: boolean): Observable>; + public verifyAddress(address: string, observe?: 'events', reportProgress?: boolean): Observable>; + public verifyAddress(address: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (address === null || address === undefined) { + throw new Error('Required parameter address was null or undefined when calling verifyAddress.'); + } + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (address !== undefined && address !== null) { + queryParameters = queryParameters.set('address', address); + } + + let headers = this.defaultHeaders; + + // authentication (csrfAuth) required + if (this.configuration.apiKeys && this.configuration.apiKeys["X-CSRF-TOKEN"]) { + headers = headers.set('X-CSRF-TOKEN', this.configuration.apiKeys["X-CSRF-TOKEN"]); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.post(`${this.configuration.basePath}/api/v2/address/verify`, + null, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * + * versionHandler returns the application version info + * @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): Observable; + public version(observe?: 'response', reportProgress?: boolean): Observable>; + public version(observe?: 'events', reportProgress?: boolean): Observable>; + public version(observe: any = 'body', reportProgress: boolean = false ): Observable { + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.configuration.basePath}/api/v1/version`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Returns a wallet by id. + * + * @param id tags to filter by + * @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 wallet(id: string, observe?: 'body', reportProgress?: boolean): Observable; + public wallet(id: string, observe?: 'response', reportProgress?: boolean): Observable>; + public wallet(id: string, observe?: 'events', reportProgress?: boolean): Observable>; + public wallet(id: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling wallet.'); + } + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (id !== undefined && id !== null) { + queryParameters = queryParameters.set('id', id); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.configuration.basePath}/api/v1/wallet`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Returns the wallet's balance, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. + * + * @param id tags to filter by + * @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 walletBalance(id: string, observe?: 'body', reportProgress?: boolean): Observable; + public walletBalance(id: string, observe?: 'response', reportProgress?: boolean): Observable>; + public walletBalance(id: string, observe?: 'events', reportProgress?: boolean): Observable>; + public walletBalance(id: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling walletBalance.'); + } + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (id !== undefined && id !== null) { + queryParameters = queryParameters.set('id', id); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.configuration.basePath}/api/v1/wallet/balance`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * + * Loads wallet from seed, will scan ahead N address and load addresses till the last one that have coins. + * @param seed Wallet seed. + * @param label Wallet label. + * @param scan The number of addresses to scan ahead for balances. + * @param encrypt Encrypt wallet. + * @param password Wallet Password + * @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 walletCreate(seed: string, label: string, scan?: number, encrypt?: boolean, password?: string, observe?: 'body', reportProgress?: boolean): Observable; + public walletCreate(seed: string, label: string, scan?: number, encrypt?: boolean, password?: string, observe?: 'response', reportProgress?: boolean): Observable>; + public walletCreate(seed: string, label: string, scan?: number, encrypt?: boolean, password?: string, observe?: 'events', reportProgress?: boolean): Observable>; + public walletCreate(seed: string, label: string, scan?: number, encrypt?: boolean, password?: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (seed === null || seed === undefined) { + throw new Error('Required parameter seed was null or undefined when calling walletCreate.'); + } + if (label === null || label === undefined) { + throw new Error('Required parameter label was null or undefined when calling walletCreate.'); + } + + let headers = this.defaultHeaders; + if (seed !== undefined && seed !== null) { + headers = headers.set('seed', String(seed)); + } + if (label !== undefined && label !== null) { + headers = headers.set('label', String(label)); + } + if (scan !== undefined && scan !== null) { + headers = headers.set('scan', String(scan)); + } + if (encrypt !== undefined && encrypt !== null) { + headers = headers.set('encrypt', String(encrypt)); + } + if (password !== undefined && password !== null) { + headers = headers.set('password', String(password)); + } + + // authentication (csrfAuth) required + if (this.configuration.apiKeys && this.configuration.apiKeys["X-CSRF-TOKEN"]) { + headers = headers.set('X-CSRF-TOKEN', this.configuration.apiKeys["X-CSRF-TOKEN"]); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.post(`${this.configuration.basePath}/api/v1/wallet/create`, + null, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Decrypts wallet. + * + * @param id Wallet id. + * @param password Wallet password. + * @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 walletDecrypt(id: string, password: string, observe?: 'body', reportProgress?: boolean): Observable; + public walletDecrypt(id: string, password: string, observe?: 'response', reportProgress?: boolean): Observable>; + public walletDecrypt(id: string, password: string, observe?: 'events', reportProgress?: boolean): Observable>; + public walletDecrypt(id: string, password: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling walletDecrypt.'); + } + if (password === null || password === undefined) { + throw new Error('Required parameter password was null or undefined when calling walletDecrypt.'); + } + + let headers = this.defaultHeaders; + if (id !== undefined && id !== null) { + headers = headers.set('id', String(id)); + } + if (password !== undefined && password !== null) { + headers = headers.set('password', String(password)); + } + + // authentication (csrfAuth) required + if (this.configuration.apiKeys && this.configuration.apiKeys["X-CSRF-TOKEN"]) { + headers = headers.set('X-CSRF-TOKEN', this.configuration.apiKeys["X-CSRF-TOKEN"]); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.post(`${this.configuration.basePath}/api/v1/wallet/decrypt`, + null, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Encrypt wallet. + * + * @param id Wallet id. + * @param password Wallet password. + * @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 walletEncrypt(id: string, password: string, observe?: 'body', reportProgress?: boolean): Observable; + public walletEncrypt(id: string, password: string, observe?: 'response', reportProgress?: boolean): Observable>; + public walletEncrypt(id: string, password: string, observe?: 'events', reportProgress?: boolean): Observable>; + public walletEncrypt(id: string, password: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling walletEncrypt.'); + } + if (password === null || password === undefined) { + throw new Error('Required parameter password was null or undefined when calling walletEncrypt.'); + } + + let headers = this.defaultHeaders; + if (id !== undefined && id !== null) { + headers = headers.set('id', String(id)); + } + if (password !== undefined && password !== null) { + headers = headers.set('password', String(password)); + } + + // authentication (csrfAuth) required + if (this.configuration.apiKeys && this.configuration.apiKeys["X-CSRF-TOKEN"]) { + headers = headers.set('X-CSRF-TOKEN', this.configuration.apiKeys["X-CSRF-TOKEN"]); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.post(`${this.configuration.basePath}/api/v1/wallet/encrypt`, + null, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * + * Returns the wallet directory path + * @param addr Address port + * @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 walletFolder(addr: string, observe?: 'body', reportProgress?: boolean): Observable; + public walletFolder(addr: string, observe?: 'response', reportProgress?: boolean): Observable>; + public walletFolder(addr: string, observe?: 'events', reportProgress?: boolean): Observable>; + public walletFolder(addr: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (addr === null || addr === undefined) { + throw new Error('Required parameter addr was null or undefined when calling walletFolder.'); + } + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (addr !== undefined && addr !== null) { + queryParameters = queryParameters.set('addr', addr); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.configuration.basePath}/api/v1/wallets/folderName`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * + * Generates new addresses + * @param id Wallet Id + * @param num The number you want to generate + * @param password Wallet Password + * @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 walletNewAddress(id: string, num?: string, password?: string, observe?: 'body', reportProgress?: boolean): Observable; + public walletNewAddress(id: string, num?: string, password?: string, observe?: 'response', reportProgress?: boolean): Observable>; + public walletNewAddress(id: string, num?: string, password?: string, observe?: 'events', reportProgress?: boolean): Observable>; + public walletNewAddress(id: string, num?: string, password?: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling walletNewAddress.'); + } + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (id !== undefined && id !== null) { + queryParameters = queryParameters.set('id', id); + } + if (num !== undefined && num !== null) { + queryParameters = queryParameters.set('num', num); + } + if (password !== undefined && password !== null) { + queryParameters = queryParameters.set('password', password); + } + + let headers = this.defaultHeaders; + + // authentication (csrfAuth) required + if (this.configuration.apiKeys && this.configuration.apiKeys["X-CSRF-TOKEN"]) { + headers = headers.set('X-CSRF-TOKEN', this.configuration.apiKeys["X-CSRF-TOKEN"]); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.post(`${this.configuration.basePath}/api/v1/wallet/newAddress`, + null, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * + * Returns the wallet directory path + * @param entropy Entropy bitSize. + * @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 walletNewSeed(entropy?: '128' | '256', observe?: 'body', reportProgress?: boolean): Observable; + public walletNewSeed(entropy?: '128' | '256', observe?: 'response', reportProgress?: boolean): Observable>; + public walletNewSeed(entropy?: '128' | '256', observe?: 'events', reportProgress?: boolean): Observable>; + public walletNewSeed(entropy?: '128' | '256', observe: any = 'body', reportProgress: boolean = false ): Observable { + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (entropy !== undefined && entropy !== null) { + queryParameters = queryParameters.set('entropy', entropy); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.configuration.basePath}/api/v1/wallet/newSeed`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Recovers an encrypted wallet by providing the seed. The first address will be generated from seed and compared to the first address of the specified wallet. If they match, the wallet will be regenerated with an optional password. If the wallet is not encrypted, an error is returned. + * + * @param id Wallet id. + * @param seed Wallet seed. + * @param password Wallet password. + * @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 walletRecover(id: string, seed: string, password?: string, observe?: 'body', reportProgress?: boolean): Observable; + public walletRecover(id: string, seed: string, password?: string, observe?: 'response', reportProgress?: boolean): Observable>; + public walletRecover(id: string, seed: string, password?: string, observe?: 'events', reportProgress?: boolean): Observable>; + public walletRecover(id: string, seed: string, password?: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling walletRecover.'); + } + if (seed === null || seed === undefined) { + throw new Error('Required parameter seed was null or undefined when calling walletRecover.'); + } + + let headers = this.defaultHeaders; + if (id !== undefined && id !== null) { + headers = headers.set('id', String(id)); + } + if (seed !== undefined && seed !== null) { + headers = headers.set('seed', String(seed)); + } + if (password !== undefined && password !== null) { + headers = headers.set('password', String(password)); + } + + // authentication (csrfAuth) required + if (this.configuration.apiKeys && this.configuration.apiKeys["X-CSRF-TOKEN"]) { + headers = headers.set('X-CSRF-TOKEN', this.configuration.apiKeys["X-CSRF-TOKEN"]); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.post(`${this.configuration.basePath}/api/v2/wallet/recover`, + null, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * This endpoint only works for encrypted wallets. If the wallet is unencrypted, The seed will be not returned. + * + * @param id Wallet Id. + * @param password Wallet password. + * @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 walletSeed(id: string, password: string, observe?: 'body', reportProgress?: boolean): Observable; + public walletSeed(id: string, password: string, observe?: 'response', reportProgress?: boolean): Observable>; + public walletSeed(id: string, password: string, observe?: 'events', reportProgress?: boolean): Observable>; + public walletSeed(id: string, password: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling walletSeed.'); + } + if (password === null || password === undefined) { + throw new Error('Required parameter password was null or undefined when calling walletSeed.'); + } + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (id !== undefined && id !== null) { + queryParameters = queryParameters.set('id', id); + } + if (password !== undefined && password !== null) { + queryParameters = queryParameters.set('password', password); + } + + let headers = this.defaultHeaders; + + // authentication (csrfAuth) required + if (this.configuration.apiKeys && this.configuration.apiKeys["X-CSRF-TOKEN"]) { + headers = headers.set('X-CSRF-TOKEN', this.configuration.apiKeys["X-CSRF-TOKEN"]); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.post(`${this.configuration.basePath}/api/v1/wallet/seed`, + null, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Verifies a wallet seed. + * + * @param seed Seed to be verified. + * @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 walletSeedVerify(seed?: string, observe?: 'body', reportProgress?: boolean): Observable; + public walletSeedVerify(seed?: string, observe?: 'response', reportProgress?: boolean): Observable>; + public walletSeedVerify(seed?: string, observe?: 'events', reportProgress?: boolean): Observable>; + public walletSeedVerify(seed?: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + + let headers = this.defaultHeaders; + if (seed !== undefined && seed !== null) { + headers = headers.set('seed', String(seed)); + } + + // authentication (csrfAuth) required + if (this.configuration.apiKeys && this.configuration.apiKeys["X-CSRF-TOKEN"]) { + headers = headers.set('X-CSRF-TOKEN', this.configuration.apiKeys["X-CSRF-TOKEN"]); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.post(`${this.configuration.basePath}/api/v2/wallet/seed/verify`, + null, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * + * Creates and broadcasts a transaction sending money from one of our wallets to destination address. + * @param id Wallet id + * @param dst Recipient address + * @param coins Number of coins to spend, in droplets. 1 coin equals 1e6 droplets. + * @param password Wallet password. + * @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 walletSpent(id: string, dst: string, coins: string, password: string, observe?: 'body', reportProgress?: boolean): Observable; + public walletSpent(id: string, dst: string, coins: string, password: string, observe?: 'response', reportProgress?: boolean): Observable>; + public walletSpent(id: string, dst: string, coins: string, password: string, observe?: 'events', reportProgress?: boolean): Observable>; + public walletSpent(id: string, dst: string, coins: string, password: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling walletSpent.'); + } + if (dst === null || dst === undefined) { + throw new Error('Required parameter dst was null or undefined when calling walletSpent.'); + } + if (coins === null || coins === undefined) { + throw new Error('Required parameter coins was null or undefined when calling walletSpent.'); + } + if (password === null || password === undefined) { + throw new Error('Required parameter password was null or undefined when calling walletSpent.'); + } + + let headers = this.defaultHeaders; + if (id !== undefined && id !== null) { + headers = headers.set('id', String(id)); + } + if (dst !== undefined && dst !== null) { + headers = headers.set('dst', String(dst)); + } + if (coins !== undefined && coins !== null) { + headers = headers.set('coins', String(coins)); + } + if (password !== undefined && password !== null) { + headers = headers.set('password', String(password)); + } + + // authentication (csrfAuth) required + if (this.configuration.apiKeys && this.configuration.apiKeys["X-CSRF-TOKEN"]) { + headers = headers.set('X-CSRF-TOKEN', this.configuration.apiKeys["X-CSRF-TOKEN"]); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.post(`${this.configuration.basePath}/api/v1/wallet/spend`, + null, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * + * Creates a signed transaction + * @param body + * @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 walletTransaction(body: InlineObject, observe?: 'body', reportProgress?: boolean): Observable; + public walletTransaction(body: InlineObject, observe?: 'response', reportProgress?: boolean): Observable>; + public walletTransaction(body: InlineObject, observe?: 'events', reportProgress?: boolean): Observable>; + public walletTransaction(body: InlineObject, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling walletTransaction.'); + } + + let headers = this.defaultHeaders; + + // authentication (csrfAuth) required + if (this.configuration.apiKeys && this.configuration.apiKeys["X-CSRF-TOKEN"]) { + headers = headers.set('X-CSRF-TOKEN', this.configuration.apiKeys["X-CSRF-TOKEN"]); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json', + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + return this.httpClient.post(`${this.configuration.basePath}/api/v1/wallet/transaction`, + body, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * + * Returns returns all unconfirmed transactions for all addresses in a given wallet verbose + * @param id Wallet id. + * @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 walletTransactions(id: string, observe?: 'body', reportProgress?: boolean): Observable; + public walletTransactions(id: string, observe?: 'response', reportProgress?: boolean): Observable>; + public walletTransactions(id: string, observe?: 'events', reportProgress?: boolean): Observable>; + public walletTransactions(id: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling walletTransactions.'); + } + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (id !== undefined && id !== null) { + queryParameters = queryParameters.set('id', id); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.configuration.basePath}/api/v1/wallet/transactions`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Unloads wallet from the wallet service. + * + * @param id Wallet Id. + * @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 walletUnload(id: string, observe?: 'body', reportProgress?: boolean): Observable; + public walletUnload(id: string, observe?: 'response', reportProgress?: boolean): Observable>; + public walletUnload(id: string, observe?: 'events', reportProgress?: boolean): Observable>; + public walletUnload(id: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling walletUnload.'); + } + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (id !== undefined && id !== null) { + queryParameters = queryParameters.set('id', id); + } + + let headers = this.defaultHeaders; + + // authentication (csrfAuth) required + if (this.configuration.apiKeys && this.configuration.apiKeys["X-CSRF-TOKEN"]) { + headers = headers.set('X-CSRF-TOKEN', this.configuration.apiKeys["X-CSRF-TOKEN"]); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.post(`${this.configuration.basePath}/api/v1/wallet/unload`, + null, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Update the wallet. + * + * @param id Wallet Id. + * @param label The label the wallet will be updated to. + * @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 walletUpdate(id: string, label: string, observe?: 'body', reportProgress?: boolean): Observable; + public walletUpdate(id: string, label: string, observe?: 'response', reportProgress?: boolean): Observable>; + public walletUpdate(id: string, label: string, observe?: 'events', reportProgress?: boolean): Observable>; + public walletUpdate(id: string, label: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling walletUpdate.'); + } + if (label === null || label === undefined) { + throw new Error('Required parameter label was null or undefined when calling walletUpdate.'); + } + + let headers = this.defaultHeaders; + if (id !== undefined && id !== null) { + headers = headers.set('id', String(id)); + } + if (label !== undefined && label !== null) { + headers = headers.set('label', String(label)); + } + + // authentication (csrfAuth) required + if (this.configuration.apiKeys && this.configuration.apiKeys["X-CSRF-TOKEN"]) { + headers = headers.set('X-CSRF-TOKEN', this.configuration.apiKeys["X-CSRF-TOKEN"]); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.post(`${this.configuration.basePath}/api/v1/wallet/update`, + null, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * + * Returns all loaded wallets + * @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 wallets(observe?: 'body', reportProgress?: boolean): Observable>; + public wallets(observe?: 'response', reportProgress?: boolean): Observable>>; + public wallets(observe?: 'events', reportProgress?: boolean): Observable>>; + public wallets(observe: any = 'body', reportProgress: boolean = false ): Observable { + + let headers = this.defaultHeaders; + + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get>(`${this.configuration.basePath}/api/v1/wallets`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/lib/skyapi/typescript-angular/configuration.ts b/lib/skyapi/typescript-angular/configuration.ts new file mode 100644 index 0000000..1132f4a --- /dev/null +++ b/lib/skyapi/typescript-angular/configuration.ts @@ -0,0 +1,79 @@ +export interface ConfigurationParameters { + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; +} + +export class Configuration { + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKeys = configurationParameters.apiKeys; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + this.withCredentials = configurationParameters.withCredentials; + } + + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#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 Configuration#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'); + } +} diff --git a/lib/skyapi/typescript-angular/encoder.ts b/lib/skyapi/typescript-angular/encoder.ts new file mode 100644 index 0000000..f1c6b78 --- /dev/null +++ b/lib/skyapi/typescript-angular/encoder.ts @@ -0,0 +1,18 @@ + import { HttpUrlEncodingCodec } from '@angular/common/http'; + +/** +* CustomHttpUrlEncodingCodec +* Fix plus sign (+) not encoding, so sent as blank space +* See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 +*/ +export class CustomHttpUrlEncodingCodec extends HttpUrlEncodingCodec { + encodeKey(k: string): string { + k = super.encodeKey(k); + return k.replace(/\+/gi, '%2B'); + } + encodeValue(v: string): string { + v = super.encodeValue(v); + return v.replace(/\+/gi, '%2B'); + } +} + diff --git a/lib/skyapi/typescript-angular/git_push.sh b/lib/skyapi/typescript-angular/git_push.sh new file mode 100644 index 0000000..8442b80 --- /dev/null +++ b/lib/skyapi/typescript-angular/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/lib/skyapi/typescript-angular/index.ts b/lib/skyapi/typescript-angular/index.ts new file mode 100644 index 0000000..c312b70 --- /dev/null +++ b/lib/skyapi/typescript-angular/index.ts @@ -0,0 +1,5 @@ +export * from './api/api'; +export * from './model/models'; +export * from './variables'; +export * from './configuration'; +export * from './api.module'; \ No newline at end of file diff --git a/lib/skyapi/typescript-angular/model/apiV1ExplorerAddressInputs.ts b/lib/skyapi/typescript-angular/model/apiV1ExplorerAddressInputs.ts new file mode 100644 index 0000000..5bf2fe5 --- /dev/null +++ b/lib/skyapi/typescript-angular/model/apiV1ExplorerAddressInputs.ts @@ -0,0 +1,21 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * 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 ApiV1ExplorerAddressInputs { + owner?: string; + hours?: number; + calculatedHours?: number; + coins?: string; + uxid?: string; +} + diff --git a/lib/skyapi/typescript-angular/model/apiV1ExplorerAddressOutputs.ts b/lib/skyapi/typescript-angular/model/apiV1ExplorerAddressOutputs.ts new file mode 100644 index 0000000..47f6d0d --- /dev/null +++ b/lib/skyapi/typescript-angular/model/apiV1ExplorerAddressOutputs.ts @@ -0,0 +1,20 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * 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 ApiV1ExplorerAddressOutputs { + hours?: number; + dst?: string; + coins?: string; + uxid?: string; +} + diff --git a/lib/skyapi/typescript-angular/model/apiV1ExplorerAddressStatus.ts b/lib/skyapi/typescript-angular/model/apiV1ExplorerAddressStatus.ts new file mode 100644 index 0000000..9a15854 --- /dev/null +++ b/lib/skyapi/typescript-angular/model/apiV1ExplorerAddressStatus.ts @@ -0,0 +1,20 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * 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 ApiV1ExplorerAddressStatus { + unconfirmed?: boolean; + blockSeq?: number; + label?: number; + confirmed?: boolean; +} + diff --git a/lib/skyapi/typescript-angular/model/apiV1PendingTxsTransaction.ts b/lib/skyapi/typescript-angular/model/apiV1PendingTxsTransaction.ts new file mode 100644 index 0000000..04d81d2 --- /dev/null +++ b/lib/skyapi/typescript-angular/model/apiV1PendingTxsTransaction.ts @@ -0,0 +1,28 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { ApiV1ExplorerAddressOutputs } from './apiV1ExplorerAddressOutputs'; + + +/** + * BlockTransactionVerbose has readable transaction data for transactions inside a block. It differs from Transaction in that it includes metadata for transaction inputs and the calculated coinhour fee spent by the block + */ +export interface ApiV1PendingTxsTransaction { + outputs?: Array; + innerHash?: string; + inputs?: Array; + sigs?: Array; + length?: number; + txid?: string; + type?: number; + timestamp?: number; +} + diff --git a/lib/skyapi/typescript-angular/model/apiV1WalletTransactionHoursSelection.ts b/lib/skyapi/typescript-angular/model/apiV1WalletTransactionHoursSelection.ts new file mode 100644 index 0000000..bfdd875 --- /dev/null +++ b/lib/skyapi/typescript-angular/model/apiV1WalletTransactionHoursSelection.ts @@ -0,0 +1,19 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * 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 ApiV1WalletTransactionHoursSelection { + mode?: string; + shareFactor?: string; + type?: string; +} + diff --git a/lib/skyapi/typescript-angular/model/apiV1WalletTransactionTo.ts b/lib/skyapi/typescript-angular/model/apiV1WalletTransactionTo.ts new file mode 100644 index 0000000..2cae35a --- /dev/null +++ b/lib/skyapi/typescript-angular/model/apiV1WalletTransactionTo.ts @@ -0,0 +1,19 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * 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 ApiV1WalletTransactionTo { + hours?: number; + address?: string; + coins?: number; +} + diff --git a/lib/skyapi/typescript-angular/model/apiV1WalletTransactionWallet.ts b/lib/skyapi/typescript-angular/model/apiV1WalletTransactionWallet.ts new file mode 100644 index 0000000..decc56e --- /dev/null +++ b/lib/skyapi/typescript-angular/model/apiV1WalletTransactionWallet.ts @@ -0,0 +1,20 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * 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 ApiV1WalletTransactionWallet { + unspents?: Array; + addresses?: Array; + password?: string; + id?: string; +} + diff --git a/lib/skyapi/typescript-angular/model/apiV1WalletsEntries.ts b/lib/skyapi/typescript-angular/model/apiV1WalletsEntries.ts new file mode 100644 index 0000000..deb161f --- /dev/null +++ b/lib/skyapi/typescript-angular/model/apiV1WalletsEntries.ts @@ -0,0 +1,18 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * 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 ApiV1WalletsEntries { + publicKey?: string; + address?: string; +} + diff --git a/lib/skyapi/typescript-angular/model/apiV1WalletsMeta.ts b/lib/skyapi/typescript-angular/model/apiV1WalletsMeta.ts new file mode 100644 index 0000000..9c2e97c --- /dev/null +++ b/lib/skyapi/typescript-angular/model/apiV1WalletsMeta.ts @@ -0,0 +1,24 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * 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 ApiV1WalletsMeta { + filename?: string; + encrypted?: boolean; + cryptoType?: string; + label?: string; + type?: string; + version?: string; + coin?: string; + timestamp?: number; +} + diff --git a/lib/skyapi/typescript-angular/model/inlineObject.ts b/lib/skyapi/typescript-angular/model/inlineObject.ts new file mode 100644 index 0000000..1d9e93a --- /dev/null +++ b/lib/skyapi/typescript-angular/model/inlineObject.ts @@ -0,0 +1,24 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { ApiV1WalletTransactionHoursSelection } from './apiV1WalletTransactionHoursSelection'; +import { ApiV1WalletTransactionTo } from './apiV1WalletTransactionTo'; +import { ApiV1WalletTransactionWallet } from './apiV1WalletTransactionWallet'; + + +export interface InlineObject { + changeAddress?: string; + hoursSelection?: ApiV1WalletTransactionHoursSelection; + ignoreUnconfirmed?: boolean; + to?: Array; + wallet?: ApiV1WalletTransactionWallet; +} + diff --git a/lib/skyapi/typescript-angular/model/inlineResponse200.ts b/lib/skyapi/typescript-angular/model/inlineResponse200.ts new file mode 100644 index 0000000..ccda7b0 --- /dev/null +++ b/lib/skyapi/typescript-angular/model/inlineResponse200.ts @@ -0,0 +1,25 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * 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 InlineResponse200 { + hours?: number; + coins?: number; + uxid?: string; + ownerAddress?: string; + spentBlockSeq?: number; + spentTx?: string; + time?: number; + srcBlockSeq?: number; + srcTx?: string; +} + diff --git a/lib/skyapi/typescript-angular/model/inlineResponse2001.ts b/lib/skyapi/typescript-angular/model/inlineResponse2001.ts new file mode 100644 index 0000000..9575999 --- /dev/null +++ b/lib/skyapi/typescript-angular/model/inlineResponse2001.ts @@ -0,0 +1,17 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * 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 InlineResponse2001 { + csrfToken?: string; +} + diff --git a/lib/skyapi/typescript-angular/model/inlineResponse2002.ts b/lib/skyapi/typescript-angular/model/inlineResponse2002.ts new file mode 100644 index 0000000..9fe2987 --- /dev/null +++ b/lib/skyapi/typescript-angular/model/inlineResponse2002.ts @@ -0,0 +1,29 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { ApiV1ExplorerAddressInputs } from './apiV1ExplorerAddressInputs'; +import { ApiV1ExplorerAddressOutputs } from './apiV1ExplorerAddressOutputs'; +import { ApiV1ExplorerAddressStatus } from './apiV1ExplorerAddressStatus'; + + +export interface InlineResponse2002 { + outputs?: Array; + innerHash?: string; + inputs?: Array; + fee?: number; + sigs?: Array; + length?: number; + txid?: string; + type?: number; + status?: ApiV1ExplorerAddressStatus; + timestamp?: number; +} + diff --git a/lib/skyapi/typescript-angular/model/inlineResponse2003.ts b/lib/skyapi/typescript-angular/model/inlineResponse2003.ts new file mode 100644 index 0000000..d615026 --- /dev/null +++ b/lib/skyapi/typescript-angular/model/inlineResponse2003.ts @@ -0,0 +1,38 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { InlineResponse2003UnconfirmedVerifyTransaction } from './inlineResponse2003UnconfirmedVerifyTransaction'; + + +export interface InlineResponse2003 { + lastReceived?: number; + lastSent?: number; + outgoing?: boolean; + mirror?: number; + address?: string; + listenPort?: number; + isTrustedPeer?: boolean; + connectedAt?: number; + unconfirmedVerifyTransaction?: InlineResponse2003UnconfirmedVerifyTransaction; + id?: number; + state?: InlineResponse2003.StateEnum; + userAgent?: string; + height?: number; +} +export namespace InlineResponse2003 { + export type StateEnum = 'pending' | 'connected' | 'introduced'; + export const StateEnum = { + Pending: 'pending' as StateEnum, + Connected: 'connected' as StateEnum, + Introduced: 'introduced' as StateEnum + }; +} + diff --git a/lib/skyapi/typescript-angular/model/inlineResponse2003UnconfirmedVerifyTransaction.ts b/lib/skyapi/typescript-angular/model/inlineResponse2003UnconfirmedVerifyTransaction.ts new file mode 100644 index 0000000..93a570f --- /dev/null +++ b/lib/skyapi/typescript-angular/model/inlineResponse2003UnconfirmedVerifyTransaction.ts @@ -0,0 +1,22 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * Represent unconfirmed transactions + */ +export interface InlineResponse2003UnconfirmedVerifyTransaction { + burnFactor?: number; + maxTransactionSize?: number; + maxDecimals?: number; +} + diff --git a/lib/skyapi/typescript-angular/model/inlineResponse2004.ts b/lib/skyapi/typescript-angular/model/inlineResponse2004.ts new file mode 100644 index 0000000..50b78f4 --- /dev/null +++ b/lib/skyapi/typescript-angular/model/inlineResponse2004.ts @@ -0,0 +1,22 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { ApiV1PendingTxsTransaction } from './apiV1PendingTxsTransaction'; + + +export interface InlineResponse2004 { + announced?: string; + isValid?: boolean; + checked?: string; + received?: string; + transaction?: ApiV1PendingTxsTransaction; +} + diff --git a/lib/skyapi/typescript-angular/model/inlineResponse2005.ts b/lib/skyapi/typescript-angular/model/inlineResponse2005.ts new file mode 100644 index 0000000..1eafeb2 --- /dev/null +++ b/lib/skyapi/typescript-angular/model/inlineResponse2005.ts @@ -0,0 +1,20 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { ApiV1WalletsEntries } from './apiV1WalletsEntries'; +import { ApiV1WalletsMeta } from './apiV1WalletsMeta'; + + +export interface InlineResponse2005 { + entries?: Array; + meta?: ApiV1WalletsMeta; +} + diff --git a/lib/skyapi/typescript-angular/model/inlineResponse2006.ts b/lib/skyapi/typescript-angular/model/inlineResponse2006.ts new file mode 100644 index 0000000..77fc359 --- /dev/null +++ b/lib/skyapi/typescript-angular/model/inlineResponse2006.ts @@ -0,0 +1,17 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * 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 InlineResponse2006 { + address?: string; +} + diff --git a/lib/skyapi/typescript-angular/model/inlineResponse2007.ts b/lib/skyapi/typescript-angular/model/inlineResponse2007.ts new file mode 100644 index 0000000..674d02c --- /dev/null +++ b/lib/skyapi/typescript-angular/model/inlineResponse2007.ts @@ -0,0 +1,19 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { InlineResponse2007Data } from './inlineResponse2007Data'; + + +export interface InlineResponse2007 { + data?: InlineResponse2007Data; + error?: any; +} + diff --git a/lib/skyapi/typescript-angular/model/inlineResponse2007Data.ts b/lib/skyapi/typescript-angular/model/inlineResponse2007Data.ts new file mode 100644 index 0000000..42a0d97 --- /dev/null +++ b/lib/skyapi/typescript-angular/model/inlineResponse2007Data.ts @@ -0,0 +1,17 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * 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 InlineResponse2007Data { + version?: number; +} + diff --git a/lib/skyapi/typescript-angular/model/inlineResponseDefault.ts b/lib/skyapi/typescript-angular/model/inlineResponseDefault.ts new file mode 100644 index 0000000..ff7af1a --- /dev/null +++ b/lib/skyapi/typescript-angular/model/inlineResponseDefault.ts @@ -0,0 +1,18 @@ +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * OpenAPI spec version: 0.25.1 + * Contact: skycoin.doe@example.com + * + * 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 InlineResponseDefault { + code?: number; + message?: string; +} + diff --git a/lib/skyapi/typescript-angular/model/models.ts b/lib/skyapi/typescript-angular/model/models.ts new file mode 100644 index 0000000..3601c3f --- /dev/null +++ b/lib/skyapi/typescript-angular/model/models.ts @@ -0,0 +1,21 @@ +export * from './apiV1ExplorerAddressInputs'; +export * from './apiV1ExplorerAddressOutputs'; +export * from './apiV1ExplorerAddressStatus'; +export * from './apiV1PendingTxsTransaction'; +export * from './apiV1WalletTransactionHoursSelection'; +export * from './apiV1WalletTransactionTo'; +export * from './apiV1WalletTransactionWallet'; +export * from './apiV1WalletsEntries'; +export * from './apiV1WalletsMeta'; +export * from './inlineObject'; +export * from './inlineResponse200'; +export * from './inlineResponse2001'; +export * from './inlineResponse2002'; +export * from './inlineResponse2003'; +export * from './inlineResponse2003UnconfirmedVerifyTransaction'; +export * from './inlineResponse2004'; +export * from './inlineResponse2005'; +export * from './inlineResponse2006'; +export * from './inlineResponse2007'; +export * from './inlineResponse2007Data'; +export * from './inlineResponseDefault'; diff --git a/lib/skyapi/typescript-angular/ng-package.json b/lib/skyapi/typescript-angular/ng-package.json new file mode 100644 index 0000000..3b17900 --- /dev/null +++ b/lib/skyapi/typescript-angular/ng-package.json @@ -0,0 +1,6 @@ +{ + "$schema": "./node_modules/ng-packagr/ng-package.schema.json", + "lib": { + "entryFile": "index.ts" + } +} diff --git a/lib/skyapi/typescript-angular/package.json b/lib/skyapi/typescript-angular/package.json new file mode 100644 index 0000000..004b689 --- /dev/null +++ b/lib/skyapi/typescript-angular/package.json @@ -0,0 +1,36 @@ +{ + "name": "libsky-angular", + "version": "0.25.1", + "description": "OpenAPI client for libsky-angular", + "author": "OpenAPI-Generator Contributors", + "keywords": [ + "openapi-client", + "openapi-generator" + ], + "license": "Unlicense", + "scripts": { + "build": "ng-packagr -p ng-package.json" + }, + "peerDependencies": { + "@angular/core": "^4.3.0", + "@angular/http": "^4.3.0", + "@angular/common": "^4.3.0", + "@angular/compiler": "^4.3.0", + "core-js": "^2.4.0", + "reflect-metadata": "^0.1.3", + "rxjs": "^5.4.0" + }, + "devDependencies": { + "@angular/compiler-cli": "^4.3.0", + "@angular/core": "^4.3.0", + "@angular/http": "^4.3.0", + "@angular/common": "^4.3.0", + "@angular/compiler": "^4.3.0", + "@angular/platform-browser": "^4.3.0", + "ng-packagr": "^1.6.0", + "reflect-metadata": "^0.1.3", + "rxjs": "^5.4.0", + "zone.js": "^0.7.6", + "typescript": ">=2.1.5 <2.8.0" + } +} diff --git a/lib/skyapi/typescript-angular/tsconfig.json b/lib/skyapi/typescript-angular/tsconfig.json new file mode 100644 index 0000000..498ee01 --- /dev/null +++ b/lib/skyapi/typescript-angular/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "noImplicitAny": false, + "suppressImplicitAnyIndexErrors": true, + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "removeComments": true, + "sourceMap": true, + "outDir": "./dist", + "noLib": false, + "declaration": true, + "lib": [ "es6", "dom" ] + }, + "exclude": [ + "node_modules", + "dist" + ], + "filesGlob": [ + "./model/*.ts", + "./api/*.ts" + ] +} diff --git a/lib/skyapi/typescript-angular/typings.json b/lib/skyapi/typescript-angular/typings.json new file mode 100644 index 0000000..507c40e --- /dev/null +++ b/lib/skyapi/typescript-angular/typings.json @@ -0,0 +1,5 @@ +{ + "globalDependencies": { + "core-js": "registry:dt/core-js#0.0.0+20160725163759" + } +} diff --git a/lib/skyapi/typescript-angular/variables.ts b/lib/skyapi/typescript-angular/variables.ts new file mode 100644 index 0000000..6fe5854 --- /dev/null +++ b/lib/skyapi/typescript-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': '|' +}