From f8a1caa05eb7c3b1aa0bc820ac93b0a8ce8c79f6 Mon Sep 17 00:00:00 2001 From: Maykel Arias Torres Date: Thu, 8 Aug 2019 09:06:43 -0400 Subject: [PATCH] [Makefile][skyapi-fetch] refs #11 Added support typescript fetch to 0.27.0 --- .gitignore | 1 + Makefile | 13 +- lib/skyapi/fetch/.gitignore | 4 + lib/skyapi/fetch/.openapi-generator-ignore | 23 + lib/skyapi/fetch/.openapi-generator/VERSION | 1 + lib/skyapi/fetch/README.md | 45 + lib/skyapi/fetch/apis/DefaultApi.ts | 2240 +++++++++++++++++ lib/skyapi/fetch/apis/index.ts | 1 + lib/skyapi/fetch/index.ts | 3 + lib/skyapi/fetch/models/Address.ts | 44 + .../models/ApiV1PendingTxsTransaction.ts | 98 + .../ApiV1PendingTxsTransactionOutputs.ts | 68 + lib/skyapi/fetch/models/BlockSchema.ts | 69 + lib/skyapi/fetch/models/BlockSchemaBody.ts | 44 + lib/skyapi/fetch/models/BlockVerboseSchema.ts | 69 + .../fetch/models/BlockVerboseSchemaBody.ts | 44 + .../fetch/models/BlockVerboseSchemaHeader.ts | 100 + lib/skyapi/fetch/models/InlineResponse200.ts | 44 + lib/skyapi/fetch/models/InlineResponse2001.ts | 50 + .../fetch/models/InlineResponse20010.ts | 82 + lib/skyapi/fetch/models/InlineResponse2002.ts | 92 + lib/skyapi/fetch/models/InlineResponse2003.ts | 44 + lib/skyapi/fetch/models/InlineResponse2004.ts | 50 + lib/skyapi/fetch/models/InlineResponse2005.ts | 60 + lib/skyapi/fetch/models/InlineResponse2006.ts | 50 + lib/skyapi/fetch/models/InlineResponse2007.ts | 44 + lib/skyapi/fetch/models/InlineResponse2008.ts | 50 + .../fetch/models/InlineResponse2008Data.ts | 50 + lib/skyapi/fetch/models/InlineResponse2009.ts | 44 + .../fetch/models/InlineResponseDefault.ts | 52 + .../fetch/models/NetworkConnectionSchema.ts | 156 ++ ...ctionSchemaUnconfirmedVerifyTransaction.ts | 60 + lib/skyapi/fetch/models/Transaction.ts | 69 + lib/skyapi/fetch/models/TransactionEncoded.ts | 82 + .../fetch/models/TransactionEncodedS.ts | 66 + lib/skyapi/fetch/models/TransactionStatus.ts | 68 + lib/skyapi/fetch/models/TransactionTxn.ts | 100 + .../models/TransactionV2ParamsAddress.ts | 50 + ...ransactionV2ParamsAddressHoursSelection.ts | 44 + .../models/TransactionV2ParamsUnspent.ts | 77 + ...ransactionV2ParamsUnspentHoursSelection.ts | 60 + .../models/TransactionV2ParamsUnspentTo.ts | 52 + lib/skyapi/fetch/models/TransactionVerbose.ts | 69 + .../fetch/models/TransactionVerboseTxn.ts | 125 + .../models/TransactionVerboseTxnInputs.ts | 76 + .../fetch/models/TransactionVerifyRequest.ts | 52 + .../fetch/models/WalletTransactionRequest.ts | 85 + .../WalletTransactionRequestHoursSelection.ts | 60 + .../models/WalletTransactionRequestWallet.ts | 68 + .../models/WalletTransactionSignRequest.ts | 68 + lib/skyapi/fetch/models/index.ts | 41 + lib/skyapi/fetch/package.json | 15 + lib/skyapi/fetch/runtime.ts | 284 +++ lib/skyapi/fetch/tsconfig.json | 17 + tests/fetch/package-lock.json | 1028 ++++++++ tests/fetch/package.json | 10 + tests/fetch/test/fetch.js | 35 + 57 files changed, 6494 insertions(+), 2 deletions(-) create mode 100644 lib/skyapi/fetch/.gitignore create mode 100644 lib/skyapi/fetch/.openapi-generator-ignore create mode 100644 lib/skyapi/fetch/.openapi-generator/VERSION create mode 100644 lib/skyapi/fetch/README.md create mode 100644 lib/skyapi/fetch/apis/DefaultApi.ts create mode 100644 lib/skyapi/fetch/apis/index.ts create mode 100644 lib/skyapi/fetch/index.ts create mode 100644 lib/skyapi/fetch/models/Address.ts create mode 100644 lib/skyapi/fetch/models/ApiV1PendingTxsTransaction.ts create mode 100644 lib/skyapi/fetch/models/ApiV1PendingTxsTransactionOutputs.ts create mode 100644 lib/skyapi/fetch/models/BlockSchema.ts create mode 100644 lib/skyapi/fetch/models/BlockSchemaBody.ts create mode 100644 lib/skyapi/fetch/models/BlockVerboseSchema.ts create mode 100644 lib/skyapi/fetch/models/BlockVerboseSchemaBody.ts create mode 100644 lib/skyapi/fetch/models/BlockVerboseSchemaHeader.ts create mode 100644 lib/skyapi/fetch/models/InlineResponse200.ts create mode 100644 lib/skyapi/fetch/models/InlineResponse2001.ts create mode 100644 lib/skyapi/fetch/models/InlineResponse20010.ts create mode 100644 lib/skyapi/fetch/models/InlineResponse2002.ts create mode 100644 lib/skyapi/fetch/models/InlineResponse2003.ts create mode 100644 lib/skyapi/fetch/models/InlineResponse2004.ts create mode 100644 lib/skyapi/fetch/models/InlineResponse2005.ts create mode 100644 lib/skyapi/fetch/models/InlineResponse2006.ts create mode 100644 lib/skyapi/fetch/models/InlineResponse2007.ts create mode 100644 lib/skyapi/fetch/models/InlineResponse2008.ts create mode 100644 lib/skyapi/fetch/models/InlineResponse2008Data.ts create mode 100644 lib/skyapi/fetch/models/InlineResponse2009.ts create mode 100644 lib/skyapi/fetch/models/InlineResponseDefault.ts create mode 100644 lib/skyapi/fetch/models/NetworkConnectionSchema.ts create mode 100644 lib/skyapi/fetch/models/NetworkConnectionSchemaUnconfirmedVerifyTransaction.ts create mode 100644 lib/skyapi/fetch/models/Transaction.ts create mode 100644 lib/skyapi/fetch/models/TransactionEncoded.ts create mode 100644 lib/skyapi/fetch/models/TransactionEncodedS.ts create mode 100644 lib/skyapi/fetch/models/TransactionStatus.ts create mode 100644 lib/skyapi/fetch/models/TransactionTxn.ts create mode 100644 lib/skyapi/fetch/models/TransactionV2ParamsAddress.ts create mode 100644 lib/skyapi/fetch/models/TransactionV2ParamsAddressHoursSelection.ts create mode 100644 lib/skyapi/fetch/models/TransactionV2ParamsUnspent.ts create mode 100644 lib/skyapi/fetch/models/TransactionV2ParamsUnspentHoursSelection.ts create mode 100644 lib/skyapi/fetch/models/TransactionV2ParamsUnspentTo.ts create mode 100644 lib/skyapi/fetch/models/TransactionVerbose.ts create mode 100644 lib/skyapi/fetch/models/TransactionVerboseTxn.ts create mode 100644 lib/skyapi/fetch/models/TransactionVerboseTxnInputs.ts create mode 100644 lib/skyapi/fetch/models/TransactionVerifyRequest.ts create mode 100644 lib/skyapi/fetch/models/WalletTransactionRequest.ts create mode 100644 lib/skyapi/fetch/models/WalletTransactionRequestHoursSelection.ts create mode 100644 lib/skyapi/fetch/models/WalletTransactionRequestWallet.ts create mode 100644 lib/skyapi/fetch/models/WalletTransactionSignRequest.ts create mode 100644 lib/skyapi/fetch/models/index.ts create mode 100644 lib/skyapi/fetch/package.json create mode 100644 lib/skyapi/fetch/runtime.ts create mode 100644 lib/skyapi/fetch/tsconfig.json create mode 100644 tests/fetch/package-lock.json create mode 100644 tests/fetch/package.json create mode 100644 tests/fetch/test/fetch.js diff --git a/.gitignore b/.gitignore index 8e717d5..143ed59 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ tests/node/node_modules lib/node/node_modules tests/axios/npm-debug.log tests/node/npm-debug.log +tests/fetch/npm-debug.log diff --git a/Makefile b/Makefile index 0ef3d1d..f2c00ee 100644 --- a/Makefile +++ b/Makefile @@ -31,9 +31,9 @@ JS_INCLUDE= -I/usr/include/nodejs/src help: @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' -install: build-node-client build-node-tester build-axios-client build-axios-tester ; ## Build all libraries and tester +install: build-node-client build-node-tester build-axios-client build-axios-tester build-fetch-client build-fetch-tester; ## Build all libraries and tester -test: test-node-client test-axios-client ; ## Test all clients +test: test-node-client test-axios-client test-fetch-client; ## Test all clients test-node-client: ## Test node client export HOST='https://staging.node.skycoin.net' && \ @@ -47,12 +47,21 @@ test-axios-client: ## Test axios client export HOST='https://node.skycoin.net' && \ (cd ./tests/axios/ && npm run test ) +test-fetch-client: ## Test axios client + export HOST='https://staging.node.skycoin.net' && \ + (cd ./tests/fetch/ && npm run test ) && \ + export HOST='https://node.skycoin.net' && \ + (cd ./tests/fetch/ && npm run test ) + build-axios-client: ## Build axios client (cd $(JS_CLIENT_DIR)/axios/ && npm install && npm run build) build-node-client: ## Build node client (cd './lib/skyapi/node/' && npm install && npm run build) +build-fetch-client: ## Build fetch client + (cd './lib/skyapi/fetch/' && npm install && npm run build) + build-node-tester: ## Build node client tester (cd './tests/node/' && npm install) diff --git a/lib/skyapi/fetch/.gitignore b/lib/skyapi/fetch/.gitignore new file mode 100644 index 0000000..149b576 --- /dev/null +++ b/lib/skyapi/fetch/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/lib/skyapi/fetch/.openapi-generator-ignore b/lib/skyapi/fetch/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/lib/skyapi/fetch/.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/fetch/.openapi-generator/VERSION b/lib/skyapi/fetch/.openapi-generator/VERSION new file mode 100644 index 0000000..aa31e71 --- /dev/null +++ b/lib/skyapi/fetch/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.0.3 \ No newline at end of file diff --git a/lib/skyapi/fetch/README.md b/lib/skyapi/fetch/README.md new file mode 100644 index 0000000..232e4d9 --- /dev/null +++ b/lib/skyapi/fetch/README.md @@ -0,0 +1,45 @@ +## @simelo/skyapi-fetch@0.27.0 + +This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: + +Environment +* Node.js +* Webpack +* Browserify + +Language level +* ES5 - you must have a Promises/A+ library installed +* ES6 + +Module system +* CommonJS +* ES6 module system + +It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html)) + +### Building + +To build and compile the typescript sources to javascript use: +``` +npm install +npm run build +``` + +### Publishing + +First build the package then run ```npm publish``` + +### Consuming + +navigate to the folder of your consuming project and run one of the following commands. + +_published:_ + +``` +npm install @simelo/skyapi-fetch@0.27.0 --save +``` + +_unPublished (not recommended):_ + +``` +npm install @simelo/skyapi-fetch@0.27.0 --save diff --git a/lib/skyapi/fetch/apis/DefaultApi.ts b/lib/skyapi/fetch/apis/DefaultApi.ts new file mode 100644 index 0000000..fa411ca --- /dev/null +++ b/lib/skyapi/fetch/apis/DefaultApi.ts @@ -0,0 +1,2240 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import { + BlockSchema, + BlockSchemaFromJSON, + BlockSchemaToJSON, + InlineResponse200, + InlineResponse200FromJSON, + InlineResponse200ToJSON, + InlineResponse2001, + InlineResponse2001FromJSON, + InlineResponse2001ToJSON, + InlineResponse20010, + InlineResponse20010FromJSON, + InlineResponse20010ToJSON, + InlineResponse2002, + InlineResponse2002FromJSON, + InlineResponse2002ToJSON, + InlineResponse2003, + InlineResponse2003FromJSON, + InlineResponse2003ToJSON, + InlineResponse2004, + InlineResponse2004FromJSON, + InlineResponse2004ToJSON, + InlineResponse2005, + InlineResponse2005FromJSON, + InlineResponse2005ToJSON, + InlineResponse2006, + InlineResponse2006FromJSON, + InlineResponse2006ToJSON, + InlineResponse2007, + InlineResponse2007FromJSON, + InlineResponse2007ToJSON, + InlineResponse2008, + InlineResponse2008FromJSON, + InlineResponse2008ToJSON, + InlineResponse2009, + InlineResponse2009FromJSON, + InlineResponse2009ToJSON, + InlineResponseDefault, + InlineResponseDefaultFromJSON, + InlineResponseDefaultToJSON, + NetworkConnectionSchema, + NetworkConnectionSchemaFromJSON, + NetworkConnectionSchemaToJSON, + Transaction, + TransactionFromJSON, + TransactionToJSON, + TransactionV2ParamsAddress, + TransactionV2ParamsAddressFromJSON, + TransactionV2ParamsAddressToJSON, + TransactionV2ParamsUnspent, + TransactionV2ParamsUnspentFromJSON, + TransactionV2ParamsUnspentToJSON, + TransactionVerifyRequest, + TransactionVerifyRequestFromJSON, + TransactionVerifyRequestToJSON, + WalletTransactionRequest, + WalletTransactionRequestFromJSON, + WalletTransactionRequestToJSON, + WalletTransactionSignRequest, + WalletTransactionSignRequestFromJSON, + WalletTransactionSignRequestToJSON, +} from '../models'; + +export interface AddressUxoutsRequest { + address: string; +} + +export interface BalanceGetRequest { + addrs: string; +} + +export interface BalancePostRequest { + addrs: string; +} + +export interface BlockRequest { + hash?: string; + seq?: number; +} + +export interface BlocksRequest { + start?: number; + end?: number; + seq?: Array; +} + +export interface DataDELETERequest { + type?: string; + key?: string; +} + +export interface DataGETRequest { + type?: string; + key?: string; +} + +export interface DataPOSTRequest { + type?: string; + key?: string; + val?: string; +} + +export interface LastBlocksRequest { + num: number; +} + +export interface NetworkConnectionRequest { + addr: string; +} + +export interface NetworkConnectionsRequest { + states?: NetworkConnectionsStatesEnum; + direction?: NetworkConnectionsDirectionEnum; +} + +export interface NetworkConnectionsDisconnectRequest { + id: string; +} + +export interface OutputsGetRequest { + address?: Array; + hash?: Array; +} + +export interface OutputsPostRequest { + address?: string; + hash?: string; +} + +export interface RichlistRequest { + includeDistribution?: boolean; + n?: string; +} + +export interface TransactionRequest { + txid: string; +} + +export interface TransactionInjectRequest { + rawtx: string; + noBroadcast?: boolean; +} + +export interface TransactionPostRequest { + transactionV2ParamsAddress?: TransactionV2ParamsAddress; +} + +export interface TransactionPostUnspentRequest { + transactionV2ParamsUnspent: TransactionV2ParamsUnspent; +} + +export interface TransactionRawRequest { + txid?: string; +} + +export interface TransactionVerifyRequest { + transactionVerifyRequest: TransactionVerifyRequest; +} + +export interface TransactionsGetRequest { + addrs?: string; + confirmed?: string; +} + +export interface TransactionsPostRequest { + addrs?: string; + confirmed?: string; +} + +export interface UxoutRequest { + uxid?: string; +} + +export interface VerifyAddressRequest { + address: object; +} + +export interface WalletRequest { + id: string; +} + +export interface WalletBalanceRequest { + id: string; +} + +export interface WalletCreateRequest { + type: string; + seed: string; + label: string; + seedPassphrase?: string; + bip44Coin?: string; + xpub?: string; + scan?: number; + encrypt?: boolean; + password?: string; +} + +export interface WalletDecryptRequest { + id: string; + password: string; +} + +export interface WalletEncryptRequest { + id: string; + password: string; +} + +export interface WalletFolderRequest { + addr: string; +} + +export interface WalletNewAddressRequest { + id: string; + num?: string; + password?: string; +} + +export interface WalletNewSeedRequest { + entropy?: WalletNewSeedEntropyEnum; +} + +export interface WalletRecoverRequest { + id: string; + seed: string; + seedPassphrase?: string; + password?: string; +} + +export interface WalletSeedRequest { + id: string; + password: string; +} + +export interface WalletSeedVerifyRequest { + seed?: string; +} + +export interface WalletTransactionRequest { + walletTransactionRequest: WalletTransactionRequest; +} + +export interface WalletTransactionSignRequest { + walletTransactionSignRequest: WalletTransactionSignRequest; +} + +export interface WalletTransactionsRequest { + id: string; +} + +export interface WalletUnloadRequest { + id: string; +} + +export interface WalletUpdateRequest { + id: string; + label: string; +} + +/** + * no description + */ +export class DefaultApi extends runtime.BaseAPI { + + /** + * Returns the total number of unique address that have coins. + */ + async addressCountRaw(): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/addresscount`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse200FromJSON(jsonValue)); + } + + /** + * Returns the total number of unique address that have coins. + */ + async addressCount(): Promise { + const response = await this.addressCountRaw(); + return await response.value(); + } + + /** + * Returns the historical, spent outputs associated with an address + */ + async addressUxoutsRaw(requestParameters: AddressUxoutsRequest): Promise>> { + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling addressUxouts.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.address !== undefined) { + queryParameters['address'] = requestParameters.address; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/address_uxouts`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response); + } + + /** + * Returns the historical, spent outputs associated with an address + */ + async addressUxouts(requestParameters: AddressUxoutsRequest): Promise> { + const response = await this.addressUxoutsRaw(requestParameters); + return await response.value(); + } + + /** + */ + async apiV1RawtxGetRaw(): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/rawtx`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + */ + async apiV1RawtxGet(): Promise { + const response = await this.apiV1RawtxGetRaw(); + return await response.value(); + } + + /** + */ + async apiV2MetricsGetRaw(): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v2/metrics`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + */ + async apiV2MetricsGet(): Promise { + const response = await this.apiV2MetricsGetRaw(); + return await response.value(); + } + + /** + * Returns the balance of one or more addresses, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. + */ + async balanceGetRaw(requestParameters: BalanceGetRequest): Promise> { + if (requestParameters.addrs === null || requestParameters.addrs === undefined) { + throw new runtime.RequiredError('addrs','Required parameter requestParameters.addrs was null or undefined when calling balanceGet.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.addrs !== undefined) { + queryParameters['addrs'] = requestParameters.addrs; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/balance`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Returns the balance of one or more addresses, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. + */ + async balanceGet(requestParameters: BalanceGetRequest): Promise { + const response = await this.balanceGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns the balance of one or more addresses, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. + */ + async balancePostRaw(requestParameters: BalancePostRequest): Promise> { + if (requestParameters.addrs === null || requestParameters.addrs === undefined) { + throw new runtime.RequiredError('addrs','Required parameter requestParameters.addrs was null or undefined when calling balancePost.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.addrs !== undefined) { + queryParameters['addrs'] = requestParameters.addrs; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-CSRF-TOKEN"] = this.configuration.apiKey("X-CSRF-TOKEN"); // csrfAuth authentication + } + + const response = await this.request({ + path: `/api/v1/balance`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Returns the balance of one or more addresses, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. + */ + async balancePost(requestParameters: BalancePostRequest): Promise { + const response = await this.balancePostRaw(requestParameters); + return await response.value(); + } + + /** + * Returns the balance of one or more addresses, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. + */ + async blockRaw(requestParameters: BlockRequest): Promise>> { + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.hash !== undefined) { + queryParameters['hash'] = requestParameters.hash; + } + + if (requestParameters.seq !== undefined) { + queryParameters['seq'] = requestParameters.seq; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/block`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(BlockSchemaFromJSON)); + } + + /** + * Returns the balance of one or more addresses, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. + */ + async block(requestParameters: BlockRequest): Promise> { + const response = await this.blockRaw(requestParameters); + return await response.value(); + } + + /** + * Returns the blockchain metadata. + */ + async blockchainMetadataRaw(): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/blockchain/metadata`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Returns the blockchain metadata. + */ + async blockchainMetadata(): Promise { + const response = await this.blockchainMetadataRaw(); + return await response.value(); + } + + /** + * Returns the blockchain sync progress. + */ + async blockchainProgressRaw(): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/blockchain/progress`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Returns the blockchain sync progress. + */ + async blockchainProgress(): Promise { + const response = await this.blockchainProgressRaw(); + return await response.value(); + } + + /** + * Returns the balance of one or more addresses, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. + */ + async blocksRaw(requestParameters: BlocksRequest): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.start !== undefined) { + queryParameters['start'] = requestParameters.start; + } + + if (requestParameters.end !== undefined) { + queryParameters['end'] = requestParameters.end; + } + + if (requestParameters.seq) { + queryParameters['seq'] = requestParameters.seq; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/blocks`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2001FromJSON(jsonValue)); + } + + /** + * Returns the balance of one or more addresses, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. + */ + async blocks(requestParameters: BlocksRequest): Promise { + const response = await this.blocksRaw(requestParameters); + return await response.value(); + } + + /** + * coinSupplyHandler returns coin distribution supply stats + */ + async coinSupplyRaw(): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/coinSupply`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2002FromJSON(jsonValue)); + } + + /** + * coinSupplyHandler returns coin distribution supply stats + */ + async coinSupply(): Promise { + const response = await this.coinSupplyRaw(); + return await response.value(); + } + + /** + * Creates a new CSRF token. Previous CSRF tokens are invalidated by this call. + */ + async csrfRaw(): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/csrf`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2003FromJSON(jsonValue)); + } + + /** + * Creates a new CSRF token. Previous CSRF tokens are invalidated by this call. + */ + async csrf(): Promise { + const response = await this.csrfRaw(); + return await response.value(); + } + + /** + */ + async dataDELETERaw(requestParameters: DataDELETERequest): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.type !== undefined && requestParameters.type !== null) { + headerParameters['type'] = String(requestParameters.type); + } + + if (requestParameters.key !== undefined && requestParameters.key !== null) { + headerParameters['key'] = String(requestParameters.key); + } + + const response = await this.request({ + path: `/api/v2/data`, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.VoidApiResponse(response); + } + + /** + */ + async dataDELETE(requestParameters: DataDELETERequest): Promise { + await this.dataDELETERaw(requestParameters); + } + + /** + */ + async dataGETRaw(requestParameters: DataGETRequest): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.type !== undefined && requestParameters.type !== null) { + headerParameters['type'] = String(requestParameters.type); + } + + if (requestParameters.key !== undefined && requestParameters.key !== null) { + headerParameters['key'] = String(requestParameters.key); + } + + const response = await this.request({ + path: `/api/v2/data`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + */ + async dataGET(requestParameters: DataGETRequest): Promise { + const response = await this.dataGETRaw(requestParameters); + return await response.value(); + } + + /** + */ + async dataPOSTRaw(requestParameters: DataPOSTRequest): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.type !== undefined && requestParameters.type !== null) { + headerParameters['type'] = String(requestParameters.type); + } + + if (requestParameters.key !== undefined && requestParameters.key !== null) { + headerParameters['key'] = String(requestParameters.key); + } + + if (requestParameters.val !== undefined && requestParameters.val !== null) { + headerParameters['val'] = String(requestParameters.val); + } + + const response = await this.request({ + path: `/api/v2/data`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.VoidApiResponse(response); + } + + /** + */ + async dataPOST(requestParameters: DataPOSTRequest): Promise { + await this.dataPOSTRaw(requestParameters); + } + + /** + * defaultConnectionsHandler returns the list of default hardcoded bootstrap addresses.\\n They are not necessarily connected to. + */ + async defaultConnectionsRaw(): Promise>> { + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/network/defaultConnections`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response); + } + + /** + * defaultConnectionsHandler returns the list of default hardcoded bootstrap addresses.\\n They are not necessarily connected to. + */ + async defaultConnections(): Promise> { + const response = await this.defaultConnectionsRaw(); + return await response.value(); + } + + /** + * Returns node health data. + */ + async healthRaw(): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/health`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Returns node health data. + */ + async health(): Promise { + const response = await this.healthRaw(); + return await response.value(); + } + + /** + * Returns the most recent N blocks on the blockchain + */ + async lastBlocksRaw(requestParameters: LastBlocksRequest): Promise> { + if (requestParameters.num === null || requestParameters.num === undefined) { + throw new runtime.RequiredError('num','Required parameter requestParameters.num was null or undefined when calling lastBlocks.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.num !== undefined) { + queryParameters['num'] = requestParameters.num; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/last_blocks`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Returns the most recent N blocks on the blockchain + */ + async lastBlocks(requestParameters: LastBlocksRequest): Promise { + const response = await this.lastBlocksRaw(requestParameters); + return await response.value(); + } + + /** + * This endpoint returns a specific connection. + */ + async networkConnectionRaw(requestParameters: NetworkConnectionRequest): Promise> { + if (requestParameters.addr === null || requestParameters.addr === undefined) { + throw new runtime.RequiredError('addr','Required parameter requestParameters.addr was null or undefined when calling networkConnection.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.addr !== undefined) { + queryParameters['addr'] = requestParameters.addr; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/network/connection`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => NetworkConnectionSchemaFromJSON(jsonValue)); + } + + /** + * This endpoint returns a specific connection. + */ + async networkConnection(requestParameters: NetworkConnectionRequest): Promise { + const response = await this.networkConnectionRaw(requestParameters); + return await response.value(); + } + + /** + * This endpoint returns all outgoings connections. + */ + async networkConnectionsRaw(requestParameters: NetworkConnectionsRequest): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.states !== undefined) { + queryParameters['states'] = requestParameters.states; + } + + if (requestParameters.direction !== undefined) { + queryParameters['direction'] = requestParameters.direction; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-CSRF-TOKEN"] = this.configuration.apiKey("X-CSRF-TOKEN"); // csrfAuth authentication + } + + const response = await this.request({ + path: `/api/v1/network/connections`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2004FromJSON(jsonValue)); + } + + /** + * This endpoint returns all outgoings connections. + */ + async networkConnections(requestParameters: NetworkConnectionsRequest): Promise { + const response = await this.networkConnectionsRaw(requestParameters); + return await response.value(); + } + + /** + * This endpoint disconnects a connection by ID or address + */ + async networkConnectionsDisconnectRaw(requestParameters: NetworkConnectionsDisconnectRequest): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling networkConnectionsDisconnect.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.id !== undefined) { + queryParameters['id'] = requestParameters.id; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-CSRF-TOKEN"] = this.configuration.apiKey("X-CSRF-TOKEN"); // csrfAuth authentication + } + + const response = await this.request({ + path: `/api/v1/network/connection/disconnect`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.VoidApiResponse(response); + } + + /** + * This endpoint disconnects a connection by ID or address + */ + async networkConnectionsDisconnect(requestParameters: NetworkConnectionsDisconnectRequest): Promise { + await this.networkConnectionsDisconnectRaw(requestParameters); + } + + /** + * This endpoint returns all connections found through peer exchange + */ + async networkConnectionsExchangeRaw(): Promise>> { + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/network/connections/exchange`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response); + } + + /** + * This endpoint returns all connections found through peer exchange + */ + async networkConnectionsExchange(): Promise> { + const response = await this.networkConnectionsExchangeRaw(); + return await response.value(); + } + + /** + * 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. + */ + async networkConnectionsTrustRaw(): Promise>> { + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/network/connections/trust`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response); + } + + /** + * 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. + */ + async networkConnectionsTrust(): Promise> { + const response = await this.networkConnectionsTrustRaw(); + return await response.value(); + } + + /** + * 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. + */ + async outputsGetRaw(requestParameters: OutputsGetRequest): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.address) { + queryParameters['address'] = requestParameters.address; + } + + if (requestParameters.hash) { + queryParameters['hash'] = requestParameters.hash; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/outputs`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * 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. + */ + async outputsGet(requestParameters: OutputsGetRequest): Promise { + const response = await this.outputsGetRaw(requestParameters); + return await response.value(); + } + + /** + * 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. + */ + async outputsPostRaw(requestParameters: OutputsPostRequest): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.address !== undefined) { + queryParameters['address'] = requestParameters.address; + } + + if (requestParameters.hash !== undefined) { + queryParameters['hash'] = requestParameters.hash; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-CSRF-TOKEN"] = this.configuration.apiKey("X-CSRF-TOKEN"); // csrfAuth authentication + } + + const response = await this.request({ + path: `/api/v1/outputs`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * 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. + */ + async outputsPost(requestParameters: OutputsPostRequest): Promise { + const response = await this.outputsPostRaw(requestParameters); + return await response.value(); + } + + /** + */ + async pendingTxsRaw(): Promise>> { + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/pendingTxs`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(InlineResponse20010FromJSON)); + } + + /** + */ + async pendingTxs(): Promise> { + const response = await this.pendingTxsRaw(); + return await response.value(); + } + + /** + * Broadcasts all unconfirmed transactions from the unconfirmed transaction pool + */ + async resendUnconfirmedTxnsRaw(): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-CSRF-TOKEN"] = this.configuration.apiKey("X-CSRF-TOKEN"); // csrfAuth authentication + } + + const response = await this.request({ + path: `/api/v1/resendUnconfirmedTxns`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Broadcasts all unconfirmed transactions from the unconfirmed transaction pool + */ + async resendUnconfirmedTxns(): Promise { + const response = await this.resendUnconfirmedTxnsRaw(); + return await response.value(); + } + + /** + * Returns the top skycoin holders. + */ + async richlistRaw(requestParameters: RichlistRequest): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.includeDistribution !== undefined) { + queryParameters['include-distribution'] = requestParameters.includeDistribution; + } + + if (requestParameters.n !== undefined) { + queryParameters['n'] = requestParameters.n; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/richlist`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Returns the top skycoin holders. + */ + async richlist(requestParameters: RichlistRequest): Promise { + const response = await this.richlistRaw(requestParameters); + return await response.value(); + } + + /** + * Returns a transaction identified by its txid hash with just id + */ + async transactionRaw(requestParameters: TransactionRequest): Promise> { + if (requestParameters.txid === null || requestParameters.txid === undefined) { + throw new runtime.RequiredError('txid','Required parameter requestParameters.txid was null or undefined when calling transaction.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.txid !== undefined) { + queryParameters['txid'] = requestParameters.txid; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/transaction`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionFromJSON(jsonValue)); + } + + /** + * Returns a transaction identified by its txid hash with just id + */ + async transaction(requestParameters: TransactionRequest): Promise { + const response = await this.transactionRaw(requestParameters); + return await response.value(); + } + + /** + * Broadcast a hex-encoded, serialized transaction to the network. + */ + async transactionInjectRaw(requestParameters: TransactionInjectRequest): Promise> { + if (requestParameters.rawtx === null || requestParameters.rawtx === undefined) { + throw new runtime.RequiredError('rawtx','Required parameter requestParameters.rawtx was null or undefined when calling transactionInject.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.rawtx !== undefined && requestParameters.rawtx !== null) { + headerParameters['rawtx'] = String(requestParameters.rawtx); + } + + if (requestParameters.noBroadcast !== undefined && requestParameters.noBroadcast !== null) { + headerParameters['no_broadcast'] = String(requestParameters.noBroadcast); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-CSRF-TOKEN"] = this.configuration.apiKey("X-CSRF-TOKEN"); // csrfAuth authentication + } + + const response = await this.request({ + path: `/api/v1/injectTransaction`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Broadcast a hex-encoded, serialized transaction to the network. + */ + async transactionInject(requestParameters: TransactionInjectRequest): Promise { + const response = await this.transactionInjectRaw(requestParameters); + return await response.value(); + } + + /** + */ + async transactionPostRaw(requestParameters: TransactionPostRequest): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-CSRF-TOKEN"] = this.configuration.apiKey("X-CSRF-TOKEN"); // csrfAuth authentication + } + + const response = await this.request({ + path: `/api/v2/transaction`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: TransactionV2ParamsAddressToJSON(requestParameters.transactionV2ParamsAddress), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2008FromJSON(jsonValue)); + } + + /** + */ + async transactionPost(requestParameters: TransactionPostRequest): Promise { + const response = await this.transactionPostRaw(requestParameters); + return await response.value(); + } + + /** + */ + async transactionPostUnspentRaw(requestParameters: TransactionPostUnspentRequest): Promise> { + if (requestParameters.transactionV2ParamsUnspent === null || requestParameters.transactionV2ParamsUnspent === undefined) { + throw new runtime.RequiredError('transactionV2ParamsUnspent','Required parameter requestParameters.transactionV2ParamsUnspent was null or undefined when calling transactionPostUnspent.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-CSRF-TOKEN"] = this.configuration.apiKey("X-CSRF-TOKEN"); // csrfAuth authentication + } + + const response = await this.request({ + path: `/api/v2/transaction/unspent`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: TransactionV2ParamsUnspentToJSON(requestParameters.transactionV2ParamsUnspent), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2008FromJSON(jsonValue)); + } + + /** + */ + async transactionPostUnspent(requestParameters: TransactionPostUnspentRequest): Promise { + const response = await this.transactionPostUnspentRaw(requestParameters); + return await response.value(); + } + + /** + * Returns the hex-encoded byte serialization of a transaction. The transaction may be confirmed or unconfirmed. + */ + async transactionRawRaw(requestParameters: TransactionRawRequest): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.txid !== undefined) { + queryParameters['txid'] = requestParameters.txid; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v2/transaction/raw`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Returns the hex-encoded byte serialization of a transaction. The transaction may be confirmed or unconfirmed. + */ + async transactionRaw(requestParameters: TransactionRawRequest): Promise { + const response = await this.transactionRawRaw(requestParameters); + return await response.value(); + } + + /** + * Decode and verify an encoded transaction + */ + async transactionVerifyRaw(requestParameters: TransactionVerifyRequest): Promise> { + if (requestParameters.transactionVerifyRequest === null || requestParameters.transactionVerifyRequest === undefined) { + throw new runtime.RequiredError('transactionVerifyRequest','Required parameter requestParameters.transactionVerifyRequest was null or undefined when calling transactionVerify.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-CSRF-TOKEN"] = this.configuration.apiKey("X-CSRF-TOKEN"); // csrfAuth authentication + } + + const response = await this.request({ + path: `/api/v2/transaction/verify`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: TransactionVerifyRequestToJSON(requestParameters.transactionVerifyRequest), + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Decode and verify an encoded transaction + */ + async transactionVerify(requestParameters: TransactionVerifyRequest): Promise { + const response = await this.transactionVerifyRaw(requestParameters); + return await response.value(); + } + + /** + * Returns transactions that match the filters. + */ + async transactionsGetRaw(requestParameters: TransactionsGetRequest): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.addrs !== undefined) { + queryParameters['addrs'] = requestParameters.addrs; + } + + if (requestParameters.confirmed !== undefined) { + queryParameters['confirmed'] = requestParameters.confirmed; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/transactions`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Returns transactions that match the filters. + */ + async transactionsGet(requestParameters: TransactionsGetRequest): Promise { + const response = await this.transactionsGetRaw(requestParameters); + return await response.value(); + } + + /** + * Returns transactions that match the filters. + */ + async transactionsPostRaw(requestParameters: TransactionsPostRequest): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.addrs !== undefined) { + queryParameters['addrs'] = requestParameters.addrs; + } + + if (requestParameters.confirmed !== undefined) { + queryParameters['confirmed'] = requestParameters.confirmed; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-CSRF-TOKEN"] = this.configuration.apiKey("X-CSRF-TOKEN"); // csrfAuth authentication + } + + const response = await this.request({ + path: `/api/v1/transactions`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Returns transactions that match the filters. + */ + async transactionsPost(requestParameters: TransactionsPostRequest): Promise { + const response = await this.transactionsPostRaw(requestParameters); + return await response.value(); + } + + /** + * Returns an unspent output by ID. + */ + async uxoutRaw(requestParameters: UxoutRequest): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.uxid !== undefined) { + queryParameters['uxid'] = requestParameters.uxid; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/uxout`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Returns an unspent output by ID. + */ + async uxout(requestParameters: UxoutRequest): Promise { + const response = await this.uxoutRaw(requestParameters); + return await response.value(); + } + + /** + * Verifies a Skycoin address. + */ + async verifyAddressRaw(requestParameters: VerifyAddressRequest): Promise> { + if (requestParameters.address === null || requestParameters.address === undefined) { + throw new runtime.RequiredError('address','Required parameter requestParameters.address was null or undefined when calling verifyAddress.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.address !== undefined) { + queryParameters['address'] = requestParameters.address; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-CSRF-TOKEN"] = this.configuration.apiKey("X-CSRF-TOKEN"); // csrfAuth authentication + } + + const response = await this.request({ + path: `/api/v2/address/verify`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Verifies a Skycoin address. + */ + async verifyAddress(requestParameters: VerifyAddressRequest): Promise { + const response = await this.verifyAddressRaw(requestParameters); + return await response.value(); + } + + /** + * versionHandler returns the application version info + */ + async versionRaw(): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/version`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2005FromJSON(jsonValue)); + } + + /** + * versionHandler returns the application version info + */ + async version(): Promise { + const response = await this.versionRaw(); + return await response.value(); + } + + /** + * Returns a wallet by id. + */ + async walletRaw(requestParameters: WalletRequest): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling wallet.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.id !== undefined) { + queryParameters['id'] = requestParameters.id; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/wallet`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Returns a wallet by id. + */ + async wallet(requestParameters: WalletRequest): Promise { + const response = await this.walletRaw(requestParameters); + return await response.value(); + } + + /** + * Returns the wallet\'s balance, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. + */ + async walletBalanceRaw(requestParameters: WalletBalanceRequest): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling walletBalance.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.id !== undefined) { + queryParameters['id'] = requestParameters.id; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/wallet/balance`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Returns the wallet\'s balance, both confirmed and predicted. The predicted balance is the confirmed balance minus the pending spends. + */ + async walletBalance(requestParameters: WalletBalanceRequest): Promise { + const response = await this.walletBalanceRaw(requestParameters); + return await response.value(); + } + + /** + * Create a wallet + */ + async walletCreateRaw(requestParameters: WalletCreateRequest): Promise> { + if (requestParameters.type === null || requestParameters.type === undefined) { + throw new runtime.RequiredError('type','Required parameter requestParameters.type was null or undefined when calling walletCreate.'); + } + + if (requestParameters.seed === null || requestParameters.seed === undefined) { + throw new runtime.RequiredError('seed','Required parameter requestParameters.seed was null or undefined when calling walletCreate.'); + } + + if (requestParameters.label === null || requestParameters.label === undefined) { + throw new runtime.RequiredError('label','Required parameter requestParameters.label was null or undefined when calling walletCreate.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.seedPassphrase !== undefined && requestParameters.seedPassphrase !== null) { + headerParameters['seed-passphrase'] = String(requestParameters.seedPassphrase); + } + + if (requestParameters.type !== undefined && requestParameters.type !== null) { + headerParameters['type'] = String(requestParameters.type); + } + + if (requestParameters.bip44Coin !== undefined && requestParameters.bip44Coin !== null) { + headerParameters['bip44-coin'] = String(requestParameters.bip44Coin); + } + + if (requestParameters.seed !== undefined && requestParameters.seed !== null) { + headerParameters['seed'] = String(requestParameters.seed); + } + + if (requestParameters.xpub !== undefined && requestParameters.xpub !== null) { + headerParameters['xpub'] = String(requestParameters.xpub); + } + + if (requestParameters.label !== undefined && requestParameters.label !== null) { + headerParameters['label'] = String(requestParameters.label); + } + + if (requestParameters.scan !== undefined && requestParameters.scan !== null) { + headerParameters['scan'] = String(requestParameters.scan); + } + + if (requestParameters.encrypt !== undefined && requestParameters.encrypt !== null) { + headerParameters['encrypt'] = String(requestParameters.encrypt); + } + + if (requestParameters.password !== undefined && requestParameters.password !== null) { + headerParameters['password'] = String(requestParameters.password); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-CSRF-TOKEN"] = this.configuration.apiKey("X-CSRF-TOKEN"); // csrfAuth authentication + } + + const response = await this.request({ + path: `/api/v1/wallet/create`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Create a wallet + */ + async walletCreate(requestParameters: WalletCreateRequest): Promise { + const response = await this.walletCreateRaw(requestParameters); + return await response.value(); + } + + /** + * Decrypts wallet. + */ + async walletDecryptRaw(requestParameters: WalletDecryptRequest): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling walletDecrypt.'); + } + + if (requestParameters.password === null || requestParameters.password === undefined) { + throw new runtime.RequiredError('password','Required parameter requestParameters.password was null or undefined when calling walletDecrypt.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.id !== undefined && requestParameters.id !== null) { + headerParameters['id'] = String(requestParameters.id); + } + + if (requestParameters.password !== undefined && requestParameters.password !== null) { + headerParameters['password'] = String(requestParameters.password); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-CSRF-TOKEN"] = this.configuration.apiKey("X-CSRF-TOKEN"); // csrfAuth authentication + } + + const response = await this.request({ + path: `/api/v1/wallet/decrypt`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Decrypts wallet. + */ + async walletDecrypt(requestParameters: WalletDecryptRequest): Promise { + const response = await this.walletDecryptRaw(requestParameters); + return await response.value(); + } + + /** + * Encrypt wallet. + */ + async walletEncryptRaw(requestParameters: WalletEncryptRequest): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling walletEncrypt.'); + } + + if (requestParameters.password === null || requestParameters.password === undefined) { + throw new runtime.RequiredError('password','Required parameter requestParameters.password was null or undefined when calling walletEncrypt.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.id !== undefined && requestParameters.id !== null) { + headerParameters['id'] = String(requestParameters.id); + } + + if (requestParameters.password !== undefined && requestParameters.password !== null) { + headerParameters['password'] = String(requestParameters.password); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-CSRF-TOKEN"] = this.configuration.apiKey("X-CSRF-TOKEN"); // csrfAuth authentication + } + + const response = await this.request({ + path: `/api/v1/wallet/encrypt`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Encrypt wallet. + */ + async walletEncrypt(requestParameters: WalletEncryptRequest): Promise { + const response = await this.walletEncryptRaw(requestParameters); + return await response.value(); + } + + /** + * Returns the wallet directory path + */ + async walletFolderRaw(requestParameters: WalletFolderRequest): Promise> { + if (requestParameters.addr === null || requestParameters.addr === undefined) { + throw new runtime.RequiredError('addr','Required parameter requestParameters.addr was null or undefined when calling walletFolder.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.addr !== undefined) { + queryParameters['addr'] = requestParameters.addr; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/wallets/folderName`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2007FromJSON(jsonValue)); + } + + /** + * Returns the wallet directory path + */ + async walletFolder(requestParameters: WalletFolderRequest): Promise { + const response = await this.walletFolderRaw(requestParameters); + return await response.value(); + } + + /** + * Generates new addresses + */ + async walletNewAddressRaw(requestParameters: WalletNewAddressRequest): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling walletNewAddress.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.id !== undefined) { + queryParameters['id'] = requestParameters.id; + } + + if (requestParameters.num !== undefined) { + queryParameters['num'] = requestParameters.num; + } + + if (requestParameters.password !== undefined) { + queryParameters['password'] = requestParameters.password; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-CSRF-TOKEN"] = this.configuration.apiKey("X-CSRF-TOKEN"); // csrfAuth authentication + } + + const response = await this.request({ + path: `/api/v1/wallet/newAddress`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Generates new addresses + */ + async walletNewAddress(requestParameters: WalletNewAddressRequest): Promise { + const response = await this.walletNewAddressRaw(requestParameters); + return await response.value(); + } + + /** + * Returns the wallet directory path + */ + async walletNewSeedRaw(requestParameters: WalletNewSeedRequest): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.entropy !== undefined) { + queryParameters['entropy'] = requestParameters.entropy; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/wallet/newSeed`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Returns the wallet directory path + */ + async walletNewSeed(requestParameters: WalletNewSeedRequest): Promise { + const response = await this.walletNewSeedRaw(requestParameters); + return await response.value(); + } + + /** + * Recovers an encrypted wallet by providing the wallet seed and optional seed passphrase + * 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. + */ + async walletRecoverRaw(requestParameters: WalletRecoverRequest): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling walletRecover.'); + } + + if (requestParameters.seed === null || requestParameters.seed === undefined) { + throw new runtime.RequiredError('seed','Required parameter requestParameters.seed was null or undefined when calling walletRecover.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.id !== undefined && requestParameters.id !== null) { + headerParameters['id'] = String(requestParameters.id); + } + + if (requestParameters.seed !== undefined && requestParameters.seed !== null) { + headerParameters['seed'] = String(requestParameters.seed); + } + + if (requestParameters.seedPassphrase !== undefined && requestParameters.seedPassphrase !== null) { + headerParameters['seed-passphrase'] = String(requestParameters.seedPassphrase); + } + + if (requestParameters.password !== undefined && requestParameters.password !== null) { + headerParameters['password'] = String(requestParameters.password); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-CSRF-TOKEN"] = this.configuration.apiKey("X-CSRF-TOKEN"); // csrfAuth authentication + } + + const response = await this.request({ + path: `/api/v2/wallet/recover`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Recovers an encrypted wallet by providing the wallet seed and optional seed passphrase + * 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. + */ + async walletRecover(requestParameters: WalletRecoverRequest): Promise { + const response = await this.walletRecoverRaw(requestParameters); + return await response.value(); + } + + /** + * This endpoint only works for encrypted wallets. If the wallet is unencrypted, The seed will be not returned. + */ + async walletSeedRaw(requestParameters: WalletSeedRequest): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling walletSeed.'); + } + + if (requestParameters.password === null || requestParameters.password === undefined) { + throw new runtime.RequiredError('password','Required parameter requestParameters.password was null or undefined when calling walletSeed.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.id !== undefined) { + queryParameters['id'] = requestParameters.id; + } + + if (requestParameters.password !== undefined) { + queryParameters['password'] = requestParameters.password; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-CSRF-TOKEN"] = this.configuration.apiKey("X-CSRF-TOKEN"); // csrfAuth authentication + } + + const response = await this.request({ + path: `/api/v1/wallet/seed`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * This endpoint only works for encrypted wallets. If the wallet is unencrypted, The seed will be not returned. + */ + async walletSeed(requestParameters: WalletSeedRequest): Promise { + const response = await this.walletSeedRaw(requestParameters); + return await response.value(); + } + + /** + * Verifies a wallet seed. + */ + async walletSeedVerifyRaw(requestParameters: WalletSeedVerifyRequest): Promise> { + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.seed !== undefined && requestParameters.seed !== null) { + headerParameters['seed'] = String(requestParameters.seed); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-CSRF-TOKEN"] = this.configuration.apiKey("X-CSRF-TOKEN"); // csrfAuth authentication + } + + const response = await this.request({ + path: `/api/v2/wallet/seed/verify`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Verifies a wallet seed. + */ + async walletSeedVerify(requestParameters: WalletSeedVerifyRequest): Promise { + const response = await this.walletSeedVerifyRaw(requestParameters); + return await response.value(); + } + + /** + * Creates a signed transaction + */ + async walletTransactionRaw(requestParameters: WalletTransactionRequest): Promise> { + if (requestParameters.walletTransactionRequest === null || requestParameters.walletTransactionRequest === undefined) { + throw new runtime.RequiredError('walletTransactionRequest','Required parameter requestParameters.walletTransactionRequest was null or undefined when calling walletTransaction.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-CSRF-TOKEN"] = this.configuration.apiKey("X-CSRF-TOKEN"); // csrfAuth authentication + } + + const response = await this.request({ + path: `/api/v1/wallet/transaction`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: WalletTransactionRequestToJSON(requestParameters.walletTransactionRequest), + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Creates a signed transaction + */ + async walletTransaction(requestParameters: WalletTransactionRequest): Promise { + const response = await this.walletTransactionRaw(requestParameters); + return await response.value(); + } + + /** + * Creates a signed transaction + */ + async walletTransactionSignRaw(requestParameters: WalletTransactionSignRequest): Promise> { + if (requestParameters.walletTransactionSignRequest === null || requestParameters.walletTransactionSignRequest === undefined) { + throw new runtime.RequiredError('walletTransactionSignRequest','Required parameter requestParameters.walletTransactionSignRequest was null or undefined when calling walletTransactionSign.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-CSRF-TOKEN"] = this.configuration.apiKey("X-CSRF-TOKEN"); // csrfAuth authentication + } + + const response = await this.request({ + path: `/api/v2/wallet/transaction/sign`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: WalletTransactionSignRequestToJSON(requestParameters.walletTransactionSignRequest), + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2009FromJSON(jsonValue)); + } + + /** + * Creates a signed transaction + */ + async walletTransactionSign(requestParameters: WalletTransactionSignRequest): Promise { + const response = await this.walletTransactionSignRaw(requestParameters); + return await response.value(); + } + + /** + */ + async walletTransactionsRaw(requestParameters: WalletTransactionsRequest): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling walletTransactions.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.id !== undefined) { + queryParameters['id'] = requestParameters.id; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/wallet/transactions`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse2006FromJSON(jsonValue)); + } + + /** + */ + async walletTransactions(requestParameters: WalletTransactionsRequest): Promise { + const response = await this.walletTransactionsRaw(requestParameters); + return await response.value(); + } + + /** + * Unloads wallet from the wallet service. + */ + async walletUnloadRaw(requestParameters: WalletUnloadRequest): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling walletUnload.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + if (requestParameters.id !== undefined) { + queryParameters['id'] = requestParameters.id; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-CSRF-TOKEN"] = this.configuration.apiKey("X-CSRF-TOKEN"); // csrfAuth authentication + } + + const response = await this.request({ + path: `/api/v1/wallet/unload`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.VoidApiResponse(response); + } + + /** + * Unloads wallet from the wallet service. + */ + async walletUnload(requestParameters: WalletUnloadRequest): Promise { + await this.walletUnloadRaw(requestParameters); + } + + /** + * Update the wallet. + */ + async walletUpdateRaw(requestParameters: WalletUpdateRequest): Promise> { + if (requestParameters.id === null || requestParameters.id === undefined) { + throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling walletUpdate.'); + } + + if (requestParameters.label === null || requestParameters.label === undefined) { + throw new runtime.RequiredError('label','Required parameter requestParameters.label was null or undefined when calling walletUpdate.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters.id !== undefined && requestParameters.id !== null) { + headerParameters['id'] = String(requestParameters.id); + } + + if (requestParameters.label !== undefined && requestParameters.label !== null) { + headerParameters['label'] = String(requestParameters.label); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-CSRF-TOKEN"] = this.configuration.apiKey("X-CSRF-TOKEN"); // csrfAuth authentication + } + + const response = await this.request({ + path: `/api/v1/wallet/update`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.TextApiResponse(response); + } + + /** + * Update the wallet. + */ + async walletUpdate(requestParameters: WalletUpdateRequest): Promise { + const response = await this.walletUpdateRaw(requestParameters); + return await response.value(); + } + + /** + * Returns all loaded wallets + */ + async walletsRaw(): Promise>> { + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/api/v1/wallets`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response); + } + + /** + * Returns all loaded wallets + */ + async wallets(): Promise> { + const response = await this.walletsRaw(); + return await response.value(); + } + +} + +/** + * @export + * @enum {string} + */ +export enum NetworkConnectionsStatesEnum { + Pending = 'pending', + Connected = 'connected', + Introduced = 'introduced' +} +/** + * @export + * @enum {string} + */ +export enum NetworkConnectionsDirectionEnum { + Connected = 'connected', + Introduced = 'introduced' +} +/** + * @export + * @enum {string} + */ +export enum WalletNewSeedEntropyEnum { + _128 = '128', + _256 = '256' +} diff --git a/lib/skyapi/fetch/apis/index.ts b/lib/skyapi/fetch/apis/index.ts new file mode 100644 index 0000000..a1aa469 --- /dev/null +++ b/lib/skyapi/fetch/apis/index.ts @@ -0,0 +1 @@ +export * from './DefaultApi'; diff --git a/lib/skyapi/fetch/index.ts b/lib/skyapi/fetch/index.ts new file mode 100644 index 0000000..848ecfa --- /dev/null +++ b/lib/skyapi/fetch/index.ts @@ -0,0 +1,3 @@ +export * from './runtime'; +export * from './apis'; +export * from './models'; diff --git a/lib/skyapi/fetch/models/Address.ts b/lib/skyapi/fetch/models/Address.ts new file mode 100644 index 0000000..323bc2a --- /dev/null +++ b/lib/skyapi/fetch/models/Address.ts @@ -0,0 +1,44 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface Address + */ +export interface Address { + /** + * + * @type {string} + * @memberof Address + */ + address: string; +} + +export function AddressFromJSON(json: any): Address { + return { + 'address': json['address'], + }; +} + +export function AddressToJSON(value?: Address): any { + if (value === undefined) { + return undefined; + } + return { + 'address': value.address, + }; +} + + diff --git a/lib/skyapi/fetch/models/ApiV1PendingTxsTransaction.ts b/lib/skyapi/fetch/models/ApiV1PendingTxsTransaction.ts new file mode 100644 index 0000000..6a29771 --- /dev/null +++ b/lib/skyapi/fetch/models/ApiV1PendingTxsTransaction.ts @@ -0,0 +1,98 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + ApiV1PendingTxsTransactionOutputs, + ApiV1PendingTxsTransactionOutputsFromJSON, + ApiV1PendingTxsTransactionOutputsToJSON, +} from './'; + +/** + * + * @export + * @interface ApiV1PendingTxsTransaction + */ +export interface ApiV1PendingTxsTransaction { + /** + * + * @type {number} + * @memberof ApiV1PendingTxsTransaction + */ + length?: number; + /** + * + * @type {number} + * @memberof ApiV1PendingTxsTransaction + */ + type?: number; + /** + * + * @type {string} + * @memberof ApiV1PendingTxsTransaction + */ + txid?: string; + /** + * + * @type {string} + * @memberof ApiV1PendingTxsTransaction + */ + innerHash?: string; + /** + * + * @type {Array} + * @memberof ApiV1PendingTxsTransaction + */ + sigs?: Array; + /** + * + * @type {Array} + * @memberof ApiV1PendingTxsTransaction + */ + inputs?: Array; + /** + * + * @type {Array} + * @memberof ApiV1PendingTxsTransaction + */ + outputs?: Array; +} + +export function ApiV1PendingTxsTransactionFromJSON(json: any): ApiV1PendingTxsTransaction { + return { + 'length': !exists(json, 'length') ? undefined : json['length'], + 'type': !exists(json, 'type') ? undefined : json['type'], + 'txid': !exists(json, 'txid') ? undefined : json['txid'], + 'innerHash': !exists(json, 'inner_hash') ? undefined : json['inner_hash'], + 'sigs': !exists(json, 'sigs') ? undefined : json['sigs'], + 'inputs': !exists(json, 'inputs') ? undefined : json['inputs'], + 'outputs': !exists(json, 'outputs') ? undefined : (json['outputs'] as Array).map(ApiV1PendingTxsTransactionOutputsFromJSON), + }; +} + +export function ApiV1PendingTxsTransactionToJSON(value?: ApiV1PendingTxsTransaction): any { + if (value === undefined) { + return undefined; + } + return { + 'length': value.length, + 'type': value.type, + 'txid': value.txid, + 'inner_hash': value.innerHash, + 'sigs': value.sigs, + 'inputs': value.inputs, + 'outputs': value.outputs === undefined ? undefined : (value.outputs as Array).map(ApiV1PendingTxsTransactionOutputsToJSON), + }; +} + + diff --git a/lib/skyapi/fetch/models/ApiV1PendingTxsTransactionOutputs.ts b/lib/skyapi/fetch/models/ApiV1PendingTxsTransactionOutputs.ts new file mode 100644 index 0000000..f2aa574 --- /dev/null +++ b/lib/skyapi/fetch/models/ApiV1PendingTxsTransactionOutputs.ts @@ -0,0 +1,68 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface ApiV1PendingTxsTransactionOutputs + */ +export interface ApiV1PendingTxsTransactionOutputs { + /** + * + * @type {string} + * @memberof ApiV1PendingTxsTransactionOutputs + */ + uxid?: string; + /** + * + * @type {string} + * @memberof ApiV1PendingTxsTransactionOutputs + */ + dst?: string; + /** + * + * @type {string} + * @memberof ApiV1PendingTxsTransactionOutputs + */ + coins?: string; + /** + * + * @type {number} + * @memberof ApiV1PendingTxsTransactionOutputs + */ + hours?: number; +} + +export function ApiV1PendingTxsTransactionOutputsFromJSON(json: any): ApiV1PendingTxsTransactionOutputs { + return { + 'uxid': !exists(json, 'uxid') ? undefined : json['uxid'], + 'dst': !exists(json, 'dst') ? undefined : json['dst'], + 'coins': !exists(json, 'coins') ? undefined : json['coins'], + 'hours': !exists(json, 'hours') ? undefined : json['hours'], + }; +} + +export function ApiV1PendingTxsTransactionOutputsToJSON(value?: ApiV1PendingTxsTransactionOutputs): any { + if (value === undefined) { + return undefined; + } + return { + 'uxid': value.uxid, + 'dst': value.dst, + 'coins': value.coins, + 'hours': value.hours, + }; +} + + diff --git a/lib/skyapi/fetch/models/BlockSchema.ts b/lib/skyapi/fetch/models/BlockSchema.ts new file mode 100644 index 0000000..02155ea --- /dev/null +++ b/lib/skyapi/fetch/models/BlockSchema.ts @@ -0,0 +1,69 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + BlockSchemaBody, + BlockSchemaBodyFromJSON, + BlockSchemaBodyToJSON, + BlockVerboseSchemaHeader, + BlockVerboseSchemaHeaderFromJSON, + BlockVerboseSchemaHeaderToJSON, +} from './'; + +/** + * + * @export + * @interface BlockSchema + */ +export interface BlockSchema { + /** + * + * @type {BlockVerboseSchemaHeader} + * @memberof BlockSchema + */ + header?: BlockVerboseSchemaHeader; + /** + * + * @type {BlockSchemaBody} + * @memberof BlockSchema + */ + body?: BlockSchemaBody; + /** + * + * @type {number} + * @memberof BlockSchema + */ + size?: number; +} + +export function BlockSchemaFromJSON(json: any): BlockSchema { + return { + 'header': !exists(json, 'header') ? undefined : BlockVerboseSchemaHeaderFromJSON(json['header']), + 'body': !exists(json, 'body') ? undefined : BlockSchemaBodyFromJSON(json['body']), + 'size': !exists(json, 'size') ? undefined : json['size'], + }; +} + +export function BlockSchemaToJSON(value?: BlockSchema): any { + if (value === undefined) { + return undefined; + } + return { + 'header': BlockVerboseSchemaHeaderToJSON(value.header), + 'body': BlockSchemaBodyToJSON(value.body), + 'size': value.size, + }; +} + + diff --git a/lib/skyapi/fetch/models/BlockSchemaBody.ts b/lib/skyapi/fetch/models/BlockSchemaBody.ts new file mode 100644 index 0000000..9ca42a9 --- /dev/null +++ b/lib/skyapi/fetch/models/BlockSchemaBody.ts @@ -0,0 +1,44 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface BlockSchemaBody + */ +export interface BlockSchemaBody { + /** + * + * @type {Array} + * @memberof BlockSchemaBody + */ + txns?: Array; +} + +export function BlockSchemaBodyFromJSON(json: any): BlockSchemaBody { + return { + 'txns': !exists(json, 'txns') ? undefined : json['txns'], + }; +} + +export function BlockSchemaBodyToJSON(value?: BlockSchemaBody): any { + if (value === undefined) { + return undefined; + } + return { + 'txns': value.txns, + }; +} + + diff --git a/lib/skyapi/fetch/models/BlockVerboseSchema.ts b/lib/skyapi/fetch/models/BlockVerboseSchema.ts new file mode 100644 index 0000000..770da3b --- /dev/null +++ b/lib/skyapi/fetch/models/BlockVerboseSchema.ts @@ -0,0 +1,69 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + BlockVerboseSchemaBody, + BlockVerboseSchemaBodyFromJSON, + BlockVerboseSchemaBodyToJSON, + BlockVerboseSchemaHeader, + BlockVerboseSchemaHeaderFromJSON, + BlockVerboseSchemaHeaderToJSON, +} from './'; + +/** + * + * @export + * @interface BlockVerboseSchema + */ +export interface BlockVerboseSchema { + /** + * + * @type {BlockVerboseSchemaHeader} + * @memberof BlockVerboseSchema + */ + header?: BlockVerboseSchemaHeader; + /** + * + * @type {BlockVerboseSchemaBody} + * @memberof BlockVerboseSchema + */ + body?: BlockVerboseSchemaBody; + /** + * + * @type {number} + * @memberof BlockVerboseSchema + */ + size?: number; +} + +export function BlockVerboseSchemaFromJSON(json: any): BlockVerboseSchema { + return { + 'header': !exists(json, 'header') ? undefined : BlockVerboseSchemaHeaderFromJSON(json['header']), + 'body': !exists(json, 'body') ? undefined : BlockVerboseSchemaBodyFromJSON(json['body']), + 'size': !exists(json, 'size') ? undefined : json['size'], + }; +} + +export function BlockVerboseSchemaToJSON(value?: BlockVerboseSchema): any { + if (value === undefined) { + return undefined; + } + return { + 'header': BlockVerboseSchemaHeaderToJSON(value.header), + 'body': BlockVerboseSchemaBodyToJSON(value.body), + 'size': value.size, + }; +} + + diff --git a/lib/skyapi/fetch/models/BlockVerboseSchemaBody.ts b/lib/skyapi/fetch/models/BlockVerboseSchemaBody.ts new file mode 100644 index 0000000..34fa809 --- /dev/null +++ b/lib/skyapi/fetch/models/BlockVerboseSchemaBody.ts @@ -0,0 +1,44 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface BlockVerboseSchemaBody + */ +export interface BlockVerboseSchemaBody { + /** + * + * @type {Array} + * @memberof BlockVerboseSchemaBody + */ + txns?: Array; +} + +export function BlockVerboseSchemaBodyFromJSON(json: any): BlockVerboseSchemaBody { + return { + 'txns': !exists(json, 'txns') ? undefined : json['txns'], + }; +} + +export function BlockVerboseSchemaBodyToJSON(value?: BlockVerboseSchemaBody): any { + if (value === undefined) { + return undefined; + } + return { + 'txns': value.txns, + }; +} + + diff --git a/lib/skyapi/fetch/models/BlockVerboseSchemaHeader.ts b/lib/skyapi/fetch/models/BlockVerboseSchemaHeader.ts new file mode 100644 index 0000000..2fa683b --- /dev/null +++ b/lib/skyapi/fetch/models/BlockVerboseSchemaHeader.ts @@ -0,0 +1,100 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface BlockVerboseSchemaHeader + */ +export interface BlockVerboseSchemaHeader { + /** + * + * @type {number} + * @memberof BlockVerboseSchemaHeader + */ + seq?: number; + /** + * + * @type {number} + * @memberof BlockVerboseSchemaHeader + */ + timestamp?: number; + /** + * + * @type {number} + * @memberof BlockVerboseSchemaHeader + */ + fee?: number; + /** + * + * @type {number} + * @memberof BlockVerboseSchemaHeader + */ + version?: number; + /** + * + * @type {string} + * @memberof BlockVerboseSchemaHeader + */ + blockHash?: string; + /** + * + * @type {string} + * @memberof BlockVerboseSchemaHeader + */ + previousBlockHash?: string; + /** + * + * @type {string} + * @memberof BlockVerboseSchemaHeader + */ + txBodyHash?: string; + /** + * + * @type {string} + * @memberof BlockVerboseSchemaHeader + */ + uxHash?: string; +} + +export function BlockVerboseSchemaHeaderFromJSON(json: any): BlockVerboseSchemaHeader { + return { + 'seq': !exists(json, 'seq') ? undefined : json['seq'], + 'timestamp': !exists(json, 'timestamp') ? undefined : json['timestamp'], + 'fee': !exists(json, 'fee') ? undefined : json['fee'], + 'version': !exists(json, 'version') ? undefined : json['version'], + 'blockHash': !exists(json, 'block_hash') ? undefined : json['block_hash'], + 'previousBlockHash': !exists(json, 'previous_block_hash') ? undefined : json['previous_block_hash'], + 'txBodyHash': !exists(json, 'tx_body_hash') ? undefined : json['tx_body_hash'], + 'uxHash': !exists(json, 'ux_hash') ? undefined : json['ux_hash'], + }; +} + +export function BlockVerboseSchemaHeaderToJSON(value?: BlockVerboseSchemaHeader): any { + if (value === undefined) { + return undefined; + } + return { + 'seq': value.seq, + 'timestamp': value.timestamp, + 'fee': value.fee, + 'version': value.version, + 'block_hash': value.blockHash, + 'previous_block_hash': value.previousBlockHash, + 'tx_body_hash': value.txBodyHash, + 'ux_hash': value.uxHash, + }; +} + + diff --git a/lib/skyapi/fetch/models/InlineResponse200.ts b/lib/skyapi/fetch/models/InlineResponse200.ts new file mode 100644 index 0000000..b2f44dc --- /dev/null +++ b/lib/skyapi/fetch/models/InlineResponse200.ts @@ -0,0 +1,44 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface InlineResponse200 + */ +export interface InlineResponse200 { + /** + * + * @type {number} + * @memberof InlineResponse200 + */ + count?: number; +} + +export function InlineResponse200FromJSON(json: any): InlineResponse200 { + return { + 'count': !exists(json, 'count') ? undefined : json['count'], + }; +} + +export function InlineResponse200ToJSON(value?: InlineResponse200): any { + if (value === undefined) { + return undefined; + } + return { + 'count': value.count, + }; +} + + diff --git a/lib/skyapi/fetch/models/InlineResponse2001.ts b/lib/skyapi/fetch/models/InlineResponse2001.ts new file mode 100644 index 0000000..101bdfb --- /dev/null +++ b/lib/skyapi/fetch/models/InlineResponse2001.ts @@ -0,0 +1,50 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + BlockSchema, + BlockSchemaFromJSON, + BlockSchemaToJSON, +} from './'; + +/** + * + * @export + * @interface InlineResponse2001 + */ +export interface InlineResponse2001 { + /** + * + * @type {Array} + * @memberof InlineResponse2001 + */ + blocks?: Array; +} + +export function InlineResponse2001FromJSON(json: any): InlineResponse2001 { + return { + 'blocks': !exists(json, 'blocks') ? undefined : (json['blocks'] as Array).map(BlockSchemaFromJSON), + }; +} + +export function InlineResponse2001ToJSON(value?: InlineResponse2001): any { + if (value === undefined) { + return undefined; + } + return { + 'blocks': value.blocks === undefined ? undefined : (value.blocks as Array).map(BlockSchemaToJSON), + }; +} + + diff --git a/lib/skyapi/fetch/models/InlineResponse20010.ts b/lib/skyapi/fetch/models/InlineResponse20010.ts new file mode 100644 index 0000000..87f1844 --- /dev/null +++ b/lib/skyapi/fetch/models/InlineResponse20010.ts @@ -0,0 +1,82 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + ApiV1PendingTxsTransaction, + ApiV1PendingTxsTransactionFromJSON, + ApiV1PendingTxsTransactionToJSON, +} from './'; + +/** + * + * @export + * @interface InlineResponse20010 + */ +export interface InlineResponse20010 { + /** + * + * @type {ApiV1PendingTxsTransaction} + * @memberof InlineResponse20010 + */ + transaction?: ApiV1PendingTxsTransaction; + /** + * + * @type {string} + * @memberof InlineResponse20010 + */ + received?: string; + /** + * + * @type {string} + * @memberof InlineResponse20010 + */ + checked?: string; + /** + * + * @type {string} + * @memberof InlineResponse20010 + */ + announced?: string; + /** + * + * @type {boolean} + * @memberof InlineResponse20010 + */ + isValid?: boolean; +} + +export function InlineResponse20010FromJSON(json: any): InlineResponse20010 { + return { + 'transaction': !exists(json, 'transaction') ? undefined : ApiV1PendingTxsTransactionFromJSON(json['transaction']), + 'received': !exists(json, 'received') ? undefined : json['received'], + 'checked': !exists(json, 'checked') ? undefined : json['checked'], + 'announced': !exists(json, 'announced') ? undefined : json['announced'], + 'isValid': !exists(json, 'is_valid') ? undefined : json['is_valid'], + }; +} + +export function InlineResponse20010ToJSON(value?: InlineResponse20010): any { + if (value === undefined) { + return undefined; + } + return { + 'transaction': ApiV1PendingTxsTransactionToJSON(value.transaction), + 'received': value.received, + 'checked': value.checked, + 'announced': value.announced, + 'is_valid': value.isValid, + }; +} + + diff --git a/lib/skyapi/fetch/models/InlineResponse2002.ts b/lib/skyapi/fetch/models/InlineResponse2002.ts new file mode 100644 index 0000000..af43b35 --- /dev/null +++ b/lib/skyapi/fetch/models/InlineResponse2002.ts @@ -0,0 +1,92 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface InlineResponse2002 + */ +export interface InlineResponse2002 { + /** + * CurrentCoinHourSupply is coins hours in non distribution addresses. + * @type {string} + * @memberof InlineResponse2002 + */ + currentCoinhourSupply?: string; + /** + * Coins distributed beyond the project. + * @type {string} + * @memberof InlineResponse2002 + */ + currentSupply?: string; + /** + * Distribution addresses which are locked and do not count towards total supply. + * @type {Array} + * @memberof InlineResponse2002 + */ + lockedDistributionAddresses?: Array; + /** + * MaxSupply is the maximum number of coins to be distributed ever. + * @type {string} + * @memberof InlineResponse2002 + */ + maxSupply?: string; + /** + * TotalCoinHourSupply is coin hours in all addresses including unlocked distribution addresses. + * @type {string} + * @memberof InlineResponse2002 + */ + totalCoinhourSupply?: string; + /** + * TotalSupply is CurrentSupply plus coins held by the distribution addresses that are spendable. + * @type {string} + * @memberof InlineResponse2002 + */ + totalSupply?: string; + /** + * Distribution addresses which count towards total supply. + * @type {Array} + * @memberof InlineResponse2002 + */ + unlockedDistributionAddresses?: Array; +} + +export function InlineResponse2002FromJSON(json: any): InlineResponse2002 { + return { + 'currentCoinhourSupply': !exists(json, 'current_coinhour_supply') ? undefined : json['current_coinhour_supply'], + 'currentSupply': !exists(json, 'current_supply') ? undefined : json['current_supply'], + 'lockedDistributionAddresses': !exists(json, 'locked_distribution_addresses') ? undefined : json['locked_distribution_addresses'], + 'maxSupply': !exists(json, 'max_supply') ? undefined : json['max_supply'], + 'totalCoinhourSupply': !exists(json, 'total_coinhour_supply') ? undefined : json['total_coinhour_supply'], + 'totalSupply': !exists(json, 'total_supply') ? undefined : json['total_supply'], + 'unlockedDistributionAddresses': !exists(json, 'unlocked_distribution_addresses') ? undefined : json['unlocked_distribution_addresses'], + }; +} + +export function InlineResponse2002ToJSON(value?: InlineResponse2002): any { + if (value === undefined) { + return undefined; + } + return { + 'current_coinhour_supply': value.currentCoinhourSupply, + 'current_supply': value.currentSupply, + 'locked_distribution_addresses': value.lockedDistributionAddresses, + 'max_supply': value.maxSupply, + 'total_coinhour_supply': value.totalCoinhourSupply, + 'total_supply': value.totalSupply, + 'unlocked_distribution_addresses': value.unlockedDistributionAddresses, + }; +} + + diff --git a/lib/skyapi/fetch/models/InlineResponse2003.ts b/lib/skyapi/fetch/models/InlineResponse2003.ts new file mode 100644 index 0000000..c13a818 --- /dev/null +++ b/lib/skyapi/fetch/models/InlineResponse2003.ts @@ -0,0 +1,44 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface InlineResponse2003 + */ +export interface InlineResponse2003 { + /** + * + * @type {string} + * @memberof InlineResponse2003 + */ + csrfToken?: string; +} + +export function InlineResponse2003FromJSON(json: any): InlineResponse2003 { + return { + 'csrfToken': !exists(json, 'csrf_token') ? undefined : json['csrf_token'], + }; +} + +export function InlineResponse2003ToJSON(value?: InlineResponse2003): any { + if (value === undefined) { + return undefined; + } + return { + 'csrf_token': value.csrfToken, + }; +} + + diff --git a/lib/skyapi/fetch/models/InlineResponse2004.ts b/lib/skyapi/fetch/models/InlineResponse2004.ts new file mode 100644 index 0000000..dd498b3 --- /dev/null +++ b/lib/skyapi/fetch/models/InlineResponse2004.ts @@ -0,0 +1,50 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + NetworkConnectionSchema, + NetworkConnectionSchemaFromJSON, + NetworkConnectionSchemaToJSON, +} from './'; + +/** + * + * @export + * @interface InlineResponse2004 + */ +export interface InlineResponse2004 { + /** + * + * @type {Array} + * @memberof InlineResponse2004 + */ + connections?: Array; +} + +export function InlineResponse2004FromJSON(json: any): InlineResponse2004 { + return { + 'connections': !exists(json, 'connections') ? undefined : (json['connections'] as Array).map(NetworkConnectionSchemaFromJSON), + }; +} + +export function InlineResponse2004ToJSON(value?: InlineResponse2004): any { + if (value === undefined) { + return undefined; + } + return { + 'connections': value.connections === undefined ? undefined : (value.connections as Array).map(NetworkConnectionSchemaToJSON), + }; +} + + diff --git a/lib/skyapi/fetch/models/InlineResponse2005.ts b/lib/skyapi/fetch/models/InlineResponse2005.ts new file mode 100644 index 0000000..a2fb4d1 --- /dev/null +++ b/lib/skyapi/fetch/models/InlineResponse2005.ts @@ -0,0 +1,60 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface InlineResponse2005 + */ +export interface InlineResponse2005 { + /** + * git branch name + * @type {string} + * @memberof InlineResponse2005 + */ + branch?: string; + /** + * git commit id + * @type {string} + * @memberof InlineResponse2005 + */ + commit?: string; + /** + * version number + * @type {string} + * @memberof InlineResponse2005 + */ + version?: string; +} + +export function InlineResponse2005FromJSON(json: any): InlineResponse2005 { + return { + 'branch': !exists(json, 'branch') ? undefined : json['branch'], + 'commit': !exists(json, 'commit') ? undefined : json['commit'], + 'version': !exists(json, 'version') ? undefined : json['version'], + }; +} + +export function InlineResponse2005ToJSON(value?: InlineResponse2005): any { + if (value === undefined) { + return undefined; + } + return { + 'branch': value.branch, + 'commit': value.commit, + 'version': value.version, + }; +} + + diff --git a/lib/skyapi/fetch/models/InlineResponse2006.ts b/lib/skyapi/fetch/models/InlineResponse2006.ts new file mode 100644 index 0000000..a49a336 --- /dev/null +++ b/lib/skyapi/fetch/models/InlineResponse2006.ts @@ -0,0 +1,50 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + TransactionEncoded, + TransactionEncodedFromJSON, + TransactionEncodedToJSON, +} from './'; + +/** + * + * @export + * @interface InlineResponse2006 + */ +export interface InlineResponse2006 { + /** + * + * @type {Array} + * @memberof InlineResponse2006 + */ + transactions?: Array; +} + +export function InlineResponse2006FromJSON(json: any): InlineResponse2006 { + return { + 'transactions': !exists(json, 'transactions') ? undefined : (json['transactions'] as Array).map(TransactionEncodedFromJSON), + }; +} + +export function InlineResponse2006ToJSON(value?: InlineResponse2006): any { + if (value === undefined) { + return undefined; + } + return { + 'transactions': value.transactions === undefined ? undefined : (value.transactions as Array).map(TransactionEncodedToJSON), + }; +} + + diff --git a/lib/skyapi/fetch/models/InlineResponse2007.ts b/lib/skyapi/fetch/models/InlineResponse2007.ts new file mode 100644 index 0000000..d6cc026 --- /dev/null +++ b/lib/skyapi/fetch/models/InlineResponse2007.ts @@ -0,0 +1,44 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface InlineResponse2007 + */ +export interface InlineResponse2007 { + /** + * + * @type {string} + * @memberof InlineResponse2007 + */ + address?: string; +} + +export function InlineResponse2007FromJSON(json: any): InlineResponse2007 { + return { + 'address': !exists(json, 'address') ? undefined : json['address'], + }; +} + +export function InlineResponse2007ToJSON(value?: InlineResponse2007): any { + if (value === undefined) { + return undefined; + } + return { + 'address': value.address, + }; +} + + diff --git a/lib/skyapi/fetch/models/InlineResponse2008.ts b/lib/skyapi/fetch/models/InlineResponse2008.ts new file mode 100644 index 0000000..5525466 --- /dev/null +++ b/lib/skyapi/fetch/models/InlineResponse2008.ts @@ -0,0 +1,50 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + InlineResponse2008Data, + InlineResponse2008DataFromJSON, + InlineResponse2008DataToJSON, +} from './'; + +/** + * + * @export + * @interface InlineResponse2008 + */ +export interface InlineResponse2008 { + /** + * + * @type {InlineResponse2008Data} + * @memberof InlineResponse2008 + */ + data?: InlineResponse2008Data; +} + +export function InlineResponse2008FromJSON(json: any): InlineResponse2008 { + return { + 'data': !exists(json, 'data') ? undefined : InlineResponse2008DataFromJSON(json['data']), + }; +} + +export function InlineResponse2008ToJSON(value?: InlineResponse2008): any { + if (value === undefined) { + return undefined; + } + return { + 'data': InlineResponse2008DataToJSON(value.data), + }; +} + + diff --git a/lib/skyapi/fetch/models/InlineResponse2008Data.ts b/lib/skyapi/fetch/models/InlineResponse2008Data.ts new file mode 100644 index 0000000..9c1289e --- /dev/null +++ b/lib/skyapi/fetch/models/InlineResponse2008Data.ts @@ -0,0 +1,50 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + Transaction, + TransactionFromJSON, + TransactionToJSON, +} from './'; + +/** + * + * @export + * @interface InlineResponse2008Data + */ +export interface InlineResponse2008Data { + /** + * + * @type {Transaction} + * @memberof InlineResponse2008Data + */ + transaction?: Transaction; +} + +export function InlineResponse2008DataFromJSON(json: any): InlineResponse2008Data { + return { + 'transaction': !exists(json, 'transaction') ? undefined : TransactionFromJSON(json['transaction']), + }; +} + +export function InlineResponse2008DataToJSON(value?: InlineResponse2008Data): any { + if (value === undefined) { + return undefined; + } + return { + 'transaction': TransactionToJSON(value.transaction), + }; +} + + diff --git a/lib/skyapi/fetch/models/InlineResponse2009.ts b/lib/skyapi/fetch/models/InlineResponse2009.ts new file mode 100644 index 0000000..3cde51a --- /dev/null +++ b/lib/skyapi/fetch/models/InlineResponse2009.ts @@ -0,0 +1,44 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface InlineResponse2009 + */ +export interface InlineResponse2009 { + /** + * + * @type {object} + * @memberof InlineResponse2009 + */ + data?: object; +} + +export function InlineResponse2009FromJSON(json: any): InlineResponse2009 { + return { + 'data': !exists(json, 'data') ? undefined : json['data'], + }; +} + +export function InlineResponse2009ToJSON(value?: InlineResponse2009): any { + if (value === undefined) { + return undefined; + } + return { + 'data': value.data, + }; +} + + diff --git a/lib/skyapi/fetch/models/InlineResponseDefault.ts b/lib/skyapi/fetch/models/InlineResponseDefault.ts new file mode 100644 index 0000000..3860412 --- /dev/null +++ b/lib/skyapi/fetch/models/InlineResponseDefault.ts @@ -0,0 +1,52 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface InlineResponseDefault + */ +export interface InlineResponseDefault { + /** + * + * @type {number} + * @memberof InlineResponseDefault + */ + code?: number; + /** + * + * @type {string} + * @memberof InlineResponseDefault + */ + message?: string; +} + +export function InlineResponseDefaultFromJSON(json: any): InlineResponseDefault { + return { + 'code': !exists(json, 'code') ? undefined : json['code'], + 'message': !exists(json, 'message') ? undefined : json['message'], + }; +} + +export function InlineResponseDefaultToJSON(value?: InlineResponseDefault): any { + if (value === undefined) { + return undefined; + } + return { + 'code': value.code, + 'message': value.message, + }; +} + + diff --git a/lib/skyapi/fetch/models/NetworkConnectionSchema.ts b/lib/skyapi/fetch/models/NetworkConnectionSchema.ts new file mode 100644 index 0000000..0dae0c3 --- /dev/null +++ b/lib/skyapi/fetch/models/NetworkConnectionSchema.ts @@ -0,0 +1,156 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + NetworkConnectionSchemaUnconfirmedVerifyTransaction, + NetworkConnectionSchemaUnconfirmedVerifyTransactionFromJSON, + NetworkConnectionSchemaUnconfirmedVerifyTransactionToJSON, +} from './'; + +/** + * + * @export + * @interface NetworkConnectionSchema + */ +export interface NetworkConnectionSchema { + /** + * + * @type {string} + * @memberof NetworkConnectionSchema + */ + address?: string; + /** + * + * @type {number} + * @memberof NetworkConnectionSchema + */ + connectedAt?: number; + /** + * + * @type {number} + * @memberof NetworkConnectionSchema + */ + height?: number; + /** + * + * @type {number} + * @memberof NetworkConnectionSchema + */ + id?: number; + /** + * + * @type {boolean} + * @memberof NetworkConnectionSchema + */ + isTrustedPeer?: boolean; + /** + * + * @type {number} + * @memberof NetworkConnectionSchema + */ + lastReceived?: number; + /** + * + * @type {number} + * @memberof NetworkConnectionSchema + */ + lastSent?: number; + /** + * + * @type {number} + * @memberof NetworkConnectionSchema + */ + listenPort?: number; + /** + * + * @type {number} + * @memberof NetworkConnectionSchema + */ + mirror?: number; + /** + * + * @type {boolean} + * @memberof NetworkConnectionSchema + */ + outgoing?: boolean; + /** + * + * @type {string} + * @memberof NetworkConnectionSchema + */ + state?: NetworkConnectionSchemaStateEnum; + /** + * + * @type {NetworkConnectionSchemaUnconfirmedVerifyTransaction} + * @memberof NetworkConnectionSchema + */ + unconfirmedVerifyTransaction?: NetworkConnectionSchemaUnconfirmedVerifyTransaction; + /** + * + * @type {string} + * @memberof NetworkConnectionSchema + */ + userAgent?: string; +} + +export function NetworkConnectionSchemaFromJSON(json: any): NetworkConnectionSchema { + return { + 'address': !exists(json, 'address') ? undefined : json['address'], + 'connectedAt': !exists(json, 'connected_at') ? undefined : json['connected_at'], + 'height': !exists(json, 'height') ? undefined : json['height'], + 'id': !exists(json, 'id') ? undefined : json['id'], + 'isTrustedPeer': !exists(json, 'is_trusted_peer') ? undefined : json['is_trusted_peer'], + 'lastReceived': !exists(json, 'last_received') ? undefined : json['last_received'], + 'lastSent': !exists(json, 'last_sent') ? undefined : json['last_sent'], + 'listenPort': !exists(json, 'listen_port') ? undefined : json['listen_port'], + 'mirror': !exists(json, 'mirror') ? undefined : json['mirror'], + 'outgoing': !exists(json, 'outgoing') ? undefined : json['outgoing'], + 'state': !exists(json, 'state') ? undefined : json['state'], + 'unconfirmedVerifyTransaction': !exists(json, 'unconfirmed_verify_transaction') ? undefined : NetworkConnectionSchemaUnconfirmedVerifyTransactionFromJSON(json['unconfirmed_verify_transaction']), + 'userAgent': !exists(json, 'user_agent') ? undefined : json['user_agent'], + }; +} + +export function NetworkConnectionSchemaToJSON(value?: NetworkConnectionSchema): any { + if (value === undefined) { + return undefined; + } + return { + 'address': value.address, + 'connected_at': value.connectedAt, + 'height': value.height, + 'id': value.id, + 'is_trusted_peer': value.isTrustedPeer, + 'last_received': value.lastReceived, + 'last_sent': value.lastSent, + 'listen_port': value.listenPort, + 'mirror': value.mirror, + 'outgoing': value.outgoing, + 'state': value.state, + 'unconfirmed_verify_transaction': NetworkConnectionSchemaUnconfirmedVerifyTransactionToJSON(value.unconfirmedVerifyTransaction), + 'user_agent': value.userAgent, + }; +} + +/** +* @export +* @enum {string} +*/ +export enum NetworkConnectionSchemaStateEnum { + Pending = 'pending', + Connected = 'connected', + Introduced = 'introduced' +} + + diff --git a/lib/skyapi/fetch/models/NetworkConnectionSchemaUnconfirmedVerifyTransaction.ts b/lib/skyapi/fetch/models/NetworkConnectionSchemaUnconfirmedVerifyTransaction.ts new file mode 100644 index 0000000..bc1bc53 --- /dev/null +++ b/lib/skyapi/fetch/models/NetworkConnectionSchemaUnconfirmedVerifyTransaction.ts @@ -0,0 +1,60 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * Represent unconfirmed transactions + * @export + * @interface NetworkConnectionSchemaUnconfirmedVerifyTransaction + */ +export interface NetworkConnectionSchemaUnconfirmedVerifyTransaction { + /** + * + * @type {number} + * @memberof NetworkConnectionSchemaUnconfirmedVerifyTransaction + */ + burnFactor?: number; + /** + * + * @type {number} + * @memberof NetworkConnectionSchemaUnconfirmedVerifyTransaction + */ + maxDecimals?: number; + /** + * + * @type {number} + * @memberof NetworkConnectionSchemaUnconfirmedVerifyTransaction + */ + maxTransactionSize?: number; +} + +export function NetworkConnectionSchemaUnconfirmedVerifyTransactionFromJSON(json: any): NetworkConnectionSchemaUnconfirmedVerifyTransaction { + return { + 'burnFactor': !exists(json, 'burn_factor') ? undefined : json['burn_factor'], + 'maxDecimals': !exists(json, 'max_decimals') ? undefined : json['max_decimals'], + 'maxTransactionSize': !exists(json, 'max_transaction_size') ? undefined : json['max_transaction_size'], + }; +} + +export function NetworkConnectionSchemaUnconfirmedVerifyTransactionToJSON(value?: NetworkConnectionSchemaUnconfirmedVerifyTransaction): any { + if (value === undefined) { + return undefined; + } + return { + 'burn_factor': value.burnFactor, + 'max_decimals': value.maxDecimals, + 'max_transaction_size': value.maxTransactionSize, + }; +} + + diff --git a/lib/skyapi/fetch/models/Transaction.ts b/lib/skyapi/fetch/models/Transaction.ts new file mode 100644 index 0000000..14894f3 --- /dev/null +++ b/lib/skyapi/fetch/models/Transaction.ts @@ -0,0 +1,69 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + TransactionStatus, + TransactionStatusFromJSON, + TransactionStatusToJSON, + TransactionTxn, + TransactionTxnFromJSON, + TransactionTxnToJSON, +} from './'; + +/** + * + * @export + * @interface Transaction + */ +export interface Transaction { + /** + * + * @type {TransactionStatus} + * @memberof Transaction + */ + status?: TransactionStatus; + /** + * + * @type {TransactionTxn} + * @memberof Transaction + */ + txn?: TransactionTxn; + /** + * + * @type {number} + * @memberof Transaction + */ + time?: number; +} + +export function TransactionFromJSON(json: any): Transaction { + return { + 'status': !exists(json, 'status') ? undefined : TransactionStatusFromJSON(json['status']), + 'txn': !exists(json, 'txn') ? undefined : TransactionTxnFromJSON(json['txn']), + 'time': !exists(json, 'time') ? undefined : json['time'], + }; +} + +export function TransactionToJSON(value?: Transaction): any { + if (value === undefined) { + return undefined; + } + return { + 'status': TransactionStatusToJSON(value.status), + 'txn': TransactionTxnToJSON(value.txn), + 'time': value.time, + }; +} + + diff --git a/lib/skyapi/fetch/models/TransactionEncoded.ts b/lib/skyapi/fetch/models/TransactionEncoded.ts new file mode 100644 index 0000000..9685748 --- /dev/null +++ b/lib/skyapi/fetch/models/TransactionEncoded.ts @@ -0,0 +1,82 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + ApiV1PendingTxsTransaction, + ApiV1PendingTxsTransactionFromJSON, + ApiV1PendingTxsTransactionToJSON, +} from './'; + +/** + * + * @export + * @interface TransactionEncoded + */ +export interface TransactionEncoded { + /** + * + * @type {ApiV1PendingTxsTransaction} + * @memberof TransactionEncoded + */ + transaction?: ApiV1PendingTxsTransaction; + /** + * + * @type {string} + * @memberof TransactionEncoded + */ + received?: string; + /** + * + * @type {string} + * @memberof TransactionEncoded + */ + checked?: string; + /** + * + * @type {string} + * @memberof TransactionEncoded + */ + announced?: string; + /** + * + * @type {boolean} + * @memberof TransactionEncoded + */ + isValid?: boolean; +} + +export function TransactionEncodedFromJSON(json: any): TransactionEncoded { + return { + 'transaction': !exists(json, 'transaction') ? undefined : ApiV1PendingTxsTransactionFromJSON(json['transaction']), + 'received': !exists(json, 'received') ? undefined : json['received'], + 'checked': !exists(json, 'checked') ? undefined : json['checked'], + 'announced': !exists(json, 'announced') ? undefined : json['announced'], + 'isValid': !exists(json, 'is_valid') ? undefined : json['is_valid'], + }; +} + +export function TransactionEncodedToJSON(value?: TransactionEncoded): any { + if (value === undefined) { + return undefined; + } + return { + 'transaction': ApiV1PendingTxsTransactionToJSON(value.transaction), + 'received': value.received, + 'checked': value.checked, + 'announced': value.announced, + 'is_valid': value.isValid, + }; +} + + diff --git a/lib/skyapi/fetch/models/TransactionEncodedS.ts b/lib/skyapi/fetch/models/TransactionEncodedS.ts new file mode 100644 index 0000000..9429efe --- /dev/null +++ b/lib/skyapi/fetch/models/TransactionEncodedS.ts @@ -0,0 +1,66 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + TransactionStatus, + TransactionStatusFromJSON, + TransactionStatusToJSON, +} from './'; + +/** + * + * @export + * @interface TransactionEncodedS + */ +export interface TransactionEncodedS { + /** + * + * @type {number} + * @memberof TransactionEncodedS + */ + time?: number; + /** + * + * @type {TransactionStatus} + * @memberof TransactionEncodedS + */ + status?: TransactionStatus; + /** + * + * @type {string} + * @memberof TransactionEncodedS + */ + encodedTransaction?: string; +} + +export function TransactionEncodedSFromJSON(json: any): TransactionEncodedS { + return { + 'time': !exists(json, 'time') ? undefined : json['time'], + 'status': !exists(json, 'status') ? undefined : TransactionStatusFromJSON(json['status']), + 'encodedTransaction': !exists(json, 'encoded_transaction') ? undefined : json['encoded_transaction'], + }; +} + +export function TransactionEncodedSToJSON(value?: TransactionEncodedS): any { + if (value === undefined) { + return undefined; + } + return { + 'time': value.time, + 'status': TransactionStatusToJSON(value.status), + 'encoded_transaction': value.encodedTransaction, + }; +} + + diff --git a/lib/skyapi/fetch/models/TransactionStatus.ts b/lib/skyapi/fetch/models/TransactionStatus.ts new file mode 100644 index 0000000..13eba72 --- /dev/null +++ b/lib/skyapi/fetch/models/TransactionStatus.ts @@ -0,0 +1,68 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface TransactionStatus + */ +export interface TransactionStatus { + /** + * If confirmed, the sequence of the block in which the transaction was executed + * @type {number} + * @memberof TransactionStatus + */ + blockSeq?: number; + /** + * + * @type {boolean} + * @memberof TransactionStatus + */ + confirmed?: boolean; + /** + * If confirmed, how many blocks deep in the chain it is. Will be at least 1 if confirmed + * @type {number} + * @memberof TransactionStatus + */ + height?: number; + /** + * + * @type {boolean} + * @memberof TransactionStatus + */ + unconfirmed?: boolean; +} + +export function TransactionStatusFromJSON(json: any): TransactionStatus { + return { + 'blockSeq': !exists(json, 'block_seq') ? undefined : json['block_seq'], + 'confirmed': !exists(json, 'confirmed') ? undefined : json['confirmed'], + 'height': !exists(json, 'height') ? undefined : json['height'], + 'unconfirmed': !exists(json, 'unconfirmed') ? undefined : json['unconfirmed'], + }; +} + +export function TransactionStatusToJSON(value?: TransactionStatus): any { + if (value === undefined) { + return undefined; + } + return { + 'block_seq': value.blockSeq, + 'confirmed': value.confirmed, + 'height': value.height, + 'unconfirmed': value.unconfirmed, + }; +} + + diff --git a/lib/skyapi/fetch/models/TransactionTxn.ts b/lib/skyapi/fetch/models/TransactionTxn.ts new file mode 100644 index 0000000..d73ecda --- /dev/null +++ b/lib/skyapi/fetch/models/TransactionTxn.ts @@ -0,0 +1,100 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * TransactionVerbose has readable transaction data. It adds TransactionStatus to a BlockTransactionVerbose + * @export + * @interface TransactionTxn + */ +export interface TransactionTxn { + /** + * + * @type {string} + * @memberof TransactionTxn + */ + innerHash?: string; + /** + * + * @type {Array} + * @memberof TransactionTxn + */ + inputs?: Array; + /** + * + * @type {number} + * @memberof TransactionTxn + */ + length?: number; + /** + * + * @type {Array} + * @memberof TransactionTxn + */ + outputs?: Array; + /** + * + * @type {Array} + * @memberof TransactionTxn + */ + sigs?: Array; + /** + * + * @type {number} + * @memberof TransactionTxn + */ + timestamp?: number; + /** + * + * @type {string} + * @memberof TransactionTxn + */ + txid?: string; + /** + * + * @type {number} + * @memberof TransactionTxn + */ + type?: number; +} + +export function TransactionTxnFromJSON(json: any): TransactionTxn { + return { + 'innerHash': !exists(json, 'inner_hash') ? undefined : json['inner_hash'], + 'inputs': !exists(json, 'inputs') ? undefined : json['inputs'], + 'length': !exists(json, 'length') ? undefined : json['length'], + 'outputs': !exists(json, 'outputs') ? undefined : json['outputs'], + 'sigs': !exists(json, 'sigs') ? undefined : json['sigs'], + 'timestamp': !exists(json, 'timestamp') ? undefined : json['timestamp'], + 'txid': !exists(json, 'txid') ? undefined : json['txid'], + 'type': !exists(json, 'type') ? undefined : json['type'], + }; +} + +export function TransactionTxnToJSON(value?: TransactionTxn): any { + if (value === undefined) { + return undefined; + } + return { + 'inner_hash': value.innerHash, + 'inputs': value.inputs, + 'length': value.length, + 'outputs': value.outputs, + 'sigs': value.sigs, + 'timestamp': value.timestamp, + 'txid': value.txid, + 'type': value.type, + }; +} + + diff --git a/lib/skyapi/fetch/models/TransactionV2ParamsAddress.ts b/lib/skyapi/fetch/models/TransactionV2ParamsAddress.ts new file mode 100644 index 0000000..70d2ab6 --- /dev/null +++ b/lib/skyapi/fetch/models/TransactionV2ParamsAddress.ts @@ -0,0 +1,50 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + TransactionV2ParamsAddressHoursSelection, + TransactionV2ParamsAddressHoursSelectionFromJSON, + TransactionV2ParamsAddressHoursSelectionToJSON, +} from './'; + +/** + * + * @export + * @interface TransactionV2ParamsAddress + */ +export interface TransactionV2ParamsAddress { + /** + * + * @type {TransactionV2ParamsAddressHoursSelection} + * @memberof TransactionV2ParamsAddress + */ + hoursSelection?: TransactionV2ParamsAddressHoursSelection; +} + +export function TransactionV2ParamsAddressFromJSON(json: any): TransactionV2ParamsAddress { + return { + 'hoursSelection': !exists(json, 'hours_selection') ? undefined : TransactionV2ParamsAddressHoursSelectionFromJSON(json['hours_selection']), + }; +} + +export function TransactionV2ParamsAddressToJSON(value?: TransactionV2ParamsAddress): any { + if (value === undefined) { + return undefined; + } + return { + 'hours_selection': TransactionV2ParamsAddressHoursSelectionToJSON(value.hoursSelection), + }; +} + + diff --git a/lib/skyapi/fetch/models/TransactionV2ParamsAddressHoursSelection.ts b/lib/skyapi/fetch/models/TransactionV2ParamsAddressHoursSelection.ts new file mode 100644 index 0000000..30e8268 --- /dev/null +++ b/lib/skyapi/fetch/models/TransactionV2ParamsAddressHoursSelection.ts @@ -0,0 +1,44 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface TransactionV2ParamsAddressHoursSelection + */ +export interface TransactionV2ParamsAddressHoursSelection { + /** + * + * @type {string} + * @memberof TransactionV2ParamsAddressHoursSelection + */ + type?: string; +} + +export function TransactionV2ParamsAddressHoursSelectionFromJSON(json: any): TransactionV2ParamsAddressHoursSelection { + return { + 'type': !exists(json, 'type') ? undefined : json['type'], + }; +} + +export function TransactionV2ParamsAddressHoursSelectionToJSON(value?: TransactionV2ParamsAddressHoursSelection): any { + if (value === undefined) { + return undefined; + } + return { + 'type': value.type, + }; +} + + diff --git a/lib/skyapi/fetch/models/TransactionV2ParamsUnspent.ts b/lib/skyapi/fetch/models/TransactionV2ParamsUnspent.ts new file mode 100644 index 0000000..9502598 --- /dev/null +++ b/lib/skyapi/fetch/models/TransactionV2ParamsUnspent.ts @@ -0,0 +1,77 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + TransactionV2ParamsUnspentHoursSelection, + TransactionV2ParamsUnspentHoursSelectionFromJSON, + TransactionV2ParamsUnspentHoursSelectionToJSON, + TransactionV2ParamsUnspentTo, + TransactionV2ParamsUnspentToFromJSON, + TransactionV2ParamsUnspentToToJSON, +} from './'; + +/** + * + * @export + * @interface TransactionV2ParamsUnspent + */ +export interface TransactionV2ParamsUnspent { + /** + * + * @type {TransactionV2ParamsUnspentHoursSelection} + * @memberof TransactionV2ParamsUnspent + */ + hoursSelection?: TransactionV2ParamsUnspentHoursSelection; + /** + * + * @type {Array} + * @memberof TransactionV2ParamsUnspent + */ + unspents?: Array; + /** + * + * @type {string} + * @memberof TransactionV2ParamsUnspent + */ + changeAddress?: string; + /** + * + * @type {Array} + * @memberof TransactionV2ParamsUnspent + */ + to?: Array; +} + +export function TransactionV2ParamsUnspentFromJSON(json: any): TransactionV2ParamsUnspent { + return { + 'hoursSelection': !exists(json, 'hours_selection') ? undefined : TransactionV2ParamsUnspentHoursSelectionFromJSON(json['hours_selection']), + 'unspents': !exists(json, 'unspents') ? undefined : json['unspents'], + 'changeAddress': !exists(json, 'change_address') ? undefined : json['change_address'], + 'to': !exists(json, 'to') ? undefined : (json['to'] as Array).map(TransactionV2ParamsUnspentToFromJSON), + }; +} + +export function TransactionV2ParamsUnspentToJSON(value?: TransactionV2ParamsUnspent): any { + if (value === undefined) { + return undefined; + } + return { + 'hours_selection': TransactionV2ParamsUnspentHoursSelectionToJSON(value.hoursSelection), + 'unspents': value.unspents, + 'change_address': value.changeAddress, + 'to': value.to === undefined ? undefined : (value.to as Array).map(TransactionV2ParamsUnspentToToJSON), + }; +} + + diff --git a/lib/skyapi/fetch/models/TransactionV2ParamsUnspentHoursSelection.ts b/lib/skyapi/fetch/models/TransactionV2ParamsUnspentHoursSelection.ts new file mode 100644 index 0000000..b614756 --- /dev/null +++ b/lib/skyapi/fetch/models/TransactionV2ParamsUnspentHoursSelection.ts @@ -0,0 +1,60 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface TransactionV2ParamsUnspentHoursSelection + */ +export interface TransactionV2ParamsUnspentHoursSelection { + /** + * + * @type {string} + * @memberof TransactionV2ParamsUnspentHoursSelection + */ + type?: string; + /** + * + * @type {string} + * @memberof TransactionV2ParamsUnspentHoursSelection + */ + mode?: string; + /** + * + * @type {string} + * @memberof TransactionV2ParamsUnspentHoursSelection + */ + shareFactor?: string; +} + +export function TransactionV2ParamsUnspentHoursSelectionFromJSON(json: any): TransactionV2ParamsUnspentHoursSelection { + return { + 'type': !exists(json, 'type') ? undefined : json['type'], + 'mode': !exists(json, 'mode') ? undefined : json['mode'], + 'shareFactor': !exists(json, 'share_factor') ? undefined : json['share_factor'], + }; +} + +export function TransactionV2ParamsUnspentHoursSelectionToJSON(value?: TransactionV2ParamsUnspentHoursSelection): any { + if (value === undefined) { + return undefined; + } + return { + 'type': value.type, + 'mode': value.mode, + 'share_factor': value.shareFactor, + }; +} + + diff --git a/lib/skyapi/fetch/models/TransactionV2ParamsUnspentTo.ts b/lib/skyapi/fetch/models/TransactionV2ParamsUnspentTo.ts new file mode 100644 index 0000000..a651e0d --- /dev/null +++ b/lib/skyapi/fetch/models/TransactionV2ParamsUnspentTo.ts @@ -0,0 +1,52 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface TransactionV2ParamsUnspentTo + */ +export interface TransactionV2ParamsUnspentTo { + /** + * + * @type {string} + * @memberof TransactionV2ParamsUnspentTo + */ + address?: string; + /** + * + * @type {string} + * @memberof TransactionV2ParamsUnspentTo + */ + coins?: string; +} + +export function TransactionV2ParamsUnspentToFromJSON(json: any): TransactionV2ParamsUnspentTo { + return { + 'address': !exists(json, 'address') ? undefined : json['address'], + 'coins': !exists(json, 'coins') ? undefined : json['coins'], + }; +} + +export function TransactionV2ParamsUnspentToToJSON(value?: TransactionV2ParamsUnspentTo): any { + if (value === undefined) { + return undefined; + } + return { + 'address': value.address, + 'coins': value.coins, + }; +} + + diff --git a/lib/skyapi/fetch/models/TransactionVerbose.ts b/lib/skyapi/fetch/models/TransactionVerbose.ts new file mode 100644 index 0000000..15e5754 --- /dev/null +++ b/lib/skyapi/fetch/models/TransactionVerbose.ts @@ -0,0 +1,69 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + TransactionStatus, + TransactionStatusFromJSON, + TransactionStatusToJSON, + TransactionVerboseTxn, + TransactionVerboseTxnFromJSON, + TransactionVerboseTxnToJSON, +} from './'; + +/** + * + * @export + * @interface TransactionVerbose + */ +export interface TransactionVerbose { + /** + * + * @type {number} + * @memberof TransactionVerbose + */ + time?: number; + /** + * + * @type {TransactionStatus} + * @memberof TransactionVerbose + */ + status?: TransactionStatus; + /** + * + * @type {TransactionVerboseTxn} + * @memberof TransactionVerbose + */ + txn?: TransactionVerboseTxn; +} + +export function TransactionVerboseFromJSON(json: any): TransactionVerbose { + return { + 'time': !exists(json, 'time') ? undefined : json['time'], + 'status': !exists(json, 'status') ? undefined : TransactionStatusFromJSON(json['status']), + 'txn': !exists(json, 'txn') ? undefined : TransactionVerboseTxnFromJSON(json['txn']), + }; +} + +export function TransactionVerboseToJSON(value?: TransactionVerbose): any { + if (value === undefined) { + return undefined; + } + return { + 'time': value.time, + 'status': TransactionStatusToJSON(value.status), + 'txn': TransactionVerboseTxnToJSON(value.txn), + }; +} + + diff --git a/lib/skyapi/fetch/models/TransactionVerboseTxn.ts b/lib/skyapi/fetch/models/TransactionVerboseTxn.ts new file mode 100644 index 0000000..0d31c27 --- /dev/null +++ b/lib/skyapi/fetch/models/TransactionVerboseTxn.ts @@ -0,0 +1,125 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + TransactionStatus, + TransactionStatusFromJSON, + TransactionStatusToJSON, + TransactionVerboseTxnInputs, + TransactionVerboseTxnInputsFromJSON, + TransactionVerboseTxnInputsToJSON, +} from './'; + +/** + * TransactionVerbose has readable transaction data. It adds TransactionStatus to a BlockTransactionVerbose + * @export + * @interface TransactionVerboseTxn + */ +export interface TransactionVerboseTxn { + /** + * + * @type {TransactionStatus} + * @memberof TransactionVerboseTxn + */ + status?: TransactionStatus; + /** + * + * @type {number} + * @memberof TransactionVerboseTxn + */ + fee?: number; + /** + * + * @type {string} + * @memberof TransactionVerboseTxn + */ + innerHash?: string; + /** + * + * @type {Array} + * @memberof TransactionVerboseTxn + */ + inputs?: Array; + /** + * + * @type {number} + * @memberof TransactionVerboseTxn + */ + length?: number; + /** + * + * @type {Array} + * @memberof TransactionVerboseTxn + */ + outputs?: Array; + /** + * + * @type {Array} + * @memberof TransactionVerboseTxn + */ + sigs?: Array; + /** + * + * @type {number} + * @memberof TransactionVerboseTxn + */ + timestamp?: number; + /** + * + * @type {string} + * @memberof TransactionVerboseTxn + */ + txid?: string; + /** + * + * @type {number} + * @memberof TransactionVerboseTxn + */ + type?: number; +} + +export function TransactionVerboseTxnFromJSON(json: any): TransactionVerboseTxn { + return { + 'status': !exists(json, 'status') ? undefined : TransactionStatusFromJSON(json['status']), + 'fee': !exists(json, 'fee') ? undefined : json['fee'], + 'innerHash': !exists(json, 'inner_hash') ? undefined : json['inner_hash'], + 'inputs': !exists(json, 'inputs') ? undefined : (json['inputs'] as Array).map(TransactionVerboseTxnInputsFromJSON), + 'length': !exists(json, 'length') ? undefined : json['length'], + 'outputs': !exists(json, 'outputs') ? undefined : json['outputs'], + 'sigs': !exists(json, 'sigs') ? undefined : json['sigs'], + 'timestamp': !exists(json, 'timestamp') ? undefined : json['timestamp'], + 'txid': !exists(json, 'txid') ? undefined : json['txid'], + 'type': !exists(json, 'type') ? undefined : json['type'], + }; +} + +export function TransactionVerboseTxnToJSON(value?: TransactionVerboseTxn): any { + if (value === undefined) { + return undefined; + } + return { + 'status': TransactionStatusToJSON(value.status), + 'fee': value.fee, + 'inner_hash': value.innerHash, + 'inputs': value.inputs === undefined ? undefined : (value.inputs as Array).map(TransactionVerboseTxnInputsToJSON), + 'length': value.length, + 'outputs': value.outputs, + 'sigs': value.sigs, + 'timestamp': value.timestamp, + 'txid': value.txid, + 'type': value.type, + }; +} + + diff --git a/lib/skyapi/fetch/models/TransactionVerboseTxnInputs.ts b/lib/skyapi/fetch/models/TransactionVerboseTxnInputs.ts new file mode 100644 index 0000000..d9f406d --- /dev/null +++ b/lib/skyapi/fetch/models/TransactionVerboseTxnInputs.ts @@ -0,0 +1,76 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface TransactionVerboseTxnInputs + */ +export interface TransactionVerboseTxnInputs { + /** + * + * @type {string} + * @memberof TransactionVerboseTxnInputs + */ + uxid?: string; + /** + * + * @type {string} + * @memberof TransactionVerboseTxnInputs + */ + owner?: string; + /** + * + * @type {string} + * @memberof TransactionVerboseTxnInputs + */ + coins?: string; + /** + * + * @type {number} + * @memberof TransactionVerboseTxnInputs + */ + hours?: number; + /** + * + * @type {number} + * @memberof TransactionVerboseTxnInputs + */ + calculatedHours?: number; +} + +export function TransactionVerboseTxnInputsFromJSON(json: any): TransactionVerboseTxnInputs { + return { + 'uxid': !exists(json, 'uxid') ? undefined : json['uxid'], + 'owner': !exists(json, 'owner') ? undefined : json['owner'], + 'coins': !exists(json, 'coins') ? undefined : json['coins'], + 'hours': !exists(json, 'hours') ? undefined : json['hours'], + 'calculatedHours': !exists(json, 'calculated_hours') ? undefined : json['calculated_hours'], + }; +} + +export function TransactionVerboseTxnInputsToJSON(value?: TransactionVerboseTxnInputs): any { + if (value === undefined) { + return undefined; + } + return { + 'uxid': value.uxid, + 'owner': value.owner, + 'coins': value.coins, + 'hours': value.hours, + 'calculated_hours': value.calculatedHours, + }; +} + + diff --git a/lib/skyapi/fetch/models/TransactionVerifyRequest.ts b/lib/skyapi/fetch/models/TransactionVerifyRequest.ts new file mode 100644 index 0000000..899efc4 --- /dev/null +++ b/lib/skyapi/fetch/models/TransactionVerifyRequest.ts @@ -0,0 +1,52 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface TransactionVerifyRequest + */ +export interface TransactionVerifyRequest { + /** + * + * @type {boolean} + * @memberof TransactionVerifyRequest + */ + unsigned?: boolean; + /** + * + * @type {string} + * @memberof TransactionVerifyRequest + */ + encodedTransaction?: string; +} + +export function TransactionVerifyRequestFromJSON(json: any): TransactionVerifyRequest { + return { + 'unsigned': !exists(json, 'unsigned') ? undefined : json['unsigned'], + 'encodedTransaction': !exists(json, 'encoded_transaction') ? undefined : json['encoded_transaction'], + }; +} + +export function TransactionVerifyRequestToJSON(value?: TransactionVerifyRequest): any { + if (value === undefined) { + return undefined; + } + return { + 'unsigned': value.unsigned, + 'encoded_transaction': value.encodedTransaction, + }; +} + + diff --git a/lib/skyapi/fetch/models/WalletTransactionRequest.ts b/lib/skyapi/fetch/models/WalletTransactionRequest.ts new file mode 100644 index 0000000..ea8e80e --- /dev/null +++ b/lib/skyapi/fetch/models/WalletTransactionRequest.ts @@ -0,0 +1,85 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +import { + WalletTransactionRequestHoursSelection, + WalletTransactionRequestHoursSelectionFromJSON, + WalletTransactionRequestHoursSelectionToJSON, + WalletTransactionRequestWallet, + WalletTransactionRequestWalletFromJSON, + WalletTransactionRequestWalletToJSON, +} from './'; + +/** + * + * @export + * @interface WalletTransactionRequest + */ +export interface WalletTransactionRequest { + /** + * + * @type {string} + * @memberof WalletTransactionRequest + */ + changeAddress?: string; + /** + * + * @type {WalletTransactionRequestHoursSelection} + * @memberof WalletTransactionRequest + */ + hoursSelection?: WalletTransactionRequestHoursSelection; + /** + * + * @type {boolean} + * @memberof WalletTransactionRequest + */ + ignoreUnconfirmed?: boolean; + /** + * + * @type {Array} + * @memberof WalletTransactionRequest + */ + to?: Array; + /** + * + * @type {WalletTransactionRequestWallet} + * @memberof WalletTransactionRequest + */ + wallet?: WalletTransactionRequestWallet; +} + +export function WalletTransactionRequestFromJSON(json: any): WalletTransactionRequest { + return { + 'changeAddress': !exists(json, 'change_address') ? undefined : json['change_address'], + 'hoursSelection': !exists(json, 'hours_selection') ? undefined : WalletTransactionRequestHoursSelectionFromJSON(json['hours_selection']), + 'ignoreUnconfirmed': !exists(json, 'ignore_unconfirmed') ? undefined : json['ignore_unconfirmed'], + 'to': !exists(json, 'to') ? undefined : json['to'], + 'wallet': !exists(json, 'wallet') ? undefined : WalletTransactionRequestWalletFromJSON(json['wallet']), + }; +} + +export function WalletTransactionRequestToJSON(value?: WalletTransactionRequest): any { + if (value === undefined) { + return undefined; + } + return { + 'change_address': value.changeAddress, + 'hours_selection': WalletTransactionRequestHoursSelectionToJSON(value.hoursSelection), + 'ignore_unconfirmed': value.ignoreUnconfirmed, + 'to': value.to, + 'wallet': WalletTransactionRequestWalletToJSON(value.wallet), + }; +} + + diff --git a/lib/skyapi/fetch/models/WalletTransactionRequestHoursSelection.ts b/lib/skyapi/fetch/models/WalletTransactionRequestHoursSelection.ts new file mode 100644 index 0000000..7a1bd14 --- /dev/null +++ b/lib/skyapi/fetch/models/WalletTransactionRequestHoursSelection.ts @@ -0,0 +1,60 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface WalletTransactionRequestHoursSelection + */ +export interface WalletTransactionRequestHoursSelection { + /** + * + * @type {string} + * @memberof WalletTransactionRequestHoursSelection + */ + mode?: string; + /** + * + * @type {string} + * @memberof WalletTransactionRequestHoursSelection + */ + shareFactor?: string; + /** + * + * @type {string} + * @memberof WalletTransactionRequestHoursSelection + */ + type?: string; +} + +export function WalletTransactionRequestHoursSelectionFromJSON(json: any): WalletTransactionRequestHoursSelection { + return { + 'mode': !exists(json, 'mode') ? undefined : json['mode'], + 'shareFactor': !exists(json, 'share_factor') ? undefined : json['share_factor'], + 'type': !exists(json, 'type') ? undefined : json['type'], + }; +} + +export function WalletTransactionRequestHoursSelectionToJSON(value?: WalletTransactionRequestHoursSelection): any { + if (value === undefined) { + return undefined; + } + return { + 'mode': value.mode, + 'share_factor': value.shareFactor, + 'type': value.type, + }; +} + + diff --git a/lib/skyapi/fetch/models/WalletTransactionRequestWallet.ts b/lib/skyapi/fetch/models/WalletTransactionRequestWallet.ts new file mode 100644 index 0000000..34cf3dd --- /dev/null +++ b/lib/skyapi/fetch/models/WalletTransactionRequestWallet.ts @@ -0,0 +1,68 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface WalletTransactionRequestWallet + */ +export interface WalletTransactionRequestWallet { + /** + * + * @type {Array} + * @memberof WalletTransactionRequestWallet + */ + addresses?: Array; + /** + * + * @type {string} + * @memberof WalletTransactionRequestWallet + */ + id?: string; + /** + * + * @type {string} + * @memberof WalletTransactionRequestWallet + */ + password?: string; + /** + * + * @type {Array} + * @memberof WalletTransactionRequestWallet + */ + unspents?: Array; +} + +export function WalletTransactionRequestWalletFromJSON(json: any): WalletTransactionRequestWallet { + return { + 'addresses': !exists(json, 'addresses') ? undefined : json['addresses'], + 'id': !exists(json, 'id') ? undefined : json['id'], + 'password': !exists(json, 'password') ? undefined : json['password'], + 'unspents': !exists(json, 'unspents') ? undefined : json['unspents'], + }; +} + +export function WalletTransactionRequestWalletToJSON(value?: WalletTransactionRequestWallet): any { + if (value === undefined) { + return undefined; + } + return { + 'addresses': value.addresses, + 'id': value.id, + 'password': value.password, + 'unspents': value.unspents, + }; +} + + diff --git a/lib/skyapi/fetch/models/WalletTransactionSignRequest.ts b/lib/skyapi/fetch/models/WalletTransactionSignRequest.ts new file mode 100644 index 0000000..62ee6e0 --- /dev/null +++ b/lib/skyapi/fetch/models/WalletTransactionSignRequest.ts @@ -0,0 +1,68 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface WalletTransactionSignRequest + */ +export interface WalletTransactionSignRequest { + /** + * + * @type {string} + * @memberof WalletTransactionSignRequest + */ + walletId?: string; + /** + * + * @type {string} + * @memberof WalletTransactionSignRequest + */ + password?: string; + /** + * + * @type {string} + * @memberof WalletTransactionSignRequest + */ + encodedTransaction?: string; + /** + * + * @type {Array} + * @memberof WalletTransactionSignRequest + */ + signIndexes?: Array; +} + +export function WalletTransactionSignRequestFromJSON(json: any): WalletTransactionSignRequest { + return { + 'walletId': !exists(json, 'wallet_id') ? undefined : json['wallet_id'], + 'password': !exists(json, 'password') ? undefined : json['password'], + 'encodedTransaction': !exists(json, 'encoded_transaction') ? undefined : json['encoded_transaction'], + 'signIndexes': !exists(json, 'sign_indexes') ? undefined : json['sign_indexes'], + }; +} + +export function WalletTransactionSignRequestToJSON(value?: WalletTransactionSignRequest): any { + if (value === undefined) { + return undefined; + } + return { + 'wallet_id': value.walletId, + 'password': value.password, + 'encoded_transaction': value.encodedTransaction, + 'sign_indexes': value.signIndexes, + }; +} + + diff --git a/lib/skyapi/fetch/models/index.ts b/lib/skyapi/fetch/models/index.ts new file mode 100644 index 0000000..006aba9 --- /dev/null +++ b/lib/skyapi/fetch/models/index.ts @@ -0,0 +1,41 @@ +export * from './Address'; +export * from './ApiV1PendingTxsTransaction'; +export * from './ApiV1PendingTxsTransactionOutputs'; +export * from './BlockSchema'; +export * from './BlockSchemaBody'; +export * from './BlockVerboseSchema'; +export * from './BlockVerboseSchemaBody'; +export * from './BlockVerboseSchemaHeader'; +export * from './InlineResponse200'; +export * from './InlineResponse2001'; +export * from './InlineResponse20010'; +export * from './InlineResponse2002'; +export * from './InlineResponse2003'; +export * from './InlineResponse2004'; +export * from './InlineResponse2005'; +export * from './InlineResponse2006'; +export * from './InlineResponse2007'; +export * from './InlineResponse2008'; +export * from './InlineResponse2008Data'; +export * from './InlineResponse2009'; +export * from './InlineResponseDefault'; +export * from './NetworkConnectionSchema'; +export * from './NetworkConnectionSchemaUnconfirmedVerifyTransaction'; +export * from './Transaction'; +export * from './TransactionEncoded'; +export * from './TransactionEncodedS'; +export * from './TransactionStatus'; +export * from './TransactionTxn'; +export * from './TransactionV2ParamsAddress'; +export * from './TransactionV2ParamsAddressHoursSelection'; +export * from './TransactionV2ParamsUnspent'; +export * from './TransactionV2ParamsUnspentHoursSelection'; +export * from './TransactionV2ParamsUnspentTo'; +export * from './TransactionVerbose'; +export * from './TransactionVerboseTxn'; +export * from './TransactionVerboseTxnInputs'; +export * from './TransactionVerifyRequest'; +export * from './WalletTransactionRequest'; +export * from './WalletTransactionRequestHoursSelection'; +export * from './WalletTransactionRequestWallet'; +export * from './WalletTransactionSignRequest'; diff --git a/lib/skyapi/fetch/package.json b/lib/skyapi/fetch/package.json new file mode 100644 index 0000000..75207e0 --- /dev/null +++ b/lib/skyapi/fetch/package.json @@ -0,0 +1,15 @@ +{ + "name": "@simelo/skyapi-fetch", + "version": "0.27.0", + "description": "OpenAPI client for skyapi-fetch", + "author": "Maykel Arias Torres", + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "scripts" : { + "build": "tsc --outDir dist/", + "prepare": "npm run build" + }, + "devDependencies": { + "typescript": "^2.4" + }, +} diff --git a/lib/skyapi/fetch/runtime.ts b/lib/skyapi/fetch/runtime.ts new file mode 100644 index 0000000..e62e75a --- /dev/null +++ b/lib/skyapi/fetch/runtime.ts @@ -0,0 +1,284 @@ +// tslint:disable +/** + * Skycoin REST API. + * Skycoin is a next-generation cryptocurrency. + * + * The version of the OpenAPI document: 0.27.0 + * Contact: contact@skycoin.net + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export const BASE_PATH = "http://127.0.0.1:6420".replace(/\/+$/, ""); + +const isBlob = (value: any) => typeof Blob !== 'undefined' && value instanceof Blob; + +/** + * This is the base class for all generated API classes. + */ +export class BaseAPI { + + private middleware: Middleware[]; + + constructor(protected configuration = new Configuration()) { + this.middleware = configuration.middleware; + } + + withMiddleware(this: T, ...middlewares: Middleware[]) { + const next = this.clone(); + next.middleware = next.middleware.concat(...middlewares); + return next; + } + + withPreMiddleware(this: T, ...preMiddlewares: Array) { + const middlewares = preMiddlewares.map((pre) => ({ pre })); + return this.withMiddleware(...middlewares); + } + + withPostMiddleware(this: T, ...postMiddlewares: Array) { + const middlewares = postMiddlewares.map((post) => ({ post })); + return this.withMiddleware(...middlewares); + } + + protected async request(context: RequestOpts): Promise { + const { url, init } = this.createFetchParams(context); + const response = await this.fetchApi(url, init); + if (response.status >= 200 && response.status < 300) { + return response; + } + throw response; + } + + private createFetchParams(context: RequestOpts) { + let url = this.configuration.basePath + context.path; + if (context.query !== undefined && Object.keys(context.query).length !== 0) { + // only add the querystring to the URL if there are query parameters. + // this is done to avoid urls ending with a "?" character which buggy webservers + // do not handle correctly sometimes. + url += '?' + querystring(context.query); + } + const body = (context.body instanceof FormData || isBlob(context.body)) + ? context.body + : JSON.stringify(context.body); + const init = { + method: context.method, + headers: context.headers, + body, + }; + return { url, init }; + } + + private fetchApi = async (url: string, init: RequestInit) => { + let fetchParams = { url, init }; + for (const middleware of this.middleware) { + if (middleware.pre) { + fetchParams = await middleware.pre({ + fetch: this.fetchApi, + ...fetchParams, + }) || fetchParams; + } + } + let response = await this.configuration.fetchApi(fetchParams.url, fetchParams.init); + for (const middleware of this.middleware) { + if (middleware.post) { + response = await middleware.post({ + fetch: this.fetchApi, + url, + init, + response: response.clone(), + }) || response; + } + } + return response; + } + + /** + * Create a shallow clone of `this` by constructing a new instance + * and then shallow cloning data members. + */ + private clone(this: T): T { + const constructor = this.constructor as any; + const next = new constructor(this.configuration); + next.middleware = this.middleware.slice(); + return next; + } +}; + +export class RequiredError extends Error { + name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +export type FetchAPI = GlobalFetch['fetch']; + +export interface ConfigurationParameters { + basePath?: string; // override base path + fetchApi?: FetchAPI; // override for fetch implementation + middleware?: Middleware[]; // middleware to apply before/after fetch requests + username?: string; // parameter for basic security + password?: string; // parameter for basic security + apiKey?: string | ((name: string) => string); // parameter for apiKey security + accessToken?: string | ((name: string, scopes?: string[]) => string); // parameter for oauth2 security +} + +export class Configuration { + constructor(private configuration: ConfigurationParameters = {}) {} + + get basePath(): string { + return this.configuration.basePath || BASE_PATH; + } + + get fetchApi(): FetchAPI { + return this.configuration.fetchApi || window.fetch.bind(window); + } + + get middleware(): Middleware[] { + return this.configuration.middleware || []; + } + + get username(): string | undefined { + return this.configuration.username; + } + + get password(): string | undefined { + return this.configuration.password; + } + + get apiKey(): ((name: string) => string) | undefined { + const apiKey = this.configuration.apiKey; + if (apiKey) { + return typeof apiKey === 'function' ? apiKey : () => apiKey; + } + return undefined; + } + + get accessToken(): ((name: string, scopes?: string[]) => string) | undefined { + const accessToken = this.configuration.accessToken; + if (accessToken) { + return typeof accessToken === 'function' ? accessToken : () => accessToken; + } + return undefined; + } +} + +export type Json = any; +export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS'; +export type HTTPHeaders = { [key: string]: string }; +export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | HTTPQuery }; +export type HTTPBody = Json | FormData; +export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; + +export interface FetchParams { + url: string; + init: RequestInit; +} + +export interface RequestOpts { + path: string; + method: HTTPMethod; + headers: HTTPHeaders; + query?: HTTPQuery; + body?: HTTPBody; +} + +export function exists(json: any, key: string) { + const value = json[key]; + return value !== null && value !== undefined; +} + +export function querystring(params: HTTPQuery, prefix: string = ''): string { + return Object.keys(params) + .map((key) => { + const fullKey = prefix + (prefix.length ? `[${key}]` : key); + const value = params[key]; + if (value instanceof Array) { + const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue))) + .join(`&${encodeURIComponent(fullKey)}=`); + return `${encodeURIComponent(fullKey)}=${multiValue}`; + } + if (value instanceof Object) { + return querystring(value as HTTPQuery, fullKey); + } + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; + }) + .filter(part => part.length > 0) + .join('&'); +} + +export function mapValues(data: any, fn: (item: any) => any) { + return Object.keys(data).reduce( + (acc, key) => ({ ...acc, [key]: fn(data[key]) }), + {} + ); +} + +export interface RequestContext { + fetch: FetchAPI; + url: string; + init: RequestInit; +} + +export interface ResponseContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + response: Response; +} + +export interface Middleware { + pre?(context: RequestContext): Promise; + post?(context: ResponseContext): Promise; +} + +export interface ApiResponse { + raw: Response; + value(): Promise; +} + +export interface ResponseTransformer { + (json: any): T; +} + +export class JSONApiResponse { + constructor(public raw: Response, private transformer: ResponseTransformer = (jsonValue: any) => jsonValue) {} + + async value() { + return this.transformer(await this.raw.json()); + } +} + +export class VoidApiResponse { + constructor(public raw: Response) {} + + async value() { + return undefined; + } +} + +export class BlobApiResponse { + constructor(public raw: Response) {} + + async value() { + return await this.raw.blob(); + }; +} + +export class TextApiResponse { + constructor(public raw: Response) {} + + async value() { + return await this.raw.text(); + }; +} diff --git a/lib/skyapi/fetch/tsconfig.json b/lib/skyapi/fetch/tsconfig.json new file mode 100644 index 0000000..6cc0287 --- /dev/null +++ b/lib/skyapi/fetch/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "declaration": true, + "target": "es6", + "module": "commonjs", + "moduleResolution": "node", + "outDir": "dist", + "rootDir": ".", + "typeRoots": [ + "node_modules/@types" + ] + }, + "exclude": [ + "dist", + "node_modules" + ] +} diff --git a/tests/fetch/package-lock.json b/tests/fetch/package-lock.json new file mode 100644 index 0000000..83506fd --- /dev/null +++ b/tests/fetch/package-lock.json @@ -0,0 +1,1028 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "ansi-colors": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", + "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "dev": true + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "chai": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", + "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", + "dev": true, + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "pathval": "^1.1.0", + "type-detect": "^4.0.5" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "dev": true + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "requires": { + "type-detect": "^4.0.0" + } + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "es-abstract": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", + "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.0", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "is-callable": "^1.1.4", + "is-regex": "^1.0.4", + "object-keys": "^1.0.12" + } + }, + "es-to-primitive": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", + "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "flat": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", + "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", + "dev": true, + "requires": { + "is-buffer": "~2.0.3" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "dev": true + }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "invert-kv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "dev": true + }, + "is-buffer": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", + "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==", + "dev": true + }, + "is-callable": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "dev": true + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "^1.0.1" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-symbol": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", + "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.0" + } + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "lcid": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "dev": true, + "requires": { + "invert-kv": "^2.0.0" + } + }, + "libsky-axios": { + "version": "file:../../lib/skyapi/axios", + "dev": true, + "requires": { + "axios": "^0.18.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "log-symbols": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "dev": true, + "requires": { + "chalk": "^2.0.1" + } + }, + "map-age-cleaner": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", + "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", + "dev": true, + "requires": { + "p-defer": "^1.0.0" + } + }, + "mem": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", + "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", + "dev": true, + "requires": { + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^2.0.0", + "p-is-promise": "^2.0.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "mocha": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.0.tgz", + "integrity": "sha512-qwfFgY+7EKAAUAdv7VYMZQknI7YJSGesxHyhn6qD52DV8UcSZs5XwCifcZGMVIE4a5fbmhvbotxC0DLQ0oKohQ==", + "dev": true, + "requires": { + "ansi-colors": "3.2.3", + "browser-stdout": "1.3.1", + "debug": "3.2.6", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "find-up": "3.0.0", + "glob": "7.1.3", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "3.13.1", + "log-symbols": "2.2.0", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "ms": "2.1.1", + "node-environment-flags": "1.0.5", + "object.assign": "4.1.0", + "strip-json-comments": "2.0.1", + "supports-color": "6.0.0", + "which": "1.3.1", + "wide-align": "1.1.3", + "yargs": "13.2.2", + "yargs-parser": "13.0.0", + "yargs-unparser": "1.5.0" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node-environment-flags": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz", + "integrity": "sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==", + "dev": true, + "requires": { + "object.getownpropertydescriptors": "^2.0.3", + "semver": "^5.7.0" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, + "object.getownpropertydescriptors": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", + "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.5.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "os-locale": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "dev": true, + "requires": { + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" + } + }, + "p-defer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", + "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", + "dev": true + }, + "p-limit": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "pathval": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", + "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", + "dev": true + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "supports-color": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", + "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, + "yargs": { + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.2.tgz", + "integrity": "sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "os-locale": "^3.1.0", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "yargs-parser": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz", + "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + }, + "yargs-unparser": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.5.0.tgz", + "integrity": "sha512-HK25qidFTCVuj/D1VfNiEndpLIeJN78aqgR23nL3y4N0U/91cOAzqfHlF8n2BvoNDcZmJKin3ddNSvOxSr8flw==", + "dev": true, + "requires": { + "flat": "^4.1.0", + "lodash": "^4.17.11", + "yargs": "^12.0.5" + }, + "dependencies": { + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "yargs": { + "version": "12.0.5", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", + "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^1.0.1", + "os-locale": "^3.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^11.1.1" + } + }, + "yargs-parser": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", + "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + } + } +} diff --git a/tests/fetch/package.json b/tests/fetch/package.json new file mode 100644 index 0000000..f8201b2 --- /dev/null +++ b/tests/fetch/package.json @@ -0,0 +1,10 @@ +{ + "scripts": { + "test": "mocha" + }, + "devDependencies": { + "chai": "^4.2.0", + "libsky-fetch": "file:../../lib/skyapi/fetch", + "mocha": "^6.1.3" + } +} diff --git a/tests/fetch/test/fetch.js b/tests/fetch/test/fetch.js new file mode 100644 index 0000000..e770860 --- /dev/null +++ b/tests/fetch/test/fetch.js @@ -0,0 +1,35 @@ +"use strict"; + +let config = require('../../config'); + +let fetchClient = require('libsky-fetch'); +var expect = require('chai').expect; + +const instantiateAPI = function (path) { + let apiConfig = new fetchClient.Configuration(); + return new fetchClient.DefaultApi(apiConfig, path); +}; + +const checkVersion = function (path) { + context(`Getting version from ${path}.`, function() { + it('Should return version object', function() { + let api = instantiateAPI(path); + return api.version().then(result => { + expect(result).to.be.a('object'); + expect(result).to.have.property('data'); + expect(result.data).to.be.a('object'); + expect(result.data).to.have.property('version'); + expect(result.data).to.have.property('commit'); + expect(result.data).to.have.property('branch'); + }); + }); + }); +}; + +describe('#fetchClient', function() { + + this.timeout(10000); + + checkVersion(config.HOST); + +});